Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loop causes internal error #513

Closed
veripoolbot opened this issue May 10, 2012 · 4 comments
Closed

Loop causes internal error #513

veripoolbot opened this issue May 10, 2012 · 4 comments
Assignees
Labels
resolution: fixed Closed; fixed

Comments

@veripoolbot
Copy link
Contributor


Author Name: Jeremy Bennett (@jeremybennett)
Original Redmine Issue: 513 from https://www.veripool.org
Original Date: 2012-05-10
Original Assignee: Wilson Snyder (@wsnyder)


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.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2012-05-10T22:33:44Z


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.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2012-05-11T00:41:33Z


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.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2012-05-16T23:31:49Z


Better error message, fixed in git towards 3.900+.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2012-07-31T22:56:00Z


In 3.840.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution: fixed Closed; fixed
Projects
None yet
Development

No branches or pull requests

2 participants