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

Class used to track operand dependencies (timed) between units. More...

#include <Scoreboard.hpp>

Inheritance diagram for sparta::Scoreboard:
Collaboration diagram for sparta::Scoreboard:

Classes

class  ScoreboardParameters
 

Public Types

using UnitID = uint32_t
 
using InstID = uint64_t
 
using RegisterBitMask = std::bitset< MAX_REGISTERS >
 

Public Member Functions

 Scoreboard (sparta::TreeNode *container, const ScoreboardParameters *params)
 Construct a Scoreboard.
 
void set (const RegisterBitMask &bits)
 Set Ready bits on the master scoreboard.
 
void set (const RegisterBitMask &bits, UnitID producer)
 Set Ready bits on the master scoreboard.
 
void clearBits (const RegisterBitMask &bits)
 Clear the given bits from the Scoreboard.
 
UnitID registerView (const std::string &producer_name, ScoreboardView *view)
 Register a view with this Scoreboard based on producer's name. The producer name MUST be listed in column 0 of the latency_matrix parameter.
 
bool isSet (const RegisterBitMask &bits) const
 Look at the master scoreboard's view of ready.
 
- Public Member Functions inherited from sparta::Unit
 Unit (TreeNode *rc, const std::string &name)
 Construct unit with a ResouceContainer.
 
 Unit (TreeNode *rc)
 Construct unit with a ResouceContainer.
 
virtual ~Unit ()
 Destroy!
 
void setAutoPrecedence (bool auto_p)
 Turn off auto-precedence.
 
PortSetgetPortSet ()
 Return the port set.
 
EventSetgetEventSet ()
 Return the event set.
 
StatisticSetgetStatisticSet ()
 Return the stat set.
 
- Public Member Functions inherited from sparta::Resource
 Resource (TreeNode *rc)
 Construct resource with a resource container.
 
 Resource (TreeNode *rc, const std::string &name)
 Construct resource with a specific name and resource container.
 
 Resource (const std::string &name, const Clock *clk)
 Construct a Resource with the given name and clock having NO association with a resource container. This constructor is reserved for free-standing resources owned by other resources (not containers [TreeNodes])
 
virtual ~Resource ()
 Destroy!
 
const ClockgetClock () const
 
SchedulergetScheduler (const bool must_exist=true) const
 
std::string getName () const
 
TreeNodegetContainer ()
 Gets the TreeNode (container) for this resource (if any)
 
const TreeNodegetContainer () const
 Gets the TreeNode (container) for this resource (if any)
 
ResourceContainergetResourceContainer ()
 Gets the ResourceContainer for this resource (if any)
 
const ResourceContainergetResourceContainer () const
 Gets the ResourceContainer for this resource (if any)
 
virtual void addLink (TreeNode *node, const std::string &label)
 
virtual void activateLink (const std::string &label)
 
 Resource (const Resource &)=delete
 Disallow copying.
 
Resourceoperator= (const Resource &)=delete
 

Static Public Attributes

static constexpr UnitID INVALID_UNIT_ID = std::numeric_limits<UnitID>::max()
 
static constexpr uint32_t INVALID_LATENCY = static_cast<uint32_t>(-1)
 
static constexpr uint32_t MAX_REGISTERS = 512
 
static const char name []
 Name of this resource. Required by sparta::ResourceFactory.
 
- Static Public Attributes inherited from sparta::Unit
static constexpr const char * INFO_LOG = "info"
 
static constexpr const char * WARN_LOG = log::categories::WARN_STR
 
static constexpr const char * DEBUG_LOG = log::categories::DEBUG_STR
 

Friends

class ScoreboardView
 

Additional Inherited Members

- Protected Member Functions inherited from sparta::Unit
virtual void onBindTreeEarly_ () override
 
virtual void onBindTreeLate_ () override
 Dump a dot.
 
- Protected Attributes inherited from sparta::Unit
sparta::PortSet unit_port_set_
 The Unit's Ports.
 
sparta::EventSet unit_event_set_
 The Unit's event set.
 
