4 #include "cpu/inst_seq.hh"
5 #include "cpu/ozone/cpu.hh"
6 #include "cpu/ozone/ozone_impl.hh"
7 #include "cpu/ozone/simple_impl.hh"
8 #include "cpu/ozone/simple_params.hh"
9 #include "mem/cache/base_cache.hh"
10 #include "sim/builder.hh"
11 #include "sim/process.hh"
12 #include "sim/sim_object.hh"
14 class DerivOzoneCPU
: public OzoneCPU
<OzoneImpl
>
17 DerivOzoneCPU(SimpleParams
*p
)
18 : OzoneCPU
<OzoneImpl
>(p
)
22 class SimpleOzoneCPU
: public OzoneCPU
<SimpleImpl
>
25 SimpleOzoneCPU(SimpleParams
*p
)
26 : OzoneCPU
<SimpleImpl
>(p
)
31 ////////////////////////////////////////////////////////////////////////
33 // OzoneCPU Simulation Object
36 BEGIN_DECLARE_SIM_OBJECT_PARAMS(DerivOzoneCPU
)
39 Param
<int> numThreads
;
42 SimObjectParam
<System
*> system
;
44 SimObjectParam
<AlphaITB
*> itb
;
45 SimObjectParam
<AlphaDTB
*> dtb
;
47 SimObjectVectorParam
<Process
*> workload
;
48 //SimObjectParam<PageTable *> page_table;
51 SimObjectParam
<FunctionalMemory
*> mem
;
53 Param
<Counter
> max_insts_any_thread
;
54 Param
<Counter
> max_insts_all_threads
;
55 Param
<Counter
> max_loads_any_thread
;
56 Param
<Counter
> max_loads_all_threads
;
58 SimObjectParam
<BaseCache
*> icache
;
59 SimObjectParam
<BaseCache
*> dcache
;
61 Param
<unsigned> cachePorts
;
62 Param
<unsigned> width
;
63 Param
<unsigned> frontEndWidth
;
64 Param
<unsigned> backEndWidth
;
65 Param
<unsigned> backEndSquashLatency
;
66 Param
<unsigned> backEndLatency
;
67 Param
<unsigned> maxInstBufferSize
;
68 Param
<unsigned> numPhysicalRegs
;
70 Param
<unsigned> decodeToFetchDelay
;
71 Param
<unsigned> renameToFetchDelay
;
72 Param
<unsigned> iewToFetchDelay
;
73 Param
<unsigned> commitToFetchDelay
;
74 Param
<unsigned> fetchWidth
;
76 Param
<unsigned> renameToDecodeDelay
;
77 Param
<unsigned> iewToDecodeDelay
;
78 Param
<unsigned> commitToDecodeDelay
;
79 Param
<unsigned> fetchToDecodeDelay
;
80 Param
<unsigned> decodeWidth
;
82 Param
<unsigned> iewToRenameDelay
;
83 Param
<unsigned> commitToRenameDelay
;
84 Param
<unsigned> decodeToRenameDelay
;
85 Param
<unsigned> renameWidth
;
87 Param
<unsigned> commitToIEWDelay
;
88 Param
<unsigned> renameToIEWDelay
;
89 Param
<unsigned> issueToExecuteDelay
;
90 Param
<unsigned> issueWidth
;
91 Param
<unsigned> executeWidth
;
92 Param
<unsigned> executeIntWidth
;
93 Param
<unsigned> executeFloatWidth
;
94 Param
<unsigned> executeBranchWidth
;
95 Param
<unsigned> executeMemoryWidth
;
97 Param
<unsigned> iewToCommitDelay
;
98 Param
<unsigned> renameToROBDelay
;
99 Param
<unsigned> commitWidth
;
100 Param
<unsigned> squashWidth
;
102 Param
<unsigned> localPredictorSize
;
103 Param
<unsigned> localCtrBits
;
104 Param
<unsigned> localHistoryTableSize
;
105 Param
<unsigned> localHistoryBits
;
106 Param
<unsigned> globalPredictorSize
;
107 Param
<unsigned> globalCtrBits
;
108 Param
<unsigned> globalHistoryBits
;
109 Param
<unsigned> choicePredictorSize
;
110 Param
<unsigned> choiceCtrBits
;
112 Param
<unsigned> BTBEntries
;
113 Param
<unsigned> BTBTagSize
;
115 Param
<unsigned> RASSize
;
117 Param
<unsigned> LQEntries
;
118 Param
<unsigned> SQEntries
;
119 Param
<unsigned> LFSTSize
;
120 Param
<unsigned> SSITSize
;
122 Param
<unsigned> numPhysIntRegs
;
123 Param
<unsigned> numPhysFloatRegs
;
124 Param
<unsigned> numIQEntries
;
125 Param
<unsigned> numROBEntries
;
127 Param
<bool> decoupledFrontEnd
;
128 Param
<int> dispatchWidth
;
131 Param
<unsigned> smtNumFetchingThreads
;
132 Param
<std::string
> smtFetchPolicy
;
133 Param
<std::string
> smtLSQPolicy
;
134 Param
<unsigned> smtLSQThreshold
;
135 Param
<std::string
> smtIQPolicy
;
136 Param
<unsigned> smtIQThreshold
;
137 Param
<std::string
> smtROBPolicy
;
138 Param
<unsigned> smtROBThreshold
;
139 Param
<std::string
> smtCommitPolicy
;
141 Param
<unsigned> instShiftAmt
;
143 Param
<bool> defer_registration
;
145 Param
<bool> function_trace
;
146 Param
<Tick
> function_trace_start
;
148 END_DECLARE_SIM_OBJECT_PARAMS(DerivOzoneCPU
)
150 BEGIN_INIT_SIM_OBJECT_PARAMS(DerivOzoneCPU
)
152 INIT_PARAM(clock
, "clock speed"),
153 INIT_PARAM(numThreads
, "number of HW thread contexts"),
156 INIT_PARAM(system
, "System object"),
157 INIT_PARAM(cpu_id
, "processor ID"),
158 INIT_PARAM(itb
, "Instruction translation buffer"),
159 INIT_PARAM(dtb
, "Data translation buffer"),
161 INIT_PARAM(workload
, "Processes to run"),
162 // INIT_PARAM(page_table, "Page table"),
163 #endif // FULL_SYSTEM
165 INIT_PARAM_DFLT(mem
, "Memory", NULL
),
167 INIT_PARAM_DFLT(max_insts_any_thread
,
168 "Terminate when any thread reaches this inst count",
170 INIT_PARAM_DFLT(max_insts_all_threads
,
171 "Terminate when all threads have reached"
174 INIT_PARAM_DFLT(max_loads_any_thread
,
175 "Terminate when any thread reaches this load count",
177 INIT_PARAM_DFLT(max_loads_all_threads
,
178 "Terminate when all threads have reached this load"
182 INIT_PARAM_DFLT(icache
, "L1 instruction cache", NULL
),
183 INIT_PARAM_DFLT(dcache
, "L1 data cache", NULL
),
185 INIT_PARAM_DFLT(cachePorts
, "Cache Ports", 200),
186 INIT_PARAM_DFLT(width
, "Width", 1),
187 INIT_PARAM_DFLT(frontEndWidth
, "Front end width", 1),
188 INIT_PARAM_DFLT(backEndWidth
, "Back end width", 1),
189 INIT_PARAM_DFLT(backEndSquashLatency
, "Back end squash latency", 1),
190 INIT_PARAM_DFLT(backEndLatency
, "Back end latency", 1),
191 INIT_PARAM_DFLT(maxInstBufferSize
, "Maximum instruction buffer size", 16),
192 INIT_PARAM(numPhysicalRegs
, "Number of physical registers"),
194 INIT_PARAM(decodeToFetchDelay
, "Decode to fetch delay"),
195 INIT_PARAM(renameToFetchDelay
, "Rename to fetch delay"),
196 INIT_PARAM(iewToFetchDelay
, "Issue/Execute/Writeback to fetch"
198 INIT_PARAM(commitToFetchDelay
, "Commit to fetch delay"),
199 INIT_PARAM(fetchWidth
, "Fetch width"),
200 INIT_PARAM(renameToDecodeDelay
, "Rename to decode delay"),
201 INIT_PARAM(iewToDecodeDelay
, "Issue/Execute/Writeback to decode"
203 INIT_PARAM(commitToDecodeDelay
, "Commit to decode delay"),
204 INIT_PARAM(fetchToDecodeDelay
, "Fetch to decode delay"),
205 INIT_PARAM(decodeWidth
, "Decode width"),
207 INIT_PARAM(iewToRenameDelay
, "Issue/Execute/Writeback to rename"
209 INIT_PARAM(commitToRenameDelay
, "Commit to rename delay"),
210 INIT_PARAM(decodeToRenameDelay
, "Decode to rename delay"),
211 INIT_PARAM(renameWidth
, "Rename width"),
213 INIT_PARAM(commitToIEWDelay
, "Commit to "
214 "Issue/Execute/Writeback delay"),
215 INIT_PARAM(renameToIEWDelay
, "Rename to "
216 "Issue/Execute/Writeback delay"),
217 INIT_PARAM(issueToExecuteDelay
, "Issue to execute delay (internal"
218 "to the IEW stage)"),
219 INIT_PARAM(issueWidth
, "Issue width"),
220 INIT_PARAM(executeWidth
, "Execute width"),
221 INIT_PARAM(executeIntWidth
, "Integer execute width"),
222 INIT_PARAM(executeFloatWidth
, "Floating point execute width"),
223 INIT_PARAM(executeBranchWidth
, "Branch execute width"),
224 INIT_PARAM(executeMemoryWidth
, "Memory execute width"),
226 INIT_PARAM(iewToCommitDelay
, "Issue/Execute/Writeback to commit "
228 INIT_PARAM(renameToROBDelay
, "Rename to reorder buffer delay"),
229 INIT_PARAM(commitWidth
, "Commit width"),
230 INIT_PARAM(squashWidth
, "Squash width"),
232 INIT_PARAM(localPredictorSize
, "Size of local predictor"),
233 INIT_PARAM(localCtrBits
, "Bits per counter"),
234 INIT_PARAM(localHistoryTableSize
, "Size of local history table"),
235 INIT_PARAM(localHistoryBits
, "Bits for the local history"),
236 INIT_PARAM(globalPredictorSize
, "Size of global predictor"),
237 INIT_PARAM(globalCtrBits
, "Bits per counter"),
238 INIT_PARAM(globalHistoryBits
, "Bits of history"),
239 INIT_PARAM(choicePredictorSize
, "Size of choice predictor"),
240 INIT_PARAM(choiceCtrBits
, "Bits of choice counters"),
242 INIT_PARAM(BTBEntries
, "Number of BTB entries"),
243 INIT_PARAM(BTBTagSize
, "Size of the BTB tags, in bits"),
245 INIT_PARAM(RASSize
, "RAS size"),
247 INIT_PARAM(LQEntries
, "Number of load queue entries"),
248 INIT_PARAM(SQEntries
, "Number of store queue entries"),
249 INIT_PARAM(LFSTSize
, "Last fetched store table size"),
250 INIT_PARAM(SSITSize
, "Store set ID table size"),
252 INIT_PARAM(numPhysIntRegs
, "Number of physical integer registers"),
253 INIT_PARAM(numPhysFloatRegs
, "Number of physical floating point "
255 INIT_PARAM(numIQEntries
, "Number of instruction queue entries"),
256 INIT_PARAM(numROBEntries
, "Number of reorder buffer entries"),
258 INIT_PARAM_DFLT(decoupledFrontEnd
, "Decoupled front end", true),
259 INIT_PARAM_DFLT(dispatchWidth
, "Dispatch width", 0),
260 INIT_PARAM_DFLT(wbWidth
, "Writeback width", 0),
262 INIT_PARAM_DFLT(smtNumFetchingThreads
, "SMT Number of Fetching Threads", 1),
263 INIT_PARAM_DFLT(smtFetchPolicy
, "SMT Fetch Policy", "SingleThread"),
264 INIT_PARAM_DFLT(smtLSQPolicy
, "SMT LSQ Sharing Policy", "Partitioned"),
265 INIT_PARAM_DFLT(smtLSQThreshold
,"SMT LSQ Threshold", 100),
266 INIT_PARAM_DFLT(smtIQPolicy
, "SMT IQ Policy", "Partitioned"),
267 INIT_PARAM_DFLT(smtIQThreshold
, "SMT IQ Threshold", 100),
268 INIT_PARAM_DFLT(smtROBPolicy
, "SMT ROB Sharing Policy", "Partitioned"),
269 INIT_PARAM_DFLT(smtROBThreshold
,"SMT ROB Threshold", 100),
270 INIT_PARAM_DFLT(smtCommitPolicy
,"SMT Commit Fetch Policy", "RoundRobin"),
272 INIT_PARAM(instShiftAmt
, "Number of bits to shift instructions by"),
273 INIT_PARAM(defer_registration
, "defer system registration (for sampling)"),
275 INIT_PARAM(function_trace
, "Enable function trace"),
276 INIT_PARAM(function_trace_start
, "Cycle to start function trace")
278 END_INIT_SIM_OBJECT_PARAMS(DerivOzoneCPU
)
280 CREATE_SIM_OBJECT(DerivOzoneCPU
)
285 // Full-system only supports a single thread for the moment.
286 int actual_num_threads
= 1;
288 // In non-full-system mode, we infer the number of threads from
289 // the workload if it's not explicitly specified.
290 int actual_num_threads
=
291 numThreads
.isValid() ? numThreads
: workload
.size();
293 if (workload
.size() == 0) {
294 fatal("Must specify at least one workload!");
299 SimpleParams
*params
= new SimpleParams
;
301 params
->clock
= clock
;
303 params
->name
= getInstanceName();
304 params
->numberOfThreads
= actual_num_threads
;
307 params
->system
= system
;
308 params
->cpu_id
= cpu_id
;
312 params
->workload
= workload
;
313 // params->pTable = page_table;
314 #endif // FULL_SYSTEM
318 params
->max_insts_any_thread
= max_insts_any_thread
;
319 params
->max_insts_all_threads
= max_insts_all_threads
;
320 params
->max_loads_any_thread
= max_loads_any_thread
;
321 params
->max_loads_all_threads
= max_loads_all_threads
;
326 params
->icacheInterface
= icache
? icache
->getInterface() : NULL
;
327 params
->dcacheInterface
= dcache
? dcache
->getInterface() : NULL
;
328 params
->cachePorts
= cachePorts
;
330 params
->width
= width
;
331 params
->frontEndWidth
= frontEndWidth
;
332 params
->backEndWidth
= backEndWidth
;
333 params
->backEndSquashLatency
= backEndSquashLatency
;
334 params
->backEndLatency
= backEndLatency
;
335 params
->maxInstBufferSize
= maxInstBufferSize
;
336 params
->numPhysicalRegs
= numPhysIntRegs
+ numPhysFloatRegs
;
338 params
->decodeToFetchDelay
= decodeToFetchDelay
;
339 params
->renameToFetchDelay
= renameToFetchDelay
;
340 params
->iewToFetchDelay
= iewToFetchDelay
;
341 params
->commitToFetchDelay
= commitToFetchDelay
;
342 params
->fetchWidth
= fetchWidth
;
344 params
->renameToDecodeDelay
= renameToDecodeDelay
;
345 params
->iewToDecodeDelay
= iewToDecodeDelay
;
346 params
->commitToDecodeDelay
= commitToDecodeDelay
;
347 params
->fetchToDecodeDelay
= fetchToDecodeDelay
;
348 params
->decodeWidth
= decodeWidth
;
350 params
->iewToRenameDelay
= iewToRenameDelay
;
351 params
->commitToRenameDelay
= commitToRenameDelay
;
352 params
->decodeToRenameDelay
= decodeToRenameDelay
;
353 params
->renameWidth
= renameWidth
;
355 params
->commitToIEWDelay
= commitToIEWDelay
;
356 params
->renameToIEWDelay
= renameToIEWDelay
;
357 params
->issueToExecuteDelay
= issueToExecuteDelay
;
358 params
->issueWidth
= issueWidth
;
359 params
->executeWidth
= executeWidth
;
360 params
->executeIntWidth
= executeIntWidth
;
361 params
->executeFloatWidth
= executeFloatWidth
;
362 params
->executeBranchWidth
= executeBranchWidth
;
363 params
->executeMemoryWidth
= executeMemoryWidth
;
365 params
->iewToCommitDelay
= iewToCommitDelay
;
366 params
->renameToROBDelay
= renameToROBDelay
;
367 params
->commitWidth
= commitWidth
;
368 params
->squashWidth
= squashWidth
;
371 params
->localPredictorSize
= localPredictorSize
;
372 params
->localCtrBits
= localCtrBits
;
373 params
->localHistoryTableSize
= localHistoryTableSize
;
374 params
->localHistoryBits
= localHistoryBits
;
375 params
->globalPredictorSize
= globalPredictorSize
;
376 params
->globalCtrBits
= globalCtrBits
;
377 params
->globalHistoryBits
= globalHistoryBits
;
378 params
->choicePredictorSize
= choicePredictorSize
;
379 params
->choiceCtrBits
= choiceCtrBits
;
381 params
->BTBEntries
= BTBEntries
;
382 params
->BTBTagSize
= BTBTagSize
;
384 params
->RASSize
= RASSize
;
386 params
->LQEntries
= LQEntries
;
387 params
->SQEntries
= SQEntries
;
389 params
->SSITSize
= SSITSize
;
390 params
->LFSTSize
= LFSTSize
;
392 params
->numPhysIntRegs
= numPhysIntRegs
;
393 params
->numPhysFloatRegs
= numPhysFloatRegs
;
394 params
->numIQEntries
= numIQEntries
;
395 params
->numROBEntries
= numROBEntries
;
397 params
->decoupledFrontEnd
= decoupledFrontEnd
;
398 params
->dispatchWidth
= dispatchWidth
;
399 params
->wbWidth
= wbWidth
;
401 params
->smtNumFetchingThreads
= smtNumFetchingThreads
;
402 params
->smtFetchPolicy
= smtFetchPolicy
;
403 params
->smtIQPolicy
= smtIQPolicy
;
404 params
->smtLSQPolicy
= smtLSQPolicy
;
405 params
->smtLSQThreshold
= smtLSQThreshold
;
406 params
->smtROBPolicy
= smtROBPolicy
;
407 params
->smtROBThreshold
= smtROBThreshold
;
408 params
->smtCommitPolicy
= smtCommitPolicy
;
410 params
->instShiftAmt
= 2;
412 params
->deferRegistration
= defer_registration
;
414 params
->functionTrace
= function_trace
;
415 params
->functionTraceStart
= function_trace_start
;
417 cpu
= new DerivOzoneCPU(params
);
422 REGISTER_SIM_OBJECT("DerivOzoneCPU", DerivOzoneCPU
)
426 ////////////////////////////////////////////////////////////////////////
428 // OzoneCPU Simulation Object
431 BEGIN_DECLARE_SIM_OBJECT_PARAMS(SimpleOzoneCPU
)
434 Param
<int> numThreads
;
437 SimObjectParam
<System
*> system
;
439 SimObjectParam
<AlphaITB
*> itb
;
440 SimObjectParam
<AlphaDTB
*> dtb
;
442 SimObjectVectorParam
<Process
*> workload
;
443 //SimObjectParam<PageTable *> page_table;
444 #endif // FULL_SYSTEM
446 SimObjectParam
<FunctionalMemory
*> mem
;
448 Param
<Counter
> max_insts_any_thread
;
449 Param
<Counter
> max_insts_all_threads
;
450 Param
<Counter
> max_loads_any_thread
;
451 Param
<Counter
> max_loads_all_threads
;
453 SimObjectParam
<BaseCache
*> icache
;
454 SimObjectParam
<BaseCache
*> dcache
;
456 Param
<unsigned> cachePorts
;
457 Param
<unsigned> width
;
458 Param
<unsigned> frontEndWidth
;
459 Param
<unsigned> backEndWidth
;
460 Param
<unsigned> backEndSquashLatency
;
461 Param
<unsigned> backEndLatency
;
462 Param
<unsigned> maxInstBufferSize
;
463 Param
<unsigned> numPhysicalRegs
;
465 Param
<unsigned> decodeToFetchDelay
;
466 Param
<unsigned> renameToFetchDelay
;
467 Param
<unsigned> iewToFetchDelay
;
468 Param
<unsigned> commitToFetchDelay
;
469 Param
<unsigned> fetchWidth
;
471 Param
<unsigned> renameToDecodeDelay
;
472 Param
<unsigned> iewToDecodeDelay
;
473 Param
<unsigned> commitToDecodeDelay
;
474 Param
<unsigned> fetchToDecodeDelay
;
475 Param
<unsigned> decodeWidth
;
477 Param
<unsigned> iewToRenameDelay
;
478 Param
<unsigned> commitToRenameDelay
;
479 Param
<unsigned> decodeToRenameDelay
;
480 Param
<unsigned> renameWidth
;
482 Param
<unsigned> commitToIEWDelay
;
483 Param
<unsigned> renameToIEWDelay
;
484 Param
<unsigned> issueToExecuteDelay
;
485 Param
<unsigned> issueWidth
;
486 Param
<unsigned> executeWidth
;
487 Param
<unsigned> executeIntWidth
;
488 Param
<unsigned> executeFloatWidth
;
489 Param
<unsigned> executeBranchWidth
;
490 Param
<unsigned> executeMemoryWidth
;
492 Param
<unsigned> iewToCommitDelay
;
493 Param
<unsigned> renameToROBDelay
;
494 Param
<unsigned> commitWidth
;
495 Param
<unsigned> squashWidth
;
497 Param
<unsigned> localPredictorSize
;
498 Param
<unsigned> localCtrBits
;
499 Param
<unsigned> localHistoryTableSize
;
500 Param
<unsigned> localHistoryBits
;
501 Param
<unsigned> globalPredictorSize
;
502 Param
<unsigned> globalCtrBits
;
503 Param
<unsigned> globalHistoryBits
;
504 Param
<unsigned> choicePredictorSize
;
505 Param
<unsigned> choiceCtrBits
;
507 Param
<unsigned> BTBEntries
;
508 Param
<unsigned> BTBTagSize
;
510 Param
<unsigned> RASSize
;
512 Param
<unsigned> LQEntries
;
513 Param
<unsigned> SQEntries
;
514 Param
<unsigned> LFSTSize
;
515 Param
<unsigned> SSITSize
;
517 Param
<unsigned> numPhysIntRegs
;
518 Param
<unsigned> numPhysFloatRegs
;
519 Param
<unsigned> numIQEntries
;
520 Param
<unsigned> numROBEntries
;
522 Param
<bool> decoupledFrontEnd
;
523 Param
<int> dispatchWidth
;
526 Param
<unsigned> smtNumFetchingThreads
;
527 Param
<std::string
> smtFetchPolicy
;
528 Param
<std::string
> smtLSQPolicy
;
529 Param
<unsigned> smtLSQThreshold
;
530 Param
<std::string
> smtIQPolicy
;
531 Param
<unsigned> smtIQThreshold
;
532 Param
<std::string
> smtROBPolicy
;
533 Param
<unsigned> smtROBThreshold
;
534 Param
<std::string
> smtCommitPolicy
;
536 Param
<unsigned> instShiftAmt
;
538 Param
<bool> defer_registration
;
540 Param
<bool> function_trace
;
541 Param
<Tick
> function_trace_start
;
543 END_DECLARE_SIM_OBJECT_PARAMS(SimpleOzoneCPU
)
545 BEGIN_INIT_SIM_OBJECT_PARAMS(SimpleOzoneCPU
)
547 INIT_PARAM(clock
, "clock speed"),
548 INIT_PARAM(numThreads
, "number of HW thread contexts"),
551 INIT_PARAM(system
, "System object"),
552 INIT_PARAM(cpu_id
, "processor ID"),
553 INIT_PARAM(itb
, "Instruction translation buffer"),
554 INIT_PARAM(dtb
, "Data translation buffer"),
556 INIT_PARAM(workload
, "Processes to run"),
557 // INIT_PARAM(page_table, "Page table"),
558 #endif // FULL_SYSTEM
560 INIT_PARAM_DFLT(mem
, "Memory", NULL
),
562 INIT_PARAM_DFLT(max_insts_any_thread
,
563 "Terminate when any thread reaches this inst count",
565 INIT_PARAM_DFLT(max_insts_all_threads
,
566 "Terminate when all threads have reached"
569 INIT_PARAM_DFLT(max_loads_any_thread
,
570 "Terminate when any thread reaches this load count",
572 INIT_PARAM_DFLT(max_loads_all_threads
,
573 "Terminate when all threads have reached this load"
577 INIT_PARAM_DFLT(icache
, "L1 instruction cache", NULL
),
578 INIT_PARAM_DFLT(dcache
, "L1 data cache", NULL
),
580 INIT_PARAM_DFLT(cachePorts
, "Cache Ports", 200),
581 INIT_PARAM_DFLT(width
, "Width", 1),
582 INIT_PARAM_DFLT(frontEndWidth
, "Front end width", 1),
583 INIT_PARAM_DFLT(backEndWidth
, "Back end width", 1),
584 INIT_PARAM_DFLT(backEndSquashLatency
, "Back end squash latency", 1),
585 INIT_PARAM_DFLT(backEndLatency
, "Back end latency", 1),
586 INIT_PARAM_DFLT(maxInstBufferSize
, "Maximum instruction buffer size", 16),
587 INIT_PARAM(numPhysicalRegs
, "Number of physical registers"),
589 INIT_PARAM(decodeToFetchDelay
, "Decode to fetch delay"),
590 INIT_PARAM(renameToFetchDelay
, "Rename to fetch delay"),
591 INIT_PARAM(iewToFetchDelay
, "Issue/Execute/Writeback to fetch"
593 INIT_PARAM(commitToFetchDelay
, "Commit to fetch delay"),
594 INIT_PARAM(fetchWidth
, "Fetch width"),
595 INIT_PARAM(renameToDecodeDelay
, "Rename to decode delay"),
596 INIT_PARAM(iewToDecodeDelay
, "Issue/Execute/Writeback to decode"
598 INIT_PARAM(commitToDecodeDelay
, "Commit to decode delay"),
599 INIT_PARAM(fetchToDecodeDelay
, "Fetch to decode delay"),
600 INIT_PARAM(decodeWidth
, "Decode width"),
602 INIT_PARAM(iewToRenameDelay
, "Issue/Execute/Writeback to rename"
604 INIT_PARAM(commitToRenameDelay
, "Commit to rename delay"),
605 INIT_PARAM(decodeToRenameDelay
, "Decode to rename delay"),
606 INIT_PARAM(renameWidth
, "Rename width"),
608 INIT_PARAM(commitToIEWDelay
, "Commit to "
609 "Issue/Execute/Writeback delay"),
610 INIT_PARAM(renameToIEWDelay
, "Rename to "
611 "Issue/Execute/Writeback delay"),
612 INIT_PARAM(issueToExecuteDelay
, "Issue to execute delay (internal"
613 "to the IEW stage)"),
614 INIT_PARAM(issueWidth
, "Issue width"),
615 INIT_PARAM(executeWidth
, "Execute width"),
616 INIT_PARAM(executeIntWidth
, "Integer execute width"),
617 INIT_PARAM(executeFloatWidth
, "Floating point execute width"),
618 INIT_PARAM(executeBranchWidth
, "Branch execute width"),
619 INIT_PARAM(executeMemoryWidth
, "Memory execute width"),
621 INIT_PARAM(iewToCommitDelay
, "Issue/Execute/Writeback to commit "
623 INIT_PARAM(renameToROBDelay
, "Rename to reorder buffer delay"),
624 INIT_PARAM(commitWidth
, "Commit width"),
625 INIT_PARAM(squashWidth
, "Squash width"),
627 INIT_PARAM(localPredictorSize
, "Size of local predictor"),
628 INIT_PARAM(localCtrBits
, "Bits per counter"),
629 INIT_PARAM(localHistoryTableSize
, "Size of local history table"),
630 INIT_PARAM(localHistoryBits
, "Bits for the local history"),
631 INIT_PARAM(globalPredictorSize
, "Size of global predictor"),
632 INIT_PARAM(globalCtrBits
, "Bits per counter"),
633 INIT_PARAM(globalHistoryBits
, "Bits of history"),
634 INIT_PARAM(choicePredictorSize
, "Size of choice predictor"),
635 INIT_PARAM(choiceCtrBits
, "Bits of choice counters"),
637 INIT_PARAM(BTBEntries
, "Number of BTB entries"),
638 INIT_PARAM(BTBTagSize
, "Size of the BTB tags, in bits"),
640 INIT_PARAM(RASSize
, "RAS size"),
642 INIT_PARAM(LQEntries
, "Number of load queue entries"),
643 INIT_PARAM(SQEntries
, "Number of store queue entries"),
644 INIT_PARAM(LFSTSize
, "Last fetched store table size"),
645 INIT_PARAM(SSITSize
, "Store set ID table size"),
647 INIT_PARAM(numPhysIntRegs
, "Number of physical integer registers"),
648 INIT_PARAM(numPhysFloatRegs
, "Number of physical floating point "
650 INIT_PARAM(numIQEntries
, "Number of instruction queue entries"),
651 INIT_PARAM(numROBEntries
, "Number of reorder buffer entries"),
653 INIT_PARAM_DFLT(decoupledFrontEnd
, "Decoupled front end", true),
654 INIT_PARAM_DFLT(dispatchWidth
, "Dispatch width", 0),
655 INIT_PARAM_DFLT(wbWidth
, "Writeback width", 0),
657 INIT_PARAM_DFLT(smtNumFetchingThreads
, "SMT Number of Fetching Threads", 1),
658 INIT_PARAM_DFLT(smtFetchPolicy
, "SMT Fetch Policy", "SingleThread"),
659 INIT_PARAM_DFLT(smtLSQPolicy
, "SMT LSQ Sharing Policy", "Partitioned"),
660 INIT_PARAM_DFLT(smtLSQThreshold
,"SMT LSQ Threshold", 100),
661 INIT_PARAM_DFLT(smtIQPolicy
, "SMT IQ Policy", "Partitioned"),
662 INIT_PARAM_DFLT(smtIQThreshold
, "SMT IQ Threshold", 100),
663 INIT_PARAM_DFLT(smtROBPolicy
, "SMT ROB Sharing Policy", "Partitioned"),
664 INIT_PARAM_DFLT(smtROBThreshold
,"SMT ROB Threshold", 100),
665 INIT_PARAM_DFLT(smtCommitPolicy
,"SMT Commit Fetch Policy", "RoundRobin"),
667 INIT_PARAM(instShiftAmt
, "Number of bits to shift instructions by"),
668 INIT_PARAM(defer_registration
, "defer system registration (for sampling)"),
670 INIT_PARAM(function_trace
, "Enable function trace"),
671 INIT_PARAM(function_trace_start
, "Cycle to start function trace")
673 END_INIT_SIM_OBJECT_PARAMS(SimpleOzoneCPU
)
675 CREATE_SIM_OBJECT(SimpleOzoneCPU
)
680 // Full-system only supports a single thread for the moment.
681 int actual_num_threads
= 1;
683 // In non-full-system mode, we infer the number of threads from
684 // the workload if it's not explicitly specified.
685 int actual_num_threads
=
686 numThreads
.isValid() ? numThreads
: workload
.size();
688 if (workload
.size() == 0) {
689 fatal("Must specify at least one workload!");
694 SimpleParams
*params
= new SimpleParams
;
696 params
->clock
= clock
;
698 params
->name
= getInstanceName();
699 params
->numberOfThreads
= actual_num_threads
;
702 params
->system
= system
;
703 params
->cpu_id
= cpu_id
;
707 params
->workload
= workload
;
708 // params->pTable = page_table;
709 #endif // FULL_SYSTEM
713 params
->max_insts_any_thread
= max_insts_any_thread
;
714 params
->max_insts_all_threads
= max_insts_all_threads
;
715 params
->max_loads_any_thread
= max_loads_any_thread
;
716 params
->max_loads_all_threads
= max_loads_all_threads
;
721 params
->icacheInterface
= icache
? icache
->getInterface() : NULL
;
722 params
->dcacheInterface
= dcache
? dcache
->getInterface() : NULL
;
723 params
->cachePorts
= cachePorts
;
725 params
->width
= width
;
726 params
->frontEndWidth
= frontEndWidth
;
727 params
->backEndWidth
= backEndWidth
;
728 params
->backEndSquashLatency
= backEndSquashLatency
;
729 params
->backEndLatency
= backEndLatency
;
730 params
->maxInstBufferSize
= maxInstBufferSize
;
731 params
->numPhysicalRegs
= numPhysIntRegs
+ numPhysFloatRegs
;
733 params
->decodeToFetchDelay
= decodeToFetchDelay
;
734 params
->renameToFetchDelay
= renameToFetchDelay
;
735 params
->iewToFetchDelay
= iewToFetchDelay
;
736 params
->commitToFetchDelay
= commitToFetchDelay
;
737 params
->fetchWidth
= fetchWidth
;
739 params
->renameToDecodeDelay
= renameToDecodeDelay
;
740 params
->iewToDecodeDelay
= iewToDecodeDelay
;
741 params
->commitToDecodeDelay
= commitToDecodeDelay
;
742 params
->fetchToDecodeDelay
= fetchToDecodeDelay
;
743 params
->decodeWidth
= decodeWidth
;
745 params
->iewToRenameDelay
= iewToRenameDelay
;
746 params
->commitToRenameDelay
= commitToRenameDelay
;
747 params
->decodeToRenameDelay
= decodeToRenameDelay
;
748 params
->renameWidth
= renameWidth
;
750 params
->commitToIEWDelay
= commitToIEWDelay
;
751 params
->renameToIEWDelay
= renameToIEWDelay
;
752 params
->issueToExecuteDelay
= issueToExecuteDelay
;
753 params
->issueWidth
= issueWidth
;
754 params
->executeWidth
= executeWidth
;
755 params
->executeIntWidth
= executeIntWidth
;
756 params
->executeFloatWidth
= executeFloatWidth
;
757 params
->executeBranchWidth
= executeBranchWidth
;
758 params
->executeMemoryWidth
= executeMemoryWidth
;
760 params
->iewToCommitDelay
= iewToCommitDelay
;
761 params
->renameToROBDelay
= renameToROBDelay
;
762 params
->commitWidth
= commitWidth
;
763 params
->squashWidth
= squashWidth
;
766 params
->localPredictorSize
= localPredictorSize
;
767 params
->localCtrBits
= localCtrBits
;
768 params
->localHistoryTableSize
= localHistoryTableSize
;
769 params
->localHistoryBits
= localHistoryBits
;
770 params
->globalPredictorSize
= globalPredictorSize
;
771 params
->globalCtrBits
= globalCtrBits
;
772 params
->globalHistoryBits
= globalHistoryBits
;
773 params
->choicePredictorSize
= choicePredictorSize
;
774 params
->choiceCtrBits
= choiceCtrBits
;
776 params
->BTBEntries
= BTBEntries
;
777 params
->BTBTagSize
= BTBTagSize
;
779 params
->RASSize
= RASSize
;
781 params
->LQEntries
= LQEntries
;
782 params
->SQEntries
= SQEntries
;
784 params
->SSITSize
= SSITSize
;
785 params
->LFSTSize
= LFSTSize
;
787 params
->numPhysIntRegs
= numPhysIntRegs
;
788 params
->numPhysFloatRegs
= numPhysFloatRegs
;
789 params
->numIQEntries
= numIQEntries
;
790 params
->numROBEntries
= numROBEntries
;
792 params
->decoupledFrontEnd
= decoupledFrontEnd
;
793 params
->dispatchWidth
= dispatchWidth
;
794 params
->wbWidth
= wbWidth
;
796 params
->smtNumFetchingThreads
= smtNumFetchingThreads
;
797 params
->smtFetchPolicy
= smtFetchPolicy
;
798 params
->smtIQPolicy
= smtIQPolicy
;
799 params
->smtLSQPolicy
= smtLSQPolicy
;
800 params
->smtLSQThreshold
= smtLSQThreshold
;
801 params
->smtROBPolicy
= smtROBPolicy
;
802 params
->smtROBThreshold
= smtROBThreshold
;
803 params
->smtCommitPolicy
= smtCommitPolicy
;
805 params
->instShiftAmt
= 2;
807 params
->deferRegistration
= defer_registration
;
809 params
->functionTrace
= function_trace
;
810 params
->functionTraceStart
= function_trace_start
;
812 cpu
= new SimpleOzoneCPU(params
);
817 REGISTER_SIM_OBJECT("SimpleOzoneCPU", SimpleOzoneCPU
)