Part III: Ruby

OPEN UP THE PDF OF THE PRIMER

Overview

  • Slides on ruby overview

  • Start looking at a state machine file
  • Slide on output
../_images/switch.png

Switch!

  • Look at MSI-cache.sm
    • Show the top part with the parameters
  • Build the protocol
  • Note: May want to use a different build directory (e.g., X86_MSI)
scons -j100 build/X86/gem5.opt PROTOCOL=MSI SLICC_HTML=True

vi src/learning_gem5/part3/MSI-cache.sm

ls build/X86/mem/protocol

vi build/X86/mem/protocol/L1Cache_Controller.py
../_images/switch.png

Switch!


Parameters to state machines

  • Talk about the parts of the state machine file
  • Talk about cachememory
  • talk about message buffers
../_images/switch.png

Switch!

  • Show the message buffers in the cache and the directory
vi src/learning_gem5/part3/MSI-cache.sh
vi src/learning_gem5/part3/MSI-dir.sh
  • Talk about the mandatory event queue
  • Talk about the memory buffer

States and events and other function

  • talk about states and show the MSI-cache.sm states
vi src/learning_gem5/part3/MSI-cache.sh
  • talk about events and show the MSI-cache events
  • Show the other functions, etc.
    • Entry
    • TBE/table
    • Declarations
    • other functions
../_images/switch.png

Switch!


In/out ports

  • High-level out_port and in_port stuff
../_images/switch.png

Switch!

  • Look at MSI-cache.sm
vi src/learning_gem5/part3/MSI-cache.sh
  • Talk about the message types
  • Talk about how message buffer above links to the ports
  • Look at the message and make a decision
  • THIS IS THE ONLY PLACE YOU’re ALLOWED TO USE IF STATEMENTS
  • Start with mandatory queue
  • Talk about how peek automatically populates in_msg
../_images/switch.png

Switch!

  • go through slide.

../_images/switch.png

Switch!

Actions

  • Look at the actions in MSI-cache.sm
  • talk about automatic variables and where they come from (passed in in in_port)
  • talk about enqueue and out_msg
  • nesting peek and enqueue
  • NO IF STATEMENTS!
  • Special z_stall.
../_images/switch.png

Switch!

  • go through slide

Transitions

  • go through slide.
  • Show HTML table

Config scripts

  • go through slides
  • After slide on sequencers, let’s look at the config scripts for MSI-cache
../_images/switch.png

Switch!

  • The first file we’ll look at is kind of like caches.py from our simple scripts.
    • We extend the L1Cache_Controller like we did Cache before. (And direcotry)
    • Construct the whole Ruby
    • Create sequencers
    • Connect everything up
  • Also extend the network to have our point-to-point network
vi configs/learning_gem5/part3/msi_caches.py
  • Next, let’s check out simple_ruby.py
  • Talk about how there’s two phases. Creating the cache system and setup. This is required because there is a circular dependence between RubySystem and RubyNetwork. :/
  • Talk about creating something with multiple threads.
vi configs/learning_gem5/part3/simple_ruby.py
../_images/switch.png

Switch!


Other ruby things

See slides.

Things I’d like to add

  • Debugging
    • It would be cool to go through an example broken protocol.
    • If I ever do a multi-day tutorial, this would be good to have as an activity.