inst_queue_impl.hh (2935:d1223a6c9156) | inst_queue_impl.hh (2980:eab855f06b79) |
---|---|
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; --- 23 unchanged lines hidden (view full) --- 32#include <limits> 33#include <vector> 34 35#include "sim/root.hh" 36 37#include "cpu/o3/fu_pool.hh" 38#include "cpu/o3/inst_queue.hh" 39 | 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; --- 23 unchanged lines hidden (view full) --- 32#include <limits> 33#include <vector> 34 35#include "sim/root.hh" 36 37#include "cpu/o3/fu_pool.hh" 38#include "cpu/o3/inst_queue.hh" 39 |
40using namespace std; 41 | |
42template <class Impl> 43InstructionQueue<Impl>::FUCompletion::FUCompletion(DynInstPtr &_inst, 44 int fu_idx, 45 InstructionQueue<Impl> *iq_ptr) 46 : Event(&mainEventQueue, Stat_Event_Pri), 47 inst(_inst), fuIdx(fu_idx), iqPtr(iq_ptr), freeFU(false) 48{ 49 this->setFlags(Event::AutoDelete); --- 45 unchanged lines hidden (view full) --- 95 //Initialize Mem Dependence Units 96 for (int i = 0; i < numThreads; i++) { 97 memDepUnit[i].init(params,i); 98 memDepUnit[i].setIQ(this); 99 } 100 101 resetState(); 102 | 40template <class Impl> 41InstructionQueue<Impl>::FUCompletion::FUCompletion(DynInstPtr &_inst, 42 int fu_idx, 43 InstructionQueue<Impl> *iq_ptr) 44 : Event(&mainEventQueue, Stat_Event_Pri), 45 inst(_inst), fuIdx(fu_idx), iqPtr(iq_ptr), freeFU(false) 46{ 47 this->setFlags(Event::AutoDelete); --- 45 unchanged lines hidden (view full) --- 93 //Initialize Mem Dependence Units 94 for (int i = 0; i < numThreads; i++) { 95 memDepUnit[i].init(params,i); 96 memDepUnit[i].setIQ(this); 97 } 98 99 resetState(); 100 |
103 string policy = params->smtIQPolicy; | 101 std::string policy = params->smtIQPolicy; |
104 105 //Convert string to lowercase 106 std::transform(policy.begin(), policy.end(), policy.begin(), 107 (int(*)(int)) tolower); 108 109 //Figure out resource sharing policy 110 if (policy == "dynamic") { 111 iqPolicy = Dynamic; --- 162 unchanged lines hidden (view full) --- 274 issueDelayDist 275 .init(Num_OpClasses,0,99,2) 276 .name(name() + ".ISSUE:") 277 .desc("cycles from operands ready to issue") 278 .flags(pdf | cdf) 279 ; 280 281 for (int i=0; i<Num_OpClasses; ++i) { | 102 103 //Convert string to lowercase 104 std::transform(policy.begin(), policy.end(), policy.begin(), 105 (int(*)(int)) tolower); 106 107 //Figure out resource sharing policy 108 if (policy == "dynamic") { 109 iqPolicy = Dynamic; --- 162 unchanged lines hidden (view full) --- 272 issueDelayDist 273 .init(Num_OpClasses,0,99,2) 274 .name(name() + ".ISSUE:") 275 .desc("cycles from operands ready to issue") 276 .flags(pdf | cdf) 277 ; 278 279 for (int i=0; i<Num_OpClasses; ++i) { |
282 stringstream subname; | 280 std::stringstream subname; |
283 subname << opClassStrings[i] << "_delay"; 284 issueDelayDist.subname(i, subname.str()); 285 } 286 287 issueRate 288 .name(name() + ".ISSUE:rate") 289 .desc("Inst issue rate") 290 .flags(total) --- 63 unchanged lines hidden (view full) --- 354 readyIt[i] = listOrder.end(); 355 } 356 nonSpecInsts.clear(); 357 listOrder.clear(); 358} 359 360template <class Impl> 361void | 281 subname << opClassStrings[i] << "_delay"; 282 issueDelayDist.subname(i, subname.str()); 283 } 284 285 issueRate 286 .name(name() + ".ISSUE:rate") 287 .desc("Inst issue rate") 288 .flags(total) --- 63 unchanged lines hidden (view full) --- 352 readyIt[i] = listOrder.end(); 353 } 354 nonSpecInsts.clear(); 355 listOrder.clear(); 356} 357 358template <class Impl> 359void |
362InstructionQueue | 360InstructionQueue<Impl>::setActiveThreads(std::list<unsigned> *at_ptr) |
363{ 364 DPRINTF(IQ, "Setting active threads list pointer.\n"); 365 activeThreads = at_ptr; 366} 367 368template <class Impl> 369void 370InstructionQueue<Impl>::setIssueToExecuteQueue(TimeBuffer<IssueStruct> *i2e_ptr) --- 45 unchanged lines hidden (view full) --- 416 417template <class Impl> 418void 419InstructionQueue<Impl>::resetEntries() 420{ 421 if (iqPolicy != Dynamic || numThreads > 1) { 422 int active_threads = (*activeThreads).size(); 423 | 361{ 362 DPRINTF(IQ, "Setting active threads list pointer.\n"); 363 activeThreads = at_ptr; 364} 365 366template <class Impl> 367void 368InstructionQueue<Impl>::setIssueToExecuteQueue(TimeBuffer<IssueStruct> *i2e_ptr) --- 45 unchanged lines hidden (view full) --- 414 415template <class Impl> 416void 417InstructionQueue<Impl>::resetEntries() 418{ 419 if (iqPolicy != Dynamic || numThreads > 1) { 420 int active_threads = (*activeThreads).size(); 421 |
424 list 425 list | 422 std::list<unsigned>::iterator threads = (*activeThreads).begin(); 423 std::list<unsigned>::iterator list_end = (*activeThreads).end(); |
426 427 while (threads != list_end) { 428 if (iqPolicy == Partitioned) { 429 maxEntries[*threads++] = numEntries / active_threads; 430 } else if(iqPolicy == Threshold && active_threads == 1) { 431 maxEntries[*threads++] = numEntries; 432 } 433 } --- 962 unchanged lines hidden --- | 424 425 while (threads != list_end) { 426 if (iqPolicy == Partitioned) { 427 maxEntries[*threads++] = numEntries / active_threads; 428 } else if(iqPolicy == Threshold && active_threads == 1) { 429 maxEntries[*threads++] = numEntries; 430 } 431 } --- 962 unchanged lines hidden --- |