InOrder Resource Pool
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
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 };