[an error occurred while processing this directive]
Написал такой ROM,(+)
(«Телесистемы»: Конференция «Языки описания аппаратуры (VHDL и др.))

миниатюрный аудио-видеорекордер mAVR

Отправлено переходящий от AHDL к VHDL 11 ноября 2004 г. 12:47

а он не компилится. Квартусом выдаётся ошибка:
Error: VHDL error at cos_table.vhd(52): object cannot be indexed because it has integer type rather than array type, в строчке где массив индексируется. Что не так?

library ieee,work;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
--use ieee.std_logic_unsigned.all;
--use ieee.std_logic_signed.all;
use work.pack.all;

entity cos_table is
generic
(
width : INTEGER := 2;
depth : INTEGER := 4
);


port
(
clk : in STD_LOGIC;
reset : in STD_LOGIC;
enable : in STD_LOGIC;


addr_cos, addr_sin : in STD_ULOGIC_VECTOR (log2_ceil(depth)-1 downto 0);
q_cos, q_sin : out STD_LOGIC_VECTOR (width-1 downto 0)
);
end cos_table;

architecture first of cos_table is

type rom_array is array (depth-1 downto 0) of STD_LOGIC_VECTOR (width-1 downto 0);

constant table: rom_array :=
(
0 => CONV_STD_LOGIC_VECTOR(1,width),
1 => CONV_STD_LOGIC_VECTOR(0,width),
2 => CONV_STD_LOGIC_VECTOR(-1,width),
3 => CONV_STD_LOGIC_VECTOR(-2,width)
--others => (others => '0')
);

begin

process (clk, reset, enable, addr_cos, addr_sin)

begin

if (reset = '1') then
q_cos <= (others =>'0');
q_sin <= (others =>'0');
elsif rising_edge(clk) then
if (enable = '1') then
q_cos <= table(CONV_INTEGER(addr_cos));
q_sin <= table(CONV_INTEGER(addr_sin));
end if;
end if;

end process;
end first;

Составить ответ  |||  Конференция  |||  Архив

Ответы


Отправка ответа

Имя (обязательно): 
Пароль: 
E-mail: 

Тема (обязательно):
Сообщение:

Ссылка на URL: 
Название ссылки: 

URL изображения: 


Перейти к списку ответов  |||  Конференция  |||  Архив  |||  Главная страница  |||  Содержание  |||  Без кадра

E-mail: info@telesys.ru