gem5 [DEVELOP-FOR-25.1]
Loading...
Searching...
No Matches
base.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011-2012,2016-2017, 2019-2020 Arm Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated
11 * unmodified and in its entirety in all distributions of the software,
12 * modified or unmodified, in source code or in binary form.
13 *
14 * Copyright (c) 2002-2005 The Regents of The University of Michigan
15 * Copyright (c) 2011 Regents of the University of California
16 * Copyright (c) 2013 Advanced Micro Devices, Inc.
17 * Copyright (c) 2013 Mark D. Hill and David A. Wood
18 * All rights reserved.
19 *
20 * Redistribution and use in source and binary forms, with or without
21 * modification, are permitted provided that the following conditions are
22 * met: redistributions of source code must retain the above copyright
23 * notice, this list of conditions and the following disclaimer;
24 * redistributions in binary form must reproduce the above copyright
25 * notice, this list of conditions and the following disclaimer in the
26 * documentation and/or other materials provided with the distribution;
27 * neither the name of the copyright holders nor the names of its
28 * contributors may be used to endorse or promote products derived from
29 * this software without specific prior written permission.
30 *
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
36 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
37 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
38 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
39 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
40 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
41 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42 */
43
44#include "cpu/base.hh"
45
46#include <iostream>
47#include <sstream>
48#include <string>
49
51#include "arch/generic/isa.hh"
52#include "arch/generic/tlb.hh"
53#include "base/cprintf.hh"
54#include "base/loader/symtab.hh"
55#include "base/logging.hh"
56#include "base/output.hh"
57#include "base/trace.hh"
58#include "cpu/checker/cpu.hh"
59#include "cpu/thread_context.hh"
60#include "debug/Mwait.hh"
61#include "debug/SyscallVerbose.hh"
62#include "debug/Thread.hh"
63#include "mem/page_table.hh"
64#include "params/BaseCPU.hh"
65#include "sim/clocked_object.hh"
66#include "sim/full_system.hh"
67#include "sim/process.hh"
68#include "sim/root.hh"
69#include "sim/sim_events.hh"
70#include "sim/sim_exit.hh"
71#include "sim/system.hh"
72
73// Hack
74#include "sim/stat_control.hh"
75
76namespace gem5
77{
78
79std::unique_ptr<BaseCPU::GlobalStats> BaseCPU::globalStats;
80
81std::vector<BaseCPU *> BaseCPU::cpuList;
82
83// This variable reflects the max number of threads in any CPU. Be
84// careful to only use it once all the CPUs that you care about have
85// been initialized
87
90 cpu(_cpu), _repeatEvent(true)
91{
92 if (_interval)
93 cpu->schedule(this, curTick() + _interval);
94}
95
96void
98{
99 Counter temp = cpu->totalOps();
100
101 if (_repeatEvent)
102 cpu->schedule(this, curTick() + _interval);
103
104 if (cpu->switchedOut()) {
105 return;
106 }
107
108#ifndef NDEBUG
109 double ipc = double(temp - lastNumInst) / (_interval / cpu->clockPeriod());
110
111 DPRINTFN("%s progress event, total committed:%i, progress insts committed: "
112 "%lli, IPC: %0.8d\n", cpu->name(), temp, temp - lastNumInst,
113 ipc);
114 ipc = 0.0;
115#else
116 cprintf("%lli: %s progress event, total committed:%i, progress insts "
117 "committed: %lli\n", curTick(), cpu->name(), temp,
118 temp - lastNumInst);
119#endif
120 lastNumInst = temp;
121}
122
123const char *
125{
126 return "CPU Progress";
127}
128
129BaseCPU::BaseCPU(const Params &p, bool is_checker)
130 : ClockedObject(p), instCnt(0), _cpuId(p.cpu_id), _socketId(p.socket_id),
131 _instRequestorId(p.system->getRequestorId(this, "inst")),
132 _dataRequestorId(p.system->getRequestorId(this, "data")),
135 modelResetPort(p.name + ".model_reset"),
140 baseStats(this),
143 pwrGatingLatency(p.pwr_gating_latency),
144 powerGatingOnIdle(p.power_gating_on_idle),
146{
147 // if Python did not provide a valid ID, do it here
148 if (_cpuId == -1 ) {
149 _cpuId = cpuList.size();
150 }
151
152 // add self to global list of CPUs
153 cpuList.push_back(this);
154
155 DPRINTF(SyscallVerbose, "Constructing CPU with id %d, socket id %d\n",
156 _cpuId, _socketId);
157
158 if (numThreads > maxThreadsPerCPU)
159 maxThreadsPerCPU = numThreads;
160
161 functionTracingEnabled = false;
162 if (p.function_trace) {
163 const std::string fname = csprintf("ftrace.%s", name());
164 functionTraceStream = simout.findOrCreate(fname)->stream();
165
166 currentFunctionStart = currentFunctionEnd = 0;
167 functionEntryTick = p.function_trace_start;
168
169 if (p.function_trace_start == 0) {
170 functionTracingEnabled = true;
171 } else {
172 Event *event = new EventFunctionWrapper(
173 [this]{ enableFunctionTrace(); }, name(), true);
174 schedule(event, p.function_trace_start);
175 }
176 }
177
178 tracer = params().tracer;
179
180 if (params().isa.size() != numThreads) {
181 fatal("Number of ISAs (%i) assigned to the CPU does not equal number "
182 "of threads (%i).\n", params().isa.size(), numThreads);
183 }
184
185 if (!FullSystem && params().workload.size() != numThreads) {
186 fatal("Number of processes (cpu.workload) (%i) assigned to the CPU "
187 "does not equal number of threads (%i).\n",
188 params().workload.size(), numThreads);
189 }
190
191 modelResetPort.onChange([this](const bool &new_val) {
192 setReset(new_val);
193 });
194
195 for (int i = 0; i < params().port_cpu_idle_pins_connection_count; i++) {
196 cpuIdlePins.emplace_back(new IntSourcePin<BaseCPU>(
197 csprintf("%s.cpu_idle_pins[%d]", name(), i), i, this));
198 }
199
200 // create a stat group object for each thread on this core
201 fetchStats.reserve(numThreads);
202 executeStats.reserve(numThreads);
203 commitStats.reserve(numThreads);
204 for (int i = 0; i < numThreads; i++) {
205 // create fetchStat object for thread i and set rate formulas
206 FetchCPUStats* fetchStatptr = new FetchCPUStats(this, i);
207 fetchStatptr->fetchRate = fetchStatptr->numInsts / baseStats.numCycles;
208 fetchStatptr->branchRate = fetchStatptr->numBranches /
209 baseStats.numCycles;
210 fetchStats.emplace_back(fetchStatptr);
211
212 // create executeStat object for thread i and set rate formulas
213 ExecuteCPUStats* executeStatptr = new ExecuteCPUStats(this, i);
214 executeStatptr->instRate = executeStatptr->numInsts /
215 baseStats.numCycles;
216 executeStats.emplace_back(executeStatptr);
217
218 // create commitStat object for thread i and set ipc, cpi formulas
219 CommitCPUStats* commitStatptr = new CommitCPUStats(this, i);
220 commitStatptr->ipc = commitStatptr->numInsts / baseStats.numCycles;
221 commitStatptr->cpi = baseStats.numCycles / commitStatptr->numInsts;
222 commitStatptr->ratioUserInsts = commitStatptr->numUserInsts /
223 commitStatptr->numInsts;
224 commitStatptr->ratioUserOps = commitStatptr->numUserOps /
225 commitStatptr->numOps;
226 commitStats.emplace_back(commitStatptr);
227 }
228}
229
230void
235
239
242{
243 return static_cast<ThreadID>(cid - threadContexts[0]->contextId());
244}
245
246void
248{
249 interrupts[tid]->post(int_num, index);
250 // Only wake up syscall emulation if it is not waiting on a futex.
251 // This is to model the fact that instructions such as ARM SEV
252 // should wake up a WFE sleep, but not a futex syscall WAIT.
253 //
254 // For RISC-V, the WFI sleep wake up is implementation defined.
255 // The SiFive WFI wake up the hart only if mip & mie != 0
256 if ((FullSystem && interrupts[tid]->isWakeUp()) ||
257 (!FullSystem && !system->futexMap.is_waiting(threadContexts[tid])))
258 wakeup(tid);
259}
260
261void
263{
264 assert(tid < numThreads);
265 AddressMonitor &monitor = addressMonitor[tid];
266
267 monitor.armed = true;
268 monitor.vAddr = address;
269 monitor.pAddr = 0x0;
270 DPRINTF(Mwait, "[tid:%d] Armed monitor (vAddr=0x%lx)\n", tid, address);
271}
272
273bool
275{
276 assert(tid < numThreads);
277 AddressMonitor &monitor = addressMonitor[tid];
278
279 if (!monitor.gotWakeup) {
280 Addr block_size = cacheLineSize();
281 Addr mask = ~(block_size - 1);
282
283 assert(pkt->req->hasPaddr());
284 monitor.pAddr = pkt->getAddr() & mask;
285 monitor.waiting = true;
286
287 DPRINTF(Mwait, "[tid:%d] mwait called (vAddr=0x%lx, "
288 "line's paddr=0x%lx)\n", tid, monitor.vAddr, monitor.pAddr);
289 return true;
290 } else {
291 monitor.gotWakeup = false;
292 return false;
293 }
294}
295
296void
298{
299 assert(tid < numThreads);
300 AddressMonitor &monitor = addressMonitor[tid];
301
302 RequestPtr req = std::make_shared<Request>();
303
304 Addr addr = monitor.vAddr;
305 Addr block_size = cacheLineSize();
306 Addr mask = ~(block_size - 1);
307 int size = block_size;
308
309 //The address of the next line if it crosses a cache line boundary.
310 Addr secondAddr = roundDown(addr + size - 1, block_size);
311
312 if (secondAddr > addr)
313 size = secondAddr - addr;
314
315 req->setVirt(addr, size, 0x0, dataRequestorId(),
316 tc->pcState().instAddr());
317
318 // translate to physical address
319 Fault fault = mmu->translateAtomic(req, tc, BaseMMU::Read);
320 assert(fault == NoFault);
321
322 monitor.pAddr = req->getPaddr() & mask;
323 monitor.waiting = true;
324
325 DPRINTF(Mwait, "[tid:%d] mwait called (vAddr=0x%lx, line's paddr=0x%lx)\n",
326 tid, monitor.vAddr, monitor.pAddr);
327}
328
329void
331{
332 // Set up instruction-count-based termination events, if any. This needs
333 // to happen after threadContexts has been constructed.
334 if (params().max_insts_any_thread != 0) {
335 scheduleInstStopAnyThread(params().max_insts_any_thread);
336 }
337
338 // Set up instruction-count-based termination events for SimPoints
339 // Typically, there are more than one action points.
340 // Simulation.py is responsible to take the necessary actions upon
341 // exitting the simulation loop.
342 if (!params().simpoint_start_insts.empty()) {
343 scheduleSimpointsInstStop(params().simpoint_start_insts);
344 }
345
346 if (params().max_insts_all_threads != 0) {
347 std::string cause = "all threads reached the max instruction count";
348
349 // allocate & initialize shared downcounter: each event will
350 // decrement this when triggered; simulation will terminate
351 // when counter reaches 0
352 int *counter = new int;
353 *counter = numThreads;
354 for (ThreadID tid = 0; tid < numThreads; ++tid) {
355 Event *event = new CountedExitEvent(cause, *counter);
356 threadContexts[tid]->scheduleInstCountEvent(
357 event, params().max_insts_all_threads);
358 }
359 }
360
361 if (!params().switched_out) {
363
365 }
366}
367
368void
370{
371 if (params().progress_interval) {
372 new CPUProgressEvent(this, params().progress_interval);
373 }
374
375 if (_switchedOut)
376 powerState->set(enums::PwrState::OFF);
377
378 // Assumption CPU start to operate instantaneously without any latency
379 if (powerState->get() == enums::PwrState::UNDEFINED)
380 powerState->set(enums::PwrState::ON);
381
382}
383
386{
388 ptr.reset(new probing::PMU(getProbeManager(), name));
389
390 return ptr;
391}
392
393void
395{
396 ppAllCycles = pmuProbePoint("Cycles");
397 ppActiveCycles = pmuProbePoint("ActiveCycles");
398
399 ppRetiredInsts = pmuProbePoint("RetiredInsts");
400 ppRetiredInstsPC = pmuProbePoint("RetiredInstsPC");
401 ppRetiredLoads = pmuProbePoint("RetiredLoads");
402 ppRetiredStores = pmuProbePoint("RetiredStores");
403 ppRetiredBranches = pmuProbePoint("RetiredBranches");
404
406 "Sleeping");
407}
408
409void
411{
412 if (!inst->isMicroop() || inst->isLastMicroop()) {
413 ppRetiredInsts->notify(1);
414 ppRetiredInstsPC->notify(pc);
415 }
416
417 if (inst->isLoad())
418 ppRetiredLoads->notify(1);
419
420 if (inst->isStore() || inst->isAtomic())
421 ppRetiredStores->notify(1);
422
423 if (inst->isControl())
424 ppRetiredBranches->notify(1);
425}
426
429 : statistics::Group(parent),
430 ADD_STAT(numCycles, statistics::units::Cycle::get(),
431 "Number of cpu cycles simulated"),
433 statistics::units::Cycle, statistics::units::Count>::get(),
434 "CPI: cycles per instruction (core level)"),
436 statistics::units::Count, statistics::units::Cycle>::get(),
437 "IPC: instructions per cycle (core level)"),
439 "Number of work items this cpu started"),
441 "Number of work items this cpu completed")
442{
443 cpi.precision(6);
445
446 ipc.precision(6);
448}
449
450void
452{
454
455 if (!globalStats) {
456 /* We need to construct the global CPU stat structure here
457 * since it needs a pointer to the Root object. */
458 globalStats.reset(new GlobalStats(Root::root()));
459 }
460
461 using namespace statistics;
462
463 int size = threadContexts.size();
464 if (size > 1) {
465 for (int i = 0; i < size; ++i) {
466 std::stringstream namestr;
467 ccprintf(namestr, "%s.ctx%d", name(), i);
468 threadContexts[i]->regStats(namestr.str());
469 }
470 } else if (size == 1)
471 threadContexts[0]->regStats(name());
472}
473
474Port &
475BaseCPU::getPort(const std::string &if_name, PortID idx)
476{
477 // Get the right port based on name. This applies to all the
478 // subclasses of the base CPU and relies on their implementation
479 // of getDataPort and getInstPort.
480 if (if_name == "dcache_port")
481 return getDataPort();
482 else if (if_name == "icache_port")
483 return getInstPort();
484 else if (if_name == "model_reset")
485 return modelResetPort;
486 else if (if_name == "cpu_idle_pins")
487 return *cpuIdlePins[idx];
488 else
489 return ClockedObject::getPort(if_name, idx);
490}
491
492void
494{
495 assert(system->multiThread || numThreads == 1);
496
498 "CPU %s has %i interrupt controllers, but is expecting one "
499 "per thread (%i)\n",
500 name(), interrupts.size(), numThreads);
501
502 for (ThreadID tid = 0; tid < threadContexts.size(); ++tid) {
503 ThreadContext *tc = threadContexts[tid];
504
505 system->registerThreadContext(tc);
506
507 if (!FullSystem)
509
510 interrupts[tid]->setThreadContext(tc);
511 tc->getIsaPtr()->setThreadContext(tc);
512 }
513}
514
515void
522
523void
525{
526 for (auto tc : threadContexts) {
527 if (tc->status() == ThreadContext::Active)
528 return;
529 }
530
531 if (powerState->get() == enums::PwrState::CLK_GATED &&
533 assert(!enterPwrGatingEvent.scheduled());
534 // Schedule a power gating event when clock gated for the specified
535 // amount of time
537 }
538}
539
540int
542{
543 ThreadID size = threadContexts.size();
544 for (ThreadID tid = 0; tid < size; ++tid) {
545 if (tc == threadContexts[tid])
546 return tid;
547 }
548 return 0;
549}
550
551void
553{
554 if (modelResetPort.state()) {
555 DPRINTF(Thread, "CPU in reset, not activating context %d\n",
556 threadContexts[thread_num]->contextId());
557 return;
558 }
559
560 DPRINTF(Thread, "activate contextId %d\n",
561 threadContexts[thread_num]->contextId());
562
563 if (thread_num < cpuIdlePins.size()) {
564 cpuIdlePins[thread_num]->lower();
565 }
566
567 // Squash enter power gating event while cpu gets activated
568 if (enterPwrGatingEvent.scheduled())
570 // For any active thread running, update CPU power state to active (ON)
571 powerState->set(enums::PwrState::ON);
572
574}
575
576void
578{
579 DPRINTF(Thread, "suspend contextId %d\n",
580 threadContexts[thread_num]->contextId());
581
582 if (thread_num < cpuIdlePins.size()) {
583 cpuIdlePins[thread_num]->raise();
584 }
585
586 // Check if all threads are suspended
587 for (auto t : threadContexts) {
588 if (t->status() != ThreadContext::Suspended) {
589 return;
590 }
591 }
592
593 // All CPU thread are suspended, update cycle count
595
596 // All CPU threads suspended, enter lower power state for the CPU
597 powerState->set(enums::PwrState::CLK_GATED);
598
599 // If pwrGatingLatency is set to 0 then this mechanism is disabled
600 if (powerGatingOnIdle) {
601 // Schedule power gating event when clock gated for pwrGatingLatency
602 // cycles
604 }
605}
606
607void
612
613void
615{
616 powerState->set(enums::PwrState::OFF);
617}
618
619void
621{
622 assert(!_switchedOut);
623 _switchedOut = true;
624
625 // Flush all TLBs in the CPU to avoid having stale translations if
626 // it gets switched in later.
627 flushTLBs();
628
629 // Go to the power gating state
630 powerState->set(enums::PwrState::OFF);
631}
632
633void
635{
636 assert(threadContexts.size() == oldCPU->threadContexts.size());
637 assert(_cpuId == oldCPU->cpuId());
638 assert(_switchedOut);
639 assert(oldCPU != this);
640 _pid = oldCPU->getPid();
641 _taskId = oldCPU->taskId();
642 // Take over the power state of the switchedOut CPU
643 powerState->set(oldCPU->powerState->get());
644
647
648 _switchedOut = false;
649
650 ThreadID size = threadContexts.size();
651 for (ThreadID i = 0; i < size; ++i) {
653 ThreadContext *oldTC = oldCPU->threadContexts[i];
654
655 newTC->getIsaPtr()->setThreadContext(newTC);
656
657 newTC->takeOverFrom(oldTC);
658
659 assert(newTC->contextId() == oldTC->contextId());
660 assert(newTC->threadId() == oldTC->threadId());
661 system->replaceThreadContext(newTC, newTC->contextId());
662
663 /* This code no longer works since the zero register (e.g.,
664 * r31 on Alpha) doesn't necessarily contain zero at this
665 * point.
666 if (debug::Context)
667 ThreadContext::compare(oldTC, newTC);
668 */
669
670 newTC->getMMUPtr()->takeOverFrom(oldTC->getMMUPtr());
671
672 // Checker whether or not we have to transfer CheckerCPU
673 // objects over in the switch
674 CheckerCPU *old_checker = oldTC->getCheckerCpuPtr();
675 CheckerCPU *new_checker = newTC->getCheckerCpuPtr();
676 if (old_checker && new_checker) {
677 new_checker->getMMUPtr()->takeOverFrom(old_checker->getMMUPtr());
678 }
679 }
680
681 interrupts = oldCPU->interrupts;
682 for (ThreadID tid = 0; tid < numThreads; tid++) {
683 interrupts[tid]->setThreadContext(threadContexts[tid]);
684 }
685 oldCPU->interrupts.clear();
686
687 // All CPUs have an instruction and a data port, and the new CPU's
688 // ports are dangling while the old CPU has its ports connected
689 // already. Unbind the old CPU and then bind the ports of the one
690 // we are switching to.
693
694 // Switch over the reset line as well, if necessary.
695 if (oldCPU->modelResetPort.isConnected())
696 modelResetPort.takeOverFrom(&oldCPU->modelResetPort);
697}
698
699void
701{
702 for (auto tc: threadContexts) {
703 if (state) {
704 // As we enter reset, stop execution.
705 tc->quiesce();
706 } else {
707 // As we leave reset, first reset thread state,
708 tc->getIsaPtr()->resetThread();
709 // reset the decoder in case it had partially decoded something,
710 tc->getDecoderPtr()->reset();
711 // reset MMU,
712 tc->getMMUPtr()->reset();
713 // Clear any interrupts,
714 interrupts[tc->threadId()]->clearAll();
715 // and finally reenable execution.
716 tc->activate();
717 }
718 }
719}
720
721void
723{
724 for (ThreadID i = 0; i < threadContexts.size(); ++i) {
726 CheckerCPU *checker(tc.getCheckerCpuPtr());
727
728 tc.getMMUPtr()->flushAll();
729 if (checker) {
730 checker->getMMUPtr()->flushAll();
731 }
732 }
733}
734
735void
737{
739
740 if (!_switchedOut) {
741 /* Unlike _pid, _taskId is not serialized, as they are dynamically
742 * assigned unique ids that are only meaningful for the duration of
743 * a specific run. We will need to serialize the entire taskMap in
744 * system. */
746
747 // Serialize the threads, this is done by the CPU implementation.
748 for (ThreadID i = 0; i < numThreads; ++i) {
749 ScopedCheckpointSection sec(cp, csprintf("xc.%i", i));
750 interrupts[i]->serialize(cp);
752 }
753 }
754}
755
756void
758{
760
761 if (!_switchedOut) {
763
764 // Unserialize the threads, this is done by the CPU implementation.
765 for (ThreadID i = 0; i < numThreads; ++i) {
766 ScopedCheckpointSection sec(cp, csprintf("xc.%i", i));
767 interrupts[i]->unserialize(cp);
769 }
770 }
771}
772
773void
774BaseCPU::scheduleInstStop(ThreadID tid, Counter insts, std::string cause)
775{
776 const Tick now(getCurrentInstCount(tid));
777 Event *event(new LocalSimLoopExitEvent(cause, 0));
778
779 threadContexts[tid]->scheduleInstCountEvent(event, now + insts);
780}
781
782Tick
784{
785 return threadContexts[tid]->getCurrentInstCount();
786}
787
789{
790 armed = false;
791 waiting = false;
792 gotWakeup = false;
793}
794
795bool
797{
798 assert(pkt->req->hasPaddr());
799 if (armed && waiting) {
800 if (pAddr == pkt->getAddr()) {
801 DPRINTF(Mwait, "pAddr=0x%lx invalidated: waking up core\n",
802 pkt->getAddr());
803 waiting = false;
804 return true;
805 }
806 }
807 return false;
808}
809
810
811void
813{
814 if (loader::debugSymbolTable.empty())
815 return;
816
817 // if pc enters different function, print new function symbol and
818 // update saved range. Otherwise do nothing.
820 auto it = loader::debugSymbolTable.findNearest(
822
823 std::string sym_str;
824 if (it == loader::debugSymbolTable.end()) {
825 // no symbol found: use addr as label
826 sym_str = csprintf("%#x", pc);
829 } else {
830 sym_str = it->name();
831 currentFunctionStart = it->address();
832 }
833
834 ccprintf(*functionTraceStream, " (%d)\n%d: %s",
835 curTick() - functionEntryTick, curTick(), sym_str);
837 }
838}
839
840void
842{
843 std::string cause = "simpoint starting point found";
844 for (size_t i = 0; i < inst_starts.size(); ++i) {
845 scheduleInstStop(0, inst_starts[i], cause);
846 }
847}
848
849void
851{
852 std::string cause = "a thread reached the max instruction count";
853 for (ThreadID tid = 0; tid < numThreads; ++tid) {
854 scheduleInstStop(tid, max_insts, cause);
855 }
856}
857
859 : statistics::Group(parent),
860 ADD_STAT(simInsts, statistics::units::Count::get(),
861 "Number of instructions simulated"),
862 ADD_STAT(simOps, statistics::units::Count::get(),
863 "Number of ops (including micro ops) simulated"),
865 statistics::units::Count, statistics::units::Second>::get(),
866 "Simulator instruction rate (inst/s)"),
868 statistics::units::Count, statistics::units::Second>::get(),
869 "Simulator op (including micro ops) rate (op/s)")
870{
873 .precision(0)
874 .prereq(simInsts)
875 ;
876
877 simOps
879 .precision(0)
880 .prereq(simOps)
881 ;
882
884 .precision(0)
885 .prereq(simInsts)
886 ;
887
889 .precision(0)
890 .prereq(simOps)
891 ;
892
895}
896
899 : statistics::Group(parent, csprintf("fetchStats%i", thread_id).c_str()),
900 ADD_STAT(numInsts, statistics::units::Count::get(),
901 "Number of instructions fetched (thread level)"),
902 ADD_STAT(numOps, statistics::units::Count::get(),
903 "Number of ops (including micro ops) fetched (thread level)"),
905 statistics::units::Count, statistics::units::Cycle>::get(),
906 "Number of inst fetches per cycle"),
907 ADD_STAT(numBranches, statistics::units::Count::get(),
908 "Number of branches fetched"),
909 ADD_STAT(branchRate, statistics::units::Ratio::get(),
910 "Number of branch fetches per cycle"),
912 "ICache total stall cycles"),
914 "Number of times Execute suspended instruction fetching")
915
916{
918 .flags(statistics::total);
919
921 .prereq(numBranches);
922
924 .flags(statistics::total);
925
927 .prereq(icacheStallCycles);
928
929}
930
931// means it is incremented in a vector indexing and not directly
934 : statistics::Group(parent, csprintf("executeStats%i", thread_id).c_str()),
935 ADD_STAT(numInsts, statistics::units::Count::get(),
936 "Number of executed instructions"),
937 ADD_STAT(numNop, statistics::units::Count::get(),
938 "Number of nop insts executed"),
939 ADD_STAT(numBranches, statistics::units::Count::get(),
940 "Number of branches executed"),
941 ADD_STAT(numLoadInsts, statistics::units::Count::get(),
942 "Number of load instructions executed"),
943 ADD_STAT(numStoreInsts, statistics::units::Count::get(),
944 "Number of stores executed"),
946 statistics::units::Count, statistics::units::Cycle>::get(),
947 "Inst execution rate"),
949 "DCache total stall cycles"),
950 ADD_STAT(numCCRegReads, statistics::units::Count::get(),
951 "Number of times the CC registers were read"),
952 ADD_STAT(numCCRegWrites, statistics::units::Count::get(),
953 "Number of times the CC registers were written"),
955 "Number of float alu accesses"),
956 ADD_STAT(numFpRegReads, statistics::units::Count::get(),
957 "Number of times the floating registers were read"),
958 ADD_STAT(numFpRegWrites, statistics::units::Count::get(),
959 "Number of times the floating registers were written"),
961 "Number of integer alu accesses"),
962 ADD_STAT(numIntRegReads, statistics::units::Count::get(),
963 "Number of times the integer registers were read"),
965 "Number of times the integer registers were written"),
966 ADD_STAT(numMemRefs, statistics::units::Count::get(),
967 "Number of memory refs"),
969 "Number of times the Misc registers were read"),
971 "Number of times the Misc registers were written"),
973 "Number of vector alu accesses"),
975 "Number of times the predicate registers were read"),
977 "Number of times the predicate registers were written"),
978 ADD_STAT(numVecRegReads, statistics::units::Count::get(),
979 "Number of times the vector registers were read"),
981 "Number of times the vector registers were written"),
983 "Number of ops (including micro ops) which were discarded before "
984 "commit")
985{
987
989 .prereq(dcacheStallCycles);
991 .prereq(numCCRegReads)
992 .flags(statistics::nozero);
994 .prereq(numCCRegWrites)
995 .flags(statistics::nozero);
997 .prereq(numFpAluAccesses);
999 .prereq(numFpRegReads);
1001 .prereq(numIntAluAccesses);
1003 .prereq(numIntRegReads);
1005 .prereq(numIntRegWrites);
1007 .prereq(numMiscRegReads);
1009 .prereq(numMiscRegWrites);
1011 .prereq(numVecPredRegReads);
1013 .prereq(numVecPredRegWrites);
1015 .prereq(numVecRegReads);
1017 .prereq(numVecRegWrites);
1018}
1019
1021 int thread_id)
1022 : statistics::Group(parent, csprintf("commitStats%i", thread_id).c_str()),
1023 ADD_STAT(numInsts, statistics::units::Count::get(),
1024 "Number of instructions committed (thread level)"),
1025 ADD_STAT(numOps, statistics::units::Count::get(),
1026 "Number of ops (including micro ops) committed (thread level)"),
1027 ADD_STAT(
1028 numInstsNotNOP, statistics::units::Count::get(),
1029 "Number of instructions committed excluding NOPs or prefetches"),
1030 ADD_STAT(numOpsNotNOP, statistics::units::Count::get(),
1031 "Number of Ops (including micro ops) Simulated"),
1032 ADD_STAT(numUserInsts, statistics::units::Count::get(),
1033 "Numbrer of instructions committed in user mode"),
1034 ADD_STAT(numUserOps, statistics::units::Count::get(),
1035 "Number of ops committed in user mode"),
1036 ADD_STAT(ratioUserInsts, statistics::units::Ratio::get(),
1037 "Ratio of instructions committed in user mode"),
1038 ADD_STAT(ratioUserOps, statistics::units::Ratio::get(),
1039 "Ratio of ops committed in user mode"),
1040 ADD_STAT(cpi,
1041 statistics::units::Rate<statistics::units::Cycle,
1042 statistics::units::Count>::get(),
1043 "CPI: cycles per instruction (thread level)"),
1044 ADD_STAT(ipc,
1045 statistics::units::Rate<statistics::units::Count,
1046 statistics::units::Cycle>::get(),
1047 "IPC: instructions per cycle (thread level)"),
1048 ADD_STAT(numMemRefs, statistics::units::Count::get(),
1049 "Number of memory references committed"),
1050 ADD_STAT(numFpInsts, statistics::units::Count::get(),
1051 "Number of float instructions"),
1052 ADD_STAT(numIntInsts, statistics::units::Count::get(),
1053 "Number of integer instructions"),
1054 ADD_STAT(numLoadInsts, statistics::units::Count::get(),
1055 "Number of load instructions"),
1056 ADD_STAT(numStoreInsts, statistics::units::Count::get(),
1057 "Number of store instructions"),
1058 ADD_STAT(numVecInsts, statistics::units::Count::get(),
1059 "Number of vector instructions"),
1061 "Class of committed instruction."),
1062 ADD_STAT(committedControl, statistics::units::Count::get(),
1063 "Class of control type instructions committed"),
1064 ADD_STAT(functionCalls, statistics::units::Count::get(),
1065 "Number of function calls committed"),
1066 ADD_STAT(numCallsReturns, statistics::units::Count::get(),
1067 "Number of function calls and returns committed")
1068
1069{
1070 numInsts
1071 .prereq(numInsts);
1072
1073 cpi.precision(6);
1074 ipc.precision(6);
1075
1077 .init(enums::Num_OpClass)
1079
1080 for (unsigned i = 0; i < Num_OpClasses; ++i) {
1081 committedInstType.subname(i, enums::OpClassStrings[i]);
1082 }
1083
1085 .init(StaticInstFlags::Flags::Num_Flags)
1086 .flags(statistics::nozero);
1087
1088 for (unsigned i = 0; i < StaticInstFlags::Flags::Num_Flags; i++) {
1089 committedControl.subname(i, StaticInstFlags::FlagsStrings[i]);
1090 }
1091}
1092
1093
1094void
1097{
1098 /* Add a count for every control instruction type */
1099 if (staticInst->isControl()) {
1100 if (staticInst->isReturn()) {
1101 committedControl[gem5::StaticInstFlags::Flags::IsReturn]++;
1102 }
1103 if (staticInst->isCall()) {
1104 committedControl[gem5::StaticInstFlags::Flags::IsCall]++;
1105 }
1106 if (staticInst->isDirectCtrl()) {
1107 committedControl[gem5::StaticInstFlags::Flags::IsDirectControl]++;
1108 }
1109 if (staticInst->isIndirectCtrl()) {
1111 [gem5::StaticInstFlags::Flags::IsIndirectControl]++;
1112 }
1113 if (staticInst->isCondCtrl()) {
1114 committedControl[gem5::StaticInstFlags::Flags::IsCondControl]++;
1115 }
1116 if (staticInst->isUncondCtrl()) {
1117 committedControl[gem5::StaticInstFlags::Flags::IsUncondControl]++;
1118 }
1119 committedControl[gem5::StaticInstFlags::Flags::IsControl]++;
1120 }
1121}
1122
1123} // namespace gem5
#define DPRINTFN(...)
Definition trace.hh:237
#define DPRINTF(x,...)
Definition trace.hh:209
void regStats() override
Callback to set stat parameters.
Definition base.cc:451
int findContext(ThreadContext *tc)
Given a Thread Context pointer return the thread num.
Definition base.cc:541
RequestorID dataRequestorId() const
Reads this CPU's unique data requestor ID.
Definition base.hh:219
probing::PMUUPtr ppRetiredInsts
Instruction commit probe point.
Definition base.hh:545
const Cycles pwrGatingLatency
Definition base.hh:707
virtual void serializeThread(CheckpointOut &cp, ThreadID tid) const
Serialize a single thread.
Definition base.hh:453
Cycles syscallRetryLatency
Definition base.hh:686
Tick functionEntryTick
Definition base.hh:616
void traceFunctionsInternal(Addr pc)
Definition base.cc:812
const bool powerGatingOnIdle
Definition base.hh:708
void registerThreadContexts()
Definition base.cc:493
virtual void haltContext(ThreadID thread_num)
Notify the CPU that the indicated context is now halted.
Definition base.cc:608
probing::PMUUPtr ppRetiredLoads
Retired load instructions.
Definition base.hh:549
Tick instCnt
Instruction count used for SPARC misc register.
Definition base.hh:112
Addr currentFunctionEnd
Definition base.hh:615
SignalSinkPort< bool > modelResetPort
Definition base.hh:192
probing::PMUUPtr ppAllCycles
CPU cycle counter even if any thread Context is suspended.
Definition base.hh:557
probing::PMUUPtr ppRetiredInstsPC
Definition base.hh:546
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Definition base.cc:330
uint32_t getPid() const
Definition base.hh:241
System * system
Definition base.hh:416
void mwaitAtomic(ThreadID tid, ThreadContext *tc, BaseMMU *mmu)
Definition base.cc:297
Addr cacheLineSize() const
Get the cache line size of the system.
Definition base.hh:421
Cycles previousCycle
Definition base.hh:580
void enterPwrGating()
Definition base.cc:614
void updateCycleCounters(CPUState state)
base method keeping track of cycle progression
Definition base.hh:585
probing::PMUUPtr pmuProbePoint(const char *name)
Helper method to instantiate probe points belonging to this object.
Definition base.cc:385
static const uint32_t invldPid
Invalid or unknown Pid.
Definition base.hh:297
void postInterrupt(ThreadID tid, int int_num, int index)
Definition base.cc:247
std::vector< std::unique_ptr< IntSourcePin< BaseCPU > > > cpuIdlePins
Definition base.hh:288
bool mwait(ThreadID tid, PacketPtr pkt)
Definition base.cc:274
const uint32_t _socketId
Each cpu will have a socket ID that corresponds to its physical location in the system.
Definition base.hh:125
void unserialize(CheckpointIn &cp) override
Reconstruct the state of this object from a checkpoint.
Definition base.cc:757
void scheduleInstStopAnyThread(Counter max_insts)
Schedule an exit event when any threads in the core reach the max_insts instructions using the schedu...
Definition base.cc:850
void serialize(CheckpointOut &cp) const override
Serialize this object to the given output stream.
Definition base.cc:736
probing::PMUUPtr ppRetiredStores
Retired store instructions.
Definition base.hh:551
bool _switchedOut
Is the CPU switched out or active?
Definition base.hh:145
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port on this CPU.
Definition base.cc:475
Addr currentFunctionStart
Definition base.hh:614
void schedulePowerGatingEvent()
Definition base.cc:524
@ CPU_STATE_SLEEP
Definition base.hh:576
@ CPU_STATE_WAKEUP
Definition base.hh:577
static std::unique_ptr< GlobalStats > globalStats
Pointer to the global stat structure.
Definition base.hh:190
virtual Port & getDataPort()=0
Purely virtual method that returns a reference to the data port.
virtual void verifyMemoryMode() const
Verify that the system is in a memory mode supported by the CPU.
Definition base.hh:408
void regProbePoints() override
Register probe points for this object.
Definition base.cc:394
void scheduleSimpointsInstStop(std::vector< Counter > inst_starts)
Schedule simpoint events using the scheduleInstStop function.
Definition base.cc:841
uint32_t taskId() const
Get cpu task id.
Definition base.hh:237
virtual void suspendContext(ThreadID thread_num)
Notify the CPU that the indicated context is now suspended.
Definition base.cc:577
void enableFunctionTrace()
Definition base.cc:231
gem5::BaseCPU::BaseCPUStats baseStats
virtual Port & getInstPort()=0
Purely virtual method that returns a reference to the instruction port.
ThreadID numThreads
Number of threads we're actually simulating (<= SMT_MAX_THREADS).
Definition base.hh:414
probing::PMUUPtr ppRetiredBranches
Retired branches (any type)
Definition base.hh:554
void deschedulePowerGatingEvent()
Definition base.cc:516
CPUState previousState
Definition base.hh:581
virtual void wakeup(ThreadID tid)=0
probing::PMUUPtr ppActiveCycles
CPU cycle counter, only counts if any thread contexts is active.
Definition base.hh:560
bool functionTracingEnabled
Definition base.hh:612
int cpuId() const
Reads this CPU's ID.
Definition base.hh:213
uint32_t _taskId
An intrenal representation of a task identifier within gem5.
Definition base.hh:138
std::vector< BaseInterrupts * > interrupts
Definition base.hh:250
void startup() override
startup() is the final initialization call before simulation.
Definition base.cc:369
virtual void unserializeThread(CheckpointIn &cp, ThreadID tid)
Unserialize one thread.
Definition base.hh:461
virtual ~BaseCPU()
Definition base.cc:236
virtual void switchOut()
Prepare for another CPU to take over execution.
Definition base.cc:620
virtual void setReset(bool state)
Set the reset of the CPU to be either asserted or deasserted.
Definition base.cc:700
void flushTLBs()
Flush all TLBs in the CPU.
Definition base.cc:722
ThreadID contextToThread(ContextID cid)
Convert ContextID to threadID.
Definition base.cc:241
void armMonitor(ThreadID tid, Addr address)
Definition base.cc:262
ProbePointArg< bool > * ppSleeping
ProbePoint that signals transitions of threadContexts sets.
Definition base.hh:570
std::ostream * functionTraceStream
Definition base.hh:613
virtual void takeOverFrom(BaseCPU *cpu)
Load the state of a CPU from the previous CPU object, invoked on all new CPUs that are about to be sw...
Definition base.cc:634
std::vector< AddressMonitor > addressMonitor
Definition base.hh:673
const Addr _cacheLineSize
Cache the cache line size that we get from the system.
Definition base.hh:148
std::vector< ThreadContext * > threadContexts
Definition base.hh:286
static std::vector< BaseCPU * > cpuList
Static global cpu list.
Definition base.hh:621
RequestorID _instRequestorId
instruction side request id that must be placed in all requests
Definition base.hh:128
EventFunctionWrapper enterPwrGatingEvent
Definition base.hh:709
void scheduleInstStop(ThreadID tid, Counter insts, std::string cause)
Schedule an event that exits the simulation loops after a predefined number of instructions.
Definition base.cc:774
BaseCPU(const Params &params, bool is_checker=false)
Definition base.cc:129
uint32_t _pid
The current OS process ID that is executing on this processor.
Definition base.hh:142
virtual void probeInstCommit(const StaticInstPtr &inst, Addr pc)
Helper method to trigger PMU probes for a committed instruction.
Definition base.cc:410
uint64_t getCurrentInstCount(ThreadID tid)
Get the number of instructions executed by the specified thread on this CPU.
Definition base.cc:783
RequestorID _dataRequestorId
data side request id that must be placed in all requests
Definition base.hh:131
virtual void activateContext(ThreadID thread_num)
Notify the CPU that the indicated context is now active.
Definition base.cc:552
virtual void setThreadContext(ThreadContext *_tc)
Definition isa.hh:85
virtual void flushAll()
Definition mmu.cc:81
virtual void takeOverFrom(BaseMMU *old_mmu)
Definition mmu.cc:172
virtual Fault translateAtomic(const RequestPtr &req, ThreadContext *tc, Mode mode)
Definition mmu.cc:111
CPUProgressEvent(BaseCPU *_cpu, Tick ival=0)
Definition base.cc:88
Counter lastNumInst
Definition base.hh:89
virtual const char * description() const
Return a C string describing the event.
Definition base.cc:124
CheckerCPU class.
Definition cpu.hh:85
BaseMMU * getMMUPtr()
Definition cpu.hh:152
ClockedObject(const ClockedObjectParams &p)
ClockedObjectParams Params
Parameters of ClockedObject.
Tick clockEdge(Cycles cycles=Cycles(0)) const
Determine the tick when a cycle begins, by default the current one, but the argument also enables the...
Event(Priority p=Default_Pri, Flags f=0)
Definition eventq.hh:407
virtual std::string name() const
Definition named.hh:60
OutputStream * findOrCreate(const std::string &name, bool binary=false)
Definition output.cc:262
std::ostream * stream() const
Get the output underlying output stream.
Definition output.hh:62
Addr instAddr() const
Returns the memory address of the instruction this PC points to.
Definition pcstate.hh:108
Addr getAddr() const
Definition packet.hh:807
RequestPtr req
A pointer to the original request.
Definition packet.hh:377
Ports are used to interface objects to each other.
Definition port.hh:62
bool isConnected() const
Is this port currently connected to a peer?
Definition port.hh:133
void takeOverFrom(Port *old)
A utility function to make it easier to swap out ports.
Definition port.hh:137
enums::PwrState get() const
ProbePointArg generates a point for the class of Arg.
Definition probe.hh:273
void assignThreadContext(ContextID context_id)
Definition process.hh:135
Static instruction class for unknown (illegal) instructions.
Definition unknown.hh:53
static Root * root()
Use this function to get a pointer to the single Root object in the simulation.
Definition root.hh:93
bool isDirectCtrl() const
bool isUncondCtrl() const
bool isLoad() const
bool isReturn() const
bool isIndirectCtrl() const
bool isLastMicroop() const
bool isStore() const
bool isAtomic() const
bool isMicroop() const
bool isCall() const
bool isCondCtrl() const
bool isControl() const
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual BaseISA * getIsaPtr() const =0
virtual void takeOverFrom(ThreadContext *old_context)=0
virtual CheckerCPU * getCheckerCpuPtr()=0
@ Suspended
Temporarily inactive.
virtual const PCStateBase & pcState() const =0
virtual int threadId() const =0
virtual BaseMMU * getMMUPtr()=0
virtual Process * getProcessPtr()=0
virtual ContextID contextId() const =0
Statistics container.
Definition group.hh:93
STL vector class.
Definition stl.hh:37
ClockedObject declaration and implementation.
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
Definition group.hh:75
static constexpr T roundDown(const T &val, const U &align)
This function is used to align addresses in memory.
Definition intmath.hh:279
void deschedule(Event &event)
Definition eventq.hh:1021
void schedule(Event &event, Tick when)
Definition eventq.hh:1012
static const Priority Progress_Event_Pri
Progress events come at the end.
Definition eventq.hh:229
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
Definition logging.hh:268
#define fatal(...)
This implements a cprintf based fatal() function.
Definition logging.hh:232
const Params & params() const
ProbeManager * getProbeManager()
Get the probe manager for this object.
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
virtual void regStats()
Callback to set stat parameters.
Definition group.cc:68
Bitfield< 3, 0 > mask
Definition pcstate.hh:63
Bitfield< 5 > t
Definition misc_types.hh:71
Bitfield< 7 > i
Definition misc_types.hh:67
Bitfield< 4 > pc
Bitfield< 10, 5 > event
Bitfield< 30, 0 > index
Bitfield< 0 > p
Bitfield< 3 > addr
Definition types.hh:84
Special TaskIds that are used for per-context-switch stats dumps and Cache Occupancy.
Definition request.hh:79
SymbolTable debugSymbolTable
Global unified debugging symbol table (for target).
Definition symtab.cc:55
std::unique_ptr< PMU > PMUUPtr
Definition pmu.hh:60
ProbePointArg< uint64_t > PMU
PMU probe point.
Definition pmu.hh:59
Units for Stats.
Definition units.hh:113
const FlagsType pdf
Print the percent of the total that this entry represents.
Definition info.hh:61
const FlagsType nozero
Don't print if this is zero.
Definition info.hh:67
const FlagsType total
Print the total.
Definition info.hh:59
double Counter
All counters are of 64-bit values.
Definition types.hh:46
const FlagsType dist
Print the distribution.
Definition info.hh:65
Copyright (c) 2024 Arm Limited All rights reserved.
Definition binary32.hh:36
std::shared_ptr< FaultBase > Fault
Definition types.hh:249
int16_t ThreadID
Thread index/ID type.
Definition types.hh:235
std::shared_ptr< Request > RequestPtr
Definition request.hh:94
IntSourcePinBase IntSourcePin
Definition intpin.hh:102
statistics::Value & hostSeconds
Definition stats.cc:48
static const OpClass Num_OpClasses
Definition op_class.hh:149
void cprintf(const char *format, const Args &...args)
Definition cprintf.hh:155
Tick curTick()
The universal simulation clock.
Definition cur_tick.hh:46
std::ostream CheckpointOut
Definition serialize.hh:66
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition types.hh:245
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
Definition root.cc:220
OutputDirectory simout
Definition output.cc:62
uint64_t Tick
Tick count type.
Definition types.hh:58
Packet * PacketPtr
int maxThreadsPerCPU
The maximum number of active threads across all cpus.
Definition base.cc:86
RefCountingPtr< StaticInst > StaticInstPtr
int ContextID
Globally unique thread context ID.
Definition types.hh:239
std::string csprintf(const char *format, const Args &...args)
Definition cprintf.hh:161
constexpr decltype(nullptr) NoFault
Definition types.hh:253
void ccprintf(cp::Print &print)
Definition cprintf.hh:130
Declarations of a non-full system Page Table.
#define UNSERIALIZE_SCALAR(scalar)
Definition serialize.hh:575
#define SERIALIZE_SCALAR(scalar)
Definition serialize.hh:568
bool doMonitor(PacketPtr pkt)
Definition base.cc:796
statistics::Scalar numWorkItemsStarted
Definition base.hh:668
BaseCPUStats(statistics::Group *parent)
Definition base.cc:428
statistics::Formula ipc
Definition base.hh:667
statistics::Formula cpi
Definition base.hh:666
statistics::Scalar numInsts
Definition base.hh:661
statistics::Scalar numCycles
Definition base.hh:664
statistics::Scalar numWorkItemsCompleted
Definition base.hh:669
statistics::Scalar numCallsReturns
Definition base.hh:852
statistics::Scalar numFpInsts
Definition base.hh:828
statistics::Vector committedInstType
Definition base.hh:843
statistics::Scalar numVecInsts
Definition base.hh:840
void updateComCtrlStats(const StaticInstPtr staticInst)
Definition base.cc:1096
statistics::Vector committedControl
Definition base.hh:846
statistics::Scalar numInstsNotNOP
Definition base.hh:809
statistics::Formula cpi
Definition base.hh:821
statistics::Scalar numUserInsts
Definition base.hh:813
statistics::Scalar numStoreInsts
Definition base.hh:837
statistics::Scalar numInsts
Definition base.hh:805
CommitCPUStats(statistics::Group *parent, int thread_id)
Definition base.cc:1020
statistics::Formula ipc
Definition base.hh:822
statistics::Formula ratioUserOps
Definition base.hh:818
statistics::Scalar numOpsNotNOP
Definition base.hh:810
statistics::Scalar numUserOps
Definition base.hh:814
statistics::Scalar numLoadInsts
Definition base.hh:834
statistics::Scalar numIntInsts
Definition base.hh:831
statistics::Scalar functionCalls
Definition base.hh:849
statistics::Scalar numMemRefs
Definition base.hh:825
statistics::Scalar numOps
Definition base.hh:806
statistics::Formula ratioUserInsts
Definition base.hh:817
statistics::Scalar numIntRegReads
Definition base.hh:775
statistics::Scalar numVecPredRegReads
Definition base.hh:789
statistics::Scalar dcacheStallCycles
Definition base.hh:758
statistics::Scalar numCCRegReads
Definition base.hh:761
statistics::Scalar numBranches
Definition base.hh:749
statistics::Scalar numInsts
Definition base.hh:745
statistics::Scalar numIntRegWrites
Definition base.hh:776
statistics::Formula numStoreInsts
Definition base.hh:753
statistics::Scalar numMemRefs
Definition base.hh:779
statistics::Formula instRate
Definition base.hh:755
statistics::Scalar numVecAluAccesses
Definition base.hh:786
statistics::Scalar numMiscRegReads
Definition base.hh:782
statistics::Scalar numCCRegWrites
Definition base.hh:762
statistics::Scalar numVecPredRegWrites
Definition base.hh:790
statistics::Scalar numFpAluAccesses
Definition base.hh:765
statistics::Scalar numFpRegWrites
Definition base.hh:769
statistics::Scalar numDiscardedOps
Definition base.hh:797
statistics::Scalar numNop
Definition base.hh:747
statistics::Scalar numIntAluAccesses
Definition base.hh:772
ExecuteCPUStats(statistics::Group *parent, int thread_id)
Definition base.cc:933
statistics::Scalar numVecRegWrites
Definition base.hh:794
statistics::Scalar numFpRegReads
Definition base.hh:768
statistics::Scalar numVecRegReads
Definition base.hh:793
statistics::Scalar numMiscRegWrites
Definition base.hh:783
statistics::Scalar numLoadInsts
Definition base.hh:751
statistics::Scalar numOps
Definition base.hh:721
statistics::Scalar numInsts
Definition base.hh:718
statistics::Formula fetchRate
Definition base.hh:724
statistics::Formula branchRate
Definition base.hh:730
statistics::Scalar numFetchSuspends
Definition base.hh:736
statistics::Scalar numBranches
Definition base.hh:727
FetchCPUStats(statistics::Group *parent, int thread_id)
Definition base.cc:898
statistics::Scalar icacheStallCycles
Definition base.hh:733
Global CPU statistics that are merged into the Root object.
Definition base.hh:152
statistics::Value simOps
Definition base.hh:156
statistics::Formula hostInstRate
Definition base.hh:158
statistics::Value simInsts
Definition base.hh:155
static Counter numSimulatedInsts()
Definition base.hh:165
GlobalStats(statistics::Group *parent)
Definition base.cc:858
static Counter numSimulatedOps()
Definition base.hh:171
statistics::Formula hostOpRate
Definition base.hh:159
const std::string & name()
Definition trace.cc:48

Generated on Mon Oct 27 2025 04:13:00 for gem5 by doxygen 1.14.0