InOrder Resource-Request Model

From gem5
Revision as of 13:29, 19 January 2010 by Ksewell (talk | contribs) (Defining Your Own Resources)
Jump to: navigation, search


Resources consists of any CPU object that an instruction wants to access. This could be a branch predictor, a cache, a execution unit, etc. In the InOrder CPU model we abstract what a resource is into a generic "Resource" class that all specific resources must derive from. In any given pipeline stage, an instruction will request that a resource perform a specific operation on it's behalf. If an instruction can complete all it's resource requests for a given stage, then it may pass to the next stage.

Relevant source files:

  • resource.[hh,cc]
  • resources/*.[hh,cc]
  • pipeline_traits.[hh,cc]
  • cpu.[hh,cc]

Resource-Request Model

Resource Internals



Predefined Resources

The following pipeline resources are defined for InOrderCPU:

  • Fetch Unit
  • Instruction Cache (I-Cache)
  • Branch Prediction Unit (BPred Unit)
  • Register File Manager (RF Manager)
  • Address Generation Unit (AGen Unit)
  • Execution Unit (EXU)
  • Integer Multiply and Divide Unit (Int MDU)
  • Data Cache (D-Cache)
  • Graduation Unit (Grad Unit)

Defining Your Own Resources

The easiest way to define your own resource is to find a resource that is similar to what you are trying to create, and then use that as a template for your design.

More specifically, you'll need to derive from the "Resource" class and then define your own resource-specific "execute" function. In the simplest case, where your resource is of zero (same-cycle) latency, then this should do the trick. If you resource processes requests on multiple cycles, then a good example of that is the instruction buffer, the caches, or the multiply/divide units.

Also note, for an instruction to use your resource, you need to :

  1. Add the resource to the resource pool
  2. Add the resource to that instruction's instruction schedule