README revision 11791
1This directory contains a demo of C++ configuration of gem5.  The intention
2is to provide a mechanism to allow pre-generated config.ini files generated
3by Python-based gem5 to be reloaded in library-base versions of gem5
4embedded in other systems using C++ calls for simulation control.
5
6This demo implements a few of the simulation control mechanisms of the Python
7gem5 on top of a C++ configured system.
8
9Read main.cc for more details of the implementation.
10
11To build:
12
13First build gem5 as a library with cxx-config support and (optionally)
14without python.  Also build a normal gem5 (cxx-config not needed, Python
15needed):
16
17> cd ../..
18> scons build/ARM/gem5.opt
19> scons --with-cxx-config --without-python build/ARM/libgem5_opt.so
20> cd util/cxx_config
21
22Note: For MAC / OSX this command should be used:
23> scons --with-cxx-config --without-python build/ARM/libgem5_opt.dylib
24
25Set a proper LD_LIBRARY_PATH e.g. for bash:
26> export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/path/to/gem5/build/ARM/"
27
28or for MAC / OSX:
29> export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/path/to/gem5/build/ARM/"
30
31Then edit Makefile to set the paths for PYTHON and run make
32
33> make
34
35Make a config file for the C++-configured gem5 using normal gem5
36
37> ../../build/ARM/gem5.opt ../../configs/example/se.py -c \
38>       ../../tests/test-progs/hello/bin/arm/linux/hello
39
40The binary 'gem5.opt.cxx' can now be used to load in the generated config
41file from the previous normal gem5 run.
42
43Try:
44
45> ./gem5.opt.cxx m5out/config.ini
46
47This should print:
48
49> Hello world!
50
51The .ini file can also be read by the Python .ini file reader example:
52
53> ../../build/ARM/gem5.opt ../../configs/example/read_config.py m5out/config.ini
54