реклама на сайте
подробности

 
 
> как правильно использовать readmemb
Kokos
сообщение Oct 29 2012, 06:29
Сообщение #1


Участник
*

Группа: Свой
Сообщений: 54
Регистрация: 5-11-10
Из: Санкт-Петербург
Пользователь №: 60 667



добрый день. возникла проблема с использованием данной команды:

CODE
reg [15:0] MEM_0 [0:359];
$readmemb("MEM_0.mif", MEM_0);


при моделировании в моделсиме на выходе то что нужно но при компиляции проекта в квартусе возникает следующая ошибка:

Error (10170): Verilog HDL syntax error at MEM_0.mif(1) near text -
Error (12153): Can't elaborate top-level user hierarchy


текст самого файла :

CODE
-- Quartus II generated Memory Initialization File (.mif)

WIDTH=16;
DEPTH=360;

ADDRESS_RADIX=UNS;
DATA_RADIX=BIN;

CONTENT BEGIN
0 : 0000000000010000;
[1..15] : 0000000000000000;
16 : 0000000000001000;
[17..359] : 0000000000000000;
END;


Анализ курент файл применительно к mif файлу дает следующее:

Error (12074): File D:/.../.../MEM_0.mif is not a recognized design file type
Error: Quartus II 64-Bit Analyze Current File was unsuccessful. 1 error, 1 warning
Error: Peak virtual memory: 371 megabytes
Error: Processing ended: Mon Oct 29 09:36:13 2012
Error: Elapsed time: 00:00:00
Error: Total CPU time (on all processors): 00:00:00



в чем проблема?кому не сложно объясните пожалуйста.

Сообщение отредактировал Kokos - Oct 29 2012, 06:31
Go to the top of the page
 
+Quote Post
 
Start new topic
Ответов
Kokos
сообщение Oct 31 2012, 05:57
Сообщение #2


Участник
*

Группа: Свой
Сообщений: 54
Регистрация: 5-11-10
Из: Санкт-Петербург
Пользователь №: 60 667



для примера приведу простую программку с этой проблемой:
read_test
CODE
module read_test ( clk,data_out);

input clk;
output [13:0] data_out;

parameter size = 10;
reg [13:0] read_mem[size-1:0];
reg [13:0] data_out;
reg [9:0] i;




initial
begin
i=0;


$readmemb ("data.mif", read_mem);


end

always@(posedge clk)
begin
data_out<= read_mem[i];
i <= i + 1;
end

endmodule



read_test_tb
CODE
`timescale 1ns/10ps
module read_test_tb;

reg clk;

read_test model(.clk(clk));

initial
begin
clk=0;
end


always
begin
#5000 clk=~clk;
end


endmodule


data.mif
CODE
-- Copyright © 1991-2011 Altera Corporation
-- Your use of Altera Corporation's design tools, logic functions
-- and other software and tools, and its AMPP partner logic
-- functions, and any output files from any of the foregoing
-- (including device programming or simulation files), and any
-- associated documentation or information are expressly subject
-- to the terms and conditions of the Altera Program License
-- Subscription Agreement, Altera MegaCore Function License
-- Agreement, or other applicable license agreement, including,
-- without limitation, that your use is for the sole purpose of
-- programming logic devices manufactured by Altera and sold by
-- Altera or its authorized distributors. Please refer to the
-- applicable agreement for further details.

-- Quartus II generated Memory Initialization File (.mif)

WIDTH=10;
DEPTH=14;

ADDRESS_RADIX=UNS;
DATA_RADIX=BIN;

CONTENT BEGIN
0 : 0000101010;
1 : 0000001111;
2 : 0010101010;
3 : 0000010111;
4 : 0000100011;
5 : 0000010101;
6 : 0000000100;
7 : 0101010011;
8 : 0000000011;
9 : 0000111111;
10 : 0000000011;
11 : 0100101010;
12 : 0000000010;
13 : 0000000110;
END;


проблема та же.ни у кого нет идей?

Сообщение отредактировал Kokos - Oct 31 2012, 06:22
Go to the top of the page
 
+Quote Post
iosifk
сообщение Oct 31 2012, 06:25
Сообщение #3


Гуру
******

Группа: Модераторы
Сообщений: 4 011
Регистрация: 8-09-05
Из: спб
Пользователь №: 8 369



Есть команды синтезируемые, а есть - несинтезируемые.
Симулятор выполняет несинтезируемые команды, а компилятор их не берет. Ну и в чем проблема?
У меня на сайте, в статьях, "Краткий Курс". Раздел описания компонентов, зависимых от производителя. Вообще там есть примеры, в которых показано, как в одном файле сделать два куска текста и для компилятора и для симулятора...
Удачи!


--------------------
www.iosifk.narod.ru
Go to the top of the page
 
+Quote Post

Сообщений в этой теме


Reply to this topicStart new topic
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 1st August 2025 - 21:49
Рейтинг@Mail.ru


Страница сгенерированна за 0.01403 секунд с 7
ELECTRONIX ©2004-2016