compiler-construction - VHDL编译器退出错误

标签 compiler-construction compiler-errors vhdl

我正在为BCD_counter创建一个测试台。

当我尝试编译测试平台时,始终出现以下错误:

“错误:.../.../../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;

最佳答案

这行:

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

具有nz而不是(我假设)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是否按预期变化。

关于compiler-construction - VHDL编译器退出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9883237/

相关文章:

java - 为什么缺席返回类型没有编译错误

vhdl - 在 VHDL 中,如何在打开文件之前检查文件是否存在?

vhdl - 查找数组中的最小值的问题

compiler-construction - 是否有使用严格求值的 Haskell 编译器或预处理器?

debugging - Codelite 调试器错误 : Failed to locate gdb! 位于 'gdb' ?

python - 为什么 Python 编译这段代码没有抛出错误?

java - Maven:构建失败

c++ - 当调用 delete[] X 命令时到底发生了什么,谁负责?

c# - 编译器魔法 : Why?

vhdl - CPU 设计中如何考虑 ROM 延迟