commit_impl.hh (4288:1fc3aa7ad095) commit_impl.hh (4318:eb4241362a80)
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
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.");
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
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.");
108// DPRINTF(Commit,"Commit Policy set to Round Robin.");
109 } else if (policy == "oldestready"){
110 commitPolicy = OldestReady;
111
109 } else if (policy == "oldestready"){
110 commitPolicy = OldestReady;
111
112 DPRINTF(Commit,"Commit Policy set to Oldest Ready.");
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{
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 DPRINTF(Commit, "Commit: Setting CPU pointer.\n");
233 cpu = cpu_ptr;
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{
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 DPRINTF(Commit, "Commit: Setting time buffer pointer.\n");
254 timeBuffer = tb_ptr;
255
256 // Setup wire to send information back to IEW.
257 toIEW = timeBuffer->getWire(0);
258
259 // Setup wire to read data from IEW (for the ROB).
260 robInfoFromIEW = timeBuffer->getWire(-iewToCommitDelay);
261}
262
263template <class Impl>
264void
265DefaultCommit<Impl>::setFetchQueue(TimeBuffer<FetchStruct> *fq_ptr)
266{
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{
267 DPRINTF(Commit, "Commit: Setting fetch queue pointer.\n");
268 fetchQueue = fq_ptr;
269
270 // Setup wire to get instructions from rename (for the ROB).
271 fromFetch = fetchQueue->getWire(-fetchToCommitDelay);
272}
273
274template <class Impl>
275void
276DefaultCommit<Impl>::setRenameQueue(TimeBuffer<RenameStruct> *rq_ptr)
277{
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{
278 DPRINTF(Commit, "Commit: Setting rename queue pointer.\n");
279 renameQueue = rq_ptr;
280
281 // Setup wire to get instructions from rename (for the ROB).
282 fromRename = renameQueue->getWire(-renameToROBDelay);
283}
284
285template <class Impl>
286void
287DefaultCommit<Impl>::setIEWQueue(TimeBuffer<IEWStruct> *iq_ptr)
288{
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{
289 DPRINTF(Commit, "Commit: Setting IEW queue pointer.\n");
290 iewQueue = iq_ptr;
291
292 // Setup wire to get instructions from IEW.
293 fromIEW = iewQueue->getWire(-iewToCommitDelay);
294}
295
296template <class Impl>
297void
298DefaultCommit<Impl>::setIEWStage(IEW *iew_stage)
299{
300 iewStage = iew_stage;
301}
302
303template<class Impl>
304void
305DefaultCommit<Impl>::setActiveThreads(std::list<unsigned> *at_ptr)
306{
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{
307 DPRINTF(Commit, "Commit: Setting active threads list pointer.\n");
308 activeThreads = at_ptr;
309}
310
311template <class Impl>
312void
313DefaultCommit<Impl>::setRenameMap(RenameMap rm_ptr[])
314{
303 activeThreads = at_ptr;
304}
305
306template <class Impl>
307void
308DefaultCommit<Impl>::setRenameMap(RenameMap rm_ptr[])
309{
315 DPRINTF(Commit, "Setting rename map pointers.\n");
316
317 for (int i=0; i < numThreads; i++) {
318 renameMap[i] = &rm_ptr[i];
319 }
320}
321
322template <class Impl>
323void
324DefaultCommit<Impl>::setROB(ROB *rob_ptr)
325{
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{
326 DPRINTF(Commit, "Commit: Setting ROB pointer.\n");
327 rob = rob_ptr;
328}
329
330template <class Impl>
331void
332DefaultCommit<Impl>::initStage()
333{
334 rob->setActiveThreads(activeThreads);

--- 1137 unchanged lines hidden ---
319 rob = rob_ptr;
320}
321
322template <class Impl>
323void
324DefaultCommit<Impl>::initStage()
325{
326 rob->setActiveThreads(activeThreads);

--- 1137 unchanged lines hidden ---