gem5 v24.0.0.0
|
Implements a store set predictor for determining if memory instructions are dependent upon each other. More...
#include <store_set.hh>
Public Types | |
typedef unsigned | SSID |
Public Member Functions | |
StoreSet () | |
Default constructor. | |
StoreSet (uint64_t clear_period, int SSIT_size, int LFST_size) | |
Creates store set predictor with given table sizes. | |
~StoreSet () | |
Default destructor. | |
void | init (uint64_t clear_period, int SSIT_size, 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. | |
Private Types | |
typedef std::map< InstSeqNum, int, ltseqnum >::iterator | SeqNumMapIt |
Private Member Functions | |
int | calcIndex (Addr PC) |
Calculates the index into the SSIT based on the PC. | |
SSID | calcSSID (Addr PC) |
Calculates a Store Set ID based on the PC. | |
Private Attributes | |
std::vector< SSID > | SSIT |
The Store Set ID Table. | |
std::vector< bool > | validSSIT |
Bit vector to tell if the SSIT has a valid entry. | |
std::vector< InstSeqNum > | LFST |
Last Fetched Store Table. | |
std::vector< bool > | validLFST |
Bit vector to tell if the LFST has a valid entry. | |
std::map< InstSeqNum, int, ltseqnum > | storeList |
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 | indexMask |
Mask to obtain the index. | |
int | offsetBits |
int | memOpsPred |
Number of memory operations predicted since last clear of predictor. | |
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 62 of file store_set.hh.
|
private |
Definition at line 143 of file store_set.hh.
typedef unsigned gem5::o3::StoreSet::SSID |
Definition at line 65 of file store_set.hh.
|
inline |
Default constructor.
init() must be called prior to use.
Definition at line 69 of file store_set.hh.
gem5::o3::StoreSet::StoreSet | ( | uint64_t | clear_period, |
int | SSIT_size, | ||
int | LFST_size ) |
Creates store set predictor with given table sizes.
Definition at line 42 of file store_set.cc.
References DPRINTF, fatal, gem5::ArmISA::i, indexMask, gem5::isPowerOf2(), LFST, LFSTSize, memOpsPred, offsetBits, SSIT, SSITSize, validLFST, and validSSIT.
gem5::o3::StoreSet::~StoreSet | ( | ) |
Default destructor.
Definition at line 80 of file store_set.cc.
|
inlineprivate |
Calculates the index into the SSIT based on the PC.
Definition at line 119 of file store_set.hh.
References indexMask, and offsetBits.
Referenced by checkInst(), insertStore(), issued(), and violation().
Calculates a Store Set ID based on the PC.
Definition at line 123 of file store_set.hh.
References LFSTSize.
Referenced by violation().
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 193 of file store_set.cc.
References clear(), clearPeriod, DPRINTF, and memOpsPred.
Referenced by insertLoad(), and insertStore().
InstSeqNum gem5::o3::StoreSet::checkInst | ( | Addr | PC | ) |
Checks if the instruction with the given PC is dependent upon any store.
Definition at line 243 of file store_set.cc.
References calcIndex(), DPRINTF, gem5::MipsISA::index, LFST, LFSTSize, SSIT, SSITSize, validLFST, and validSSIT.
Referenced by gem5::o3::MemDepUnit::insert().
void gem5::o3::StoreSet::clear | ( | ) |
Resets all tables.
Definition at line 345 of file store_set.cc.
References gem5::ArmISA::i, LFSTSize, SSITSize, storeList, validLFST, and validSSIT.
Referenced by checkClear(), and gem5::o3::MemDepUnit::takeOverFrom().
void gem5::o3::StoreSet::dump | ( | ) |
Debug function to dump the contents of the store list.
Definition at line 359 of file store_set.cc.
References gem5::cprintf(), and storeList.
void gem5::o3::StoreSet::init | ( | uint64_t | clear_period, |
int | SSIT_size, | ||
int | LFST_size ) |
Initializes the store set predictor with the given table sizes.
Definition at line 85 of file store_set.cc.
References clearPeriod, DPRINTF, gem5::ArmISA::i, indexMask, LFST, LFSTSize, memOpsPred, offsetBits, SSIT, SSITSize, validLFST, and validSSIT.
Referenced by gem5::o3::MemDepUnit::init().
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 205 of file store_set.cc.
References checkClear().
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 213 of file store_set.cc.
References calcIndex(), checkClear(), DPRINTF, gem5::MipsISA::index, LFST, LFSTSize, SSIT, SSITSize, storeList, validLFST, and validSSIT.
Referenced by gem5::o3::MemDepUnit::insert(), and gem5::o3::MemDepUnit::insertNonSpec().
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 278 of file store_set.cc.
References calcIndex(), DPRINTF, gem5::MipsISA::index, LFST, LFSTSize, SSIT, SSITSize, storeList, validLFST, and validSSIT.
Referenced by gem5::o3::MemDepUnit::issue().
void gem5::o3::StoreSet::squash | ( | InstSeqNum | squashed_num, |
ThreadID | tid ) |
Squashes for a specific thread until the given sequence number.
Definition at line 315 of file store_set.cc.
References DPRINTF, LFST, storeList, and validLFST.
Referenced by gem5::o3::MemDepUnit::squash().
Records a memory ordering violation between the younger load and the older store.
Definition at line 120 of file store_set.cc.
References calcIndex(), calcSSID(), DPRINTF, LFSTSize, SSIT, SSITSize, and validSSIT.
Referenced by gem5::o3::MemDepUnit::violation().
|
private |
Number of loads/stores to process before wiping predictor so all entries don't get saturated.
Definition at line 148 of file store_set.hh.
Referenced by checkClear(), and init().
|
private |
Mask to obtain the index.
Definition at line 157 of file store_set.hh.
Referenced by calcIndex(), init(), and StoreSet().
|
private |
Last Fetched Store Table.
Definition at line 133 of file store_set.hh.
Referenced by checkInst(), init(), insertStore(), issued(), squash(), and StoreSet().
|
private |
Last Fetched Store Table size, in entries.
Definition at line 154 of file store_set.hh.
Referenced by calcSSID(), checkInst(), clear(), init(), insertStore(), issued(), StoreSet(), and violation().
|
private |
Number of memory operations predicted since last clear of predictor.
Definition at line 163 of file store_set.hh.
Referenced by checkClear(), init(), and StoreSet().
|
private |
Definition at line 160 of file store_set.hh.
Referenced by calcIndex(), init(), and StoreSet().
|
private |
The Store Set ID Table.
Definition at line 127 of file store_set.hh.
Referenced by checkInst(), init(), insertStore(), issued(), StoreSet(), and violation().
|
private |
Store Set ID Table size, in entries.
Definition at line 151 of file store_set.hh.
Referenced by checkInst(), clear(), init(), insertStore(), issued(), StoreSet(), and violation().
|
private |
Map of stores that have been inserted into the store set, but not yet issued or squashed.
Definition at line 141 of file store_set.hh.
Referenced by clear(), dump(), insertStore(), issued(), and squash().
|
private |
Bit vector to tell if the LFST has a valid entry.
Definition at line 136 of file store_set.hh.
Referenced by checkInst(), clear(), init(), insertStore(), issued(), squash(), and StoreSet().
|
private |
Bit vector to tell if the SSIT has a valid entry.
Definition at line 130 of file store_set.hh.
Referenced by checkInst(), clear(), init(), insertStore(), issued(), StoreSet(), and violation().