Hardware and software platform
We will use our Ubuntu Linux installation to run all the SystemC simulations. For more information see Installing Ubuntu 7.04 with VMware.
Downloading SystemC libraries
Before we can download the SystemC C++ class libraries from the OSCI web page we must register as a member. After that we can use the OSCI download page: http://www.systemc.org/downloads/standards/ and download the file systemc-2.2.0.tgz.

SystemC 2.2 installation
After unzipping and unpacking (tar zxvf systemc-2.2.0.tgz) the downloaded file (systemc-2.2.0.tgz) we have the following file structure.

SystemC documentation
In the docs directory we find the following documents:
FuncSpec20.pdf
IEEE1666_specification
License.pdf
SystemS_2_1_features.pdf
SystemC_2_1_overview.pdf
UserGuide20.pdf
WhitePaper.pdf
Install and configure SystemC
We will start by reading the INSTALL file. To build, install and use SystemC we need the GNU c++ compiler (gcc) and the GNU make program (gmake). If you don't have gcc installed on your system use the following command to install everything you need: sudo apt-get install build-essential
To install SystemC on a Linux system, do the following steps:
1. Change to the top level directory (systemc-2.2)
2. Create a temporary directory, e.g.,
> mkdir objdir
3. Change to the temporary directory, e.g.,
> cd objdir
4. Set the following environment variable(s):
> set CXX=g++
> export CXX
5. Configure the package for your system.
> ../configure
While the 'configure' script is running, which takes a few moments, it prints messages to inform you of the features it is checking. It also detects the platform.
6. Compile the package. For an optimized SystemC library, enter:
> gmake (or you can use make which is actually the same as gmake in Ubuntu)
For a debug SystemC library, enter:
> gmake debug
7. Install the package.
> gmake install
8. At this point you may wish to verify the installation by testing the example suite.
> gmake check
this will compile and run the examples in the subdirectory examples.
Let's start to configure the system
> ../configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/config/missing: Unknown `--run' option
Try `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/config/missing --help' for more information
configure: WARNING: `missing' script is too old or missing
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for ranlib... ranlib
checking for a BSD-compatible install... /usr/bin/install -c
configure: creating ./config.status
..........
config.status: creating examples/sysc/2.1/Makefile
config.status: creating examples/sysc/2.1/dpipe/Makefile
config.status: creating examples/sysc/2.1/forkjoin/Makefile
config.status: creating examples/sysc/2.1/reset_signal_is/Makefile
config.status: creating examples/sysc/2.1/sc_export/Makefile
config.status: creating examples/sysc/2.1/sc_report/Makefile
config.status: creating examples/sysc/2.1/scx_barrier/Makefile
config.status: creating examples/sysc/2.1/scx_mutex_w_policy/Makefile
config.status: creating examples/sysc/2.1/specialized_signals/Makefile
config.status: executing depfiles commands
Now let's compile everything.
>gmake
Making all in src
gmake[1]: Entering directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/src'
Making all in sysc
gmake[2]: Entering directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/src/sysc'
Making all in kernel
gmake[3]: Entering directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/src/sysc/kernel'
g++ -I. -I. -I../../../../src/sysc/kernel -I../../../../src -Wall -DSC_INCLUDE_FX -O3 -c -o sc_attribute.o `test -f '../../../../src/sysc/kernel/sc_attribute.cpp' || echo '../../../../src/sysc/kernel/'`../../../../src/sysc/kernel/sc_attribute.cpp
g++ -I. -I. -I../../../../src/sysc/kernel -I../../../../src -Wall -DSC_INCLUDE_FX -O3 -c -o sc_cor_fiber.o `test -f '../../../../src/sysc/kernel/sc_cor_fiber.cpp' || echo '../../../../src/sysc/kernel/'`../../../../src/sysc/kernel/sc_cor_fiber.cpp
g++ -I. -I. -I../../../../src/sysc/kernel -I../../../../src -Wall -DSC_INCLUDE_FX -O3 -c -o sc_cor_pthread.o `test -f '../../../../src/sysc/kernel/sc_cor_pthread.cpp' || echo '../../../../src/sysc/kernel/'`../../../../src/sysc/kernel/sc_cor_pthread.cpp
.........
To compile and run this example type
make check
gmake[4]: Leaving directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/examples/sysc/2.1/specialized_signals'
gmake[4]: Entering directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/examples/sysc/2.1'
gmake[4]: Nothing to be done for `all-am'.
gmake[4]: Leaving directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/examples/sysc/2.1'
gmake[3]: Leaving directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/examples/sysc/2.1'
gmake[3]: Entering directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/examples/sysc'
gmake[3]: Nothing to be done for `all-am'.
gmake[3]: Leaving directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/examples/sysc'
gmake[2]: Leaving directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/examples/sysc'
Making all in .
gmake[2]: Entering directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/examples'
gmake[2]: Nothing to be done for `all-am'.
gmake[2]: Leaving directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/examples'
gmake[1]: Leaving directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/examples'
Making all in .
gmake[1]: Entering directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir'
gmake[1]: Nothing to be done for `all-am'.
gmake[1]: Leaving directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir'
>
and last we install everything.
>gmake install
Making install in src
gmake[1]: Entering directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/src'
Making install in sysc
gmake[2]: Entering directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/src/sysc'
Making install in kernel
gmake[3]: Entering directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/src/sysc/kernel'
gmake[4]: Entering directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir/src/sysc/kernel'
gmake[4]: Nothing to be done for `install-exec-am'.
/bin/sh ../../../../config/mkinstalldirs /home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/include/sysc/kernel
mkdir /home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/include
mkdir /home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/include/sysc
mkdir /home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/include/sysc/kernel
for file in sc_attribute.h sc_boost.h sc_cmnhdr.h sc_constants.h sc_cor.h sc_dynamic_processes.h sc_event.h sc_except.h sc_externs.h sc_join.h sc_kernel_ids.h sc_macros.h sc_module.h sc_module_name.h sc_object.h sc_process.h sc_process_handle.h sc_reset.h sc_runnable.h sc_sensitive.h sc_spawn.h sc_spawn_options.h sc_simcontext.h sc_time.h sc_ver.h sc_wait.h sc_wait_cthread.h ; do
/usr/bin/install -c -m 644 ../../../../src/sysc/kernel/$file /home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/include/sysc/kernel/$file;
done
.............................
Making install in .
gmake[1]: Entering directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir'
gmake[2]: Entering directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir'
gmake[2]: Nothing to be done for `install-exec-am'.
for file in AUTHORS COPYING ChangeLog INSTALL LICENSE NEWS README RELEASENOTES docs; do
d=..;
if test -d $d/$file; then
test -d /home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/$file
|| cp -pr $d/$file /home/svenand/root/projects/SystemC/libraries/systemc-2.2.0 || :;
else
test -f /home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/$file
|| cp -p $d/$file /home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/$file || :;
fi;
done
gmake[2]: Leaving directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir'
gmake[1]: Leaving directory `/home/svenand/root/projects/SystemC/libraries/systemc-2.2.0/objdir'
To compile and run all examples we execute the following command:
> gmake check
We are now ready to start exploring all features of SystemC. We will do that by looking closer to some of the examples that came with the installation.