Override by sequence type changes handle type everywhere whereever it is declared in driver even if it is parameterized or how?

I have one sequence item which is overriden by another sequence item.
now I have overwrite first sequence item with the second sequence item using type override.now I have the driver code as follows. driver code is declared using first sequence item.snippet is as follows. in following code there are 3 places .which place exactly this type overwriting happens.Could you please clarify

class uvm_driver_e  extends uvm_driver #(first_seq_item);// first place
 
first_seq_item handle; //second place

task run_phase(uvm_phase phase);

............
seq_item_port.get_next_item(handle);  //third place

.............................




uvm_driver is defined as

class uvm_driver #(type REQ=uvm_sequence_item,
                   type RSP=REQ) extends uvm_component;

  uvm_seq_item_pull_port #(REQ, RSP) seq_item_port;
  REQ req;
  RSP rsp;
...

There is no need to declare a separate handle, just use req. That removes the second place declaration.

The UVM factory override only affects the construction of an object instance; it does not override the class variable where its handle is stored.

1 Like

Hi Dave,

Thanks for the clarifications. Could you please provide the below clarifications too. then only whenever the base sequence item object is constructed instead of creating base class sequence item object , it creates the derives class item object and assigns to the base class item handle . then if I need to call the derived class item class variables in driver , please clarify do I need to modify the driver with $cast or how it needs to reference the derived class variables in driver.