51#ifndef __SIM_CXX_CONFIG_HH__
52#define __SIM_CXX_CONFIG_HH__
87 bool isVector_,
bool isSimObject_) :
105 bool isVector_,
bool isRequestor_) :
114 std::map<std::string, PortDesc *>
ports;
141 "Failed to insert config directory entry %s (duplicate?).",
157 virtual void setName(
const std::string &name_) { }
212 virtual bool getParam(
const std::string &object_name,
213 const std::string ¶m_name,
214 std::string &value)
const = 0;
218 const std::string ¶m_name,
223 const std::string &port_name,
237 bool return_paths =
false)
const = 0;
240 virtual bool load(
const std::string &filename) = 0;
const bool isSimObject
Is this a SimObject, and so is to be set with setSimObject... or another from-string parameter set wi...
ParamDesc(const std::string &name_, bool isVector_, bool isSimObject_)
Similar to ParamDesc to describe ports.
const bool isRequestor
Is this a request or response port.
PortDesc(const std::string &name_, bool isVector_, bool isRequestor_)
Config details entry for a SimObject.
std::map< std::string, ParamDesc * > parameters
All parameters (including SimObjects) in order.
virtual CxxConfigParams * makeParamsObject() const
Make a ...Param structure for the SimObject class of this entry.
virtual ~CxxConfigDirectoryEntry()
std::map< std::string, PortDesc * > ports
Ports.
Config file wrapper providing a common interface to CxxConfigManager.
virtual ~CxxConfigFileBase()
virtual void getAllObjectNames(std::vector< std::string > &list) const =0
Get all SimObjects in the config.
virtual bool getParamVector(const std::string &object_name, const std::string ¶m_name, std::vector< std::string > &values) const =0
Get a list/vector parameter.
virtual void getObjectChildren(const std::string &object_name, std::vector< std::string > &children, bool return_paths=false) const =0
Get the names or paths of all the children SimObjects of this SimObject.
virtual bool getPortPeers(const std::string &object_name, const std::string &port_name, std::vector< std::string > &peers) const =0
Get the peer (connected) ports of the named ports.
virtual bool getParam(const std::string &object_name, const std::string ¶m_name, std::string &value) const =0
Get a single parameter value as a string returned in value.
virtual bool load(const std::string &filename)=0
Load config file.
virtual CxxConfigParams::Flags getFlags() const
Get the flags which should be used to modify parameter parsing behaviour.
virtual bool objectExists(const std::string &object_name) const =0
Does an object with this path exist?
Base for peer classes of SimObjectParams derived classes with parameter modifying member functions.
virtual bool setParam(const std::string &name, const std::string &value, const Flags flags)
Set a parameter with a value parsed from the given string.
virtual bool setPortConnectionCount(const std::string &name, unsigned int count)
Set the number of connections expected for the named port.
virtual const std::string & getName()
Get full path name string.
gem5::Flags< FlagsType > Flags
virtual ~CxxConfigParams()
virtual bool setSimObjectVector(const std::string &name, const std::vector< SimObject * > &simObjects)
As setSimObjectVector but set a whole vector of references.
virtual SimObject * simObjectCreate()
Create the associated SimObject.
virtual void setName(const std::string &name_)
Example flag.
virtual bool setSimObject(const std::string &name, SimObject *simObject)
Set a SimObject valued parameter with a reference to the given SimObject.
uint32_t FlagsType
Flags passable to setParam... to smooth over any parsing difference between different config files.
static const std::string invalidName
virtual bool setParamVector(const std::string &name, const std::vector< std::string > &values, const Flags flags)
As setParamVector but for parameters given as vectors pre-separated into elements.
Wrapper that groups a few flag bits under the same undelying container.
Abstract superclass for simulation objects.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::map< std::string, CxxConfigDirectoryEntry * > & cxxConfigDirectory()
Directory of all SimObject classes config details.
AddToConfigDir(const std::string &name, CxxConfigDirectoryEntry *entry)
const std::string & name()