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; --- 141 unchanged lines hidden (view full) --- 150 tail = instList[0].end(); 151} 152 153template <class Impl> 154void 155ROB<Impl>::resetEntries() 156{ 157 if (robPolicy != Dynamic || numThreads > 1) { |
158 int active_threads = activeThreads->size(); |
159 |
160 std::list<unsigned>::iterator threads = activeThreads->begin(); 161 std::list<unsigned>::iterator end = activeThreads->end(); |
162 |
163 while (threads != end) { 164 unsigned tid = *threads++; 165 |
166 if (robPolicy == Partitioned) { |
167 maxEntries[tid] = numEntries / active_threads; |
168 } else if (robPolicy == Threshold && active_threads == 1) { |
169 maxEntries[tid] = numEntries; |
170 } 171 } 172 } 173} 174 175template <class Impl> 176int 177ROB<Impl>::entryAmount(int num_threads) --- 137 unchanged lines hidden (view full) --- 315 return false; 316} 317 318template <class Impl> 319bool 320ROB<Impl>::canCommit() 321{ 322 //@todo: set ActiveThreads through ROB or CPU |
323 std::list<unsigned>::iterator threads = activeThreads->begin(); 324 std::list<unsigned>::iterator end = activeThreads->end(); |
325 |
326 while (threads != end) { |
327 unsigned tid = *threads++; 328 329 if (isHeadReady(tid)) { 330 return true; 331 } 332 } 333 334 return false; --- 95 unchanged lines hidden (view full) --- 430void 431ROB<Impl>::updateHead() 432{ 433 DynInstPtr head_inst; 434 InstSeqNum lowest_num = 0; 435 bool first_valid = true; 436 437 // @todo: set ActiveThreads through ROB or CPU |
438 std::list<unsigned>::iterator threads = activeThreads->begin(); 439 std::list<unsigned>::iterator end = activeThreads->end(); |
440 |
441 while (threads != end) { 442 unsigned tid = *threads++; |
443 |
444 if (instList[tid].empty()) |
445 continue; 446 447 if (first_valid) { |
448 head = instList[tid].begin(); |
449 lowest_num = (*head)->seqNum; 450 first_valid = false; 451 continue; 452 } 453 |
454 InstIt head_thread = instList[tid].begin(); |
455 456 DynInstPtr head_inst = (*head_thread); 457 458 assert(head_inst != 0); 459 460 if (head_inst->seqNum < lowest_num) { 461 head = head_thread; 462 lowest_num = head_inst->seqNum; --- 8 unchanged lines hidden (view full) --- 471 472template <class Impl> 473void 474ROB<Impl>::updateTail() 475{ 476 tail = instList[0].end(); 477 bool first_valid = true; 478 |
479 std::list<unsigned>::iterator threads = activeThreads->begin(); 480 std::list<unsigned>::iterator end = activeThreads->end(); |
481 |
482 while (threads != end) { |
483 unsigned tid = *threads++; 484 485 if (instList[tid].empty()) { 486 continue; 487 } 488 489 // If this is the first valid then assign w/out 490 // comparison --- 211 unchanged lines hidden --- |