commit_impl.hh (13453:4a7a060ea26e) commit_impl.hh (13563:68c171235dc5)
1/*
2 * Copyright 2014 Google, Inc.
3 * Copyright (c) 2010-2014, 2017 ARM Limited
4 * All rights reserved
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating

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

77{
78 // This will get reset by commit if it was switched out at the
79 // time of this event processing.
80 trapSquash[tid] = true;
81}
82
83template <class Impl>
84DefaultCommit<Impl>::DefaultCommit(O3CPU *_cpu, DerivO3CPUParams *params)
1/*
2 * Copyright 2014 Google, Inc.
3 * Copyright (c) 2010-2014, 2017 ARM Limited
4 * All rights reserved
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating

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

77{
78 // This will get reset by commit if it was switched out at the
79 // time of this event processing.
80 trapSquash[tid] = true;
81}
82
83template <class Impl>
84DefaultCommit<Impl>::DefaultCommit(O3CPU *_cpu, DerivO3CPUParams *params)
85 : cpu(_cpu),
85 : commitPolicy(params->smtCommitPolicy),
86 cpu(_cpu),
86 iewToCommitDelay(params->iewToCommitDelay),
87 commitToIEWDelay(params->commitToIEWDelay),
88 renameToROBDelay(params->renameToROBDelay),
89 fetchToCommitDelay(params->commitToFetchDelay),
90 renameWidth(params->renameWidth),
91 commitWidth(params->commitWidth),
92 numThreads(params->numThreads),
93 drainPending(false),

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

98{
99 if (commitWidth > Impl::MaxWidth)
100 fatal("commitWidth (%d) is larger than compiled limit (%d),\n"
101 "\tincrease MaxWidth in src/cpu/o3/impl.hh\n",
102 commitWidth, static_cast<int>(Impl::MaxWidth));
103
104 _status = Active;
105 _nextStatus = Inactive;
87 iewToCommitDelay(params->iewToCommitDelay),
88 commitToIEWDelay(params->commitToIEWDelay),
89 renameToROBDelay(params->renameToROBDelay),
90 fetchToCommitDelay(params->commitToFetchDelay),
91 renameWidth(params->renameWidth),
92 commitWidth(params->commitWidth),
93 numThreads(params->numThreads),
94 drainPending(false),

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

99{
100 if (commitWidth > Impl::MaxWidth)
101 fatal("commitWidth (%d) is larger than compiled limit (%d),\n"
102 "\tincrease MaxWidth in src/cpu/o3/impl.hh\n",
103 commitWidth, static_cast<int>(Impl::MaxWidth));
104
105 _status = Active;
106 _nextStatus = Inactive;
106 std::string policy = params->smtCommitPolicy;
107
107
108 //Convert string to lowercase
109 std::transform(policy.begin(), policy.end(), policy.begin(),
110 (int(*)(int)) tolower);
111
112 //Assign commit policy
113 if (policy == "aggressive"){
114 commitPolicy = Aggressive;
115
116 DPRINTF(Commit,"Commit Policy set to Aggressive.\n");
117 } else if (policy == "roundrobin"){
118 commitPolicy = RoundRobin;
119
108 if (commitPolicy == CommitPolicy::RoundRobin) {
120 //Set-Up Priority List
121 for (ThreadID tid = 0; tid < numThreads; tid++) {
122 priority_list.push_back(tid);
123 }
109 //Set-Up Priority List
110 for (ThreadID tid = 0; tid < numThreads; tid++) {
111 priority_list.push_back(tid);
112 }
124
125 DPRINTF(Commit,"Commit Policy set to Round Robin.\n");
126 } else if (policy == "oldestready"){
127 commitPolicy = OldestReady;
128
129 DPRINTF(Commit,"Commit Policy set to Oldest Ready.");
130 } else {
131 panic("Invalid SMT commit policy. Options are: Aggressive, "
132 "RoundRobin, OldestReady");
133 }
134
135 for (ThreadID tid = 0; tid < Impl::MaxThreads; tid++) {
136 commitStatus[tid] = Idle;
137 changedROBNumEntries[tid] = false;
138 trapSquash[tid] = false;
139 tcSquash[tid] = false;
140 squashAfterInst[tid] = nullptr;

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

1426////////////////////////////////////////
1427template <class Impl>
1428ThreadID
1429DefaultCommit<Impl>::getCommittingThread()
1430{
1431 if (numThreads > 1) {
1432 switch (commitPolicy) {
1433
113 }
114
115 for (ThreadID tid = 0; tid < Impl::MaxThreads; tid++) {
116 commitStatus[tid] = Idle;
117 changedROBNumEntries[tid] = false;
118 trapSquash[tid] = false;
119 tcSquash[tid] = false;
120 squashAfterInst[tid] = nullptr;

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

1406////////////////////////////////////////
1407template <class Impl>
1408ThreadID
1409DefaultCommit<Impl>::getCommittingThread()
1410{
1411 if (numThreads > 1) {
1412 switch (commitPolicy) {
1413
1434 case Aggressive:
1414 case CommitPolicy::Aggressive:
1435 //If Policy is Aggressive, commit will call
1436 //this function multiple times per
1437 //cycle
1438 return oldestReady();
1439
1415 //If Policy is Aggressive, commit will call
1416 //this function multiple times per
1417 //cycle
1418 return oldestReady();
1419
1440 case RoundRobin:
1420 case CommitPolicy::RoundRobin:
1441 return roundRobin();
1442
1421 return roundRobin();
1422
1443 case OldestReady:
1423 case CommitPolicy::OldestReady:
1444 return oldestReady();
1445
1446 default:
1447 return InvalidThreadID;
1448 }
1449 } else {
1450 assert(!activeThreads->empty());
1451 ThreadID tid = activeThreads->front();

--- 79 unchanged lines hidden ---
1424 return oldestReady();
1425
1426 default:
1427 return InvalidThreadID;
1428 }
1429 } else {
1430 assert(!activeThreads->empty());
1431 ThreadID tid = activeThreads->front();

--- 79 unchanged lines hidden ---