klh Posted April 14, 2022 Report Share Posted April 14, 2022 You need to separate out stimulus generation from monitoring and checking. #include "systemc.h" SC_MODULE(MultTb){ sc_in<bool> clk; sc_out<int> din1; sc_out<int> din2; sc_in <int> dout; void stim_gen(); SC_CTOR(MultTb){ SC_THREAD(stim_gen); sensitive << clk.pos(); } }; void MultTb::stim_gen(){ wait(); din1 = 10; din2 = 10; wait(); printf("[MON]:: %0d * %0d = %0d\n", din1.read(), din2.read(), dout.read()); din1 = -10; din2 = 10; wait(); printf("[MON]:: %0d * %0d = %0d\n", din1.read(), din2.read(), dout.read()); sc_stop(); } Quote Link to comment Share on other sites More sharing options...
Bas Arts Posted April 20, 2022 Report Share Posted April 20, 2022 Who is "You"? You? 🙂 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.