1 This directory contains a demo of a coupling between gem5 and SystemC-TLM.
2 It is based on the gem5-systemc implementation in utils/systemc.
3 First a simple example with gem5's traffic generator is shown, later an full
8 main.cc -- demonstration top level
9 sc_port.{cc,hh} -- transactor that translates beween gem5 and tlm
10 sc_mm.{cc,hh} -- implementation of a tlm memory manager
11 sc_ext.{cc,hh} -- a TLM extension that carries the gem5 packet
12 sc_target.{cc,hh} -- an example TLM LT/AT memory module
13 tlm.py -- simple gem5 configuration
14 tgen.cfg -- configuration file for the traceplayer
16 Other Files will be used from utils/systemc example:
20 sc_gem5_control.{cc,hh},
24 I. Traffic Generator Setup
25 ==========================
29 First build a normal gem5 (cxx-config not needed, Python needed).
30 Second build gem5 as a library with cxx-config support and (optionally)
34 > scons build/ARM/gem5.opt
35 > scons --with-cxx-config --without-python build/ARM/libgem5_opt.so
38 Set a proper LD_LIBRARY_PATH e.g. for bash:
39 > export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/path/to/gem5/build/ARM/"
41 Then edit the Makefile to set the paths for SystemC and run make
45 Make a config file for the C++-configured gem5 using normal gem5
47 > ../../build/ARM/gem5.opt ./tlm.py
49 The message "fatal: Can't find port handler type 'tlm'" is okay.
50 The configuration will be stored in the m5out/ directory
52 The binary 'gem5.opt.sc', that has been created in the make step,
53 can now be used to load in the generated config file from the previous
58 > ./gem5.opt.sc m5out/config.ini -e 1000000
60 It should run a simulation for 1us.
62 To see more information what happens inside the TLM module use the -D flag:
64 > ./gem5.opt.sc m5out/config.ini -e 1000000 -D
66 To see more information about the port coupling use:
68 > ./gem5.opt.sc m5out/config.ini -e 1000000 -d ExternalPort
73 Build gem5 as discribed in Section I. Then, make a config file for the
74 C++-configured gem5 using normal gem5
76 > ../../build/ARM/gem5.opt ../../configs/example/fs.py --tlm-memory=memory \
77 --cpu-type=timing --num-cpu=1 --mem-type=SimpleMemory --mem-size=512MB \
78 --mem-channels=1 --caches --l2cache --machine-type=VExpress_EMM \
79 --dtb-filename=vexpress.aarch32.ll_20131205.0-gem5.1cpu.dtb \
80 --kernel=vmlinux.aarch32.ll_20131205.0-gem5 \
81 --disk-image=linux-aarch32-ael.img
83 The message "fatal: Can't find port handler type 'tlm'" is okay.
84 The configuration will be stored in the m5out/ directory
86 The binary 'gem5.opt.sc' can now be used to load in the generated config
87 file from the previous normal gem5 run.
91 > ./gem5.opt.sc m5out/config.ini -o 2147483648
93 The parameter -o specifies the begining of the memory region (0x80000000).
94 The system should boot now.
96 For conveniance a run_gem5.sh file holds all those commands