Home > Community > Forums > Functional Verification > ask one question.....

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 ask one question..... 

Last post Mon, Dec 19 2011 5:03 PM by redrabbit. 2 replies.
Started by redrabbit 05 Dec 2011 11:32 PM. Topic has 2 replies and 2755 views
Page 1 of 1 (3 items)
Sort Posts:
  • Mon, Dec 5 2011 11:32 PM

    • redrabbit
    • Top 500 Contributor
    • Joined on Tue, Nov 22 2011
    • Posts 26
    • Points 385
    ask one question..... Reply

    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......

    • Post Points: 20
  • Mon, Dec 19 2011 8:53 AM

    • hannes
    • Top 150 Contributor
    • Joined on Fri, Nov 14 2008
    • Bracknell, Berkshire
    • Posts 50
    • Points 895
    Re: ask one question..... Reply

     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

    Filed under: ,
    • Post Points: 20
  • Mon, Dec 19 2011 5:03 PM

    • redrabbit
    • Top 500 Contributor
    • Joined on Tue, Nov 22 2011
    • Posts 26
    • Points 385
    Re: ask one question..... Reply

    thank you very much!

    • Post Points: 5
Page 1 of 1 (3 items)
Sort Posts:
Started by redrabbit at 05 Dec 2011 11:32 PM. Topic has 2 replies.