How important is it to have clocking blocks?
I have gone through lot of info about clocking blocks. Still not clear, when to have them?
Is i/p and o/p skew specified depends on the design?
What values to mention, if i dont have any specific values?
I read somewhere that, monitor must have clocking block? How about driver?
In above monitor sampling:
@(posedge ram_vif.monitor_cb);
seq_item_collected.rd_data = ram_vif.rd_data;
If i do:
@(posedge ram_vif.monitor_cb);
seq_item_collected.rd_data = ram_vif.monitor_cb.rd_data;
I dont get expected data. ram_vif.rd_data works fine. Any reason?
This is the case with many other modules too.
Not sure, if i am missing something. Please clarify.
Two things only:
(1) clocking blocks are an automatic mean to avoid races between testbench and DUT. I consider this as an option.
(2) When using a clocking block you are süecifying ind the clocking block definition the sampling event. Synchronizing on the clocking block does not need a posedge/hegedge. It is simply
On Sampling signal "a" high on posedge of clock , the State Machine would enter State HIGH_A ( from lets say a Default State ) and drive Output Signal OPA High .
Now this OPA signal could either be Driven through Blocking Assignment ( i.e Combinationally Driven ) or through Non-Blocking Assignment ( i.e Sequentially Driven )
Now my Monitor also Samples signals on posedge of clk . I want to check inside Monitor whether Signal OPA is High or Not ( Error Condition ) on entering State HIGH_A
(a) Am I correct in believing there is a potential race condition between OPA being Driven ( either through Blocking or Non-Blocking Assignment ) and the Monitor Sampling OPA on observing signal “a” high on posedge of clock ?
(b) How could Clocking Blocks be helpful in Sampling OPA correctly ? There is always a possibility that signal a goes low before next posedge of clock , so DUT has entered State HIGH_A and if monitor missed out sampling a High on posedge of clock , it would be left back
(c) One Possibility I see is through #0 input skews which Sample Values in Observed Regions .
But I have read its not a recommended approach although I don’t understand why so ? . It certainly would help my monitor in Sampling Correct Value of OPA Signal in this case