library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity conv_enc is
Port ( clk : in STD_LOGIC;
rst : in STD_LOGIC;
inp : in STD_LOGIC;
outp : out STD_LOGIC_VECTOR(3 DOWN TO 0));
end conv_enc;
architecture Behavioral of conv_enc is
begin
process
variable ff:std_logic_vector(3 down to 0);
begin
wait until rising_edge (clk)
if rst='1' then
ff<="0000";
else
for i in 2 down to 0 loop
ff(i)<=ff(i+1);
end loop;
ff(3)<=inp;
end if;
end process;
outp(0) <= inp xor ff(1) xor ff(0) ;
outp(1) <= inp xor ff(3) xor ff(2) xor ff(1) ;
outp(2) <= inp xor ff(3) xor ff(2) xor ff(1) xor ff(0);
end Behavioral;
错误说:HDLParsers:3481 - 图书馆工作没有单位 . 没有保存参考文件“xst / work / hdllib.ref” . 请帮忙
2 回答
虽然Maria和scary_jeff给出了部分解决方案,但有几个错误:
以下是你的代码纠正这些,特别是使ff成为一个信号:
请注意,未使用的Synopsys软件包已注释掉 .
然后你的代码分析 .
注意,outp(3)没有赋值 .
你的convolutionally encoder看起来不太合适,但那可能就是我 .
如果没有提供刺激和预期结果的测试平台,则无法验证功能 .
ff(3)<=inp;
必须在else
之后 .