lsq_impl.hh (4192:7accc6365bb9) lsq_impl.hh (4318:eb4241362a80)
1/*
2 * Copyright (c) 2005-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;

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

107}
108
109template <class Impl>
110LSQ<Impl>::LSQ(Params *params)
111 : dcachePort(this), LQEntries(params->LQEntries),
112 SQEntries(params->SQEntries), numThreads(params->numberOfThreads),
113 retryTid(-1)
114{
1/*
2 * Copyright (c) 2005-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;

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

107}
108
109template <class Impl>
110LSQ<Impl>::LSQ(Params *params)
111 : dcachePort(this), LQEntries(params->LQEntries),
112 SQEntries(params->SQEntries), numThreads(params->numberOfThreads),
113 retryTid(-1)
114{
115 DPRINTF(LSQ, "Creating LSQ object.\n");
116
117 dcachePort.snoopRangeSent = false;
118
119 //**********************************************/
120 //************ Handle SMT Parameters ***********/
121 //**********************************************/
122 std::string policy = params->smtLSQPolicy;
123
124 //Convert string to lowercase
125 std::transform(policy.begin(), policy.end(), policy.begin(),
126 (int(*)(int)) tolower);
127
128 //Figure out fetch policy
129 if (policy == "dynamic") {
130 lsqPolicy = Dynamic;
131
132 maxLQEntries = LQEntries;
133 maxSQEntries = SQEntries;
115 dcachePort.snoopRangeSent = false;
116
117 //**********************************************/
118 //************ Handle SMT Parameters ***********/
119 //**********************************************/
120 std::string policy = params->smtLSQPolicy;
121
122 //Convert string to lowercase
123 std::transform(policy.begin(), policy.end(), policy.begin(),
124 (int(*)(int)) tolower);
125
126 //Figure out fetch policy
127 if (policy == "dynamic") {
128 lsqPolicy = Dynamic;
129
130 maxLQEntries = LQEntries;
131 maxSQEntries = SQEntries;
134
132/*
135 DPRINTF(LSQ, "LSQ sharing policy set to Dynamic\n");
133 DPRINTF(LSQ, "LSQ sharing policy set to Dynamic\n");
136
134*/
137 } else if (policy == "partitioned") {
138 lsqPolicy = Partitioned;
139
140 //@todo:make work if part_amt doesnt divide evenly.
141 maxLQEntries = LQEntries / numThreads;
142 maxSQEntries = SQEntries / numThreads;
135 } else if (policy == "partitioned") {
136 lsqPolicy = Partitioned;
137
138 //@todo:make work if part_amt doesnt divide evenly.
139 maxLQEntries = LQEntries / numThreads;
140 maxSQEntries = SQEntries / numThreads;
143
141/*
144 DPRINTF(Fetch, "LSQ sharing policy set to Partitioned: "
145 "%i entries per LQ | %i entries per SQ",
146 maxLQEntries,maxSQEntries);
142 DPRINTF(Fetch, "LSQ sharing policy set to Partitioned: "
143 "%i entries per LQ | %i entries per SQ",
144 maxLQEntries,maxSQEntries);
147
145*/
148 } else if (policy == "threshold") {
149 lsqPolicy = Threshold;
150
151 assert(params->smtLSQThreshold > LQEntries);
152 assert(params->smtLSQThreshold > SQEntries);
153
154 //Divide up by threshold amount
155 //@todo: Should threads check the max and the total
156 //amount of the LSQ
157 maxLQEntries = params->smtLSQThreshold;
158 maxSQEntries = params->smtLSQThreshold;
146 } else if (policy == "threshold") {
147 lsqPolicy = Threshold;
148
149 assert(params->smtLSQThreshold > LQEntries);
150 assert(params->smtLSQThreshold > SQEntries);
151
152 //Divide up by threshold amount
153 //@todo: Should threads check the max and the total
154 //amount of the LSQ
155 maxLQEntries = params->smtLSQThreshold;
156 maxSQEntries = params->smtLSQThreshold;
159
157/*
160 DPRINTF(LSQ, "LSQ sharing policy set to Threshold: "
161 "%i entries per LQ | %i entries per SQ",
162 maxLQEntries,maxSQEntries);
158 DPRINTF(LSQ, "LSQ sharing policy set to Threshold: "
159 "%i entries per LQ | %i entries per SQ",
160 maxLQEntries,maxSQEntries);
161*/
163
164 } else {
165 assert(0 && "Invalid LSQ Sharing Policy.Options Are:{Dynamic,"
166 "Partitioned, Threshold}");
167 }
168
169 //Initialize LSQs
170 for (int tid=0; tid < numThreads; tid++) {

--- 479 unchanged lines hidden ---
162
163 } else {
164 assert(0 && "Invalid LSQ Sharing Policy.Options Are:{Dynamic,"
165 "Partitioned, Threshold}");
166 }
167
168 //Initialize LSQs
169 for (int tid=0; tid < numThreads; tid++) {

--- 479 unchanged lines hidden ---