[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  BugVise
  CovVise
  Force-Gate-Sim
  Gspice
  IPC::Locker
  Rsvn
  SVN::S4
  SystemPerl
  Voneline
  WFH
General Info
  Papers

Issue #513

Loop causes internal error

Added by Jeremy Bennett about 1 year ago. Updated 11 months ago.

Status:ClosedStart date:05/10/2012
Priority:NormalDue date:
Assignee:Wilson Snyder% Done:

0%

Category:TranslationError
Target version:-

Description

The following code has a loop dependency between the first two always blocks. It should execute to completion on the first positive clock edge.

module t (clk);
   input clk;
   reg      ready;

   initial begin
      ready = 1'b0;
   end

   always @(posedge ready) begin
      if ((ready === 1'b1)) begin
     $write("*-* All Finished *-*\n");
     $finish;
      end
   end

   always @(posedge ready) begin
      if ((ready === 1'b0)) begin
         ready = 1'b1 ;
      end
   end

   always @(posedge clk) begin
      ready = 1'b1;
   end
endmodule
This works fine on Icarus Verilog, but on Verilator fails to compile, with the error:
%Error: Internal Error: ../V3GraphAcyc.cpp:343: Non-cutable edge forms a loop   VERTEX=0x8bd71c0\n ALWAYS

(The example is meaningless, but was obtained by cutting down a 1100 line proprietary code where the error occurred).

Please pull the testcase from https://github.com/jeremybennett/verilator/tree/loop-crash.

History

#1 Updated by Wilson Snyder about 1 year ago

I'm not sure how to best report this error, as the code requires an event driven simulator. Perhaps as a multidriven non-blocking error. Or just change the uncuttable to a more obvious filename/line number pointer.

#2 Updated by Wilson Snyder about 1 year ago

These would have gotten a BLKSEQ warning, but BLKSEQ is a lint-style-only warning.

Looks like the loop detection logic is the only place that sees the complicated picture, so it will need to print an example path out by calling loopsVertexCb.

#3 Updated by Wilson Snyder about 1 year ago

  • Category set to TranslationError
  • Status changed from New to Resolved
  • Assignee set to Wilson Snyder

Better error message, fixed in git towards 3.900+.

#4 Updated by Wilson Snyder 11 months ago

  • Status changed from Resolved to Closed

In 3.840.

Also available in: Atom PDF