For Cadence : does irun look under `ifdef when run with OVM?

Hi,
Please have a look at the following code:

module top;

include "ovm_macros.svh"; include “ovm.svh”;

ifndef NC blabla endif

ifndef NC avm_analysis_port#(x) m_request_phase_started; endif
endmodule

When I compile this code with:

irun +incdir+/home/avidan/svnwork/ovm/src top.sv -define NC -linedebug -svpp -c

I get an error because class x is not defined. However, since NC is defined, irun should not be looking under the `ifndef NC in any case.

This seems to be an OVM+irun related bug and I’ve opened up a service request for this, but if somebody has something clever to say I would be happy to hear it.

thanks,
Avidan Efody
Verilab
www.specman-verification.com

Hi Avidan.

I don’t know about the issue you mention, but if you want conditional compilation for IUS (NC), then you should use:
ifdef INCA ... endif

This “INCA” define is hard-wired into IUS, so you don’t have to explicitly define it.

Steve.

Avidane-

Your example runs on IUS if you use instead

`ifndef INCA

also you should remove the semicolons after the `include statements
since they generate a warning.

-Stuart

Thanks Stuart and Stephen,

I would like to use just my own define and not the INCA one, mainly because I would like to check that the code under the ifdefs compiles and loads in Questa as well.
I don’t understand why there should be anything that prevents me from doing so.

Thanks for the semi-colon tip. Questa doesn’t issue any warning for it. Whose right?

Avidan Efody
Verilab
www.specman-verification.com

Avidan,

This is a svpp issue. The problem is that svpp sees specializations, even if they live in conditional code, unless the conditional macro is INCA or SVPP (these are the only two macros that svpp understands).

So, to do what you want, there are two solutions.

Solution 1:

ifndef NC</font> <font color=#4169e1>ifndef SVPP //Add so svpp doesn’t make specialization type
avm_analysis_port#(x) m_request_phase_started;

endif endif

Solution 2 (only needed if x is not available to nc)
ifndef NC</font> <font color=#4169e1>class x; endclass</font> <font color=#4169e1>avm_analysis_port#(x) m_request_phase_started;</font><font color=#4169e1> endif

I hope this helps.

john

Oops, for the solution 2, the definition of the dummy class should have been in the ifdef NC section. Sorry. So, solution 2 should be: <font color=#4169e1>ifndef NC
class x; endclass
blabla
`endif

ifndef NC avm_analysis_port#(x) m_request_phase_started; endif

Thanks a lot, now everything’s clear.

Avidan Efody
Verilab
www.specman-verification.com

Hi,

I have experienced the same in past but with ncverilog. There is some issue with “`ifndef” you can use following piece of code instead:

ifdef NC else
blabla
`endif

i suppose this should work fine for you.:)

Regards,
Saurabh Sharma

Hi,

I have a question before using irun.

My database, contains

`ifdef PRE_PROTECT
  `include"xyz.vp" // For encrypted version
`else
  `include"xyz.v" // For source version
`endif

in almost each and every files, 100s in #.

So will irun look for protected include files also, which are not present in source version.:confused:

Thanks,
Saurabh Sharma