The Sparta Modeling Framework
Loading...
Searching...
No Matches
sparta::GlobalOrderingPoint Class Reference

Used to set precedence between Scheduleable types across simulation. More...

#include <GlobalOrderingPoint.hpp>

Public Member Functions

 GlobalOrderingPoint (sparta::TreeNode *node, const std::string &name)
 Construction a GlobalOrderingPoint.
 
const std::string & getName () const
 Handy method for debug.
 
DAG::GOPoint * getGOPoint () const
 Used by the precedence rules.
 

Detailed Description

Used to set precedence between Scheduleable types across simulation.

In cases where two events in different blocks need synchronization, this class can allow a modeler to set a precedence between those entities, even across blocks that do not know about each other.

Example: a core's load/store unit needs to send "ready" to the middle machine for operand readiness. The middle machine will pick the instruction that corresponds to that ready signal on the same cycle the load/store sends ready. The modeler requires the load/store unit to be scheduled first before the middle machine's picker:

class LSU {
EventT ev_send_ready_;
};
class MidMachine {
EventT pick_instruction_;
};

In the above case, the event ev_send_ready_ must be scheduled before pick_instruction_.

To do this, set up a sparta::GlobalOrderingPoint in both unit's constructors:

LSU::LSU(sparta::TreeNode * container, const LSUParameters*)
{
// Sent ready signal MUST COME BEFORE the GlobalOrderingPoint
ev_send_ready_ >> sparta::GlobalOrderingPoint(container, "lsu_midmachine_order");
}
MidMachine::MidMachine(sparta::TreeNode * container, const MidMachineParameters*)
{
// The GlobalOrderingPoint must come before picking
sparta::GlobalOrderingPoint(container, "lsu_midmachine_order") >> pick_instruction_;
}
Used to set precedence between Scheduleable types across simulation.
Node in a composite tree representing a sparta Tree item.
Definition TreeNode.hpp:205

The modeler must ensure the name of the sparta::GlobalOrderingPoint is the same on both calls.

Definition at line 60 of file GlobalOrderingPoint.hpp.

Constructor & Destructor Documentation

◆ GlobalOrderingPoint()

sparta::GlobalOrderingPoint::GlobalOrderingPoint ( sparta::TreeNode node,
const std::string &  name 
)
inline

Construction a GlobalOrderingPoint.

Parameters
nodeThe node this GOP is associated with
nameThe name that's used to register with the internal DAG

See descition for use

Definition at line 71 of file GlobalOrderingPoint.hpp.

Here is the call graph for this function:

Member Function Documentation

◆ getGOPoint()

DAG::GOPoint * sparta::GlobalOrderingPoint::getGOPoint ( ) const
inline

Used by the precedence rules.

Returns
The internal GOP from the internal DAG

Definition at line 93 of file GlobalOrderingPoint.hpp.

◆ getName()

const std::string & sparta::GlobalOrderingPoint::getName ( ) const
inline

Handy method for debug.

Returns
The name of this GOP

Definition at line 85 of file GlobalOrderingPoint.hpp.


The documentation for this class was generated from the following file: