74,76c74
< ~LSQ() {
< if (thread) delete [] thread;
< }
---
> ~LSQ() { }
313,314c311,324
< /** The LSQ units for individual threads. */
< LSQUnit *thread;
---
> /** Transform a SMT sharing policy string into a LSQPolicy value. */
> static LSQPolicy readLSQPolicy(const std::string& policy) {
> std::string policy_ = policy;
> std::transform(policy_.begin(), policy_.end(), policy_.begin(),
> (int(*)(int)) tolower);
> if (policy_ == "dynamic") {
> return Dynamic;
> } else if (policy_ == "partitioned") {
> return Partitioned;
> } else if (policy_ == "threshold") {
> return Threshold;
> }
> assert(0 && "Invalid LSQ Sharing Policy.Options Are:{Dynamic,"
> "Partitioned, Threshold}");
315a326,350
> // Some compilers complain if there is no return.
> return Dynamic;
> }
>
> /** Auxiliary function to calculate per-thread max LSQ allocation limit.
> * Depending on a policy, number of entries and possibly number of threads
> * and threshold, this function calculates how many resources each thread
> * can occupy at most.
> */
> static uint32_t maxLSQAllocation(const LSQPolicy& pol, uint32_t entries,
> uint32_t numThreads, uint32_t SMTThreshold) {
> if (pol == Dynamic) {
> return entries;
> } else if (pol == Partitioned) {
> //@todo:make work if part_amt doesnt divide evenly.
> return entries / numThreads;
> } else if (pol == Threshold) {
> //Divide up by threshold amount
> //@todo: Should threads check the max and the total
> //amount of the LSQ
> return SMTThreshold;
> }
> return 0;
> }
>
329a365,367
> /** The LSQ units for individual threads. */
> std::vector<LSQUnit> thread;
>