Hello everyone!
I am new in this forum. I am doing some SystemC exercises after a long time without using it, and I have a very basic problem. I wrote the following code:
#include <iostream>
#include "systemc.h"
SC_MODULE(stim)
{
sc_in<bool> Clk;
void StimGen()
{
cout << sc_time_stamp() << "Hello World!\n";
}
SC_CTOR(stim)
{
SC_METHOD(StimGen);
sensitive << Clk.pos();
}
};
int sc_main(int argc, char* argv[])
{
sc_clock TestClk("clk", 10,SC_NS);
stim Stim1("Stimulus");
Stim1.Clk(TestClk);
sc_start();
return 0;
}
When run the program, it terminates without printing "Hello World!" string on output.
What am I doing wrong?
If I substitute SC_THREAD with SC_METHOD, the "Hello World!" message is printed.