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; --- 82 unchanged lines hidden (view full) --- 91 //Convert string to lowercase 92 std::transform(policy.begin(), policy.end(), policy.begin(), 93 (int(*)(int)) tolower); 94 95 //Assign commit policy 96 if (policy == "aggressive"){ 97 commitPolicy = Aggressive; 98 |
99// DPRINTF(Commit,"Commit Policy set to Aggressive."); |
100 } else if (policy == "roundrobin"){ 101 commitPolicy = RoundRobin; 102 103 //Set-Up Priority List 104 for (int tid=0; tid < numThreads; tid++) { 105 priority_list.push_back(tid); 106 } 107 |
108// DPRINTF(Commit,"Commit Policy set to Round Robin."); |
109 } else if (policy == "oldestready"){ 110 commitPolicy = OldestReady; 111 |
112// DPRINTF(Commit,"Commit Policy set to Oldest Ready."); |
113 } else { 114 assert(0 && "Invalid SMT Commit Policy. Options Are: {Aggressive," 115 "RoundRobin,OldestReady}"); 116 } 117 118 for (int i=0; i < numThreads; i++) { 119 commitStatus[i] = Idle; 120 changedROBNumEntries[i] = false; --- 103 unchanged lines hidden (view full) --- 224 .desc("number cycles where commit BW limit reached") 225 ; 226} 227 228template <class Impl> 229void 230DefaultCommit<Impl>::setCPU(O3CPU *cpu_ptr) 231{ |
232 cpu = cpu_ptr; |
233 DPRINTF(Commit, "Commit: Setting CPU pointer.\n"); |
234 235 // Commit must broadcast the number of free entries it has at the start of 236 // the simulation, so it starts as active. 237 cpu->activateStage(O3CPU::CommitIdx); 238 239 trapLatency = cpu->cycles(trapLatency); 240} 241 242template <class Impl> 243void 244DefaultCommit<Impl>::setThreads(std::vector<Thread *> &threads) 245{ 246 thread = threads; 247} 248 249template <class Impl> 250void 251DefaultCommit<Impl>::setTimeBuffer(TimeBuffer<TimeStruct> *tb_ptr) 252{ |
253 timeBuffer = tb_ptr; 254 255 // Setup wire to send information back to IEW. 256 toIEW = timeBuffer->getWire(0); 257 258 // Setup wire to read data from IEW (for the ROB). 259 robInfoFromIEW = timeBuffer->getWire(-iewToCommitDelay); 260} 261 262template <class Impl> 263void 264DefaultCommit<Impl>::setFetchQueue(TimeBuffer<FetchStruct> *fq_ptr) 265{ |
266 fetchQueue = fq_ptr; 267 268 // Setup wire to get instructions from rename (for the ROB). 269 fromFetch = fetchQueue->getWire(-fetchToCommitDelay); 270} 271 272template <class Impl> 273void 274DefaultCommit<Impl>::setRenameQueue(TimeBuffer<RenameStruct> *rq_ptr) 275{ |
276 renameQueue = rq_ptr; 277 278 // Setup wire to get instructions from rename (for the ROB). 279 fromRename = renameQueue->getWire(-renameToROBDelay); 280} 281 282template <class Impl> 283void 284DefaultCommit<Impl>::setIEWQueue(TimeBuffer<IEWStruct> *iq_ptr) 285{ |
286 iewQueue = iq_ptr; 287 288 // Setup wire to get instructions from IEW. 289 fromIEW = iewQueue->getWire(-iewToCommitDelay); 290} 291 292template <class Impl> 293void 294DefaultCommit<Impl>::setIEWStage(IEW *iew_stage) 295{ 296 iewStage = iew_stage; 297} 298 299template<class Impl> 300void 301DefaultCommit<Impl>::setActiveThreads(std::list<unsigned> *at_ptr) 302{ |
303 activeThreads = at_ptr; 304} 305 306template <class Impl> 307void 308DefaultCommit<Impl>::setRenameMap(RenameMap rm_ptr[]) 309{ |
310 for (int i=0; i < numThreads; i++) { 311 renameMap[i] = &rm_ptr[i]; 312 } 313} 314 315template <class Impl> 316void 317DefaultCommit<Impl>::setROB(ROB *rob_ptr) 318{ |
319 rob = rob_ptr; 320} 321 322template <class Impl> 323void 324DefaultCommit<Impl>::initStage() 325{ 326 rob->setActiveThreads(activeThreads); --- 1137 unchanged lines hidden --- |