UVM Library Compilation Troubleshooting

This application note covers several types of configuration issues you might encounter when working with the UVM library:

1) Error messages like:

  • err Error: SYSTEM_VERILOG_2012: Cannot open `include file “uvm_macros.svh”

  • err Error: SYSTEM_VERILOG_2012: Undefined macro name: `uvm_object_utils_begin

  • err Error: EXTEND_CLASS: Extending non existing class ‘uvm_agent

These errors indicate that the UVM library was not compiled or that the uvm_pkg has not been imported properly. To check whether the UVM library was compiled:

If the library is not compiled add the -uvm argument to your build file or one of the Compatibility Modes specific flags.

Also make sure the uvm package is imported in the scope where the errors are reported.

2) Error messages like:

  • err Error: METHOD_CALL_ARGUMENTS: Expecting maximum ‘0’ arguments when calling ‘new’, found ‘1’

  • err Error: ILLEGAL_ASSIGNMENT: Illegal assignment of ‘literal_string’ to argument ‘stream’ of type ‘uvm_tr_stream’

  • err Error: UNDECLARED_IDENTIFIER: Identifier ‘factory’ is not declared

These errors can happen when there is a mismatch between the UVM version that is compiled by DVT and the one used by the project.

For example there are two scenarios for the ‘’METHOD_CALL_ARGUMENTS’’ error:

  • 2a) The first one is the mismatch scenario.
    • The error is thrown for classes that do not define a constructor with a string argument for the name.

    • Although this is not an issue with older UVM versions such as uvm-1.1d, it is an issue for uvm-1.2 :

      • (uvm-1.1d)

        ../../_images/uvm_1_1_d_obj_utils_expansion.png
      • (uvm-1.2)

        ../../_images/uvm_1_2_obj_utils_expansion.png
    • From the pictures above it can be observed that by default the ‘’uvm-1.2’’ version enforces a constructor with a string argument.

    • To quickly check which version was compiled by DVT, disable the Content Filters using the toolbar button cf, open the Macros View macros and search for uvm_version.

    • To compile a different UVM version see SystemVerilog OVM or UVM Library Compilation.

  • 2b) The second scenario is where the simulator CLI gets passed +define+UVM_OBJECT_DO_NOT_NEED_CONSTRUCTOR but the directive is missing from .dvt/default.build buildfile.

3) Error messages like:

  • err Error: SYSTEM_VERILOG_2012: Undefined macro name: `uvm_record_attribute

    This typically happens when compiling the uvm-1.1c version and not specifiying a compatibility mode. The solution is to specify a Compatibility Modes.