base: remove Trace::enabled flag
[gem5.git] / util / tlm / README
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
4 system example.
5
6 Files:
7
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
15
16 Other Files will be used from utils/systemc example:
17
18 sc_logger.{cc,hh},
19 sc_module.{cc,hh},
20 sc_gem5_control.{cc,hh},
21 stats.{cc,hh}
22
23
24 I. Traffic Generator Setup
25 ==========================
26
27 To build:
28
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)
31 without python.
32
33 > cd ../..
34 > scons build/ARM/gem5.opt
35 > scons --with-cxx-config --without-python build/ARM/libgem5_opt.so
36 > cd util/tlm
37
38 Set a proper LD_LIBRARY_PATH e.g. for bash:
39 > export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/path/to/gem5/build/ARM/"
40
41 Then edit the Makefile to set the paths for SystemC and run make
42
43 > make
44
45 Make a config file for the C++-configured gem5 using normal gem5
46
47 > ../../build/ARM/gem5.opt ./tlm.py
48
49 The message "fatal: Can't find port handler type 'tlm'" is okay.
50 The configuration will be stored in the m5out/ directory
51
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
54 normal gem5 run.
55
56 Try:
57
58 > ./gem5.opt.sc m5out/config.ini -e 1000000
59
60 It should run a simulation for 1us.
61
62 To see more information what happens inside the TLM module use the -D flag:
63
64 > ./gem5.opt.sc m5out/config.ini -e 1000000 -D
65
66 To see more information about the port coupling use:
67
68 > ./gem5.opt.sc m5out/config.ini -e 1000000 -d ExternalPort
69
70 II. Full System Setup
71 =====================
72
73 Build gem5 as discribed in Section I. Then, make a config file for the
74 C++-configured gem5 using normal gem5
75
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
82
83 The message "fatal: Can't find port handler type 'tlm'" is okay.
84 The configuration will be stored in the m5out/ directory
85
86 The binary 'gem5.opt.sc' can now be used to load in the generated config
87 file from the previous normal gem5 run.
88
89 Try:
90
91 > ./gem5.opt.sc m5out/config.ini -o 2147483648
92
93 The parameter -o specifies the begining of the memory region (0x80000000).
94 The system should boot now.
95
96 For conveniance a run_gem5.sh file holds all those commands