Difference between revisions of "InOrder Resource Pool"

From gem5
Jump to: navigation, search
(Resource Pool Events)
(Interaction w/CPU)
Line 10: Line 10:
  
 
== Interaction w/CPU ==
 
== Interaction w/CPU ==
 +
As stated before, the resource pool encapsulates all of the resources that a CPU accesses. Consequently, the CPU must first access the resource pool before receiving access to any specific resource. Conversely, a resource can talk to the CPU by grabbing a pointer to the CPU through the resource pool.
 +
 +
Typically, the CPU will access the resource pool in just a few cases:
 +
# An instruction request in a pipeline stage
 +
# Broadcasting a CPU Event
 +
# Non-cycle-accurate instances such as initialization, system calls, and in the future checkpointing.
  
 
== Resource Pool Events ==
 
== Resource Pool Events ==

Revision as of 16:53, 19 January 2010

Overview

The ResourcePool is the interface that the CPU must go through in order to access a resource. The "pool" instantiates all resources, allocates IDs to resources, and can schedule events to be processed on one or all of the resources available to the CPU.

Relevant source files:

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

Interaction w/CPU

As stated before, the resource pool encapsulates all of the resources that a CPU accesses. Consequently, the CPU must first access the resource pool before receiving access to any specific resource. Conversely, a resource can talk to the CPU by grabbing a pointer to the CPU through the resource pool.

Typically, the CPU will access the resource pool in just a few cases:

  1. An instruction request in a pipeline stage
  2. Broadcasting a CPU Event
  3. Non-cycle-accurate instances such as initialization, system calls, and in the future checkpointing.

Resource Pool Events

The resource pool allows the CPU to broadcast events that all of the resources will see and process. This is beneficial to provide the CPU ability to transfer information to resources and provide for resources the ability to generically pass information to other resources.

By default, any CPU event that is scheduled (excluding the Tick event) is copied and scheduled as a ResourcePool event. A list of CPU events is available in cpu.hh:

    enum CPUEventType {
        ActivateThread,
        ActivateNextReadyThread,
        DeactivateThread,
        HaltThread,
        SuspendThread,
        Trap,
        InstGraduated,
        SquashFromMemStall,
        UpdatePCs,
        NumCPUEvents
    };

Each of these events are implemented as virtual functions in the "Resource" base class, such that any resource that needs to react to any of the aforementioned events simply needs to override the virtual function in it's implementation.

The ResourcePool also has a few specific events that resources can schedule themselves. The current list is found in resource_pool.hh:

    enum ResPoolEventType {
        InstGraduated = InOrderCPU::NumCPUEvents,
        SquashAll,
        UpdateAfterContextSwitch,
        Default
    };