I have to collect a value(de-whitened value) from a Check_whitening task implemented in the driver and pass it to the monitor.
I have made use of a static variable in the Class Packet to store the value from the task after it is executed in the driver.
When I access the variable in the monitor, it is still 0 since the Check_whitening task has not been executed yet in the driver.
How do I synchronize events between the monitor and the driver.
I don’t want to use analysis port/exports to pass the transaction between monitor and driver.
Wha doing simple things complicated. Using the TLM connection is the most simple approach. Any other approach like passing the data to the config_db requires events to indicate when the vale can be retrieved from the config_db.
Conventionally, I haven’t seen Monitor connected to a Driver by a TLM.
Only Monitor connected to scoreboard or coverage collector.
Is it the correct way?
The UVM does not have compliance rulre, i.e. you can do anything you want to do. In a few of my industrial projects I used this connection to transmit seq_items to the monitor for further processing in coverage collectors etc. Or I was omitting the monitor and connectiong to the analysis port of the driver coverage collectos and scoreboard.
Use of static variables is generally discouraged is software programming. It becomes difficult to scale once you find you need multiple instances of the same environment. As you’ve already discovered, synchronization of reading and writing is also problematic. And reaching into another class created dependancies that don’t scale as you move from unit to block to SoC testing. (i.e. your driver might get removed because another part of the RTL was added).
The class uvm_event#() is probably the simplest mechanism for sending data from one class to another. But if you need any kind of buffering/queuing or other handshaking, the TLM is a better choice. If no synchronization is required, or already handled by the phases, then uvm_config_db is best for that.
In reply to Curious_cat:
The UVM does not have compliance rulre, i.e. you can do anything you want to do. In a few of my industrial projects I used this connection to transmit seq_items to the monitor for further processing in coverage collectors etc. Or I was omitting the monitor and connectiong to the analysis port of the driver coverage collectos and scoreboard.
according to cookbook, driver is only there for driving transaction to pin level activity and other way around for monitor. why you need sync between to independent blocks?