marp | paginate | theme | title | author |
---|---|---|---|---|
true |
true |
gem5 |
Getting Started with gem5 |
Jason Lowe-Power |
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.
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.
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/
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.
- Introduction
- Computer architecture research intro
- Introduction to computer architecture research
- Example research idea: secure memory
- Why do we need simulators?
- Background on simulation
- What is is simulation and why does it matter
- gem5 history
- Getting started with gem5
- Getting into the codespace environment
- Running your first simulation
- EXERCISE: Run your first simulation
- Computer architecture research intro
- 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
- gem5's standard library
- 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
- Modeling cores in gem5
Now we have a full "baseline" that's running!
- 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?
- SimObject intro
- Using gem5 for research
- Developing models to test secure memory
- 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
- Full system simulation
- Putting it all together
- Running FS simulation with secure memory
- Advanced developing gem5 models
- Modeling Cores
- New instructions
- How the execution model works
- Debugging
- Modeling cache coherence with Ruby and SLICC
- Ruby intro
- Structure of SLICC
- Building/running/configuring protocols
- Debugging
- Ruby network
- (Note to Jason: could do a whole day here if split like before.)
- Extending gem5
- Probe points
- Generic cache object
- Base utilities (e.g., bitset)
- Random numbers
- Signal ports?
- Using the CHI protocol
- How is CHI different from other protocols?
- Configuring a CHI hierarchy
- Modeling the on-chip network with Garnet
- Garnet intro
- Building/running/configuring networks
- Debugging
- Ports and memory-based SimObjects
- Idea of ports (request/response), packets, interface
- A simple memory object that forwards things
- Connecting ports and writing config files
- Adding stats to a SimObject
- Adding latency and and modeling buffers/computing time
- Power modeling
- 👉 EXERCISE: Running a power simulation
- Modeling Cores
- 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
- 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
- We'll be going mostly top-down
- How to use gem5
- How to each model can be used
- 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
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!
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.
We will also have questions for you to answer?
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>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 |
- Bootcamp website (Maybe you're here now)
- Source for bootcamp materials (You'll work here)
- GitHub Classroom (Needed to use codespaces)
- gem5 code
- gem5 website
- gem5 YouTube
- gem5 Slack (for asking offline questions)