is there a UVM way to pass information from a monitor to a sequence running on a sequencer
inside of the same agent?
I was thinking about adding a “uvm_analysis_export” to my sequencer and connecting it to
a “uvm_analysis_port” of my monitor.
But I’ve seen an implementation which is using a uvm_event in order to get the transaction
from the monitor into a sequence.
So my question is which way should I go from here?
What is the difference between a uvm_analysis_port implementation in opposite to a
uvm_event based implementation?
Here is the code for the monitor
// Allows the sequencer to look at monitored data for responses
uvm_blocking_peek_imp#(rb_seq_item, rb_mntr) addr_trans_export;
// You need to implement this peek method to pass information from the monitor to a sequence of an agent
task rb_mntr::peek(output rb_seq_item trans);
//@trans_addr_grabbed;
trans_addr_grabbed.wait_trigger();
`uvm_info(“RB_MNTR_EVENT_WATCHER”, $psprintf("Starting wait_trigger : %m "), UVM_DEBUG);
trans = rb_item;
endtask : peek
Can someone help me with this one? I’m trying to do the sugestion of liuchao but I’m only passing the transaction directly from the monitor to the sequence, without using any other component.
This is what I did:
// In monitor class
uvm_analysis_export #(packet) to_fifo;
uvm_tlm_analysis_fifo #(packet) item_collected_fifo;
// In build_phase
to_fifo = new("to_fifo", this);
uvm_tlm_analysis_fifo #(packet) item_collected_fifo;
// In connect phase
to_fifo.connect(item_collected_fifo.analysis_export);
// In run_phase
item_collected_fifo.write(spi_tr);
// In sequence class
uvm_tlm_analysis_fifo #(packet) item_collected_fifo;
// In test class
// In connect phase
seq.item_collected_fifo = env.sentEnv.e_agent.sent_mon.item_collected_fifo;
It is compiling but I’m not getting the data. Actually I tried to do the item_collected_port.size in the monitor to see if the size increments after doing the to_fifo.write(spi_tr), but it remains 0.
What’s the problem with this one?
Looks a little bit confusing.
What is the reason of the analysis export in the monitor?
The sequence is atransient object it will be created at any time and disappears when it has been executed.
I don’t think this is the good way to send data from monitor to sequence. However, it seems your approach will work. In fact, you collect the transactions to analysis fifo in monitor and your sequence will refer this fifo (points the object to monitor). Your problem happened maybe because of the timing.
Please check again your sequence to make sure it will not be finished before the transactiom is captured in your monitor.
Your sequence sends trans to driver to drive dut signals. It will be finished as soon as the transaction is being drived completely in driver.
It will take time for your monitor to capture the transaction in interface signals after transaction is being drived in driver.