Error in device class creation -- *E TYCMPAT

Hi All,
I am facing following error in my simulation.
Error :
*master0 = new(MASTER_NAME,0,AAHB_MASTER,ports);
|
ncvlog: E,TYCMPAT (./…/VIP/aahb_master.sv,92|30): formal and actual do not have assignment compatible data types (expecting datatype compatible with ‘class uvm_pkg::uvm_component’ but found ‘integer’ instead).

master0 = new(MASTER_NAME,0,AAHB_MASTER,ports);

Constructor for those instance creation

  function new( 
                  string name, 
`ifdef AVERY_AHB_UVM
                  uvm_component parent,
`elsif AVERY_AHB_OVM
                  ovm_component parent,
`endif
                  bit [3:0] instance_id= 0, 
                  aahb_device_type_e dev_type= AAHB_DEVICE_TYPE_UNKNOWN,
                  virtual aahb_intf ports= null
                );
`protect

Please someone guide for this issue

Regards
Muthuvenkatesh

In reply to Muthuvenkatesh:

Because AVERY_AHB_UVM or AVERY_AHB_OVM macro is defined but you didnt pass any value to ‘parent’ parameter of new function. Either you pass value to parent or you can set default value for ‘parent’ (null for example) and call:


master0 = new(MASTER_NAME,,0,AAHB_MASTER,ports);

In reply to Muthuvenkatesh:

Every class extended from uvm_component or ovm_component needs to have the constructor as defined by the UVM/OVM specification:

function new(string name="name", uvm_component parent=null);

You CAN NOT modify this constructor in any way as it is required for factory registration.