DescriptionQ861
Q861DVNVIDIAASIC interview problem
Share a named UVM configuration event
TechniquesDVSystemVerilogUVMShareA
DifficultyMedium
TopicSystemVerilog and UVM
LanguageSystemVerilog
Requirements4 checkpoints
01
Problem
A producer and consumer are created independently but must rendezvous through the global UVM event pool after configuration is published. Write the two UVM tasks that publish and consume a version number without missing an early trigger.
Class declarationSystemVerilog
class cfg_version_obj extends uvm_object; int unsigned version; endclass
task publish_cfg(int unsigned version);
task wait_cfg(output int unsigned version);Example input and output
Use this case to check your interpretationInput
Start wait_cfg first, then call publish_cfg(7) using the shared global event.Output
wait_cfg returns version = 7.Explanation
Both tasks resolve the same named event, and the trigger data carries the published version object to the waiter.
02
Requirements (4)
- Both tasks obtain the same uvm_event from uvm_event_pool::get_global_pool().get("cfg_done").
- publish_cfg creates cfg_version_obj, fills its version, and triggers the event once with that object.
- wait_cfg uses wait_on so a trigger that happened before the task began is still observed, then reads the stored trigger data.
- The producer never resets the event; only the test resets it between test cases after both tasks finish.
