gem5
v20.0.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 |
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 | regStats () |
Registers statistics. More... | |
void | setDcachePort (MasterPort *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... | |
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 |
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... | |
MasterPort * | 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... | |
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... | |
Stats::Scalar | lsqForwLoads |
Total number of loads forwaded from LSQ stores. More... | |
Stats::Scalar | invAddrLoads |
Total number of loads ignored due to invalid addresses. More... | |
Stats::Scalar | lsqSquashedLoads |
Total number of squashed loads. More... | |
Stats::Scalar | lsqIgnoredResponses |
Total number of responses from the memory system that are ignored due to the instruction already being squashed. More... | |
Stats::Scalar | lsqMemOrderViolation |
Tota number of memory ordering violations. More... | |
Stats::Scalar | lsqSquashedStores |
Total number of squashed stores. More... | |
Stats::Scalar | invAddrSwpfs |
Total number of software prefetches ignored due to invalid addresses. More... | |
Stats::Scalar | lsqBlockedLoads |
Ready loads blocked due to partial store-forwarding. More... | |
Stats::Scalar | lsqRescheduledLoads |
Number of loads that were rescheduled. More... | |
Stats::Scalar | lsqCacheBlocked |
Number of times the LSQ is blocked due to the cache. 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 77 of file lsq_unit.hh.
typedef Impl::DynInstPtr LSQUnit< Impl >::DynInstPtr |
Definition at line 83 of file lsq_unit.hh.
Definition at line 84 of file lsq_unit.hh.
typedef Impl::CPUPol::IssueStruct LSQUnit< Impl >::IssueStruct |
Definition at line 86 of file lsq_unit.hh.
using LSQUnit< Impl >::LoadQueue = CircularQueue<LQEntry> |
Definition at line 217 of file lsq_unit.hh.
Definition at line 206 of file lsq_unit.hh.
typedef CircularQueue<LQEntry>::iterator LSQUnit< Impl >::LQIterator |
Definition at line 609 of file lsq_unit.hh.
typedef CircularQueue<LQEntry> LSQUnit< Impl >::LQueue |
Definition at line 611 of file lsq_unit.hh.
Definition at line 85 of file lsq_unit.hh.
using LSQUnit< Impl >::LSQRequest = typename Impl::CPUPol::LSQ::LSQRequest |
Definition at line 89 of file lsq_unit.hh.
using LSQUnit< Impl >::LSQSenderState = typename LSQ::LSQSenderState |
Definition at line 88 of file lsq_unit.hh.
Definition at line 82 of file lsq_unit.hh.
typedef CircularQueue<SQEntry>::iterator LSQUnit< Impl >::SQIterator |
Definition at line 610 of file lsq_unit.hh.
typedef CircularQueue<SQEntry> LSQUnit< Impl >::SQueue |
Definition at line 612 of file lsq_unit.hh.
using LSQUnit< Impl >::StoreQueue = CircularQueue<SQEntry> |
Definition at line 218 of file lsq_unit.hh.
|
strongprivate |
Coverage of one address range with another.
Enumerator | |
---|---|
PartialAddrRangeCoverage | |
FullAddrRangeCoverage | |
NoAddrRangeCoverage |
Definition at line 209 of file lsq_unit.hh.
Constructs an LSQ unit.
init() must be called prior to use.
Definition at line 143 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 228 of file lsq_unit.hh.
References LSQUnit< Impl >::checkSnoop(), LSQUnit< Impl >::checkViolations(), LSQUnit< Impl >::drainSanityCheck(), LSQUnit< Impl >::executeLoad(), LSQUnit< Impl >::init(), LSQUnit< Impl >::insert(), LSQUnit< Impl >::insertLoad(), LSQUnit< Impl >::insertStore(), LSQUnit< Impl >::LSQEntry::inst, LSQUnit< Impl >::name(), panic, LSQUnit< Impl >::regStats(), LSQUnit< Impl >::setDcachePort(), and LSQUnit< Impl >::takeOverFrom().
unsigned int LSQUnit< Impl >::cacheLineSize | ( | ) |
Definition at line 1130 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::cpu.
Referenced by LSQUnit< Impl >::willWB().
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 368 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(), TheISA::handleLockedSnoop(), TheISA::handleLockedSnoopHit(), Packet::isInvalidate(), Request::LLSC, LSQUnit< Impl >::loadQueue, LSQUnit< Impl >::needsTSO, and RiscvISA::x.
Referenced by LSQUnit< Impl >::LSQUnit().
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 449 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::depCheckShift, DPRINTF, CircularQueue< T >::end(), LSQUnit< Impl >::loadQueue, LSQUnit< Impl >::lsqMemOrderViolation, LSQUnit< Impl >::memDepViolator, and NoFault.
Referenced by LSQUnit< Impl >::executeLoad(), LSQUnit< Impl >::executeStore(), and LSQUnit< Impl >::LSQUnit().
void LSQUnit< Impl >::commitLoad | ( | ) |
Commits the head load.
Definition at line 651 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(), and LSQUnit< Impl >::executeLoad().
void LSQUnit< Impl >::commitLoads | ( | InstSeqNum & | youngest_inst | ) |
Commits loads older than a specific sequence number.
Definition at line 666 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::commitLoad(), CircularQueue< T >::front(), LSQUnit< Impl >::loadQueue, and LSQUnit< Impl >::loads.
Referenced by LSQUnit< Impl >::executeLoad().
void LSQUnit< Impl >::commitStores | ( | InstSeqNum & | youngest_inst | ) |
Commits stores older than a specific sequence number.
Definition at line 678 of file lsq_unit_impl.hh.
References DPRINTF, LSQUnit< Impl >::storeQueue, LSQUnit< Impl >::stores, LSQUnit< Impl >::storesToWB, and RiscvISA::x.
Referenced by LSQUnit< Impl >::executeLoad().
Completes the data access that has been returned from the memory system.
Definition at line 110 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::completeStore(), LSQUnit< Impl >::cpu, LSQUnit< Impl >::WritebackEvent::inst, Packet::senderState, ArmISA::ss, and LSQUnit< Impl >::writeback().
Referenced by LSQUnit< Impl >::executeLoad().
|
private |
Completes the store at the specified index.
Definition at line 990 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(), LSQUnit< Impl >::willWB(), and LSQUnit< Impl >::writebackStores().
void LSQUnit< Impl >::drainSanityCheck | ( | ) | const |
Perform sanity checks after a drain.
Definition at line 255 of file lsq_unit_impl.hh.
References CircularQueue< T >::capacity(), ArmISA::i, LSQUnit< Impl >::loadQueue, LSQUnit< Impl >::retryPkt, and LSQUnit< Impl >::storesToWB.
Referenced by LSQUnit< Impl >::LSQUnit().
Definition at line 388 of file lsq_unit.hh.
References LSQUnit< Impl >::cpu.
void LSQUnit< Impl >::dumpInsts | ( | ) | const |
Debugging function to dump instructions in the LSQ.
Definition at line 1105 of file lsq_unit_impl.hh.
References cprintf(), ArmISA::e, LSQUnit< Impl >::loadQueue, LSQUnit< Impl >::loads, LSQUnit< Impl >::storeQueue, and LSQUnit< Impl >::stores.
Referenced by LSQUnit< Impl >::willWB().
Fault LSQUnit< Impl >::executeLoad | ( | const DynInstPtr & | inst | ) |
Executes a load instruction.
Definition at line 530 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::checkLoads, LSQUnit< Impl >::checkViolations(), DPRINTF, LSQUnit< Impl >::iewStage, and NoFault.
Referenced by LSQUnit< Impl >::LSQUnit().
Definition at line 274 of file lsq_unit.hh.
References LSQUnit< Impl >::commitLoad(), LSQUnit< Impl >::commitLoads(), LSQUnit< Impl >::commitStores(), LSQUnit< Impl >::completeDataAccess(), LSQUnit< Impl >::executeStore(), NoFault, panic, LSQUnit< Impl >::squash(), and LSQUnit< Impl >::writebackStores().
Fault LSQUnit< Impl >::executeStore | ( | const DynInstPtr & | inst | ) |
Executes a store instruction.
Definition at line 598 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::checkViolations(), DPRINTF, NoFault, LSQUnit< Impl >::storeQueue, LSQUnit< Impl >::stores, and LSQUnit< Impl >::storesToWB.
Referenced by LSQUnit< Impl >::executeLoad().
|
inline |
Returns the number of instructions in the LSQ.
Definition at line 335 of file lsq_unit.hh.
References LSQUnit< Impl >::loads, and LSQUnit< Impl >::stores.
|
inline |
Returns the index of the head load instruction.
Definition at line 584 of file lsq_unit.hh.
References CircularQueue< T >::head().
|
inline |
Returns the sequence number of the head load instruction.
Definition at line 588 of file lsq_unit.hh.
References CircularQueue< T >::front().
Impl::DynInstPtr LSQUnit< Impl >::getMemDepViolator | ( | ) |
Returns the memory ordering violator.
Definition at line 334 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::memDepViolator.
Referenced by LSQUnit< Impl >::violation().
|
inline |
Returns the index of the head store instruction.
Definition at line 596 of file lsq_unit.hh.
References CircularQueue< T >::head().
|
inline |
Returns the sequence number of the head store instruction.
Definition at line 599 of file lsq_unit.hh.
References CircularQueue< T >::front().
|
inline |
Returns if there are any stores to writeback.
Definition at line 338 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 153 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::checkLoads, LSQUnit< Impl >::cpu, LSQUnit< Impl >::depCheckShift, DPRINTF, ArmISA::id, LSQUnit< Impl >::iewStage, LSQUnit< Impl >::lsq, LSQUnit< Impl >::lsqID, LSQUnit< Impl >::needsTSO, and LSQUnit< Impl >::resetState().
Referenced by LSQUnit< Impl >::LSQUnit().
void LSQUnit< Impl >::insert | ( | const DynInstPtr & | inst | ) |
Inserts an instruction.
Definition at line 273 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::insertLoad(), and LSQUnit< Impl >::insertStore().
Referenced by LSQUnit< Impl >::LSQUnit().
void LSQUnit< Impl >::insertLoad | ( | const DynInstPtr & | load_inst | ) |
Inserts a load instruction.
Definition at line 290 of file lsq_unit_impl.hh.
References CircularQueue< T >::advance_tail(), CircularQueue< T >::back(), CircularQueue< T >::capacity(), DPRINTF, CircularQueue< T >::full(), CircularQueue< T >::getIterator(), LSQUnit< Impl >::loadQueue, LSQUnit< Impl >::loads, LSQUnit< Impl >::storeQueue, and CircularQueue< T >::tail().
Referenced by LSQUnit< Impl >::insert(), and LSQUnit< Impl >::LSQUnit().
void LSQUnit< Impl >::insertStore | ( | const DynInstPtr & | store_inst | ) |
Inserts a store instruction.
Definition at line 313 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(), and LSQUnit< Impl >::LSQUnit().
|
inline |
Returns if both the LQ and SQ are empty.
Definition at line 320 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 317 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 607 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 329 of file lsq_unit.hh.
References LSQUnit< Impl >::loads.
Referenced by LSQUnit< Impl >::isEmpty().
|
inline |
Returns if the LQ is full.
Definition at line 323 of file lsq_unit.hh.
References CircularQueue< T >::full(), and LSQUnit< Impl >::loadQueue.
Referenced by LSQUnit< Impl >::isFull().
std::string LSQUnit< Impl >::name | ( | ) | const |
Returns the name of the LSQ unit.
Definition at line 192 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::iewStage, LSQUnit< Impl >::lsqID, and sc_dt::to_string().
Referenced by LSQUnit< Impl >::LSQUnit(), and LSQUnit< Impl >::regStats().
unsigned LSQUnit< Impl >::numFreeLoadEntries | ( | ) |
Returns the number of free LQ entries.
Definition at line 345 of file lsq_unit_impl.hh.
References CircularQueue< T >::capacity(), DPRINTF, LSQUnit< Impl >::loadQueue, and LSQUnit< Impl >::loads.
Referenced by LSQUnit< Impl >::violation().
unsigned LSQUnit< Impl >::numFreeStoreEntries | ( | ) |
Returns the number of free SQ entries.
Definition at line 356 of file lsq_unit_impl.hh.
References DPRINTF, LSQUnit< Impl >::storeQueue, and LSQUnit< Impl >::stores.
Referenced by LSQUnit< Impl >::violation().
|
inline |
Returns the number of loads in the LQ.
Definition at line 311 of file lsq_unit.hh.
References LSQUnit< Impl >::loads.
|
inline |
Returns the number of stores in the SQ.
Definition at line 314 of file lsq_unit.hh.
References LSQUnit< Impl >::stores.
|
inline |
Returns the number of stores to writeback.
Definition at line 341 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 617 of file lsq_unit.hh.
References LSQUnit< Impl >::cpu, curTick(), Packet::dataStatic(), DPRINTF, LSQUnit< Impl >::FullAddrRangeCoverage, CircularQueue< T >::getIterator(), TheISA::handleLockedRead(), CircularQueue< T >::head(), LSQUnit< Impl >::iewStage, LSQUnit< Impl >::LSQEntry::instruction(), LSQUnit< Impl >::loadQueue, LSQUnit< Impl >::lsqForwLoads, LSQUnit< Impl >::lsqID, LSQUnit< Impl >::lsqRescheduledLoads, LSQUnit< Impl >::MaxDataBytes, LSQUnit< Impl >::NoAddrRangeCoverage, NoFault, panic, LSQUnit< Impl >::PartialAddrRangeCoverage, MemCmd::ReadReq, LSQUnit< Impl >::LSQEntry::setRequest(), LSQUnit< Impl >::stalled, LSQUnit< Impl >::stallingLoadIdx, LSQUnit< Impl >::stallingStoreIsn, LSQUnit< Impl >::storeQueue, and LSQUnit< Impl >::storeWBIt.
void LSQUnit< Impl >::recvRetry | ( | ) |
Handles doing the retry.
Definition at line 1095 of file lsq_unit_impl.hh.
References DPRINTF, LSQUnit< Impl >::isStoreBlocked, and LSQUnit< Impl >::writebackBlockedStore().
Referenced by LSQUnit< Impl >::willWB().
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 92 of file lsq_unit_impl.hh.
References Packet::senderState.
void LSQUnit< Impl >::regStats | ( | ) |
Registers statistics.
Definition at line 203 of file lsq_unit_impl.hh.
References Stats::DataWrap< Derived, InfoProxyType >::desc(), LSQUnit< Impl >::invAddrLoads, LSQUnit< Impl >::invAddrSwpfs, LSQUnit< Impl >::lsqBlockedLoads, LSQUnit< Impl >::lsqCacheBlocked, LSQUnit< Impl >::lsqForwLoads, LSQUnit< Impl >::lsqIgnoredResponses, LSQUnit< Impl >::lsqMemOrderViolation, LSQUnit< Impl >::lsqRescheduledLoads, LSQUnit< Impl >::lsqSquashedLoads, LSQUnit< Impl >::lsqSquashedStores, LSQUnit< Impl >::name(), and Stats::DataWrap< Derived, InfoProxyType >::name().
Referenced by LSQUnit< Impl >::LSQUnit().
|
private |
Reset the LSQ state.
Definition at line 175 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::cacheBlockMask, LSQUnit< Impl >::cpu, LSQUnit< Impl >::loads, LSQUnit< Impl >::memDepViolator, LSQUnit< Impl >::retryPkt, LSQUnit< Impl >::stalled, LSQUnit< Impl >::storeQueue, LSQUnit< Impl >::stores, LSQUnit< Impl >::storesToWB, and LSQUnit< Impl >::storeWBIt.
Referenced by LSQUnit< Impl >::init(), LSQUnit< Impl >::takeOverFrom(), and LSQUnit< Impl >::willWB().
Schedule event for the cpu.
Definition at line 386 of file lsq_unit.hh.
References LSQUnit< Impl >::cpu.
void LSQUnit< Impl >::setDcachePort | ( | MasterPort * | dcache_port | ) |
Sets the pointer to the dcache port.
Definition at line 248 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::dcachePort.
Referenced by LSQUnit< Impl >::LSQUnit().
|
inline |
Returns if the SQ is empty.
Definition at line 332 of file lsq_unit.hh.
References LSQUnit< Impl >::stores.
Referenced by LSQUnit< Impl >::isEmpty().
|
inline |
Returns if the SQ is full.
Definition at line 326 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 846 of file lsq_unit_impl.hh.
References CircularQueue< T >::back(), DPRINTF, LSQUnit< Impl >::isStalled(), LSQUnit< Impl >::loadQueue, LSQUnit< Impl >::loads, LSQUnit< Impl >::lsqSquashedLoads, LSQUnit< Impl >::lsqSquashedStores, LSQUnit< Impl >::memDepViolator, panic, CircularQueue< T >::pop_back(), LSQUnit< Impl >::stalled, LSQUnit< Impl >::stallingLoadIdx, LSQUnit< Impl >::stallingStoreIsn, LSQUnit< Impl >::storeQueue, LSQUnit< Impl >::stores, and CircularQueue< T >::tail().
Referenced by LSQUnit< Impl >::executeLoad().
|
private |
Handles completing the send of a store to memory.
Definition at line 915 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 >::willWB(), LSQUnit< Impl >::writebackBlockedStore(), and LSQUnit< Impl >::writebackStores().
void LSQUnit< Impl >::takeOverFrom | ( | ) |
Takes over from another CPU's thread.
Definition at line 266 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::resetState().
Referenced by LSQUnit< Impl >::LSQUnit().
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 1055 of file lsq_unit_impl.hh.
References LSQ< Impl >::cacheBlocked(), LSQ< Impl >::cachePortAvailable(), LSQ< Impl >::cachePortBusy(), LSQUnit< Impl >::dcachePort, LSQUnit< Impl >::isStoreBlocked, LSQUnit< Impl >::lsq, LSQUnit< Impl >::lsqCacheBlocked, Packet::senderState, MasterPort::sendTimingReq(), and LSQUnit< Impl >::storeWBIt.
Referenced by LSQUnit< Impl >::willWB().
|
inline |
Returns if there is a memory ordering violation.
Value is reset upon call to getMemDepViolator().
Definition at line 299 of file lsq_unit.hh.
References LSQUnit< Impl >::getMemDepViolator(), LSQUnit< Impl >::memDepViolator, LSQUnit< Impl >::numFreeLoadEntries(), and LSQUnit< Impl >::numFreeStoreEntries().
|
inline |
Returns if the LSQ unit will writeback on this cycle.
Definition at line 345 of file lsq_unit.hh.
References LSQUnit< Impl >::cacheLineSize(), LSQUnit< Impl >::completeStore(), CircularQueue< T >::iterator::dereferenceable(), LSQUnit< Impl >::dumpInsts(), LSQUnit< Impl >::isStoreBlocked, LSQUnit< Impl >::recvRetry(), LSQUnit< Impl >::resetState(), LSQUnit< Impl >::storePostSend(), LSQUnit< Impl >::storeWBIt, LSQUnit< Impl >::trySendPacket(), LSQUnit< Impl >::writeback(), and LSQUnit< Impl >::writebackBlockedStore().
Fault LSQUnit< Impl >::write | ( | LSQRequest * | req, |
uint8_t * | data, | ||
int | store_idx | ||
) |
Executes the store at the given index.
Definition at line 870 of file lsq_unit.hh.
References Request::CACHE_BLOCK_ZERO, data, LSQUnit< Impl >::SQEntry::DataSize, DPRINTF, NoFault, LSQUnit< Impl >::LSQEntry::size(), Request::STORE_NO_DATA, LSQUnit< Impl >::storeQueue, and LSQUnit< Impl >::LSQEntry::valid().
|
private |
Writes back the instruction, sending it to IEW.
Definition at line 947 of file lsq_unit_impl.hh.
References DPRINTF, LSQUnit< Impl >::iewStage, LSQUnit< Impl >::lsqIgnoredResponses, and NoFault.
Referenced by LSQUnit< Impl >::completeDataAccess(), and LSQUnit< Impl >::willWB().
|
private |
Try to finish a previously blocked write back attempt.
Definition at line 705 of file lsq_unit_impl.hh.
References LSQUnit< Impl >::isStoreBlocked, LSQUnit< Impl >::storePostSend(), and LSQUnit< Impl >::storeWBIt.
Referenced by LSQUnit< Impl >::recvRetry(), LSQUnit< Impl >::willWB(), and LSQUnit< Impl >::writebackStores().
void LSQUnit< Impl >::writebackStores | ( | ) |
Writes back stores.
Definition at line 716 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, TheISA::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.
Referenced by LSQUnit< Impl >::executeLoad().
Address Mask for a cache block (e.g.
~(cache_block_size-1))
Definition at line 506 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::checkSnoop(), LSQUnit< Impl >::resetState(), and LSQUnit< Impl >::writebackStores().
|
private |
Should loads be checked for dependency issues.
Definition at line 491 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::executeLoad(), and LSQUnit< Impl >::init().
Pointer to the CPU.
Definition at line 392 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::cacheLineSize(), LSQUnit< Impl >::checkSnoop(), LSQUnit< Impl >::completeDataAccess(), LSQUnit< Impl >::completeStore(), LSQUnit< Impl >::dTLB(), LSQUnit< Impl >::init(), LSQUnit< Impl >::read(), LSQUnit< Impl >::resetState(), LSQUnit< Impl >::schedule(), LSQUnit< Impl >::storePostSend(), and LSQUnit< Impl >::writebackStores().
|
private |
Pointer to the dcache port.
Used only for sending.
Definition at line 401 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 488 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::checkViolations(), and LSQUnit< Impl >::init().
|
private |
Wire to read information from the issue stage time queue.
Definition at line 509 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 534 of file lsq_unit.hh.
Pointer to the IEW stage.
Definition at line 395 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::completeStore(), LSQUnit< Impl >::executeLoad(), LSQUnit< Impl >::init(), LSQUnit< Impl >::name(), LSQUnit< Impl >::read(), LSQUnit< Impl >::storePostSend(), and LSQUnit< Impl >::writeback().
|
private |
Total number of loads ignored due to invalid addresses.
Definition at line 549 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::regStats().
|
private |
Total number of software prefetches ignored due to invalid addresses.
Definition at line 565 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::regStats().
|
private |
Whehter or not a store is blocked due to the memory system.
Definition at line 524 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::recvRetry(), LSQUnit< Impl >::trySendPacket(), LSQUnit< Impl >::willWB(), LSQUnit< Impl >::writebackBlockedStore(), and LSQUnit< Impl >::writebackStores().
The load queue.
Definition at line 482 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 >::insertLoad(), LSQUnit< Impl >::insertStore(), LSQ< Impl >::LSQRequest::install(), LSQUnit< Impl >::lqFull(), LSQUnit< Impl >::numFreeLoadEntries(), LSQUnit< Impl >::read(), LSQUnit< Impl >::squash(), and LSQUnit< Impl >::storePostSend().
|
private |
The number of load instructions in the LQ.
Definition at line 494 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(), LSQUnit< Impl >::resetState(), and LSQUnit< Impl >::squash().
Pointer to the LSQ.
Definition at line 398 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::init(), LSQUnit< Impl >::trySendPacket(), and LSQUnit< Impl >::writebackStores().
|
private |
Ready loads blocked due to partial store-forwarding.
Definition at line 568 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::regStats().
|
private |
Number of times the LSQ is blocked due to the cache.
Definition at line 574 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::regStats(), and LSQUnit< Impl >::trySendPacket().
|
private |
Total number of loads forwaded from LSQ stores.
Definition at line 546 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::read(), and LSQUnit< Impl >::regStats().
The LSQUnit thread id.
Definition at line 476 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::init(), LSQUnit< Impl >::name(), LSQUnit< Impl >::read(), and LSQUnit< Impl >::writebackStores().
|
private |
Total number of responses from the memory system that are ignored due to the instruction already being squashed.
Definition at line 556 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::regStats(), and LSQUnit< Impl >::writeback().
|
private |
Tota number of memory ordering violations.
Definition at line 559 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::checkViolations(), and LSQUnit< Impl >::regStats().
|
private |
Number of loads that were rescheduled.
Definition at line 571 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::read(), and LSQUnit< Impl >::regStats().
|
private |
Total number of squashed loads.
Definition at line 552 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::regStats(), and LSQUnit< Impl >::squash().
|
private |
Total number of squashed stores.
Definition at line 562 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::regStats(), and LSQUnit< Impl >::squash().
|
static |
Definition at line 80 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::read().
|
private |
The oldest load that caused a memory ordering violation.
Definition at line 530 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::checkViolations(), LSQUnit< Impl >::getMemDepViolator(), LSQUnit< Impl >::resetState(), LSQUnit< Impl >::squash(), and LSQUnit< Impl >::violation().
|
private |
Flag for memory model.
Definition at line 540 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::checkSnoop(), LSQUnit< Impl >::completeStore(), LSQUnit< Impl >::init(), LSQUnit< Impl >::storePostSend(), and LSQUnit< Impl >::writebackStores().
|
private |
The packet that is pending free cache ports.
Definition at line 537 of file lsq_unit.hh.
The packet that needs to be retried.
Definition at line 521 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::drainSanityCheck(), and LSQUnit< Impl >::resetState().
|
private |
Whether or not the LSQ is stalled.
Definition at line 512 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::completeStore(), LSQUnit< Impl >::isStalled(), LSQUnit< Impl >::read(), LSQUnit< Impl >::resetState(), LSQUnit< Impl >::squash(), and LSQUnit< Impl >::storePostSend().
|
private |
The index of the above store.
Definition at line 518 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::completeStore(), LSQUnit< Impl >::read(), LSQUnit< Impl >::squash(), and LSQUnit< Impl >::storePostSend().
|
private |
The store that causes the stall due to partial store to load forwarding.
Definition at line 516 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::completeStore(), LSQUnit< Impl >::read(), LSQUnit< Impl >::squash(), and LSQUnit< Impl >::storePostSend().
|
private |
Whether or not a store is in flight.
Definition at line 527 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 479 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::commitStores(), LSQUnit< Impl >::completeStore(), LSQUnit< Impl >::dumpInsts(), LSQUnit< Impl >::executeStore(), LSQUnit< Impl >::insertLoad(), LSQUnit< Impl >::insertStore(), LSQ< Impl >::LSQRequest::install(), LSQUnit< Impl >::numFreeStoreEntries(), LSQUnit< Impl >::read(), LSQUnit< Impl >::resetState(), LSQUnit< Impl >::sqFull(), LSQUnit< Impl >::squash(), LSQUnit< Impl >::write(), and LSQUnit< Impl >::writebackStores().
|
private |
The number of store instructions in the SQ.
Definition at line 496 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 >::resetState(), 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 498 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(), LSQUnit< Impl >::resetState(), 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 503 of file lsq_unit.hh.
Referenced by LSQUnit< Impl >::read(), LSQUnit< Impl >::resetState(), LSQUnit< Impl >::storePostSend(), LSQUnit< Impl >::trySendPacket(), LSQUnit< Impl >::willWB(), LSQUnit< Impl >::writebackBlockedStore(), and LSQUnit< Impl >::writebackStores().