• 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. Custom IC Design
  3. ERROR in AMS simulation : "expecting a valid compiler directive...

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 125
  • Views 1980
  • 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

ERROR in AMS simulation : "expecting a valid compiler directive [16(IEEE)]"

RFStuff
RFStuff over 4 years ago

Dear All,

I have a verilog code portion as below:-

But, when I run I get error as :- ncvlog: *E,EXPCPD ... expecting a valid compiler directive [16(IEEE)]. `#if $NUM_STAGES$ > 2.

Could any body please tell how to fix this issue.

`#if $NUM_STAGES$ > 2
sync_mod i_sync_cell(
.Q(z_o),
.CD(~reset_n_i),
.CP(clk_i),
.D(d_i_sg2),
.SE(1'b0),
.SI(d_i_sg2)
);
`#endif

  • Cancel
  • RFStuff
    RFStuff over 4 years ago

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to RFStuff

    Belated reply (was a bit busy at the time), but `#if (or indeed `#anything) is not a legal directive in Verilog. No idea why you think it would be - it's not in the IEEE 1364 Language Reference Manual (LRM). There are a number of them which are specified in Clause 19 of the 1364-2001 IEEE standard, but there's no `if (only `ifdef).

    I assume you got this from somewhere - perhaps it was a non-standard extension in a specific simulator?

    Andrew

    • 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