• 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
  • Rony Ross
    Rony Ross over 15 years ago
    Thank you for the reply.
    Unfortunately, I don't have access for the link of the Cadence solution. For some reason I couldn't find this flag in my Cadence help. However, it solves the problem with the example that I gave. Now it raises few more questions...

        1. What else does this flag do? Would it have any other effect on my simulation?
        2. Why is it an ncvlog flag and not an ncsim?
        3. Although it is a correct behavior, one could expect the following:
            1. A Lint warning
            2. That the simulator won't hang. It should exit with a warning that it encountered an infinite loop involving the following blocks …
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Rony Ross
    Rony Ross over 15 years ago
    Thank you for the reply.
    Unfortunately, I don't have access for the link of the Cadence solution. For some reason I couldn't find this flag in my Cadence help. However, it solves the problem with the example that I gave. Now it raises few more questions...

        1. What else does this flag do? Would it have any other effect on my simulation?
        2. Why is it an ncvlog flag and not an ncsim?
        3. Although it is a correct behavior, one could expect the following:
            1. A Lint warning
            2. That the simulator won't hang. It should exit with a warning that it encountered an infinite loop involving the following blocks …
    • 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