1. Download SystemC source from Accellera website.

2. Untar the package using tar -xzvf systemc-2.3.0.tgz or if this doesn’t work install 7zip using command line/ubuntu software centre and then type: 7z x filename  , in our case filename=systemc-2.3.0.tgz

(change permissions from the parent directory, if permission related error occurs, typing : chmod  -R +x systemc-2.3.0 )
3. Change to the top level directory systemc-2.3.0 : cd systemc-2.3.0
4. Make a directory  systemc230 for installation in your /usr/local/ path.

mkdir /usr/local/systemc230

5. Make a directory “objdir” in the directory systemc-2.3.0 : mkdir objdir
6. Change to objdir : cd objdir
7. now type: export CXX=g++

8. Run configure from objdir:  ../configure --prefix=/usr/local/systemc230
9. Do: make
10. Install by typing command: sudo make install

You are done with installation of SystemC 2.3.0. This version is packed with TLM package also. Now we can run our first Hello World! program.

Open your favourite text editor and enter the following program:

…………………………………………………………………………….

// 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.\n”;
}
};

// sc_main in top level function like in C++ main
int sc_main(int argc, char* argv[]) {
hello_world hello(“HELLO”);
// Print the hello world
hello.say_hello();
return(0);
}

…………………………………………………………..

Save the file as hello.cpp. Use following command to export a variable SYSTEMC_HOME.

export SYSTEMC_HOME=/usr/local/systemc230/

Now you can use following command to compile the program:

g++ -I. -I$SYSTEMC_HOME/include -L. -L$SYSTEMC_HOME/lib-linux -Wl,-rpath=$SYSTEMC_HOME/lib-linux -o hello hello.cpp -lsystemc -lm

Once the program is compiled type following to run your program:
./hello

and you should get output:

SystemC 2.3.0-ASI — Aug 12 2012 09:27:22
Copyright (c) 1996-2012 by all Contributors,
ALL RIGHTS RESERVED


Hello World.