I want using uvm_event with argument to pass data between 2 agents.
the argument i need to pass is of uvm_sequence_item type.
i see that the argument should be uvm_object.
does it enough that um_sequence_item is inheritance uvm_object?
now i get an error that i’m not use uvm_object.
my seq_item is with arguments.
what is the best way to resolve it?
Since uvm_sequence_item inherits from uvm_object, try using the dynamic casting:
$cast(dst_var, src_var) task/function.
To downcast the uvm_object to your uvm_sequence_item.
Like in the example below:
event_e.wait_trigger_data(rx_data_uvm_object);
if !($cast(rx_data_uvm_seqeunce_item, rx_data_uvm_object))
`uvm_fatal(get_name(),"downcast failed!")
The answer depends on which version of UVM is in use. In UVM 1.1d or earlier, the “data” argument written must be an object derived from uvm_object. You must retrieve the object into a uvm_object variable, then `$cast it back to your sequence item.
Starting with UVM 1.2, the type of the data argument is parameterized so you can avoid the downcasting.
I get an error:
Error-[MFNF] Member not found
…/verification//env/tsp_ref_model.sv, 102
“this.xy2spi_item_e.”
Could not find member ‘trigger’ in class ‘uvm_object_string_pool’, at
“/tools/Synopsys/vcs/U-2023.03-SP1//etc/uvm-1.2/base/uvm_pool.svh”, 248.
uvm_event_pool is not parameterized, it is specialized to uvm_event#(uvm_object) get_global("key") returns a handle to a uvm_event not the uvm_event_pool.