gem5 [DEVELOP-FOR-25.0]
Loading...
Searching...
No Matches
gem5::o3::StoreSet Class Reference

Implements a store set predictor for determining if memory instructions are dependent upon each other. More...

#include <store_set.hh>

Inheritance diagram for gem5::o3::StoreSet:
gem5::Named

Classes

class  SSITEntry
 

Public Types

typedef Addr SSID
 

Public Member Functions

 StoreSet ()
 Default constructor.
 
 StoreSet (std::string_view name, uint64_t clear_period, size_t SSIT_entries, int SSIT_assoc, replacement_policy::Base *replPolicy, BaseIndexingPolicy *indexingPolicy, int LFST_size)
 Creates store set predictor with given table sizes.
 
 ~StoreSet ()
 Default destructor.
 
void init (uint64_t clear_period, size_t SSIT_entries, int SSIT_assoc, replacement_policy::Base *_replPolicy, BaseIndexingPolicy *_indexingPolicy, int LFST_size)
 Initializes the store set predictor with the given table sizes.
 
void violation (Addr store_PC, Addr load_PC)
 Records a memory ordering violation between the younger load and the older store.
 
void checkClear ()
 Clears the store set predictor every so often so that all the entries aren't used and stores are constantly predicted as conflicting.
 
void insertLoad (Addr load_PC, InstSeqNum load_seq_num)
 Inserts a load into the store set predictor.
 
void insertStore (Addr store_PC, InstSeqNum store_seq_num, ThreadID tid)
 Inserts a store into the store set predictor.
 
InstSeqNum checkInst (Addr PC)
 Checks if the instruction with the given PC is dependent upon any store.
 
void issued (Addr issued_PC, InstSeqNum issued_seq_num, bool is_store)
 Records this PC/sequence number as issued.
 
void squash (InstSeqNum squashed_num, ThreadID tid)
 Squashes for a specific thread until the given sequence number.
 
void clear ()
 Resets all tables.
 
void dump ()
 Debug function to dump the contents of the store list.
 
- Public Member Functions inherited from gem5::Named
 Named (std::string_view name_)
 
virtual ~Named ()=default
 
virtual std::string name () const
 

Private Types

typedef std::map< InstSeqNum, int, ltseqnum >::iterator SeqNumMapIt
 

Private Member Functions

SSID calcSSID (Addr PC)
 Calculates a Store Set ID based on the PC.
 

Private Attributes

AssociativeCache< SSITEntrySSIT
 The Store Set ID Table.
 
std::vector< InstSeqNumLFST
 Last Fetched Store Table.
 
std::vector< bool > validLFST
 Bit vector to tell if the LFST has a valid entry.
 
std::map< InstSeqNum, int, ltseqnumstoreList
 Map of stores that have been inserted into the store set, but not yet issued or squashed.
 
uint64_t clearPeriod
 Number of loads/stores to process before wiping predictor so all entries don't get saturated.
 
int SSITSize
 Store Set ID Table size, in entries.
 
int LFSTSize
 Last Fetched Store Table size, in entries.
 
int memOpsPred
 Number of memory operations predicted since last clear of predictor.
 

Detailed Description

Implements a store set predictor for determining if memory instructions are dependent upon each other.

See paper "Memory Dependence Prediction using Store Sets" by Chrysos and Emer. SSID stands for Store Set ID, SSIT stands for Store Set ID Table, and LFST is Last Fetched Store Table.

Definition at line 73 of file store_set.hh.

Member Typedef Documentation

◆ SeqNumMapIt

typedef std::map<InstSeqNum,int,ltseqnum>::iterator gem5::o3::StoreSet::SeqNumMapIt
private

Definition at line 165 of file store_set.hh.

◆ SSID

Definition at line 76 of file store_set.hh.

Constructor & Destructor Documentation

◆ StoreSet() [1/2]

gem5::o3::StoreSet::StoreSet ( )
inline

Default constructor.

init() must be called prior to use.

Definition at line 92 of file store_set.hh.

References gem5::Named::Named(), and SSIT.

Referenced by checkClear(), checkInst(), init(), insertStore(), issued(), squash(), StoreSet(), and violation().

◆ StoreSet() [2/2]

gem5::o3::StoreSet::StoreSet ( std::string_view name,
uint64_t clear_period,
size_t SSIT_entries,
int SSIT_assoc,
replacement_policy::Base * replPolicy,
BaseIndexingPolicy * indexingPolicy,
int LFST_size )

Creates store set predictor with given table sizes.

Definition at line 43 of file store_set.cc.

References clearPeriod, DPRINTF, fatal, gem5::genTagExtractor(), gem5::ArmISA::i, gem5::isPowerOf2(), LFST, LFSTSize, memOpsPred, gem5::Named::Named(), SSIT, SSITSize, StoreSet(), and validLFST.

◆ ~StoreSet()

gem5::o3::StoreSet::~StoreSet ( )

Default destructor.

Definition at line 78 of file store_set.cc.

Member Function Documentation

◆ calcSSID()

SSID gem5::o3::StoreSet::calcSSID ( Addr PC)
inlineprivate

Calculates a Store Set ID based on the PC.

Definition at line 148 of file store_set.hh.

References LFSTSize.

Referenced by violation().

◆ checkClear()

void gem5::o3::StoreSet::checkClear ( )

Clears the store set predictor every so often so that all the entries aren't used and stores are constantly predicted as conflicting.

Definition at line 181 of file store_set.cc.

