gem5
v20.1.0.0
|
Class that implements the actual LQ and SQ for each specific thread. More...
#include <lsq_unit.hh>
Classes | |
class | LQSenderState |
Particularisation of the LSQSenderState to the LQ. More... | |
class | LSQEntry |
struct | LSQUnitStats |
class | SQEntry |
class | SQSenderState |
Particularisation of the LSQSenderState to the SQ. More... | |
class | WritebackEvent |
Writeback event, specifically for when stores forward data to loads. More... | |
Public Types | |
typedef Impl::O3CPU | O3CPU |
typedef Impl::DynInstPtr | DynInstPtr |
typedef Impl::CPUPol::IEW | IEW |
typedef Impl::CPUPol::LSQ | LSQ |
typedef Impl::CPUPol::IssueStruct | IssueStruct |
using | LSQSenderState = typename LSQ::LSQSenderState |
using | LSQRequest = typename Impl::CPUPol::LSQ::LSQRequest |
using | LoadQueue = CircularQueue< LQEntry > |
using | StoreQueue = CircularQueue< SQEntry > |
typedef CircularQueue< LQEntry >::iterator | LQIterator |
typedef CircularQueue< SQEntry >::iterator | SQIterator |
typedef CircularQueue< LQEntry > | LQueue |
typedef CircularQueue< SQEntry > | SQueue |
Public Member Functions | |
LSQUnit (uint32_t lqEntries, uint32_t sqEntries) | |
Constructs an LSQ unit. More... | |
LSQUnit (const LSQUnit &l) | |
We cannot copy LSQUnit because it has stats for which copy contructor is deleted explicitly. More... | |
void | init (O3CPU *cpu_ptr, IEW *iew_ptr, DerivO3CPUParams *params, LSQ *lsq_ptr, unsigned id) |
Initializes the LSQ unit with the specified number of entries. More... | |
std::string | name () const |
Returns the name of the LSQ unit. More... | |
void | setDcachePort (RequestPort *dcache_port) |
Sets the pointer to the dcache port. More... | |
void | drainSanityCheck () const |
Perform sanity checks after a drain. More... | |
void | takeOverFrom () |
Takes over from another CPU's thread. More... | |
void | insert (const DynInstPtr &inst) |
Inserts an instruction. More... | |
void | insertLoad (const DynInstPtr &load_inst) |
Inserts a load instruction. More... | |
void | insertStore (const DynInstPtr &store_inst) |
Inserts a store instruction. More... | |
Fault | checkViolations (typename LoadQueue::iterator &loadIt, const DynInstPtr &inst) |
Check for ordering violations in the LSQ. More... | |
void | checkSnoop (PacketPtr pkt) |
Check if an incoming invalidate hits in the lsq on a load that might have issued out of order wrt another load beacuse of the intermediate invalidate. More... | |
Fault | executeLoad (const DynInstPtr &inst) |
Executes a load instruction. More... | |
Fault | executeLoad (int lq_idx) |
Fault | executeStore (const DynInstPtr &inst) |
Executes a store instruction. More... | |
void | commitLoad () |
Commits the head load. More... | |
void | commitLoads (InstSeqNum &youngest_inst) |
Commits loads older than a specific sequence number. More... | |
void | commitStores (InstSeqNum &youngest_inst) |
Commits stores older than a specific sequence number. More... | |
void | writebackStores () |
Writes back stores. More... | |
void | completeDataAccess (PacketPtr pkt) |
Completes the data access that has been returned from the memory system. More... | |
void | squash (const InstSeqNum &squashed_num) |
Squashes all instructions younger than a specific sequence number. More... | |
bool | violation () |
Returns if there is a memory ordering violation. More... | |
DynInstPtr | getMemDepViolator () |
Returns the memory ordering violator. More... | |
unsigned | numFreeLoadEntries () |
Returns the number of free LQ entries. More... | |
unsigned | numFreeStoreEntries () |
Returns the number of free SQ entries. More... | |
int | numLoads () |
Returns the number of loads in the LQ. More... | |
int | numStores () |
Returns the number of stores in the SQ. More... | |
int | numHtmStarts () const |
int | numHtmStops () const |
void | resetHtmStartsStops () |
uint64_t | getLatestHtmUid () const |
void | setLastRetiredHtmUid (uint64_t htm_uid) |
bool | isFull () |
Returns if either the LQ or SQ is full. More... | |
bool | isEmpty () const |
Returns if both the LQ and SQ are empty. More... | |
bool | lqFull () |
Returns if the LQ is full. More... | |
bool | sqFull () |
Returns if the SQ is full. More... | |
bool | lqEmpty () const |
Returns if the LQ is empty. More... | |
bool | sqEmpty () const |
Returns if the SQ is empty. More... | |
unsigned | getCount () |
Returns the number of instructions in the LSQ. More... | |
bool | hasStoresToWB () |
Returns if there are any stores to writeback. More... | |
int | numStoresToWB () |
Returns the number of stores to writeback. More... | |
bool | willWB () |
Returns if the LSQ unit will writeback on this cycle. More... | |
void | recvRetry () |
Handles doing the retry. More... | |
unsigned int | cacheLineSize () |
bool | trySendPacket (bool isLoad, PacketPtr data_pkt) |
Attempts to send a packet to the cache. More... | |
void | dumpInsts () const |
Debugging function to dump instructions in the LSQ. More... | |
void | schedule (Event &ev, Tick when) |
Schedule event for the cpu. More... | |
BaseTLB * | dTLB () |
bool | recvTimingResp (PacketPtr pkt) |
Handles writing back and completing the load or store that has returned from memory. More... | |
Fault | read (LSQRequest *req, int load_idx) |
Executes the load at the given index. More... | |
Fault | write (LSQRequest *req, uint8_t *data, int store_idx) |
Executes the store at the given index. More... | |
int | getLoadHead () |
Returns the index of the head load instruction. More... | |
InstSeqNum | getLoadHeadSeqNum () |
Returns the sequence number of the head load instruction. More... | |
int | getStoreHead () |
Returns the index of the head store instruction. More... | |
InstSeqNum | getStoreHeadSeqNum () |
Returns the sequence number of the head store instruction. More... | |
bool | isStalled () |
Returns whether or not the LSQ unit is stalled. More... | |
Public Attributes | |
CircularQueue< SQEntry > | storeQueue |
The store queue. More... | |
LoadQueue | loadQueue |
The load queue. More... | |
Static Public Attributes | |
static constexpr auto | MaxDataBytes = MaxVecRegLenInBytes |
Protected Attributes | |
LSQUnit::LSQUnitStats | stats |
Private Types | |
enum | AddrRangeCoverage { AddrRangeCoverage::PartialAddrRangeCoverage, AddrRangeCoverage::FullAddrRangeCoverage, AddrRangeCoverage::NoAddrRangeCoverage } |
Coverage of one address range with another. More... | |
using | LQEntry = LSQEntry |
Private Member Functions | |
void | resetState () |
Reset the LSQ state. More... | |
void | writeback (const DynInstPtr &inst, PacketPtr pkt) |
Writes back the instruction, sending it to IEW. More... | |
void | writebackBlockedStore () |
Try to finish a previously blocked write back attempt. More... | |
void | completeStore (typename StoreQueue::iterator store_idx) |
Completes the store at the specified index. More... | |
void | storePostSend () |
Handles completing the send of a store to memory. More... | |
Private Attributes | |
O3CPU * | cpu |
Pointer to the CPU. More... | |
IEW * | iewStage |
Pointer to the IEW stage. More... | |
LSQ * | lsq |
Pointer to the LSQ. More... | |
RequestPort * | dcachePort |
Pointer to the dcache port. More... | |
ThreadID | lsqID |
The LSQUnit thread id. More... | |
unsigned | depCheckShift |
The number of places to shift addresses in the LSQ before checking for dependency violations. More... | |
bool | checkLoads |
Should loads be checked for dependency issues. More... | |
int | loads |
The number of load instructions in the LQ. More... | |
int | stores |
The number of store instructions in the SQ. More... | |
int | storesToWB |
The number of store instructions in the SQ waiting to writeback. More... | |
int | htmStarts |
int | htmStops |
uint64_t | lastRetiredHtmUid |
StoreQueue::iterator | storeWBIt |
The index of the first instruction that may be ready to be written back, and has not yet been written back. More... | |
Addr | cacheBlockMask |
Address Mask for a cache block (e.g. More... | |
TimeBuffer< IssueStruct >::wire | fromIssue |
Wire to read information from the issue stage time queue. More... | |
bool | stalled |
Whether or not the LSQ is stalled. More... | |
InstSeqNum | stallingStoreIsn |
The store that causes the stall due to partial store to load forwarding. More... | |
int | stallingLoadIdx |
The index of the above store. More... | |
PacketPtr | retryPkt |
The packet that needs to be retried. More... | |
bool | isStoreBlocked |
Whehter or not a store is blocked due to the memory system. More... | |
bool | storeInFlight |
Whether or not a store is in flight. More... | |
DynInstPtr | memDepViolator |
The oldest load that caused a memory ordering violation. More... | |
bool | hasPendingRequest |
Whether or not there is a packet that couldn't be sent because of a lack of cache ports. More... | |
LSQRequest * | pendingRequest |
The packet that is pending free cache ports. More... | |
bool | needsTSO |
Flag for memory model. More... | |
Class that implements the actual LQ and SQ for each specific thread.
Both are circular queues; load entries are freed upon committing, while store entries are freed once they writeback. The LSQUnit tracks if there are memory ordering violations, and also detects partial load to store forwarding cases (a store only has part of a load's data) that requires the load to wait until the store writes back. In the former case it holds onto the instruction until the dependence unit looks at it, and in the latter it stalls the LSQ until the store writes back. At that point the load is replayed.
Definition at line 78 of file lsq_unit.hh.
typedef Impl::DynInstPtr LSQUnit< Impl >::DynInstPtr |
Definition at line 84 of file lsq_unit.hh.
Definition at line 85 of file lsq_unit.hh.
typedef Impl::CPUPol::IssueStruct LSQUnit< Impl >::IssueStruct |
Definition at line 87 of file lsq_unit.hh.
using LSQUnit< Impl >::LoadQueue = CircularQueue<LQEntry> |
Definition at line 218 of file lsq_unit.hh.
Definition at line 207 of file lsq_unit.hh.
typedef CircularQueue<LQEntry>::iterator LSQUnit< Impl >::LQIterator |
Definition at line 628 of file lsq_unit.hh.
typedef CircularQueue<LQEntry> LSQUnit< Impl >::LQueue |
Definition at line 630 of file lsq_unit.hh.
Definition at line 86 of file lsq_unit.hh.
using LSQUnit< Impl >::LSQRequest = typename Impl::CPUPol::LSQ::LSQRequest |
Definition at line 90 of file lsq_unit.hh.
using LSQUnit< Impl >::LSQSenderState = typename LSQ::LSQSenderState |
Definition at line 89 of file lsq_unit.hh.
Definition at line 83 of file lsq_unit.hh.
typedef CircularQueue<SQEntry>::iterator LSQUnit< Impl >::SQIterator |
Definition at line 629 of file lsq_unit.hh.
typedef CircularQueue<SQEntry> LSQUnit< Impl >::SQueue |
Definition at line 631 of file lsq_unit.hh.
using LSQUnit< Impl >::StoreQueue = CircularQueue<SQEntry> |
Definition at line 219 of file lsq_unit.hh.
|
strongprivate |
Coverage of one address range with another.
Enumerator | |
---|---|
PartialAddrRangeCoverage | |
FullAddrRangeCoverage | |
NoAddrRangeCoverage |
Definition at line 210 of file lsq_unit.hh.
Constructs an LSQ unit.
init() must be called prior to use.
Definition at line 204 of file lsq_unit_impl.hh.
We cannot copy LSQUnit because it has stats for which copy contructor is deleted explicitly.
However, STL vector requires a valid copy constructor for the base type at compile time.
Definition at line 229 of file lsq_unit.hh.
References panic.
unsigned int LSQUnit< Impl >::cacheLineSize |
Definition at line 1293 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::cpu.
Check if an incoming invalidate hits in the lsq on a load that might have issued out of order wrt another load beacuse of the intermediate invalidate.
Definition at line 447 of file lsq_unit_impl.hh.
References CircularQueue< T >::begin(), LSQUnit< Impl >::cacheBlockMask, LSQUnit< Impl >::cpu, DPRINTF, CircularQueue< T >::empty(), CircularQueue< T >::end(), Packet::getAddr(), ArmISA::handleLockedSnoop(), ArmISA::handleLockedSnoopHit(), Packet::isInvalidate(), Request::LLSC, LSQUnit< Impl >::loadQueue, LSQUnit< Impl >::needsTSO, and RiscvISA::x.
Fault LSQUnit< Impl >::checkViolations | ( | typename LoadQueue::iterator & | loadIt, |
const DynInstPtr & | inst | ||
) |
Check for ordering violations in the LSQ.
For a store squash if we ever find a conflicting load. For a load, only squash if we an external snoop invalidate has been seen for that load address
load_idx | index to start checking at |
inst | the instruction to check |
Definition at line 528 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::depCheckShift, DPRINTF, CircularQueue< T >::end(), LSQUnit< Impl >::loadQueue, LSQUnit< Impl >::memDepViolator, LSQUnit< Impl >::LSQUnitStats::memOrderViolation, NoFault, and LSQUnit< Impl >::stats.
Referenced by LSQUnit< Impl >::executeLoad(), and LSQUnit< Impl >::executeStore().
void LSQUnit< Impl >::commitLoad |
Commits the head load.
Definition at line 730 of file lsq_unit_impl.hh.
References DPRINTF, CircularQueue< T >::front(), LSQUnit< Impl >::loadQueue, LSQUnit< Impl >::loads, and CircularQueue< T >::pop_front().
Referenced by LSQUnit< Impl >::commitLoads().
void LSQUnit< Impl >::commitLoads | ( | InstSeqNum & | youngest_inst | ) |
Commits loads older than a specific sequence number.
Definition at line 745 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::commitLoad(), CircularQueue< T >::front(), LSQUnit< Impl >::loadQueue, and LSQUnit< Impl >::loads.
void LSQUnit< Impl >::commitStores | ( | InstSeqNum & | youngest_inst | ) |
Commits stores older than a specific sequence number.
Definition at line 757 of file lsq_unit_impl.hh.
References DPRINTF, LSQUnit< Impl >::storeQueue, LSQUnit< Impl >::stores, LSQUnit< Impl >::storesToWB, and RiscvISA::x.
Completes the data access that has been returned from the memory system.
Definition at line 111 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::completeStore(), LSQUnit< Impl >::cpu, DPRINTF, FAIL_OTHER, FAIL_REMOTE, FAIL_SELF, Packet::getAddr(), Packet::getHtmTransactionFailedInCacheRC(), Packet::getHtmTransactionUid(), htmFailureToStr(), Packet::htmTransactionFailedInCache(), INVALID, Packet::isHtmTransactional(), Packet::isWrite(), MEMORY, OTHER, panic, Packet::senderState, SIZE, ArmISA::ss, and LSQUnit< Impl >::writeback().
|
private |
Completes the store at the specified index.
Definition at line 1153 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::cpu, curTick(), DPRINTF, DTRACE, CircularQueue< T >::iterator::idx(), LSQUnit< Impl >::iewStage, LSQUnit< Impl >::isStalled(), LSQUnit< Impl >::loadQueue, LSQUnit< Impl >::needsTSO, LSQUnit< Impl >::stalled, LSQUnit< Impl >::stallingLoadIdx, LSQUnit< Impl >::stallingStoreIsn, LSQUnit< Impl >::storeInFlight, LSQUnit< Impl >::storeQueue, LSQUnit< Impl >::stores, and LSQUnit< Impl >::storesToWB.
Referenced by LSQUnit< Impl >::completeDataAccess(), and LSQUnit< Impl >::writebackStores().
void LSQUnit< Impl >::drainSanityCheck |
Perform sanity checks after a drain.
Definition at line 295 of file lsq_unit_impl.hh.
References CircularQueue< T >::capacity(), ArmISA::i, LSQUnit< Impl >::loadQueue, LSQUnit< Impl >::retryPkt, and LSQUnit< Impl >::storesToWB.
Definition at line 404 of file lsq_unit.hh.
References LSQUnit< Impl >::cpu.
void LSQUnit< Impl >::dumpInsts |
Debugging function to dump instructions in the LSQ.
Definition at line 1268 of file lsq_unit_impl.hh.
References cprintf(), ArmISA::e, LSQUnit< Impl >::loadQueue, LSQUnit< Impl >::loads, LSQUnit< Impl >::storeQueue, and LSQUnit< Impl >::stores.
Fault LSQUnit< Impl >::executeLoad | ( | const DynInstPtr & | inst | ) |
Executes a load instruction.
Definition at line 609 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::checkLoads, LSQUnit< Impl >::checkViolations(), DPRINTF, LSQUnit< Impl >::iewStage, and NoFault.
Definition at line 275 of file lsq_unit.hh.
Fault LSQUnit< Impl >::executeStore | ( | const DynInstPtr & | inst | ) |
Executes a store instruction.
Definition at line 677 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::checkViolations(), DPRINTF, NoFault, LSQUnit< Impl >::storeQueue, LSQUnit< Impl >::stores, and LSQUnit< Impl >::storesToWB.
|
inline |
Returns the number of instructions in the LSQ.
Definition at line 351 of file lsq_unit.hh.
References LSQUnit< Impl >::loads, and LSQUnit< Impl >::stores.
|
inline |
Definition at line 321 of file lsq_unit.hh.
References LSQUnit< Impl >::cpu, and LSQUnit< Impl >::lsqID.
|
inline |
Returns the index of the head load instruction.
Definition at line 603 of file lsq_unit.hh.
References CircularQueue< T >::head(), and LSQUnit< Impl >::loadQueue.
|
inline |
Returns the sequence number of the head load instruction.
Definition at line 607 of file lsq_unit.hh.
References CircularQueue< T >::front(), and LSQUnit< Impl >::loadQueue.
Impl::DynInstPtr LSQUnit< Impl >::getMemDepViolator |
Returns the memory ordering violator.
Definition at line 413 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::memDepViolator.
|
inline |
Returns the index of the head store instruction.
Definition at line 615 of file lsq_unit.hh.
References LSQUnit< Impl >::storeQueue.
|
inline |
Returns the sequence number of the head store instruction.
Definition at line 618 of file lsq_unit.hh.
References LSQUnit< Impl >::storeQueue.
|
inline |
Returns if there are any stores to writeback.
Definition at line 354 of file lsq_unit.hh.
References LSQUnit< Impl >::storesToWB.
void LSQUnit< Impl >::init | ( | O3CPU * | cpu_ptr, |
IEW * | iew_ptr, | ||
DerivO3CPUParams * | params, | ||
LSQ * | lsq_ptr, | ||
unsigned | id | ||
) |
Initializes the LSQ unit with the specified number of entries.
Definition at line 217 of file lsq_unit_impl.hh.
References csprintf(), DPRINTF, and ArmISA::id.
void LSQUnit< Impl >::insert | ( | const DynInstPtr & | inst | ) |
Inserts an instruction.
Definition at line 313 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::insertLoad(), and LSQUnit< Impl >::insertStore().
void LSQUnit< Impl >::insertLoad | ( | const DynInstPtr & | load_inst | ) |
Inserts a load instruction.
Definition at line 330 of file lsq_unit_impl.hh.
References CircularQueue< T >::advance_tail(), CircularQueue< T >::back(), CircularQueue< T >::capacity(), LSQUnit< Impl >::cpu, DPRINTF, CircularQueue< T >::full(), CircularQueue< T >::getIterator(), LSQUnit< Impl >::htmStarts, LSQUnit< Impl >::htmStops, LSQUnit< Impl >::loadQueue, LSQUnit< Impl >::loads, LSQUnit< Impl >::lsqID, LSQUnit< Impl >::storeQueue, and CircularQueue< T >::tail().
Referenced by LSQUnit< Impl >::insert().
void LSQUnit< Impl >::insertStore | ( | const DynInstPtr & | store_inst | ) |
Inserts a store instruction.
Definition at line 392 of file lsq_unit_impl.hh.
References DPRINTF, CircularQueue< T >::end(), LSQUnit< Impl >::loadQueue, CircularQueue< T >::moduloAdd(), LSQUnit< Impl >::storeQueue, LSQUnit< Impl >::stores, and CircularQueue< T >::tail().
Referenced by LSQUnit< Impl >::insert().
|
inline |
Returns if both the LQ and SQ are empty.
Definition at line 336 of file lsq_unit.hh.
References LSQUnit< Impl >::lqEmpty(), and LSQUnit< Impl >::sqEmpty().
|
inline |
Returns if either the LQ or SQ is full.
Definition at line 333 of file lsq_unit.hh.
References LSQUnit< Impl >::lqFull(), and LSQUnit< Impl >::sqFull().
|
inline |
Returns whether or not the LSQ unit is stalled.
Definition at line 626 of file lsq_unit.hh.
References LSQUnit< Impl >::stalled.
Referenced by LSQUnit< Impl >::completeStore(), LSQUnit< Impl >::squash(), and LSQUnit< Impl >::storePostSend().
|
inline |
Returns if the LQ is empty.
Definition at line 345 of file lsq_unit.hh.
References LSQUnit< Impl >::loads.
Referenced by LSQUnit< Impl >::isEmpty().
|
inline |
Returns if the LQ is full.
Definition at line 339 of file lsq_unit.hh.
References CircularQueue< T >::full(), and LSQUnit< Impl >::loadQueue.
Referenced by LSQUnit< Impl >::isFull().
std::string LSQUnit< Impl >::name |
Returns the name of the LSQ unit.
Definition at line 261 of file lsq_unit_impl.hh.
References sc_dt::to_string().
unsigned LSQUnit< Impl >::numFreeLoadEntries |
Returns the number of free LQ entries.
Definition at line 424 of file lsq_unit_impl.hh.
References CircularQueue< T >::capacity(), DPRINTF, LSQUnit< Impl >::loadQueue, and LSQUnit< Impl >::loads.
unsigned LSQUnit< Impl >::numFreeStoreEntries |
Returns the number of free SQ entries.
Definition at line 435 of file lsq_unit_impl.hh.
References DPRINTF, LSQUnit< Impl >::storeQueue, and LSQUnit< Impl >::stores.
|
inline |
Definition at line 318 of file lsq_unit.hh.
References LSQUnit< Impl >::htmStarts.
|
inline |
Definition at line 319 of file lsq_unit.hh.
References LSQUnit< Impl >::htmStops.
|
inline |
Returns the number of loads in the LQ.
Definition at line 312 of file lsq_unit.hh.
References LSQUnit< Impl >::loads.
|
inline |
Returns the number of stores in the SQ.
Definition at line 315 of file lsq_unit.hh.
References LSQUnit< Impl >::stores.
|
inline |
Returns the number of stores to writeback.
Definition at line 357 of file lsq_unit.hh.
References LSQUnit< Impl >::storesToWB.
Fault LSQUnit< Impl >::read | ( | LSQRequest * | req, |
int | load_idx | ||
) |
Executes the load at the given index.
Definition at line 636 of file lsq_unit.hh.
References curTick(), Packet::dataStatic(), DPRINTF, Packet::getAddr(), ArmISA::handleLockedRead(), LSQUnit< Impl >::LSQEntry::instruction(), Packet::makeResponse(), Request::NO_ACCESS, NoFault, panic, MemCmd::ReadReq, Packet::req, Packet::setHtmTransactional(), and LSQUnit< Impl >::LSQEntry::setRequest().
void LSQUnit< Impl >::recvRetry |
Handles doing the retry.
Definition at line 1258 of file lsq_unit_impl.hh.
References DPRINTF, LSQUnit< Impl >::isStoreBlocked, and LSQUnit< Impl >::writebackBlockedStore().
Handles writing back and completing the load or store that has returned from memory.
pkt | Response packet from the memory sub-system |
Definition at line 93 of file lsq_unit_impl.hh.
References Packet::senderState.
|
inline |
Definition at line 320 of file lsq_unit.hh.
References LSQUnit< Impl >::htmStarts, and LSQUnit< Impl >::htmStops.
|
private |
Reset the LSQ state.
Definition at line 241 of file lsq_unit_impl.hh.
Referenced by LSQUnit< Impl >::takeOverFrom().
Schedule event for the cpu.
Definition at line 402 of file lsq_unit.hh.
References LSQUnit< Impl >::cpu.
void LSQUnit< Impl >::setDcachePort | ( | RequestPort * | dcache_port | ) |
Sets the pointer to the dcache port.
Definition at line 288 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::dcachePort.
|
inline |
Definition at line 326 of file lsq_unit.hh.
References LSQUnit< Impl >::lastRetiredHtmUid.
|
inline |
Returns if the SQ is empty.
Definition at line 348 of file lsq_unit.hh.
References LSQUnit< Impl >::stores.
Referenced by LSQUnit< Impl >::isEmpty().
|
inline |
Returns if the SQ is full.
Definition at line 342 of file lsq_unit.hh.
References LSQUnit< Impl >::storeQueue.
Referenced by LSQUnit< Impl >::isFull().
void LSQUnit< Impl >::squash | ( | const InstSeqNum & | squashed_num | ) |
Squashes all instructions younger than a specific sequence number.
Definition at line 941 of file lsq_unit_impl.hh.
References CircularQueue< T >::back(), CircularQueue< T >::begin(), LSQUnit< Impl >::cpu, DPRINTF, CircularQueue< T >::end(), LSQUnit< Impl >::htmStarts, LSQUnit< Impl >::htmStops, LSQUnit< Impl >::isStalled(), LSQUnit< Impl >::lastRetiredHtmUid, LSQUnit< Impl >::loadQueue, LSQUnit< Impl >::loads, LSQUnit< Impl >::lsqID, LSQUnit< Impl >::memDepViolator, panic, CircularQueue< T >::pop_back(), LSQUnit< Impl >::LSQUnitStats::squashedLoads, LSQUnit< Impl >::LSQUnitStats::squashedStores, LSQUnit< Impl >::stalled, LSQUnit< Impl >::stallingLoadIdx, LSQUnit< Impl >::stallingStoreIsn, LSQUnit< Impl >::stats, LSQUnit< Impl >::storeQueue, LSQUnit< Impl >::stores, and CircularQueue< T >::tail().
|
private |
Handles completing the send of a store to memory.
Definition at line 1059 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::cpu, DPRINTF, LSQUnit< Impl >::iewStage, LSQUnit< Impl >::isStalled(), LSQUnit< Impl >::loadQueue, LSQUnit< Impl >::needsTSO, LSQUnit< Impl >::stalled, LSQUnit< Impl >::stallingLoadIdx, LSQUnit< Impl >::stallingStoreIsn, LSQUnit< Impl >::storeInFlight, and LSQUnit< Impl >::storeWBIt.
Referenced by LSQUnit< Impl >::writebackBlockedStore(), and LSQUnit< Impl >::writebackStores().
void LSQUnit< Impl >::takeOverFrom |
Takes over from another CPU's thread.
Definition at line 306 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::resetState().
Attempts to send a packet to the cache.
Check if there are ports available. Return true if there are, false if there are not.
Definition at line 1218 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::LSQUnitStats::blockedByCache, LSQ< Impl >::cacheBlocked(), LSQ< Impl >::cachePortAvailable(), LSQ< Impl >::cachePortBusy(), LSQUnit< Impl >::dcachePort, LSQUnit< Impl >::isStoreBlocked, LSQUnit< Impl >::lsq, Packet::senderState, RequestPort::sendTimingReq(), LSQUnit< Impl >::stats, and LSQUnit< Impl >::storeWBIt.
|
inline |
Returns if there is a memory ordering violation.
Value is reset upon call to getMemDepViolator().
Definition at line 300 of file lsq_unit.hh.
References LSQUnit< Impl >::memDepViolator.
|
inline |
Returns if the LSQ unit will writeback on this cycle.
Definition at line 361 of file lsq_unit.hh.
References CircularQueue< T >::iterator::dereferenceable(), LSQUnit< Impl >::isStoreBlocked, and LSQUnit< Impl >::storeWBIt.
Fault LSQUnit< Impl >::write | ( | LSQRequest * | req, |
uint8_t * | data, | ||
int | store_idx | ||
) |
Executes the store at the given index.
Definition at line 959 of file lsq_unit.hh.
References Request::CACHE_BLOCK_ZERO, data, DPRINTF, NoFault, and Request::STORE_NO_DATA.
|
private |
Writes back the instruction, sending it to IEW.
Definition at line 1091 of file lsq_unit_impl.hh.
References DPRINTF, htmFailureToStr(), Packet::htmTransactionFailedInCache(), LSQUnit< Impl >::iewStage, LSQUnit< Impl >::LSQUnitStats::ignoredResponses, NoFault, and LSQUnit< Impl >::stats.
Referenced by LSQUnit< Impl >::completeDataAccess().
|
private |
Try to finish a previously blocked write back attempt.
Definition at line 784 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::isStoreBlocked, LSQUnit< Impl >::storePostSend(), and LSQUnit< Impl >::storeWBIt.
Referenced by LSQUnit< Impl >::recvRetry(), and LSQUnit< Impl >::writebackStores().
void LSQUnit< Impl >::writebackStores |
Writes back stores.
Definition at line 795 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::cacheBlockMask, LSQ< Impl >::cachePortAvailable(), LSQUnit< Impl >::completeStore(), LSQUnit< Impl >::cpu, curTick(), Packet::dataStatic(), CircularQueue< T >::iterator::dereferenceable(), DPRINTF, ArmISA::handleLockedWrite(), CircularQueue< T >::iterator::idx(), LSQUnit< Impl >::isStoreBlocked, LSQUnit< Impl >::lsq, LSQUnit< Impl >::lsqID, LSQUnit< Impl >::needsTSO, LSQUnit< Impl >::storeInFlight, LSQUnit< Impl >::storePostSend(), LSQUnit< Impl >::storeQueue, LSQUnit< Impl >::stores, LSQUnit< Impl >::storesToWB, LSQUnit< Impl >::storeWBIt, LSQUnit< Impl >::writebackBlockedStore(), and MemCmd::WriteReq.
Address Mask for a cache block (e.g.
~(cache_block_size-1))
Definition at line 529 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::checkSnoop(), and LSQUnit< Impl >::writebackStores().
|
private |
Should loads be checked for dependency issues.
Definition at line 507 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::executeLoad().
Pointer to the CPU.
Definition at line 408 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::cacheLineSize(), LSQUnit< Impl >::checkSnoop(), LSQUnit< Impl >::completeDataAccess(), LSQUnit< Impl >::completeStore(), LSQUnit< Impl >::dTLB(), LSQUnit< Impl >::getLatestHtmUid(), LSQUnit< Impl >::insertLoad(), LSQUnit< Impl >::schedule(), LSQUnit< Impl >::squash(), LSQUnit< Impl >::storePostSend(), and LSQUnit< Impl >::writebackStores().
|
private |
Pointer to the dcache port.
Used only for sending.
Definition at line 417 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::setDcachePort(), and LSQUnit< Impl >::trySendPacket().
|
private |
The number of places to shift addresses in the LSQ before checking for dependency violations.
Definition at line 504 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::checkViolations().
|
private |
Wire to read information from the issue stage time queue.
Definition at line 532 of file lsq_unit.hh.
|
private |
Whether or not there is a packet that couldn't be sent because of a lack of cache ports.
Definition at line 557 of file lsq_unit.hh.
|
private |
Definition at line 518 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::insertLoad(), LSQUnit< Impl >::numHtmStarts(), LSQUnit< Impl >::resetHtmStartsStops(), and LSQUnit< Impl >::squash().
|
private |
Definition at line 519 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::insertLoad(), LSQUnit< Impl >::numHtmStops(), LSQUnit< Impl >::resetHtmStartsStops(), and LSQUnit< Impl >::squash().
Pointer to the IEW stage.
Definition at line 411 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::completeStore(), LSQUnit< Impl >::executeLoad(), LSQUnit< Impl >::storePostSend(), and LSQUnit< Impl >::writeback().
|
private |
Whehter or not a store is blocked due to the memory system.
Definition at line 547 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::recvRetry(), LSQUnit< Impl >::trySendPacket(), LSQUnit< Impl >::willWB(), LSQUnit< Impl >::writebackBlockedStore(), and LSQUnit< Impl >::writebackStores().
|
private |
Definition at line 521 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::setLastRetiredHtmUid(), and LSQUnit< Impl >::squash().
The load queue.
Definition at line 498 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::checkSnoop(), LSQUnit< Impl >::checkViolations(), LSQUnit< Impl >::commitLoad(), LSQUnit< Impl >::commitLoads(), LSQUnit< Impl >::completeStore(), LSQUnit< Impl >::drainSanityCheck(), LSQUnit< Impl >::dumpInsts(), LSQUnit< Impl >::getLoadHead(), LSQUnit< Impl >::getLoadHeadSeqNum(), LSQUnit< Impl >::insertLoad(), LSQUnit< Impl >::insertStore(), LSQ< Impl >::LSQRequest::install(), LSQUnit< Impl >::lqFull(), LSQUnit< Impl >::numFreeLoadEntries(), LSQUnit< Impl >::squash(), and LSQUnit< Impl >::storePostSend().
|
private |
The number of load instructions in the LQ.
Definition at line 510 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::commitLoad(), LSQUnit< Impl >::commitLoads(), LSQUnit< Impl >::dumpInsts(), LSQUnit< Impl >::getCount(), LSQUnit< Impl >::insertLoad(), LSQUnit< Impl >::lqEmpty(), LSQUnit< Impl >::numFreeLoadEntries(), LSQUnit< Impl >::numLoads(), and LSQUnit< Impl >::squash().
Pointer to the LSQ.
Definition at line 414 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::trySendPacket(), and LSQUnit< Impl >::writebackStores().
The LSQUnit thread id.
Definition at line 492 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::getLatestHtmUid(), LSQUnit< Impl >::insertLoad(), LSQUnit< Impl >::squash(), and LSQUnit< Impl >::writebackStores().
|
staticconstexpr |
Definition at line 81 of file lsq_unit.hh.
|
private |
The oldest load that caused a memory ordering violation.
Definition at line 553 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::checkViolations(), LSQUnit< Impl >::getMemDepViolator(), LSQUnit< Impl >::squash(), and LSQUnit< Impl >::violation().
|
private |
Flag for memory model.
Definition at line 563 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::checkSnoop(), LSQUnit< Impl >::completeStore(), LSQUnit< Impl >::storePostSend(), and LSQUnit< Impl >::writebackStores().
|
private |
The packet that is pending free cache ports.
Definition at line 560 of file lsq_unit.hh.
The packet that needs to be retried.
Definition at line 544 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::drainSanityCheck().
|
private |
Whether or not the LSQ is stalled.
Definition at line 535 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::completeStore(), LSQUnit< Impl >::isStalled(), LSQUnit< Impl >::squash(), and LSQUnit< Impl >::storePostSend().
|
private |
The index of the above store.
Definition at line 541 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::completeStore(), LSQUnit< Impl >::squash(), and LSQUnit< Impl >::storePostSend().
|
private |
The store that causes the stall due to partial store to load forwarding.
Definition at line 539 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::completeStore(), LSQUnit< Impl >::squash(), and LSQUnit< Impl >::storePostSend().
|
protected |
|
private |
Whether or not a store is in flight.
Definition at line 550 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::completeStore(), LSQUnit< Impl >::storePostSend(), and LSQUnit< Impl >::writebackStores().
CircularQueue<SQEntry> LSQUnit< Impl >::storeQueue |
The store queue.
Definition at line 495 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::commitStores(), LSQUnit< Impl >::completeStore(), LSQUnit< Impl >::dumpInsts(), LSQUnit< Impl >::executeStore(), LSQUnit< Impl >::getStoreHead(), LSQUnit< Impl >::getStoreHeadSeqNum(), LSQUnit< Impl >::insertLoad(), LSQUnit< Impl >::insertStore(), LSQ< Impl >::LSQRequest::install(), LSQUnit< Impl >::numFreeStoreEntries(), LSQUnit< Impl >::sqFull(), LSQUnit< Impl >::squash(), and LSQUnit< Impl >::writebackStores().
|
private |
The number of store instructions in the SQ.
Definition at line 512 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::commitStores(), LSQUnit< Impl >::completeStore(), LSQUnit< Impl >::dumpInsts(), LSQUnit< Impl >::executeStore(), LSQUnit< Impl >::getCount(), LSQUnit< Impl >::insertStore(), LSQUnit< Impl >::numFreeStoreEntries(), LSQUnit< Impl >::numStores(), LSQUnit< Impl >::sqEmpty(), LSQUnit< Impl >::squash(), and LSQUnit< Impl >::writebackStores().
|
private |
The number of store instructions in the SQ waiting to writeback.
Definition at line 514 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::commitStores(), LSQUnit< Impl >::completeStore(), LSQUnit< Impl >::drainSanityCheck(), LSQUnit< Impl >::executeStore(), LSQUnit< Impl >::hasStoresToWB(), LSQUnit< Impl >::numStoresToWB(), and LSQUnit< Impl >::writebackStores().
|
private |
The index of the first instruction that may be ready to be written back, and has not yet been written back.
Definition at line 526 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::storePostSend(), LSQUnit< Impl >::trySendPacket(), LSQUnit< Impl >::willWB(), LSQUnit< Impl >::writebackBlockedStore(), and LSQUnit< Impl >::writebackStores().