inorder cpu: add missing DPRINTF argument
[gem5.git] / src / cpu / ozone / simple_cpu_builder.cc
1 /*
2 * Copyright (c) 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;
9 * redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution;
12 * neither the name of the copyright holders nor the names of its
13 * contributors may be used to endorse or promote products derived from
14 * this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * Authors: Kevin Lim
29 */
30
31 #include <string>
32
33 #include "cpu/checker/cpu.hh"
34 #include "cpu/ozone/cpu_impl.hh"
35 #include "cpu/ozone/simple_impl.hh"
36 #include "cpu/ozone/simple_params.hh"
37 #include "cpu/inst_seq.hh"
38 #include "mem/cache/base.hh"
39 #include "sim/SimpleOzoneCPU.hh"
40 #include "sim/process.hh"
41 #include "sim/sim_object.hh"
42
43 template
44 class OzoneCPU<SimpleImpl>;
45
46 class SimpleOzoneCPU : public OzoneCPU<SimpleImpl>
47 {
48 public:
49 SimpleOzoneCPU(SimpleParams *p)
50 : OzoneCPU<SimpleImpl>(p)
51 { }
52 };
53
54 ////////////////////////////////////////////////////////////////////////
55 //
56 // OzoneCPU Simulation Object
57 //
58 SimpleOzoneCPU *
59 SimpleOzoneCPUParams::create()
60 {
61 SimpleOzoneCPU *cpu;
62
63 if (FullSystem) {
64 // Full-system only supports a single thread for the moment.
65 ThreadID actual_num_threads = 1;
66 } else {
67 // In non-full-system mode, we infer the number of threads from
68 // the workload if it's not explicitly specified.
69 ThreadID actual_num_threads =
70 numThreads.isValid() ? numThreads : workload.size();
71
72 if (workload.size() == 0) {
73 fatal("Must specify at least one workload!");
74 }
75 }
76
77 SimpleParams *params = new SimpleParams;
78
79 params->clock = clock;
80
81 params->name = name;
82 params->numberOfThreads = actual_num_threads;
83
84 params->itb = itb;
85 params->dtb = dtb;
86
87 params->system = system;
88 params->cpu_id = cpu_id;
89 params->workload = workload;
90
91 params->mem = mem;
92 params->checker = checker;
93 params->max_insts_any_thread = max_insts_any_thread;
94 params->max_insts_all_threads = max_insts_all_threads;
95 params->max_loads_any_thread = max_loads_any_thread;
96 params->max_loads_all_threads = max_loads_all_threads;
97
98 //
99 // Caches
100 //
101 params->icacheInterface = icache ? icache->getInterface() : NULL;
102 params->dcacheInterface = dcache ? dcache->getInterface() : NULL;
103 params->cachePorts = cachePorts;
104
105 params->width = width;
106 params->frontEndWidth = frontEndWidth;
107 params->backEndWidth = backEndWidth;
108 params->backEndSquashLatency = backEndSquashLatency;
109 params->backEndLatency = backEndLatency;
110 params->maxInstBufferSize = maxInstBufferSize;
111 params->numPhysicalRegs = numPhysIntRegs + numPhysFloatRegs;
112
113 params->decodeToFetchDelay = decodeToFetchDelay;
114 params->renameToFetchDelay = renameToFetchDelay;
115 params->iewToFetchDelay = iewToFetchDelay;
116 params->commitToFetchDelay = commitToFetchDelay;
117 params->fetchWidth = fetchWidth;
118
119 params->renameToDecodeDelay = renameToDecodeDelay;
120 params->iewToDecodeDelay = iewToDecodeDelay;
121 params->commitToDecodeDelay = commitToDecodeDelay;
122 params->fetchToDecodeDelay = fetchToDecodeDelay;
123 params->decodeWidth = decodeWidth;
124
125 params->iewToRenameDelay = iewToRenameDelay;
126 params->commitToRenameDelay = commitToRenameDelay;
127 params->decodeToRenameDelay = decodeToRenameDelay;
128 params->renameWidth = renameWidth;
129
130 params->commitToIEWDelay = commitToIEWDelay;
131 params->renameToIEWDelay = renameToIEWDelay;
132 params->issueToExecuteDelay = issueToExecuteDelay;
133 params->issueWidth = issueWidth;
134 params->executeWidth = executeWidth;
135 params->executeIntWidth = executeIntWidth;
136 params->executeFloatWidth = executeFloatWidth;
137 params->executeBranchWidth = executeBranchWidth;
138 params->executeMemoryWidth = executeMemoryWidth;
139
140 params->iewToCommitDelay = iewToCommitDelay;
141 params->renameToROBDelay = renameToROBDelay;
142 params->commitWidth = commitWidth;
143 params->squashWidth = squashWidth;
144
145 params->predType = predType;
146 params->localPredictorSize = localPredictorSize;
147 params->localCtrBits = localCtrBits;
148 params->localHistoryTableSize = localHistoryTableSize;
149 params->localHistoryBits = localHistoryBits;
150 params->globalPredictorSize = globalPredictorSize;
151 params->globalCtrBits = globalCtrBits;
152 params->globalHistoryBits = globalHistoryBits;
153 params->choicePredictorSize = choicePredictorSize;
154 params->choiceCtrBits = choiceCtrBits;
155
156 params->BTBEntries = BTBEntries;
157 params->BTBTagSize = BTBTagSize;
158
159 params->RASSize = RASSize;
160
161 params->LQEntries = LQEntries;
162 params->SQEntries = SQEntries;
163
164 params->SSITSize = SSITSize;
165 params->LFSTSize = LFSTSize;
166
167 params->numPhysIntRegs = numPhysIntRegs;
168 params->numPhysFloatRegs = numPhysFloatRegs;
169 params->numIQEntries = numIQEntries;
170 params->numROBEntries = numROBEntries;
171
172 params->decoupledFrontEnd = decoupledFrontEnd;
173 params->dispatchWidth = dispatchWidth;
174 params->wbWidth = wbWidth;
175
176 params->smtNumFetchingThreads = smtNumFetchingThreads;
177 params->smtFetchPolicy = smtFetchPolicy;
178 params->smtIQPolicy = smtIQPolicy;
179 params->smtLSQPolicy = smtLSQPolicy;
180 params->smtLSQThreshold = smtLSQThreshold;
181 params->smtROBPolicy = smtROBPolicy;
182 params->smtROBThreshold = smtROBThreshold;
183 params->smtCommitPolicy = smtCommitPolicy;
184
185 params->instShiftAmt = 2;
186
187 params->deferRegistration = defer_registration;
188
189 params->functionTrace = function_trace;
190 params->functionTraceStart = function_trace_start;
191
192 cpu = new SimpleOzoneCPU(params);
193
194 return cpu;
195 }