Deleted Added
sdiff udiff text old ( 3732:e84a6e9ebd3d ) new ( 3771:808a4c19cf34 )
full compact
1/*
2 * Copyright (c) 2004-2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
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;

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

476 "[sn:%i].\n", tid, inst->readPC(), inst->seqNum);
477
478 toCommit->squash[tid] = true;
479 toCommit->squashedSeqNum[tid] = inst->seqNum;
480 toCommit->mispredPC[tid] = inst->readPC();
481 toCommit->branchMispredict[tid] = true;
482
483#if ISA_HAS_DELAY_SLOT
484 bool branch_taken = inst->readNextNPC() !=
485 (inst->readNextPC() + sizeof(TheISA::MachInst));
486
487 toCommit->branchTaken[tid] = branch_taken;
488
489 toCommit->condDelaySlotBranch[tid] = inst->isCondDelaySlot();
490
491 if (inst->isCondDelaySlot() && branch_taken) {
492 toCommit->nextPC[tid] = inst->readNextPC();
493 } else {
494 toCommit->nextPC[tid] = inst->readNextNPC();
495 }
496#else
497 toCommit->branchTaken[tid] = inst->readNextPC() !=
498 (inst->readPC() + sizeof(TheISA::MachInst));
499 toCommit->nextPC[tid] = inst->readNextPC();
500#endif
501
502 toCommit->includeSquashInst[tid] = false;
503

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

509DefaultIEW<Impl>::squashDueToMemOrder(DynInstPtr &inst, unsigned tid)
510{
511 DPRINTF(IEW, "[tid:%i]: Squashing from a specific instruction, "
512 "PC: %#x [sn:%i].\n", tid, inst->readPC(), inst->seqNum);
513
514 toCommit->squash[tid] = true;
515 toCommit->squashedSeqNum[tid] = inst->seqNum;
516 toCommit->nextPC[tid] = inst->readNextPC();
517 toCommit->branchMispredict[tid] = false;
518
519 toCommit->includeSquashInst[tid] = false;
520
521 wroteToTimeBuffer = true;
522}
523
524template<class Impl>
525void
526DefaultIEW<Impl>::squashDueToMemBlocked(DynInstPtr &inst, unsigned tid)
527{
528 DPRINTF(IEW, "[tid:%i]: Memory blocked, squashing load and younger insts, "
529 "PC: %#x [sn:%i].\n", tid, inst->readPC(), inst->seqNum);
530
531 toCommit->squash[tid] = true;
532 toCommit->squashedSeqNum[tid] = inst->seqNum;
533 toCommit->nextPC[tid] = inst->readPC();
534 toCommit->branchMispredict[tid] = false;
535
536 // Must include the broadcasted SN in the squash.
537 toCommit->includeSquashInst[tid] = true;
538
539 ldstQueue.setLoadBlockedHandled(tid);
540
541 wroteToTimeBuffer = true;
542}

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

1288 // If the store had a fault then it may not have a mem req
1289 if (!inst->isStoreConditional() && fault == NoFault) {
1290 inst->setExecuted();
1291
1292 instToCommit(inst);
1293 } else if (fault != NoFault) {
1294 // If the instruction faulted, then we need to send it along to commit
1295 // without the instruction completing.
1296 DPRINTF(IEW, "Store has fault %s! [sn:%lli]\n",
1297 fault->name(), inst->seqNum);
1298
1299 // Send this instruction to commit, also make sure iew stage
1300 // realizes there is activity.
1301 inst->setExecuted();
1302
1303 instToCommit(inst);
1304 activityThisCycle();
1305 }

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

1326 // handle this if there hasn't already been something that
1327 // redirects fetch in this group of instructions.
1328
1329 // This probably needs to prioritize the redirects if a different
1330 // scheduler is used. Currently the scheduler schedules the oldest
1331 // instruction first, so the branch resolution order will be correct.
1332 unsigned tid = inst->threadNumber;
1333
1334 if (!fetchRedirect[tid] ||
1335 toCommit->squashedSeqNum[tid] > inst->seqNum) {
1336
1337 if (inst->mispredicted()) {
1338 fetchRedirect[tid] = true;
1339
1340 DPRINTF(IEW, "Execute: Branch mispredict detected.\n");
1341#if ISA_HAS_DELAY_SLOT
1342 DPRINTF(IEW, "Execute: Redirecting fetch to PC: %#x.\n",
1343 inst->nextNPC);

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

1349 squashDueToBranch(inst, tid);
1350
1351 if (inst->predTaken()) {
1352 predictedTakenIncorrect++;
1353 } else {
1354 predictedNotTakenIncorrect++;
1355 }
1356 } else if (ldstQueue.violation(tid)) {
1357 // If there was an ordering violation, then get the
1358 // DynInst that caused the violation. Note that this
1359 // clears the violation signal.
1360 DynInstPtr violator;
1361 violator = ldstQueue.getMemDepViolator(tid);
1362
1363 DPRINTF(IEW, "LDSTQ detected a violation. Violator PC: "
1364 "%#x, inst PC: %#x. Addr is: %#x.\n",
1365 violator->readPC(), inst->readPC(), inst->physEffAddr);
1366
1367 // Ensure the violating instruction is older than
1368 // current squash
1369 if (fetchRedirect[tid] &&
1370 violator->seqNum >= toCommit->squashedSeqNum[tid])
1371 continue;
1372
1373 fetchRedirect[tid] = true;
1374
1375 // Tell the instruction queue that a violation has occured.
1376 instQueue.violation(inst, violator);
1377
1378 // Squash.
1379 squashDueToMemOrder(inst,tid);
1380
1381 ++memOrderViolationEvents;
1382 } else if (ldstQueue.loadBlocked(tid) &&

--- 231 unchanged lines hidden ---