The gem5 simulator is most useful for research when you build new models and new features on top of the current codebase. Thus, the most common way to use gem5 is to download the source and build it yourself. Reference
git clone https://gem5.googlesource.com/public/gem5
(Latest version is v21.0.0.0 at the time of writing, usegit describe --tags
to find the gem5 version.)- After cloning the source code, you can build gem5 by using scons.
scons build/X86/gem5.opt -j <NUMBER OF CPUs ON YOUR PLATFORM>
. Uselscpu
to find number of CPU or just use-j$(nproc)
- gem5’s interface is Python scripts. The gem5 binary reads in and executes the provided Python script which creates the system under test and executes the simulator.
build/X86/gem5.opt configs/learning_gem5/part1/simple.py
gem5 is a modular discrete event driven computer system simulator platform. That means that:
- gem5’s components can be rearranged, parameterized, extended or replaced easily to suit your needs.
- It simulates the passing of time as a series of discrete events.
- Its intended use is to simulate one or more computer systems in various ways.
- It’s more than just a simulator; it’s a simulator platform that lets you use as many of its premade components as you want to build up your own simulation system.
Full System Mode: Complete system with devices and an operating system SysCall Emulation Mode: User space only programs where system services are provided directly by the simulator