Jump to content

Can I bind an sc_port to sc_export?


Recommended Posts

Hello,

 

I have a systemC module having an input sc_in<bool> and an output sc_export<sc_core::sc_signal_inout_if<bool>>. How can I route the signal values coming on the input systemc port to the export port? Is that even doable and under which conditions?

 

Thanks.

Link to post
Share on other sites

Yes and no.

SystemC ports (e.g., sc_port<T>) sit on the boundary of a SystemC module to allow communication with external channels. They point outward from a module towards the channel. SystemC exports point inward towards a channel within the module or within submodules via additional export.

sc_in<T> is a partial template specialization of sc_port using an sc_signal_in_if<T>.

So the answer to your question depends on where the ports are located vs. the module and channel.

A picture would help.

What books on SystemC have your read?

Link to post
Share on other sites

grafik.thumb.png.b4f09ceb7183cb07f46ad16fec33922f.png

@David Black As proposed, here is an illustration of what I try to achieve. In the original design, I have SystemC modules "A" and "C" connected directly, where the sc_port of the module "C" uses the Interface provided by sc_export of module "A". Now, I added a module "B" which is supposed to route flexibly the signals and forward their values to destination. I succeeded to achieve the binding between modules "A", "B" and "C" as illustrated in the picture. But I am not sure how to forward efficiently the values from the sc_port of the "B" module to the sc_export of that same module to be consumed by the Module "C" as done originally.

Is the sketch clear?

Link to post
Share on other sites
  • 3 weeks later...

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