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; --- 30 unchanged lines hidden (view full) --- 39template <class Impl> 40DefaultRename<Impl>::DefaultRename(Params *params) 41 : iewToRenameDelay(params->iewToRenameDelay), 42 decodeToRenameDelay(params->decodeToRenameDelay), 43 commitToRenameDelay(params->commitToRenameDelay), 44 renameWidth(params->renameWidth), 45 commitWidth(params->commitWidth), 46 resumeSerialize(false), |
47 resumeUnblocking(false), |
48 numThreads(params->numberOfThreads), 49 maxPhysicalRegs(params->numPhysIntRegs + params->numPhysFloatRegs) 50{ 51 _status = Inactive; 52 53 for (int i=0; i< numThreads; i++) { 54 renameStatus[i] = Idle; 55 --- 345 unchanged lines hidden (view full) --- 401 while (slist_it != skidBuffer[tid].end()) { 402 if ((*slist_it)->seqNum > squash_seq_num) { 403 (*slist_it)->setSquashed(); 404 DPRINTF(Rename, "Squashing skidbuffer instruction, [tid:%i] [sn:%i]" 405 "PC %08p.\n", tid, (*slist_it)->seqNum, (*slist_it)->PC); 406 } 407 slist_it++; 408 } |
409 resumeUnblocking = (skidBuffer[tid].size() != 0); 410 DPRINTF(Rename, "Resume unblocking set to %s\n", 411 resumeUnblocking ? "true" : "false"); |
412#else 413 skidBuffer[tid].clear(); 414#endif 415 doSquash(squash_seq_num, tid); 416} 417 418template <class Impl> 419void --- 75 unchanged lines hidden (view full) --- 495 // If we are currently in SerializeStall and resumeSerialize 496 // was set, then that means that we are resuming serializing 497 // this cycle. Tell the previous stages to block. 498 if (resumeSerialize) { 499 resumeSerialize = false; 500 block(tid); 501 toDecode->renameUnblock[tid] = false; 502 } |
503 } else if (renameStatus[tid] == Unblocking) { 504 if (resumeUnblocking) { 505 block(tid); 506 resumeUnblocking = false; 507 toDecode->renameUnblock[tid] = false; 508 } |
509 } 510 511 if (renameStatus[tid] == Running || 512 renameStatus[tid] == Idle) { 513 DPRINTF(Rename, "[tid:%u]: Not blocked, so attempting to run " 514 "stage.\n", tid); 515 516 renameInsts(tid); --- 249 unchanged lines hidden (view full) --- 766 "skidBuffer\n", tid, inst->seqNum, inst->readPC()); 767 768 ++renameSkidInsts; 769 770 skidBuffer[tid].push_back(inst); 771 } 772 773 if (skidBuffer[tid].size() > skidBufferMax) |
774 { 775 typename InstQueue::iterator it; 776 warn("Skidbuffer contents:\n"); 777 for(it = skidBuffer[tid].begin(); it != skidBuffer[tid].end(); it++) 778 { 779 warn("[tid:%u]: %s [sn:%i].\n", tid, 780 (*it)->staticInst->disassemble(inst->readPC()), 781 (*it)->seqNum); 782 } |
783 panic("Skidbuffer Exceeded Max Size"); |
784 } |
785} 786 787template <class Impl> 788void 789DefaultRename<Impl>::sortInsts() 790{ 791 int insts_from_decode = fromDecode->size; 792#ifdef DEBUG --- 70 unchanged lines hidden (view full) --- 863 864 // Add the current inputs onto the skid buffer, so they can be 865 // reprocessed when this stage unblocks. 866 skidInsert(tid); 867 868 // Only signal backwards to block if the previous stages do not think 869 // rename is already blocked. 870 if (renameStatus[tid] != Blocked) { |
871 // If resumeUnblocking is set, we unblocked during the squash, 872 // but now we're have unblocking status. We need to tell earlier 873 // stages to block. 874 if (resumeUnblocking || renameStatus[tid] != Unblocking) { |
875 toDecode->renameBlock[tid] = true; 876 toDecode->renameUnblock[tid] = false; 877 wroteToTimeBuffer = true; 878 } 879 880 // Rename can not go from SerializeStall to Blocked, otherwise 881 // it would not know to complete the serialize stall. 882 if (renameStatus[tid] != SerializeStall) { --- 399 unchanged lines hidden (view full) --- 1282 unblock(tid); 1283 1284 return true; 1285 } 1286 1287 if (renameStatus[tid] == Squashing) { 1288 // Switch status to running if rename isn't being told to block or 1289 // squash this cycle. |
1290 if (resumeSerialize) { |
1291 DPRINTF(Rename, "[tid:%u]: Done squashing, switching to serialize.\n", 1292 tid); 1293 1294 renameStatus[tid] = SerializeStall; 1295 return true; |
1296 } else if (resumeUnblocking) { 1297 DPRINTF(Rename, "[tid:%u]: Done squashing, switching to unblocking.\n", 1298 tid); 1299 renameStatus[tid] = Unblocking; 1300 return true; 1301 } else { 1302 DPRINTF(Rename, "[tid:%u]: Done squashing, switching to running.\n", 1303 tid); 1304 1305 renameStatus[tid] = Running; 1306 return false; |
1307 } 1308 } 1309 1310 if (renameStatus[tid] == SerializeStall) { 1311 // Stall ends once the ROB is free. 1312 DPRINTF(Rename, "[tid:%u]: Done with serialize stall, switching to " 1313 "unblocking.\n", tid); 1314 --- 86 unchanged lines hidden --- |