Go to the documentation of this file.
45 #include "arch/locked_mem.hh"
47 #include "config/the_isa.hh"
51 #include "debug/Activity.hh"
52 #include "debug/HtmCpu.hh"
53 #include "debug/IEW.hh"
54 #include "debug/LSQUnit.hh"
55 #include "debug/O3PipeView.hh"
67 :
Event(Default_Pri, AutoDelete),
68 inst(_inst), pkt(_pkt), lsqPtr(lsq_ptr)
70 assert(_inst->savedReq);
71 _inst->savedReq->writebackScheduled();
77 assert(!lsqPtr->cpu->switchedOut());
79 lsqPtr->writeback(inst, pkt);
81 assert(inst->savedReq);
82 inst->savedReq->writebackDone();
89 return "Store writeback";
97 assert(req !=
nullptr);
100 if (senderState->alive()) {
103 senderState->outstanding--;
132 "store notification (ignored) of HTM transaction failure "
133 "in cache - addr=0x%lx - rc=%s - htmUid=%d\n",
150 panic(
"HTM error - unhandled return code from cache (%s)",
155 std::make_shared<GenericHtmFailureFault>(
156 inst->getHtmTransactionUid(),
160 "load notification of HTM transaction failure "
161 "in cache - pc=%s - addr=0x%lx - "
162 "rc=%u - htmUid=%d\n",
163 inst->pcState(), pkt->
getAddr(),
175 if (!inst->isSquashed()) {
179 assert(inst->isLoad() || inst->isStoreConditional() ||
189 if (inst->isStore() || inst->isAtomic()) {
194 }
else if (inst->isStore()) {
214 LSQ *lsq_ptr,
unsigned id)
265 : statistics::
Group(parent),
266 ADD_STAT(forwLoads, statistics::units::Count::get(),
267 "Number of loads that had data forwarded from stores"),
268 ADD_STAT(squashedLoads, statistics::units::Count::get(),
269 "Number of loads squashed"),
270 ADD_STAT(ignoredResponses, statistics::units::Count::get(),
271 "Number of memory responses ignored because the instruction is "
273 ADD_STAT(memOrderViolation, statistics::units::Count::get(),
274 "Number of memory ordering violations"),
275 ADD_STAT(squashedStores, statistics::units::Count::get(),
276 "Number of stores squashed"),
277 ADD_STAT(rescheduledLoads, statistics::units::Count::get(),
278 "Number of loads that were rescheduled"),
279 ADD_STAT(blockedByCache, statistics::units::Count::get(),
280 "Number of times an access to memory failed due to the cache "
282 ADD_STAT(loadToUse,
"Distribution of cycle latency between the "
283 "first time a load is issued and its completion")
315 assert(inst->isMemRef());
317 assert(inst->isLoad() || inst->isStore() || inst->isAtomic());
319 if (inst->isLoad()) {
345 assert(load_inst->lqIdx > 0);
353 if (load_inst->isHtmStart()) {
355 DPRINTF(HtmCpu,
">> htmStarts++ (%d) : htmStops (%d)\n",
360 auto htm_uid = htm_cpt->getHtmUid();
363 if (!load_inst->inHtmTransactionalState()) {
364 htm_uid = htm_cpt->newHtmUid();
365 DPRINTF(HtmCpu,
"generating new htmUid=%u\n", htm_uid);
366 if (htm_depth != 1) {
368 "unusual HTM transactional depth (%d)"
369 " possibly caused by mispeculation - htmUid=%u\n",
373 load_inst->setHtmTransactionalState(htm_uid, htm_depth);
376 if (load_inst->isHtmStop()) {
378 DPRINTF(HtmCpu,
">> htmStarts (%d) : htmStops++ (%d)\n",
383 "htmStops==1 && htmStarts==0. "
384 "This generally shouldn't happen "
385 "(unless due to misspeculation)\n");
403 assert(store_inst->lqIdx > 0);
452 bool no_squash =
cpu->
thread[
x]->noSquashFromTC;
470 if (ld_inst->effAddrValid() &&
475 bool force_squash =
false;
478 ld_inst = iter->instruction();
481 if (!ld_inst->effAddrValid() || ld_inst->strictlyOrdered())
485 ld_inst->seqNum, invalidate_addr);
495 if (ld_inst->possibleLoadViolation() || force_squash) {
497 pkt->
getAddr(), ld_inst->seqNum);
500 ld_inst->fault = std::make_shared<ReExec>();
504 pkt->
getAddr(), ld_inst->seqNum);
515 ld_inst->hitExternalSnoop(
true);
536 if (!ld_inst->effAddrValid() || ld_inst->strictlyOrdered()) {
545 if (inst_eff_addr2 >= ld_eff_addr1 && inst_eff_addr1 <= ld_eff_addr2) {
546 if (inst->isLoad()) {
550 if (ld_inst->hitExternalSnoop()) {
554 "and [sn:%lli] at address %#x\n",
555 inst->seqNum, ld_inst->seqNum, ld_eff_addr1);
560 return std::make_shared<GenericISA::M5PanicFault>(
561 "Detected fault with inst [sn:%lli] and "
562 "[sn:%lli] at address %#x\n",
563 inst->seqNum, ld_inst->seqNum, ld_eff_addr1);
569 ld_inst->possibleLoadViolation(
true);
571 " between instructions [sn:%lli] and [sn:%lli]\n",
572 inst_eff_addr1, inst->seqNum, ld_inst->seqNum);
581 "[sn:%lli] at address %#x\n",
582 inst->seqNum, ld_inst->seqNum, ld_eff_addr1);
587 return std::make_shared<GenericISA::M5PanicFault>(
588 "Detected fault with "
589 "inst [sn:%lli] and [sn:%lli] at address %#x\n",
590 inst->seqNum, ld_inst->seqNum, ld_eff_addr1);
609 inst->pcState(), inst->seqNum);
611 assert(!inst->isSquashed());
613 load_fault = inst->initiateAcc();
615 if (load_fault ==
NoFault && !inst->readMemAccPredicate()) {
616 assert(inst->readPredicate());
618 inst->completeAcc(
nullptr);
624 if (inst->isTranslationDelayed() && load_fault ==
NoFault)
627 if (load_fault !=
NoFault && inst->translationCompleted() &&
628 inst->savedReq->isPartialFault() && !inst->savedReq->isComplete()) {
629 assert(inst->savedReq->isSplit());
639 if (load_fault !=
NoFault || !inst->readPredicate()) {
644 if (!inst->readPredicate())
645 inst->forwardOldRegs();
648 (load_fault !=
NoFault ?
"fault" :
"predication"));
649 if (!(inst->hasRequest() && inst->strictlyOrdered()) ||
650 inst->isAtCommit()) {
656 if (inst->effAddrValid()) {
657 auto it = inst->lqIt;
674 int store_idx = store_inst->sqIdx;
677 store_inst->pcState(), store_inst->seqNum);
679 assert(!store_inst->isSquashed());
683 typename LoadQueue::iterator loadIt = store_inst->lqIt;
685 Fault store_fault = store_inst->initiateAcc();
687 if (store_inst->isTranslationDelayed() &&
691 if (!store_inst->readPredicate()) {
692 DPRINTF(
LSQUnit,
"Store [sn:%lli] not executed from predication\n",
694 store_inst->forwardOldRegs();
700 store_inst->pcState(), store_inst->seqNum);
705 assert(store_fault ==
NoFault);
707 if (store_inst->isStoreConditional() || store_inst->isAtomic()) {
731 if (!inst->isInstPrefetch() && !inst->isDataPrefetch()
732 && inst->firstIssue != -1
733 && inst->lastWakeDependents != -1) {
735 inst->lastWakeDependents - inst->firstIssue));
766 if (
x.instruction()->seqNum > youngest_inst) {
771 x.instruction()->pcState(),
772 x.instruction()->seqNum);
785 storeWBIt->request()->sendPacketToCache();
822 if (
storeWBIt->instruction()->isDataPrefetch()) {
839 "[sn:%lli] is %s%s and not head of the queue\n",
841 req->
request()->getPaddr(), inst->seqNum,
843 req->
mainRequest()->isRelease() ?
"/Release" :
"");
849 assert(!inst->memData);
850 inst->memData =
new uint8_t[req->
_size];
853 memset(inst->memData, 0, req->
_size);
865 if (inst->isStoreConditional() || inst->isAtomic()) {
873 "to Addr:%#x, data:%#x [sn:%lli]\n",
875 req->
request()->getPaddr(), (
int)*(inst->memData),
879 if (inst->isStoreConditional()) {
883 inst->recordResult(
false);
886 inst->recordResult(
true);
893 "Instantly completing it.\n",
908 if (req->
request()->isLocalAccess()) {
909 assert(!inst->isStoreConditional());
910 assert(!inst->inHtmTransactionalState());
915 req->
request()->localAccessor(thread, main_pkt);
928 DPRINTF(
LSQUnit,
"D-Cache became blocked when writing [sn:%lli], "
929 "will retry later\n",
940 "(Loads:%i Stores:%i)\n", squashed_num,
loads,
stores);
961 DPRINTF(HtmCpu,
">> htmStarts-- (%d) : htmStops (%d)\n",
967 DPRINTF(HtmCpu,
">> htmStarts (%d) : htmStops-- (%d)\n",
983 uint64_t in_flight_uid = 0;
985 if (scan_it->instruction()->isHtmStart() &&
986 !scan_it->instruction()->isSquashed()) {
987 in_flight_uid = scan_it->instruction()->getHtmTransactionUid();
988 DPRINTF(HtmCpu,
"loadQueue[%d]: found valid HtmStart htmUid=%u\n",
989 scan_it._idx, in_flight_uid);
997 const uint64_t old_local_htm_uid = htm_cpt->getHtmUid();
998 uint64_t new_local_htm_uid;
999 if (in_flight_uid > 0)
1000 new_local_htm_uid = in_flight_uid;
1004 if (old_local_htm_uid != new_local_htm_uid) {
1005 DPRINTF(HtmCpu,
"flush: lastRetiredHtmUid=%u\n",
1007 DPRINTF(HtmCpu,
"flush: resetting localHtmUid=%u\n",
1010 htm_cpt->setHtmUid(new_local_htm_uid);
1026 "idx:%i [sn:%lli]\n",
1034 panic(
"Is stalled should have been cleared by stalling load!\n");
1057 return htm_cpt->getHtmUid();
1073 if (!
storeWBIt->instruction()->isStoreConditional()) {
1077 storeWBIt->instruction()->setCompleted();
1097 if (inst->isSquashed()) {
1098 assert (!inst->isStore() || inst->isStoreConditional());
1103 if (!inst->isExecuted()) {
1104 inst->setExecuted();
1108 inst->completeAcc(pkt);
1118 auto htm_fault = std::dynamic_pointer_cast<
1122 assert(
dynamic_cast<ReExec*
>(inst->fault.
get()) !=
nullptr ||
1123 inst->savedReq->isPartialFault());
1131 "%s writeback with HTM failure fault, "
1132 "however, completing packet is not aware of "
1133 "transaction failure. cause=%s htmUid=%u\n",
1134 inst->staticInst->getName(),
1136 htm_fault->getHtmUid());
1140 "due to pending fault.\n", inst->seqNum);
1156 assert(store_idx->valid());
1157 store_idx->completed() =
true;
1167 DynInstPtr store_inst = store_idx->instruction();
1179 DPRINTF(
LSQUnit,
"Completing store [sn:%lli], idx:%i, store head "
1184 if (debug::O3PipeView) {
1185 store_inst->storeTick =
1186 curTick() - store_inst->fetchTick;
1200 store_inst->setCompleted();
1212 if (
cpu->
checker && !store_inst->isStoreConditional()) {
1221 bool cache_got_blocked =
false;
1229 cache_got_blocked =
true;
1240 state->outstanding++;
1241 state->request()->packetSent();
1243 if (cache_got_blocked) {
1248 assert(state->request() ==
storeWBIt->request());
1251 state->request()->packetNotSent();
1253 DPRINTF(
LSQUnit,
"Memory request (pkt: %s) from inst [sn:%llu] was"
1254 " %ssent (cache is blocked: %d, cache_got_blocked: %d)\n",
1255 data_pkt->
print(), state->inst->seqNum,
1272 cprintf(
"Load store queue: Dumping instructions.\n");
1278 cprintf(
"%s.[sn:%llu] ", inst->pcState(), inst->seqNum);
1287 cprintf(
"%s.[sn:%llu] ", inst->pcState(), inst->seqNum);
1312 assert(!load_inst->isExecuted());
1320 (load_idx !=
loadQueue.
head() || !load_inst->isAtCommit())) {
1324 load_inst->clearIssued();
1325 load_inst->effAddrValid(
false);
1328 load_inst->seqNum, load_inst->pcState());
1335 return std::make_shared<GenericISA::M5PanicFault>(
1336 "Strictly ordered load [sn:%llx] PC %s\n",
1337 load_inst->seqNum, load_inst->pcState());
1341 "storeHead: %i addr: %#x%s\n",
1349 load_inst->recordResult(
false);
1351 load_inst->recordResult(
true);
1355 assert(!load_inst->memData);
1356 assert(!load_inst->inHtmTransactionalState());
1382 if (!load_inst->memData) {
1383 load_inst->memData =
1386 memset(load_inst->memData, 0, req->
mainRequest()->getSize());
1390 if (load_inst->inHtmTransactionalState()) {
1392 load_inst->getHtmTransactionUid());
1403 auto store_it = load_inst->sqIt;
1406 while (store_it !=
storeWBIt && !load_inst->isDataPrefetch()) {
1409 assert(store_it->valid());
1410 assert(store_it->instruction()->seqNum < load_inst->seqNum);
1411 int store_size = store_it->size();
1416 if (store_size != 0 && !store_it->instruction()->strictlyOrdered() &&
1417 !(store_it->request()->mainRequest() &&
1418 store_it->request()->mainRequest()->isCacheMaintenance())) {
1419 assert(store_it->instruction()->effAddrValid());
1424 auto req_e = req_s + req->
mainRequest()->getSize();
1425 auto st_s = store_it->instruction()->effAddr;
1426 auto st_e = st_s + store_size;
1428 bool store_has_lower_limit = req_s >= st_s;
1429 bool store_has_upper_limit = req_e <= st_e;
1430 bool lower_load_has_store_part = req_s < st_e;
1431 bool upper_load_has_store_part = req_e > st_s;
1439 if (!store_it->instruction()->isAtomic() &&
1440 store_has_lower_limit && store_has_upper_limit &&
1443 const auto& store_req = store_it->request()->mainRequest();
1444 coverage = store_req->isMasked() ?
1451 ((store_has_lower_limit && lower_load_has_store_part) ||
1452 (store_has_upper_limit && upper_load_has_store_part) ||
1453 (lower_load_has_store_part && upper_load_has_store_part))) ||
1457 ((store_has_lower_limit || upper_load_has_store_part) &&
1458 (store_has_upper_limit || lower_load_has_store_part))) ||
1461 (store_it->instruction()->isAtomic() &&
1462 ((store_has_lower_limit || upper_load_has_store_part) &&
1463 (store_has_upper_limit || lower_load_has_store_part)))) {
1471 store_it->instruction()->effAddr;
1474 if (!load_inst->memData) {
1475 load_inst->memData =
1478 if (store_it->isAllZeros())
1479 memset(load_inst->memData, 0,
1482 memcpy(load_inst->memData,
1483 store_it->
data() + shift_amt,
1487 "addr %#x\n", store_it._idx,
1502 if (load_inst->inHtmTransactionalState()) {
1503 assert (!
storeQueue[store_it._idx].completed());
1506 inHtmTransactionalState());
1508 load_inst->getHtmTransactionUid() ==
1510 getHtmTransactionUid());
1512 load_inst->getHtmTransactionUid());
1513 DPRINTF(HtmCpu,
"HTM LD (ST2LDF) "
1514 "pc=0x%lx - vaddr=0x%lx - "
1515 "paddr=0x%lx - htmUid=%u\n",
1516 load_inst->instAddr(),
1517 data_pkt->
req->hasVaddr() ?
1518 data_pkt->
req->getVaddr() : 0lu,
1520 load_inst->getHtmTransactionUid());
1548 if (store_it->completed()) {
1549 panic(
"Should not check one of these");
1567 load_inst->clearIssued();
1568 load_inst->effAddrValid(
false);
1574 "Store idx %i to load addr %#x\n",
1586 DPRINTF(
LSQUnit,
"Doing memory access for inst [sn:%lli] PC %s\n",
1587 load_inst->seqNum, load_inst->pcState());
1590 if (!load_inst->memData) {
1591 load_inst->memData =
new uint8_t[req->
mainRequest()->getSize()];
1600 *load_inst->memData = (uint64_t) 0x1ull;
1614 state->
inst = load_inst;
1631 DPRINTF(
LSQUnit,
"Doing write to store idx %i, addr %#x | storeHead:%i "
1634 storeQueue[store_idx].instruction()->seqNum);
1637 unsigned size = req->
_size;
1639 bool store_no_data =
1641 storeQueue[store_idx].isAllZeros() = store_no_data;
1646 !req->
request()->isCacheMaintenance() &&
void storePostSend()
Handles completing the send of a store to memory.
statistics::Scalar squashedLoads
Total number of squashed loads.
DynInstPtr inst
Instruction which initiated the access to memory.
Tick curTick()
The universal simulation clock.
void process()
Processes the writeback event.
ProbePointArg< std::pair< DynInstPtr, PacketPtr > > * ppDataAccessComplete
uint64_t lastRetiredHtmUid
Memory operation metadata.
constexpr decltype(nullptr) NoFault
bool switchedOut() const
Determine if the CPU is switched out.
InstSeqNum stallingStoreIsn
The store that causes the stall due to partial store to load forwarding.
bool sendTimingReq(PacketPtr pkt)
Attempt to send a timing request to the responder port by calling its corresponding receive function.
virtual void complete()=0
void insertStore(const DynInstPtr &store_inst)
Inserts a store instruction.
bool storeInFlight
Whether or not a store is in flight.
bool cacheBlocked() const
Is D-cache blocked?
const char * description() const
Returns the description of this event.
bool isStalled()
Returns whether or not the LSQ unit is stalled.
bool checkLoads
Should loads be checked for dependency issues.
void cprintf(const char *format, const Args &...args)
void advance_tail()
Increases the tail by one.
statistics::Scalar memOrderViolation
Tota number of memory ordering violations.
bool recvTimingResp(PacketPtr pkt)
Handles writing back and completing the load or store that has returned from memory.
void setRequest(LSQRequest *r)
IEW * iewStage
Pointer to the IEW stage.
DynInstPtr memDepViolator
The oldest load that caused a memory ordering violation.
int stallingLoadIdx
The index of the above store.
unsigned numContexts()
Get the number of thread contexts available.
void replayMemInst(const DynInstPtr &inst)
Re-executes all rescheduled memory instructions.
LSQUnit(uint32_t lqEntries, uint32_t sqEntries)
Constructs an LSQ unit.
Fault read(LSQRequest *req, int load_idx)
Executes the load at the given index.
RequestPtr req
A pointer to the original request.
bool needWB
Whether or not the instruction will need to writeback.
unsigned int cacheLineSize() const
Get the cache line size of the system.
unsigned numFreeStoreEntries()
Returns the number of free SQ entries.
void init(CPU *cpu_ptr, IEW *iew_ptr, const O3CPUParams ¶ms, LSQ *lsq_ptr, unsigned id)
Initializes the LSQ unit with the specified number of entries.
@ CACHE_BLOCK_ZERO
This is a write that is targeted and zeroing an entire cache block.
statistics::Scalar ignoredResponses
Total number of responses from the memory system that are ignored due to the instruction already bein...
virtual bool isCacheBlockHit(Addr blockAddr, Addr cacheBlockMask)=0
Test if the request accesses a particular cache line.
const FlagsType nozero
Don't print if this is zero.
void checkMisprediction(const DynInstPtr &inst)
Check misprediction
const std::string to_string(sc_enc enc)
virtual void buildPackets()=0
void schedule(Event &ev, Tick when)
Schedule event for the cpu.
bool cachePortAvailable(bool is_load) const
Is any store port available to use?
void setHtmTransactional(uint64_t val)
Stipulates that this packet/request originates in the CPU executing in transactional mode,...
static constexpr auto MaxDataBytes
int storesToWB
The number of store instructions in the SQ waiting to writeback.
Addr cacheBlockMask
Address Mask for a cache block (e.g.
virtual void sendPacketToCache()=0
void setDcachePort(RequestPort *dcache_port)
Sets the pointer to the dcache port.
void schedule(Event &event, Tick when)
std::string csprintf(const char *format, const Args &...args)
virtual PacketPtr mainPacket()
T * get() const
Directly access the pointer itself without taking a reference.
bool full() const
Is the queue full? A queue is full if the head is the 0^{th} element and the tail is the (size-1)^{th...
statistics::Distribution loadToUse
Distribution of cycle latency between the first time a load is issued and its completion.
unsigned depCheckShift
The number of places to shift addresses in the LSQ before checking for dependency violations.
@ PartialAddrRangeCoverage
void sample(const U &v, int n=1)
Add a value to the distribtion n times.
unsigned numFreeLoadEntries()
Returns the number of free LQ entries.
void wakeCPU()
Tells the CPU to wakeup if it has descheduled itself due to no activity.
void rescheduleMemInst(const DynInstPtr &inst)
Tells memory dependence unit that a memory instruction needs to be rescheduled.
gem5::Checker< DynInstPtr > * checker
Pointer to the checker, which can dynamically verify instruction results at run time.
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
Cycles is a wrapper class for representing cycle counts, i.e.
uint64_t getLatestHtmUid() const
bool handleLockedWrite(XC *xc, const RequestPtr &req, Addr cacheBlockMask)
void completeStore(typename StoreQueue::iterator store_idx)
Completes the store at the specified index.
bool needsTSO
Flag for memory model.
statistics::Scalar forwLoads
Total number of loads forwaded from LSQ stores.
void dataStatic(T *p)
Set the data pointer to the following value that should not be freed.
statistics::Scalar blockedByCache
Number of times the LSQ is blocked due to the cache.
Writeback event, specifically for when stores forward data to loads.
virtual bool recvTimingResp(PacketPtr pkt)=0
Class that implements the actual LQ and SQ for each specific thread.
O3CPU class, has each of the stages (fetch through commit) within it, as well as all of the time buff...
void packetSent()
Update the status to reflect that a packet was sent.
gem5::o3::LSQUnit::LSQUnitStats stats
void commitLoad()
Commits the head load.
Distribution & init(Counter min, Counter max, Counter bkt)
Set the parameters of this distribution.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
statistics::Scalar rescheduledLoads
Number of loads that were rescheduled.
void discard()
The request is discarded (e.g.
bool trySendPacket(bool isLoad, PacketPtr data_pkt)
Attempts to send a packet to the cache.
std::shared_ptr< FaultBase > Fault
void print(std::ostream &o, int verbosity=0, const std::string &prefix="") const
bool isSplit
Whether or not this access is split in two.
void discardSenderState()
Mark senderState as discarded.
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
Particularisation of the LSQSenderState to the LQ.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
int loads
The number of load instructions in the LQ.
bool isStoreBlocked
Whehter or not a store is blocked due to the memory system.
bool htmTransactionFailedInCache() const
Returns whether or not this packet/request has returned from the cache hierarchy in a failed transact...
ProbePointArg< PacketInfo > Packet
Packet probe point.
uint64_t Tick
Tick count type.
WritebackEvent(const DynInstPtr &_inst, PacketPtr pkt, LSQUnit *lsq_ptr)
Constructs a writeback event.
IEW handles both single threaded and SMT IEW (issue/execute/writeback).
CPU * cpu
Pointer to the CPU.
StoreQueue::iterator storeWBIt
The index of the first instruction that may be ready to be written back, and has not yet been written...
ThreadID lsqID
The LSQUnit thread id.
PacketPtr packet(int idx=0)
uint32_t _numOutstandingPackets
gem5::ThreadContext * tcBase(ThreadID tid)
Returns a pointer to a thread context.
Fault write(LSQRequest *req, uint8_t *data, int store_idx)
Executes the store at the given index.
uint64_t getHtmTransactionUid() const
If a packet/request originates in a CPU executing in transactional mode, i.e.
std::vector< ThreadState * > thread
Pointers to all of the threads in the CPU.
void commitLoads(InstSeqNum &youngest_inst)
Commits loads older than a specific sequence number.
void activityThisCycle()
Reports to the CPU that there is activity this cycle.
iterator begin()
Iterators.
void handleLockedSnoopHit(XC *xc)
void completeDataAccess(PacketPtr pkt)
Completes the data access that has been returned from the memory system.
void cachePortBusy(bool is_load)
Another store port is in use.
void wakeCPU()
Wakes the CPU, rescheduling the CPU if it's not already active.
void addStatGroup(const char *name, Group *block)
Add a stat block as a child of this block.
HtmCacheFailure getHtmTransactionFailedInCacheRC() const
If a packet/request has returned from the cache hierarchy in a failed transaction,...
void takeOverFrom()
Takes over from another CPU's thread.
RequestPtr request(int idx=0)
PacketPtr retryPkt
The packet that needs to be retried.
Fault checkViolations(typename LoadQueue::iterator &loadIt, const DynInstPtr &inst)
Check for ordering violations in the LSQ.
virtual BaseHTMCheckpointPtr & getHtmCheckpointPtr()=0
void senderState(LSQSenderState *st)
virtual ThreadContext * getContext(int tn)
Given a thread num get tho thread context for it.
int stores
The number of store instructions in the SQ.
void writeback(const DynInstPtr &inst, PacketPtr pkt)
Writes back the instruction, sending it to IEW.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void squash(const InstSeqNum &squashed_num)
Squashes all instructions younger than a specific sequence number.
SenderState * senderState
This packet's sender state.
statistics::Scalar squashedStores
Total number of squashed stores.
Tick clockEdge(Cycles cycles=Cycles(0)) const
Determine the tick when a cycle begins, by default the current one, but the argument also enables the...
const DynInstPtr & instruction() const
Fault executeStore(const DynInstPtr &inst)
Executes a store instruction.
static const FlagsType STORE_NO_DATA
static constexpr int MaxThreads
void writebackBlockedStore()
Try to finish a previously blocked write back attempt.
void activityThisCycle()
Records that there was time buffer activity this cycle.
bool isLoad
Whether or not it is a load.
void pop_front(size_t num_elem=1)
Circularly increase the head pointer.
void instToCommit(const DynInstPtr &inst)
Sends an instruction to commit through the time buffer.
void insert(const DynInstPtr &inst)
Inserts an instruction.
RequestPort * dcachePort
Pointer to the dcache port.
Derived class to hold any sender state the LSQ needs.
void pop_back()
Circularly decrease the tail pointer.
bool empty() const
Is the queue empty?
bool stalled
Whether or not the LSQ is stalled.
std::string htmFailureToStr(HtmFailureFaultCause cause)
Convert enum into string to be used for debug purposes.
@ LLSC
The request is a Load locked/store conditional.
void blockMemInst(const DynInstPtr &inst)
Moves memory instruction onto the list of cache blocked instructions.
virtual RequestPtr mainRequest()
T * data
The stored pointer.
static constexpr size_t DataSize
LSQ * lsq
Pointer to the LSQ.
void makeResponse()
Take a request packet and modify it in place to be suitable for returning as a response to that reque...
Fault executeLoad(const DynInstPtr &inst)
Executes a load instruction.
void recvRetry()
Handles doing the retry.
bool isAnyOutstandingRequest()
Test if there is any in-flight translation or mem access request.
void handleLockedRead(XC *xc, const RequestPtr &req)
@ NO_ACCESS
The request should not cause a memory access.
bool updateLSQNextCycle
Records if the LSQ needs to be updated on the next cycle, so that IEW knows if there will be activity...
void drainSanityCheck() const
Perform sanity checks after a drain.
void commitStores(InstSeqNum &youngest_inst)
Commits stores older than a specific sequence number.
void resetState()
Reset the LSQ state.
Particularisation of the LSQSenderState to the SQ.
void setHtmTransactionFailedInCache(const HtmCacheFailure ret_code)
Stipulates that this packet/request has returned from the cache hierarchy in a failed transaction.
void handleLockedSnoop(XC *xc, PacketPtr pkt, Addr cacheBlockMask)
Derived & flags(Flags _flags)
Set the flags and marks this stat to print at the end of simulation.
Cycles ticksToCycles(Tick t) const
iterator getIterator(size_t idx)
Return an iterator to an index in the queue.
bool isHtmTransactional() const
Returns whether or not this packet/request originates in the CPU executing in transactional mode,...
DynInstPtr getMemDepViolator()
Returns the memory ordering violator.
InstSeqNum getStoreHeadSeqNum()
Returns the sequence number of the head store instruction.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
LoadQueue loadQueue
The load queue.
std::string name() const
Returns the name of the LSQ unit.
void dumpInsts() const
Debugging function to dump instructions in the LSQ.
void insertLoad(const DynInstPtr &load_inst)
Inserts a load instruction.
unsigned int cacheLineSize()
CircularQueue< SQEntry > storeQueue
The store queue.
InstSeqNum getLoadHeadSeqNum()
Returns the sequence number of the head load instruction.
void writebackStores()
Writes back stores.
void checkSnoop(PacketPtr pkt)
Check if an incoming invalidate hits in the lsq on a load that might have issued out of order wrt ano...
std::string name() const
Returns the name of the IEW stage.
bool isInvalidate() const
#define panic(...)
This implements a cprintf based panic() function.
LSQUnitStats(statistics::Group *parent)
Generated on Wed Jul 28 2021 12:10:24 for gem5 by doxygen 1.8.17