Passing no uvm_object data through uvm_event

Hello,

I’m trying to send specific data (typedef struct) when a uvm_event is triggered using the wait_ptrigger_data I have got the following compilation error
“automatic uvm_event_callback tmp = this.callbacks[i];”
Expression ‘this.callbacks[i]’ on rhs is not a class or a compatible class
and hence cannot be assigned to a class handle on lhs.
Please make sure that the lhs and rhs expressions are compatible.

in the uvm-1.2 code the wait_ptrigger_data method is defined as:

	virtual task wait_ptrigger_data (output T data);
		wait_ptrigger();
		data = get_trigger_data();
	endtask

this allows to use user-defined types and there is no restriction to uvm_object class type.

the event is used without uvm_event_pool which is clearly defined with restriction to uvm_object as:

typedef uvm_object_string_pool #(uvm_event#(uvm_object)) uvm_event_pool;

the origin of the issue is the callbacks defined and used in uvm_event.svh file:

	
protected uvm_event_callback  callbacks[$];

uvm_event_callback is defined as:

virtual class uvm_event_callback#(type T=uvm_object) extends uvm_object;

the callbacks is defined as type of uvm_event_callback without specialization so the default type = uvm_object is used, so the compatibility issue appeared.

Is there someone faced similar issue and has a workaround to it?

In reply to Mohamed_TN:

I was facing same error with struct/user defined types. As a workaround, I wrapped up the struct variable in an extended uvm_object class and used that class in uvm_event.

In reply to sharvil111:

Thanks sharvil111, I think this is the only solution to this limitation.