My simple "HelloWorld" program does not work. The programs prints the usual SystemC copyright notice, but not the "Hello World" string).
If I write a similar program using SC_METHOD
(removing wait
calls), I can see the printed message.
What causes this?
#include <iostream>
#include "systemc.h"
SC_MODULE(stim)
{
sc_in<bool> Clk;
void StimGen()
{
cout << "Hello World!\n";
wait();
cout << "Hello again, world!\n";
wait();
}
SC_CTOR(stim)
{
SC_THREAD(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(); // run forever
return 0;
}