Skip to content

Latest commit

 

History

History
342 lines (259 loc) · 11.7 KB

00-introduction-to-bootcamp.md

File metadata and controls

342 lines (259 loc) · 11.7 KB
marp paginate theme title author
true
true
gem5
Getting Started with gem5
Jason Lowe-Power

Welcome to the gem5 bootcamp!


About the overall structure of the bootcamp

These slides and are available at https://gem5bootcamp.github.io/latin-america-2024 for you to follow along.

(Note: They will be archived at https://gem5bootcamp.github.io/latin-america-2024)

The source for the slides, and what you'll be using throughout the bootcamp can be found on github at https://github.com/gem5bootcamp/latin-america-2024

Note: Don't clone that repo, yet. We'll do that in a bit.


A bit about us

I am Prof. Jason Lowe-Power (he/him). I am an associate professor in the Computer Science Department and the Project Management Committee chair for the gem5 project.

I lead the Davis Computer Architecture Research (DArchR) Group.

https://arch.cs.ucdavis.edu

UC Davis logo width:500px

DArchR logo width:550px


A bit about us

I am Prof. Tamara Silbergleit Lehman (she/her). I am an assistant professor in the Electrical, Computer and Energy Engineering (ECEE) Department at the University of Colorado Boulder (CU Boulder). Research Interests: Computer architecture security

Boulder Computer Architecture Research Lab (BCARL) https://www.colorado.edu/faculty/lehmantamara/

CU Boulder Logo w:450px center

Note: interested in applying to the PhD program at CU Boulder? Ask me how to waive the application fee. Application deadline is December 15th 2024.


Contributors to the bootcamp

Everyone who has contributed to the bootcamp width:1200px


Plan for the week

Day 1

  • Introduction
  • Using gem5
    • gem5's standard library
      • Quick overview of stdlib ideas (board, processor, cache hierarchy, memory)
      • EXERCISE: Building a simple Arm simulation
        • Outcome: Run a real workload in SE mode and look at stats
      • Quick overview of available components in stdlib
      • The idea of the simulator
        • Useful simulator functions (set_max_ticks/instructions)
    • Modeling memory in gem5
      • Memory models in gem5
    • Traffic generators
      • Using traffic generator (Test board)
      • EXERCISE: Using the traffic generator to test memory
      • EXERCISE: Creating a new (hybrid) traffic generator
    • Modeling caches in gem5
      • Cache models in gem5 (Ruby and classic)
      • EXERCISE: 3 level classic cache hierarchy
      • 👉 Replacement policies
      • 👉 Tag policies
      • Tradeoffs between classic and Ruby
      • HOMEWORK: Example of using a Ruby hierarchy
      • Look at the gem5 generated statistics

Day 2

  • Using gem5
    • Modeling cores in gem5
      • Types of CPU models in gem5
      • EXERCISE: (Optional) Comparison of atomic and timing CPU
      • Look at the gem5 generated statistics
      • EXERCISE: Create a two custom out-of-order cores and compare
      • 👉 Branch predictors
      • 👉 Overview of ISAs and tradeoffs
    • Running applications in gem5
      • Intro to syscall emulation mode
      • The gem5-bridge utility and library
      • Cross compiling
      • EXERCISE: Create your own workload
    • Using gem5 resources
      • Overview of resources, workloads, and suites
      • Multisim
      • EXERCISE: Running suite and seeing different results from different apps

Now we have a full "baseline" that's running!

Day 3

  • Developing gem5 models
    • SimObject intro
      • Development environment, code style, git branches
      • The most simple SimObject
      • Simple run script
      • How to add parameters to a SimObject
    • Debugging and debug flags
      • How to enable debug flags (examples of DRAM and Exec)
      • --debug-help
      • Adding a new debug flag
      • Functions other than DPRINTF
      • Panic/fatal/assert
      • gdb?
    • Event-driven simulation
      • Creating a simple callback event
      • Scheduling events
      • Modeling bandwidth and latency with events
      • Other SimObjects as parameters
      • Hello/Goodbye example with buffer
      • Clock domains?

Day 4

  • Using gem5 for research
    • Developing models to test secure memory

Day 5

  • Advanced running in gem5
    • Full system simulation
      • What is full system simulation?
      • Basics of booting up a real system in gem5
      • Running in FS mode
      • m5term to interact with a running system
      • "what do to when linux boots"
        • commands
      • Set kernel disk workload
      • Exit events
        • Simulation loop
        • Types of exit events
      • Creating disk images using packer and qemu
      • Extending/modifying a gem5 disk image
    • Accelerating simulation
      • Switchable processor
      • KVM fast forwarding
      • 👉 EXERCISE: Running a simulation with KVM, switching, complex exits, and measuring
      • Checkpointing
      • 👉 EXERCISE: Running many different configs with checkpoint
    • Sampled simulation with gem5
      • Simpoint ideas
      • Simpoint analysis
      • Simpoint checkpoints
      • How to analyze sampled simulation data
      • EXERCISE: Running a simpoint simulation
      • Loopoint/Elfies
      • Statistical simulation ideas
      • EXERCISE Statistical simulation running and analysis
  • Putting it all together
    • Running FS simulation with secure memory

Extra stuff

  • Advanced developing gem5 models

Our goals for the gem5 bootcamp

  • Make gem5 less painful and flatten the learning curve
  • Give you a vocabulary for asking questions​
  • Provide a reference for the future​
  • Give you material to take back and teach your colleagues

Other likely outcomes

  • You will be overwhelmed by the amount of information and how large gem5 is
    • That's OK! You can take these materials with you and refer back to them
  • You will not understand everything
    • That's OK! You can ask questions as we go

How this is going to work

  • We'll be going mostly top-down
    1. How to use gem5
    2. How to each model can be used
    3. How to develop your own models and modify existing models
  • Highly iterative:
    • You'll see the same thing over and over
    • Each time it will be one level deeper
  • Lots of coding examples
    • Both live coding and practice problems

Coding examples

You can write the following code

print("Hello, world!")
print("You'll be seeing a lot of Python code")
print("The slides will be a reference, but we'll be doing a lot of live coding!")

And you'll see this output.

Hello, world!
You'll be seeing a lot of Python code
The slides will be a reference, but we'll be doing a lot of live coding!

Exercises

Throughout the bootcamp, we'll have exercises for you to work on.

These exercises are designed to help you learn the material.

We will give you step-by-step instructions for each exercise.

Questions

We will also have questions for you to answer?


Slido

We'll be using Slido for questions and answers.

<iframe src="https://app.sli.do/event/qpr43XWrbjYJCdE3GHGCWg/embed/polls/428b4b2e-486e-47cb-be20-8bd2d5dd84a1" width="100%" height="440"></iframe>

Bootcamp logistics

We'll be teaching each day from 9:00 a.m. - 12:00 p.m. and from 1:00 p.m. - 4:00 p.m.

We will be in the laboratories of pavilion 0+inf, but we'll be in different rooms each day.

Día Laboratorio
Lunes 25/11 Labo 1110
Martes 26/11 Labo 1111
Miércoles 27/11 Labo 1110
Jueves 28/11 Labo 1108
Viernes 29/11 Labo 1108

Other admin things


Important resources

Bootcamp links

gem5 links