In reply to ben@SystemVerilog.us:
Hi Ben,
-
In your code the variable ‘f’ is updated in NBA region whereas the endpoint of sequence ‘seq’ occurs in Observed region.
At T:35 by Observed region the value of ‘f’ would be updated to 0.Event control @(seq) unblocks in loopback from Observed to Active region and the $display() within it executes in Active region.
Hence we observe updated value of 0 for ‘f’. -
In your code variable ‘length’ is assigned preponed value of 0 ( which is same as default value ) so there is no discrepancy here
i.e whether the assignment occurs before or after @(seq) unblocks.
In both cases the value (0) is the same
In my code the void function ‘Length’ is assigned value of 10 in Reactive region whereas @(seq) unblocks in loopback from Observed to Active region.
So some tools show updated value for Length whereas some show the non-updated value of Length.
**As the void function is called in Reactive region the assignment also occurs in Reactive region whereas the seq. endpoint occurs in Observed region.
When do we say that the sequence has ended ? i.e after the assignment is done for ‘Length’ OR before the assignment as soon as ‘c’ is true
**