Deleted Added
sdiff udiff text old ( 10327:5b6279635c49 ) new ( 10333:6be8945d226b )
full compact
1
2/*
3 * Copyright (c) 2010-2013 ARM Limited
4 * Copyright (c) 2013 Advanced Micro Devices, Inc.
5 * All rights reserved
6 *
7 * The license below extends only to copyright in the software and shall
8 * not be construed as granting a license to any other intellectual
9 * property including but not limited to intellectual property relating
10 * to a hardware implementation of the functionality of the software
11 * licensed hereunder. You may use the software subject to the license

--- 82 unchanged lines hidden (view full) ---

94void
95LSQUnit<Impl>::completeDataAccess(PacketPtr pkt)
96{
97 LSQSenderState *state = dynamic_cast<LSQSenderState *>(pkt->senderState);
98 DynInstPtr inst = state->inst;
99 DPRINTF(IEW, "Writeback event [sn:%lli].\n", inst->seqNum);
100 DPRINTF(Activity, "Activity: Writeback event [sn:%lli].\n", inst->seqNum);
101
102 //iewStage->ldstQueue.removeMSHR(inst->threadNumber,inst->seqNum);
103
104 // If this is a split access, wait until all packets are received.
105 if (TheISA::HasUnalignedMemAcc && !state->complete()) {
106 delete pkt->req;
107 delete pkt;
108 return;
109 }
110

--- 24 unchanged lines hidden (view full) ---

135 delete state;
136 delete pkt->req;
137 delete pkt;
138}
139
140template <class Impl>
141LSQUnit<Impl>::LSQUnit()
142 : loads(0), stores(0), storesToWB(0), cacheBlockMask(0), stalled(false),
143 isStoreBlocked(false), isLoadBlocked(false),
144 loadBlockedHandled(false), storeInFlight(false), hasPendingPkt(false)
145{
146}
147
148template<class Impl>
149void
150LSQUnit<Impl>::init(O3CPU *cpu_ptr, IEW *iew_ptr, DerivO3CPUParams *params,
151 LSQ *lsq_ptr, unsigned maxLQEntries, unsigned maxSQEntries,
152 unsigned id)

--- 37 unchanged lines hidden (view full) ---

190
191 storeHead = storeWBIdx = storeTail = 0;
192
193 usedPorts = 0;
194
195 retryPkt = NULL;
196 memDepViolator = NULL;
197
198 blockedLoadSeqNum = 0;
199
200 stalled = false;
201 isLoadBlocked = false;
202 loadBlockedHandled = false;
203
204 cacheBlockMask = ~(cpu->cacheLineSize() - 1);
205}
206
207template<class Impl>
208std::string
209LSQUnit<Impl>::name() const
210{

--- 416 unchanged lines hidden (view full) ---

627 inst->seqNum,
628 (load_fault != NoFault ? "fault" : "predication"));
629 if (!(inst->hasRequest() && inst->uncacheable()) ||
630 inst->isAtCommit()) {
631 inst->setExecuted();
632 }
633 iewStage->instToCommit(inst);
634 iewStage->activityThisCycle();
635 } else if (!loadBlocked()) {
636 assert(inst->effAddrValid());
637 int load_idx = inst->lqIdx;
638 incrLdIdx(load_idx);
639
640 if (checkLoads)
641 return checkViolations(load_idx, inst);
642 }
643

--- 138 unchanged lines hidden (view full) ---

782
783 while (storesToWB > 0 &&
784 storeWBIdx != storeTail &&
785 storeQueue[storeWBIdx].inst &&
786 storeQueue[storeWBIdx].canWB &&
787 ((!needsTSO) || (!storeInFlight)) &&
788 usedPorts < cachePorts) {
789
790 if (isStoreBlocked || lsq->cacheBlocked()) {
791 DPRINTF(LSQUnit, "Unable to write back any more stores, cache"
792 " is blocked!\n");
793 break;
794 }
795
796 // Store didn't write any data so no need to write it back to
797 // memory.
798 if (storeQueue[storeWBIdx].size == 0) {

--- 220 unchanged lines hidden (view full) ---

1019
1020 // Inefficient!
1021 loadTail = load_idx;
1022
1023 decrLdIdx(load_idx);
1024 ++lsqSquashedLoads;
1025 }
1026
1027 if (isLoadBlocked) {
1028 if (squashed_num < blockedLoadSeqNum) {
1029 isLoadBlocked = false;
1030 loadBlockedHandled = false;
1031 blockedLoadSeqNum = 0;
1032 }
1033 }
1034
1035 if (memDepViolator && squashed_num < memDepViolator->seqNum) {
1036 memDepViolator = NULL;
1037 }
1038
1039 int store_idx = storeTail;
1040 decrStIdx(store_idx);
1041
1042 while (stores != 0 &&

--- 170 unchanged lines hidden (view full) ---

1213LSQUnit<Impl>::sendStore(PacketPtr data_pkt)
1214{
1215 if (!dcachePort->sendTimingReq(data_pkt)) {
1216 // Need to handle becoming blocked on a store.
1217 isStoreBlocked = true;
1218 ++lsqCacheBlocked;
1219 assert(retryPkt == NULL);
1220 retryPkt = data_pkt;
1221 lsq->setRetryTid(lsqID);
1222 return false;
1223 }
1224 return true;
1225}
1226
1227template <class Impl>
1228void
1229LSQUnit<Impl>::recvRetry()

--- 9 unchanged lines hidden (view full) ---

1239 // Don't finish the store unless this is the last packet.
1240 if (!TheISA::HasUnalignedMemAcc || !state->pktToSend ||
1241 state->pendingPacket == retryPkt) {
1242 state->pktToSend = false;
1243 storePostSend(retryPkt);
1244 }
1245 retryPkt = NULL;
1246 isStoreBlocked = false;
1247 lsq->setRetryTid(InvalidThreadID);
1248
1249 // Send any outstanding packet.
1250 if (TheISA::HasUnalignedMemAcc && state->pktToSend) {
1251 assert(state->pendingPacket);
1252 if (sendStore(state->pendingPacket)) {
1253 storePostSend(state->pendingPacket);
1254 }
1255 }
1256 } else {
1257 // Still blocked!
1258 ++lsqCacheBlocked;
1259 lsq->setRetryTid(lsqID);
1260 }
1261 } else if (isLoadBlocked) {
1262 DPRINTF(LSQUnit, "Loads squash themselves and all younger insts, "
1263 "no need to resend packet.\n");
1264 } else {
1265 DPRINTF(LSQUnit, "Retry received but LSQ is no longer blocked.\n");
1266 }
1267}
1268
1269template <class Impl>
1270inline void
1271LSQUnit<Impl>::incrStIdx(int &store_idx) const
1272{
1273 if (++store_idx >= SQEntries)

--- 61 unchanged lines hidden ---