katang Posted May 7, 2017 Report Share Posted May 7, 2017 I want to share a clock between modules. If I attempt to do it like sc_core::sc_clock Clock("Clock",sc_core::sc_time(1,sc_core::SC_NS)); scProc* Proc = new scProc("MY",Clock, 100,100); then the compiler gives the message /usr/local/systemc231a/include/sysc/communication/sc_clock.h:169: error: 'sc_core::sc_clock::sc_clock(const sc_core::sc_clock&)' is private sc_clock( const sc_clock& ); ^ If I (after changing the signatures correspondingly) sc_core::sc_clock Clock("Clock",sc_core::sc_time(1,sc_core::SC_NS)); scProc* Proc = new scProc("EMPA",&Clock, 100,100); then the code compiles, but in runtime presents with the error message Error: (E109) complete binding failed: port not bound: port 'MY.My.port_0' (sc_in) In scProc I have a private member sc_core::sc_in_clk mClock; and during initialization, I use mClock(*Clock), Quote Link to comment Share on other sites More sharing options...
AmeyaVS Posted May 8, 2017 Report Share Posted May 8, 2017 Hello @katang, You can use: sc_core::sc_in<bool> clk; in your modules and bind them in the top module as a normal sc_in/out port binding operation. e.g: // In top module. // Clock is the system clock object. some_module_having.clk(Clock); some_other_module_having.clk(Clock); some_another_module_having.clk(Clock); Each of the modules will have public port interface mentioned above. Regards, Ameya Vikram Singh Quote Link to comment Share on other sites More sharing options...
katang Posted May 12, 2017 Author Report Share Posted May 12, 2017 Hello @Ameya, so you say that Clock (in C++ terms) should be global. This is fine, and if you have modules at the same level of hierarchy, I would do so. What I am thinking about, is a hierarchy, like a many-core processor, where the processor which receives the clock as sc_in and must drive the cores' sc_in from something like sc_out. How to convert this, and what electronic transformation the different types (in C++) mean ? 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.