that you can get more information on compilation errors ?

Did you know ...

My colleague asked me about this and I thought I’ll post it here. Let’s say you get an error like

ncvlog: *E,NOTCLM (myXtr.sv,62|29): Regrite_t is not a class item

You can do

% nchelp ncvlog NOTCLM

and you’ll get

nchelp: 12.20-s008: (c) Copyright 1995-2013 Cadence Design Systems, Inc.
ncvlog/NOTCLM =
The specified name is not an item (property or method, for example) in the class.

This works for ncelab as well

% nchelp ncelab <ERROR_CODE>

 

Something with `define

Compilation Errors

I was writing code like :

`define SUB(x) reg_ctrl_x_0

genvar num;
generate for (num = 0; num < 10; num = num + 1) begin : myGen
assign mySignal [num] = `SUB (num)
end
endgenerate

I thought it would be alright and guess what, it resulted in a compilation error.
I tried the following things and I was still getting error.

`define _SUB_(X) reg_ctrl_X_0
`define sub(num) reg_ctrl_num_0
`define sub(num) {reg_ctrl, “num”, _0}

and then I realized it. This is taken like a string and it finally worked with
`define sub(num) “reg_ctrl_num_0”

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”));