README revision 11791:ac5237fa4230
110152Satgutier@umich.eduThis directory contains a demo of C++ configuration of gem5.  The intention
210152Satgutier@umich.eduis to provide a mechanism to allow pre-generated config.ini files generated
310152Satgutier@umich.eduby Python-based gem5 to be reloaded in library-base versions of gem5
410152Satgutier@umich.eduembedded in other systems using C++ calls for simulation control.
510152Satgutier@umich.edu
610152Satgutier@umich.eduThis demo implements a few of the simulation control mechanisms of the Python
710152Satgutier@umich.edugem5 on top of a C++ configured system.
810152Satgutier@umich.edu
910152Satgutier@umich.eduRead main.cc for more details of the implementation.
1010152Satgutier@umich.edu
1110152Satgutier@umich.eduTo build:
1210152Satgutier@umich.edu
1310152Satgutier@umich.eduFirst build gem5 as a library with cxx-config support and (optionally)
1410152Satgutier@umich.eduwithout python.  Also build a normal gem5 (cxx-config not needed, Python
1510152Satgutier@umich.eduneeded):
1610152Satgutier@umich.edu
1710152Satgutier@umich.edu> cd ../..
1810152Satgutier@umich.edu> scons build/ARM/gem5.opt
1910152Satgutier@umich.edu> scons --with-cxx-config --without-python build/ARM/libgem5_opt.so
2010152Satgutier@umich.edu> cd util/cxx_config
2110152Satgutier@umich.edu
2210152Satgutier@umich.eduNote: For MAC / OSX this command should be used:
2310152Satgutier@umich.edu> scons --with-cxx-config --without-python build/ARM/libgem5_opt.dylib
2410152Satgutier@umich.edu
2510152Satgutier@umich.eduSet a proper LD_LIBRARY_PATH e.g. for bash:
2610152Satgutier@umich.edu> export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/path/to/gem5/build/ARM/"
2710152Satgutier@umich.edu
2810152Satgutier@umich.eduor for MAC / OSX:
2910152Satgutier@umich.edu> export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/path/to/gem5/build/ARM/"
3010152Satgutier@umich.edu
3110152Satgutier@umich.eduThen edit Makefile to set the paths for PYTHON and run make
3210152Satgutier@umich.edu
3310152Satgutier@umich.edu> make
3410152Satgutier@umich.edu
3510152Satgutier@umich.eduMake a config file for the C++-configured gem5 using normal gem5
3610152Satgutier@umich.edu
3710152Satgutier@umich.edu> ../../build/ARM/gem5.opt ../../configs/example/se.py -c \
3810152Satgutier@umich.edu>       ../../tests/test-progs/hello/bin/arm/linux/hello
3910152Satgutier@umich.edu
4010152Satgutier@umich.eduThe binary 'gem5.opt.cxx' can now be used to load in the generated config
4110152Satgutier@umich.edufile from the previous normal gem5 run.
4210152Satgutier@umich.edu
4310152Satgutier@umich.eduTry:
4410152Satgutier@umich.edu
4510152Satgutier@umich.edu> ./gem5.opt.cxx m5out/config.ini
4610152Satgutier@umich.edu
4710152Satgutier@umich.eduThis should print:
4810152Satgutier@umich.edu
4910152Satgutier@umich.edu> Hello world!
5010152Satgutier@umich.edu
5110152Satgutier@umich.eduThe .ini file can also be read by the Python .ini file reader example:
5210152Satgutier@umich.edu
5310152Satgutier@umich.edu> ../../build/ARM/gem5.opt ../../configs/example/read_config.py m5out/config.ini
5410152Satgutier@umich.edu