Skip to content

Instantly share code, notes, and snippets.

@rajesh-s
Created February 21, 2022 00:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rajesh-s/497cef2729100394bcabf9f9b05b0a6e to your computer and use it in GitHub Desktop.
Save rajesh-s/497cef2729100394bcabf9f9b05b0a6e to your computer and use it in GitHub Desktop.

gem5

Getting started with gem5

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

How to build?

  • git clone https://gem5.googlesource.com/public/gem5 (Latest version is v21.0.0.0 at the time of writing, use git 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>. Use lscpu 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

What is gem5?

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment