Go to the documentation of this file.
38 #ifndef __MEM_STACK_DIST_CALC_HH__
39 #define __MEM_STACK_DIST_CALC_HH__
196 uint64_t
getSum(
Node* node,
bool from_left, uint64_t sum_from_below,
197 uint64_t stack_dist, uint64_t
level)
const;
225 bool from_left, uint64_t sum_from_below, uint64_t
level,
226 uint64_t stack_dist,
bool discard_node);
302 bool update_stack =
false);
312 static constexpr uint64_t
Infinity = std::numeric_limits<uint64_t>::max();
341 bool addNewNode =
true);
414 #endif //__STACK_DIST_CALC_HH__
StackDistCalc(bool verify_stack=false)
uint64_t getSumsLeavesToRoot(Node *node) const
Gets the sum from the leaf node specified.
std::map< uint64_t, Node * > IndexNodeMap
std::vector< IndexNodeMap > TreeType
std::pair< uint64_t, bool > calcStackDist(const Addr r_address, bool mark=false)
Process the given address.
void sanityCheckTree(const Node *node, uint64_t level=0) const
This method is used for verification purposes It recursively traverses upwards from the given node ti...
bool isMarked
Flag to indicate if this address is marked.
void updateTree()
updateTree is a tree balancing operation, which maintains the binary tree structure.
uint64_t updateSumsLeavesToRoot(Node *node, bool is_new_leaf)
Updates the leaf nodes and nodes above.
uint64_t index
Internal counter for address accesses (unique and non-unique) This counter increments everytime the c...
std::vector< uint64_t > stack
uint64_t getSum(Node *node, bool from_left, uint64_t sum_from_below, uint64_t stack_dist, uint64_t level) const
Gets sum from the node upwards recursively till the root.
Node which takes form of Leaf, INode or Root.
uint64_t verifyStackDist(const Addr r_address, bool update_stack=false)
This is an alternative implementation of the stack-distance in a naive way.
std::pair< uint64_t, bool > calcStackDistAndUpdate(const Addr r_address, bool addNewNode=true)
Process the given address:
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint64_t updateSum(Node *node, bool from_left, uint64_t sum_from_below, uint64_t level, uint64_t stack_dist, bool discard_node)
Updates the nodes upwards recursively till the root.
static constexpr uint64_t Infinity
A convenient way of refering to infinity.
The stack distance calculator is a passive object that merely observes the addresses pass to it.
uint64_t getTreeDepth() const
Query depth of the tree (tree[0] represents leaf layer while tree[treeDepth] represents the root laye...
Node()
The discard flags are false by default they become true if the node is reached again in a future look...
uint64_t getIndex() const
Return the counter for address accesses (unique and non-unique).
void printStack(int n=5) const
Print the last n items on the stack.
std::vector< uint64_t > nextIndex
std::map< Addr, uint64_t > AddressIndexMap
Generated on Wed Sep 30 2020 14:02:14 for gem5 by doxygen 1.8.17