You must put sc_start()
between the point where you want to continue the simulation. Like following
a_in = SC_LOGIC_1;
b_in = SC_LOGIC_0;
sc_start(1,SC_NS); // Add this
cout << c_out << endl;
b_in = SC_LOGIC_1;
sc_start(1,SC_NS); // Add this
cout << c_out << endl;
In your original code, you just sequentially assign new value to a_in
and b_in
. It changes the current values of a_in
and b_in
, but it does not affect the current value of c_out
because your program does not enter SystemC simulation kernel to simulate the change. So c_out
's next value won't be changed by your a_in
or b_in
sensitivity list.