sparta::StatisticSet unit_stat_set_
 The Unit's statistic set.
 
log::MessageSource info_logger_
 Default info logger.
 
log::MessageSource warn_logger_
 Default warn logger.
 
log::MessageSource debug_logger_
 Default debug logger.
 

Detailed Description

Class used to track operand dependencies (timed) between units.

The Scoreboard of the model simply keeps track of the readiness of phyiscal registers in the OOO core. There are two parts to the SB:

  1. The Scoreboard or "master" for each register file type (GPU, FPR, Vector, etc). Typically a Rename block is responsible for setting/clearing the SB readiness.
  2. The ScoreboardView is created by a Scheduling/Execution block and is used to determine if an instruction is ready for execution (all operands ready)

Definition at line 41 of file Scoreboard.hpp.

Member Typedef Documentation

◆ InstID

using sparta::Scoreboard::InstID = uint64_t

Definition at line 45 of file Scoreboard.hpp.

◆ RegisterBitMask

using sparta::Scoreboard::RegisterBitMask = std::bitset<MAX_REGISTERS>

Definition at line 51 of file Scoreboard.hpp.

◆ UnitID

using sparta::Scoreboard::UnitID = uint32_t

Definition at line 44 of file Scoreboard.hpp.

Constructor & Destructor Documentation

◆ Scoreboard()

sparta::Scoreboard::Scoreboard ( sparta::TreeNode container,
const ScoreboardParameters params 
)

Construct a Scoreboard.

Parameters
containerThe TreeNode this Scoreboard belongs to
paramsThe parameters of this Scoreboard

Member Function Documentation

◆ clearBits()

void sparta::Scoreboard::clearBits ( const RegisterBitMask &  bits)

Clear the given bits from the Scoreboard.

Parameters
bitsThe bits to clear

A bit value of 1 is cleared (sets the Scoreboard internal value to 0). This is propogated to all of the Scoreboard Views immediately.

◆ registerView()

UnitID sparta::Scoreboard::registerView ( const std::string &  producer_name,
ScoreboardView view 
)

Register a view with this Scoreboard based on producer's name. The producer name MUST be listed in column 0 of the latency_matrix parameter.

Parameters
producer_nameThe name of the producer
viewThe view to register

◆ set() [1/2]

void sparta::Scoreboard::set ( const RegisterBitMask &  bits)

Set Ready bits on the master scoreboard.

Parameters
bitsBits to set as ready

A bit value of 1 means the rename is ready, 0 is not. When this function is called, it will propogate those ready bits to all registered ScoreboardViews in the machine immediately.

◆ set() [2/2]

void sparta::Scoreboard::set ( const RegisterBitMask &  bits,
UnitID  producer 
)

Set Ready bits on the master scoreboard.

Parameters
bitsBits to set as ready
producerThe unit ID of the producer

A bit value of 1 means the rename is ready, 0 is not. When this function is called, it will propogate those ready bits to all registered ScoreboardViews in the machine using the registered latencies.

Friends And Related Symbol Documentation

◆ ScoreboardView

friend class ScoreboardView
friend

Definition at line 137 of file Scoreboard.hpp.

Member Data Documentation

◆ INVALID_LATENCY

constexpr uint32_t sparta::Scoreboard::INVALID_LATENCY = static_cast<uint32_t>(-1)
staticconstexpr

Definition at line 48 of file Scoreboard.hpp.

◆ INVALID_UNIT_ID

constexpr UnitID sparta::Scoreboard::INVALID_UNIT_ID = std::numeric_limits<UnitID>::max()
staticconstexpr

Definition at line 47 of file Scoreboard.hpp.

◆ MAX_REGISTERS

constexpr uint32_t sparta::Scoreboard::MAX_REGISTERS = 512
staticconstexpr

Definition at line 49 of file Scoreboard.hpp.

◆ name

const char sparta::Scoreboard::name[]
static

Name of this resource. Required by sparta::ResourceFactory.

Definition at line 54 of file Scoreboard.hpp.


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