• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Logic Design
  3. Problem with Simvision hanging in an endless loop

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 64
  • Views 24487
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem with Simvision hanging in an endless loop

Rony Ross
Rony Ross over 15 years ago

I have a problem with Simvision hanging in an endless loop. I encounter this problem from time to time probably since I use a lot of complicated always @(*) blocks. The problem occurs with two blocks that have some dependencies between them. However, it is not a combinatorial loop. I believe that it got something to do with the way that Simvision creates and updates its dependency tree. Usually, some "cosmetic" change, such as taking out a line and changing it to "assign ...", solves the problem. However, it is very difficult to find out which line causes the problem. I tried to reproduce a simple example below. I belive that it can be even simpler.

module endlessloop
(
 output reg c_cld
);

  parameter CREATE_ENDLESS_LOOP = 1; // =0 will not cause the endless loop

reg a;
reg b;
reg c;
reg d;
reg d_cld;

reg clk;
reg rst_l;

initial
begin
  clk = 1'b1;
  rst_l = 1'b0;
  #50 rst_l = 1'b1;
end

always
  #10 clk = ~clk;

always @(posedge clk or negedge rst_l)
begin
  if (~rst_l)
  begin
    c_cld <= 1'b0;
    d_cld <= 1'b0;
  end
  else
  begin
    c_cld <= c;
    d_cld <= ~d_cld;
  end
end

always @(*)
begin
  $display("%d; in 1",$time);
  if (CREATE_ENDLESS_LOOP)
  begin
    a = 1'b0;
    d = 1'b0;
  end

  a = b;
  d = d_cld;
end

always @(*)
begin
  $display("%d; in 2",$time);
  if (CREATE_ENDLESS_LOOP)
  begin
    c = 1'b0;
    b = 1'b0;
  end

  c = a;
  b = d;
end

endmodule // endlessloop

 

  • Cancel
Parents
  • TAM1
    TAM1 over 15 years ago

    The simulator is behaving correctly in this. Your block 'one' has some events which trigger block 'two', which has some events which trigger block 'one' and so on, ad infinitum. To avoid this kind of behavior, many design methodologies don't allow combinatorial blocks to feed back to each other, even if the signals involved are apparently unrelated. Because every signal in a block can be updated when it executes, even if triggered by an event on another signal entirely, you need to be aware that a combinatorial feedback path can be triggered even when you think it would not.

    You can work around this using the command line option "-delay_trigger" on your ncvlog command line. It will wait until the last assignment on a net before determining if the net had an "event" on it.

    PS. I found this information looking a Cadence solution published at: http://support.cadence.com/wps/mypoc/cos?uri=deeplinkmin:ViewSolution;solutionNumber=11594558

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • TAM1
    TAM1 over 15 years ago

    The simulator is behaving correctly in this. Your block 'one' has some events which trigger block 'two', which has some events which trigger block 'one' and so on, ad infinitum. To avoid this kind of behavior, many design methodologies don't allow combinatorial blocks to feed back to each other, even if the signals involved are apparently unrelated. Because every signal in a block can be updated when it executes, even if triggered by an event on another signal entirely, you need to be aware that a combinatorial feedback path can be triggered even when you think it would not.

    You can work around this using the command line option "-delay_trigger" on your ncvlog command line. It will wait until the last assignment on a net before determining if the net had an "event" on it.

    PS. I found this information looking a Cadence solution published at: http://support.cadence.com/wps/mypoc/cos?uri=deeplinkmin:ViewSolution;solutionNumber=11594558

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information