Jump to content

Display of Copyright


sumit_tuwien

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...