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 |
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 |
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++; |
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++; |
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 |