首页 文章

在Xilinx工具中需要您对以下vhdl代码的帮助

提问于
浏览
-1
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 回答

  • 3

    虽然Maria和scary_jeff给出了部分解决方案,但有几个错误:

    你在三个地方宣布了一个范围,而不是downto . 你错过了一个分号,在这个过程中终止了wait语句 . 您尝试读取进程外部的变量(在其范围之外) .

    以下是你的代码纠正这些,特别是使ff成为一个信号:

    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 downto 0) -- WAS DOWN TO
        );
    end entity conv_enc;
    
    architecture behavioral of conv_enc is
         signal ff:   std_logic_vector(3 downto 0); -- variable used outside process
    begin
        process
            -- variable ff:   std_logic_vector(3 downto 0);  --  was down to
        begin
            wait until rising_edge (clk);  -- was miaaing terminating semicolon
            if rst = '1' then
                ff <= "0000";
            else
                for i in 2 downto 0 loop   -- was down to
                    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 architecture behavioral;
    

    请注意,未使用的Synopsys软件包已注释掉 .

    然后你的代码分析 .

    注意,outp(3)没有赋值 .

    你的convolutionally encoder看起来不太合适,但那可能就是我 .

    如果没有提供刺激和预期结果的测试平台,则无法验证功能 .

  • 0

    ff(3)<=inp; 必须在 else 之后 .

相关问题