powerjg / learning_gem5 Goto Github PK
View Code? Open in Web Editor NEWLearning gem5 is a work-in-progress book to help gem5 users get started using gem5.
License: Creative Commons Attribution 4.0 International
Learning gem5 is a work-in-progress book to help gem5 users get started using gem5.
License: Creative Commons Attribution 4.0 International
Hi
I am trying to run fullsystem(ARM) on gem5 but I can not do it.please help me and guide me how to do it.
We should add some more details about event-driven simulation and what a "tick" is.
The tick rate is a constant 1ps. gem5 is an event-driven simulation and time is measured in "ticks", which is the time "quantum" (time is not continuous in gem5). Most objects in gem5 (e.g., CPU, cache, etc.) are a "ClockedObject" (they inherit from that class) and have a specified clock domain. This object-specific clock domain is what you should be modifying.
In the cache chapter, it would be good to use vectors instead of "new" for data.
To be in line with what I'm pushing to mainline gem5, make Hello->Simple until the 3rd? chapter. Basically, only have hello object for the hello-goodbye example.
I'll update the book to be more clear about how to get SCons to pick up the new protocol. The magic is to create a SConsopts file in the same directory as your protocol and add the line "protocol_dirs.append(str(Dir('.').abspath))". This tells the SLICC compiler to look in that directory when finding all of the protocols.
Here: http://learning.gem5.org/book/part3/MSI/cache-intro.html#first-steps-to-writing-a-protocol
fs_config.rst tries to link to chapters on kernel-chapter, full-system-arm-chapter, and m5-op-chapter. However, none of these keywords links to an actual chapter in the document.
Matt
In http://learning.gem5.org/book/part2/parameters.html, we update the following DPRINTF to print the name of the parameter object:
DPRINTF(Hello, "Created the hello object with the name %s\n", myName);
However, later in the same section, hello_object3.cc does not contain this change:
DPRINTF(Hello, "Created the hello object\n");
hello_object3.cc should be updated to reflect this change. The text in parameters.rst right before hello_object3.cc is also missing this change, but I can update that as part of an upcoming pull request.
Matt
Hello,
I would like to try the full system simulation example, so I downloaded scripts in this category, and try to run it in gem5
.
However, I got the following error:
โ gem5 ./build/X86/gem5.opt configs/cacheD/run.py
gem5 Simulator System. http://gem5.org
gem5 is copyrighted software; use the --copyright option for details.
gem5 compiled Dec 20 2016 20:11:15
gem5 started Dec 21 2016 13:22:58
gem5 executing on lrs-dwu01, pid 27677
command line: ./build/X86/gem5.opt configs/cacheD/run.py
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/work/gem5/src/python/m5/main.py", line 400, in main
exec filecode in scope
File "configs/test/run.py", line 49, in <module>
system = MySystem(opts)
File "configs/test/system.py", line 68, in __init__
x86.init_fs(self, self.membus)
File "configs/test/x86.py", line 85, in init_fs
addr_ranges = system.mem_ranges)
File "/home/work/gem5/src/python/m5/SimObject.py", line 1046, in __init__
setattr(self, key, val)
File "/home/work/gem5/src/python/m5/SimObject.py", line 1150, in __setattr__
% (self.__class__.__name__, attr)
AttributeError: Class Cache has no parameter hit_latency
Am I doing anything wrong here?
It would be a good idea to have links to the exact build version on github within the book.
Do this.
I think it would be a good idea to add a example of how to use gdb to debug programs in gem5. I'm not sure exactly where this would go, so at the moment this is mostly a suggestion, but I think it would be helpful as the current m5 instructions are somewhat opaque.
Matt
Before http://learning.gem5.org/book/part2/parameters.html, there are no comments in the hello_object.cc code that appears in the HTML. However, starting with this section, there are comments for member variables (myName, latency, timesLeft) that were previously introduced without comments. It's not a big deal, but it would be good to be consistent throughout.
Matt
You mentioned " Since we used a MemoryBandwidth parameter in the SimObject declaration, the bandwidth variable is automatically converted into bytes per tick", so shouldn't the below part (and in some other parts of the code) in bold be bytes_copied / bandwidth to gives us the number of ticks?
schedule(event, curTick() + bandwidth * bytes_copied)
Submitted by: Shilpika (https://piazza.com/class/j7z54vw7a5r2sl?cid=95)
Hi,
There is a typo in "part5/fs_config.rst". In the code for the createCacheHierarchy,
the self.membus is mistyped as self.mmubus.
def createCacheHierarchy(self):
.
.
.
# Connect the CPU TLBs directly to the mem.
self.cpu.itb.walker.port = self.mmubus.slave # this should be self.membus.slave
self.cpu.dtb.walker.port = self.mmubus.slave # this should be self.membus.slave
Thanks for learning gem5 book.
Hi, All
I try to change a CPU type to DerivO3CPU, which is
From
system.cpu = TimingSimpleCPU()
to
system.cpu = DerivO3CPU()
And I run with command
./build/X86/gem5.opt configs/tutorial/simple.py
and I get this error
gem5 Simulator System. http://gem5.org
gem5 is copyrighted software; use the --copyright option for details.
gem5 compiled May 17 2018 21:48:59
gem5 started May 17 2018 22:26:11
gem5 executing on x1c, pid 28382
command line: ./build/X86/gem5.opt configs/tutorial/simple.py
Global frequency set at 1000000000000 ticks per second
warn: DRAM device capacity (8192 Mbytes) does not match the address range assigned (512 Mbytes)
0: system.remote_gdb: listening for remote gdb on port 7000
Beginning simulation!
info: Entering event queue @ 0. Starting simulation...
gem5.opt: build/X86/mem/xbar.cc:190: bool BaseXBar::Layer<SrcType, DstType>::tryTiming(SrcType*) [with SrcType = SlavePort; DstType = MasterPort]: Assertion `std::find(waitingForLayer.begin(), waitingForLayer.end(), src_port) == waitingForLayer.end()' failed.
Program aborted at tick 7319000
--- BEGIN LIBC BACKTRACE ---
./build/X86/gem5.opt(_Z15print_backtracev+0x28)[0x7230c8]
./build/X86/gem5.opt(_Z12abortHandleri+0x46)[0x735c46]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7fd01b353390]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7fd019d5b428]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7fd019d5d02a]
/lib/x86_64-linux-gnu/libc.so.6(+0x2dbd7)[0x7fd019d53bd7]
/lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7fd019d53c82]
./build/X86/gem5.opt(_ZN8BaseXBar5LayerI9SlavePort10MasterPortE9tryTimingEPS1_+0x3b0)[0x130c490]
./build/X86/gem5.opt(_ZN12CoherentXBar13recvTimingReqEP6Packets+0x46b)[0x128d31b]
./build/X86/gem5.opt(_ZN7LSQUnitI9O3CPUImplE4readEP7RequestS3_S3_i+0x96d)[0x1471b8d]
./build/X86/gem5.opt(_ZN11BaseDynInstI9O3CPUImplE15initiateMemReadEmj5FlagsImE+0x3aa)[0x1472c0a]
./build/X86/gem5.opt(_ZNK10X86ISAInst5LdBig11initiateAccEP11ExecContextPN5Trace10InstRecordE+0x128)[0xc8fe48]
./build/X86/gem5.opt(_ZN13BaseO3DynInstI9O3CPUImplE11initiateAccEv+0x45)[0x149b935]
./build/X86/gem5.opt(_ZN7LSQUnitI9O3CPUImplE11executeLoadER14RefCountingPtrI13BaseO3DynInstIS0_EE+0x55)[0x14ceae5]
./build/X86/gem5.opt(_ZN3LSQI9O3CPUImplE11executeLoadER14RefCountingPtrI13BaseO3DynInstIS0_EE+0x37)[0x14c4537]
./build/X86/gem5.opt(_ZN10DefaultIEWI9O3CPUImplE12executeInstsEv+0x9ad)[0x14b221d]
./build/X86/gem5.opt(_ZN10DefaultIEWI9O3CPUImplE4tickEv+0x122)[0x14b68d2]
./build/X86/gem5.opt(_ZN9FullO3CPUI9O3CPUImplE4tickEv+0x133)[0x148abc3]
./build/X86/gem5.opt(_ZN10EventQueue10serviceOneEv+0xc5)[0x7298b5]
./build/X86/gem5.opt(_Z9doSimLoopP10EventQueue+0x50)[0x741940]
./build/X86/gem5.opt(_Z8simulatem+0xd1b)[0x742a2b]
./build/X86/gem5.opt[0x15c7d1a]
./build/X86/gem5.opt[0x7899d5]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x7852)[0x7fd01b610772]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x85c)[0x7fd01b74705c]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x6ffd)[0x7fd01b60ff1d]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x85c)[0x7fd01b74705c]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCode+0x19)[0x7fd01b608da9]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x613b)[0x7fd01b60f05b]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x85c)[0x7fd01b74705c]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x6ffd)[0x7fd01b60ff1d]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x85c)[0x7fd01b74705c]
--- END LIBC BACKTRACE ---
Aborted (core dumped)
Am I missing anything?
Thanks.
In Chapter 1:
The cmd at the end of http://learning.gem5.org/book/part1/cache_config.html:
build/X86/gem5.opt configs/tutorial/two_level_opts.py --l2_size='1MB' --l1d_size='128kB'
However in the head of the gem5 repository you have the sample code already from Chapter 1, under configs/learning_gem5/part1
which contradicts configs/tutorial/
used in the text. There does not appear to be any reference to the first path in the book.
In Chapter 2:
The cmd taken from the gem5 ouput at http://learning.gem5.org/book/part2/helloobject.html:
build/X86/gem5.opt configs/learning_gem5/part2/run_hello.py
This now refers to configs/learning_gem5/part2/
dir again. It is also confusing as there are now two learning_gem5
directories in configs
and src
.
Finally it would be very helpful if the sections in general provided a summary of which files are placed where for the examples and any commands run. Perhaps a shell script can unpack them, given a gem5 repo path? It will be much easier for the user to reproduce the examples.
I am willing to make these changes however I cannot guarantee the time soon. Thanks for producing such a helpful book so far!
what parameters set on sieve.cpp and sieve-config.py files. please help
Not sure if this is the preferred channel for bug reporting. Apologize in advance if it isn't.
There seems to be a typo in the init function for L2Cache.
- super(L2Cache, self).init(options)
The attached .py has the correct code.
Thanks for the clear and concise tutorial.
Hi all,
I want to ask if you know anything about this backtrace message I have when I try to restore from a checkpoint with DerivO3CPU using LTAGE.
gem5.opt: build/X86/cpu/pred/ltage.cc:101: virtual void LTAGE::update(ThreadID, Addr, bool, void*, bool, const StaticInstPtr&, Addr): Assertion `corrTarget != MaxAddr' failed.
Program aborted at tick 30396466306134
--- BEGIN LIBC BACKTRACE ---
/home/students/cs/2017/iconst01/EXTRASPACE/Gem5_Giannis/gem5/build/X86/gem5.opt(_Z15print_backtracev+0x15)[0xd87f45]
/home/students/cs/2017/iconst01/EXTRASPACE/Gem5_Giannis/gem5/build/X86/gem5.opt(_Z12abortHandleri+0x39)[0xd925e9]
/lib64/libpthread.so.0(+0xf7e0)[0x2add9f7cc7e0]
/lib64/libc.so.6(gsignal+0x35)[0x2adda1099495]
/lib64/libc.so.6(abort+0x175)[0x2adda109ac75]
/lib64/libc.so.6(+0x2b60e)[0x2adda109260e]
/lib64/libc.so.6(__assert_perror_fail+0x0)[0x2adda10926d0]
/home/students/cs/2017/iconst01/EXTRASPACE/Gem5_Giannis/gem5/build/X86/gem5.opt(_ZN5LTAGE6updateEsmbPvbRK14RefCountingPtrI10StaticInstEm+0x347)[0xea5c17]
/home/students/cs/2017/iconst01/EXTRASPACE/Gem5_Giannis/gem5/build/X86/gem5.opt(_ZN9BPredUnit6squashERKmRKN6X86ISA7PCStateEbs+0x21d)[0xe96a5d]
/home/students/cs/2017/iconst01/EXTRASPACE/Gem5_Giannis/gem5/build/X86/gem5.opt(_ZN12DefaultFetchI9O3CPUImplE21checkSignalsAndUpdateEs+0x30e)[0xefd3de]
/home/students/cs/2017/iconst01/EXTRASPACE/Gem5_Giannis/gem5/build/X86/gem5.opt(_ZN12DefaultFetchI9O3CPUImplE4tickEv+0x73)[0xf03583]
/home/students/cs/2017/iconst01/EXTRASPACE/Gem5_Giannis/gem5/build/X86/gem5.opt(_ZN9FullO3CPUI9O3CPUImplE4tickEv+0x5f)[0xee565f]
/home/students/cs/2017/iconst01/EXTRASPACE/Gem5_Giannis/gem5/build/X86/gem5.opt(_ZN10EventQueue10serviceOneEv+0xc5)[0xd8dd05]
/home/students/cs/2017/iconst01/EXTRASPACE/Gem5_Giannis/gem5/build/X86/gem5.opt(_Z9doSimLoopP10EventQueue+0x38)[0xd9ba68]
/home/students/cs/2017/iconst01/EXTRASPACE/Gem5_Giannis/gem5/build/X86/gem5.opt(_Z8simulatem+0xd3a)[0xd9cb3a]
/home/students/cs/2017/iconst01/EXTRASPACE/Gem5_Giannis/gem5/build/X86/gem5.opt[0x152b70c]
/home/students/cs/2017/iconst01/EXTRASPACE/Gem5_Giannis/gem5/build/X86/gem5.opt[0x998de1]
/home/students/cs/2017/iconst01/EXTRASPACE/Gem5_Giannis/gem5/build/X86/gem5.opt(PyEval_EvalFrameEx+0x5266)[0x15f0506]
/home/students/cs/2017/iconst01/EXTRASPACE/Gem5_Giannis/gem5/build/X86/gem5.opt(PyEval_EvalCodeEx+0x877)[0x15f2477]
/home/students/cs/2017/iconst01/EXTRASPACE/Gem5_Giannis/gem5/build/X86/gem5.opt(PyEval_EvalFrameEx+0x56f3)[0x15f0993]
/home/students/cs/2017/iconst01/EXTRASPACE/Gem5_Giannis/gem5/build/X86/gem5.opt(PyEval_EvalCodeEx+0x877)[0x15f2477]
/home/students/cs/2017/iconst01/EXTRASPACE/Gem5_Giannis/gem5/build/X86/gem5.opt(PyEval_EvalFrameEx+0x56f3)[0x15f0993]
/home/students/cs/2017/iconst01/EXTRASPACE/Gem5_Giannis/gem5/build/X86/gem5.opt(PyEval_EvalCodeEx+0x877)[0x15f2477]
/home/students/cs/2017/iconst01/EXTRASPACE/Gem5_Giannis/gem5/build/X86/gem5.opt(PyEval_EvalFrameEx+0x56f3)[0x15f0993]
/home/students/cs/2017/iconst01/EXTRASPACE/Gem5_Giannis/gem5/build/X86/gem5.opt(PyEval_EvalCodeEx+0x877)[0x15f2477]
/home/students/cs/2017/iconst01/EXTRASPACE/Gem5_Giannis/gem5/build/X86/gem5.opt(PyEval_EvalCode+0x32)[0x15f2582]
/home/students/cs/2017/iconst01/EXTRASPACE/Gem5_Giannis/gem5/build/X86/gem5.opt(PyEval_EvalFrameEx+0x5f69)[0x15f1209]
/home/students/cs/2017/iconst01/EXTRASPACE/Gem5_Giannis/gem5/build/X86/gem5.opt(PyEval_EvalCodeEx+0x877)[0x15f2477]
/home/students/cs/2017/iconst01/EXTRASPACE/Gem5_Giannis/gem5/build/X86/gem5.opt(PyEval_EvalFrameEx+0x56f3)[0x15f0993]
/home/students/cs/2017/iconst01/EXTRASPACE/Gem5_Giannis/gem5/build/X86/gem5.opt(PyEval_EvalCodeEx+0x877)[0x15f2477]
/home/students/cs/2017/iconst01/EXTRASPACE/Gem5_Giannis/gem5/build/X86/gem5.opt(PyEval_EvalCode+0x32)[0x15f2582]
/home/students/cs/2017/iconst01/EXTRASPACE/Gem5_Giannis/gem5/build/X86/gem5.opt(PyRun_StringFlags+0x11b)[0x161368b]
--- END LIBC BACKTRACE ---
This is the command I run :
build/X86/gem5.opt -d sim_gcc configs/example/fs.py --bench-image=gcc.img --script=gcc.rcS --cpu-type=DerivO3CPU --rel-max-tick=0 -r 22492288158 --at-instruction --checkpoint-dir=gcccpts/ --restore-with-cpu=DerivO3CPU --mem-size=8GB --caches --l2cache --num-l2caches=1 -I 100000000
Thanks in advance,
Giannis
Hi, Sir,
I want to build gem5 with cmake. Is there any tips to be followed? Thanks a lot!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.