rob_impl.hh (2980:eab855f06b79) rob_impl.hh (3867:807483cfab77)
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) {
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();
158 int active_threads = activeThreads->size();
159
159
160 std::list<unsigned>::iterator threads = (*activeThreads).begin();
161 std::list<unsigned>::iterator list_end = (*activeThreads).end();
160 std::list<unsigned>::iterator threads = activeThreads->begin();
161 std::list<unsigned>::iterator end = activeThreads->end();
162
162
163 while (threads != list_end) {
163 while (threads != end) {
164 unsigned tid = *threads++;
165
164 if (robPolicy == Partitioned) {
166 if (robPolicy == Partitioned) {
165 maxEntries[*threads++] = numEntries / active_threads;
167 maxEntries[tid] = numEntries / active_threads;
166 } else if (robPolicy == Threshold && active_threads == 1) {
168 } else if (robPolicy == Threshold && active_threads == 1) {
167 maxEntries[*threads++] = numEntries;
169 maxEntries[tid] = numEntries;
168 }
169 }
170 }
171}
172
173template <class Impl>
174int
175ROB<Impl>::entryAmount(int num_threads)

--- 137 unchanged lines hidden (view full) ---

313 return false;
314}
315
316template <class Impl>
317bool
318ROB<Impl>::canCommit()
319{
320 //@todo: set ActiveThreads through ROB or CPU
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
321 std::list<unsigned>::iterator threads = (*activeThreads).begin();
323 std::list<unsigned>::iterator threads = activeThreads->begin();
324 std::list<unsigned>::iterator end = activeThreads->end();
322
325
323 while (threads != (*activeThreads).end()) {
326 while (threads != end) {
324 unsigned tid = *threads++;
325
326 if (isHeadReady(tid)) {
327 return true;
328 }
329 }
330
331 return false;

--- 95 unchanged lines hidden (view full) ---

427void
428ROB<Impl>::updateHead()
429{
430 DynInstPtr head_inst;
431 InstSeqNum lowest_num = 0;
432 bool first_valid = true;
433
434 // @todo: set ActiveThreads through ROB or CPU
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
435 std::list<unsigned>::iterator threads = (*activeThreads).begin();
438 std::list<unsigned>::iterator threads = activeThreads->begin();
439 std::list<unsigned>::iterator end = activeThreads->end();
436
440
437 while (threads != (*activeThreads).end()) {
438 unsigned thread_num = *threads++;
441 while (threads != end) {
442 unsigned tid = *threads++;
439
443
440 if (instList[thread_num].empty())
444 if (instList[tid].empty())
441 continue;
442
443 if (first_valid) {
445 continue;
446
447 if (first_valid) {
444 head = instList[thread_num].begin();
448 head = instList[tid].begin();
445 lowest_num = (*head)->seqNum;
446 first_valid = false;
447 continue;
448 }
449
449 lowest_num = (*head)->seqNum;
450 first_valid = false;
451 continue;
452 }
453
450 InstIt head_thread = instList[thread_num].begin();
454 InstIt head_thread = instList[tid].begin();
451
452 DynInstPtr head_inst = (*head_thread);
453
454 assert(head_inst != 0);
455
456 if (head_inst->seqNum < lowest_num) {
457 head = head_thread;
458 lowest_num = head_inst->seqNum;

--- 8 unchanged lines hidden (view full) ---

467
468template <class Impl>
469void
470ROB<Impl>::updateTail()
471{
472 tail = instList[0].end();
473 bool first_valid = true;
474
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
475 std::list<unsigned>::iterator threads = (*activeThreads).begin();
479 std::list<unsigned>::iterator threads = activeThreads->begin();
480 std::list<unsigned>::iterator end = activeThreads->end();
476
481
477 while (threads != (*activeThreads).end()) {
482 while (threads != end) {
478 unsigned tid = *threads++;
479
480 if (instList[tid].empty()) {
481 continue;
482 }
483
484 // If this is the first valid then assign w/out
485 // comparison

--- 211 unchanged lines hidden ---
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 ---