2012-03-27 52 views
0

我正在爲BCD_counter創建一個測試平臺。VHDL編譯器退出錯誤

當我嘗試編譯測試臺,我一直得到讀取錯誤:

「錯誤:.../.../../Test_UpDownCounter.vhdl(38):VHDL編譯器退出。 「

這是我得到的唯一錯誤,第38行是我的代碼的最後一行。我想知道可能是什麼問題?

這是我的代碼,任何幫助將不勝感激。

entity test_BCD is 
    end entity test_BCD; 

    architecture test of test_BCD is 
    signal t_clk, t_direction, t_init, t_enable: bit; 
    signal t_q : integer; 

    component UpDownCounter is 
      port(clk, direction, init, enable: in bit; 
       q_out: out integer); 
    end component; 

    begin 
     my_design: UpDownCounter port map (t_enable, t_q, t_clk, t_direction, t_init, t_enable); 


     clk_gen: process 
      constant High_time : Time :=5 ns; 
      constant Low_time : Time := 5 ns; 
     begin 
      wait for High_time; 
      t_clk <= '1'; 
      wait for Low_time; 
      t_clk <= '0'; 
     end process clk_gen; 


     -- Initialization process (code that executes only once). 
     init: process 
     begin 
      -- enable signal 
      t_enable <= '1', '0' after 100 ns, '1' after 200 ns; 
      t_direction <= '1', '0' after 50 ns, '1' after 100 ns, '0' after 150 ns; 
      t_init <= '0', '1' after 20 ns, '0' after 30 nz, '1' after 150 ns; 
      wait; 
     end process init; 
end architecture test; 

回答

2

這條線:

t_init <= '0', '1' after 20 ns, '0' after 30 nz, '1' after 150 ns; 

具有nz而不是(I假設)ns作爲時間單位。我的編譯器立即告訴我:

** Error: test1.vhd(34): (vcom-1136) Unknown identifier "nz". 

我會用任何編譯器提出一個錯誤報告,以產生更好的錯誤消息!


雖然我在這裏:

你的UpDownCounter實例看起來錯誤 - 你的信號看起來是在一個不同的順序你使用的組件聲明。


而在此:

clk_gen: process 
     constant High_time : Time :=5 ns; 
     constant Low_time : Time := 5 ns; 
    begin 
     wait for High_time; 
     t_clk <= '1'; 
     wait for Low_time; 
     t_clk <= '0'; 
    end process clk_gen; 

您的標籤High_timeLow_time又回到了前面 - 嘗試改變其中的一個,看看高或低的變化IME是否符合預期。