2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;
9 * redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution;
12 * neither the name of the copyright holders nor the names of its
13 * contributors may be used to endorse or promote products derived from
14 * this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 #include "arch/locked_mem.hh"
33 #include "config/the_isa.hh"
34 #include "config/use_checker.hh"
35 #include "cpu/o3/lsq.hh"
36 #include "cpu/o3/lsq_unit.hh"
37 #include "base/str.hh"
38 #include "mem/packet.hh"
39 #include "mem/request.hh"
42 #include "cpu/checker/cpu.hh"
46 LSQUnit<Impl>::WritebackEvent::WritebackEvent(DynInstPtr &_inst, PacketPtr _pkt,
48 : inst(_inst), pkt(_pkt), lsqPtr(lsq_ptr)
50 this->setFlags(Event::AutoDelete);
55 LSQUnit<Impl>::WritebackEvent::process()
57 if (!lsqPtr->isSwitchedOut()) {
58 lsqPtr->writeback(inst, pkt);
62 delete pkt->senderState;
70 LSQUnit<Impl>::WritebackEvent::description() const
72 return "Store writeback";
77 LSQUnit<Impl>::completeDataAccess(PacketPtr pkt)
79 LSQSenderState *state = dynamic_cast<LSQSenderState *>(pkt->senderState);
80 DynInstPtr inst = state->inst;
81 DPRINTF(IEW, "Writeback event [sn:%lli]\n", inst->seqNum);
82 DPRINTF(Activity, "Activity: Writeback event [sn:%lli]\n", inst->seqNum);
84 //iewStage->ldstQueue.removeMSHR(inst->threadNumber,inst->seqNum);
86 assert(!pkt->wasNacked());
88 if (isSwitchedOut() || inst->isSquashed()) {
89 iewStage->decrWb(inst->seqNum);
95 if (inst->isStore()) {
96 completeStore(state->idx);
105 template <class Impl>
106 LSQUnit<Impl>::LSQUnit()
107 : loads(0), stores(0), storesToWB(0), stalled(false),
108 isStoreBlocked(false), isLoadBlocked(false),
109 loadBlockedHandled(false)
115 LSQUnit<Impl>::init(O3CPU *cpu_ptr, IEW *iew_ptr, DerivO3CPUParams *params,
116 LSQ *lsq_ptr, unsigned maxLQEntries, unsigned maxSQEntries,
122 DPRINTF(LSQUnit, "Creating LSQUnit%i object.\n",id);
130 // Add 1 for the sentinel entry (they are circular queues).
131 LQEntries = maxLQEntries + 1;
132 SQEntries = maxSQEntries + 1;
134 loadQueue.resize(LQEntries);
135 storeQueue.resize(SQEntries);
137 loadHead = loadTail = 0;
139 storeHead = storeWBIdx = storeTail = 0;
142 cachePorts = params->cachePorts;
145 memDepViolator = NULL;
147 blockedLoadSeqNum = 0;
152 LSQUnit<Impl>::name() const
154 if (Impl::MaxThreads == 1) {
155 return iewStage->name() + ".lsq";
157 return iewStage->name() + ".lsq.thread." + to_string(lsqID);
163 LSQUnit<Impl>::regStats()
166 .name(name() + ".forwLoads")
167 .desc("Number of loads that had data forwarded from stores");
170 .name(name() + ".invAddrLoads")
171 .desc("Number of loads ignored due to an invalid address");
174 .name(name() + ".squashedLoads")
175 .desc("Number of loads squashed");
178 .name(name() + ".ignoredResponses")
179 .desc("Number of memory responses ignored because the instruction is squashed");
182 .name(name() + ".memOrderViolation")
183 .desc("Number of memory ordering violations");
186 .name(name() + ".squashedStores")
187 .desc("Number of stores squashed");
190 .name(name() + ".invAddrSwpfs")
191 .desc("Number of software prefetches ignored due to an invalid address");
194 .name(name() + ".blockedLoads")
195 .desc("Number of blocked loads due to partial load-store forwarding");
198 .name(name() + ".rescheduledLoads")
199 .desc("Number of loads that were rescheduled");
202 .name(name() + ".cacheBlocked")
203 .desc("Number of times an access to memory failed due to the cache being blocked");
208 LSQUnit<Impl>::setDcachePort(Port *dcache_port)
210 dcachePort = dcache_port;
214 cpu->checker->setDcachePort(dcachePort);
221 LSQUnit<Impl>::clearLQ()
228 LSQUnit<Impl>::clearSQ()
235 LSQUnit<Impl>::switchOut()
238 for (int i = 0; i < loadQueue.size(); ++i) {
239 assert(!loadQueue[i]);
243 assert(storesToWB == 0);
248 LSQUnit<Impl>::takeOverFrom()
251 loads = stores = storesToWB = 0;
253 loadHead = loadTail = 0;
255 storeHead = storeWBIdx = storeTail = 0;
259 memDepViolator = NULL;
261 blockedLoadSeqNum = 0;
264 isLoadBlocked = false;
265 loadBlockedHandled = false;
270 LSQUnit<Impl>::resizeLQ(unsigned size)
272 unsigned size_plus_sentinel = size + 1;
273 assert(size_plus_sentinel >= LQEntries);
275 if (size_plus_sentinel > LQEntries) {
276 while (size_plus_sentinel > loadQueue.size()) {
278 loadQueue.push_back(dummy);
282 LQEntries = size_plus_sentinel;
289 LSQUnit<Impl>::resizeSQ(unsigned size)
291 unsigned size_plus_sentinel = size + 1;
292 if (size_plus_sentinel > SQEntries) {
293 while (size_plus_sentinel > storeQueue.size()) {
295 storeQueue.push_back(dummy);
299 SQEntries = size_plus_sentinel;
303 template <class Impl>
305 LSQUnit<Impl>::insert(DynInstPtr &inst)
307 assert(inst->isMemRef());
309 assert(inst->isLoad() || inst->isStore());
311 if (inst->isLoad()) {
320 template <class Impl>
322 LSQUnit<Impl>::insertLoad(DynInstPtr &load_inst)
324 assert((loadTail + 1) % LQEntries != loadHead);
325 assert(loads < LQEntries);
327 DPRINTF(LSQUnit, "Inserting load PC %#x, idx:%i [sn:%lli]\n",
328 load_inst->readPC(), loadTail, load_inst->seqNum);
330 load_inst->lqIdx = loadTail;
333 load_inst->sqIdx = -1;
335 load_inst->sqIdx = storeTail;
338 loadQueue[loadTail] = load_inst;
345 template <class Impl>
347 LSQUnit<Impl>::insertStore(DynInstPtr &store_inst)
349 // Make sure it is not full before inserting an instruction.
350 assert((storeTail + 1) % SQEntries != storeHead);
351 assert(stores < SQEntries);
353 DPRINTF(LSQUnit, "Inserting store PC %#x, idx:%i [sn:%lli]\n",
354 store_inst->readPC(), storeTail, store_inst->seqNum);
356 store_inst->sqIdx = storeTail;
357 store_inst->lqIdx = loadTail;
359 storeQueue[storeTail] = SQEntry(store_inst);
361 incrStIdx(storeTail);
366 template <class Impl>
367 typename Impl::DynInstPtr
368 LSQUnit<Impl>::getMemDepViolator()
370 DynInstPtr temp = memDepViolator;
372 memDepViolator = NULL;
377 template <class Impl>
379 LSQUnit<Impl>::numFreeEntries()
381 unsigned free_lq_entries = LQEntries - loads;
382 unsigned free_sq_entries = SQEntries - stores;
384 // Both the LQ and SQ entries have an extra dummy entry to differentiate
385 // empty/full conditions. Subtract 1 from the free entries.
386 if (free_lq_entries < free_sq_entries) {
387 return free_lq_entries - 1;
389 return free_sq_entries - 1;
393 template <class Impl>
395 LSQUnit<Impl>::numLoadsReady()
397 int load_idx = loadHead;
400 while (load_idx != loadTail) {
401 assert(loadQueue[load_idx]);
403 if (loadQueue[load_idx]->readyToIssue()) {
411 template <class Impl>
413 LSQUnit<Impl>::executeLoad(DynInstPtr &inst)
415 using namespace TheISA;
416 // Execute a specific load.
417 Fault load_fault = NoFault;
419 DPRINTF(LSQUnit, "Executing load PC %#x, [sn:%lli]\n",
420 inst->readPC(),inst->seqNum);
422 assert(!inst->isSquashed());
424 load_fault = inst->initiateAcc();
426 // If the instruction faulted, then we need to send it along to commit
427 // without the instruction completing.
428 if (load_fault != NoFault) {
429 // Send this instruction to commit, also make sure iew stage
430 // realizes there is activity.
431 // Mark it as executed unless it is an uncached load that
432 // needs to hit the head of commit.
433 if (!(inst->hasRequest() && inst->uncacheable()) ||
434 inst->isAtCommit()) {
437 iewStage->instToCommit(inst);
438 iewStage->activityThisCycle();
439 } else if (!loadBlocked()) {
440 assert(inst->effAddrValid);
441 int load_idx = inst->lqIdx;
443 while (load_idx != loadTail) {
444 // Really only need to check loads that have actually executed
446 // @todo: For now this is extra conservative, detecting a
447 // violation if the addresses match assuming all accesses
448 // are quad word accesses.
450 // @todo: Fix this, magic number being used here
451 if (loadQueue[load_idx]->effAddrValid &&
452 (loadQueue[load_idx]->effAddr >> 8) ==
453 (inst->effAddr >> 8)) {
454 // A load incorrectly passed this load. Squash and refetch.
455 // For now return a fault to show that it was unsuccessful.
456 DynInstPtr violator = loadQueue[load_idx];
457 if (!memDepViolator ||
458 (violator->seqNum < memDepViolator->seqNum)) {
459 memDepViolator = violator;
464 ++lsqMemOrderViolation;
466 return genMachineCheckFault();
476 template <class Impl>
478 LSQUnit<Impl>::executeStore(DynInstPtr &store_inst)
480 using namespace TheISA;
481 // Make sure that a store exists.
484 int store_idx = store_inst->sqIdx;
486 DPRINTF(LSQUnit, "Executing store PC %#x [sn:%lli]\n",
487 store_inst->readPC(), store_inst->seqNum);
489 assert(!store_inst->isSquashed());
491 // Check the recently completed loads to see if any match this store's
492 // address. If so, then we have a memory ordering violation.
493 int load_idx = store_inst->lqIdx;
495 Fault store_fault = store_inst->initiateAcc();
497 if (storeQueue[store_idx].size == 0) {
498 DPRINTF(LSQUnit,"Fault on Store PC %#x, [sn:%lli],Size = 0\n",
499 store_inst->readPC(),store_inst->seqNum);
504 assert(store_fault == NoFault);
506 if (store_inst->isStoreConditional()) {
507 // Store conditionals need to set themselves as able to
508 // writeback if we haven't had a fault by here.
509 storeQueue[store_idx].canWB = true;
514 assert(store_inst->effAddrValid);
515 while (load_idx != loadTail) {
516 // Really only need to check loads that have actually executed
517 // It's safe to check all loads because effAddr is set to
518 // InvalAddr when the dyn inst is created.
520 // @todo: For now this is extra conservative, detecting a
521 // violation if the addresses match assuming all accesses
522 // are quad word accesses.
524 // @todo: Fix this, magic number being used here
525 if (loadQueue[load_idx]->effAddrValid &&
526 (loadQueue[load_idx]->effAddr >> 8) ==
527 (store_inst->effAddr >> 8)) {
528 // A load incorrectly passed this store. Squash and refetch.
529 // For now return a fault to show that it was unsuccessful.
530 DynInstPtr violator = loadQueue[load_idx];
531 if (!memDepViolator ||
532 (violator->seqNum < memDepViolator->seqNum)) {
533 memDepViolator = violator;
538 ++lsqMemOrderViolation;
540 return genMachineCheckFault();
549 template <class Impl>
551 LSQUnit<Impl>::commitLoad()
553 assert(loadQueue[loadHead]);
555 DPRINTF(LSQUnit, "Committing head load instruction, PC %#x\n",
556 loadQueue[loadHead]->readPC());
558 loadQueue[loadHead] = NULL;
565 template <class Impl>
567 LSQUnit<Impl>::commitLoads(InstSeqNum &youngest_inst)
569 assert(loads == 0 || loadQueue[loadHead]);
571 while (loads != 0 && loadQueue[loadHead]->seqNum <= youngest_inst) {
576 template <class Impl>
578 LSQUnit<Impl>::commitStores(InstSeqNum &youngest_inst)
580 assert(stores == 0 || storeQueue[storeHead].inst);
582 int store_idx = storeHead;
584 while (store_idx != storeTail) {
585 assert(storeQueue[store_idx].inst);
586 // Mark any stores that are now committed and have not yet
587 // been marked as able to write back.
588 if (!storeQueue[store_idx].canWB) {
589 if (storeQueue[store_idx].inst->seqNum > youngest_inst) {
592 DPRINTF(LSQUnit, "Marking store as able to write back, PC "
594 storeQueue[store_idx].inst->readPC(),
595 storeQueue[store_idx].inst->seqNum);
597 storeQueue[store_idx].canWB = true;
602 incrStIdx(store_idx);
606 template <class Impl>
608 LSQUnit<Impl>::writebackStores()
610 while (storesToWB > 0 &&
611 storeWBIdx != storeTail &&
612 storeQueue[storeWBIdx].inst &&
613 storeQueue[storeWBIdx].canWB &&
614 usedPorts < cachePorts) {
616 if (isStoreBlocked || lsq->cacheBlocked()) {
617 DPRINTF(LSQUnit, "Unable to write back any more stores, cache"
622 // Store didn't write any data so no need to write it back to
624 if (storeQueue[storeWBIdx].size == 0) {
625 completeStore(storeWBIdx);
627 incrStIdx(storeWBIdx);
634 if (storeQueue[storeWBIdx].inst->isDataPrefetch()) {
635 incrStIdx(storeWBIdx);
640 assert(storeQueue[storeWBIdx].req);
641 assert(!storeQueue[storeWBIdx].committed);
643 DynInstPtr inst = storeQueue[storeWBIdx].inst;
645 Request *req = storeQueue[storeWBIdx].req;
646 storeQueue[storeWBIdx].committed = true;
648 assert(!inst->memData);
649 inst->memData = new uint8_t[64];
651 memcpy(inst->memData, storeQueue[storeWBIdx].data, req->getSize());
654 req->isSwap() ? MemCmd::SwapReq :
655 (req->isLLSC() ? MemCmd::StoreCondReq : MemCmd::WriteReq);
656 PacketPtr data_pkt = new Packet(req, command,
658 data_pkt->dataStatic(inst->memData);
660 LSQSenderState *state = new LSQSenderState;
661 state->isLoad = false;
662 state->idx = storeWBIdx;
664 data_pkt->senderState = state;
666 DPRINTF(LSQUnit, "D-Cache: Writing back store idx:%i PC:%#x "
667 "to Addr:%#x, data:%#x [sn:%lli]\n",
668 storeWBIdx, inst->readPC(),
669 req->getPaddr(), (int)*(inst->memData),
672 // @todo: Remove this SC hack once the memory system handles it.
673 if (inst->isStoreConditional()) {
674 // Disable recording the result temporarily. Writing to
675 // misc regs normally updates the result, but this is not
676 // the desired behavior when handling store conditionals.
677 inst->recordResult = false;
678 bool success = TheISA::handleLockedWrite(inst.get(), req);
679 inst->recordResult = true;
682 // Instantly complete this store.
683 DPRINTF(LSQUnit, "Store conditional [sn:%lli] failed. "
684 "Instantly completing it.\n",
686 WritebackEvent *wb = new WritebackEvent(inst, data_pkt, this);
687 cpu->schedule(wb, curTick + 1);
688 completeStore(storeWBIdx);
689 incrStIdx(storeWBIdx);
693 // Non-store conditionals do not need a writeback.
697 if (!dcachePort->sendTiming(data_pkt)) {
698 // Need to handle becoming blocked on a store.
699 DPRINTF(IEW, "D-Cache became blocked when writing [sn:%lli], will"
702 isStoreBlocked = true;
704 assert(retryPkt == NULL);
706 lsq->setRetryTid(lsqID);
708 storePostSend(data_pkt);
712 // Not sure this should set it to 0.
715 assert(stores >= 0 && storesToWB >= 0);
718 /*template <class Impl>
720 LSQUnit<Impl>::removeMSHR(InstSeqNum seqNum)
722 list<InstSeqNum>::iterator mshr_it = find(mshrSeqNums.begin(),
726 if (mshr_it != mshrSeqNums.end()) {
727 mshrSeqNums.erase(mshr_it);
728 DPRINTF(LSQUnit, "Removing MSHR. count = %i\n",mshrSeqNums.size());
732 template <class Impl>
734 LSQUnit<Impl>::squash(const InstSeqNum &squashed_num)
736 DPRINTF(LSQUnit, "Squashing until [sn:%lli]!"
737 "(Loads:%i Stores:%i)\n", squashed_num, loads, stores);
739 int load_idx = loadTail;
742 while (loads != 0 && loadQueue[load_idx]->seqNum > squashed_num) {
743 DPRINTF(LSQUnit,"Load Instruction PC %#x squashed, "
745 loadQueue[load_idx]->readPC(),
746 loadQueue[load_idx]->seqNum);
748 if (isStalled() && load_idx == stallingLoadIdx) {
750 stallingStoreIsn = 0;
754 // Clear the smart pointer to make sure it is decremented.
755 loadQueue[load_idx]->setSquashed();
756 loadQueue[load_idx] = NULL;
767 if (squashed_num < blockedLoadSeqNum) {
768 isLoadBlocked = false;
769 loadBlockedHandled = false;
770 blockedLoadSeqNum = 0;
774 if (memDepViolator && squashed_num < memDepViolator->seqNum) {
775 memDepViolator = NULL;
778 int store_idx = storeTail;
779 decrStIdx(store_idx);
781 while (stores != 0 &&
782 storeQueue[store_idx].inst->seqNum > squashed_num) {
783 // Instructions marked as can WB are already committed.
784 if (storeQueue[store_idx].canWB) {
788 DPRINTF(LSQUnit,"Store Instruction PC %#x squashed, "
789 "idx:%i [sn:%lli]\n",
790 storeQueue[store_idx].inst->readPC(),
791 store_idx, storeQueue[store_idx].inst->seqNum);
793 // I don't think this can happen. It should have been cleared
794 // by the stalling load.
796 storeQueue[store_idx].inst->seqNum == stallingStoreIsn) {
797 panic("Is stalled should have been cleared by stalling load!\n");
799 stallingStoreIsn = 0;
802 // Clear the smart pointer to make sure it is decremented.
803 storeQueue[store_idx].inst->setSquashed();
804 storeQueue[store_idx].inst = NULL;
805 storeQueue[store_idx].canWB = 0;
807 // Must delete request now that it wasn't handed off to
808 // memory. This is quite ugly. @todo: Figure out the proper
809 // place to really handle request deletes.
810 delete storeQueue[store_idx].req;
812 storeQueue[store_idx].req = NULL;
816 storeTail = store_idx;
818 decrStIdx(store_idx);
823 template <class Impl>
825 LSQUnit<Impl>::storePostSend(PacketPtr pkt)
828 storeQueue[storeWBIdx].inst->seqNum == stallingStoreIsn) {
829 DPRINTF(LSQUnit, "Unstalling, stalling store [sn:%lli] "
831 stallingStoreIsn, stallingLoadIdx);
833 stallingStoreIsn = 0;
834 iewStage->replayMemInst(loadQueue[stallingLoadIdx]);
837 if (!storeQueue[storeWBIdx].inst->isStoreConditional()) {
838 // The store is basically completed at this time. This
839 // only works so long as the checker doesn't try to
840 // verify the value in memory for stores.
841 storeQueue[storeWBIdx].inst->setCompleted();
844 cpu->checker->verify(storeQueue[storeWBIdx].inst);
849 incrStIdx(storeWBIdx);
852 template <class Impl>
854 LSQUnit<Impl>::writeback(DynInstPtr &inst, PacketPtr pkt)
858 // Squashed instructions do not need to complete their access.
859 if (inst->isSquashed()) {
860 iewStage->decrWb(inst->seqNum);
861 assert(!inst->isStore());
862 ++lsqIgnoredResponses;
866 if (!inst->isExecuted()) {
869 // Complete access to copy data to proper place.
870 inst->completeAcc(pkt);
873 // Need to insert instruction into queue to commit
874 iewStage->instToCommit(inst);
876 iewStage->activityThisCycle();
879 template <class Impl>
881 LSQUnit<Impl>::completeStore(int store_idx)
883 assert(storeQueue[store_idx].inst);
884 storeQueue[store_idx].completed = true;
886 // A bit conservative because a store completion may not free up entries,
887 // but hopefully avoids two store completions in one cycle from making
888 // the CPU tick twice.
890 cpu->activityThisCycle();
892 if (store_idx == storeHead) {
894 incrStIdx(storeHead);
897 } while (storeQueue[storeHead].completed &&
898 storeHead != storeTail);
900 iewStage->updateLSQNextCycle = true;
903 DPRINTF(LSQUnit, "Completing store [sn:%lli], idx:%i, store head "
905 storeQueue[store_idx].inst->seqNum, store_idx, storeHead);
908 storeQueue[store_idx].inst->seqNum == stallingStoreIsn) {
909 DPRINTF(LSQUnit, "Unstalling, stalling store [sn:%lli] "
911 stallingStoreIsn, stallingLoadIdx);
913 stallingStoreIsn = 0;
914 iewStage->replayMemInst(loadQueue[stallingLoadIdx]);
917 storeQueue[store_idx].inst->setCompleted();
919 // Tell the checker we've completed this instruction. Some stores
920 // may get reported twice to the checker, but the checker can
924 cpu->checker->verify(storeQueue[store_idx].inst);
929 template <class Impl>
931 LSQUnit<Impl>::recvRetry()
933 if (isStoreBlocked) {
934 DPRINTF(LSQUnit, "Receiving retry: store blocked\n");
935 assert(retryPkt != NULL);
937 if (dcachePort->sendTiming(retryPkt)) {
938 storePostSend(retryPkt);
940 isStoreBlocked = false;
941 lsq->setRetryTid(InvalidThreadID);
945 lsq->setRetryTid(lsqID);
947 } else if (isLoadBlocked) {
948 DPRINTF(LSQUnit, "Loads squash themselves and all younger insts, "
949 "no need to resend packet.\n");
951 DPRINTF(LSQUnit, "Retry received but LSQ is no longer blocked.\n");
955 template <class Impl>
957 LSQUnit<Impl>::incrStIdx(int &store_idx)
959 if (++store_idx >= SQEntries)
963 template <class Impl>
965 LSQUnit<Impl>::decrStIdx(int &store_idx)
968 store_idx += SQEntries;
971 template <class Impl>
973 LSQUnit<Impl>::incrLdIdx(int &load_idx)
975 if (++load_idx >= LQEntries)
979 template <class Impl>
981 LSQUnit<Impl>::decrLdIdx(int &load_idx)
984 load_idx += LQEntries;
987 template <class Impl>
989 LSQUnit<Impl>::dumpInsts()
991 cprintf("Load store queue: Dumping instructions.\n");
992 cprintf("Load queue size: %i\n", loads);
993 cprintf("Load queue: ");
995 int load_idx = loadHead;
997 while (load_idx != loadTail && loadQueue[load_idx]) {
998 cprintf("%#x ", loadQueue[load_idx]->readPC());
1000 incrLdIdx(load_idx);
1003 cprintf("Store queue size: %i\n", stores);
1004 cprintf("Store queue: ");
1006 int store_idx = storeHead;
1008 while (store_idx != storeTail && storeQueue[store_idx].inst) {
1009 cprintf("%#x ", storeQueue[store_idx].inst->readPC());
1011 incrStIdx(store_idx);