VanTeo Posted September 22, 2016 Report Share Posted September 22, 2016 Hi, In sc_main function I have a sc_clock and I instance a module A, too. Now inside module A, I want to get period of that sc_clock to delay. Thanks, VanTeo Quote Link to comment Share on other sites More sharing options...
PARVINDER PAL SINGH Posted September 22, 2016 Report Share Posted September 22, 2016 Hello VanTeo, Asuming your modue A have sc_in<bbol> port you can do something like : SC_MODULE(A){sc_in<bool> inPort; ..... void before_end_of_elaboration(){sc_interface* i_f = clock.get_interface();sc_clock* clk = dynamic_cast<sc_clock*>(i_f);sc_time t = clk->period(); // Call method of clock object to which port is bound... } ... }; 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.