README revision 10458
110458Sandreas.hansson@arm.comThis directory contains a demo of C++ configuration of gem5.  The intention
210458Sandreas.hansson@arm.comis to provide a mechanism to allow pre-generated config.ini files generated
310458Sandreas.hansson@arm.comby Python-based gem5 to be reloaded in library-base versions of gem5
410458Sandreas.hansson@arm.comembedded in other systems using C++ calls for simulation control.
510458Sandreas.hansson@arm.com
610458Sandreas.hansson@arm.comThis demo implements a few of the simulation control mechanisms of the Python
710458Sandreas.hansson@arm.comgem5 on top of a C++ configured system.
810458Sandreas.hansson@arm.com
910458Sandreas.hansson@arm.comRead main.cc for more details of the implementation.
1010458Sandreas.hansson@arm.com
1110458Sandreas.hansson@arm.comTo build:
1210458Sandreas.hansson@arm.com
1310458Sandreas.hansson@arm.comFirst build gem5 as a library with cxx-config support and (optionally)
1410458Sandreas.hansson@arm.comwithout python.  Also build a normal gem5 (cxx-config not needed, Python
1510458Sandreas.hansson@arm.comneeded):
1610458Sandreas.hansson@arm.com
1710458Sandreas.hansson@arm.com> cd ../..
1810458Sandreas.hansson@arm.com> scons build/ARM/gem5.opt
1910458Sandreas.hansson@arm.com> scons --with-cxx-config --without-python build/ARM/libgem5_opt.so
2010458Sandreas.hansson@arm.com> cd util/cxx_config
2110458Sandreas.hansson@arm.com
2210458Sandreas.hansson@arm.comThen edit Makefile to set the paths for PYTHON and run make
2310458Sandreas.hansson@arm.com
2410458Sandreas.hansson@arm.com> make
2510458Sandreas.hansson@arm.com
2610458Sandreas.hansson@arm.comMake a config file for the C++-configured gem5 using normal gem5
2710458Sandreas.hansson@arm.com
2810458Sandreas.hansson@arm.com> ../../build/ARM/gem5.opt ../../configs/example/se.py -c \
2910458Sandreas.hansson@arm.com>       ../../tests/test-progs/hello/bin/arm/linux/hello
3010458Sandreas.hansson@arm.com
3110458Sandreas.hansson@arm.comThe binary 'gem5.opt.cxx' can now be used to load in the generated config
3210458Sandreas.hansson@arm.comfile from the previous normal gem5 run.
3310458Sandreas.hansson@arm.com
3410458Sandreas.hansson@arm.comTry:
3510458Sandreas.hansson@arm.com
3610458Sandreas.hansson@arm.com> ./gem5.opt.cxx m5out/config.ini
3710458Sandreas.hansson@arm.com
3810458Sandreas.hansson@arm.comThis should print:
3910458Sandreas.hansson@arm.com
4010458Sandreas.hansson@arm.com> Hello world!
4110458Sandreas.hansson@arm.com
4210458Sandreas.hansson@arm.comThe .ini file can also be read by the Python .ini file reader example:
4310458Sandreas.hansson@arm.com
4410458Sandreas.hansson@arm.com> ../../build/ARM/gem5.opt ../../configs/example/read_config.py m5out/config.ini
45