Go to the documentation of this file.
51 #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"
86 branchPred(
p.branchPred),
96 this,
i,
p.system,
p.mmu,
p.isa[
i]);
99 this,
i,
p.system,
p.workload[
i],
p.mmu,
p.isa[
i]);
108 fatal(
"Checker currently does not support SMT");
128 tc->initMemProxies(tc);
141 }
while (oldpc !=
pc);
178 total_inst += t_info->numInst;
189 total_op += t_info->numOp;
241 DPRINTF(Quiesce,
"[tid:%d] Suspended Processor awoke\n", tid);
249 if (debug::ExecFaulting) {
270 assert(!std::dynamic_pointer_cast<GenericHtmFailureFault>(
273 DPRINTF(HtmCpu,
"Deferring pending interrupt - %s -"
274 "due to transactional state\n",
281 interrupt->invoke(tc);
299 DPRINTF(Fetch,
"Fetch: Inst PC:%08p, Fetch PC:%08p\n", instAddr, fetchPC);
343 decoder.moreBytes(pcState, fetchPC);
347 instPtr =
decoder.decode(pcState);
384 const bool predict_taken(
401 Addr instAddr =
pc.instAddr();
475 const bool branching(thread->
pcState().branching());
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
Serialize a single thread.
void setFaulting(bool val)
Counter totalOps() const override
constexpr decltype(nullptr) NoFault
Trace::InstTracer * tracer
std::vector< BaseInterrupts * > interrupts
std::vector< SimpleExecContext * > threadInfo
void setIntReg(RegIndex reg_idx, RegVal val) override
Trace::InstRecord * traceData
static bool isRomMicroPC(MicroPC upc)
statistics::Scalar numCallsReturns
Addr instAddr() const override
void updateCycleCounters(CPUState state)
base method keeping track of cycle progression
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
StaticInstPtr curStaticInst
Current instruction.
gem5::SimpleExecContext::ExecContextStats execContextStats
bool isDelayedCommit() const
BaseSimpleCPU(const BaseSimpleCPUParams ¶ms)
void unserializeThread(CheckpointIn &cp, ThreadID tid) override
Unserialize one thread.
Derived ThreadContext class for use with the Checker.
virtual void resetStats()
Callback to reset stats.
The SimpleThread object provides a combination of the ThreadState object and the ThreadContext interf...
statistics::Scalar numPredictedBranches
Number of branches predicted as taken.
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.
ThreadID numThreads
Number of threads we're actually simulating (<= SMT_MAX_THREADS).
const StaticInstPtr nullStaticInstPtr
Statically allocated null StaticInstPtr.
virtual void suspendContext(ThreadID thread_num)
Notify the CPU that the indicated context is now suspended.
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.
GenericISA::DelaySlotPCState< 4 > PCState
statistics::Scalar numCondCtrlInsts
void setupFetchRequest(const RequestPtr &req)
RequestorID instRequestorId() const
Reads this CPU's unique instruction requestor ID.
std::shared_ptr< Request > RequestPtr
@ INST_FETCH
The request was an instruction fetch.
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.
TheISA::PCState pcState() const override
virtual InstRecord * getInstRecord(Tick when, ThreadContext *tc, const StaticInstPtr staticInst, TheISA::PCState pc, const StaticInstPtr macroStaticInst=NULL)=0
void squash(const InstSeqNum &squashed_sn, ThreadID tid)
Squashes all outstanding updates until a given sequence number.
AddressMonitor * getCpuAddrMonitor(ThreadID tid)
virtual void probeInstCommit(const StaticInstPtr &inst, Addr pc)
Helper method to trigger PMU probes for a committed instruction.
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
branch_prediction::BPredUnit * branchPred
std::vector< ThreadContext * > threadContexts
void resetStats() override
Callback to reset stats.
statistics::Scalar numIntInsts
statistics::Scalar numIntAluAccesses
void setMemAccPredicate(bool val) override
void traceFunctions(Addr pc)
bool checkInterrupts(ThreadID tid) const
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
Notify the CPU that the indicated context is now halted.
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
@ IntRegClass
Integer register.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
StaticInstPtr curMacroStaticInst
EventQueue comInstEventQueue
An instruction-based event queue.
virtual void advancePC(TheISA::PCState &pc_state) const =0
statistics::Scalar numMemRefs
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...
int16_t ThreadID
Thread index/ID type.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
void setSystem(System *system)
Generated on Tue Sep 21 2021 12:25:00 for gem5 by doxygen 1.8.17