View Full Version : For Cadence : does irun look under `ifdef when run with OVM?
avidane
01-15-2008, 03:59 AM
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
stephenh
01-15-2008, 11:16 AM
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.
stuart
01-15-2008, 04:59 PM
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
avidane
01-17-2008, 04:34 AM
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
jlrose
01-17-2008, 06:38 AM
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
`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
class x; endclass
avm_analysis_port#(x) m_request_phase_started;
`endif
I hope this helps.
john
jlrose
01-17-2008, 06:56 AM
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:
`ifndef NC
class x; endclass
blabla
`endif
`ifndef NC
avm_analysis_port#(x) m_request_phase_started;
`endif
avidane
01-17-2008, 11:42 AM
Thanks a lot, now everything's clear.
Avidan Efody
Verilab
www.specman-verification.com
saurabhsharma
04-08-2008, 05:02 AM
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
saurabhsharma
04-29-2008, 10:59 PM
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
Powered by vBulletin™ Version 4.0.3 Copyright © 2010 vBulletin Solutions, Inc. All rights reserved.