다음 코드는 Altera ModelSim에서 하나의 메모리 ROM을 테스트하는 데 사용됩니다.ModelSIM ALTERA 오류
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.numeric_std_unsigned.all;
ENTITY hex_vhdl_vhd_vec_tst IS
END hex_vhdl_vhd_vec_tst;
ARCHITECTURE hex_vhdl_arch OF hex_vhdl_vhd_vec_tst IS
-- constants
-- signals
SIGNAL t_sig_address : STD_LOGIC_VECTOR(10 DOWNTO 0);
SIGNAL t_sig_clock : STD_LOGIC;
SIGNAL t_sig_q : STD_LOGIC_VECTOR(7 DOWNTO 0);
COMPONENT hex_vhdl
PORT(
address : IN STD_LOGIC_VECTOR(10 DOWNTO 0);
clock : IN STD_LOGIC;
q : OUT STD_LOGIC_VECTOR(7 DOWNTO 0)
);
END COMPONENT;
BEGIN
tb : hex_vhdl
PORT MAP(
-- list connections between master ports and signals
address => t_sig_address,
clock => t_sig_clock,
q => t_sig_q
);
TEST: PROCESS
variable L : natural;
begin
--clock
for L in 0 to 2048 loop
t_sig_clock <= '0';
WAIT FOR 25 ns;
t_sig_clock <= '1';
WAIT FOR 25 ns;
t_sig_address <= std_logic_vector(to_unsigned(L, 11));
end loop;
t_sig_clock <= '0';
wait;
END PROCESS TEST;
END hex_vhdl_arch;
PROCESS 부분의 코드는 저의 것으로 디자인되었습니다.
나는 각 비트 주소에 대한 PROCESS했습니다, 전 단계로 더 많은 주소 변경 단계 ...
를 사용하지 유혹하고있다.
컴파일되지 않습니다 유일한 라인
t_sig_address <= std_logic_vector(to_unsigned(L, 11));
# ** Error: hex_vhdl.vht(70): (vcom-1136) Unknown identifier "to_unsigned".
그래서 내가 처음
USE ieee.numeric_std_unsigned.all;
그러나에 다음 줄을 추가하고, 내가 만든 다음 오류
# ** Error: (vcom-11) Could not find ieee.numeric_std_unsigned.
# ** Error: hex_vhdl.vht(30): (vcom-1195) Cannot find expanded name "ieee.numeric_std_unsigned".
# ** Error: hex_vhdl.vht(30): Unknown expanded name.
시작 이러한 단서들과 함께, 링크에서 찾은 내용은
입니다.Convert Integer to std_logic_vector in VHDL
일하지 왜 모르겠어요!
이 라이브러리는 quartus II에서 제대로 작동하지만 ModelSim에서는 작동하지 않는 것 같습니다.
누군가 나를 도와 줄 수 있습니까? :)
또한 변수 'L'이 사용되지 않습니다. 린트 보고서 : http://www.sigasi.com/vhdl-code-check?ID=28031531 – Philippe
그래,이게 분명해 보인다. 왜냐하면 3 번째 줄에 올바른 라이브러리 선언이 없다면, 42 번 라인이 잘못되었다 ... 34 번 라인에 선언 된 변수 L은 결코 사용되지 않을 것이다 !!! 단순한. – songa