2016-04-18 5 views
-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; 

ザイリンクスのツールで、次のVHDLコードのためのあなたの助けを必要とERRORは言う: HDLParsers:3481 - 図書館の仕事は何の単位を持っていません。参照ファイル "xst/work/hdllib.ref"を保存しませんでした。 ご連絡ください

+1

'STD_LOGIC_UNSIGNED'や' STD_LOGIC_ARITH'は使用しないでください。あなたのコードは何も算術演算を実行せず、それがあったとしても、これに 'numeric_std'パッケージを使います。 –

答えて

0

ff(3)<=inp;elseの直後でなければなりません。

3

マリアとscary_jeffは、いくつかのエラーがある部分解を与えている間:

あなたは範囲down toの代わりに、3ヶ所で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; 

は、未使用のシノプシスパッケージがコメントアウトされています。

コードが解析されます。

注:outp(3)への割り当てはありません。

convolutionally encoderあなたのconvolutionally encoderはうまく見えませんが、それだけで私かもしれません。

刺激と期待される結果を提供するテストベンチがなければ、機能性は検証できません。