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"
86 branchPred(
p->branchPred),
96 p->itb,
p->dtb,
p->isa[
i]);
99 p->itb,
p->dtb,
p->isa[
i]);
108 fatal(
"Checker currently does not support SMT");
128 tc->initMemProxies(tc);
141 }
while (oldpc !=
pc);
181 total_inst += t_info->numInst;
192 total_op += t_info->numOp;
214 using namespace Stats;
221 std::string thread_str =
name();
226 .
name(thread_str +
".committedInsts")
227 .
desc(
"Number of instructions committed")
231 .
name(thread_str +
".committedOps")
232 .
desc(
"Number of ops (including micro ops) committed")
236 .
name(thread_str +
".num_int_alu_accesses")
237 .
desc(
"Number of integer alu accesses")
241 .
name(thread_str +
".num_fp_alu_accesses")
242 .
desc(
"Number of float alu accesses")
246 .
name(thread_str +
".num_vec_alu_accesses")
247 .
desc(
"Number of vector alu accesses")
251 .
name(thread_str +
".num_func_calls")
252 .
desc(
"number of times a function call or return occured")
256 .
name(thread_str +
".num_conditional_control_insts")
257 .
desc(
"number of instructions that are conditional controls")
261 .
name(thread_str +
".num_int_insts")
262 .
desc(
"number of integer instructions")
266 .
name(thread_str +
".num_fp_insts")
267 .
desc(
"number of float instructions")
271 .
name(thread_str +
".num_vec_insts")
272 .
desc(
"number of vector instructions")
276 .
name(thread_str +
".num_int_register_reads")
277 .
desc(
"number of times the integer registers were read")
281 .
name(thread_str +
".num_int_register_writes")
282 .
desc(
"number of times the integer registers were written")
286 .
name(thread_str +
".num_fp_register_reads")
287 .
desc(
"number of times the floating registers were read")
291 .
name(thread_str +
".num_fp_register_writes")
292 .
desc(
"number of times the floating registers were written")
296 .
name(thread_str +
".num_vec_register_reads")
297 .
desc(
"number of times the vector registers were read")
301 .
name(thread_str +
".num_vec_register_writes")
302 .
desc(
"number of times the vector registers were written")
306 .
name(thread_str +
".num_cc_register_reads")
307 .
desc(
"number of times the CC registers were read")
312 .
name(thread_str +
".num_cc_register_writes")
313 .
desc(
"number of times the CC registers were written")
318 .
name(thread_str +
".num_mem_refs")
319 .
desc(
"number of memory refs")
323 .
name(thread_str +
".num_store_insts")
324 .
desc(
"Number of store instructions")
328 .
name(thread_str +
".num_load_insts")
329 .
desc(
"Number of load instructions")
333 .
name(thread_str +
".not_idle_fraction")
334 .
desc(
"Percentage of non-idle cycles")
338 .
name(thread_str +
".idle_fraction")
339 .
desc(
"Percentage of idle cycles")
343 .
name(thread_str +
".num_busy_cycles")
344 .
desc(
"Number of busy cycles")
348 .
name(thread_str +
".num_idle_cycles")
349 .
desc(
"Number of idle cycles")
353 .
name(thread_str +
".icache_stall_cycles")
354 .
desc(
"ICache total stall cycles")
359 .
name(thread_str +
".dcache_stall_cycles")
360 .
desc(
"DCache total stall cycles")
365 .
init(Enums::Num_OpClass)
366 .
name(thread_str +
".op_class")
367 .
desc(
"Class of executed instruction")
380 .
name(thread_str +
".Branches")
381 .
desc(
"Number of branches fetched")
385 .
name(thread_str +
".predictedBranches")
386 .
desc(
"Number of branches predicted as taken")
390 .
name(thread_str +
".BranchMispred")
391 .
desc(
"Number of branch mispredictions")
399 BaseCPU::resetStats();
430 DPRINTF(Quiesce,
"[tid:%d] Suspended Processor awoke\n", tid);
438 if (
DTRACE(ExecFaulting)) {
459 assert(!std::dynamic_pointer_cast<GenericHtmFailureFault>(
462 DPRINTF(HtmCpu,
"Deferring pending interrupt - %s -"
463 "due to transactional state\n",
470 interrupt->invoke(tc);
487 DPRINTF(Fetch,
"Fetch: Inst PC:%08p, Fetch PC:%08p\n", instAddr, fetchPC);
533 instPtr =
decoder->decode(pcState);
562 DPRINTF(Decode,
"Decode: Decoded %s instruction: %#x\n",
573 const bool predict_taken(
590 Addr instAddr =
pc.instAddr();
664 const bool branching(thread->
pcState().branching());
static const OpClass Num_OpClasses
#define fatal(...)
This implements a cprintf based fatal() function.
Stats::Scalar numVecInsts
TheISA::PCState pcState() const override
Trace::InstRecord * traceData
Stats::Scalar numCCRegReads
Stats::Scalar numFpRegWrites
StaticInstPtr curMacroStaticInst
Stats::Formula numIdleCycles
void unserializeThread(CheckpointIn &cp, ThreadID tid) override
Unserialize one thread.
Counter totalInsts() const override
int16_t ThreadID
Thread index/ID type.
Trace::InstTracer * tracer
void serializeThread(CheckpointOut &cp, ThreadID tid) const override
Serialize a single thread.
Stats::Scalar numLoadInsts
const std::string to_string(sc_enc enc)
void setSystem(System *system)
void setIntReg(RegIndex reg_idx, RegVal val) override
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.
Stats::Scalar numIntAluAccesses
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
@ INST_FETCH
The request was an instruction fetch.
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...
Derived & flags(Flags _flags)
Set the flags and marks this stat to print at the end of simulation.
Stats::Scalar numIntRegReads
std::list< ThreadID > activeThreads
Stats::Scalar numIntRegWrites
int64_t Counter
Statistics counter type.
Stats::Scalar numPredictedBranches
Number of branches predicted as taken.
Counter totalOps() const override
Addr instAddr() const override
ThreadContext is the external interface to all thread state for anything outside of the CPU.
bool isDelayedCommit() const
Derived & prereq(const Stat &prereq)
Set the prerequisite stat and marks this stat to print at the end of simulation.
ThreadContext * getTC()
Returns the pointer to this SimpleThread's ThreadContext.
Stats::Scalar dcacheStallCycles
std::shared_ptr< FaultBase > Fault
std::vector< BaseInterrupts * > interrupts
TheISA::MachInst inst
Current instruction.
std::string getName()
Return name of machine instruction.
void serviceEvents(Tick when)
process all events up to the given timestamp.
std::vector< ThreadContext * > threadContexts
Stats::Scalar icacheStallCycles
Stats::Scalar numFpRegReads
void checkForInterrupts()
Stats::Scalar numVecRegWrites
AddressMonitor * getCpuAddrMonitor(ThreadID tid)
constexpr decltype(nullptr) NoFault
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
static StaticInstPtr nullStaticInstPtr
Pointer to a statically allocated "null" instruction object.
Stats::Scalar numIntInsts
const FlagsType dist
Print the distribution.
const std::string & name()
Derived & init(size_type size)
Set this vector to have the given size.
static bool isRomMicroPC(MicroPC upc)
Stats::Scalar numVecRegReads
Stats::Scalar numCallsReturns
const FlagsType nozero
Don't print if this is zero.
RequestorID instRequestorId() const
Reads this CPU's unique instruction requestor ID.
Stats::Scalar numBranches
Stats::Formula idleFraction
void wakeup(ThreadID tid) override
StaticInstPtr curStaticInst
EventQueue comInstEventQueue
An instruction-based event queue.
void advancePC(const Fault &fault)
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.
const ExtMachInst machInst
The binary machine instruction.
Overload hash function for BasicBlockRange type.
GenericISA::DelaySlotPCState< MachInst > PCState
Stats::Formula numBusyCycles
const FlagsType pdf
Print the percent of the total that this entry represents.
Stats::Scalar numStoreInsts
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)
BaseSimpleCPU(BaseSimpleCPUParams *params)
void setFaulting(bool val)
void resetStats() override
Derived ThreadContext class for use with the Checker.
std::ostream CheckpointOut
Derived & subname(off_type index, const std::string &name)
Set the subfield name for the given index, and marks this stat to print at the end of simulation.
Stats::Scalar numCondCtrlInsts
virtual void suspendContext(ThreadID thread_num)
Notify the CPU that the indicated context is now suspended.
Stats::Scalar numVecAluAccesses
Stats::Scalar numFpAluAccesses
Stats::Scalar numBranchMispred
Number of misprediced branches.
const FlagsType total
Print the total.
bool inHtmTransactionalState() const override
void squash(const InstSeqNum &squashed_sn, ThreadID tid)
Squashes all outstanding updates until a given sequence number.
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
virtual void probeInstCommit(const StaticInstPtr &inst, Addr pc)
Helper method to trigger PMU probes for a committed instruction.
bool checkInterrupts(ThreadID tid) const
Stats::Average notIdleFraction
void haltContext(ThreadID thread_num) override
Notify the CPU that the indicated context is now halted.
Stats::Vector statExecutedInstType
Stats::Scalar numCCRegWrites
Tick curTick()
The current simulated tick.
Generated on Wed Sep 30 2020 14:02:08 for gem5 by doxygen 1.8.17