|
| Bus (TreeNode *parent, const std::string &name, const std::string &group=GROUP_NAME_NONE, group_idx_type group_idx=GROUP_IDX_NONE, const std::string &desc="") |
| Construct a bus given the parent BusSet.
|
|
PortSet & | getPortSet () |
| Get the port set this bus uses to maintain the ports.
|
|
void | registerPort (Port *port) |
| Register the given port with the bus.
|
|
void | enableCollection () |
|
PortSet::RegisteredPortMap & | getPorts (Port::Direction direction) |
| Get the ports in this PortSet for the given direction.
|
|
void | setInPortDelay (uint32_t delay_cycles) |
| Set the port delay to the given value for all IN ports.
|
|
void | setInPortDelay (double delay_cycles) |
| Set the port delay to the given value for all IN ports.
|
|
template<typename EventT > |
void | inportsPrecede (EventT &event) |
| Make all inports precede the given event.
|
|
template<typename EventT > |
void | outportsSucceed (EventT &event) |
| Make all outports succeed the given event.
|
|
void | bind (Bus *other_bus) |
| Bind bus1 to bus2.
|
|
const Clock * | getClock () override |
| Walks up parents (starting with self) until a parent with an associated local clock is found, then returns that clock.
|
|
const Clock * | getClock () const |
|
const Clock * | getLocalClock () |
| Gets the clock associated directly with this Node. This is useful for configuration and simulator debug, but not at run-time.
|
|
const Clock * | getLocalClock () const |
|
virtual void | setClock (const Clock *clk) |
| Assigns a clock to this node. This clock will then be accessed by any descendant which has no assigned clock or an ancestor with an assigned clock between that descendant and this node. getClock returns the Clock associated with the nearest ancestor.
|
|
Scheduler * | getScheduler (const bool must_exist=false) |
| Get the scheduler associated with this tree node's root.
|
|
const Scheduler * | getScheduler (const bool must_exist=false) const |
|
WeakPtr | getWeakPtr () |
| Gets a weak pointer to this TreeNode. This weak pointer is guaranteed to expire when this TreeNode is destructed unless locked.
|
|
ConstWeakPtr | getWeakPtr () const |
| Const variant of getWeakPtr.
|
|
virtual void | addLink (TreeNode *node, const std::string &label) |
| Link this tree node with another tree node.
|
|
virtual void | activateLink (const std::string &label) |
| Activate one of the links added with addLink.
|
|
| TreeNode ()=delete |
| Not default-constructable.
|
|
| TreeNode (const TreeNode &)=delete |
| Not copy-constructable.
|
|
| TreeNode (TreeNode &&rhp) |
| Move constructor.
|
|
TreeNode & | operator= (const TreeNode &)=delete |
| Not assign-constructable.
|
|
| TreeNode (TreeNode *parent, const std::string &name, const std::string &group, group_idx_type group_idx, const std::string &desc, bool is_indexable) |
| TreeNode full constructor. Initializes node and adds it as a child of an existing tree node (if parent is not null).
|
|
| TreeNode (TreeNode *parent, const std::string &name, const std::string &group, group_idx_type group_idx, const std::string &desc) |
| TreeNode constructor with no is_indexable parameter [defaults to true].
|
|
| TreeNode (const std::string &name, const std::string &group, group_idx_type group_idx, const std::string &desc) |
| TreeNode constructor with no parent Node.
|
|
| TreeNode (TreeNode *parent, const std::string &name, const std::string &desc) |
| TreeNode constructor with no group information.
|
|
| TreeNode (TreeNode *parent, const std::string &group, group_idx_type group_idx, const std::string &desc) |
| TreeNode constructor for anonymous node with group information.
|
|
| TreeNode (const std::string &name, const std::string &desc) |
| TreeNode constructor with no parent node or group information.
|
|
virtual | ~TreeNode () |
| Virtual destructor.
|
|
void | addAlias (const std::string &alias) |
| Add a single alias for this node.
|
|
void | addAliases (const AliasVector &v) |
| Adds each element of a vector of aliases to this node..
|
|
void | addTag (const std::string &tag) |
| Adds single tag to this node.
|
|
void | addTags (const std::vector< std::string > &v) |
| Adds each elements of a vector of tags to this node.
|
|
virtual std::string | stringize (bool pretty=false) const |
| Create a string representation of this node.
|
|
void | stringizeTags (std::stringstream &ss) const |
| Render tags to a string in the form: " tags:[tag0, tag1]" If there are any tags. The leading space makes this a useful sub-utility of stringize because if there are no tags, returns empty string with no leading space.
|
|
node_uid_type | getNodeUID () const |
| Gets the unique ID of this node.
|
|
const std::string & | getName () const override |
| Gets the name of this node.
|
|
const std::string * | getNamePtr () const |
| Gets the name of this node's string pointer which isinterned in StringManager)
|
|
bool | isAnonymous () const |
| Is this node anonymous.
|
|
bool | isExpired () const |
| Is this expired (i.e. has it been the rhp of a move constructor)
|
|
bool | isIndexableByGroup () const |
| Returns whether this object is accessible through its parent's interfaces for getting children by group and index.
|
|
const std::string & | getGroup () const |
| Gets the group name of this node.
|
|
const std::string * | getGroupNamePtr () const |
| Gets the group name string pointer (interned in StringManager singleton) of this node.
|
|
group_idx_type | getGroupIdx () const |
| Gets the group index of this node.
|
|
const std::vector< const std::string * > & | getTags () const |
| Gets the set of tags associated with this TreeNode.
|
|
bool | hasTag (const std::string &tag) const |
| Does this node have a specific tag (by name)
|
|
bool | hasTag (const std::string *interned_tag_name) const |
| Does this node have a specific tag (by string pointer interned with StringManager). This is faster than the alternate hasTag method because it relies only on pointer comparisons.
|
|
const std::string & | getDesc () const |
| Gets the description of this node.
|
|
bool | isBuiltin () const |
| Is this node in the builtins group.
|
|
void | markHidden (bool hidden=true) |
| Marks this TreeNode hidden for the purposes of printint out nodes. This does not make the node inaccessible, but causes it (and its subtree) to be hidden from typical recursive tree printouts.
|
|
bool | isHidden () const |
| Is this TreeNode supposed to be hidden during tree printouts This value does not have to be respected by anything using TreeNode and is mainly a UI/printout convenience.
|
|
void | validateName (const std::string &nm) |
| Validates the given name string for this TreeNode. Does not consider context (e.g. name collisions)
|
|
void | validateGroup (const std::string &name, const std::string &group, group_idx_type idx) |
| Validates the given group name string and group index for this TreeNode. Does not consider context (e.g. name collisions)
|
|
void | validateDesc (const std::string &desc) |
| Validates the given description string for this TreeNode.
|
|
void | addExtensionParameters (const std::string &extension_name, std::unique_ptr< ParameterSet > extension_params) |
| Add a named parameter set to extend this tree node's metadata.
|
|
void | addExtensionFactory (const std::string &extension_name, std::function< ExtensionsBase *()> factory) |
| Add an extension factory to this tree node by its type (name). This method does not actually create any objects at this time. It will validate and create the extension only if asked for later on during simulation.
|
|
ExtensionsBase * | getExtension (const std::string &extension_name) |
| Get an extension object by type string. Returns nullptr if not found (unrecognized).
|
|
ExtensionsBase * | getExtension () |
| Get an extension without needing to specify any particular type string. If no extensions exist, returns nullptr. If only one extension exists, returns that extension. If more than one extension exists, throws an exception.
|
|
const std::set< std::string > & | getAllExtensionNames () |
| Extension names, if any. Tree node extensions are typically instantiated on-demand for best performance (you have to explicitly ask for an extension by its name, or it won't be created) - so note that calling this method will trigger the creation of all this node's extensions. The performance cost is proportional to the number of nodes in the virtual parameter tree.
|
|
void | addChild (TreeNode *child, bool inherit_phase=true) |
| Adds a TreeNode to this node as a child.
|
|
void | addChild (TreeNode &child) |
| AddChild by reference for convenience.
|
|
void | makeSubtreePrivate () |
| Make the entire subtree private.
|
|
void | setScopeRoot () |
|
bool | isScopeRoot () const |
|
void | lockdownParameters () |
| Method to put the device tree in lockdown phase. All LOCKED and HIDDEN parameters are frozen after this point. Regular parameters are not affected by this phase. This method requires a Simulation pointer and will assert at compile time if anyone tries to lockdown the tree without the context of a Simulation.
|
|
virtual bool | isAttached () const |
| Is this node part of a device tree with a proper RootTreeNode at the root.
|
|
virtual TreeNode * | getParent () |
| Gets immediate parent of this node if one exists.
|
|
virtual const TreeNode * | getParent () const |
|
template<class T , typename = typename std::enable_if<std::is_pointer<T>::value>::type> |
const T | getParentAs (bool must_exist=true) const |
| Retrieves a parent casted to type T* if this node has a parent.
|
|
template<class T , typename = typename std::enable_if<!std::is_pointer<T>::value>::type> |
const T * | getParentAs (bool must_exist=true) const |
|
template<class T , typename = typename std::enable_if<std::is_pointer<T>::value>::type> |
T | getParentAs (bool must_exist=true) |
|
template<class T , typename = typename std::enable_if<!std::is_pointer<T>::value>::type> |
T * | getParentAs (bool must_exist=true) |
|
virtual TreeNode * | getRoot () |
| Gets farthest ancestor of this node.
|
|
virtual const TreeNode * | getRoot () const |
|
TreeNode * | getScopeRoot () |
|
const TreeNode * | getScopeRoot () const |
|
const TreeNode * | getExpectedRoot () const |
| build-time equivalent to getRoot before an object is actually attached to a tree. This is a mainly a framework and debugging tool for determining what the root of a node being constructed will be when complete
|
|
app::Simulation * | getSimulation () const |
| Gets the simulation (if any) associated with this tree.
|
|
uint32_t | getNumChildren () const |
| Gets the number of children that this node has including those in the sparta builtins group.
|
|
TreeNode * | getChildAt (uint32_t idx) const |
| Gets a child at a position in the children vector in the order in which they were added to this node.
|
|
const ChildrenVector | getChildren () const |
| Gets a vector of all children of this node in any group in the order in which they were added to this node.
|
|
uint32_t | getChildren (std::vector< TreeNode * > &results, bool ignore_builtin_group=true, bool ignore_anonymous_nodes=true) |
| Gets all children of this node in the order in which they were added to this node.
|
|
template<class T > |
uint32_t | getChildrenOfType (std::vector< T * > &results) const |
| return all the children matching a particular type using dynamic cast.
|
|
sparta::TreeNode * | findAncestorByName (const std::string &name) |
| Find ancestor by name.
|
|
template<typename T > |
sparta::TreeNode * | findAncestorByType () |
| Find ancestor by type.
|
|
sparta::TreeNode * | findAncestorByTag (const std::string &tag) |
| Find the first ancestor with a particular tag.
|
|
template<typename T > |
T * | findAncestorResourceByType () |
| Find an ancestor's resource with a certain type.
|
|
const AliasVector & | getAliases () const |
| Gets a vector of all aliases of this node.
|
|
uint32_t | getChildrenIdentifiers (std::vector< std::string > &idents, bool ignore_builtin_group=true) const |
| Gets all child identifiers, aliases, group names, and group-aliases which can be used to refer to a child of this node.
|
|
std::vector< const std::string * > | getIdentifiers () const |
| Gets all the identifiers for this node (excluding groups)
|
|
uint32_t | getGroupSize (const std::string &group) |
| Gets the number of nodes in a group.
|
|
group_idx_type | getGroupIndexMax (const std::string &group) |
| Gets the largest index of a node in the given group.
|
|
uint32_t | getGroup (const std::string &group, std::vector< TreeNode * > &results) |
| Gets all nodes in a child group.
|
|
uint32_t | findChildren (const std::string &pattern, std::vector< TreeNode * > &results, std::vector< std::vector< std::string > > &replacements) |
| Finds all children starting at this node with a given pattern relative to this node by matching names an aliases. Appends each found child to <results>.
|
|
uint32_t | findChildren (const std::string &pattern, std::vector< TreeNode * > &results) |
| Version of findChildren with no replacements vector.
|
|
virtual uint32_t | findImmediateChildren_ (std::regex &expr, std::vector< TreeNode * > &found, std::vector< std::vector< std::string > > &replacements, bool allow_private=false) |
| Finds immediate children with some identity (name or alias) matching a regex.
|
|
uint32_t | findImmediateChildren_ (std::regex &expr, std::vector< TreeNode * > &found, bool allow_private=false) |
| Variant of findImmediateChildren_ with no replacements vector.
|
|
virtual uint32_t | findImmediateChildren_ (std::regex &expr, std::vector< const TreeNode * > &found, std::vector< std::vector< std::string > > &replacements, bool allow_private=false) const |
| Const-qualified variant of findImmediateChildren_.
|
|
uint32_t | findImmediateChildren_ (std::regex &expr, std::vector< const TreeNode * > &found, bool allow_private=false) const |
| Variant of const-qualified findImmediateChildren_ with no replacements vector.
|
|
bool | locationMatchesPattern (const std::string &pattern, const TreeNode *pat_loc) const |
| Determines if the given pattern (which may contain wildcards) can describe this node.
|
|
TreeNode * | getChild (const std::string &name, bool must_exist=true) |
| Retrieves a child with this dotted path name.
|
|
const TreeNode * | getChild (const std::string &name, bool must_exist=true) const |
| Overloaded const-qualified.
|
|
std::string | getDeepestMatchingPath (const std::string &path) const |
| Gets the deepest whole node location starting from this node that matches some part of path starting at its beginning.
|
|
bool | hasChild (const std::string &name) const noexcept |
| Determines if a child can be found with the given dotted path.
|
|
bool | hasImmediateChild (const TreeNode *n) const noexcept |
| Determines if the node n is an immediate child of this node.
|
|
template<class T , typename = typename std::enable_if<std::is_pointer<T>::value>::type, class ConstT = typename ptr_to_const_obj_ptr<T>::type> |
const ConstT | getChildAs (const std::string &name, bool must_exist=true) const |
| Retrieves a child that is castable to T with the given dotted path.
|
|
template<class T , typename = typename std::enable_if<!std::is_pointer<T>::value>::type> |
const T * | getChildAs (const std::string &name, bool must_exist=true) const |
|
template<class T , typename = typename std::enable_if<std::is_pointer<T>::value>::type> |
T | getChildAs (const std::string &name, bool must_exist=true) |
|
template<class T , typename = typename std::enable_if<!std::is_pointer<T>::value>::type> |
T * | getChildAs (const std::string &name, bool must_exist=true) |
|
template<class T , typename = typename std::enable_if<std::is_pointer<T>::value>::type, class ConstT = typename ptr_to_const_obj_ptr<T>::type> |
ConstT | getAs () const |
| Retrieves this node after casting to type T.
|
|
template<class T , typename = typename std::enable_if<!std::is_pointer<T>::value>::type> |
const T * | getAs () const |
| Retrieves this node after casting to type const T.
|
|
template<class T , typename = typename std::enable_if<std::is_pointer<T>::value>::type> |
T | getAs () |
| Retrieves this node after casting to type const T.
|
|
template<class T , typename = typename std::enable_if<!std::is_pointer<T>::value>::type> |
T * | getAs () |
| Retrieves this node after casting to type const T.
|
|
uint32_t | findChildrenByTag (const std::string &tag, std::vector< TreeNode * > &results, int32_t max_depth=-1) |
| Finds a set of all children having the selected tag which this node or descendants of this node within a distance of the given max_depth.
|
|
bool | isDescendantOf (const TreeNode *ancestor, int32_t max_depth=-1) const |
| Determines if this node is a descendant of the specified ancestor node within some number of generations (depth).
|
|
std::string | getLocation () const override final |
|
std::string | getDisplayLocation () const |
| Returns the location of this node in the device tree which might not be usable for navigating the device tree (it cannot be used as an argument for getChild/findChildren).
|
|
std::string | getExpectedLocation () const |
| build-time equivalent to getLocation before an object is actually attached to a tree. This is a mainly a framework and debugging tool for determining what the location of a node currently being constructed will be when complete.
|
|
std::string | renderSubtree (int32_t max_depth=-1, bool show_builtins=false, bool names_only=false, bool hide_hidden=false, bool(*leaf_filt_fxn)(const TreeNode *)=nullptr) const |
| Renders the subtree starting at this node as a string containing an indentation-based depth-first representation.
|
|
uint32_t | getLevel () const |
| Gets the level of this node. 0 is root.
|
|
template<typename T > |
uint32_t | getRecursiveNodeCount () const |
| Recursively gets the count of a nodes that are a subclass of a particular type (determined by dynamic_cast). Includes all descendants of this node in the tree, but excludes this node.
|
|
uint32_t | getPossibleNotifications (std::vector< NotificationInfo > &infos) const |
| Gets information on the possible notifications generated by this node (excludes children).
|
|
void | dumpPossibleNotifications (std::ostream &o) const noexcept |
| Dumps a listing of the notifications which this node can generate to the ostream o.
|
|
template<typename DataT = ANY_TYPE> |
uint32_t | locateNotificationSources (std::vector< TreeNode * > &nodes, const std::string &name="") |
| Gets all possible notification info from NotificationSources within this node's subtree.
|
|
template<typename DataT = ANY_TYPE> |
void | dumpLocatedNotificationSources (std::ostream &o, const std::string &name="") |
| Retrieves the relevant NotificationSources from locateNotificationSources and prints them to the output o.
|
|
uint32_t | getPossibleSubtreeNotifications (std::vector< NotificationInfo > &infos) const noexcept |
| Gets information on the possible notifications generated by this node and all its descendants.
|
|
void | dumpPossibleSubtreeNotifications (std::ostream &o) const noexcept |
| Dumps a listing of the notifications which this node and its descendants can generate to the ostream o.
|
|
bool | canGenerateNotification (const std::type_info &tinfo, const std::string *name) const |
| Can this TreeNode generate a notification of the given type having the given name or pattern.
|
|
bool | canGenerateNotification (const std::type_info &tinfo, const std::string &name) const |
| Can this TreeNode generate a notification of the given type having the given name (does not require interned string - will intern automatically with StringManager).
|
|
bool | canGenerateNotification (const NotificationInfo &info) const |
| Can this TreeNode generate a notification of the given NotificationInfo.
|
|
bool | canSubtreeGenerateNotification (const std::type_info &tinfo, const std::string *name) const |
| Can this TreeNode or its descendants (of any distance) generate a notification of the given type having the given name.
|
|
bool | canSubtreeGenerateNotification (const std::type_info &tinfo, const std::string &name) const |
| Can this TreeNode or its descendants (of any distance) generate a notification of the given type having the given name (does not require interned string)
|
|
bool | canSubtreeGenerateNotifications (const std::type_info &tinfo, const std::vector< const std::string * > &names) const |
| Checks to see if any a subtree can generate any of several notification names which may be patterns.
|
|
template<typename DataT , typename T , void(T::*)(const TreeNode &, const TreeNode &, const DataT &) TMethod> |
void | registerForNotification (T *obj, const std::string &name, bool ensure_possible=true) |
| Registers a callback method to listen for all notifications having the specified data type DataT and name (or any name if name is "") occuring on this node or any descendant (subtree).
|
|
template<typename DataT , typename T , void(T::*)(const DataT &) TMethod> |
void | registerForNotification (T *obj, const std::string &name, bool ensure_possible=true) |
|
template<typename DataT , typename T , void(T::*)(const TreeNode &, const TreeNode &, const DataT &) TMethod> |
void | deregisterForNotification (T *obj, const std::string &name) |
| Removes at most one registration made with registerForNotification.
|
|
template<typename DataT , typename T , void(T::*)(const DataT &) TMethod> |
void | deregisterForNotification (T *obj, const std::string &name) |
|
bool | hasObserversRegisteredForNotification (const std::type_info &tinfo, const std::string *name) const noexcept |
| Determines if this TreeNode (not descendants) has any observers for this type of event and name.
|
|
void | getDelegatesRegisteredForNotification (const std::type_info &tinfo, const std::string *name, std::vector< delegate > &dels) noexcept |
| Gets the vector of delegates registered for a notification on this TreeNode.
|
|
| ResourceContainer () |
| Consturct with a null, unlocked resource.
|
|
| ResourceContainer (const ResourceContainer &)=delete |
| Copy construction disbled.
|
|
| ResourceContainer (ResourceContainer &&)=default |
| Move constructor.
|
|
virtual | ~ResourceContainer () |
| Destructor.
|
|
Resource * | getResource () |
| Gets the resource contained by this node if any. May only be called after finalization begins or during teardown.
|
|
const Resource * | getResource () const |
| Const variant of getResource.
|
|
bool | hasResource () const |
| Determines if this node has a resource. This method exists in case the TreeNode is being explored by a tool or interactive UI. Typical TreeNode clients (such as Resources) will assume that there is a resource if they are expecting one.
|
|
template<class T , typename = typename std::enable_if<std::is_pointer<T>::value>::type> |
const T | getResourceAs () const |
| Gets the resource contained by this node (if any) as the given type.
|
|
template<class T , typename = typename std::enable_if<!std::is_pointer<T>::value>::type> |
const T * | getResourceAs () const |
| Overload of getResourceAs for const access with a non-pointer template type.
|
|
template<class T , typename = typename std::enable_if<std::is_pointer<T>::value>::type> |
T | getResourceAs () |
| Non-const overload of getResourceAs.
|
|
template<class T , typename = typename std::enable_if<!std::is_pointer<T>::value>::type> |
T * | getResourceAs () |
| Non-const overload of getResourceAs.
|
|
virtual std::string | getResourceType () const |
| Gets the typename of the resource that this node will eventually contain.
|
|
virtual std::string | getResourceTypeRaw () const |
| Gets the typename of the resource that this node will eventually contain.
|
|
| PhasedObject (PhasedObject &&)=default |
|
TreePhase | getPhase () const |
| Gets the trees current phase.
|
|
virtual bool | isBuilding () const |
| Is this node (and thus the entire tree above and below it) currently in the TREE_BUILDING phase.
|
|
virtual bool | isBuilt () const |
| Is this node (and thus the entire tree above it) "built". Checks that getPhase has passed TREE_BUILDING.
|
|
virtual bool | isConfigured () const |
| Is this node (and thus the entire tree above it) "configured". Checks that getPhase has passed TREE_CONFIGURING (i.e. FINALIZED, FINALIZING, TEARDOWN, etc).
|
|
virtual bool | isConfiguring () const |
| Is this node (and thus the entire tree above it) currently in the TREE_CONFIGURING phase.
|
|
virtual bool | isFinalizing () const |
| Is this node (and thus the entire tree above it) "finalized".
|
|
virtual bool | isFinalized () const |
| Is this node (and thus the entire tree above it) "finalized".
|
|
virtual bool | isTearingDown () const |
| Is this node (and thus the entire tree above it) in the "teardown" phase.
|
|
std::vector< ArchData * > | getAssociatedArchDatas () |
| Retrieves all ArchDatas associated with this TreeNode so that children can use it to allocate their data.
|
|
const std::vector< ArchData * > | getAssociatedArchDatas () const |
| Const variant of getAssociatedArchDatas.
|
|
| ArchDataContainer ()=default |
| Default constructor.
|
|
| ArchDataContainer (ArchDataContainer &)=delete |
| Copy construction disabled.
|
|
| ArchDataContainer (ArchDataContainer &&)=default |
| Move constructor.
|
|
virtual | ~ArchDataContainer () |
| Virtual destructor.
|
|