• 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. Functional Verification
  3. $display() is executed immediately after simulation start...

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 66
  • Views 4496
  • 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

$display() is executed immediately after simulation start although the condition in always statement (under which $display() resides) is not satisfied

alexek
alexek over 1 year ago

Hello!

I'm testing a small design of my own and I stumbled upon something I can't understand. When I hit 'run', I see immediately "Hello!" printed. Here is part of my testmodule:

initial begin

  init_done=0;

  .

  <some other signals inits go here>

  .

  <some delays goes here>

  init_done=1;

end

.

.

.

always @(negedge sig1) begin

    if (init_done) begin

       $display("Hello!");

       test_done <= 1;

    end

end

sig1 is raised for a couple of clocks when the DUT finishes its job. test_done is probed on each clock and when it is high, $finish() is issued.

So there are actually 2 questions here I can't answer:

1. Why always block executed without its condition being satisfied? I mean, if $display() is executed, it should mean that both negedge sig1 and init_done were satisfied?

2. Assuming always block was indeed executed, why test_done variable wasn't affected? 

I'm aware of the "Events in Sequence Time" concept but I'd expect these to happen after "solid" init - starting from time 0, and not during init itself. Anyway, it does not describe the test_done being unaffected....

Would be glad for any help!

  • Cancel
Parents
  • alexek
    alexek over 1 year ago

    It was my bad. I mixed up one code with another. I think this post can be safely deleted.

    Sorry for that.

    Alexei

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • alexek
    alexek over 1 year ago

    It was my bad. I mixed up one code with another. I think this post can be safely deleted.

    Sorry for that.

    Alexei

    • 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