README revision 10993
17893SN/AThis directory contains a demo of a coupling between gem5 and SystemC-TLM.
27893SN/AIt is based on the gem5-systemc implementation in utils/systemc.
37893SN/AFirst a simple example with gem5's traffic generator is shown, later an full
410036SAli.Saidi@ARM.comsystem example.
58835SAli.Saidi@ARM.com
610036SAli.Saidi@ARM.comFiles:
77893SN/A
87893SN/A    main.cc                -- demonstration top level
97893SN/A    sc_port.{cc,hh}        -- transactor that translates beween gem5 and tlm
107893SN/A    sc_mm.{cc,hh}          -- implementation of a tlm memory manager
117893SN/A    sc_ext.{cc,hh}         -- a TLM extension that carries the gem5 packet
127893SN/A    sc_target.{cc,hh}      -- an example TLM LT/AT memory module
1310315Snilay@cs.wisc.edu    tlm.py                 -- simple gem5 configuration
148835SAli.Saidi@ARM.com    tgen.cfg               -- configuration file for the traceplayer
159885Sstever@gmail.com
169885Sstever@gmail.comOther Files will be used from utils/systemc example:
1711570SCurtis.Dunham@arm.com
1810036SAli.Saidi@ARM.com    sc_logger.{cc,hh},
1911312Santhony.gutierrez@amd.com    sc_module.{cc,hh},
208835SAli.Saidi@ARM.com    sc_gem5_control.{cc,hh},
218835SAli.Saidi@ARM.com    stats.{cc,hh}
2210315Snilay@cs.wisc.edu
2311960Sgabeblack@google.com
248835SAli.Saidi@ARM.comI. Traffic Generator Setup
2510242Ssteve.reinhardt@amd.com==========================
269449SAli.Saidi@ARM.com
279449SAli.Saidi@ARM.comTo build:
288464SN/A
2910736Snilay@cs.wisc.eduFirst build a normal gem5 (cxx-config not needed, Python needed).
3011219Snilay@cs.wisc.eduSecond build gem5 as a library with cxx-config support and (optionally)
318721SN/Awithout python.
3211570SCurtis.Dunham@arm.com
3311570SCurtis.Dunham@arm.com> cd ../..
3411570SCurtis.Dunham@arm.com> scons build/ARM/gem5.opt
3511570SCurtis.Dunham@arm.com> scons --with-cxx-config --without-python build/ARM/libgem5_opt.so
368835SAli.Saidi@ARM.com> cd util/systemc_tlm
378835SAli.Saidi@ARM.com
3811440SCurtis.Dunham@arm.comSet a proper LD_LIBRARY_PATH e.g. for bash:
3911440SCurtis.Dunham@arm.com> export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/path/to/gem5/build/ARM/"
407935SN/A
417935SN/AThen edit the Makefile to set the paths for SystemC and run make
427935SN/A
437935SN/A> make
447935SN/A
457935SN/AMake a config file for the C++-configured gem5 using normal gem5
467935SN/A
478983Snate@binkert.org> ../../build/ARM/gem5.opt ./tlm.py
487893SN/A
499885Sstever@gmail.comThe message "fatal: Can't find port handler type 'tlm'" is okay.
509885Sstever@gmail.comThe configuration will be stored in the m5out/ directory
519885Sstever@gmail.com
5210315Snilay@cs.wisc.eduThe binary 'gem5.opt.sc', that has been created in the make step,
5310036SAli.Saidi@ARM.comcan now be used to load in the generated config file from the previous
5410315Snilay@cs.wisc.edunormal gem5 run.
559885Sstever@gmail.com
569885Sstever@gmail.comTry:
577893SN/A
587893SN/A> ./gem5.opt.sc m5out/config.ini -e 1000000
599885Sstever@gmail.com
607893SN/AIt should run a simulation for 1us.
617893SN/A
628241SN/ATo see more information what happens inside the TLM module use the -D flag:
638241SN/A
647893SN/A> ./gem5.opt.sc m5out/config.ini -e 1000000 -D
657893SN/A
667893SN/ATo see more information about the port coupling use:
677893SN/A
689481Snilay@cs.wisc.edu> ./gem5.opt.sc m5out/config.ini -e 1000000 -d ExternalPort
6911960Sgabeblack@google.com
707893SN/AII. Full System Setup
719885Sstever@gmail.com=====================
727893SN/A
737893SN/ABuild gem5 as discribed in Section I. Then, make a config file for the
747893SN/AC++-configured gem5 using normal gem5
757893SN/A
767893SN/A> ../../build/ARM/gem5.opt ../../configs/example/fs.py --tlm-memory=memory \
777893SN/A  --cpu-type=timing --num-cpu=1 --mem-type=SimpleMemory --mem-size=512MB   \
787893SN/A  --mem-channels=1  --caches --l2cache --machine-type=VExpress_EMM         \
797893SN/A  --dtb-filename=vexpress.aarch32.ll_20131205.0-gem5.1cpu.dtb              \
807893SN/A  --kernel=vmlinux.aarch32.ll_20131205.0-gem5                              \
8111570SCurtis.Dunham@arm.com  --disk-image=linux-aarch32-ael.img
827893SN/A
837893SN/AThe message "fatal: Can't find port handler type 'tlm'" is okay.
848835SAli.Saidi@ARM.comThe configuration will be stored in the m5out/ directory
857893SN/A
867893SN/AThe binary 'gem5.opt.sc' can now be used to load in the generated config
8710036SAli.Saidi@ARM.comfile from the previous normal gem5 run.
8810036SAli.Saidi@ARM.com
8910451Snilay@cs.wisc.eduTry:
907893SN/A
917893SN/A> ./gem5.opt.sc m5out/config.ini -o 2147483648
927893SN/A
937893SN/AThe parameter -o specifies the begining of the memory region (0x80000000).
947893SN/AThe system should boot now.
957893SN/A
967893SN/AFor conveniance a run_gem5.sh file holds all those commands
977893SN/A