gem5/util/cxx_config
Matthias Jung 5b08ae2372 misc: Documentation Update
Updates for READMEs of /util/cxx_config, /util/systemc, /util/tlm.
Some minor corrections, mostly with respect to MAC/OSX

Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
2017-01-09 09:33:42 -06:00
..
Makefile config: Add the ability to read a config file using C++ and Python 2014-10-16 05:49:37 -04:00
README misc: Documentation Update 2017-01-09 09:33:42 -06:00
main.cc sim: Update C++ config example to match SystemC example 2015-09-10 16:10:49 +01:00
stats.cc config: Add the ability to read a config file using C++ and Python 2014-10-16 05:49:37 -04:00
stats.hh config: Add the ability to read a config file using C++ and Python 2014-10-16 05:49:37 -04:00

README

This directory contains a demo of C++ configuration of gem5.  The intention
is to provide a mechanism to allow pre-generated config.ini files generated
by Python-based gem5 to be reloaded in library-base versions of gem5
embedded in other systems using C++ calls for simulation control.

This demo implements a few of the simulation control mechanisms of the Python
gem5 on top of a C++ configured system.

Read main.cc for more details of the implementation.

To build:

First build gem5 as a library with cxx-config support and (optionally)
without python.  Also build a normal gem5 (cxx-config not needed, Python
needed):

> cd ../..
> scons build/ARM/gem5.opt
> scons --with-cxx-config --without-python build/ARM/libgem5_opt.so
> cd util/cxx_config

Note: For MAC / OSX this command should be used:
> scons --with-cxx-config --without-python build/ARM/libgem5_opt.dylib

Set a proper LD_LIBRARY_PATH e.g. for bash:
> export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/path/to/gem5/build/ARM/"

or for MAC / OSX:
> export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/path/to/gem5/build/ARM/"

Then edit Makefile to set the paths for PYTHON and run make

> make

Make a config file for the C++-configured gem5 using normal gem5

> ../../build/ARM/gem5.opt ../../configs/example/se.py -c \
>       ../../tests/test-progs/hello/bin/arm/linux/hello

The binary 'gem5.opt.cxx' can now be used to load in the generated config
file from the previous normal gem5 run.

Try:

> ./gem5.opt.cxx m5out/config.ini

This should print:

> Hello world!

The .ini file can also be read by the Python .ini file reader example:

> ../../build/ARM/gem5.opt ../../configs/example/read_config.py m5out/config.ini