gem5  v22.1.0.0
Public Member Functions | Private Attributes | List of all members
gem5::Dueler Class Reference

A dueler is an entry that may or may not be accounted for sampling. More...

#include <dueling.hh>

Inheritance diagram for gem5::Dueler:
gem5::replacement_policy::Dueling::DuelerReplData

Public Member Functions

 Dueler ()
 By default initializes entries as followers. More...
 
virtual ~Dueler ()=default
 
void setSample (uint64_t id, bool team)
 Make this entry a sampling entry for a specific Dueling instance. More...
 
bool isSample (uint64_t id, bool &team) const
 Check if entry is a sample for the given instance. More...
 

Private Attributes

uint64_t _isSample
 Whether this entry is a sample or a follower. More...
 
uint64_t _team
 If entry is a sample, it belongs to one of two possible teams. More...
 

Detailed Description

A dueler is an entry that may or may not be accounted for sampling.

Whenever an action triggers sampling, the dueling monitor will check if the dueler is a sample so that it can decide whether to perform the sampling or not.

Each sampling dueler belongs to a team, "True" or "False", for which it "duels". For example, if a sample belongs to team "True" and it is sampled, team "True" will score a point.

See also
DuelingMonitor

Definition at line 52 of file dueling.hh.

Constructor & Destructor Documentation

◆ Dueler()

gem5::Dueler::Dueler ( )

By default initializes entries as followers.

Definition at line 39 of file dueling.cc.

◆ ~Dueler()

virtual gem5::Dueler::~Dueler ( )
virtualdefault

Member Function Documentation

◆ isSample()

bool gem5::Dueler::isSample ( uint64_t  id,
bool &  team 
) const

Check if entry is a sample for the given instance.

If so, provide back its team.

Parameters
idThe ID of the Dueling instance that called this function.
teamTeam to which this sampling entry belongs (only 2 possible).
Returns
Whether this is a sampling entry.

Definition at line 57 of file dueling.cc.

References _isSample, _team, and gem5::ArmISA::id.

Referenced by gem5::DuelingMonitor::isSample(), gem5::DuelingMonitor::sample(), and TEST().

◆ setSample()

void gem5::Dueler::setSample ( uint64_t  id,
bool  team 
)

Make this entry a sampling entry for a specific Dueling instance.

Parameters
idThe ID of the Dueling instance that called this function.
teamTeam to which this sampling entry belongs (only 2 possible).

Definition at line 45 of file dueling.cc.

References _isSample, _team, gem5::ArmISA::id, panic_if, and gem5::popCount().

Referenced by gem5::DuelingMonitor::initEntry(), and TEST().

Member Data Documentation

◆ _isSample

uint64_t gem5::Dueler::_isSample
private

Whether this entry is a sample or a follower.

Each bit corresponds to a different ueling monitor instance. If more than 64 instances are needed this needs to be changed to an array containing the ids being sampled.

Definition at line 61 of file dueling.hh.

Referenced by isSample(), and setSample().

◆ _team

uint64_t gem5::Dueler::_team
private

If entry is a sample, it belongs to one of two possible teams.

Each bit corresponds to a different dueling monitor instance.

Definition at line 67 of file dueling.hh.

Referenced by isSample(), and setSample().


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

Generated on Wed Dec 21 2022 10:23:26 for gem5 by doxygen 1.9.1