2 * Copyright (c) 2006 The Regents of The University of Michigan
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.
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.
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"
44 class OzoneCPU
<SimpleImpl
>;
46 class SimpleOzoneCPU
: public OzoneCPU
<SimpleImpl
>
49 SimpleOzoneCPU(SimpleParams
*p
)
50 : OzoneCPU
<SimpleImpl
>(p
)
54 ////////////////////////////////////////////////////////////////////////
56 // OzoneCPU Simulation Object
59 SimpleOzoneCPUParams::create()
64 // Full-system only supports a single thread for the moment.
65 ThreadID actual_num_threads
= 1;
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();
72 if (workload
.size() == 0) {
73 fatal("Must specify at least one workload!");
77 SimpleParams
*params
= new SimpleParams
;
79 params
->clock
= clock
;
82 params
->numberOfThreads
= actual_num_threads
;
87 params
->system
= system
;
88 params
->cpu_id
= cpu_id
;
89 params
->workload
= workload
;
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
;
101 params
->icacheInterface
= icache
? icache
->getInterface() : NULL
;
102 params
->dcacheInterface
= dcache
? dcache
->getInterface() : NULL
;
103 params
->cachePorts
= cachePorts
;
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
;
113 params
->decodeToFetchDelay
= decodeToFetchDelay
;
114 params
->renameToFetchDelay
= renameToFetchDelay
;
115 params
->iewToFetchDelay
= iewToFetchDelay
;
116 params
->commitToFetchDelay
= commitToFetchDelay
;
117 params
->fetchWidth
= fetchWidth
;
119 params
->renameToDecodeDelay
= renameToDecodeDelay
;
120 params
->iewToDecodeDelay
= iewToDecodeDelay
;
121 params
->commitToDecodeDelay
= commitToDecodeDelay
;
122 params
->fetchToDecodeDelay
= fetchToDecodeDelay
;
123 params
->decodeWidth
= decodeWidth
;
125 params
->iewToRenameDelay
= iewToRenameDelay
;
126 params
->commitToRenameDelay
= commitToRenameDelay
;
127 params
->decodeToRenameDelay
= decodeToRenameDelay
;
128 params
->renameWidth
= renameWidth
;
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
;
140 params
->iewToCommitDelay
= iewToCommitDelay
;
141 params
->renameToROBDelay
= renameToROBDelay
;
142 params
->commitWidth
= commitWidth
;
143 params
->squashWidth
= squashWidth
;
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
;
156 params
->BTBEntries
= BTBEntries
;
157 params
->BTBTagSize
= BTBTagSize
;
159 params
->RASSize
= RASSize
;
161 params
->LQEntries
= LQEntries
;
162 params
->SQEntries
= SQEntries
;
164 params
->SSITSize
= SSITSize
;
165 params
->LFSTSize
= LFSTSize
;
167 params
->numPhysIntRegs
= numPhysIntRegs
;
168 params
->numPhysFloatRegs
= numPhysFloatRegs
;
169 params
->numIQEntries
= numIQEntries
;
170 params
->numROBEntries
= numROBEntries
;
172 params
->decoupledFrontEnd
= decoupledFrontEnd
;
173 params
->dispatchWidth
= dispatchWidth
;
174 params
->wbWidth
= wbWidth
;
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
;
185 params
->instShiftAmt
= 2;
187 params
->deferRegistration
= defer_registration
;
189 params
->functionTrace
= function_trace
;
190 params
->functionTraceStart
= function_trace_start
;
192 cpu
= new SimpleOzoneCPU(params
);