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; . . 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!
↧