sumit_tuwien Posted May 30, 2013 Report Share Posted May 30, 2013 I have an interesting question. I am writing a library which will link systemc library. I want to display library copyright information just after ASI copyright information. How do I do that ? I know that I can write a function which contains copyright information and call it once in every library component using an extern flag (setting the flag false after once it is called) . But I do not want to declare "extern". Any clean way to perform this ? -Sumit Quote Link to comment Share on other sites More sharing options...
maehne Posted May 31, 2013 Report Share Posted May 31, 2013 Hello Sumit, I guess, the message you want to print should only be displayed once you actually use something from your library, i.e., either instantiate a class/module from the library or call some of its functions. Then, you can simply call the function displaying the copyright message in either: the class/module's constructor the module's before_end_of_elaboration() callback. the function body. As you only want the message to appear once, you will have to declare a static boolean flag in the body of the copyright message function, which is initially initialized to true and then is assigned false after the message has been conditionally displayed based on the flag. If you want to be able to display the copyright message several times by calling the function, you will need a helper that handles the flag and uses your copyright message function. If I remember correctly, SystemC and SystemC-AMS display the copyright message from the context of their respective simulation context object, which is a singleton class. However, you'll need this heavier solution only if you also need to manage some more complex state centrally. Best regards, Torsten Quote Link to comment Share on other sites More sharing options...
sumit_tuwien Posted May 31, 2013 Author Report Share Posted May 31, 2013 Thanks Torsten, will let you know when it starts working Quote Link to comment Share on other sites More sharing options...
apfitch Posted June 1, 2013 Report Share Posted June 1, 2013 This isn't in the LRM, but the ASI simulator seems to have the option of suppressing the copyright message using an environment variable or a #define - have a look in the code in sc_ver.h You can print out the SystemC copyright using sc_copyright() (which *is* in the LRM) regards Alan Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.