OMark Posted September 7, 2020 Report Share Posted September 7, 2020 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. Quote Link to comment Share on other sites More sharing options...
David Black Posted September 8, 2020 Report Share Posted September 8, 2020 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? Quote Link to comment Share on other sites More sharing options...
OMark Posted September 8, 2020 Author Report Share Posted September 8, 2020 @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? Quote Link to comment Share on other sites More sharing options...
Eyck Posted September 25, 2020 Report Share Posted September 25, 2020 create a signal in the B module and bind it to the sc_export. The you create a SC_METHOD being sensitive to the sc_port. In the method you just read the port value and write it to the signal. 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.