Type Argument Value Does Not Match Containing Class


There are several UVM macros for which the first argument must be the equal to containing class. These macros are:

  • All UVM object and component utility macros
  • uvm_field_utils_begin
  • uvm_sequence_library_utils
  • uvm_add_to_seq_lib
  • uvm_set_super_type
  • uvm_register_cb
class my_uvm_component extends uvm_component;

    `uvm_component_utils(some_other_class)

    ...

endclass
class my_uvm_component extends uvm_component;

    `uvm_component_utils(my_uvm_component)

    ...

endclass

If the containing class is parameterized, the parameters must also be passed to the macro:

class my_uvm_component#(int size_param = 8) extends uvm_component;

    `uvm_component_param_utils(my_uvm_component)

    ...

endclass
class my_uvm_component#(int size_param = 8) extends uvm_component;

    `uvm_component_param_utils(my_uvm_component#(size_param))

    ...

endclass

Rule configuration

This rule can be disabled for your project, or its severity and parameters can be modified in the project linting settings. Alternatively, it can be manually configured with the following template:

147/severity/${path}={error|warning|info|ignore}