gem5  v20.1.0.0
base.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2013, 2017, 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  * All rights reserved.
17  *
18  * Redistribution and use in source and binary forms, with or without
19  * modification, are permitted provided that the following conditions are
20  * met: redistributions of source code must retain the above copyright
21  * notice, this list of conditions and the following disclaimer;
22  * redistributions in binary form must reproduce the above copyright
23  * notice, this list of conditions and the following disclaimer in the
24  * documentation and/or other materials provided with the distribution;
25  * neither the name of the copyright holders nor the names of its
26  * contributors may be used to endorse or promote products derived from
27  * this software without specific prior written permission.
28  *
29  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40  */
41 
42 #ifndef __CPU_BASE_HH__
43 #define __CPU_BASE_HH__
44 
45 #include <vector>
46 
47 // Before we do anything else, check if this build is the NULL ISA,
48 // and if so stop here
49 #include "config/the_isa.hh"
50 #if THE_ISA == NULL_ISA
51 #include "arch/null/cpu_dummy.hh"
52 #else
54 #include "base/statistics.hh"
55 #include "mem/port_proxy.hh"
56 #include "sim/clocked_object.hh"
57 #include "sim/eventq.hh"
58 #include "sim/full_system.hh"
59 #include "sim/insttracer.hh"
60 #include "sim/probe/pmu.hh"
61 #include "sim/probe/probe.hh"
62 #include "sim/system.hh"
63 #include "debug/Mwait.hh"
64 
65 class BaseCPU;
66 struct BaseCPUParams;
67 class CheckerCPU;
68 class ThreadContext;
69 
71 {
73  bool doMonitor(PacketPtr pkt);
74 
75  bool armed;
78  uint64_t val;
79  bool waiting; // 0=normal, 1=mwaiting
80  bool gotWakeup;
81 };
82 
83 class CPUProgressEvent : public Event
84 {
85  protected:
90 
91  public:
92  CPUProgressEvent(BaseCPU *_cpu, Tick ival = 0);
93 
94  void process();
95 
96  void interval(Tick ival) { _interval = ival; }
97  Tick interval() { return _interval; }
98 
99  void repeatEvent(bool repeat) { _repeatEvent = repeat; }
100 
101  virtual const char *description() const;
102 };
103 
104 class BaseCPU : public ClockedObject
105 {
106  protected:
107 
111 
112  // every cpu has an id, put it in the base cpu
113  // Set at initialization, only time a cpuId might change is during a
114  // takeover (which should be done from within the BaseCPU anyway,
115  // therefore no setCpuId() method is provided
116  int _cpuId;
117 
123  const uint32_t _socketId;
124 
127 
130 
136  uint32_t _taskId;
137 
140  uint32_t _pid;
141 
144 
146  const unsigned int _cacheLineSize;
147 
148  public:
149 
156  virtual Port &getDataPort() = 0;
157 
163  {
164  auto port = dynamic_cast<RequestPort *>(&getDataPort());
165  assert(port);
166  return [port](PacketPtr pkt)->void { port->sendFunctional(pkt); };
167  }
168 
175  virtual Port &getInstPort() = 0;
176 
178  int cpuId() const { return _cpuId; }
179 
181  uint32_t socketId() const { return _socketId; }
182 
187 
198  Port &getPort(const std::string &if_name,
199  PortID idx=InvalidPortID) override;
200 
202  uint32_t taskId() const { return _taskId; }
204  void taskId(uint32_t id) { _taskId = id; }
205 
206  uint32_t getPid() const { return _pid; }
207  void setPid(uint32_t pid) { _pid = pid; }
208 
209  inline void workItemBegin() { numWorkItemsStarted++; }
210  inline void workItemEnd() { numWorkItemsCompleted++; }
211  // @todo remove me after debugging with legion done
212  Tick instCount() { return instCnt; }
213 
214  protected:
216 
217  public:
220  {
221  if (interrupts.empty())
222  return NULL;
223 
224  assert(interrupts.size() > tid);
225  return interrupts[tid];
226  }
227 
228  virtual void wakeup(ThreadID tid) = 0;
229 
230  void
231  postInterrupt(ThreadID tid, int int_num, int index);
232 
233  void
234  clearInterrupt(ThreadID tid, int int_num, int index)
235  {
236  interrupts[tid]->clear(int_num, index);
237  }
238 
239  void
241  {
242  interrupts[tid]->clearAll();
243  }
244 
245  bool
247  {
248  return FullSystem && interrupts[tid]->checkInterrupts();
249  }
250 
251  protected:
253 
255 
256  public:
257 
258 
261  static const uint32_t invldPid = std::numeric_limits<uint32_t>::max();
262 
263  // Mask to align PCs to MachInst sized boundaries
264  static const Addr PCMask = ~((Addr)sizeof(TheISA::MachInst) - 1);
265 
268 
270  virtual void activateContext(ThreadID thread_num);
271 
274  virtual void suspendContext(ThreadID thread_num);
275 
277  virtual void haltContext(ThreadID thread_num);
278 
280  int findContext(ThreadContext *tc);
281 
283  virtual ThreadContext *getContext(int tn) { return threadContexts[tn]; }
284 
286  unsigned numContexts() {
287  return static_cast<unsigned>(threadContexts.size());
288  }
289 
292  { return static_cast<ThreadID>(cid - threadContexts[0]->contextId()); }
293 
294  public:
295  typedef BaseCPUParams Params;
296  const Params *params() const
297  { return reinterpret_cast<const Params *>(_params); }
298  BaseCPU(Params *params, bool is_checker = false);
299  virtual ~BaseCPU();
300 
301  void init() override;
302  void startup() override;
303  void regStats() override;
304 
305  void regProbePoints() override;
306 
307  void registerThreadContexts();
308 
309  // Functions to deschedule and reschedule the events to enter the
310  // power gating sleep before and after checkpoiting respectively.
313 
321  virtual void switchOut();
322 
334  virtual void takeOverFrom(BaseCPU *cpu);
335 
345  void flushTLBs();
346 
352  bool switchedOut() const { return _switchedOut; }
353 
363  virtual void verifyMemoryMode() const { };
364 
370 
372 
376  inline unsigned int cacheLineSize() const { return _cacheLineSize; }
377 
388  void serialize(CheckpointOut &cp) const override;
389 
400  void unserialize(CheckpointIn &cp) override;
401 
408  virtual void serializeThread(CheckpointOut &cp, ThreadID tid) const {};
409 
416  virtual void unserializeThread(CheckpointIn &cp, ThreadID tid) {};
417 
418  virtual Counter totalInsts() const = 0;
419 
420  virtual Counter totalOps() const = 0;
421 
435  void scheduleInstStop(ThreadID tid, Counter insts, const char *cause);
436 
444  uint64_t getCurrentInstCount(ThreadID tid);
445 
446  public:
459  virtual void probeInstCommit(const StaticInstPtr &inst, Addr pc);
460 
461  protected:
470 
481 
486 
489 
492 
495 
507  enum CPUState {
511  };
512 
515 
517  inline void updateCycleCounters(CPUState state)
518  {
519  uint32_t delta = curCycle() - previousCycle;
520 
521  if (previousState == CPU_STATE_ON) {
522  ppActiveCycles->notify(delta);
523  }
524 
525  switch (state)
526  {
527  case CPU_STATE_WAKEUP:
528  ppSleeping->notify(false);
529  break;
530  case CPU_STATE_SLEEP:
531  ppSleeping->notify(true);
532  break;
533  default:
534  break;
535  }
536 
537  ppAllCycles->notify(delta);
538 
539  previousCycle = curCycle();
540  previousState = state;
541  }
542 
543  // Function tracing
544  private:
546  std::ostream *functionTraceStream;
550  void enableFunctionTrace();
552 
553  private:
555 
556  public:
558  {
561  }
562 
563  static int numSimulatedCPUs() { return cpuList.size(); }
565  {
566  Counter total = 0;
567 
568  int size = cpuList.size();
569  for (int i = 0; i < size; ++i)
570  total += cpuList[i]->totalInsts();
571 
572  return total;
573  }
574 
576  {
577  Counter total = 0;
578 
579  int size = cpuList.size();
580  for (int i = 0; i < size; ++i)
581  total += cpuList[i]->totalOps();
582 
583  return total;
584  }
585 
586  public:
587  // Number of CPU cycles simulated
591 
592  private:
594 
595  public:
596  void armMonitor(ThreadID tid, Addr address);
597  bool mwait(ThreadID tid, PacketPtr pkt);
598  void mwaitAtomic(ThreadID tid, ThreadContext *tc, BaseTLB *dtb);
600  {
601  assert(tid < numThreads);
602  return &addressMonitor[tid];
603  }
604 
605  bool waitForRemoteGDB() const;
606 
608 
609  // Enables CPU to enter power gating on a configurable cycle count
610  protected:
611  void enterPwrGating();
612 
614  const bool powerGatingOnIdle;
616 };
617 
618 #endif // THE_ISA == NULL_ISA
619 
620 #endif // __CPU_BASE_HH__
BaseCPU::mwait
bool mwait(ThreadID tid, PacketPtr pkt)
Definition: base.cc:212
BaseCPU::ppRetiredInstsPC
ProbePoints::PMUUPtr ppRetiredInstsPC
Definition: base.hh:480
BaseCPU::_cpuId
int _cpuId
Definition: base.hh:116
BaseCPU::regStats
void regStats() override
Definition: base.cc:369
BaseCPU::getPort
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port on this CPU.
Definition: base.cc:402
CPUProgressEvent::CPUProgressEvent
CPUProgressEvent(BaseCPU *_cpu, Tick ival=0)
Definition: base.cc:82
BaseCPU::flushTLBs
void flushTLBs()
Flush all TLBs in the CPU.
Definition: base.cc:635
BaseCPU::serializeThread
virtual void serializeThread(CheckpointOut &cp, ThreadID tid) const
Serialize a single thread.
Definition: base.hh:408
BaseCPU::functionTracingEnabled
bool functionTracingEnabled
Definition: base.hh:545
BaseCPU::taskId
void taskId(uint32_t id)
Set cpu task id.
Definition: base.hh:204
BaseCPU::getCurrentInstCount
uint64_t getCurrentInstCount(ThreadID tid)
Get the number of instructions executed by the specified thread on this CPU.
Definition: base.cc:698
BaseCPU::CPUState
CPUState
Definition: base.hh:507
system.hh
BaseCPU::ppRetiredBranches
ProbePoints::PMUUPtr ppRetiredBranches
Retired branches (any type)
Definition: base.hh:488
BaseCPU::previousState
CPUState previousState
Definition: base.hh:514
BaseCPU::verifyMemoryMode
virtual void verifyMemoryMode() const
Verify that the system is in a memory mode supported by the CPU.
Definition: base.hh:363
MipsISA::index
Bitfield< 30, 0 > index
Definition: pra_constants.hh:44
BaseCPU::init
void init() override
Definition: base.cc:267
BaseCPU::_pid
uint32_t _pid
The current OS process ID that is executing on this processor.
Definition: base.hh:140
CPUProgressEvent::lastNumInst
Counter lastNumInst
Definition: base.hh:87
InvalidPortID
const PortID InvalidPortID
Definition: types.hh:238
ArmISA::i
Bitfield< 7 > i
Definition: miscregs_types.hh:63
BaseCPU::getDataPort
virtual Port & getDataPort()=0
Purely virtual method that returns a reference to the data port.
ThreadID
int16_t ThreadID
Thread index/ID type.
Definition: types.hh:227
BaseCPU::ppAllCycles
ProbePoints::PMUUPtr ppAllCycles
CPU cycle counter even if any thread Context is suspended.
Definition: base.hh:491
insttracer.hh
BaseCPU::tracer
Trace::InstTracer * tracer
Definition: base.hh:254
ArmISA::MachInst
uint32_t MachInst
Definition: types.hh:52
CPUProgressEvent::interval
Tick interval()
Definition: base.hh:97
BaseCPU::numSimulatedCPUs
static int numSimulatedCPUs()
Definition: base.hh:563
ContextID
int ContextID
Globally unique thread context ID.
Definition: types.hh:231
AddressMonitor::doMonitor
bool doMonitor(PacketPtr pkt)
Definition: base.cc:709
CPUProgressEvent::description
virtual const char * description() const
Return a C string describing the event.
Definition: base.cc:118
BaseCPU::cacheLineSize
unsigned int cacheLineSize() const
Get the cache line size of the system.
Definition: base.hh:376
CPUProgressEvent::_interval
Tick _interval
Definition: base.hh:86
ProbePointArg< bool >
BaseCPU::armMonitor
void armMonitor(ThreadID tid, Addr address)
Definition: base.cc:200
Tick
uint64_t Tick
Tick count type.
Definition: types.hh:63
PortID
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition: types.hh:237
BaseCPU::syscallRetryLatency
Cycles syscallRetryLatency
Definition: base.hh:607
CheckerCPU
CheckerCPU class.
Definition: cpu.hh:85
BaseCPU::wakeup
static void wakeup(ThreadID tid)
Definition: cpu_dummy.hh:48
BaseCPU::mwaitAtomic
void mwaitAtomic(ThreadID tid, ThreadContext *tc, BaseTLB *dtb)
Definition: base.cc:235
BaseCPU::enableFunctionTrace
void enableFunctionTrace()
Definition: base.cc:179
BaseCPU::postInterrupt
void postInterrupt(ThreadID tid, int int_num, int index)
Definition: base.cc:189
std::vector< BaseInterrupts * >
BaseCPU::registerThreadContexts
void registerThreadContexts()
Definition: base.cc:416
BaseCPU::deschedulePowerGatingEvent
void deschedulePowerGatingEvent()
Definition: base.cc:444
FullSystem
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
Definition: root.cc:132
BaseCPU::socketId
uint32_t socketId() const
Reads this CPU's Socket ID.
Definition: base.hh:181
BaseCPU::totalOps
virtual Counter totalOps() const =0
BaseCPU::getContext
virtual ThreadContext * getContext(int tn)
Given a thread num get tho thread context for it.
Definition: base.hh:283
BaseCPU::ppRetiredLoads
ProbePoints::PMUUPtr ppRetiredLoads
Retired load instructions.
Definition: base.hh:483
BaseCPU::numCycles
Stats::Scalar numCycles
Definition: base.hh:588
ProbePointArg::notify
void notify(const Arg &arg)
called at the ProbePoint call site, passes arg to each listener.
Definition: probe.hh:286
BaseCPU::getPid
uint32_t getPid() const
Definition: base.hh:206
BaseCPU::invldPid
static const uint32_t invldPid
Invalid or unknown Pid.
Definition: base.hh:261
BaseTLB
Definition: tlb.hh:50
AddressMonitor::vAddr
Addr vAddr
Definition: base.hh:76
AddressMonitor
Definition: base.hh:70
ClockedObject
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
Definition: clocked_object.hh:231
BaseCPU::updateCycleCounters
void updateCycleCounters(CPUState state)
base method keeping track of cycle progression
Definition: base.hh:517
EventFunctionWrapper
Definition: eventq.hh:1101
pmu.hh
BaseCPU::getSendFunctional
virtual PortProxy::SendFunctionalFunc getSendFunctional()
Returns a sendFunctional delegate for use with port proxies.
Definition: base.hh:162
CPUProgressEvent::cpu
BaseCPU * cpu
Definition: base.hh:88
Stats::Scalar
This is a simple scalar statistic, like a counter.
Definition: statistics.hh:2533
RequestorID
uint16_t RequestorID
Definition: request.hh:85
Counter
int64_t Counter
Statistics counter type.
Definition: types.hh:58
CPUProgressEvent
Definition: base.hh:83
BaseCPU::findContext
int findContext(ThreadContext *tc)
Given a Thread Context pointer return the thread num.
Definition: base.cc:469
cp
Definition: cprintf.cc:40
BaseCPU::workItemBegin
void workItemBegin()
Definition: base.hh:209
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:88
Event
Definition: eventq.hh:246
BaseCPU::traceFunctionsInternal
void traceFunctionsInternal(Addr pc)
Definition: base.cc:724
BaseCPU::_instRequestorId
RequestorID _instRequestorId
instruction side request id that must be placed in all requests
Definition: base.hh:126
BaseCPU::_cacheLineSize
const unsigned int _cacheLineSize
Cache the cache line size that we get from the system.
Definition: base.hh:146
System
Definition: system.hh:73
BaseCPU::numSimulatedInsts
static Counter numSimulatedInsts()
Definition: base.hh:564
BaseCPU::instCnt
Tick instCnt
Instruction count used for SPARC misc register.
Definition: base.hh:110
MipsISA::pc
Bitfield< 4 > pc
Definition: pra_constants.hh:240
BaseCPU::interrupts
std::vector< BaseInterrupts * > interrupts
Definition: base.hh:215
statistics.hh
BaseCPU::numWorkItemsStarted
Stats::Scalar numWorkItemsStarted
Definition: base.hh:589
CPUProgressEvent::repeatEvent
void repeatEvent(bool repeat)
Definition: base.hh:99
BaseCPU::BaseCPU
BaseCPU(Params *params, bool is_checker=false)
Definition: base.cc:123
Port
Ports are used to interface objects to each other.
Definition: port.hh:56
BaseCPU::_taskId
uint32_t _taskId
An intrenal representation of a task identifier within gem5.
Definition: base.hh:136
BaseCPU::ppActiveCycles
ProbePoints::PMUUPtr ppActiveCycles
CPU cycle counter, only counts if any thread contexts is active.
Definition: base.hh:494
port_proxy.hh
BaseCPU::threadContexts
std::vector< ThreadContext * > threadContexts
Definition: base.hh:252
BaseCPU::currentFunctionEnd
Addr currentFunctionEnd
Definition: base.hh:548
BaseCPU::clearInterrupt
void clearInterrupt(ThreadID tid, int int_num, int index)
Definition: base.hh:234
BaseCPU::serialize
void serialize(CheckpointOut &cp) const override
Serialize this object to the given output stream.
Definition: base.cc:651
BaseCPU::activateContext
virtual void activateContext(ThreadID thread_num)
Notify the CPU that the indicated context is now active.
Definition: base.cc:480
BaseCPU::previousCycle
Cycles previousCycle
Definition: base.hh:513
PortProxy::SendFunctionalFunc
std::function< void(PacketPtr pkt)> SendFunctionalFunc
Definition: port_proxy.hh:83
BaseCPU::pmuProbePoint
ProbePoints::PMUUPtr pmuProbePoint(const char *name)
Helper method to instantiate probe points belonging to this object.
Definition: base.cc:326
BaseCPU::functionEntryTick
Tick functionEntryTick
Definition: base.hh:549
BaseCPU::setPid
void setPid(uint32_t pid)
Definition: base.hh:207
BaseCPU::ppRetiredStores
ProbePoints::PMUUPtr ppRetiredStores
Retired store instructions.
Definition: base.hh:485
BaseCPU::getCpuAddrMonitor
AddressMonitor * getCpuAddrMonitor(ThreadID tid)
Definition: base.hh:599
RequestPort
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
Definition: port.hh:74
BaseCPU::numContexts
unsigned numContexts()
Get the number of thread contexts available.
Definition: base.hh:286
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
AddressMonitor::pAddr
Addr pAddr
Definition: base.hh:77
BaseCPU::params
const Params * params() const
Definition: base.hh:296
BaseCPU::CPU_STATE_WAKEUP
@ CPU_STATE_WAKEUP
Definition: base.hh:510
BaseCPU::ppRetiredInsts
ProbePoints::PMUUPtr ppRetiredInsts
Instruction commit probe point.
Definition: base.hh:479
name
const std::string & name()
Definition: trace.cc:50
BaseCPU::contextToThread
ThreadID contextToThread(ContextID cid)
Convert ContextID to threadID.
Definition: base.hh:291
full_system.hh
cpu_dummy.hh
ProbePoints::PMUUPtr
std::unique_ptr< PMU > PMUUPtr
Definition: pmu.hh:56
BaseCPU::instRequestorId
RequestorID instRequestorId() const
Reads this CPU's unique instruction requestor ID.
Definition: base.hh:186
BaseCPU::taskId
uint32_t taskId() const
Get cpu task id.
Definition: base.hh:202
BaseCPU
Definition: cpu_dummy.hh:43
AddressMonitor::AddressMonitor
AddressMonitor()
Definition: base.cc:703
BaseCPU::Params
BaseCPUParams Params
Definition: base.hh:295
BaseCPU::pwrGatingLatency
const Cycles pwrGatingLatency
Definition: base.hh:613
AddressMonitor::val
uint64_t val
Definition: base.hh:78
BaseCPU::haltContext
virtual void haltContext(ThreadID thread_num)
Notify the CPU that the indicated context is now halted.
Definition: base.cc:520
CPUProgressEvent::interval
void interval(Tick ival)
Definition: base.hh:96
BaseCPU::schedulePowerGatingEvent
void schedulePowerGatingEvent()
Definition: base.cc:452
BaseCPU::system
System * system
Definition: base.hh:371
BaseCPU::takeOverFrom
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:546
BaseCPU::clearInterrupts
void clearInterrupts(ThreadID tid)
Definition: base.hh:240
clocked_object.hh
Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:257
BaseCPU::switchOut
virtual void switchOut()
Prepare for another CPU to take over execution.
Definition: base.cc:532
BaseCPU::_dataRequestorId
RequestorID _dataRequestorId
data side request id that must be placed in all requests
Definition: base.hh:129
interrupts.hh
BaseCPU::PCMask
static const Addr PCMask
Definition: base.hh:264
BaseCPU::getTracer
Trace::InstTracer * getTracer()
Provide access to the tracer pointer.
Definition: base.hh:267
BaseCPU::numThreads
ThreadID numThreads
Number of threads we're actually simulating (<= SMT_MAX_THREADS).
Definition: base.hh:363
CPUProgressEvent::process
void process()
Definition: base.cc:91
BaseCPU::traceFunctions
void traceFunctions(Addr pc)
Definition: base.hh:557
BaseCPU::dataRequestorId
RequestorID dataRequestorId() const
Reads this CPU's unique data requestor ID.
Definition: base.hh:184
Cycles
Cycles is a wrapper class for representing cycle counts, i.e.
Definition: types.hh:83
BaseCPU::functionTraceStream
std::ostream * functionTraceStream
Definition: base.hh:546
BaseCPU::scheduleInstStop
void scheduleInstStop(ThreadID tid, Counter insts, const char *cause)
Schedule an event that exits the simulation loops after a predefined number of instructions.
Definition: base.cc:689
CPUProgressEvent::_repeatEvent
bool _repeatEvent
Definition: base.hh:89
CheckpointOut
std::ostream CheckpointOut
Definition: serialize.hh:63
BaseCPU::numSimulatedOps
static Counter numSimulatedOps()
Definition: base.hh:575
BaseCPU::startup
void startup() override
Definition: base.cc:310
Trace::InstTracer
Definition: insttracer.hh:257
BaseCPU::cpuList
static std::vector< BaseCPU * > cpuList
Static global cpu list.
Definition: base.hh:554
BaseCPU::regProbePoints
void regProbePoints() override
Definition: base.cc:335
BaseCPU::CPU_STATE_ON
@ CPU_STATE_ON
Definition: base.hh:508
BaseCPU::enterPwrGating
void enterPwrGating()
Definition: base.cc:526
BaseCPU::suspendContext
virtual void suspendContext(ThreadID thread_num)
Notify the CPU that the indicated context is now suspended.
Definition: base.cc:494
RefCountingPtr< StaticInst >
BaseCPU::enterPwrGatingEvent
EventFunctionWrapper enterPwrGatingEvent
Definition: base.hh:615
BaseCPU::_socketId
const uint32_t _socketId
Each cpu will have a socket ID that corresponds to its physical location in the system.
Definition: base.hh:123
BaseCPU::numWorkItemsCompleted
Stats::Scalar numWorkItemsCompleted
Definition: base.hh:590
BaseCPU::currentFunctionStart
Addr currentFunctionStart
Definition: base.hh:547
BaseCPU::CPU_STATE_SLEEP
@ CPU_STATE_SLEEP
Definition: base.hh:509
BaseCPU::totalInsts
virtual Counter totalInsts() const =0
BaseCPU::addressMonitor
std::vector< AddressMonitor > addressMonitor
Definition: base.hh:593
BaseCPU::instCount
Tick instCount()
Definition: base.hh:212
AddressMonitor::gotWakeup
bool gotWakeup
Definition: base.hh:80
probe.hh
BaseCPU::unserializeThread
virtual void unserializeThread(CheckpointIn &cp, ThreadID tid)
Unserialize one thread.
Definition: base.hh:416
BaseCPU::switchedOut
bool switchedOut() const
Determine if the CPU is switched out.
Definition: base.hh:352
BaseInterrupts
Definition: interrupts.hh:37
BaseCPU::_switchedOut
bool _switchedOut
Is the CPU switched out or active?
Definition: base.hh:143
Stats::total
const FlagsType total
Print the total.
Definition: info.hh:49
BaseCPU::workItemEnd
void workItemEnd()
Definition: base.hh:210
CheckpointIn
Definition: serialize.hh:67
BaseCPU::unserialize
void unserialize(CheckpointIn &cp) override
Reconstruct the state of this object from a checkpoint.
Definition: base.cc:672
BaseCPU::probeInstCommit
virtual void probeInstCommit(const StaticInstPtr &inst, Addr pc)
Helper method to trigger PMU probes for a committed instruction.
Definition: base.cc:351
BaseCPU::checkInterrupts
bool checkInterrupts(ThreadID tid) const
Definition: base.hh:246
BaseCPU::getInstPort
virtual Port & getInstPort()=0
Purely virtual method that returns a reference to the instruction port.
BaseCPU::waitForRemoteGDB
bool waitForRemoteGDB() const
Definition: base.cc:753
AddressMonitor::armed
bool armed
Definition: base.hh:75
BaseCPU::getInterruptController
BaseInterrupts * getInterruptController(ThreadID tid)
Definition: base.hh:219
BaseCPU::~BaseCPU
virtual ~BaseCPU()
Definition: base.cc:184
BaseCPU::cpuId
int cpuId() const
Reads this CPU's ID.
Definition: base.hh:178
AddressMonitor::waiting
bool waiting
Definition: base.hh:79
BaseCPU::ppSleeping
ProbePointArg< bool > * ppSleeping
ProbePoint that signals transitions of threadContexts sets.
Definition: base.hh:504
ArmISA::id
Bitfield< 33 > id
Definition: miscregs_types.hh:247
BaseCPU::powerGatingOnIdle
const bool powerGatingOnIdle
Definition: base.hh:614
eventq.hh

Generated on Wed Sep 30 2020 14:02:07 for gem5 by doxygen 1.8.17