In SystemVerilog simulation, events are processed through distinct regions (active, reactive, observed, postponed) within each time unit, and feedback loops can cause assignments to execute across multiple regions within the same time slot, demonstrating how non-blocking assignments in clocking blocks trigger events that loop back to the active region to complete the assignment.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
Course : Systemverilog Verification 6 : L9.2 : Simulation Regions Example 2
Added:now you have seen what is happening at time zero nanosecond so now let's see what will happen at one nanosecond two nanosecond and so on so this this state of your uh all blocks at same time zero nanosecond um and um there is no uh observed region event or there is there are no uh reimbur region events in this zero nanosecond time unit and next is at one nanosecond at one nanosecond pre-pawn region the value of signal clock will be equal to zero and tb of code will be equal to zero because they were already got updated in zero nanosecond and those files will be available at this beginning and as you can see that there are no other events happening at one nanosecond because um this forever is saying uh waiting for fight five time units and there are no other time related events in either this initial block or this initial block therefore nothing will happen at one nanosecond this will be the state of all uh variables and again at two nanosecond at three nanoseconds at four nanoseconds the same thing will happen but at five nanosecond um as you can see and uh next event was scheduled for five nanosecond which was toggling of this clock signal so let's see what will happen at five nanosecond so at five nanosecond again uh these are the initial state at free point region clock will be equal to zero tb code is equal to zero and this uh op code as the tb of code and um interface data rx again and um if you come here this execution was at at this point uh this initially begin it was stuck at this point and um this initial begin we was stuck in this point now let's see what are the statements i think to execute at five nanoseconds obviously this need to be executed and this is a blocking assignment therefore definitely this is going to be scheduled into the active region and let's see if some other active region events will be scheduled here so you can see that um you can probably think that there is going to be one more active region scheduling that is to execute the right hand side of this assignment if you have code uh nb assignment equal to one so let's see whether this will happen or not so before that there was a design module that we already discussed and there was an always work within this design module so we will see this block as well um so we have got only three blocks uh in the world three set of our old modules and um interfaces there are two initial works in this test bench and one always broken this design and let's see what happens that uh this always broke so this always block is sensitive to the positive edge of clock this is a direct waiting for a positive jeff club so as you can see that clock was already executed our clock is already assigned with one so clock is changing from zero to one in the active region so this is a trigger event for clock so when this is happening it will trigger it will trigger an event for executing these case statement because this is already satisfied in the active region and so it will come the execution will come and check the interface dot upward value and it will assign and it will go into here but the interface dot op code value is already x here and it is not x uh getting updated so it need to be updated uh it will be updated only in the rnb region because as you know this interface dot output value will be is updated through a clocking block event so at this point when this always at positive clock was untriggered dot opcode values again x here and therefore none of these uh statements will be executed and this interface data will be still equal to x at this point and coming to the nba region and let's see if there are this there are some other nba assignments in this region so you can see we already discussed that this is not going to happen because this is not going to satisfy this case statement for 0 1 2 or 3 values but let's see if this interface in the tb code this particular line that is tb of code dot the tbr code is assigned with a non-blocking assignment with the value one so you might think that this this will happen here but uh actually this is not going to happen at this point of time so we are now from three point region active region reactive region and nba region of five nanoseconds and the first titration but and you can see that this code that is this is saying to wait for a clocking event trigger that is interface dot clocking event uh clocking block need to be triggered here so the triggering the condition for the clocking block is a positive adjust clock that was already satisfied in the active region but this triggering will not happen in the active region as we have already discussed any clocking block will be get triggered only in the observed region therefore this uh this rate this weight will be getting satisfied this will be getting triggered only in the observed region and thus this um tb record uh assignment with fun nba assignment with one will not happen at this point in time but when this is triggered when uh so when it will come to observe region and it will be triggered this interface dot um in interface dot uh clocking will be getting triggered so when it is getting triggered this next line is unblocked and what you can see is next is an nbsm non-blocking assignment so what will effectively happen is uh this need this need to be executed in the same time unit because it is an npa assignment but this nba assignment is not going to happen here in the reactive region because this is lying in a in a module that is a nba is lying in a module it's not in a program primitive therefore this will trigger a loop back to the active region but as you know as we are already in the observed region uh the only way to trigger back uh loop from the third region direct to this active region is an expect statement so if if otherwise what will happen is it will go through the reactive region portion and after completing the reactive region it will go back to the active region this final loop will be happening thus when this line is executed it will schedule an event back to this active region this uh same time slot but before that it will go through this reactive region set so again there is nothing happening in the reactive set and and the reactive is also md but the ray nba need to be uh done here because it is saying the interface dot um clocking block dot op code is equal to one so uh this clocking block op code need to be driven with new value one because the clocking block was already triggered here this interface dot upward will be getting updated to one and the event what was scheduled this event that is the assignment of this nba will be scheduling and it will go back to the active region again so in the active region it it will evaluate this particular length so initially it will evaluate the rhs of this nb assignment in the active regions active region set active region so there is nothing to evaluate it will come to the reactive rigid there is not nothing to evaluate and again it will come back to nba region so here the actual assignment of um one to this tb output will be happening uh in the that is lhs will be assigned with this updated value so as you can see that this is the first set of again this is again the same time unit five nanosecond so this is how it is coming so this is a flow it is com coming from this point it is executing and uh this nba is not happening here clocking block get triggered uh since closing block is triggered this need to be executed so and even will be scheduled here but since it's already in the upside region this is going to happen only after passing through the reactive region set so in the reactivity game set this assignment will happen uh and after that it will go back to this active region that loop will happen and uh this will be evaluated and this rhs will be evaluated and active and the nba lhs will be assigned with the active value finally when it is coming so again it will come back to the observation there is nothing and reactive nothing um remain i think and finally it will go back to the postponed region so this loop is happening in this time slot and finally when it is coming after the postponed region this signal values will be at five and a second clock will be equal to one tb of code will be equal to one uh opcode will be equal to one and uh your um data is still x because uh it it while exec while this code was executed the opcode was not updated and therefore the data will be still equal to x to make this point more clear for you i am just doing a simulation directly so i will be simulating this program with some display statement so as i have already explained when the first loop this db of code will not be executed and it will be executed only after a loop that is only after triggering the clocking block so let's see how we can show this in a simulation here i am simulating the same pro same set of program the time scale is one nanosecond per minute a second this is interface the same clocking block is used here and this is the module design and this is a test bench so the only difference uh in this code is i've added two extra display statement after the first clocking block weight so as we were we were discussing at this point so this is the point we will come to the five nanosecond execution point so i've added two statement one is a dollar display statement so i'm saying this is initial block uh display at times this time tb of code will be equal to what value and again i'm using a strobe also so as you know that the display statement dollar display is executing and executed in the active region and dollar store will be executed in the um in the postponed region so again in order to make this more clear for you i've added up one more always statement just to make just to print some more additional information so uh before printing this always block let's see what is the output of this code we are just interested in these two display statements so you can see that so the display statement uh initial block display so first one is will be displayed uh the dollar display will be executed at five nanoseconds so as i have already explained tbr will be equal to 0 because this is where um it is coming into the active region so when coming into the active region tbr code is definitely going to be 0 because even without any effect this is a this is an nb assignment so this when when coming into active region this is or in all all conditions it should be equal to zero and finally when going after five nanosecond the strobe size of tv of code is equal to 1 but this doesn't says anything about the loop so we just we are just interested in the loop scenario so what i've done here is i've added one more always block and this always block is sensitive to the tb of code same variable itself it's not sensitive to the clock signal so whenever the tb of code is getting changed you will get a display message and stop message um the strobe is definitely not going to have any effect here because this is going to print the final values in the time region so this straw will give exact same result as of this stroke but let's just keep it there but let's see what will happen about this display so i'm running this and note that there are there is a difference in this message it's it says initial and in the always it says always so uh this always is saying always a tv of course whenever there you upgrade changes it will be printed displayed so ignore the first two and we are interested in whatever is printing at five nanosecond so at five so this is the order in which they got displayed so note that the order initial block so first one was called in the initial block display it ended it is saying tb output is equal to zero so this is exactly what we are expecting uh the dollar display will be uh executed with the initial um value of zero and after that you can see that the always block display will be called so this is calling because the tb of code is getting changed here as i said earlier after this tb of code is giving again getting changed in the same five nanosecond through a feedback loop and at that time it is printing uh always blocked or display block tb of code is equal to one and after this always block and initial box stops will be executed they can come in any order uh because they are two independent blokes but both of them will say uh give the the postponed value of tb of code which will be definitely equal to one so so just by looking at these four messages at five nanoseconds hope you will be more clear about the execution so as i described earlier there was a feedback loop from the reactive region back to the active region because of this cloaking block and its nba assignments and in the next video you are going to see how again this simulation is advanced and see what will happen in the next few time slots
Related Videos
LBF101 Creating an XML Changelog
liquibase7511
3K views•2026-06-15
Alta Labs Cloud Dashboard Real time Network & Xnet Insights!
ShinyTechThings
158 views•2026-06-17
Wait... Group Policy Not Applying? Check This First!
keeplearning_iT
144 views•2026-06-15
Leetcode Weekly Contest 506 | Life's boring these days
Pudeesht
2K views•2026-06-14
microJAM: MAKING A MICRO GAME FOR A GAME JAM IN CLOJURESCRIPT AND TOTALLY NOT C
janetacarr
156 views•2026-06-18
Partitioning vs Bucketing vs Clustering: How to Make Queries 100x Faster
thedataandaiguy
194 views•2026-06-16
Design Claude Code Like a Senior Engineer
hayk.simonyan
344 views•2026-06-19
Linus Torvalds: AI Won’t Replace Understanding Code
SavvyNik
140 views•2026-06-19











