Deleted Added
sdiff udiff text old ( 13449:2f7efa89c58b ) new ( 13472:7ceacede4f1e )
full compact
1/*
2 * Copyright (c) 2011-2012, 2014 ARM Limited
3 * Copyright (c) 2013 Advanced Micro Devices, Inc.
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

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

56#include "debug/Writeback.hh"
57#include "params/DerivO3CPU.hh"
58
59using namespace std;
60
61template <class Impl>
62LSQ<Impl>::LSQ(O3CPU *cpu_ptr, IEW *iew_ptr, DerivO3CPUParams *params)
63 : cpu(cpu_ptr), iewStage(iew_ptr),
64 LQEntries(params->LQEntries),
65 SQEntries(params->SQEntries),
66 numThreads(params->numThreads)
67{
68 assert(numThreads > 0 && numThreads <= Impl::MaxThreads);
69
70 //**********************************************/
71 //************ Handle SMT Parameters ***********/
72 //**********************************************/
73 std::string policy = params->smtLSQPolicy;
74
75 //Convert string to lowercase
76 std::transform(policy.begin(), policy.end(), policy.begin(),
77 (int(*)(int)) tolower);
78
79 //Figure out fetch policy
80 if (policy == "dynamic") {
81 lsqPolicy = Dynamic;
82
83 maxLQEntries = LQEntries;
84 maxSQEntries = SQEntries;
85
86 DPRINTF(LSQ, "LSQ sharing policy set to Dynamic\n");
87 } else if (policy == "partitioned") {
88 lsqPolicy = Partitioned;
89
90 //@todo:make work if part_amt doesnt divide evenly.
91 maxLQEntries = LQEntries / numThreads;
92 maxSQEntries = SQEntries / numThreads;
93
94 DPRINTF(Fetch, "LSQ sharing policy set to Partitioned: "
95 "%i entries per LQ | %i entries per SQ\n",
96 maxLQEntries,maxSQEntries);
97 } else if (policy == "threshold") {
98 lsqPolicy = Threshold;
99
100 assert(params->smtLSQThreshold > LQEntries);
101 assert(params->smtLSQThreshold > SQEntries);
102
103 //Divide up by threshold amount
104 //@todo: Should threads check the max and the total
105 //amount of the LSQ
106 maxLQEntries = params->smtLSQThreshold;
107 maxSQEntries = params->smtLSQThreshold;
108
109 DPRINTF(LSQ, "LSQ sharing policy set to Threshold: "
110 "%i entries per LQ | %i entries per SQ\n",
111 maxLQEntries,maxSQEntries);
112 } else {
113 panic("Invalid LSQ sharing policy. Options are: Dynamic, "
114 "Partitioned, Threshold");
115 }
116
117 //Initialize LSQs
118 thread = new LSQUnit[numThreads];
119 for (ThreadID tid = 0; tid < numThreads; tid++) {
120 thread[tid].init(cpu, iew_ptr, params, this,
121 maxLQEntries, maxSQEntries, tid);
122 thread[tid].setDcachePort(&cpu_ptr->getDataPort());
123 }
124}
125
126
127template<class Impl>
128std::string
129LSQ<Impl>::name() const

--- 573 unchanged lines hidden ---