Verification Methodology Forum - Powered by vBulletin
+ Reply to Thread
Results 1 to 9 of 9

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

  1. #1

    Default 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

  2. #2

    Default

    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.

  3. #3

    Default re IUS compile question

    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
    Stuart Swan
    Senior Architect
    Cadence Design Systems

  4. #4

    Default

    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

  5. #5

    Default

    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

  6. #6

    Default

    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

  7. #7

    Default

    Thanks a lot, now everything's clear.

    Avidan Efody
    Verilab
    www.specman-verification.com

  8. #8

    Default

    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
    "Don't worry about the world coming to an end today. It's already tomorrow in Australia." -Charles Schultz

  9. #9

    Default

    Hi,

    I have a question before using irun.

    My database, contains
    Code:
    `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.

    Thanks,
    Saurabh Sharma
    "Don't worry about the world coming to an end today. It's already tomorrow in Australia." -Charles Schultz

+ Reply to Thread

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts