112027Sjungma@eit.uni-kl.deOverview
212027Sjungma@eit.uni-kl.de========
312027Sjungma@eit.uni-kl.de
412027Sjungma@eit.uni-kl.deThis repository is a redistribution of the Accellera SystemC 2.3.1 library
512027Sjungma@eit.uni-kl.de[[1]][sysc]. This distribution replaces Accellera's Autoconf build system with
612027Sjungma@eit.uni-kl.dea SCons build system, which is very useful for integration of SystemC in other
712027Sjungma@eit.uni-kl.deSCons based projects, e.g., gem5 [[2]][gem5].
812027Sjungma@eit.uni-kl.de
912027Sjungma@eit.uni-kl.deThe repository contains all the source files from the Accellera distribution,
1012027Sjungma@eit.uni-kl.debut strips down the boost dependencies. All references to the boost library
1112027Sjungma@eit.uni-kl.deare replaced by calls to the C++11 STL. This repository also contains the
1212027Sjungma@eit.uni-kl.deTLM 2.0 protocl checker from Doulos [[3]][doulos].
1312027Sjungma@eit.uni-kl.de
1412027Sjungma@eit.uni-kl.deBuild
1512027Sjungma@eit.uni-kl.de=====
1612027Sjungma@eit.uni-kl.de
1712027Sjungma@eit.uni-kl.deTo build libsystemc-2.3.1.so, simply type scons. Optionally you can specify the
1812027Sjungma@eit.uni-kl.denumber of jobs.
1912027Sjungma@eit.uni-kl.de
2012027Sjungma@eit.uni-kl.de```
2112027Sjungma@eit.uni-kl.descons -j N
2212027Sjungma@eit.uni-kl.de```
2312027Sjungma@eit.uni-kl.de
2412027Sjungma@eit.uni-kl.deTo build and link to SystemC from another SCons project, simply call the
2512027Sjungma@eit.uni-kl.deSConscript located in `src/`. Be sure to add `-std=c++11` to the `CXXFLAGS` of
2612027Sjungma@eit.uni-kl.deyour environment and to export the environment as `'env'`. In case you build on
2712027Sjungma@eit.uni-kl.deOS X, you will need to add `-undefined dynamic lookup` to your `LINKFLAGS`.
2812027Sjungma@eit.uni-kl.deThis is how a minimal SConstruct for your SystemC project could look:
2912027Sjungma@eit.uni-kl.de
3012027Sjungma@eit.uni-kl.de```python
3112027Sjungma@eit.uni-kl.deenv = Environment()
3212027Sjungma@eit.uni-kl.de
3312027Sjungma@eit.uni-kl.deenv.Append(CXXFLAGS=['-std=c++11'])
3412027Sjungma@eit.uni-kl.deif env['PLATFORM'] == 'darwin':
3512027Sjungma@eit.uni-kl.de    env.Append(LINKFLAGS=['-undefined', 'dynamic_lookup'])
3612027Sjungma@eit.uni-kl.de
3712027Sjungma@eit.uni-kl.desystemc = env.SConscript('<path_to_systemc>/src/SConscript', exports=['env'])
3812027Sjungma@eit.uni-kl.deenv.Program('example', ['example.cc', systemc])
3912027Sjungma@eit.uni-kl.de```
4012027Sjungma@eit.uni-kl.de
4112027Sjungma@eit.uni-kl.de[sysc]: http://accellera.org/downloads/standards/systemc
4212027Sjungma@eit.uni-kl.de[gem5]: http://www.gem5.org/Main_Page
4312027Sjungma@eit.uni-kl.de[doulos]: https://www.doulos.com/knowhow/systemc/tlm2/base_protocol_checker/
44