References clear(), clearPeriod, DPRINTF, memOpsPred, and StoreSet().

Referenced by insertLoad(), and insertStore().

◆ checkInst()

InstSeqNum gem5::o3::StoreSet::checkInst ( Addr PC)

Checks if the instruction with the given PC is dependent upon any store.

Returns
Returns the sequence number of the store instruction this PC is dependent upon. Returns 0 if none.

Definition at line 232 of file store_set.cc.

References DPRINTF, LFST, LFSTSize, SSIT, StoreSet(), and validLFST.

◆ clear()

void gem5::o3::StoreSet::clear ( )

Resets all tables.

Definition at line 331 of file store_set.cc.

References gem5::ArmISA::i, LFSTSize, SSIT, storeList, and validLFST.

Referenced by checkClear().

◆ dump()

void gem5::o3::StoreSet::dump ( )

Debug function to dump the contents of the store list.

Definition at line 343 of file store_set.cc.

References gem5::cprintf(), and storeList.

◆ init()

void gem5::o3::StoreSet::init ( uint64_t clear_period,
size_t SSIT_entries,
int SSIT_assoc,
replacement_policy::Base * _replPolicy,
BaseIndexingPolicy * _indexingPolicy,
int LFST_size )

Initializes the store set predictor with the given table sizes.

Definition at line 83 of file store_set.cc.

References clearPeriod, DPRINTF, gem5::genTagExtractor(), gem5::ArmISA::i, LFST, LFSTSize, memOpsPred, SSIT, SSITSize, StoreSet(), and validLFST.

◆ insertLoad()

void gem5::o3::StoreSet::insertLoad ( Addr load_PC,
InstSeqNum load_seq_num )

Inserts a load into the store set predictor.

This does nothing but is included in case other predictors require a similar function.

Definition at line 193 of file store_set.cc.

References checkClear().

◆ insertStore()

void gem5::o3::StoreSet::insertStore ( Addr store_PC,
InstSeqNum store_seq_num,
ThreadID tid )

Inserts a store into the store set predictor.

Updates the LFST if the store has a valid SSID.

Definition at line 201 of file store_set.cc.

References checkClear(), DPRINTF, LFST, LFSTSize, SSIT, storeList, StoreSet(), and validLFST.

◆ issued()

void gem5::o3::StoreSet::issued ( Addr issued_PC,
InstSeqNum issued_seq_num,
bool is_store )

Records this PC/sequence number as issued.

Definition at line 265 of file store_set.cc.

References DPRINTF, LFST, LFSTSize, SSIT, storeList, StoreSet(), and validLFST.

◆ squash()

void gem5::o3::StoreSet::squash ( InstSeqNum squashed_num,
ThreadID tid )

Squashes for a specific thread until the given sequence number.

Definition at line 301 of file store_set.cc.

References DPRINTF, LFST, storeList, StoreSet(), and validLFST.

◆ violation()

void gem5::o3::StoreSet::violation ( Addr store_PC,
Addr load_PC )

Records a memory ordering violation between the younger load and the older store.

Definition at line 112 of file store_set.cc.

References calcSSID(), DPRINTF, LFSTSize, gem5::o3::StoreSet::SSITEntry::setSSID(), SSIT, and StoreSet().

Member Data Documentation

◆ clearPeriod

uint64_t gem5::o3::StoreSet::clearPeriod
private

Number of loads/stores to process before wiping predictor so all entries don't get saturated.

Definition at line 170 of file store_set.hh.

Referenced by checkClear(), init(), and StoreSet().

◆ LFST

std::vector<InstSeqNum> gem5::o3::StoreSet::LFST
private

Last Fetched Store Table.

Definition at line 155 of file store_set.hh.

Referenced by checkInst(), init(), insertStore(), issued(), squash(), and StoreSet().

◆ LFSTSize

int gem5::o3::StoreSet::LFSTSize
private

Last Fetched Store Table size, in entries.

Definition at line 176 of file store_set.hh.

Referenced by calcSSID(), checkInst(), clear(), init(), insertStore(), issued(), StoreSet(), and violation().

◆ memOpsPred

int gem5::o3::StoreSet::memOpsPred
private

Number of memory operations predicted since last clear of predictor.

Definition at line 179 of file store_set.hh.

Referenced by checkClear(), init(), and StoreSet().

◆ SSIT

AssociativeCache<SSITEntry> gem5::o3::StoreSet::SSIT
private

The Store Set ID Table.

Definition at line 152 of file store_set.hh.

Referenced by checkInst(), clear(), init(), insertStore(), issued(), StoreSet(), StoreSet(), and violation().

◆ SSITSize

int gem5::o3::StoreSet::SSITSize
private

Store Set ID Table size, in entries.

Definition at line 173 of file store_set.hh.

Referenced by init(), and StoreSet().

◆ storeList

std::map<InstSeqNum, int, ltseqnum> gem5::o3::StoreSet::storeList
private

Map of stores that have been inserted into the store set, but not yet issued or squashed.

Definition at line 163 of file store_set.hh.

Referenced by clear(), dump(), insertStore(), issued(), and squash().

◆ validLFST

std::vector<bool> gem5::o3::StoreSet::validLFST
private

Bit vector to tell if the LFST has a valid entry.

Definition at line 158 of file store_set.hh.

Referenced by checkInst(), clear(), init(), insertStore(), issued(), squash(), and StoreSet().


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

Generated on Mon May 26 2025 09:19:34 for gem5 by doxygen 1.13.2