I tried to extend the uvm_event class which is a parameterized class, by providing a different data type parameter. Such parameter defines the data type of the message sent during the trigger. I get an error due to incompatible data types on the uvm_event source code.
class reset_event extends uvm_event#(reset_data);
I looked at UVM source code, and seems that we cannot override the default parameter (uvm_object) since uvm_event_base uses the implicit specialization uvm_event_callback#(uvm_object). In the other hand, uvm_event uses a configurable specialization uvm_event_callback#(T) in the trigger() function. Those incompatible variables are being assigned between them, causing elaboration errors.
virtual class uvm_event_base extends uvm_object;
//..
protected uvm_event_callback callbacks[$];
//..
class uvm_event#(type T=uvm_object) extends uvm_event_base;
//..
virtual function void trigger (T data=null);
int skip;
skip=0;
if (callbacks.size()) begin
for (int i=0;i<callbacks.size();i++) begin
uvm_event_callback#(T) tmp=callbacks[i];
Error-[SV-ICA] Illegal class assignment
/p/hdk/rtl/cad/x86-64_linux30/accellera/uvm/1.2/src/base/uvm_event.svh, 305
“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.