shiva25 Posted August 27, 2021 Report Share Posted August 27, 2021 How can the value of port change automatically after 1 clock cycle. what should i do for this? Quote Link to comment Share on other sites More sharing options...
Eyck Posted August 27, 2021 Report Share Posted August 27, 2021 You need to implement a method or a thread being sensitive on the clock. Something like: SC_MODULE(test) { sc_core::sc_in<bool> clk_i{"clk_i"}; sc_core::sc_ou<bool> out_o{"out_o"}; SC_CTOR(test) { SC_THREAD(run); } void run(){ while(true) { wait(clk_i.posedge_event()); out_o.write(!out_o.read()); } } }; 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.