Zero delay loop

10,297
  1. Why Zero delay loop happened?

    Due to race condition or ambiguous coding style zero delay loop may get generated which results in simulation hung or infinite simulation time

  2. What are the causes of Zero delay loop?

    One example of a common loop behaviour as follows:

    always @ (x)
    begin
      y = 1'b0;
      ...
      case (x)
        ...
        1'b1: y = 1'b1;
        ...
      endcase
    end
    
    always @ (y)
    begin
      x = 1'b0;
      ...
      case (y)
        ...
        1'b1: x = 1'b1;
        ...
      endcase
    end
    

Here in this there is a possibility of loop when both x and y are set to 1, which causes new event and trigger case statements called zero delay loop because of event triggering at same time, to avoid use #0 delay which forces event to happen at the end of the time step, but this type of coding style is not recommended

  1. To debug this issue

From my understanding vcs has a switch called +vcs+loopreport which will generate a detailed report of zero delay loop and genrerate a text file, from that you can either eliminate or debug those loops effectively

Share:
10,297
Santhosh Kumar
Author by

Santhosh Kumar

Updated on June 14, 2022

Comments

  • Santhosh Kumar
    Santhosh Kumar almost 2 years

    When we are run the design, we are getting the "Zero Delay loop" issue. What is the meaning of "Zero Delay loop" and

    1. Why this issue will present.
    2. What are the causes for zero delay loop.

    The simulator is continuously running and it's not finished.

  • user1978273
    user1978273 about 6 years
    Do you know the filename that is generated?