Jump to content

How to generate sc_signal at runtime?


SiGa

Recommended Posts

I used sc_spawn a lot for generating processes at runtime. 

Is there a similar way to spawn a signal? 

As I understand SystemC, a signal is the data type and the port of a module is a pointer to the datatype. So it should be possible to create them at runtime or not? 

 

Why do I need it?

I have a given module that has a varying set of ports and I want to attach and connect these ports with signals dynamically.

 

Best regards and thanks in advance,

SiGa

 

Link to comment
Share on other sites

Sc_signals are not data types. Sc_signals are channels, which represent hardware being modeled and are used as mechanisms to transport data between processes. As such, channels are only allowed to be created during the “elaboration phase” that occurs prior to simulation starting up.

 

Also, strictly speaking, sc_port’s are not normal pointers; although, an underlying mechanism uses pointers for efficiencies sake. The operator->() is overloaded on sc_port<IF_TYPE>.

You could of course create an sc_vector< sc_signal<T> >, N >, where N was a maximum of the number of signals required and then allocate specific index to each spawned process. 

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