The Sparta Modeling Framework
|
Factory which can create Resources as well as the Parameter sets that can be modified before actually instantiating the resources themselves. Packages providing resources to the simulator implement this interface. More...
#include <ResourceFactory.hpp>
Public Member Functions | |
virtual | ~ResourceFactoryBase () |
Destructor. | |
virtual std::string | getResourceType () const =0 |
Returns the resource type-name for this resource, demangled. | |
virtual std::string | getResourceTypeRaw () const =0 |
Returns the resource type-name for this resource as in the typeid. | |
virtual ParameterSet * | createParameters (TreeNode *node)=0 |
Creates a new set of parameters associated with the resource that can be created by this factory. | |
virtual void | deleteParameters (ParameterSet *params)=0 |
Deletes a ParameterSet created by the createParameters method of this ResourceFactory. | |
virtual void | createSubtree (sparta::ResourceTreeNode *n)=0 |
Optionally creates a subtree of TreeNodes for this TreeNode by attaching children to this node. These children may be regular TreeNode or ResourceTreeNodes. | |
virtual void | deleteSubtree (sparta::ResourceTreeNode *n)=0 |
Optionally deletes the TreeNodes created by createSubtee (if any). | |
virtual void | onBuilding (sparta::ResourceTreeNode *n)=0 |
Hook for additional building on ResourceTreeNode constructing. | |
virtual void | onConfiguring (sparta::ResourceTreeNode *n)=0 |
Hook for additional configuring on resource node configure. | |
virtual Resource * | createResource (TreeNode *node, const ParameterSet *params)=0 |
Instanitates a new Resource of the type described by this factory. | |
virtual void | deleteResource (Resource *res)=0 |
Deletes a resource created by the createResource method of this ResourceFactory. | |
virtual void | bindEarly (TreeNode *node)=0 |
Allows contents to be bound together if desired. | |
virtual void | bindLate (TreeNode *node)=0 |
Allows contents to be bound together if desired. | |
Factory which can create Resources as well as the Parameter sets that can be modified before actually instantiating the resources themselves. Packages providing resources to the simulator implement this interface.
This class must be a factory for exactly 1 type of resource.
The paired create/delete methods within this class allow it to be part of a shared-library package interface. This informs the interface design by, for example, prohibiting boost and stl types.
These methods exists to ensure that if this factory were created through a shared library, then any memory it allocates will be freed by the same memory manager. This is required to ensure ABI compatibility with shared libraries.
Generally, the procedure is:
Definition at line 47 of file ResourceFactory.hpp.
|
inlinevirtual |
Destructor.
Definition at line 54 of file ResourceFactory.hpp.
|
pure virtual |
Allows contents to be bound together if desired.
Subclasses can use this to bind ports together if needed, which can also be done in Resource::bind* methods or at the Simulation level
This happens before the top-level simulator class has a chance to bind anything
Implemented in sparta::ResourceFactory< ResourceT, ParamsT >, sparta::ResourceFactory< core_example::BIU, core_example::BIU::BIUParameterSet >, sparta::ResourceFactory< core_example::Core, core_example::Core::CoreParameterSet >, sparta::ResourceFactory< core_example::Decode, core_example::Decode::DecodeParameterSet >, sparta::ResourceFactory< core_example::Dispatch, core_example::Dispatch::DispatchParameterSet >, sparta::ResourceFactory< core_example::Execute, core_example::Execute::ExecuteParameterSet >, sparta::ResourceFactory< core_example::Fetch, core_example::Fetch::FetchParameterSet >, sparta::ResourceFactory< core_example::FlushManager, core_example::FlushManager::FlushManagerParameters >, sparta::ResourceFactory< core_example::LSU, core_example::LSU::LSUParameterSet >, sparta::ResourceFactory< core_example::MSS, core_example::MSS::MSSParameterSet >, sparta::ResourceFactory< core_example::Preloader, core_example::Preloader::PreloaderParameterSet >, sparta::ResourceFactory< core_example::Rename, core_example::Rename::RenameParameterSet >, sparta::ResourceFactory< core_example::ROB, core_example::ROB::ROBParameterSet >, sparta::ResourceFactory< core_example::SimpleTLB, core_example::SimpleTLB::TLBParameterSet >, and sparta::ResourceFactory< CPU, CPU::CPUParameterSet >.
|
pure virtual |
Allows contents to be bound together if desired.
Subclasses can use this to bind ports together if needed, which can also be done in Resource::bind* methods or at the Simulation level
Implemented in sparta::ResourceFactory< ResourceT, ParamsT >, sparta::ResourceFactory< core_example::BIU, core_example::BIU::BIUParameterSet >, sparta::ResourceFactory< core_example::Core, core_example::Core::CoreParameterSet >, sparta::ResourceFactory< core_example::Decode, core_example::Decode::DecodeParameterSet >, sparta::ResourceFactory< core_example::Dispatch, core_example::Dispatch::DispatchParameterSet >, sparta::ResourceFactory< core_example::Execute, core_example::Execute::ExecuteParameterSet >, sparta::ResourceFactory< core_example::Fetch, core_example::Fetch::FetchParameterSet >, sparta::ResourceFactory< core_example::FlushManager, core_example::FlushManager::FlushManagerParameters >, sparta::ResourceFactory< core_example::LSU, core_example::LSU::LSUParameterSet >, sparta::ResourceFactory< core_example::MSS, core_example::MSS::MSSParameterSet >, sparta::ResourceFactory< core_example::Preloader, core_example::Preloader::PreloaderParameterSet >, sparta::ResourceFactory< core_example::Rename, core_example::Rename::RenameParameterSet >, sparta::ResourceFactory< core_example::ROB, core_example::ROB::ROBParameterSet >, sparta::ResourceFactory< core_example::SimpleTLB, core_example::SimpleTLB::TLBParameterSet >, and sparta::ResourceFactory< CPU, CPU::CPUParameterSet >.
|
pure virtual |
Creates a new set of parameters associated with the resource that can be created by this factory.
node | TreeNode which which the newly-created parameters will be permanently associated. |
Each ParameterSet created by this parameter set must contain identical parameters down to types and default values.
Implemented in sparta::ResourceFactory< ResourceT, ParamsT >, sparta::ResourceFactory< core_example::BIU, core_example::BIU::BIUParameterSet >, sparta::ResourceFactory< core_example::Core, core_example::Core::CoreParameterSet >, sparta::ResourceFactory< core_example::Decode, core_example::Decode::DecodeParameterSet >, sparta::ResourceFactory< core_example::Dispatch, core_example::Dispatch::DispatchParameterSet >, sparta::ResourceFactory< core_example::Execute, core_example::Execute::ExecuteParameterSet >, sparta::ResourceFactory< core_example::Fetch, core_example::Fetch::FetchParameterSet >, sparta::ResourceFactory< core_example::FlushManager, core_example::FlushManager::FlushManagerParameters >, sparta::ResourceFactory< core_example::LSU, core_example::LSU::LSUParameterSet >, sparta::ResourceFactory< core_example::MSS, core_example::MSS::MSSParameterSet >, sparta::ResourceFactory< core_example::Preloader, core_example::Preloader::PreloaderParameterSet >, sparta::ResourceFactory< core_example::Rename, core_example::Rename::RenameParameterSet >, sparta::ResourceFactory< core_example::ROB, core_example::ROB::ROBParameterSet >, sparta::ResourceFactory< core_example::SimpleTLB, core_example::SimpleTLB::TLBParameterSet >, and sparta::ResourceFactory< CPU, CPU::CPUParameterSet >.
|
pure virtual |
Instanitates a new Resource of the type described by this factory.
node | TreeNode with which this resource will be associated. At this point the tree will be finalizing. No new children can be attached to this node at this time. |
params | ParameterSet created by createParameters |
Implemented in sparta::ResourceFactory< ResourceT, ParamsT >, sparta::ResourceFactory< core_example::BIU, core_example::BIU::BIUParameterSet >, sparta::ResourceFactory< core_example::Core, core_example::Core::CoreParameterSet >, sparta::ResourceFactory< core_example::Decode, core_example::Decode::DecodeParameterSet >, sparta::ResourceFactory< core_example::Dispatch, core_example::Dispatch::DispatchParameterSet >, sparta::ResourceFactory< core_example::Execute, core_example::Execute::ExecuteParameterSet >, sparta::ResourceFactory< core_example::Fetch, core_example::Fetch::FetchParameterSet >, sparta::ResourceFactory< core_example::FlushManager, core_example::FlushManager::FlushManagerParameters >, sparta::ResourceFactory< core_example::LSU, core_example::LSU::LSUParameterSet >, sparta::ResourceFactory< core_example::MSS, core_example::MSS::MSSParameterSet >, sparta::ResourceFactory< core_example::Preloader, core_example::Preloader::PreloaderParameterSet >, sparta::ResourceFactory< core_example::Rename, core_example::Rename::RenameParameterSet >, sparta::ResourceFactory< core_example::ROB, core_example::ROB::ROBParameterSet >, sparta::ResourceFactory< core_example::SimpleTLB, core_example::SimpleTLB::TLBParameterSet >, and sparta::ResourceFactory< CPU, CPU::CPUParameterSet >.
|
pure virtual |
Optionally creates a subtree of TreeNodes for this TreeNode by attaching children to this node. These children may be regular TreeNode or ResourceTreeNodes.
Because this occurs during the tree construction phase, adding child ResourceTreeNodes is valid
Implemented in sparta::ResourceFactory< ResourceT, ParamsT >, sparta::ResourceFactory< core_example::BIU, core_example::BIU::BIUParameterSet >, sparta::ResourceFactory< core_example::Core, core_example::Core::CoreParameterSet >, sparta::ResourceFactory< core_example::Decode, core_example::Decode::DecodeParameterSet >, sparta::ResourceFactory< core_example::Dispatch, core_example::Dispatch::DispatchParameterSet >, sparta::ResourceFactory< core_example::Execute, core_example::Execute::ExecuteParameterSet >, sparta::ResourceFactory< core_example::Fetch, core_example::Fetch::FetchParameterSet >, sparta::ResourceFactory< core_example::FlushManager, core_example::FlushManager::FlushManagerParameters >, sparta::ResourceFactory< core_example::LSU, core_example::LSU::LSUParameterSet >, sparta::ResourceFactory< core_example::MSS, core_example::MSS::MSSParameterSet >, sparta::ResourceFactory< core_example::Preloader, core_example::Preloader::PreloaderParameterSet >, sparta::ResourceFactory< core_example::Rename, core_example::Rename::RenameParameterSet >, sparta::ResourceFactory< core_example::ROB, core_example::ROB::ROBParameterSet >, sparta::ResourceFactory< core_example::SimpleTLB, core_example::SimpleTLB::TLBParameterSet >, and sparta::ResourceFactory< CPU, CPU::CPUParameterSet >.
|
pure virtual |
Deletes a ParameterSet created by the createParameters method of this ResourceFactory.
params | ParameterSet to deallocate |
Implemented in sparta::ResourceFactory< ResourceT, ParamsT >, sparta::ResourceFactory< core_example::BIU, core_example::BIU::BIUParameterSet >, sparta::ResourceFactory< core_example::Core, core_example::Core::CoreParameterSet >, sparta::ResourceFactory< core_example::Decode, core_example::Decode::DecodeParameterSet >, sparta::ResourceFactory< core_example::Dispatch, core_example::Dispatch::DispatchParameterSet >, sparta::ResourceFactory< core_example::Execute, core_example::Execute::ExecuteParameterSet >, sparta::ResourceFactory< core_example::Fetch, core_example::Fetch::FetchParameterSet >, sparta::ResourceFactory< core_example::FlushManager, core_example::FlushManager::FlushManagerParameters >, sparta::ResourceFactory< core_example::LSU, core_example::LSU::LSUParameterSet >, sparta::ResourceFactory< core_example::MSS, core_example::MSS::MSSParameterSet >, sparta::ResourceFactory< core_example::Preloader, core_example::Preloader::PreloaderParameterSet >, sparta::ResourceFactory< core_example::Rename, core_example::Rename::RenameParameterSet >, sparta::ResourceFactory< core_example::ROB, core_example::ROB::ROBParameterSet >, sparta::ResourceFactory< core_example::SimpleTLB, core_example::SimpleTLB::TLBParameterSet >, and sparta::ResourceFactory< CPU, CPU::CPUParameterSet >.
|
pure virtual |
Deletes a resource created by the createResource method of this ResourceFactory.
res | Resource to deallocate. |
Implemented in sparta::ResourceFactory< ResourceT, ParamsT >, sparta::ResourceFactory< core_example::BIU, core_example::BIU::BIUParameterSet >, sparta::ResourceFactory< core_example::Core, core_example::Core::CoreParameterSet >, sparta::ResourceFactory< core_example::Decode, core_example::Decode::DecodeParameterSet >, sparta::ResourceFactory< core_example::Dispatch, core_example::Dispatch::DispatchParameterSet >, sparta::ResourceFactory< core_example::Execute, core_example::Execute::ExecuteParameterSet >, sparta::ResourceFactory< core_example::Fetch, core_example::Fetch::FetchParameterSet >, sparta::ResourceFactory< core_example::FlushManager, core_example::FlushManager::FlushManagerParameters >, sparta::ResourceFactory< core_example::LSU, core_example::LSU::LSUParameterSet >, sparta::ResourceFactory< core_example::MSS, core_example::MSS::MSSParameterSet >, sparta::ResourceFactory< core_example::Preloader, core_example::Preloader::PreloaderParameterSet >, sparta::ResourceFactory< core_example::Rename, core_example::Rename::RenameParameterSet >, sparta::ResourceFactory< core_example::ROB, core_example::ROB::ROBParameterSet >, sparta::ResourceFactory< core_example::SimpleTLB, core_example::SimpleTLB::TLBParameterSet >, and sparta::ResourceFactory< CPU, CPU::CPUParameterSet >.
|
pure virtual |
Optionally deletes the TreeNodes created by createSubtee (if any).
An implementation of ResourceFactoryBase should generally keep a vector of nodes that it allocated and delete them when this method is invoked.
Implemented in sparta::ResourceFactory< ResourceT, ParamsT >, sparta::ResourceFactory< core_example::BIU, core_example::BIU::BIUParameterSet >, sparta::ResourceFactory< core_example::Core, core_example::Core::CoreParameterSet >, sparta::ResourceFactory< core_example::Decode, core_example::Decode::DecodeParameterSet >, sparta::ResourceFactory< core_example::Dispatch, core_example::Dispatch::DispatchParameterSet >, sparta::ResourceFactory< core_example::Execute, core_example::Execute::ExecuteParameterSet >, sparta::ResourceFactory< core_example::Fetch, core_example::Fetch::FetchParameterSet >, sparta::ResourceFactory< core_example::FlushManager, core_example::FlushManager::FlushManagerParameters >, sparta::ResourceFactory< core_example::LSU, core_example::LSU::LSUParameterSet >, sparta::ResourceFactory< core_example::MSS, core_example::MSS::MSSParameterSet >, sparta::ResourceFactory< core_example::Preloader, core_example::Preloader::PreloaderParameterSet >, sparta::ResourceFactory< core_example::Rename, core_example::Rename::RenameParameterSet >, sparta::ResourceFactory< core_example::ROB, core_example::ROB::ROBParameterSet >, sparta::ResourceFactory< core_example::SimpleTLB, core_example::SimpleTLB::TLBParameterSet >, and sparta::ResourceFactory< CPU, CPU::CPUParameterSet >.
|
pure virtual |
Returns the resource type-name for this resource, demangled.
Implemented in sparta::ResourceFactory< ResourceT, ParamsT >, sparta::ResourceFactory< core_example::BIU, core_example::BIU::BIUParameterSet >, sparta::ResourceFactory< core_example::Core, core_example::Core::CoreParameterSet >, sparta::ResourceFactory< core_example::Decode, core_example::Decode::DecodeParameterSet >, sparta::ResourceFactory< core_example::Dispatch, core_example::Dispatch::DispatchParameterSet >, sparta::ResourceFactory< core_example::Execute, core_example::Execute::ExecuteParameterSet >, sparta::ResourceFactory< core_example::Fetch, core_example::Fetch::FetchParameterSet >, sparta::ResourceFactory< core_example::FlushManager, core_example::FlushManager::FlushManagerParameters >, sparta::ResourceFactory< core_example::LSU, core_example::LSU::LSUParameterSet >, sparta::ResourceFactory< core_example::MSS, core_example::MSS::MSSParameterSet >, sparta::ResourceFactory< core_example::Preloader, core_example::Preloader::PreloaderParameterSet >, sparta::ResourceFactory< core_example::Rename, core_example::Rename::RenameParameterSet >, sparta::ResourceFactory< core_example::ROB, core_example::ROB::ROBParameterSet >, sparta::ResourceFactory< core_example::SimpleTLB, core_example::SimpleTLB::TLBParameterSet >, and sparta::ResourceFactory< CPU, CPU::CPUParameterSet >.
|
pure virtual |
Returns the resource type-name for this resource as in the typeid.
Implemented in sparta::ResourceFactory< ResourceT, ParamsT >, sparta::ResourceFactory< core_example::BIU, core_example::BIU::BIUParameterSet >, sparta::ResourceFactory< core_example::Core, core_example::Core::CoreParameterSet >, sparta::ResourceFactory< core_example::Decode, core_example::Decode::DecodeParameterSet >, sparta::ResourceFactory< core_example::Dispatch, core_example::Dispatch::DispatchParameterSet >, sparta::ResourceFactory< core_example::Execute, core_example::Execute::ExecuteParameterSet >, sparta::ResourceFactory< core_example::Fetch, core_example::Fetch::FetchParameterSet >, sparta::ResourceFactory< core_example::FlushManager, core_example::FlushManager::FlushManagerParameters >, sparta::ResourceFactory< core_example::LSU, core_example::LSU::LSUParameterSet >, sparta::ResourceFactory< core_example::MSS, core_example::MSS::MSSParameterSet >, sparta::ResourceFactory< core_example::Preloader, core_example::Preloader::PreloaderParameterSet >, sparta::ResourceFactory< core_example::Rename, core_example::Rename::RenameParameterSet >, sparta::ResourceFactory< core_example::ROB, core_example::ROB::ROBParameterSet >, sparta::ResourceFactory< core_example::SimpleTLB, core_example::SimpleTLB::TLBParameterSet >, and sparta::ResourceFactory< CPU, CPU::CPUParameterSet >.
|
pure virtual |
Hook for additional building on ResourceTreeNode constructing.
Tap into hook for creating more resource nodes, subtrees, etc.
Implemented in sparta::ResourceFactory< ResourceT, ParamsT >, sparta::ResourceFactory< core_example::BIU, core_example::BIU::BIUParameterSet >, sparta::ResourceFactory< core_example::Core, core_example::Core::CoreParameterSet >, sparta::ResourceFactory< core_example::Decode, core_example::Decode::DecodeParameterSet >, sparta::ResourceFactory< core_example::Dispatch, core_example::Dispatch::DispatchParameterSet >, sparta::ResourceFactory< core_example::Execute, core_example::Execute::ExecuteParameterSet >, sparta::ResourceFactory< core_example::Fetch, core_example::Fetch::FetchParameterSet >, sparta::ResourceFactory< core_example::FlushManager, core_example::FlushManager::FlushManagerParameters >, sparta::ResourceFactory< core_example::LSU, core_example::LSU::LSUParameterSet >, sparta::ResourceFactory< core_example::MSS, core_example::MSS::MSSParameterSet >, sparta::ResourceFactory< core_example::Preloader, core_example::Preloader::PreloaderParameterSet >, sparta::ResourceFactory< core_example::Rename, core_example::Rename::RenameParameterSet >, sparta::ResourceFactory< core_example::ROB, core_example::ROB::ROBParameterSet >, sparta::ResourceFactory< core_example::SimpleTLB, core_example::SimpleTLB::TLBParameterSet >, and sparta::ResourceFactory< CPU, CPU::CPUParameterSet >.
|
pure virtual |
Hook for additional configuring on resource node configure.
Tap into hook to configure any resources.
Implemented in sparta::ResourceFactory< ResourceT, ParamsT >, sparta::ResourceFactory< core_example::BIU, core_example::BIU::BIUParameterSet >, sparta::ResourceFactory< core_example::Core, core_example::Core::CoreParameterSet >, sparta::ResourceFactory< core_example::Decode, core_example::Decode::DecodeParameterSet >, sparta::ResourceFactory< core_example::Dispatch, core_example::Dispatch::DispatchParameterSet >, sparta::ResourceFactory< core_example::Execute, core_example::Execute::ExecuteParameterSet >, sparta::ResourceFactory< core_example::Fetch, core_example::Fetch::FetchParameterSet >, sparta::ResourceFactory< core_example::FlushManager, core_example::FlushManager::FlushManagerParameters >, sparta::ResourceFactory< core_example::LSU, core_example::LSU::LSUParameterSet >, sparta::ResourceFactory< core_example::MSS, core_example::MSS::MSSParameterSet >, sparta::ResourceFactory< core_example::Preloader, core_example::Preloader::PreloaderParameterSet >, sparta::ResourceFactory< core_example::Rename, core_example::Rename::RenameParameterSet >, sparta::ResourceFactory< core_example::ROB, core_example::ROB::ROBParameterSet >, sparta::ResourceFactory< core_example::SimpleTLB, core_example::SimpleTLB::TLBParameterSet >, and sparta::ResourceFactory< CPU, CPU::CPUParameterSet >.