Compiling Systemc Link to heading
systemc
library can be found on accellera. There are two ways to build it. CMake and good old autoconf. autoconf will do the job just fine.
cd systemc-2.3.3
./configure --prefix=`pwd`/local
make
make install
export SC_INSTALL=`pwd`/local
And we are good to go.
Compiling application Link to heading
I got an example from systemc examples. Again there are several ways to build it But I am going for the minimal compilation command.
#include <systemc>
#include <iostream>
static const char *filename = "hello.cpp";
SC_MODULE(hello) {
SC_CTOR(hello){
SC_THREAD(main_thread);
}
void main_thread(void) {
std::cout << "Hello World!" << std::endl;
}
};
int sc_main(int sc_args, char * sc_argv[]){
hello hello_i("hello");
sc_core::sc_start();
return 0;
}
Compilation command for hello world.
g++ hello.cpp -I$SC_INSTALL/include -L$SC_INSTALL/lib-linux64 -lsystemc -o hello
export LD_LIBRARY_PATH=$SC_INSTALL/lib-linux64
./hello