Error on ovm_component_utils in an extended class

I am using a 3rd party verification IP in my TB. It has a class, say,
class vip_class extends ovm_component;
`ovm_component_utils(vip_class)

endclass

Now, I extend this class as,
class my_class extends vip_class;
`ovm_component_utils(my_class) // ← I get error here

endclass

But I am getting an error on line with ovm_component_utils in my code which says,
Error : Type of argument ‘tmp_data__’ of virtual method ‘m_field_automation’ in class ‘my_class’ does not match with type of argument in abstract superclass ‘ovm_object’

Can anyone explain why am I seeing this error and how can I resolve it?

Thanking in anticipation.

Regards,
Prasad

Are you sure the vip_class is using ovm_component_utils and not ovm_object_utils?

In reply to dave_59:

Yes, vip_class uses ovm_component_utils and not ovm_object_utils.

And vip_class is extended from ovm_threaded_component, and not ovm_component. This should not affect as ovm_threaded_component points to ovm_component, right?

In reply to prasads:

ovm_threaded_component is just a typedef to ovm_component (legacy from AVM)

`ovm_component_utils does not generate any of the code you mentioned in error. I assume tou are not using the field automation macros later.
That macro should have generated

typedef ovm_component_registry #(my_class,"my_class") type_id;
     static function type_id get_type();
       return type_id::get();
     endfunction     
     virtual function ovm_object_wrapper get_object_type();
       return type_id::get();
     endfunction
     const static string type_name = "my_class";
     virtual function string get_type_name ();
       return type_name;
     endfunction

Try replacing the macro with this code and see if you get the same error.

In reply to dave_59:

After replacing the code, I get following warning during compilation on line " virtual function ovm_object_wrapper get_object_type();"

** Warning: <fileName>(<lineNumber>): (vlog-LRM-7047) Return type of virtual method ‘get_object_type’ in class ‘my_class’ is a subtype of the method return type in the superclass. For strict LRM compliance the return types must match.

But when i execute vsim, i get errors like:

** Error: (vsim-3978) /projects/pnq/sangam/released/ovm/latest/ovm/src/base/ovm_registry.svh(54): Illegal assignment to class work.top/ovm_component from class work.top/my_class

Time: 0 ps Iteration: 0 Region: /top/ovm_component_registry::ovm_component_registry__3 File: top.sv

my_class doesn’t seem to behave like an extended class of ovm_component.

In reply to prasads:

prasads,

It’s possible you are including the OVM library instead of importing it, thus winding up with two different instances of the OVM library.
You should contact Mentor support directly as you are not showing enough information here for me to help you further.

In reply to dave_59:

Thanks Dave.
The problem was same as you mentioned. One of our scripts included ovm library and so was getting those errors. Now that I modified the script, I see no error.

Regards,
Prasad

In reply to prasads:

Great. The thing that clued me in was the actual error message

** Error: (vsim-3978) /projects/pnq/sangam/released/ovm/latest/ovm/src/base/ovm_registry.svh(54): Illegal assignment to class work.top/ovm_component from class work.top/my_class

class work.top/ovm_component means the class was defined inside the module top, not inside the ovm_pkg. This is why it is very import to look carefully at the error message.

Hi all,
other than the above possibilities(as dave suggested:It’s possible you are including the OVM library instead of importing ) ,Are there any possibilities to get the following error .here i shown my makefile and register_pkg.sv as below to get an ideal over the problem.i am importing ovm pkg and uvm register package and included the macros of ovm and uvm register in this register_pkg.sv file. which is in my environment.

can any body tell me what will be the problem.

thanks,
kk

------ Compile the REGISTER PKG ----------------------------------
vlog -work /home/Desktop/sRegister/data/trunk/work/sRegister /home/Desktop/sRegister/data_from/trunk/dv/env/registers/register_pkg.sv +incdir+/home/Desktop/sRegister/data_from/trunk/dv/env/registers +incdir+/home/Desktop/sRegister/data_from/trunk/dv/verif/common/ovm/ovm-2.1.1/src +incdir+/home/Desktop/sRegister/data_from_/trunk/dv/env +incdir+/home/Desktop/sRegister/data_from/trunk/dv/verif/common/ovc/ovm_register-2.1/src +incdir+/tools/mentor/questa10.1b/questa_sim/verilog_src/uvm_reg-1.1/src +incdir+/tools/mentor/questa10.1b/questa_sim/verilog_src/uvm_reg-1.1/src/dpi
QuestaSim vlog 10.1b Compiler 2012.04 Apr 26 2012
– Compiling package register_pkg
– Importing package ovm_pkg
– Importing package mtiUvmReg.uvm_reg_pkg (uvm_reg-1.1 Built-in)
– Importing package mtiOvm.ovm_pkg (ovm-2.1.2 Built-in)
– Importing package axi_pkg
** Warning: /home/Desktop/sREgister/data_from/trunk/dv/env/registers/reg_model.sv(50): (vlog-LRM-7047) Return type of virtual method ‘get_object_type’ in class ‘car_register_Device_Identity_CAR_reg’ is a subtype of the method return type in the superclass. For strict LRM compliance the return types must match.
** Warning: /home/Desktop/sRIO/data_from/trunk/dv/env/registers/reg_model.sv(50): (vlog-LRM-7047) Return type of virtual method ‘create’ in class ‘car_register_Device_Identity_CAR_reg’ is a subtype of the method return type in the superclass. For strict LRM compliance the return types must match.
** Error: /home/Desktop/sRegister/data_from/trunk/dv/env/registers/reg_model.sv(50): Type of argument ‘tmp_data__’ of virtual method ‘m_field_automation’ in class ‘car_register_Device_Identity_CAR_reg’ does not match with type of argument in abstract superclass ‘ovm_object’.

my Make file as below:
(WORK)/register_pkg/_primary.dat: (WORK)/ovm_pkg/_primary.dat
(WORK)/ovm_register_pkg/_primary.dat \ (WORK)/axi_pkg/_primary.dat
#(WORK)/uvm_reg_pkg/_primary.dat \ /tools/mentor/questa10.1b/questa_sim/uvm_reg-1.1/uvm_reg_pkg/_primary.dat \ /tools/mentor/questa10.1b/questa_sim/uvm_reg-1.1/_dpi/dpi.tfdb \ (DV_ENV)/registers/reg_model.sv
#(DV_ENV)/registers/srio_reg_adapter.sv \ (DV_ENV)/sregister_macros.svh
(DV_ENV)/registers/register_pkg.sv @echo @echo ------ Compile the srio REGISTER PKG ---------------------------------- (VLOG) -work (WORK) (DV_ENV)/registers/register_pkg.sv +incdir+(DV_ENV)/registers +incdir+(OVM_DIR) +incdir+(DV_ENV) +incdir+(DV_OVC)/ovm_register-2.1/src +incdir+/tools/mentor/questa10.1b/questa_sim/verilog_src/uvm_reg-1.1/src +incdir+/tools/mentor/questa10.1b/questa_sim/verilog_src/uvm_reg-1.1/src/dpi $(VE_DEFINES)

my register_pkg.sv file:

ifndef REGISTER_PKG define REGISTER_PKG

include "ovm_macros.svh" include “uvm_reg_macros.svh”

package register_pkg;

import ovm_pkg::;
import uvm_reg_pkg::
;
import axi_pkg::*;

include "reg_model.sv" include “reg_adapter.sv”

endpackage
`endif