rob_impl.hh (7720:65d338a8dba4) | rob_impl.hh (7897:d9e8b1fd1a9f) |
---|---|
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; --- 190 unchanged lines hidden (view full) --- 199} 200 201template <class Impl> 202void 203ROB<Impl>::insertInst(DynInstPtr &inst) 204{ 205 assert(inst); 206 | 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; --- 190 unchanged lines hidden (view full) --- 199} 200 201template <class Impl> 202void 203ROB<Impl>::insertInst(DynInstPtr &inst) 204{ 205 assert(inst); 206 |
207 robWrites++; 208 |
|
207 DPRINTF(ROB, "Adding inst PC %s to the ROB.\n", inst->pcState()); 208 209 assert(numInstsInROB != numEntries); 210 211 ThreadID tid = inst->threadNumber; 212 213 instList[tid].push_back(inst); 214 --- 17 unchanged lines hidden (view full) --- 232 233 DPRINTF(ROB, "[tid:%i] Now has %d instructions.\n", tid, threadEntries[tid]); 234} 235 236template <class Impl> 237void 238ROB<Impl>::retireHead(ThreadID tid) 239{ | 209 DPRINTF(ROB, "Adding inst PC %s to the ROB.\n", inst->pcState()); 210 211 assert(numInstsInROB != numEntries); 212 213 ThreadID tid = inst->threadNumber; 214 215 instList[tid].push_back(inst); 216 --- 17 unchanged lines hidden (view full) --- 234 235 DPRINTF(ROB, "[tid:%i] Now has %d instructions.\n", tid, threadEntries[tid]); 236} 237 238template <class Impl> 239void 240ROB<Impl>::retireHead(ThreadID tid) 241{ |
242 robWrites++; 243 |
|
240 assert(numInstsInROB > 0); 241 242 // Get the head ROB instruction. 243 InstIt head_it = instList[tid].begin(); 244 245 DynInstPtr head_inst = (*head_it); 246 247 assert(head_inst->readyToCommit()); --- 18 unchanged lines hidden (view full) --- 266 // iterator will become invalidated. 267 cpu->removeFrontInst(head_inst); 268} 269 270template <class Impl> 271bool 272ROB<Impl>::isHeadReady(ThreadID tid) 273{ | 244 assert(numInstsInROB > 0); 245 246 // Get the head ROB instruction. 247 InstIt head_it = instList[tid].begin(); 248 249 DynInstPtr head_inst = (*head_it); 250 251 assert(head_inst->readyToCommit()); --- 18 unchanged lines hidden (view full) --- 270 // iterator will become invalidated. 271 cpu->removeFrontInst(head_inst); 272} 273 274template <class Impl> 275bool 276ROB<Impl>::isHeadReady(ThreadID tid) 277{ |
278 robReads++; |
|
274 if (threadEntries[tid] != 0) { 275 return instList[tid].front()->readyToCommit(); 276 } 277 278 return false; 279} 280 281template <class Impl> --- 28 unchanged lines hidden (view full) --- 310{ 311 return maxEntries[tid] - threadEntries[tid]; 312} 313 314template <class Impl> 315void 316ROB<Impl>::doSquash(ThreadID tid) 317{ | 279 if (threadEntries[tid] != 0) { 280 return instList[tid].front()->readyToCommit(); 281 } 282 283 return false; 284} 285 286template <class Impl> --- 28 unchanged lines hidden (view full) --- 315{ 316 return maxEntries[tid] - threadEntries[tid]; 317} 318 319template <class Impl> 320void 321ROB<Impl>::doSquash(ThreadID tid) 322{ |
323 robWrites++; |
|
318 DPRINTF(ROB, "[tid:%u]: Squashing instructions until [sn:%i].\n", 319 tid, squashedSeqNum[tid]); 320 321 assert(squashIt[tid] != instList[tid].end()); 322 323 if ((*squashIt[tid])->seqNum < squashedSeqNum[tid]) { 324 DPRINTF(ROB, "[tid:%u]: Done squashing instructions.\n", 325 tid); --- 192 unchanged lines hidden (view full) --- 518ROB<Impl>::readTailInst(ThreadID tid) 519{ 520 InstIt tail_thread = instList[tid].end(); 521 tail_thread--; 522 523 return *tail_thread; 524} 525 | 324 DPRINTF(ROB, "[tid:%u]: Squashing instructions until [sn:%i].\n", 325 tid, squashedSeqNum[tid]); 326 327 assert(squashIt[tid] != instList[tid].end()); 328 329 if ((*squashIt[tid])->seqNum < squashedSeqNum[tid]) { 330 DPRINTF(ROB, "[tid:%u]: Done squashing instructions.\n", 331 tid); --- 192 unchanged lines hidden (view full) --- 524ROB<Impl>::readTailInst(ThreadID tid) 525{ 526 InstIt tail_thread = instList[tid].end(); 527 tail_thread--; 528 529 return *tail_thread; 530} 531 |
532template <class Impl> 533void 534ROB<Impl>::regStats() 535{ 536 using namespace Stats; 537 robReads 538 .name(name() + ".rob_reads") 539 .desc("The number of ROB reads"); 540 541 robWrites 542 .name(name() + ".rob_writes") 543 .desc("The number of ROB writes"); 544} 545 |
|