rename_impl.hh (3788:5c804ea5cc48) | rename_impl.hh (3798:ec59feae527b) |
---|---|
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), | 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), |
|
47 numThreads(params->numberOfThreads), 48 maxPhysicalRegs(params->numPhysIntRegs + params->numPhysFloatRegs) 49{ 50 _status = Inactive; 51 52 for (int i=0; i< numThreads; i++) { 53 renameStatus[i] = Idle; 54 --- 345 unchanged lines hidden (view full) --- 400 while (slist_it != skidBuffer[tid].end()) { 401 if ((*slist_it)->seqNum > squash_seq_num) { 402 (*slist_it)->setSquashed(); 403 DPRINTF(Rename, "Squashing skidbuffer instruction, [tid:%i] [sn:%i]" 404 "PC %08p.\n", tid, (*slist_it)->seqNum, (*slist_it)->PC); 405 } 406 slist_it++; 407 } | 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"); |
|
408#else 409 skidBuffer[tid].clear(); 410#endif 411 doSquash(squash_seq_num, tid); 412} 413 414template <class Impl> 415void --- 75 unchanged lines hidden (view full) --- 491 // If we are currently in SerializeStall and resumeSerialize 492 // was set, then that means that we are resuming serializing 493 // this cycle. Tell the previous stages to block. 494 if (resumeSerialize) { 495 resumeSerialize = false; 496 block(tid); 497 toDecode->renameUnblock[tid] = false; 498 } | 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 } |
|
499 } 500 501 if (renameStatus[tid] == Running || 502 renameStatus[tid] == Idle) { 503 DPRINTF(Rename, "[tid:%u]: Not blocked, so attempting to run " 504 "stage.\n", tid); 505 506 renameInsts(tid); --- 249 unchanged lines hidden (view full) --- 756 "skidBuffer\n", tid, inst->seqNum, inst->readPC()); 757 758 ++renameSkidInsts; 759 760 skidBuffer[tid].push_back(inst); 761 } 762 763 if (skidBuffer[tid].size() > skidBufferMax) | 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 } |
|
764 panic("Skidbuffer Exceeded Max Size"); | 783 panic("Skidbuffer Exceeded Max Size"); |
784 } |
|
765} 766 767template <class Impl> 768void 769DefaultRename<Impl>::sortInsts() 770{ 771 int insts_from_decode = fromDecode->size; 772#ifdef DEBUG --- 70 unchanged lines hidden (view full) --- 843 844 // Add the current inputs onto the skid buffer, so they can be 845 // reprocessed when this stage unblocks. 846 skidInsert(tid); 847 848 // Only signal backwards to block if the previous stages do not think 849 // rename is already blocked. 850 if (renameStatus[tid] != Blocked) { | 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) { |
851 if (renameStatus[tid] != Unblocking) { | 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) { |
852 toDecode->renameBlock[tid] = true; 853 toDecode->renameUnblock[tid] = false; 854 wroteToTimeBuffer = true; 855 } 856 857 // Rename can not go from SerializeStall to Blocked, otherwise 858 // it would not know to complete the serialize stall. 859 if (renameStatus[tid] != SerializeStall) { --- 399 unchanged lines hidden (view full) --- 1259 unblock(tid); 1260 1261 return true; 1262 } 1263 1264 if (renameStatus[tid] == Squashing) { 1265 // Switch status to running if rename isn't being told to block or 1266 // squash this cycle. | 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. |
1267 if (!resumeSerialize) { 1268 DPRINTF(Rename, "[tid:%u]: Done squashing, switching to running.\n", 1269 tid); 1270 1271 renameStatus[tid] = Running; 1272 return false; 1273 } else { | 1290 if (resumeSerialize) { |
1274 DPRINTF(Rename, "[tid:%u]: Done squashing, switching to serialize.\n", 1275 tid); 1276 1277 renameStatus[tid] = SerializeStall; 1278 return true; | 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; |
|
1279 } 1280 } 1281 1282 if (renameStatus[tid] == SerializeStall) { 1283 // Stall ends once the ROB is free. 1284 DPRINTF(Rename, "[tid:%u]: Done with serialize stall, switching to " 1285 "unblocking.\n", tid); 1286 --- 86 unchanged lines hidden --- | 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 --- |