[an error occurred while processing this directive]
|
На странице по ссылке всё доходчиво объясняется.
Package std_logic_arith is a proprietary stopgap developed by SYNOPSYS before the IEEE packages became available. It should not be used for new designs any longer now that there is an official IEEE standard. std_logic_arith - насколько я понял теперь лучше это не использовать.
Теперь компилирующийся вариант выглядит так:
(но возникла новая проблема - не используется внутренняя память, но триггеры :( )
library ieee,work;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use work.pack.all;
entity cos_table is
generic
(
width : INTEGER := 2;
depth : INTEGER := 256
);
port
(
clk : in STD_LOGIC;
reset : in STD_LOGIC;
enable : in STD_LOGIC;
addr_cos, addr_sin : in STD_LOGIC_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 integer;
constant table: rom_array :=
(
0 => 1,
1 => 0,
2 => -1,
3 => -2,
others => -2
);
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 <= STD_LOGIC_VECTOR(TO_UNSIGNED(table(TO_INTEGER(UNSIGNED(addr_cos))),width));
q_sin <= STD_LOGIC_VECTOR(TO_UNSIGNED(table(TO_INTEGER(UNSIGNED(addr_sin))),width));
end if;
end if;
end process;
end first;
E-mail: info@telesys.ru