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

A ScoreboardView is a view into the master Scoreboard for operand readiness. More...

#include <Scoreboard.hpp>

Public Types

using ReadinessCallback = std::function< void(const Scoreboard::RegisterBitMask &)>
 Typedef for the callbacks.
 

Public Member Functions

 ScoreboardView (const std::string &unit_name, const std::string &scoreboard_type, sparta::TreeNode *node)
 Create a ScoreboardView.
 
void registerReadyCallback (const Scoreboard::RegisterBitMask &bits, const Scoreboard::InstID inst_id, const ReadinessCallback &callback)
 Register a ready callback to be called when the bits are ready.
 
void clearCallbacks (const Scoreboard::InstID inst_id)
 On a flush any registered callback needs to be "forgotten".
 
bool isSet (const Scoreboard::RegisterBitMask &bits) const
 See if the given bits are set.
 
void setReady (const Scoreboard::RegisterBitMask &bits)
 Set the given bits as ready in the Scoreboard.
 
std::string getType () const
 Get the scoreboard type identifier.
 
std::string getName () const
 Get the name of this view.
 

Detailed Description

A ScoreboardView is a view into the master Scoreboard for operand readiness.

Used by the Schedulers/Execution units, the view represents that Scheduler/Execution unit's view into readiness of a rename in the machine.

Definition at line 193 of file Scoreboard.hpp.

Member Typedef Documentation

◆ ReadinessCallback

using sparta::ScoreboardView::ReadinessCallback = std::function<void(const Scoreboard::RegisterBitMask&)>

Typedef for the callbacks.

Definition at line 197 of file Scoreboard.hpp.

Constructor & Destructor Documentation

◆ ScoreboardView()

sparta::ScoreboardView::ScoreboardView ( const std::string &  unit_name,
const std::string &  scoreboard_type,
sparta::TreeNode node 
)

Create a ScoreboardView.

Parameters
unit_nameThe unit name that's creating/receiving SB updates
scoreboard_typeThe type of master Scoreboard to connect to
Thesparta::TreeNode to search for the scoreboard_type

Member Function Documentation

◆ clearCallbacks()

void sparta::ScoreboardView::clearCallbacks ( const Scoreboard::InstID  inst_id)

On a flush any registered callback needs to be "forgotten".

Parameters
unique_idThe unique ID to find and flush

Clears ready callbacks

◆ getName()

std::string sparta::ScoreboardView::getName ( ) const
inline

Get the name of this view.

Returns
Name of the view

Definition at line 265 of file Scoreboard.hpp.

◆ getType()

std::string sparta::ScoreboardView::getType ( ) const
inline

Get the scoreboard type identifier.

Returns
Name string for the scoreboard type

Definition at line 257 of file Scoreboard.hpp.

◆ isSet()

bool sparta::ScoreboardView::isSet ( const Scoreboard::RegisterBitMask &  bits) const
inline

See if the given bits are set.

Parameters
bitsBits to check
Returns
A boolean of result

Definition at line 242 of file Scoreboard.hpp.

◆ registerReadyCallback()

void sparta::ScoreboardView::registerReadyCallback ( const Scoreboard::RegisterBitMask &  bits,
const Scoreboard::InstID  inst_id,
const ReadinessCallback callback 
)

Register a ready callback to be called when the bits are ready.

Parameters
bitsRegisterBitMask of bits to masked to determine ready
callbackThe handler to call; boolean argument + bits being set

Expected callback signature:

void func(const Scoreboard::RegisterBitMask & bits);

After a scoreboard update and the new bits are a match for the registered bits, the callback will be called and cleared from the Scoreboard.

◆ setReady()

void sparta::ScoreboardView::setReady ( const Scoreboard::RegisterBitMask &  bits)

Set the given bits as ready in the Scoreboard.

Parameters
bitsBits to propagate

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