Jump to content
SystemCInDepth

wait in SC_CTOR()

Recommended Posts

Hello @SystemCInDepth,

The wait() call can only be used in SC_THREAD/SC_CTHREAD registered processes in SystemC library.

You are trying to call wait even before the elaboration happens and you have started the simulation.

It would be better if you could go through the book: SystemC from Ground Up by David Black to have a better understanding.

Hope it helps.

Regards,

Ameya Vikram Singh

 

Share this post


Link to post
Share on other sites

Hi,

if you want to map the Verilog initial block you can use the  start_of_simulation() callback function. This one us called automatically by the kernel at simulation start. But you cannot call wait()  either in this function. If you need to execute somethin delayed you can post a sc_event in the start_of_simulation() function and register a method/trhead being sensitive to this event.

Cheers

Share this post


Link to post
Share on other sites

Or, a more simple solution: you may put a "call" to an initialization routine, like

   SC_THREAD(Initialize_method);  

If you do NOT use  dont_initialize() after that line, the SystemC engine waits until the constructor finishes (and gets registered), and after that executes the thread 'Initialize_method' where you are enabled to use wait(). This happens at the same (simulated) time, so I think it closely matches 'initial', which you want to imitate.

 

Share this post


Link to post
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...