Deleted Added
sdiff udiff text old ( 4192:7accc6365bb9 ) new ( 4318:eb4241362a80 )
full compact
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;
134
135 DPRINTF(LSQ, "LSQ sharing policy set to Dynamic\n");
136
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;
143
144 DPRINTF(Fetch, "LSQ sharing policy set to Partitioned: "
145 "%i entries per LQ | %i entries per SQ",
146 maxLQEntries,maxSQEntries);
147
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;
159
160 DPRINTF(LSQ, "LSQ sharing policy set to Threshold: "
161 "%i entries per LQ | %i entries per SQ",
162 maxLQEntries,maxSQEntries);
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 ---