commit_impl.hh (4318:eb4241362a80) | commit_impl.hh (4329:52057dbec096) |
---|---|
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; --- 57 unchanged lines hidden (view full) --- 66template <class Impl> 67const char * 68DefaultCommit<Impl>::TrapEvent::description() 69{ 70 return "Trap event"; 71} 72 73template <class Impl> | 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; --- 57 unchanged lines hidden (view full) --- 66template <class Impl> 67const char * 68DefaultCommit<Impl>::TrapEvent::description() 69{ 70 return "Trap event"; 71} 72 73template <class Impl> |
74DefaultCommit 75 : squashCounter(0), | 74DefaultCommit<Impl>::DefaultCommit(O3CPU *_cpu, Params *params) 75 : cpu(_cpu), 76 squashCounter(0), |
76 iewToCommitDelay(params->iewToCommitDelay), 77 commitToIEWDelay(params->commitToIEWDelay), 78 renameToROBDelay(params->renameToROBDelay), 79 fetchToCommitDelay(params->commitToFetchDelay), 80 renameWidth(params->renameWidth), 81 commitWidth(params->commitWidth), 82 numThreads(params->numberOfThreads), 83 drainPending(false), --- 7 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 | 77 iewToCommitDelay(params->iewToCommitDelay), 78 commitToIEWDelay(params->commitToIEWDelay), 79 renameToROBDelay(params->renameToROBDelay), 80 fetchToCommitDelay(params->commitToFetchDelay), 81 renameWidth(params->renameWidth), 82 commitWidth(params->commitWidth), 83 numThreads(params->numberOfThreads), 84 drainPending(false), --- 7 unchanged lines hidden (view full) --- 92 //Convert string to lowercase 93 std::transform(policy.begin(), policy.end(), policy.begin(), 94 (int(*)(int)) tolower); 95 96 //Assign commit policy 97 if (policy == "aggressive"){ 98 commitPolicy = Aggressive; 99 |
99// DPRINTF(Commit,"Commit Policy set to Aggressive."); | 100 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 | 101 } else if (policy == "roundrobin"){ 102 commitPolicy = RoundRobin; 103 104 //Set-Up Priority List 105 for (int tid=0; tid < numThreads; tid++) { 106 priority_list.push_back(tid); 107 } 108 |
108// DPRINTF(Commit,"Commit Policy set to Round Robin."); | 109 DPRINTF(Commit,"Commit Policy set to Round Robin."); |
109 } else if (policy == "oldestready"){ 110 commitPolicy = OldestReady; 111 | 110 } else if (policy == "oldestready"){ 111 commitPolicy = OldestReady; 112 |
112// DPRINTF(Commit,"Commit Policy set to Oldest Ready."); | 113 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; --- 101 unchanged lines hidden (view full) --- 222 commitEligibleSamples 223 .name(name() + ".COM:bw_lim_events") 224 .desc("number cycles where commit BW limit reached") 225 ; 226} 227 228template <class Impl> 229void | 114 } else { 115 assert(0 && "Invalid SMT Commit Policy. Options Are: {Aggressive," 116 "RoundRobin,OldestReady}"); 117 } 118 119 for (int i=0; i < numThreads; i++) { 120 commitStatus[i] = Idle; 121 changedROBNumEntries[i] = false; --- 101 unchanged lines hidden (view full) --- 223 commitEligibleSamples 224 .name(name() + ".COM:bw_lim_events") 225 .desc("number cycles where commit BW limit reached") 226 ; 227} 228 229template <class Impl> 230void |
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) --- 76 unchanged lines hidden (view full) --- 328 329 // Broadcast the number of free entries. 330 for (int i=0; i < numThreads; i++) { 331 toIEW->commitInfo[i].usedROB = true; 332 toIEW->commitInfo[i].freeROBEntries = rob->numFreeEntries(i); 333 toIEW->commitInfo[i].emptyROB = true; 334 } 335 | 231DefaultCommit<Impl>::setThreads(std::vector<Thread *> &threads) 232{ 233 thread = threads; 234} 235 236template <class Impl> 237void 238DefaultCommit<Impl>::setTimeBuffer(TimeBuffer<TimeStruct> *tb_ptr) --- 76 unchanged lines hidden (view full) --- 315 316 // Broadcast the number of free entries. 317 for (int i=0; i < numThreads; i++) { 318 toIEW->commitInfo[i].usedROB = true; 319 toIEW->commitInfo[i].freeROBEntries = rob->numFreeEntries(i); 320 toIEW->commitInfo[i].emptyROB = true; 321 } 322 |
323 // Commit must broadcast the number of free entries it has at the 324 // start of the simulation, so it starts as active. 325 cpu->activateStage(O3CPU::CommitIdx); 326 |
|
336 cpu->activityThisCycle(); | 327 cpu->activityThisCycle(); |
328 trapLatency = cpu->cycles(trapLatency); |
|
337} 338 339template <class Impl> 340bool 341DefaultCommit<Impl>::drain() 342{ 343 drainPending = true; 344 --- 1119 unchanged lines hidden --- | 329} 330 331template <class Impl> 332bool 333DefaultCommit<Impl>::drain() 334{ 335 drainPending = true; 336 --- 1119 unchanged lines hidden --- |