UVM – not recognized ??

Compilation Errors

class my_env extends uvm_environment ;
|
ncvlog: *E,SVNOTY (my_env.svh,1|35): Syntactically this identifier appears to begin a datatype but it does not refer to a visible datatype in the current scope.

Problem : There’s no uvm_environment datatype in UVM.

Solution :

class my_env extends uvm_env;

 

PS : If you still get the same error, check if

1. You mentioned -sv or -sv uvm when compiling the code.

2. Check if your environment is setup.

% echo $UVM_HOME                                       // Is this pointing to the UVM class library ?

3. Check if you have the line below in your code

`include “uvm_macros.svh”

4. Check if you have imported uvm packages

import uvm_pkg::* ;

Note : Even if you have imported the package into one of your own, self-created packages, it is necessary to import it into the top TB module. I spent almost a week trying to compile a simple Hello World Env.

 

Compilation Errors

module dut (dut_if _if);
|
ncvlog: *E,EXPRPA (dut.v,1|21): expecting a right parenthesis (‘)’)  12.1(IEEE)].

 

Problem :  The code looks correct, but still having problem ?

Solution : One of the reasons could be that you have not used the -sv switch when compiling.

ncverilog -f filelist -sv

 

expecting a semicolon

Compilation Errors

shortint j;
|
ncvlog: *E,EXPSMC (myClass.sv,106|10): expecting a semicolon (‘;’) [3.2.2(IEEE)].


 

Problem  : very straightforward, you are missing a semicolon, but where ? right above the line shown, @ 105.

function void myClass::myTask ();
int datacnt = 0
shortint j;
`LOG_MSG (log, LS_DEBUG, $sformatf (” A task to distribute data packets”));


 

Solution

function void myClass::myTask ();
int datacnt = 0;
shortint j;
`LOG_MSG (log, LS_DEBUG, $sformatf (” A task to distribute data packets”));

 

 

identify declaration while expecting a statement

Compilation Errors

int repLines = 0;
|
ncvlog: *E,BADDCL (mySoC.sv,106|5): identify declaration while expecting a statement


 

Problem : LOG_MSG should come after declaration of variables

function void myClass::myTask ();
`LOG_MSG (log, LS_DEBUG, $sformatf (“This task will distribute data to all packets”));
int dataCount = 0;
shortint j;


 

Solution :

function void myClass::myTask ();
int dataCount = 0;
shortint j;

`LOG_MSG (log, LS_DEBUG, $sformatf (“This task will distribute data to all packets”));