What is a possible approach to communicate between 2 sequences so that is 100% sure that the simulation result does not depend on the order in which the simulator (Questa) schedules its processes in a timestep?
To clarify with an example: I have 2 sequences and a communication channel between them (e.g. a mailbox M)
- a source sequence, which will generate sequence items (driver sends these into the DUT). Everytime a sequence item was finished, the sequence checks M to know if it needs to send another sequence item, or if it needs to end.
- a sink sequence: this will collect sequence items (data coming out of the DUT) and knows how many to collect. When it has collected all it needs, it puts a message in M to inform the source that it can stop.
Both drivers (need to) run on the same clock (edge). Assume the timestep where the sink ends and this is also when a source item was handled. see what happens depending on the order in which Questa schedules the processes:
possibility 1:
- source sequence checks mailbox. it is empty → a new sequence item is sent into the DUT
- sink sequence puts message in mailbox
possibility2 :
- sink sequence puts message in mailbox
- source sequence gets this message and ends
Although both simulations can be working, it is really awful to have such kind of non-determinism when debugging.
In my case I have 8 sources, 8 sinks, and all sources can interact with all sinks. So there are 64 possible point to point communications.
The issue I think is that systemVerilog and the available UVM channels do not use an evaluate-update mechanism (~NBA in SV?) like VHDL or systemC does. In systemC I could just have used a TLM_FIFO and as this uses evaluate update there is no race condition. The UVM TLM FIFO’s do not seem to have this mechanism (some extra NBA stuff had to be added for the driver/SQR communication uvm_tlm_fifo - (how) does it guarantee deterministic simulations? | Verification Academy). The mailbox also doesn’t have this.
Just 2 questions:
- did I miss something obvious?
- would it be possible to construct a communication channel around a mailbox that solves this? E.g. to combine a mailbox with some NBA or so?