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"
95 this,
i,
p.system,
p.mmu,
p.isa[
i],
p.decoder[
i]);
98 this,
i,
p.system,
p.workload[
i],
p.mmu,
p.isa[
i],
108 fatal(
"Checker currently does not support SMT");
110 BaseCPU *temp_checker = p.checker;
111 checker = dynamic_cast<CheckerCPU *>(temp_checker);
112 checker->setSystem(p.system);
114 ThreadContext *cpu_tc = threadContexts[0];
115 threadContexts[0] = new CheckerThreadContext<ThreadContext>(
116 cpu_tc, this->checker);
131 }
while (oldpc !=
pc);
193 total_inst += t_info->numInst;
204 total_op += t_info->numOp;
256 DPRINTF(Quiesce,
"[tid:%d] Suspended Processor awoke\n", tid);
264 if (debug::ExecFaulting) {
285 assert(!std::dynamic_pointer_cast<GenericHtmFailureFault>(
288 DPRINTF(HtmCpu,
"Deferring pending interrupt - %s -"
289 "due to transactional state\n",
296 interrupt->invoke(tc);
314 DPRINTF(Fetch,
"Fetch: Inst PC:%08p, Fetch PC:%08p\n", instAddr, fetchPC);
356 decoder->moreBytes(pc_state, fetch_pc);
360 instPtr =
decoder->decode(pc_state);
397 const bool predict_taken(
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
RequestorID instRequestorId() const
Reads this CPU's unique instruction requestor ID.
trace::InstTracer * tracer
AddressMonitor * getCpuAddrMonitor(ThreadID tid)
void updateCycleCounters(CPUState state)
base method keeping track of cycle progression
std::vector< std::unique_ptr< CommitCPUStats > > commitStats
virtual void suspendContext(ThreadID thread_num)
Notify the CPU that the indicated context is now suspended.
gem5::BaseCPU::BaseCPUStats baseStats
ThreadID numThreads
Number of threads we're actually simulating (<= SMT_MAX_THREADS).
std::vector< std::unique_ptr< ExecuteCPUStats > > executeStats
bool checkInterrupts(ThreadID tid) const
std::vector< BaseInterrupts * > interrupts
void traceFunctions(Addr pc)
std::vector< std::unique_ptr< FetchCPUStats > > fetchStats
std::vector< ThreadContext * > threadContexts
BaseCPU(const Params ¶ms, bool is_checker=false)
virtual void probeInstCommit(const StaticInstPtr &inst, Addr pc)
Helper method to trigger PMU probes for a committed instruction.
BaseSimpleCPU(const BaseSimpleCPUParams ¶ms)
void serializeThread(CheckpointOut &cp, ThreadID tid) const override
Serialize a single thread.
void resetStats() override
Callback to reset stats.
branch_prediction::BPredUnit * branchPred
void unserializeThread(CheckpointIn &cp, ThreadID tid) override
Unserialize one thread.
void wakeup(ThreadID tid) override
StaticInstPtr curMacroStaticInst
void checkForInterrupts()
void traceFault()
Handler used when encountering a fault; its purpose is to tear down the InstRecord.
void advancePC(const Fault &fault)
void setupFetchRequest(const RequestPtr &req)
std::unique_ptr< PCStateBase > preExecuteTempPC
std::list< ThreadID > activeThreads
std::vector< SimpleExecContext * > threadInfo
Counter totalOps() const override
StaticInstPtr curStaticInst
Current instruction.
Counter totalInsts() const override
void haltContext(ThreadID thread_num) override
Notify the CPU that the indicated context is now halted.
trace::InstRecord * traceData
void serviceInstCountEvents()
virtual bool branching() const =0
Addr instAddr() const
Returns the memory address of the instruction this PC points to.
@ INST_FETCH
The request was an instruction fetch.
Counter numInst
PER-THREAD STATS.
void setMemAccPredicate(bool val) override
void setPredicate(bool val) override
std::unique_ptr< PCStateBase > predPC
bool inHtmTransactionalState() const override
gem5::SimpleExecContext::ExecContextStats execContextStats
The SimpleThread object provides a combination of the ThreadState object and the ThreadContext interf...
int threadId() const override
EventQueue comInstEventQueue
An instruction-based event queue.
const PCStateBase & pcState() const override
ThreadContext * getTC()
Returns the pointer to this SimpleThread's ThreadContext.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
@ Suspended
Temporarily inactive.
void serviceEvents(Tick when)
process all events up to the given timestamp.
virtual void resetStats()
Callback to reset stats.
Declaration of IniFile object.
Bitfield< 3, 0 > priority
double Counter
All counters are of 64-bit values.
Copyright (c) 2024 Arm Limited All rights reserved.
std::shared_ptr< FaultBase > Fault
int16_t ThreadID
Thread index/ID type.
std::shared_ptr< Request > RequestPtr
Tick curTick()
The universal simulation clock.
std::ostream CheckpointOut
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
static void activate(const char *expr)
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
RefCountingPtr< StaticInst > StaticInstPtr
static bool isRomMicroPC(MicroPC upc)
void change_thread_state(ThreadID tid, int activate, int priority)
Changes the status and priority of the thread with the given number.
const StaticInstPtr nullStaticInstPtr
Statically allocated null StaticInstPtr.
constexpr decltype(nullptr) NoFault
Declaration of the Packet class.
Declaration of a request, the overall memory request consisting of the parts of the request that are ...
statistics::Scalar numMatInsts
statistics::Scalar numMatAluAccesses
statistics::Scalar numBranchMispred
Number of misprediced branches.
statistics::Scalar numCallsReturns
statistics::Scalar numPredictedBranches