Go to the documentation of this file.
52 #include "config/the_isa.hh"
64 #include "debug/Decode.hh"
65 #include "debug/ExecFaulting.hh"
66 #include "debug/Fetch.hh"
67 #include "debug/HtmCpu.hh"
68 #include "debug/Quiesce.hh"
71 #include "params/BaseSimpleCPU.hh"
87 branchPred(
p.branchPred),
94 for (
unsigned i = 0;
i < numThreads;
i++) {
97 this,
i,
p.system,
p.mmu,
p.isa[
i],
p.decoder[
i]);
100 this,
i,
p.system,
p.workload[
i],
p.mmu,
p.isa[
i],
105 threadContexts.push_back(tc);
110 fatal(
"Checker currently does not support SMT");
112 BaseCPU *temp_checker =
p.checker;
133 }
while (oldpc !=
pc);
139 if (numThreads > 1) {
170 total_inst += t_info->numInst;
181 total_op += t_info->numOp;
195 suspendContext(thread_num);
196 updateCycleCounters(BaseCPU::CPU_STATE_SLEEP);
202 BaseCPU::resetStats();
230 getCpuAddrMonitor(tid)->gotWakeup =
true;
233 DPRINTF(Quiesce,
"[tid:%d] Suspended Processor awoke\n", tid);
241 if (debug::ExecFaulting) {
262 assert(!std::dynamic_pointer_cast<GenericHtmFailureFault>(
265 DPRINTF(HtmCpu,
"Deferring pending interrupt - %s -"
266 "due to transactional state\n",
273 interrupt->invoke(tc);
291 DPRINTF(Fetch,
"Fetch: Inst PC:%08p, Fetch PC:%08p\n", instAddr, fetchPC);
294 instRequestorId(), instAddr);
336 decoder->moreBytes(pc_state, fetch_pc);
340 instPtr =
decoder->decode(pc_state);
377 const bool predict_taken(
393 Addr instAddr = threadContexts[
curThread]->pcState().instAddr();
449 traceFunctions(instAddr);
Tick curTick()
The universal simulation clock.
#define fatal(...)
This implements a cprintf based fatal() function.
void update(const InstSeqNum &done_sn, ThreadID tid)
Tells the branch predictor to commit any updates until the given sequence number.
void serializeThread(CheckpointOut &cp, ThreadID tid) const override
void setFaulting(bool val)
Addr instAddr() const
Returns the memory address of the instruction this PC points to.
bool predict(const StaticInstPtr &inst, const InstSeqNum &seqNum, PCStateBase &pc, ThreadID tid)
Predicts whether or not the instruction is a taken branch, and the target of the branch if it is take...
Counter totalOps() const override
constexpr decltype(nullptr) NoFault
std::vector< SimpleExecContext * > threadInfo
void setIntReg(RegIndex reg_idx, RegVal val) override
@ INST_FETCH
The request was an instruction fetch.
Trace::InstRecord * traceData
static bool isRomMicroPC(MicroPC upc)
statistics::Scalar numCallsReturns
StaticInstPtr curStaticInst
Current instruction.
gem5::SimpleExecContext::ExecContextStats execContextStats
bool isDelayedCommit() const
BaseSimpleCPU(const BaseSimpleCPUParams ¶ms)
void unserializeThread(CheckpointIn &cp, ThreadID tid) override
Derived ThreadContext class for use with the Checker.
The SimpleThread object provides a combination of the ThreadState object and the ThreadContext interf...
statistics::Scalar numPredictedBranches
Number of branches predicted as taken.
virtual void advancePC(PCStateBase &pc_state) const =0
void serviceEvents(Tick when)
process all events up to the given timestamp.
statistics::Scalar numVecInsts
void setPredicate(bool val) override
void checkForInterrupts()
virtual StaticInstPtr fetchMicroop(MicroPC upc) const
Return the microop that goes with a particular micropc.
OpClass opClass() const
Operation class. Used to select appropriate function unit in issue.
virtual bool branching() const =0
const StaticInstPtr nullStaticInstPtr
Statically allocated null StaticInstPtr.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
statistics::Scalar numInsts
std::shared_ptr< FaultBase > Fault
bool inHtmTransactionalState() const override
@ Suspended
Temporarily inactive.
statistics::Scalar numCondCtrlInsts
void setupFetchRequest(const RequestPtr &req)
std::unique_ptr< PCStateBase > preExecuteTempPC
std::shared_ptr< Request > RequestPtr
std::list< ThreadID > activeThreads
statistics::Vector statExecutedInstType
void traceFault()
Handler used when encountering a fault; its purpose is to tear down the InstRecord.
Counter numInst
PER-THREAD STATS.
void squash(const InstSeqNum &squashed_sn, ThreadID tid)
Squashes all outstanding updates until a given sequence number.
const PCStateBase & pcState() const override
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
bool isLastMicroop() const
statistics::Scalar numFpInsts
statistics::Scalar numVecAluAccesses
statistics::Scalar numStoreInsts
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
ThreadContext * getTC()
Returns the pointer to this SimpleThread's ThreadContext.
statistics::Scalar numLoadInsts
@ IntRegClass
Integer register.
branch_prediction::BPredUnit * branchPred
void resetStats() override
statistics::Scalar numIntInsts
statistics::Scalar numIntAluAccesses
void setMemAccPredicate(bool val) override
double Counter
All counters are of 64-bit values.
void serviceInstCountEvents()
statistics::Scalar numFpAluAccesses
void wakeup(ThreadID tid) override
void advancePC(const Fault &fault)
statistics::Scalar numBranches
statistics::Scalar numOps
std::ostream CheckpointOut
void haltContext(ThreadID thread_num) override
statistics::Scalar numBranchMispred
Number of misprediced branches.
void change_thread_state(ThreadID tid, int activate, int priority)
Changes the status and priority of the thread with the given number.
Counter totalInsts() const override
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
std::unique_ptr< PCStateBase > predPC
StaticInstPtr curMacroStaticInst
EventQueue comInstEventQueue
An instruction-based event queue.
statistics::Scalar numMemRefs
int16_t ThreadID
Thread index/ID type.
void setSystem(System *system)
Generated on Wed May 4 2022 12:13:52 for gem5 by doxygen 1.8.17