Skip to content
Snippets Groups Projects
Commit d9ba5e24 authored by Adrian Böckenkamp's avatar Adrian Böckenkamp
Browse files

gem5: more info about how to use and how to build

The recent information in how-to-use.txt and how-to-build.txt were
outdated.

Change-Id: I4e6536a0b56370717d6a09f4012862d300526313
parent f92557c2
No related branches found
No related tags found
No related merge requests found
...@@ -188,38 +188,49 @@ IPS: 66124283 average = 66964789 ...@@ -188,38 +188,49 @@ IPS: 66124283 average = 66964789
Building gem5: Building gem5:
********************************************************************** **********************************************************************
Fail* configuration: For the first time (incl. selecting an experiment):
------------------------------------------------------------ ------------------------------------------------------------
- BUILD_GEM5 ON 1. Change to the Fail* directory (expects to be in ${FAIL_DIR}) and
- BUILD_ARM ON create a new build directory.
- all configuration options specific for other simulators OFF $ cd ${FAIL_DIR}; mkdir build; cd build
- Release or Debug choice must match gem5 in the following 3. Start the configuration by typing
$ cmake ..
For the first time: 4. Modify the generated configuration according to your needs using
------------------------------------------------------------ $ ccmake .
1. Change to the gem5 simulator directory (expects to be in ${FAIL_DIR}): At least, you should set an experiment and turn on the following
$ cd simulators/gem5 flags: BUILD_GEM5 = BUILD_ARM = ON. Additionally, all config
2. Build gem5 using the commands below until it fails finding the fail-libs options specific for other simulator should be turned OFF. Finally,
3. Build fail edit ${FAIL_DIR}/src/core/sal/gem5/SConscript: search for a line
4. Select an experiment (see below) with "gStaticLibs" and ensure that this line lists all the various
5. Build gem5 again. THe fail-libs should be found now. target you want to include in the binary (especially your experiment
target and perhabs an additional plugin), i.e. change
Optimized build: -lfail-arch-test to -lfail-[EXPERIMENTNAME|PLUGINNAME].
------------------------------------------------------------ 5. Typing
$ cd ../simulator/gem5 $ make (or nice make -jN)
$ scons EXTRAS=../../src/core/sal/gem5 build/ARM/gem5.fast will start the build process of Fail* and gem5. This automatically
(add -jN for a parallel build) builds the debug variant for ARM targets. (Note that this build will
automatically include the ${FAIL_DIR}/src/core/sal/gem5 as an
Debug build: "EXTRAS" feature, see gem5/scons build system documentation for
------------------------------------------------------------ further information. That means, adding another directory containing
$ cd ../simulator/gem5 gem5-specific code requires to modify the gem5 build command, see
$ scons EXTRAS=../../src/core/sal/gem5 build/ARM/gem5.debug ${FAIL_DIR}/cmake/gem5.cmake.) The build process for gem5 currently
(add -jN for a parallel build) uses 9 cores for a parallel build regardless whether you specify a
different core count in the -jN option. This and various other stuff
Selecting an experiment: (e.g. a release build, i.e. using "gem5.fast" instead of "gem5.debug")
can be changed in the aforementioned gem5.cmake file.
After changes to Fail*/gem5 code (incl. aspect headers):
------------------------------------------------------------ ------------------------------------------------------------
1. Edit ../src/core/sal/gem5/SConscript 1. Clean the current build by typing
In line starting with (gStaticLibs = ...) change -lfail-arch-test to $ make gem5-allclean
-lfail-EXPERIMENTNAME (in your build dir ${FAIL_DIR}/build). This cleans the current
Fail* and gem5 build directories. Note that "make clean" only cleans
the Fail* build directory. Additionally note, that changing the
specified experiment target requires editing
${FAIL_DIR}/src/core/sal/gem5/SConscript (see above). Furthermore, all
remaining CMake remnants should be deleted:
$ find -name CMakeCache.txt | xargs rm
2. Rebuild by typing
$ make (or nice make -jN)
(as in the last step of the previous section).
...@@ -182,6 +182,13 @@ Steps to run an experiment with gem5: ...@@ -182,6 +182,13 @@ Steps to run an experiment with gem5:
1. Create a directory which will be used as gem5 system directory (which 1. Create a directory which will be used as gem5 system directory (which
will contain the guest system and boot image). Further called $SYSTEM. will contain the guest system and boot image). Further called $SYSTEM.
2. Create two directories $SYSTEM/binaries and $SYSTEM/disks. 2. Create two directories $SYSTEM/binaries and $SYSTEM/disks.
3. Put guestsystem kernel to $SYSTEM/binaries and boot image to $SYSTEM/disks 3. Put guestsystem kernel to $SYSTEM/binaries and boot image to $SYSTEM/disks.
4. Run gem5 with: For ARM targets, you can use the "linux-arm-ael.img" image contained in
http://www.gem5.org/dist/current/arm/arm-system-2011-08.tar.bz2
As an example, the resulting directory structure might look like this
boecke@kos:~/$FAIL_DIR/build/gem5sys$ find
./binaries/abo-simple-arm.elf # your experiment binary (!= gem5)
./disks/linux-arm-ael.img # the ARM image (FIXME: whats this exactly?)
./disks/boot.arm # the ARM bootloader (FIXME: dito)
4. Run gem5 in $FAIL_DIR/simulators/gem5/ with:
$ M5_PATH=$SYSTEM build/ARM/gem5.debug configs/example/fs.py --bare-metal --kernel kernelname $ M5_PATH=$SYSTEM build/ARM/gem5.debug configs/example/fs.py --bare-metal --kernel kernelname
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment