• 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. ask one question.....

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 65
  • Views 14241
  • 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

ask one question.....

redrabbit
redrabbit over 13 years ago

hi all,

i use define in my testcase,what i want to do is in the first loop i use the define maybe in one branch ,while on the second loop ,i want #undef the define that i defined before and into another branch,but it doesn't work......

 

codes are like this:

for ()

{

     #ifdef  AAAA then

    {

          ........

          .........

          specman("#undef  AAAA");

    }; 

    #ifndef AAAA then

    {  

         ......

     };

};

 

why???

what really does the sentence means in reference "The effect is propagated to all files that are loaded after the
#undef statement is encountered."?

does it means the #undef could not write in just one file ? or between two import e file ,we use #undef ? like the example supported in e_reference:

#define semaphore my_semaphore;
import my_design.e;
#undef semaphore;
import external_code.e;

thank you for your reply......

  • Cancel
  • hannes
    hannes over 13 years ago

     Hello redrabbit,

    defines are preprocessor directives. If you want control flow in your code, I would suggest using variables or AOP features (i.e. modifying method in when subtypes). The e language gives you many features, exactly for the flexibility you are looking for. Preprocessor directoves are very un-flexible, so they should be the last resort.

    Regards,
    -hannes

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • redrabbit
    redrabbit over 13 years ago

    thank you very much!

    • 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