Hello,

I took a fresh look at the problem of spurious
failures with 64-bit Mentor Modelsim 6.2g, where the
example up-counter tests would pass/fail at random. 
In contrast, the same tests would always pass with all
other supported simulators.

By adding a zero-delay null statement at the beginning
of the edge-triggered always block, the problem goes
away and the tests always pass:

  always @(posedge clock) begin
    #0; // zero-delay null statement

    /* rest of the code */
  end

I think the problem is that the cbAfterDelay callback
does not always take you to the top of a time-step
(before any events in that time-step are executed) in
Modelsim.  Instead, it seems that the callback
sometimes takes you to the middle of a time-step
(after some events in the time-step have been
executed).

Any ideas?  Or is the hack of adding the zero-delay
null statement acceptable as a work-around?

Thanks for your consideration.

Reply via email to