Go to the documentation of this file.
44 #include "arch/utility.hh"
52 #include "config/the_isa.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"
70 #include "params/BaseSimpleCPU.hh"
83 branchPred(
p.branchPred),
93 this,
i,
p.system,
p.mmu,
p.isa[
i]);
96 this,
i,
p.system,
p.workload[
i],
p.mmu,
p.isa[
i]);
105 fatal(
"Checker currently does not support SMT");
125 tc->initMemProxies(tc);
138 }
while (oldpc !=
pc);
177 total_inst += t_info->numInst;
188 total_op += t_info->numOp;
211 thread_info->execContextStats.notIdleFraction = (
_status !=
Idle);
240 DPRINTF(Quiesce,
"[tid:%d] Suspended Processor awoke\n", tid);
248 if (
DTRACE(ExecFaulting)) {
269 assert(!std::dynamic_pointer_cast<GenericHtmFailureFault>(
272 DPRINTF(HtmCpu,
"Deferring pending interrupt - %s -"
273 "due to transactional state\n",
280 interrupt->invoke(tc);
297 DPRINTF(Fetch,
"Fetch: Inst PC:%08p, Fetch PC:%08p\n", instAddr, fetchPC);
343 instPtr =
decoder->decode(pcState);
380 const bool predict_taken(
397 Addr instAddr =
pc.instAddr();
471 const bool branching(thread->
pcState().branching());
#define fatal(...)
This implements a cprintf based fatal() function.
Stats::Scalar numIntAluAccesses
TheISA::PCState pcState() const override
Trace::InstRecord * traceData
StaticInstPtr curMacroStaticInst
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
void unserializeThread(CheckpointIn &cp, ThreadID tid) override
Unserialize one thread.
Counter totalInsts() const override
int16_t ThreadID
Thread index/ID type.
Trace::InstTracer * tracer
Stats::Scalar numVecAluAccesses
void serializeThread(CheckpointOut &cp, ThreadID tid) const override
Serialize a single thread.
BaseSimpleCPU(const BaseSimpleCPUParams ¶ms)
Stats::Scalar numBranches
void setSystem(System *system)
void setIntReg(RegIndex reg_idx, RegVal val) override
Stats::Scalar numCondCtrlInsts
void setupFetchRequest(const RequestPtr &req)
std::shared_ptr< Request > RequestPtr
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
OpClass opClass() const
Operation class. Used to select appropriate function unit in issue.
std::vector< SimpleExecContext * > threadInfo
void traceFault()
Handler used when encountering a fault; its purpose is to tear down the InstRecord.
void update(const InstSeqNum &done_sn, ThreadID tid)
Tells the branch predictor to commit any updates until the given sequence number.
void advancePC(PCState &pc, const StaticInstPtr &inst)
void setMemAccPredicate(bool val) override
virtual InstRecord * getInstRecord(Tick when, ThreadContext *tc, const StaticInstPtr staticInst, TheISA::PCState pc, const StaticInstPtr macroStaticInst=NULL)=0
void updateCycleCounters(CPUState state)
base method keeping track of cycle progression
void setPredicate(bool val) override
The SimpleThread object provides a combination of the ThreadState object and the ThreadContext interf...
Stats::Scalar numIntInsts
std::list< ThreadID > activeThreads
int64_t Counter
Statistics counter type.
virtual void resetStats()
Callback to reset stats.
Counter totalOps() const override
Addr instAddr() const override
ThreadContext is the external interface to all thread state for anything outside of the CPU.
SimpleExecContext::ExecContextStats execContextStats
bool isDelayedCommit() const
ThreadContext * getTC()
Returns the pointer to this SimpleThread's ThreadContext.
std::shared_ptr< FaultBase > Fault
std::vector< BaseInterrupts * > interrupts
TheISA::MachInst inst
Current instruction.
void serviceEvents(Tick when)
process all events up to the given timestamp.
std::vector< ThreadContext * > threadContexts
Stats::Scalar numPredictedBranches
Number of branches predicted as taken.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
void checkForInterrupts()
AddressMonitor * getCpuAddrMonitor(ThreadID tid)
Stats::Scalar numCallsReturns
constexpr decltype(nullptr) NoFault
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
static StaticInstPtr nullStaticInstPtr
Pointer to a statically allocated "null" instruction object.
static bool isRomMicroPC(MicroPC upc)
@ INST_FETCH
The request was an instruction fetch.
RequestorID instRequestorId() const
Reads this CPU's unique instruction requestor ID.
void wakeup(ThreadID tid) override
StaticInstPtr curStaticInst
EventQueue comInstEventQueue
An instruction-based event queue.
void advancePC(const Fault &fault)
Stats::Scalar numLoadInsts
bool isLastMicroop() const
@ Suspended
Temporarily inactive.
Counter numInst
PER-THREAD STATS.
void change_thread_state(ThreadID tid, int activate, int priority)
Changes the status and priority of the thread with the given number.
virtual StaticInstPtr fetchMicroop(MicroPC upc) const
Return the microop that goes with a particular micropc.
Stats::Scalar numFpAluAccesses
GenericISA::DelaySlotPCState< MachInst > PCState
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...
ThreadID numThreads
Number of threads we're actually simulating (<= SMT_MAX_THREADS).
void traceFunctions(Addr pc)
void setFaulting(bool val)
void resetStats() override
Callback to reset stats.
Derived ThreadContext class for use with the Checker.
std::ostream CheckpointOut
virtual void suspendContext(ThreadID thread_num)
Notify the CPU that the indicated context is now suspended.
Stats::Scalar numStoreInsts
Tick curTick()
The universal simulation clock.
Stats::Vector statExecutedInstType
Stats::Scalar numVecInsts
bool inHtmTransactionalState() const override
void squash(const InstSeqNum &squashed_sn, ThreadID tid)
Squashes all outstanding updates until a given sequence number.
virtual void probeInstCommit(const StaticInstPtr &inst, Addr pc)
Helper method to trigger PMU probes for a committed instruction.
bool checkInterrupts(ThreadID tid) const
void haltContext(ThreadID thread_num) override
Notify the CPU that the indicated context is now halted.
Stats::Scalar numBranchMispred
Number of misprediced branches.
Generated on Tue Jun 22 2021 15:28:25 for gem5 by doxygen 1.8.17