README revision 11099:69fb77726e9e
110152Satgutier@umich.eduThis directory contains a demo of a coupling between gem5 and SystemC-TLM.
210152Satgutier@umich.eduIt is based on the gem5-systemc implementation in utils/systemc.
310152Satgutier@umich.eduFirst a simple example with gem5's traffic generator is shown, later an full
410152Satgutier@umich.edusystem example.
510152Satgutier@umich.edu
610152Satgutier@umich.eduFiles:
710152Satgutier@umich.edu
810152Satgutier@umich.edu    main.cc                -- demonstration top level
910152Satgutier@umich.edu    sc_port.{cc,hh}        -- transactor that translates beween gem5 and tlm
1010152Satgutier@umich.edu    sc_mm.{cc,hh}          -- implementation of a tlm memory manager
1110152Satgutier@umich.edu    sc_ext.{cc,hh}         -- a TLM extension that carries the gem5 packet
1210152Satgutier@umich.edu    sc_target.{cc,hh}      -- an example TLM LT/AT memory module
1310152Satgutier@umich.edu    tlm.py                 -- simple gem5 configuration
1410152Satgutier@umich.edu    tgen.cfg               -- configuration file for the traceplayer
1510152Satgutier@umich.edu
1610152Satgutier@umich.eduOther Files will be used from utils/systemc example:
1710152Satgutier@umich.edu
1810152Satgutier@umich.edu    sc_logger.{cc,hh},
1910152Satgutier@umich.edu    sc_module.{cc,hh},
2010152Satgutier@umich.edu    sc_gem5_control.{cc,hh},
2110152Satgutier@umich.edu    stats.{cc,hh}
2210152Satgutier@umich.edu
2310152Satgutier@umich.edu
2410152Satgutier@umich.eduI. Traffic Generator Setup
2510152Satgutier@umich.edu==========================
2610152Satgutier@umich.edu
2710152Satgutier@umich.eduTo build:
2810152Satgutier@umich.edu
2910152Satgutier@umich.eduFirst build a normal gem5 (cxx-config not needed, Python needed).
3010152Satgutier@umich.eduSecond build gem5 as a library with cxx-config support and (optionally)
3110152Satgutier@umich.eduwithout python.
3210152Satgutier@umich.edu
3310152Satgutier@umich.edu> cd ../..
3410152Satgutier@umich.edu> scons build/ARM/gem5.opt
3510152Satgutier@umich.edu> scons --with-cxx-config --without-python build/ARM/libgem5_opt.so
3610152Satgutier@umich.edu> cd util/tlm
3710152Satgutier@umich.edu
3810152Satgutier@umich.eduSet a proper LD_LIBRARY_PATH e.g. for bash:
3910152Satgutier@umich.edu> export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/path/to/gem5/build/ARM/"
4010152Satgutier@umich.edu
4110152Satgutier@umich.eduThen edit the Makefile to set the paths for SystemC and run make
4210152Satgutier@umich.edu
4310152Satgutier@umich.edu> make
4410152Satgutier@umich.edu
4510152Satgutier@umich.eduMake a config file for the C++-configured gem5 using normal gem5
4610152Satgutier@umich.edu
4710152Satgutier@umich.edu> ../../build/ARM/gem5.opt ./tlm.py
4810152Satgutier@umich.edu
4910152Satgutier@umich.eduThe message "fatal: Can't find port handler type 'tlm'" is okay.
5010152Satgutier@umich.eduThe configuration will be stored in the m5out/ directory
5110152Satgutier@umich.edu
5210152Satgutier@umich.eduThe binary 'gem5.opt.sc', that has been created in the make step,
5310152Satgutier@umich.educan now be used to load in the generated config file from the previous
5410152Satgutier@umich.edunormal gem5 run.
5510152Satgutier@umich.edu
5610152Satgutier@umich.eduTry:
5710152Satgutier@umich.edu
5810152Satgutier@umich.edu> ./gem5.opt.sc m5out/config.ini -e 1000000
5910152Satgutier@umich.edu
6010152Satgutier@umich.eduIt should run a simulation for 1us.
6110152Satgutier@umich.edu
6210152Satgutier@umich.eduTo see more information what happens inside the TLM module use the -D flag:
6310152Satgutier@umich.edu
6410152Satgutier@umich.edu> ./gem5.opt.sc m5out/config.ini -e 1000000 -D
6510152Satgutier@umich.edu
6610152Satgutier@umich.eduTo see more information about the port coupling use:
6710152Satgutier@umich.edu
6810152Satgutier@umich.edu> ./gem5.opt.sc m5out/config.ini -e 1000000 -d ExternalPort
6910152Satgutier@umich.edu
7010152Satgutier@umich.eduII. Full System Setup
7110152Satgutier@umich.edu=====================
7210152Satgutier@umich.edu
7310152Satgutier@umich.eduBuild gem5 as discribed in Section I. Then, make a config file for the
7410152Satgutier@umich.eduC++-configured gem5 using normal gem5
7510152Satgutier@umich.edu
7610152Satgutier@umich.edu> ../../build/ARM/gem5.opt ../../configs/example/fs.py --tlm-memory=memory \
7710152Satgutier@umich.edu  --cpu-type=timing --num-cpu=1 --mem-type=SimpleMemory --mem-size=512MB   \
7810152Satgutier@umich.edu  --mem-channels=1  --caches --l2cache --machine-type=VExpress_EMM         \
7910152Satgutier@umich.edu  --dtb-filename=vexpress.aarch32.ll_20131205.0-gem5.1cpu.dtb              \
8010152Satgutier@umich.edu  --kernel=vmlinux.aarch32.ll_20131205.0-gem5                              \
8110152Satgutier@umich.edu  --disk-image=linux-aarch32-ael.img
8210152Satgutier@umich.edu
8310152Satgutier@umich.eduThe message "fatal: Can't find port handler type 'tlm'" is okay.
8410152Satgutier@umich.eduThe configuration will be stored in the m5out/ directory
8510152Satgutier@umich.edu
8610152Satgutier@umich.eduThe binary 'gem5.opt.sc' can now be used to load in the generated config
8710152Satgutier@umich.edufile from the previous normal gem5 run.
8810152Satgutier@umich.edu
8910152Satgutier@umich.eduTry:
9010152Satgutier@umich.edu
9110152Satgutier@umich.edu> ./gem5.opt.sc m5out/config.ini -o 2147483648
9210152Satgutier@umich.edu
9310152Satgutier@umich.eduThe parameter -o specifies the begining of the memory region (0x80000000).
9410152Satgutier@umich.eduThe system should boot now.
9510152Satgutier@umich.edu
9610152Satgutier@umich.eduFor conveniance a run_gem5.sh file holds all those commands
9710152Satgutier@umich.edu