Go to the documentation of this file.
50 #ifndef __SIM_CXX_MANAGER_HH__
51 #define __SIM_CXX_MANAGER_HH__
84 Exception(
const std::string &name_,
const std::string &message_) :
104 const std::string &to_prefix) :
131 const std::string &responsePort,
PortID responsePortIndex);
141 std::string
rename(
const std::string &from_name);
145 std::string
unRename(
const std::string &to_name);
178 const std::string &object_name, std::string &object_type);
208 bool visit_children =
false);
235 template<
typename SimObjectType>
244 SimObjectType *
object =
dynamic_cast<SimObjectType *
>(
249 " type", object_name));
264 static void parsePort(
const std::string &inp,
265 std::string &path, std::string &port,
unsigned int &
index);
284 unsigned int drain();
305 void setParam(
const std::string &object_name,
306 const std::string ¶m_name,
const std::string ¶m_value);
308 const std::string ¶m_name,
312 #endif // __SIM_CXX_MANAGER_HH__
void bindRequestPort(SimObject *object, const CxxConfigDirectoryEntry::PortDesc &port, const std::vector< std::string > &peers)
Bind a single (possibly vectored) request port to peers from the unparsed list peers with elements in...
void addRenaming(const Renaming &renaming)
Add a name prefix renaming to those currently applied.
SimObjectResolver & getSimObjectResolver()
Get the resolver used to map SimObject names to SimObjects for checkpoint restore.
CxxConfigManager(CxxConfigFileBase &configFile_)
void deleteObjects()
Delete all objects and clear objectsByName and objectsByOrder.
std::string unRename(const std::string &to_name)
Apply the first matching renaming in reverse (toPrefix -> fromPrefix for the given name.
CxxConfigFileBase & configFile
Configuration file being read.
Name substitution when instantiating any object whose name starts with fromPrefix.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
void findAllObjects()
Find all objects by iterating over the object names in the config file with findObject.
Renaming(const std::string &from_prefix, const std::string &to_prefix)
void instantiate(bool build_all=true)
Build all objects (if build_all is true, otherwise objects must have been individually findObject-ed ...
Similar to ParamDesc to describe ports.
void serialize(std::ostream &os)
Serialize (checkpoint) all objects to the given stream.
void findTraversalOrder(const std::string &object_name)
Populate objectsInOrder with a preorder, depth first traversal from the given object name down throug...
Base for peer classes of SimObjectParams derived classes with parameter modifying member functions.
SimObjectType & getObject(const std::string &object_name)
Find an object from objectsByName with a type-checking cast.
CxxConfigManager & configManager
void bindObjectPorts(SimObject *object)
Bind the ports of a single SimObject.
Exception(const std::string &name_, const std::string &message_)
static void parsePort(const std::string &inp, std::string &path, std::string &port, unsigned int &index)
Parse a port string of the form 'path(.path)*.port[index]' into path, port and index.
void setParamVector(const std::string &object_name, const std::string ¶m_name, const std::vector< std::string > ¶m_values)
Config details entry for a SimObject.
void initState()
Call initState on all objects.
Exception for instantiate/post-instantiate errors.
std::map< std::string, SimObject * > objectsByName
SimObject indexed by name.
std::string rename(const std::string &from_name)
Apply the first matching renaming in renamings to the given name.
const CxxConfigDirectoryEntry & findObjectType(const std::string &object_name, std::string &object_type)
Find the type field for a named object and return both the name of the type to object_type and the ob...
CxxConfigParams * findObjectParams(const std::string &object_name)
Find the parameters for the named object.
void startup()
Call startup on all objects.
const std::string & name()
SimObject * findObject(const std::string &object_name, bool visit_children=false)
Walk the configuration starting with object object_name and fill in all the elements of this object o...
std::set< std::string > inVisit
While configuring, inVisit contains names of SimObjects visited in this recursive configuration walk.
void setParam(const std::string &object_name, const std::string ¶m_name, const std::string ¶m_value)
Convenience functions for calling set...
SimObjectResolver(CxxConfigManager &configManager_)
Class for resolving SimObject names to SimObjects usable by the checkpoint restore mechanism.
const char * what() const
void loadState(CheckpointIn &checkpoint)
Load all objects' state from the given Checkpoint.
void bindPort(SimObject *requestorObject, const std::string &requestPort, PortID requestPortIndex, SimObject *responderObject, const std::string &responsePort, PortID responsePortIndex)
Bind a single connection between two objects' ports.
Config file wrapper providing a common interface to CxxConfigManager.
std::map< std::string, CxxConfigParams * > objectParamsByName
...Params objects created by this manager
std::list< Renaming > renamings
All the renamings applicable when instantiating objects.
void bindAllPorts()
Bind the ports of all the objects in objectInOrder order.
SimObjectResolver simObjectResolver
Singleton instance of SimObjectResolver.
void forEachObject(void(SimObject::*mem_func)())
Perform mem_func on each SimObject.
SimObject * resolveSimObject(const std::string &name)
Find a SimObject given a full path name.
std::string csprintf(const char *format, const Args &...args)
void drainResume()
Resume from drain.
This class allows a config file to be read into gem5 (generating the appropriate SimObjects) from C++...
CxxConfigParams::Flags flags
Flags to pass to affect param setting.
unsigned int drain()
Drain all objects.
std::list< SimObject * > objectsInOrder
SimObjects in order.
Abstract superclass for simulation objects.
Generated on Wed Sep 30 2020 14:02:14 for gem5 by doxygen 1.8.17