2012-11-01 105 views
0

我正在使用以下代码。迭代次数限制达到10000

`timescale 1ns/1ps 
module program_counter 
    (
    input  clock, 
    input  reset, 
    input [31:0]  in, 
    output reg [31:0] out 
    ); 
     initial 
      begin 
       out <= 32'b00000000000000000000000000000001; 
      end 
    always @(negedge clock) 
     begin 
      if(reset) 
       begin 
        out <= 32'b00000000000000000000000000000001; 
       end 
      else 
       begin 
        out <= in; 
       end 
     end 
endmodule 

它显示错误,如图

"ERROR: at 0 ps: Iteration limit 10000 is reached. Possible zero delay oscillation detected where simulation can not advance in time because signals can not resolve to a stable value in File "C:/dewesh/latest_bkup/Program_counter.v" Line 12. Please correct this code in order to advance past the current simulation time."

我无法找到是什么问题。

+0

'32'b00000000000000000000000000000001;'与'32'b1相同;' – Morgan

+0

32'h ****对您而言较短。如果你想要变化,把它分配为1,32位适合int。 – Khanh

回答

0

问题是第一行最初是延迟。这应该在时间0.驱动。尝试延迟初始(#1)。

您还希望在一个模块中混合可合成和不可合成的代码。这可能不是你想要的。

摆脱这个模块的初始块,并通过一个具有时间尺度的实验台来实例化该模块,该模块具有适当的延迟时间并驱动该模块的输入。