Go to the documentation of this file.
50 #ifndef __SIM_CXX_MANAGER_HH__
51 #define __SIM_CXX_MANAGER_HH__
87 Exception(
const std::string &name_,
const std::string &message_) :
107 const std::string &to_prefix) :
134 const std::string &responsePort,
PortID responsePortIndex);
144 std::string
rename(
const std::string &from_name);
148 std::string
unRename(
const std::string &to_name);
181 const std::string &object_name, std::string &object_type);
211 bool visit_children =
false);
238 template<
typename SimObjectType>
247 SimObjectType *
object =
dynamic_cast<SimObjectType *
>(
252 " type", object_name));
267 static void parsePort(
const std::string &inp,
268 std::string &path, std::string &port,
unsigned int &
index);
287 unsigned int drain();
308 void setParam(
const std::string &object_name,
309 const std::string ¶m_name,
const std::string ¶m_value);
311 const std::string ¶m_name,
317 #endif // __SIM_CXX_MANAGER_HH__
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
std::list< Renaming > renamings
All the renamings applicable when instantiating objects.
Renaming(const std::string &from_prefix, const std::string &to_prefix)
std::map< std::string, SimObject * > objectsByName
SimObject indexed by name.
void deleteObjects()
Delete all objects and clear objectsByName and objectsByOrder.
void bindObjectPorts(SimObject *object)
Bind the ports of a single SimObject.
This class allows a config file to be read into gem5 (generating the appropriate SimObjects) from C++...
std::string unRename(const std::string &to_name)
Apply the first matching renaming in reverse (toPrefix -> fromPrefix for the given name.
Exception(const std::string &name_, const std::string &message_)
CxxConfigManager & configManager
SimObjectResolver simObjectResolver
Singleton instance of SimObjectResolver.
CxxConfigParams::Flags flags
Flags to pass to affect param setting.
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.
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 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...
Base for peer classes of SimObjectParams derived classes with parameter modifying member functions.
void findAllObjects()
Find all objects by iterating over the object names in the config file with findObject.
void addRenaming(const Renaming &renaming)
Add a name prefix renaming to those currently applied.
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::string csprintf(const char *format, const Args &...args)
const char * what() const
void forEachObject(void(SimObject::*mem_func)())
Perform mem_func on each SimObject.
std::map< std::string, CxxConfigParams * > objectParamsByName
...Params objects created by this manager
CxxConfigParams * findObjectParams(const std::string &object_name)
Find the parameters for the named object.
void serialize(std::ostream &os)
Serialize (checkpoint) all objects to the given stream.
std::list< SimObject * > objectsInOrder
SimObjects in order.
void setParamVector(const std::string &object_name, const std::string ¶m_name, const std::vector< std::string > ¶m_values)
std::set< std::string > inVisit
While configuring, inVisit contains names of SimObjects visited in this recursive configuration walk.
void startup()
Call startup on all objects.
CxxConfigManager(CxxConfigFileBase &configFile_)
Exception for instantiate/post-instantiate errors.
void findTraversalOrder(const std::string &object_name)
Populate objectsInOrder with a preorder, depth first traversal from the given object name down throug...
SimObjectResolver & getSimObjectResolver()
Get the resolver used to map SimObject names to SimObjects for checkpoint restore.
Abstract superclass for simulation objects.
Similar to ParamDesc to describe ports.
void drainResume()
Resume from drain.
const std::string & name()
Name substitution when instantiating any object whose name starts with fromPrefix.
unsigned int drain()
Drain all objects.
void loadState(CheckpointIn &checkpoint)
Load all objects' state from the given Checkpoint.
Config file wrapper providing a common interface to CxxConfigManager.
void initState()
Call initState on all objects.
void bindAllPorts()
Bind the ports of all the objects in objectInOrder order.
CxxConfigFileBase & configFile
Configuration file being read.
std::string rename(const std::string &from_name)
Apply the first matching renaming in renamings to the given name.
Base class to wrap object resolving functionality.
Config details entry for a SimObject.
void instantiate(bool build_all=true)
Build all objects (if build_all is true, otherwise objects must have been individually findObject-ed ...
SimObject * resolveSimObject(const std::string &name)
Find a SimObject given a full path 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...
Class for resolving SimObject names to SimObjects usable by the checkpoint restore mechanism.
SimObjectResolver(CxxConfigManager &configManager_)
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
void setParam(const std::string &object_name, const std::string ¶m_name, const std::string ¶m_value)
Convenience functions for calling set...
SimObjectType & getObject(const std::string &object_name)
Find an object from objectsByName with a type-checking cast.
Generated on Sun Jul 30 2023 01:56:59 for gem5 by doxygen 1.8.17