gem5  v21.0.1.0
base.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2012, 2015, 2017, 2018, 2020 ARM Limited
3  * Copyright (c) 2013 Advanced Micro Devices, Inc.
4  * All rights reserved
5  *
6  * The license below extends only to copyright in the software and shall
7  * not be construed as granting a license to any other intellectual
8  * property including but not limited to intellectual property relating
9  * to a hardware implementation of the functionality of the software
10  * licensed hereunder. You may use the software subject to the license
11  * terms below provided that you ensure that this notice is replicated
12  * unmodified and in its entirety in all distributions of the software,
13  * modified or unmodified, in source code or in binary form.
14  *
15  * Copyright (c) 2002-2005 The Regents of The University of Michigan
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 #include "cpu/simple/base.hh"
43 
44 #include "arch/utility.hh"
45 #include "base/cprintf.hh"
46 #include "base/inifile.hh"
47 #include "base/loader/symtab.hh"
48 #include "base/logging.hh"
49 #include "base/pollevent.hh"
50 #include "base/trace.hh"
51 #include "base/types.hh"
52 #include "config/the_isa.hh"
53 #include "cpu/base.hh"
54 #include "cpu/checker/cpu.hh"
56 #include "cpu/exetrace.hh"
57 #include "cpu/pred/bpred_unit.hh"
59 #include "cpu/simple_thread.hh"
60 #include "cpu/smt.hh"
61 #include "cpu/static_inst.hh"
62 #include "cpu/thread_context.hh"
63 #include "debug/Decode.hh"
64 #include "debug/ExecFaulting.hh"
65 #include "debug/Fetch.hh"
66 #include "debug/HtmCpu.hh"
67 #include "debug/Quiesce.hh"
68 #include "mem/packet.hh"
69 #include "mem/request.hh"
70 #include "params/BaseSimpleCPU.hh"
71 #include "sim/byteswap.hh"
72 #include "sim/debug.hh"
73 #include "sim/faults.hh"
74 #include "sim/full_system.hh"
75 #include "sim/sim_events.hh"
76 #include "sim/sim_object.hh"
77 #include "sim/stats.hh"
78 #include "sim/system.hh"
79 
80 BaseSimpleCPU::BaseSimpleCPU(const BaseSimpleCPUParams &p)
81  : BaseCPU(p),
82  curThread(0),
83  branchPred(p.branchPred),
84  traceData(NULL),
85  inst(),
86  _status(Idle)
87 {
88  SimpleThread *thread;
89 
90  for (unsigned i = 0; i < numThreads; i++) {
91  if (FullSystem) {
92  thread = new SimpleThread(
93  this, i, p.system, p.mmu, p.isa[i]);
94  } else {
95  thread = new SimpleThread(
96  this, i, p.system, p.workload[i], p.mmu, p.isa[i]);
97  }
98  threadInfo.push_back(new SimpleExecContext(this, thread));
99  ThreadContext *tc = thread->getTC();
100  threadContexts.push_back(tc);
101  }
102 
103  if (p.checker) {
104  if (numThreads != 1)
105  fatal("Checker currently does not support SMT");
106 
107  BaseCPU *temp_checker = p.checker;
108  checker = dynamic_cast<CheckerCPU *>(temp_checker);
109  checker->setSystem(p.system);
110  // Manipulate thread context
111  ThreadContext *cpu_tc = threadContexts[0];
113  } else {
114  checker = NULL;
115  }
116 }
117 
118 void
120 {
121  BaseCPU::init();
122 
123  for (auto tc : threadContexts) {
124  // Initialise the ThreadContext's memory proxies
125  tc->initMemProxies(tc);
126  }
127 }
128 
129 void
131 {
132  Addr oldpc, pc = threadInfo[curThread]->thread->instAddr();
133  do {
134  oldpc = pc;
135  threadInfo[curThread]->thread->pcEventQueue.service(
136  oldpc, threadContexts[curThread]);
137  pc = threadInfo[curThread]->thread->instAddr();
138  } while (oldpc != pc);
139 }
140 
141 void
143 {
144  if (numThreads > 1) {
146  !threadInfo[curThread]->stayAtPC) {
147  // Swap active threads
148  if (!activeThreads.empty()) {
149  curThread = activeThreads.front();
150  activeThreads.pop_front();
151  activeThreads.push_back(curThread);
152  }
153  }
154  }
155 }
156 
157 void
159 {
161 
163  t_info.numInst++;
164  t_info.execContextStats.numInsts++;
165 
166  t_info.thread->funcExeInst++;
167  }
168  t_info.numOp++;
169  t_info.execContextStats.numOps++;
170 }
171 
172 Counter
174 {
175  Counter total_inst = 0;
176  for (auto& t_info : threadInfo) {
177  total_inst += t_info->numInst;
178  }
179 
180  return total_inst;
181 }
182 
183 Counter
185 {
186  Counter total_op = 0;
187  for (auto& t_info : threadInfo) {
188  total_op += t_info->numOp;
189  }
190 
191  return total_op;
192 }
193 
195 {
196 }
197 
198 void
200 {
201  // for now, these are equivalent
202  suspendContext(thread_num);
204 }
205 
206 void
208 {
210  for (auto &thread_info : threadInfo) {
211  thread_info->execContextStats.notIdleFraction = (_status != Idle);
212  }
213 }
214 
215 void
217 {
218  assert(_status == Idle || _status == Running);
219 
220  threadInfo[tid]->thread->serialize(cp);
221 }
222 
223 void
225 {
226  threadInfo[tid]->thread->unserialize(cp);
227 }
228 
229 void
230 change_thread_state(ThreadID tid, int activate, int priority)
231 {
232 }
233 
234 void
236 {
237  getCpuAddrMonitor(tid)->gotWakeup = true;
238 
239  if (threadInfo[tid]->thread->status() == ThreadContext::Suspended) {
240  DPRINTF(Quiesce,"[tid:%d] Suspended Processor awoke\n", tid);
241  threadInfo[tid]->thread->activate();
242  }
243 }
244 
245 void
247 {
248  if (DTRACE(ExecFaulting)) {
249  traceData->setFaulting(true);
250  } else {
251  delete traceData;
252  traceData = NULL;
253  }
254 }
255 
256 void
258 {
260  SimpleThread* thread = t_info.thread;
261  ThreadContext* tc = thread->getTC();
262 
263  if (checkInterrupts(curThread)) {
264  Fault interrupt = interrupts[curThread]->getInterrupt();
265 
266  if (interrupt != NoFault) {
267  // hardware transactional memory
268  // Postpone taking interrupts while executing transactions.
269  assert(!std::dynamic_pointer_cast<GenericHtmFailureFault>(
270  interrupt));
271  if (t_info.inHtmTransactionalState()) {
272  DPRINTF(HtmCpu, "Deferring pending interrupt - %s -"
273  "due to transactional state\n",
274  interrupt->name());
275  return;
276  }
277 
278  t_info.fetchOffset = 0;
279  interrupts[curThread]->updateIntrInfo();
280  interrupt->invoke(tc);
281  thread->decoder.reset();
282  }
283  }
284 }
285 
286 
287 void
289 {
291  SimpleThread* thread = t_info.thread;
292 
293  Addr instAddr = thread->instAddr();
294  Addr fetchPC = (instAddr & PCMask) + t_info.fetchOffset;
295 
296  // set up memory request for instruction fetch
297  DPRINTF(Fetch, "Fetch: Inst PC:%08p, Fetch PC:%08p\n", instAddr, fetchPC);
298 
299  req->setVirt(fetchPC, sizeof(TheISA::MachInst), Request::INST_FETCH,
300  instRequestorId(), instAddr);
301 }
302 
303 
304 void
306 {
308  SimpleThread* thread = t_info.thread;
309 
310  // maintain $r0 semantics
311  thread->setIntReg(TheISA::ZeroReg, 0);
312 
313  // resets predicates
314  t_info.setPredicate(true);
315  t_info.setMemAccPredicate(true);
316 
317  // check for instruction-count-based events
318  thread->comInstEventQueue.serviceEvents(t_info.numInst);
319 
320  // decode the instruction
321  TheISA::PCState pcState = thread->pcState();
322 
323  if (isRomMicroPC(pcState.microPC())) {
324  t_info.stayAtPC = false;
325  curStaticInst = thread->decoder.fetchRomMicroop(
326  pcState.microPC(), curMacroStaticInst);
327  } else if (!curMacroStaticInst) {
328  //We're not in the middle of a macro instruction
329  StaticInstPtr instPtr = NULL;
330 
331  TheISA::Decoder *decoder = &(thread->decoder);
332 
333  //Predecode, ie bundle up an ExtMachInst
334  //If more fetch data is needed, pass it in.
335  Addr fetchPC = (pcState.instAddr() & PCMask) + t_info.fetchOffset;
336  //if (decoder->needMoreBytes())
337  decoder->moreBytes(pcState, fetchPC, inst);
338  //else
339  // decoder->process();
340 
341  //Decode an instruction if one is ready. Otherwise, we'll have to
342  //fetch beyond the MachInst at the current pc.
343  instPtr = decoder->decode(pcState);
344  if (instPtr) {
345  t_info.stayAtPC = false;
346  thread->pcState(pcState);
347  } else {
348  t_info.stayAtPC = true;
349  t_info.fetchOffset += sizeof(TheISA::MachInst);
350  }
351 
352  //If we decoded an instruction and it's microcoded, start pulling
353  //out micro ops
354  if (instPtr && instPtr->isMacroop()) {
355  curMacroStaticInst = instPtr;
356  curStaticInst =
357  curMacroStaticInst->fetchMicroop(pcState.microPC());
358  } else {
359  curStaticInst = instPtr;
360  }
361  } else {
362  //Read the next micro op from the macro op
363  curStaticInst = curMacroStaticInst->fetchMicroop(pcState.microPC());
364  }
365 
366  //If we decoded an instruction this "tick", record information about it.
367  if (curStaticInst) {
368 #if TRACING_ON
369  traceData = tracer->getInstRecord(curTick(), thread->getTC(),
371 #endif // TRACING_ON
372  }
373 
374  if (branchPred && curStaticInst &&
376  // Use a fake sequence number since we only have one
377  // instruction in flight at the same time.
378  const InstSeqNum cur_sn(0);
379  t_info.predPC = thread->pcState();
380  const bool predict_taken(
381  branchPred->predict(curStaticInst, cur_sn, t_info.predPC,
382  curThread));
383 
384  if (predict_taken)
386  }
387 }
388 
389 void
391 {
393 
394  assert(curStaticInst);
395 
397  Addr instAddr = pc.instAddr();
398 
399  if (curStaticInst->isMemRef()) {
400  t_info.execContextStats.numMemRefs++;
401  }
402 
403  if (curStaticInst->isLoad()) {
404  ++t_info.numLoad;
405  }
406 
407  if (curStaticInst->isControl()) {
408  ++t_info.execContextStats.numBranches;
409  }
410 
411  /* Power model statistics */
412  //integer alu accesses
413  if (curStaticInst->isInteger()){
415  t_info.execContextStats.numIntInsts++;
416  }
417 
418  //float alu accesses
419  if (curStaticInst->isFloating()){
421  t_info.execContextStats.numFpInsts++;
422  }
423 
424  //vector alu accesses
425  if (curStaticInst->isVector()){
427  t_info.execContextStats.numVecInsts++;
428  }
429 
430  //number of function calls/returns to get window accesses
433  }
434 
435  //the number of branch predictions that will be made
436  if (curStaticInst->isCondCtrl()){
438  }
439 
440  //result bus acceses
441  if (curStaticInst->isLoad()){
443  }
444 
447  }
448  /* End power model statistics */
449 
451 
452  if (FullSystem)
453  traceFunctions(instAddr);
454 
455  if (traceData) {
456  traceData->dump();
457  delete traceData;
458  traceData = NULL;
459  }
460 
461  // Call CPU instruction commit probes
462  probeInstCommit(curStaticInst, instAddr);
463 }
464 
465 void
467 {
469  SimpleThread* thread = t_info.thread;
470 
471  const bool branching(thread->pcState().branching());
472 
473  //Since we're moving to a new pc, zero out the offset
474  t_info.fetchOffset = 0;
475  if (fault != NoFault) {
477  fault->invoke(threadContexts[curThread], curStaticInst);
478  thread->decoder.reset();
479  } else {
480  if (curStaticInst) {
483  TheISA::PCState pcState = thread->pcState();
485  thread->pcState(pcState);
486  }
487  }
488 
490  // Use a fake sequence number since we only have one
491  // instruction in flight at the same time.
492  const InstSeqNum cur_sn(0);
493 
494  if (t_info.predPC == thread->pcState()) {
495  // Correctly predicted branch
496  branchPred->update(cur_sn, curThread);
497  } else {
498  // Mis-predicted branch
499  branchPred->squash(cur_sn, thread->pcState(), branching, curThread);
501  }
502  }
503 }
fatal
#define fatal(...)
This implements a cprintf based fatal() function.
Definition: logging.hh:183
ThreadState::funcExeInst
Counter funcExeInst
Definition: thread_state.hh:166
SimpleExecContext
Definition: exec_context.hh:57
SimpleExecContext::ExecContextStats::numIntAluAccesses
Stats::Scalar numIntAluAccesses
Definition: exec_context.hh:188
SimpleThread::pcState
TheISA::PCState pcState() const override
Definition: simple_thread.hh:505
BaseSimpleCPU::traceData
Trace::InstRecord * traceData
Definition: base.hh:95
system.hh
BaseSimpleCPU::curMacroStaticInst
StaticInstPtr curMacroStaticInst
Definition: base.hh:104
BaseSimpleCPU::_status
Status _status
Definition: base.hh:121
StaticInst::isMemRef
bool isMemRef() const
Definition: static_inst.hh:162
BaseCPU::init
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Definition: base.cc:269
BaseSimpleCPU::unserializeThread
void unserializeThread(CheckpointIn &cp, ThreadID tid) override
Unserialize one thread.
Definition: base.cc:224
sim_events.hh
ArmISA::i
Bitfield< 7 > i
Definition: miscregs_types.hh:63
BaseSimpleCPU::totalInsts
Counter totalInsts() const override
Definition: base.cc:173
ThreadID
int16_t ThreadID
Thread index/ID type.
Definition: types.hh:233
BaseCPU::tracer
Trace::InstTracer * tracer
Definition: base.hh:271
SimpleExecContext::ExecContextStats::numVecAluAccesses
Stats::Scalar numVecAluAccesses
Definition: exec_context.hh:194
ArmISA::MachInst
uint32_t MachInst
Definition: types.hh:52
BaseSimpleCPU::checker
CheckerCPU * checker
Definition: base.hh:96
BaseSimpleCPU::serializeThread
void serializeThread(CheckpointOut &cp, ThreadID tid) const override
Serialize a single thread.
Definition: base.cc:216
BaseSimpleCPU::BaseSimpleCPU
BaseSimpleCPU(const BaseSimpleCPUParams &params)
Definition: base.cc:80
SimpleExecContext::ExecContextStats::numBranches
Stats::Scalar numBranches
Definition: exec_context.hh:254
CheckerCPU::setSystem
void setSystem(System *system)
Definition: cpu.cc:91
exetrace.hh
SimpleThread::setIntReg
void setIntReg(RegIndex reg_idx, RegVal val) override
Definition: simple_thread.hh:442
SimpleExecContext::ExecContextStats::numCondCtrlInsts
Stats::Scalar numCondCtrlInsts
Definition: exec_context.hh:200
SimpleExecContext::ExecContextStats::numOps
Stats::Scalar numOps
Definition: exec_context.hh:185
BaseSimpleCPU::setupFetchRequest
void setupFetchRequest(const RequestPtr &req)
Definition: base.cc:288
RequestPtr
std::shared_ptr< Request > RequestPtr
Definition: request.hh:86
CheckerCPU
CheckerCPU class.
Definition: cpu.hh:85
DTRACE
#define DTRACE(x)
Definition: debug.hh:156
FullSystem
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
Definition: root.cc:204
StaticInst::opClass
OpClass opClass() const
Operation class. Used to select appropriate function unit in issue.
Definition: static_inst.hh:229
BaseSimpleCPU::threadInfo
std::vector< SimpleExecContext * > threadInfo
Definition: base.hh:98
BaseSimpleCPU::traceFault
void traceFault()
Handler used when encountering a fault; its purpose is to tear down the InstRecord.
Definition: base.cc:246
BaseSimpleCPU::countInst
void countInst()
Definition: base.cc:158
faults.hh
SimpleExecContext::ExecContextStats::numInsts
Stats::Scalar numInsts
Definition: exec_context.hh:184
BaseSimpleCPU::branchPred
BPredUnit * branchPred
Definition: base.hh:84
SimpleThread::decoder
TheISA::Decoder decoder
Definition: simple_thread.hh:132
BPredUnit::update
void update(const InstSeqNum &done_sn, ThreadID tid)
Tells the branch predictor to commit any updates until the given sequence number.
Definition: bpred_unit.cc:295
request.hh
ArmISA::advancePC
void advancePC(PCState &pc, const StaticInstPtr &inst)
Definition: utility.hh:392
Trace::InstRecord::dump
virtual void dump()=0
SimpleExecContext::setMemAccPredicate
void setMemAccPredicate(bool val) override
Definition: exec_context.hh:628
Trace::InstTracer::getInstRecord
virtual InstRecord * getInstRecord(Tick when, ThreadContext *tc, const StaticInstPtr staticInst, TheISA::PCState pc, const StaticInstPtr macroStaticInst=NULL)=0
BaseSimpleCPU::postExecute
void postExecute()
Definition: base.cc:390
BaseCPU::updateCycleCounters
void updateCycleCounters(CPUState state)
base method keeping track of cycle progression
Definition: base.hh:532
SimpleExecContext::setPredicate
void setPredicate(bool val) override
Definition: exec_context.hh:612
packet.hh
SimpleThread
The SimpleThread object provides a combination of the ThreadState object and the ThreadContext interf...
Definition: simple_thread.hh:90
StaticInst::isInteger
bool isInteger() const
Definition: static_inst.hh:175
SimpleExecContext::ExecContextStats::numIntInsts
Stats::Scalar numIntInsts
Definition: exec_context.hh:203
BaseSimpleCPU::activeThreads
std::list< ThreadID > activeThreads
Definition: base.hh:99
stats.hh
Counter
int64_t Counter
Statistics counter type.
Definition: types.hh:54
Stats::Group::resetStats
virtual void resetStats()
Callback to reset stats.
Definition: group.cc:81
StaticInst::isStore
bool isStore() const
Definition: static_inst.hh:167
smt.hh
BaseSimpleCPU::totalOps
Counter totalOps() const override
Definition: base.cc:184
cp
Definition: cprintf.cc:37
BaseSimpleCPU::checkPcEventQueue
void checkPcEventQueue()
Definition: base.cc:130
StaticInst::isLoad
bool isLoad() const
Definition: static_inst.hh:166
SimpleThread::instAddr
Addr instAddr() const override
Definition: simple_thread.hh:514
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:88
SimpleExecContext::execContextStats
SimpleExecContext::ExecContextStats execContextStats
SimpleExecContext::ExecContextStats::numMemRefs
Stats::Scalar numMemRefs
Definition: exec_context.hh:232
StaticInst::isDelayedCommit
bool isDelayedCommit() const
Definition: static_inst.hh:206
SimpleThread::getTC
ThreadContext * getTC()
Returns the pointer to this SimpleThread's ThreadContext.
Definition: simple_thread.hh:165
sim_object.hh
DPRINTF
#define DPRINTF(x,...)
Definition: trace.hh:237
StaticInst::isAtomic
bool isAtomic() const
Definition: static_inst.hh:168
StaticInst::isControl
bool isControl() const
Definition: static_inst.hh:179
Fault
std::shared_ptr< FaultBase > Fault
Definition: types.hh:246
MipsISA::pc
Bitfield< 4 > pc
Definition: pra_constants.hh:240
debug.hh
BaseCPU::interrupts
std::vector< BaseInterrupts * > interrupts
Definition: base.hh:232
pollevent.hh
BaseSimpleCPU::Idle
@ Idle
Definition: base.hh:108
BaseSimpleCPU::inst
TheISA::MachInst inst
Current instruction.
Definition: base.hh:102
StaticInst::isMacroop
bool isMacroop() const
Definition: static_inst.hh:204
cpu.hh
EventQueue::serviceEvents
void serviceEvents(Tick when)
process all events up to the given timestamp.
Definition: eventq.hh:873
ArmISA::ZeroReg
const int ZeroReg
Definition: registers.hh:110
BaseCPU::threadContexts
std::vector< ThreadContext * > threadContexts
Definition: base.hh:269
SimpleExecContext::thread
SimpleThread * thread
Definition: exec_context.hh:61
SimpleExecContext::ExecContextStats::numPredictedBranches
Stats::Scalar numPredictedBranches
Number of branches predicted as taken.
Definition: exec_context.hh:256
BaseSimpleCPU::init
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Definition: base.cc:119
BaseSimpleCPU::checkForInterrupts
void checkForInterrupts()
Definition: base.cc:257
cprintf.hh
static_inst.hh
BaseCPU::getCpuAddrMonitor
AddressMonitor * getCpuAddrMonitor(ThreadID tid)
Definition: base.hh:618
inifile.hh
SimpleExecContext::ExecContextStats::numCallsReturns
Stats::Scalar numCallsReturns
Definition: exec_context.hh:197
BaseSimpleCPU::curThread
ThreadID curThread
Definition: base.hh:83
InstSeqNum
uint64_t InstSeqNum
Definition: inst_seq.hh:37
NoFault
constexpr decltype(nullptr) NoFault
Definition: types.hh:251
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:148
BaseSimpleCPU::~BaseSimpleCPU
virtual ~BaseSimpleCPU()
Definition: base.cc:194
StaticInst::nullStaticInstPtr
static StaticInstPtr nullStaticInstPtr
Pointer to a statically allocated "null" instruction object.
Definition: static_inst.hh:253
isRomMicroPC
static bool isRomMicroPC(MicroPC upc)
Definition: types.hh:167
SimpleExecContext::numOp
Counter numOp
Definition: exec_context.hh:74
Request::INST_FETCH
@ INST_FETCH
The request was an instruction fetch.
Definition: request.hh:108
full_system.hh
StaticInst::isMicroop
bool isMicroop() const
Definition: static_inst.hh:205
SimpleExecContext::numLoad
Counter numLoad
Definition: exec_context.hh:76
SimpleExecContext::ExecContextStats::numFpInsts
Stats::Scalar numFpInsts
Definition: exec_context.hh:206
BaseCPU::instRequestorId
RequestorID instRequestorId() const
Reads this CPU's unique instruction requestor ID.
Definition: base.hh:203
BaseCPU
Definition: base.hh:104
BaseSimpleCPU::wakeup
void wakeup(ThreadID tid) override
Definition: base.cc:235
BaseSimpleCPU::curStaticInst
StaticInstPtr curStaticInst
Definition: base.hh:103
SimpleThread::comInstEventQueue
EventQueue comInstEventQueue
An instruction-based event queue.
Definition: simple_thread.hh:126
base.hh
BaseSimpleCPU::swapActiveThread
void swapActiveThread()
Definition: base.cc:142
BaseSimpleCPU::advancePC
void advancePC(const Fault &fault)
Definition: base.cc:466
SimpleExecContext::ExecContextStats::numLoadInsts
Stats::Scalar numLoadInsts
Definition: exec_context.hh:233
StaticInst::isLastMicroop
bool isLastMicroop() const
Definition: static_inst.hh:207
SimpleExecContext::predPC
TheISA::PCState predPC
Definition: exec_context.hh:70
ThreadContext::Suspended
@ Suspended
Temporarily inactive.
Definition: thread_context.hh:107
SimpleExecContext::numInst
Counter numInst
PER-THREAD STATS.
Definition: exec_context.hh:73
simple_thread.hh
change_thread_state
void change_thread_state(ThreadID tid, int activate, int priority)
Changes the status and priority of the thread with the given number.
Definition: base.cc:230
StaticInst::fetchMicroop
virtual StaticInstPtr fetchMicroop(MicroPC upc) const
Return the microop that goes with a particular micropc.
Definition: static_inst.cc:96
base.hh
SimpleExecContext::ExecContextStats::numFpAluAccesses
Stats::Scalar numFpAluAccesses
Definition: exec_context.hh:191
MipsISA::PCState
GenericISA::DelaySlotPCState< MachInst > PCState
Definition: types.hh:41
types.hh
bpred_unit.hh
BaseSimpleCPU::preExecute
void preExecute()
Definition: base.cc:305
BaseCPU::PCMask
static const Addr PCMask
Definition: base.hh:281
BPredUnit::predict
bool predict(const StaticInstPtr &inst, const InstSeqNum &seqNum, TheISA::PCState &pc, ThreadID tid)
Predicts whether or not the instruction is a taken branch, and the target of the branch if it is take...
Definition: bpred_unit.cc:120
SimpleExecContext::fetchOffset
Addr fetchOffset
Definition: exec_context.hh:64
BaseCPU::numThreads
ThreadID numThreads
Number of threads we're actually simulating (<= SMT_MAX_THREADS).
Definition: base.hh:378
StaticInst::isCall
bool isCall() const
Definition: static_inst.hh:180
BaseCPU::traceFunctions
void traceFunctions(Addr pc)
Definition: base.hh:572
Trace::InstRecord::setFaulting
void setFaulting(bool val)
Definition: insttracer.hh:228
logging.hh
exec_context.hh
BaseSimpleCPU::resetStats
void resetStats() override
Callback to reset stats.
Definition: base.cc:207
CheckerThreadContext
Derived ThreadContext class for use with the Checker.
Definition: thread_context.hh:66
CheckpointOut
std::ostream CheckpointOut
Definition: serialize.hh:64
StaticInst::isFloating
bool isFloating() const
Definition: static_inst.hh:176
BaseCPU::suspendContext
virtual void suspendContext(ThreadID thread_num)
Notify the CPU that the indicated context is now suspended.
Definition: base.cc:498
SimpleExecContext::ExecContextStats::numStoreInsts
Stats::Scalar numStoreInsts
Definition: exec_context.hh:234
RefCountingPtr< StaticInst >
curTick
Tick curTick()
The universal simulation clock.
Definition: cur_tick.hh:43
trace.hh
StaticInst::isCondCtrl
bool isCondCtrl() const
Definition: static_inst.hh:184
symtab.hh
BaseCPU::CPU_STATE_SLEEP
@ CPU_STATE_SLEEP
Definition: base.hh:524
decoder
output decoder
Definition: nop.cc:61
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
SimpleExecContext::ExecContextStats::statExecutedInstType
Stats::Vector statExecutedInstType
Definition: exec_context.hh:262
AddressMonitor::gotWakeup
bool gotWakeup
Definition: base.hh:80
SimpleExecContext::ExecContextStats::numVecInsts
Stats::Scalar numVecInsts
Definition: exec_context.hh:209
SimpleExecContext::inHtmTransactionalState
bool inHtmTransactionalState() const override
Definition: exec_context.hh:646
CheckpointIn
Definition: serialize.hh:68
BPredUnit::squash
void squash(const InstSeqNum &squashed_sn, ThreadID tid)
Squashes all outstanding updates until a given sequence number.
Definition: bpred_unit.cc:318
thread_context.hh
StaticInst::isReturn
bool isReturn() const
Definition: static_inst.hh:181
BaseCPU::probeInstCommit
virtual void probeInstCommit(const StaticInstPtr &inst, Addr pc)
Helper method to trigger PMU probes for a committed instruction.
Definition: base.cc:353
StaticInst::isVector
bool isVector() const
Definition: static_inst.hh:177
BaseCPU::checkInterrupts
bool checkInterrupts(ThreadID tid) const
Definition: base.hh:263
BaseSimpleCPU::haltContext
void haltContext(ThreadID thread_num) override
Notify the CPU that the indicated context is now halted.
Definition: base.cc:199
thread_context.hh
SimpleExecContext::ExecContextStats::numBranchMispred
Stats::Scalar numBranchMispred
Number of misprediced branches.
Definition: exec_context.hh:258
SimpleExecContext::stayAtPC
bool stayAtPC
Definition: exec_context.hh:67
byteswap.hh
BaseSimpleCPU::Running
@ Running
Definition: base.hh:109

Generated on Tue Jun 22 2021 15:28:25 for gem5 by doxygen 1.8.17