//all systemc modules should include systemc.h header file #include"systemc.h" //hello_world is module name SC_MODULE(hello_world){SC_CTOR(hello_world){//nothing in constructor}void say_hello(){//Print "Hello world!!!" to the console.cout<<"Hello World!!!"<}; //此处分号不要忘了 //sc_main in top level function like in C&#43;&#43; main int sc_main(int argc, char* argv[]){hello_world hello("HELLO");hello.say();return 0; }
编译并运行
g&#43;&#43; test.cpp -I/home/centos7/systemc-2.3.3/include -L/home/centos7/systemc-2.3.3/lib-linux64 -o test -lsystemc ./test