2 * Copyright (c) 2004-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 "config/full_system.hh"
34 #include "config/use_checker.hh"
35 #include "cpu/base.hh"
36 #include "cpu/o3/sparc/cpu.hh"
37 #include "cpu/o3/sparc/impl.hh"
38 #include "cpu/o3/sparc/params.hh"
39 #include "cpu/o3/fu_pool.hh"
40 #include "params/DerivO3CPU.hh"
42 class DerivO3CPU
: public SparcO3CPU
<SparcSimpleImpl
>
45 DerivO3CPU(SparcSimpleParams
*p
)
46 : SparcO3CPU
<SparcSimpleImpl
>(p
)
51 DerivO3CPUParams::create()
56 // Full-system only supports a single thread for the moment.
57 int actual_num_threads
= 1;
59 // In non-full-system mode, we infer the number of threads from
60 // the workload if it's not explicitly specified.
61 int actual_num_threads
=
62 (numThreads
>= workload
.size()) ? numThreads
: workload
.size();
64 if (workload
.size() == 0) {
65 fatal("Must specify at least one workload!");
69 SparcSimpleParams
*params
= new SparcSimpleParams
;
71 params
->clock
= clock
;
72 params
->phase
= phase
;
75 params
->numberOfThreads
= actual_num_threads
;
76 params
->cpu_id
= cpu_id
;
77 params
->activity
= activity
;
80 params
->system
= system
;
83 params
->profile
= profile
;
85 params
->do_quiesce
= do_quiesce
;
86 params
->do_checkpoint_insts
= do_checkpoint_insts
;
87 params
->do_statistics_insts
= do_statistics_insts
;
89 params
->workload
= workload
;
93 params
->checker
= checker
;
96 params
->max_insts_any_thread
= max_insts_any_thread
;
97 params
->max_insts_all_threads
= max_insts_all_threads
;
98 params
->max_loads_any_thread
= max_loads_any_thread
;
99 params
->max_loads_all_threads
= max_loads_all_threads
;
100 params
->progress_interval
= progress_interval
;
105 params
->cachePorts
= cachePorts
;
107 params
->decodeToFetchDelay
= decodeToFetchDelay
;
108 params
->renameToFetchDelay
= renameToFetchDelay
;
109 params
->iewToFetchDelay
= iewToFetchDelay
;
110 params
->commitToFetchDelay
= commitToFetchDelay
;
111 params
->fetchWidth
= fetchWidth
;
113 params
->renameToDecodeDelay
= renameToDecodeDelay
;
114 params
->iewToDecodeDelay
= iewToDecodeDelay
;
115 params
->commitToDecodeDelay
= commitToDecodeDelay
;
116 params
->fetchToDecodeDelay
= fetchToDecodeDelay
;
117 params
->decodeWidth
= decodeWidth
;
119 params
->iewToRenameDelay
= iewToRenameDelay
;
120 params
->commitToRenameDelay
= commitToRenameDelay
;
121 params
->decodeToRenameDelay
= decodeToRenameDelay
;
122 params
->renameWidth
= renameWidth
;
124 params
->commitToIEWDelay
= commitToIEWDelay
;
125 params
->renameToIEWDelay
= renameToIEWDelay
;
126 params
->issueToExecuteDelay
= issueToExecuteDelay
;
127 params
->dispatchWidth
= dispatchWidth
;
128 params
->issueWidth
= issueWidth
;
129 params
->wbWidth
= wbWidth
;
130 params
->wbDepth
= wbDepth
;
131 params
->fuPool
= fuPool
;
133 params
->iewToCommitDelay
= iewToCommitDelay
;
134 params
->renameToROBDelay
= renameToROBDelay
;
135 params
->commitWidth
= commitWidth
;
136 params
->squashWidth
= squashWidth
;
137 params
->trapLatency
= trapLatency
;
139 params
->backComSize
= backComSize
;
140 params
->forwardComSize
= forwardComSize
;
142 params
->predType
= predType
;
143 params
->localPredictorSize
= localPredictorSize
;
144 params
->localCtrBits
= localCtrBits
;
145 params
->localHistoryTableSize
= localHistoryTableSize
;
146 params
->localHistoryBits
= localHistoryBits
;
147 params
->globalPredictorSize
= globalPredictorSize
;
148 params
->globalCtrBits
= globalCtrBits
;
149 params
->globalHistoryBits
= globalHistoryBits
;
150 params
->choicePredictorSize
= choicePredictorSize
;
151 params
->choiceCtrBits
= choiceCtrBits
;
153 params
->BTBEntries
= BTBEntries
;
154 params
->BTBTagSize
= BTBTagSize
;
156 params
->RASSize
= RASSize
;
158 params
->LQEntries
= LQEntries
;
159 params
->SQEntries
= SQEntries
;
161 params
->SSITSize
= SSITSize
;
162 params
->LFSTSize
= LFSTSize
;
164 params
->numPhysIntRegs
= numPhysIntRegs
;
165 params
->numPhysFloatRegs
= numPhysFloatRegs
;
166 params
->numIQEntries
= numIQEntries
;
167 params
->numROBEntries
= numROBEntries
;
169 params
->smtNumFetchingThreads
= smtNumFetchingThreads
;
171 // Default smtFetchPolicy to "RoundRobin", if necessary.
172 std::string round_robin_policy
= "RoundRobin";
173 std::string single_thread
= "SingleThread";
175 if (actual_num_threads
> 1 && single_thread
.compare(smtFetchPolicy
) == 0)
176 params
->smtFetchPolicy
= round_robin_policy
;
178 params
->smtFetchPolicy
= smtFetchPolicy
;
180 params
->smtIQPolicy
= smtIQPolicy
;
181 params
->smtLSQPolicy
= smtLSQPolicy
;
182 params
->smtLSQThreshold
= smtLSQThreshold
;
183 params
->smtROBPolicy
= smtROBPolicy
;
184 params
->smtROBThreshold
= smtROBThreshold
;
185 params
->smtCommitPolicy
= smtCommitPolicy
;
187 params
->instShiftAmt
= 2;
189 params
->deferRegistration
= defer_registration
;
191 params
->functionTrace
= function_trace
;
192 params
->functionTraceStart
= function_trace_start
;
194 cpu
= new DerivO3CPU(params
);