Override sc in uvm_analysis_imp

Hi,
I have a base monitor class wtih an uvm_analysis_imp …

class base_mon#(type REQ=base_pkt, type RSP=REQ) extends uvm_component;
`uvm_component_utils(base_mon)


uvm_analysis_imp#(base_pkt, base_mon) drvr_mon_import;

function new(string name, uvm_compnent parent);

drvr_mon_import = new(“drvr_mon_import”, new);
endfunction

I want to use the above port in an extended monitor class …

class mod1_mon extends base_mon;

Since the analysis_imp has to point to the subscriber, I’m confused as how to override the subscriber in the extended class.

Thanks,
Kalai

In reply to kalai12345:

First, imp stands for implementation.
Second, drvr_mon_import = new(“drvr_mon_import”, new); is wrong. The second Argument has to be of type uvm_component and is not a constructor call.
Third, imp means you have to implement the write function.

In reply to chr_sue:

my bad.
It should be
drvr_mon_import = new(“drvr_mon_import”, this).

Anyhow, with some online help, I could reuse the analysis_imp declared from the base class in the extended class by having a typedef of the base class within the base class and then passing that handle to the uvm_analysis_imp’s 2nd arg.

Thanks,
Kalai