• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Functional Verification
  3. Questa vs. NC

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 64
  • Views 14117
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Questa vs. NC

archive
archive over 17 years ago

Hi, In the code below, nc will compile the code only if NC is defined. Otherwise it will issue two compilation errors. Questa on the other hand, will compile the code anyway. Who is right? package x; class z; function new(); `ifndef NC bit x = 1; // Questa compiles this line `else bit x; x = 1; `endif `ifndef NC randomize(); // Questa issues a warning but compiles `else void'(randomize()); `endif endfunction endclass endpackage once again if you want to read this in a normal way open the text file. Cadence guys - can someone please tell me what am I doing wrong that everything shows up as one line? Best, Avidan


Originally posted in cdnusers.org by avidan_e
  • for_cdnusers.txt
  • View
  • Hide
  • Cancel
  • archive
    archive over 17 years ago

    Regarding
    [code]randomize();[/code]
    vs
    [code]void'(randomize());[/code]

    there is an ambiguity in the IEEE 1800-2005 standard as to whether a function may be called like a task without casting it to void. In the 1800-2008 standard, it is planned to say that it is legal, but will issue a warning.

    -- Shalom


    Originally posted in cdnusers.org by shalom
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    The Verilog 2001 standard explicitly disallows the setting of an initial value on a variable declared in a function or a task. As the syntax error message says, section 6.2.1 concludes with "Variable declaration assignments are only allowed at the module level."

    The SystemVerilog adds a declaration assignment in a package. But I don't see anything in the LRM that goes as far as permitting it in a class function or task. The list of enhancements to tasks and functions given in section 12.1 of the SV LRM doesn't mention anything about variable declaration assignments.

    Perhaps someone who knows the SV standard better than myself can give us the final word.


    Originally posted in cdnusers.org by TAM
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    6.4 in 1800-2005 says simply,

    "A variable can be declared with an initializer, for example:
    int i = 0;"

    This was intended to be unconditional.

    -- Shalom


    Originally posted in cdnusers.org by shalom
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    6.4 in 1800-2005 says simply,

    "A variable can be declared with an initializer, for example:
    int i = 0;"

    This was intended to be unconditional.

    -- Shalom


    Originally posted in cdnusers.org by shalom
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information