46 #include "arch/kernel_stats.hh" 47 #include "config/the_isa.hh" 56 #include "debug/Activity.hh" 57 #include "debug/Drain.hh" 58 #include "debug/O3CPU.hh" 59 #include "debug/Quiesce.hh" 60 #include "enums/MemoryMode.hh" 88 tickEvent([this]{
tick(); },
"FullO3CPU tick",
108 params->numPhysVecPredRegs,
134 if (!
params->switched_out) {
192 active_threads =
params->workload.size();
194 if (active_threads > Impl::MaxThreads) {
195 panic(
"Workload Size too large. Increase the 'MaxThreads' " 196 "constant in your O3CPU impl. file (e.g. o3/alpha/impl.hh) " 197 "or edit your workload size.");
213 isa[tid] =
dynamic_cast<TheISA::ISA *
>(
params->isa[tid]);
220 RegIndex invalidFPReg = TheISA::NumFloatRegs + 1;
231 for (
ThreadID tid = 0; tid < active_threads; tid++) {
265 renameMap[tid].setEntry(lrid, phys_elem);
297 this->
thread.resize(this->numThreads);
302 assert(this->numThreads == 1);
305 if (tid < params->workload.size()) {
309 (
typename Impl::O3CPU *)(
this),
310 tid,
params->workload[tid]);
320 (
typename Impl::O3CPU *)(
this),
340 o3_tc->
cpu = (
typename Impl::O3CPU *)(
this);
348 this->
thread[tid]->tc = tc;
356 fatal(
"FullO3CPU %s has no interrupt controller.\n" 357 "Ensure createInterruptController() is called.\n",
name());
361 this->
thread[tid]->setFuncExeInst(0);
364 template <
class Impl>
369 template <
class Impl>
378 fetch.regProbePoints();
380 iew.regProbePoints();
384 template <
class Impl>
393 .
desc(
"Number of times that the entire CPU went into an idle state and" 394 " unscheduled itself")
399 .
desc(
"Total number of cycles that the CPU has spent unscheduled due " 405 .
desc(
"Total number of cycles that CPU has spent quiesced or waiting " 416 .
desc(
"Number of Instructions Simulated")
422 .
desc(
"Number of Ops (including micro ops) Simulated")
427 .
desc(
"CPI: Cycles Per Instruction")
433 .
desc(
"CPI: Total CPI of All Threads")
439 .
desc(
"IPC: Instructions Per Cycle")
445 .
desc(
"IPC: Total IPC of All Threads")
449 this->
fetch.regStats();
452 this->
iew.regStats();
454 this->
rob.regStats();
457 .
name(
name() +
".int_regfile_reads")
458 .
desc(
"number of integer regfile reads")
462 .
name(
name() +
".int_regfile_writes")
463 .
desc(
"number of integer regfile writes")
468 .
desc(
"number of floating regfile reads")
472 .
name(
name() +
".fp_regfile_writes")
473 .
desc(
"number of floating regfile writes")
477 .
name(
name() +
".vec_regfile_reads")
478 .
desc(
"number of vector regfile reads")
482 .
name(
name() +
".vec_regfile_writes")
483 .
desc(
"number of vector regfile writes")
487 .
name(
name() +
".pred_regfile_reads")
488 .
desc(
"number of predicate regfile reads")
492 .
name(
name() +
".pred_regfile_writes")
493 .
desc(
"number of predicate regfile writes")
498 .
desc(
"number of cc regfile reads")
502 .
name(
name() +
".cc_regfile_writes")
503 .
desc(
"number of cc regfile writes")
507 .
name(
name() +
".misc_regfile_reads")
508 .
desc(
"number of misc regfile reads")
512 .
name(
name() +
".misc_regfile_writes")
513 .
desc(
"number of misc regfile writes")
517 template <
class Impl>
521 DPRINTF(
O3CPU,
"\n\nFullO3CPU: Ticking main, FullO3CPU.\n");
576 template <
class Impl>
585 thread[tid]->noSquashFromTC =
true;
592 thread[tid]->noSquashFromTC =
false;
597 template <
class Impl>
605 fetch.startupStage();
612 template <
class Impl>
619 DPRINTF(
O3CPU,
"[tid:%i] Calling activate thread.\n", tid);
623 DPRINTF(
O3CPU,
"[tid:%i] Adding to active threads list\n",
630 template <
class Impl>
638 DPRINTF(
O3CPU,
"[tid:%i] Calling deactivate thread.\n", tid);
642 DPRINTF(
O3CPU,
"[tid:%i] Removing from active threads list\n",
647 fetch.deactivateThread(tid);
648 commit.deactivateThread(tid);
651 template <
class Impl>
664 template <
class Impl>
677 template <
class Impl>
700 fetch.wakeFromQuiesce();
716 template <
class Impl>
720 DPRINTF(
O3CPU,
"[tid:%i] Suspending Thread Context.\n", tid);
732 DPRINTF(Quiesce,
"Suspending Context\n");
737 template <
class Impl>
742 DPRINTF(
O3CPU,
"[tid:%i] Halt Context called. Deallocating\n", tid);
751 template <
class Impl>
769 renameMap[tid].setEntry(reg_id, phys_reg);
777 renameMap[tid].setEntry(reg_id, phys_reg);
785 renameMap[tid].setEntry(reg_id, phys_reg);
800 commit.rob->resetEntries();
803 template <
class Impl>
807 DPRINTF(
O3CPU,
"[tid:%i] Removing thread context from CPU.\n", tid);
821 fetch.clearStates(tid);
824 iew.clearStates(tid);
829 assert(
iew.instQueue.getCount(tid) == 0);
830 assert(
iew.ldstQueue.getCount(tid) == 0);
831 assert(
commit.rob->isEmpty(tid));
847 template <
class Impl>
859 }
else if (
vecMode == Enums::Full) {
869 template <
class Impl>
889 template <
class Impl>
897 template <
class Impl>
910 DPRINTF(
O3CPU,
"Interrupt %s being handled\n", interrupt->name());
911 this->
trap(interrupt, 0,
nullptr);
914 template <
class Impl>
923 template <
class Impl>
927 DPRINTF(
O3CPU,
"[tid:%i] Executing syscall().\n\n", tid);
929 DPRINTF(Activity,
"Activity: syscall() called.\n");
933 ++(this->
thread[tid]->funcExeInst);
936 this->
thread[tid]->syscall(fault);
940 --(this->
thread[tid]->funcExeInst);
943 template <
class Impl>
947 thread[tid]->serialize(cp);
950 template <
class Impl>
954 thread[tid]->unserialize(cp);
957 template <
class Impl>
968 DPRINTF(Drain,
"Draining...\n");
984 DPRINTF(Drain,
"Currently suspended so activate %i \n",
995 DPRINTF(Drain,
"CPU not drained\n");
999 DPRINTF(Drain,
"CPU is already drained\n");
1020 template <
class Impl>
1030 DPRINTF(Drain,
"CPU done draining, processing drain event\n");
1036 template <
class Impl>
1041 fetch.drainSanityCheck();
1042 decode.drainSanityCheck();
1043 rename.drainSanityCheck();
1044 iew.drainSanityCheck();
1045 commit.drainSanityCheck();
1048 template <
class Impl>
1055 DPRINTF(Drain,
"Main CPU structures not drained.\n");
1059 if (!
fetch.isDrained()) {
1060 DPRINTF(Drain,
"Fetch not drained.\n");
1064 if (!
decode.isDrained()) {
1065 DPRINTF(Drain,
"Decode not drained.\n");
1069 if (!
rename.isDrained()) {
1070 DPRINTF(Drain,
"Rename not drained.\n");
1074 if (!
iew.isDrained()) {
1075 DPRINTF(Drain,
"IEW not drained.\n");
1079 if (!
commit.isDrained()) {
1080 DPRINTF(Drain,
"Commit not drained.\n");
1087 template <
class Impl>
1091 fetch.drainStall(tid);
1094 template <
class Impl>
1101 DPRINTF(Drain,
"Resuming...\n");
1104 fetch.drainResume();
1110 DPRINTF(Drain,
"Activating thread: %i\n",
i);
1124 template <
class Impl>
1139 template <
class Impl>
1145 fetch.takeOverFrom();
1161 template <
class Impl>
1166 fatal(
"The O3 CPU requires the memory system to be in " 1167 "'timing' mode.\n");
1171 template <
class Impl>
1175 return this->
isa[tid]->readMiscRegNoEffect(misc_reg);
1178 template <
class Impl>
1183 return this->
isa[tid]->readMiscReg(misc_reg,
tcBase(tid));
1186 template <
class Impl>
1190 this->
isa[tid]->setMiscRegNoEffect(misc_reg, val);
1193 template <
class Impl>
1198 this->
isa[tid]->setMiscReg(misc_reg, val,
tcBase(tid));
1201 template <
class Impl>
1209 template <
class Impl>
1217 template <
class Impl>
1226 template <
class Impl>
1235 template <
class Impl>
1243 template <
class Impl>
1252 template <
class Impl>
1261 template <
class Impl>
1269 template <
class Impl>
1277 template <
class Impl>
1285 template <
class Impl>
1293 template <
class Impl>
1301 template <
class Impl>
1310 template <
class Impl>
1318 template <
class Impl>
1329 template <
class Impl>
1340 template <
class Impl>
1350 template <
class Impl>
1360 template <
class Impl>
1370 template <
class Impl>
1380 template <
class Impl>
1390 template <
class Impl>
1401 template <
class Impl>
1412 template <
class Impl>
1423 template <
class Impl>
1433 template <
class Impl>
1443 template <
class Impl>
1453 template <
class Impl>
1464 template <
class Impl>
1468 return commit.pcState(tid);
1471 template <
class Impl>
1475 commit.pcState(val, tid);
1478 template <
class Impl>
1482 return commit.instAddr(tid);
1485 template <
class Impl>
1489 return commit.nextInstAddr(tid);
1492 template <
class Impl>
1496 return commit.microPC(tid);
1499 template <
class Impl>
1503 this->
thread[tid]->noSquashFromTC =
true;
1504 this->
commit.generateTCEvent(tid);
1507 template <
class Impl>
1516 template <
class Impl>
1521 if (!inst->isMicroop() || inst->isLastMicroop()) {
1528 thread[tid]->comInstEventQueue.serviceEvents(
thread[tid]->numInst);
1537 template <
class Impl>
1541 DPRINTF(
O3CPU,
"Removing committed instruction [tid:%i] PC %s " 1543 inst->threadNumber, inst->pcState(), inst->seqNum);
1551 template <
class Impl>
1555 DPRINTF(
O3CPU,
"Thread %i: Deleting instructions from instruction" 1560 bool rob_empty =
false;
1564 }
else if (
rob.isEmpty(tid)) {
1565 DPRINTF(
O3CPU,
"ROB is empty, squashing all insts.\n");
1569 end_it = (
rob.readTailInst(tid))->getInstListIt();
1570 DPRINTF(
O3CPU,
"ROB is not empty, squashing insts not in ROB.\n");
1581 while (inst_it != end_it) {
1596 template <
class Impl>
1608 DPRINTF(
O3CPU,
"Deleting instructions from instruction " 1609 "list that are from [tid:%i] and above [sn:%lli] (end=%lli).\n",
1610 tid, seq_num, (*inst_iter)->seqNum);
1612 while ((*inst_iter)->seqNum > seq_num) {
1614 bool break_loop = (inst_iter ==
instList.begin());
1625 template <
class Impl>
1629 if ((*instIt)->threadNumber == tid) {
1631 "[tid:%i] [sn:%lli] PC %s\n",
1632 (*instIt)->threadNumber,
1634 (*instIt)->pcState());
1637 (*instIt)->setSquashed();
1646 template <
class Impl>
1652 "[tid:%i] [sn:%lli] PC %s\n",
1672 template <
class Impl>
1680 cprintf(
"Dumping Instruction List\n");
1682 while (inst_list_it !=
instList.end()) {
1683 cprintf(
"Instruction:%i\nPC:%#x\n[tid:%i]\n[sn:%lli]\nIssued:%i\n" 1685 num, (*inst_list_it)->instAddr(), (*inst_list_it)->threadNumber,
1686 (*inst_list_it)->seqNum, (*inst_list_it)->isIssued(),
1687 (*inst_list_it)->isSquashed());
1700 template <
class Impl>
1705 DPRINTF(Activity,
"CPU already running.\n");
1709 DPRINTF(Activity,
"Waking up CPU\n");
1722 template <
class Impl>
1731 DPRINTF(Quiesce,
"Suspended Processor woken\n");
1735 template <
class Impl>
1749 template <
class Impl>
1758 unsigned high_thread = *list_begin;
1766 template <
class Impl>
1770 DPRINTF(
O3CPU,
"Thread %d is inserted to exitingThreads list\n", tid);
1786 template <
class Impl>
1793 template <
class Impl>
1814 template <
class Impl>
1825 bool readyToExit = it->second;
bool isCpuDrained() const
Check if a system is in a drained state.
#define panic(...)
This implements a cprintf based panic() function.
void unserializeThread(CheckpointIn &cp, ThreadID tid) override
Unserialize one thread.
std::vector< ThreadID > tids
Available thread ids in the cpu.
Stats::Scalar timesIdled
Stat for total number of times the CPU is descheduled.
bool removeInstsThisCycle
Records if instructions need to be removed this cycle due to being retired or squashed.
void setVecElem(PhysRegIdPtr reg_idx, const VecElem &val)
virtual void probeInstCommit(const StaticInstPtr &inst, Addr pc)
Helper method to trigger PMU probes for a committed instruction.
decltype(nullptr) constexpr NoFault
Cycles is a wrapper class for representing cycle counts, i.e.
ThreadID getFreeTid()
Gets a free thread id.
std::unordered_map< ThreadID, bool > exitingThreads
This is a list of threads that are trying to exit.
void squashFromTC(ThreadID tid)
Initiates a squash of all in-flight instructions for a given thread.
#define fatal(...)
This implements a cprintf based fatal() function.
System * system
Pointer to the system.
void scheduleTickEvent(Cycles delay)
Schedule tick event, regardless of its current state.
std::vector< Thread * > thread
Pointers to all of the threads in the CPU.
void switchRenameMode(ThreadID tid, UnifiedFreeList *freelist)
Check if a change in renaming is needed for vector registers.
Fault getInterrupts()
Returns the Fault for any valid interrupt.
static const Priority CPU_Exit_Pri
If we want to exit a thread in a CPU, it comes after CPU_Tick_Pri.
ThreadID numThreads
Number of threads we're actually simulating (<= SMT_MAX_THREADS).
VecPredRegContainer & getWritableVecPredReg(PhysRegIdPtr phys_reg)
Vector Register Abstraction This generic class is the model in a particularization of MVC...
VecRegContainer & getWritableArchVecReg(int reg_idx, ThreadID tid)
Read architectural vector register for modification.
void activateContext(ThreadID tid) override
Add Thread to Active Threads List.
virtual TheISA::PCState pcState() const =0
Stats::Formula ipc
Stat for the IPC per thread.
void takeOverFrom(BaseCPU *oldCPU) override
Takes over from another CPU.
Stats::Scalar intRegfileReads
virtual void setStatus(Status new_status)=0
std::vector< BaseInterrupts * > interrupts
const VecElem & readVecElem(PhysRegIdPtr phys_reg) const
Reads a vector element.
Stats::Scalar vecPredRegfileWrites
void wakeCPU()
Wakes the CPU, rescheduling the CPU if it's not already active.
Stats::Vector committedInsts
Stat for the number of committed instructions per thread.
Stats::Scalar vecRegfileReads
const VecRegContainer & readVecReg(PhysRegIdPtr reg_idx) const
Status _status
Overall CPU status.
CPUPolicy::Decode decode
The decode stage.
virtual void activateContext(ThreadID thread_num)
Notify the CPU that the indicated context is now active.
void activity()
Records that there is activity this cycle.
void setCCReg(PhysRegIdPtr phys_reg, RegVal val)
Sets a condition-code register to the given value.
BaseO3CPU(BaseCPUParams *params)
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
CPUPolicy::FreeList freeList
The free list.
bool switchedOut() const
Determine if the CPU is switched out.
Stats::Scalar miscRegfileReads
EventFunctionWrapper threadExitEvent
The exit event used for terminating all ready-to-exit threads.
constexpr unsigned NumVecElemPerVecReg
ProbePointArg< std::pair< DynInstPtr, PacketPtr > > * ppDataAccessComplete
void reset()
Clears the time buffer and the activity count.
Overload hash function for BasicBlockRange type.
static Enums::VecRegRenameMode mode(const TheISA::PCState &)
Stats::Vector committedOps
Stat for the number of committed ops (including micro ops) per thread.
void insertThread(ThreadID tid)
Setup CPU to insert a thread's context.
void setArchFloatReg(int reg_idx, RegVal val, ThreadID tid)
FullO3CPU(DerivO3CPUParams *params)
Constructs a CPU with the given parameters.
void setArchVecElem(const RegIndex ®_idx, const ElemIndex &ldx, const VecElem &val, ThreadID tid)
Derived & flags(Flags _flags)
Set the flags and marks this stat to print at the end of simulation.
RegVal readIntReg(PhysRegIdPtr phys_reg) const
Reads an integer register.
ThreadContext is the external interface to all thread state for anything outside of the CPU...
void tick()
Ticks CPU, calling tick() on each stage, and checking the overall activity to see if the CPU should d...
const VecElem & readArchVecElem(const RegIndex ®_idx, const ElemIndex &ldx, ThreadID tid) const
TimeBuffer< TimeStruct > timeBuffer
The main time buffer to do backwards communication.
Event for timing out quiesce instruction.
CPUPolicy::Fetch fetch
The fetch stage.
ListIt addInst(const DynInstPtr &inst)
Function to add instruction onto the head of the list of the instructions.
void trap(const Fault &fault, ThreadID tid, const StaticInstPtr &inst)
Traps to handle given fault.
CPUPolicy::ROB rob
The re-order buffer.
DrainState
Object drain/handover states.
void removeInstsUntil(const InstSeqNum &seq_num, ThreadID tid)
Remove all instructions younger than the given sequence number.
Derived & init(size_type size)
Set this vector to have the given size.
void squashInstIt(const ListIt &instIt, ThreadID tid)
Removes the instruction pointed to by the iterator.
RegVal readArchFloatReg(int reg_idx, ThreadID tid)
void regStats() override
Callback to set stat parameters.
DrainState drainState() const
Return the current drain state of an object.
Derived ThreadContext class for use with the Checker.
Stats::Formula totalCpi
Stat for the total CPI.
void verifyMemoryMode() const override
Verify that the system is in a memory mode supported by the CPU.
std::vector< ThreadContext * > threadContexts
void syscall(ThreadID tid, Fault *fault)
Executes a syscall.
void setVecReg(PhysRegIdPtr reg_idx, const VecRegContainer &val)
Vector Register Native Elem lane.
void deactivateThread(ThreadID tid)
Remove Thread from Active Threads List.
RegVal readMiscReg(int misc_reg, ThreadID tid)
Reads a misc.
Draining buffers pending serialization/handover.
void setArchIntReg(int reg_idx, RegVal val, ThreadID tid)
Architectural register accessors.
Tick curTick()
The current simulated tick.
const VecElem & readVecElem(PhysRegIdPtr reg_idx) const
void setMiscReg(int misc_reg, RegVal val, ThreadID tid)
Sets a misc.
VecRegContainer & getWritableVecReg(PhysRegIdPtr phys_reg)
Reads a vector register for modification.
RegVal readArchIntReg(int reg_idx, ThreadID tid)
std::list< ThreadID > activeThreads
Active Threads List.
void schedulePowerGatingEvent()
void setFloatReg(PhysRegIdPtr phys_reg, RegVal val)
void serializeThread(CheckpointOut &cp, ThreadID tid) const override
Serialize a single thread.
void setVecPredReg(PhysRegIdPtr phys_reg, const VecPredRegContainer &val)
Sets a predicate register to the given value.
virtual void takeOverFrom(BaseCPU *cpu)
Load the state of a CPU from the previous CPU object, invoked on all new CPUs that are about to be sw...
void suspendContext(ThreadID tid) override
Remove Thread from Active Threads List.
void haltContext(ThreadID tid) override
Remove Thread from Active Threads List && Remove Thread Context from CPU.
void updateCycleCounters(CPUState state)
base method keeping track of cycle progression
Stats::Scalar miscRegfileWrites
Stats::Scalar intRegfileWrites
RegVal readCCReg(PhysRegIdPtr phys_reg)
Reads a condition-code register.
VecRegContainer & getWritableVecReg(PhysRegIdPtr reg_idx)
Read physical vector register for modification.
CPUPolicy::Commit commit
The commit stage.
void setReg(PhysRegIdPtr phys_reg)
Sets the register as ready.
Cycles lastRunningCycle
The cycle that the CPU was last running, used for statistics.
Derived & prereq(const Stat &prereq)
Set the prerequisite stat and marks this stat to print at the end of simulation.
void startup() override
startup() is the final initialization call before simulation.
Addr instAddr(ThreadID tid)
Reads the commit PC of a specific thread.
void setArchVecPredReg(int reg_idx, const VecPredRegContainer &val, ThreadID tid)
ProbePointArg< PacketPtr > * ppInstAccessComplete
std::vector< ThreadContext * > threadContexts
TimeBuffer< DecodeStruct > decodeQueue
The decode stage's instruction queue.
void setVecElem(PhysRegIdPtr phys_reg, const VecElem val)
Sets a vector register to the given value.
void deschedule(Event &event)
EventFunctionWrapper tickEvent
The tick event used for scheduling CPU ticks.
static const Priority CPU_Tick_Pri
CPU ticks must come after other associated CPU events (such as writebacks).
Cycles curCycle() const
Determine the current cycle, corresponding to a tick aligned to a clock edge.
void setFloatReg(PhysRegIdPtr phys_reg, RegVal val)
MicroPC microPC(ThreadID tid)
Reads the commit micro PC of a specific thread.
Counter totalInsts() const override
Count the Total Instructions Committed in the CPU.
void schedule(Event &event, Tick when)
void setVecReg(PhysRegIdPtr phys_reg, const VecRegContainer &val)
Sets a vector register to the given value.
void setVectorsAsReady(ThreadID tid)
Mark vector fields in scoreboard as ready right after switching vector mode, since software may read ...
TimeBuffer< FetchStruct > fetchQueue
The fetch stage's instruction queue.
void activateThread(ThreadID tid)
Add Thread to Active Threads List.
Tick lastActivatedCycle
The cycle that the CPU was last activated by a new thread.
void init() override
Initialize the CPU.
int instcount
Count of total number of dynamic instructions in flight.
void unscheduleTickEvent()
Unschedule tick event, regardless of its current state.
Tick nextCycle() const
Based on the clock of the object, determine the start tick of the first cycle that is at least one cy...
void removeThread(ThreadID tid)
Remove all of a thread's context from CPU.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void regStats()
Callback to set stat parameters.
Derived & precision(int _precision)
Set the precision and marks this stat to print at the end of simulation.
Stats::Scalar fpRegfileReads
int64_t Counter
Statistics counter type.
Enums::VecRegRenameMode vecMode
The rename mode of the vector registers.
Stats::Scalar fpRegfileWrites
const VecRegContainer & readArchVecReg(int reg_idx, ThreadID tid) const
Tick clockEdge(Cycles cycles=Cycles(0)) const
Determine the tick when a cycle begins, by default the current one, but the argument also enables the...
bool tryDrain()
Check if the pipeline has drained and signal drain done.
Stats::Scalar vecRegfileWrites
RegVal readIntReg(PhysRegIdPtr phys_reg)
Stats::Scalar quiesceCycles
Stat for total number of cycles the CPU spends descheduled due to a quiesce operation or waiting for ...
std::queue< ListIt > removeList
List of all the instructions that will be removed at the end of this cycle.
const FlagsType total
Print the total.
virtual void switchOut()
Prepare for another CPU to take over execution.
void setMiscRegNoEffect(int misc_reg, RegVal val, ThreadID tid)
Sets a miscellaneous register.
const ThreadID InvalidThreadID
void removeInstsNotInROB(ThreadID tid)
Remove all instructions that are not currently in the ROB.
Stats::Formula cpi
Stat for the CPI per thread.
Checker< Impl > * checker
Pointer to the checker, which can dynamically verify instruction results at run time.
bool isThreadExiting(ThreadID tid) const
Is the thread trying to exit?
bool scheduled() const
Determine if the current event is scheduled.
ProbeManager * getProbeManager()
Get the probe manager for this object.
FreeList class that simply holds the list of free integer and floating point registers.
const VecPredRegContainer & readVecPredReg(PhysRegIdPtr phys_reg) const
Reads a predicate register.
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
int16_t ThreadID
Thread index/ID type.
void switchOut() override
Switches out this CPU.
virtual const std::string name() const
O3CPU * cpu
Pointer to the CPU.
ProbePointArg generates a point for the class of Arg.
void regProbePoints() override
Register probe points for this object.
ThreadContext * tcBase(ThreadID tid)
Returns a pointer to a thread context.
void setCCReg(PhysRegIdPtr phys_reg, RegVal val)
TimeBuffer< IEWStruct > iewQueue
The IEW stage's instruction queue.
std::ostream CheckpointOut
O3ThreadState< Impl > Thread
uint16_t ElemIndex
Logical vector register elem index type.
void startup() override
startup() is the final initialization call before simulation.
void setArchCCReg(int reg_idx, RegVal val, ThreadID tid)
PhysRegFile regFile
The register file.
void dumpInsts()
Debug function to print all instructions on the list.
void deschedulePowerGatingEvent()
RegVal readFloatReg(PhysRegIdPtr phys_reg)
void setIntReg(PhysRegIdPtr phys_reg, RegVal val)
Sets an integer register to the given value.
void setVecPredReg(PhysRegIdPtr reg_idx, const VecPredRegContainer &val)
const VecPredRegContainer & readArchVecPredReg(int reg_idx, ThreadID tid) const
ActivityRecorder activityRec
The activity recorder; used to tell if the CPU has any activity remaining or if it can go to idle and...
Stats::Scalar vecPredRegfileReads
Stats::Scalar idleCycles
Stat for total number of cycles the CPU spends descheduled.
Generic predicate register container.
bool active()
Returns if the CPU should be active.
RegVal readCCReg(PhysRegIdPtr phys_reg)
void signalDrainDone() const
Signal that an object is drained.
void exitThreads()
Terminate all threads that are ready to exit.
const VecRegContainer & readVecReg(PhysRegIdPtr phys_reg) const
Reads a vector register.
Addr nextInstAddr(ThreadID tid)
Reads the next PC of a specific thread.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Helper structure to get the vector register mode for a given ISA.
const RegIndex & index() const
Index accessors.
CPUPolicy::RenameMap commitRenameMap[Impl::MaxThreads]
The commit rename map.
Counter totalOps() const override
Count the Total Ops (including micro ops) committed in the CPU.
Stats::Scalar ccRegfileReads
unsigned totalNumPhysRegs() const
const VecPredRegContainer & readVecPredReg(PhysRegIdPtr reg_idx) const
InstSeqNum globalSeqNum
The global sequence number counter.
TimeBuffer< RenameStruct > renameQueue
The rename stage's instruction queue.
void removeFrontInst(const DynInstPtr &inst)
Remove an instruction from the front end of the list.
Scoreboard scoreboard
Integer Register Scoreboard.
Derived ThreadContext class for use with the O3CPU.
Register ID: describe an architectural register with its class and index.
void regStats() override
Registers statistics.
RegVal readFloatReg(PhysRegIdPtr phys_reg) const
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
DrainState drain() override
Starts draining the CPU's pipeline of all instructions in order to stop all memory accesses...
void setArchVecReg(int reg_idx, const VecRegContainer &val, ThreadID tid)
RegVal readArchCCReg(int reg_idx, ThreadID tid)
CPUPolicy::IEW iew
The issue/execute/writeback stages.
void setIntReg(PhysRegIdPtr phys_reg, RegVal val)
std::list< DynInstPtr >::iterator ListIt
std::vector< TheISA::ISA * > isa
bool isTimingMode() const
Is the system in timing mode?
void scheduleThreadExitEvent(ThreadID tid)
If a thread is trying to exit and its corresponding trap event has been completed, schedule an event to terminate the thread.
std::list< DynInstPtr > instList
List of all the instructions in flight.
void cleanUpRemovedInsts()
Cleans up all instructions on the remove list.
void advance()
Advances the activity buffer, decrementing the activityCount if active communication just left the ti...
void drainSanityCheck() const
Perform sanity checks after a drain.
VecPredRegContainer & getWritableVecPredReg(PhysRegIdPtr reg_idx)
void drainResume() override
Resumes execution after a drain.
O3CPUImpl ::DynInstPtr DynInstPtr
VecPredRegContainer & getWritableArchVecPredReg(int reg_idx, ThreadID tid)
GenericISA::DelaySlotPCState< MachInst > PCState
void commitDrained(ThreadID tid)
Commit has reached a safe point to drain a thread.
virtual void wakeup(ThreadID tid) override
O3ThreadState< Impl > * thread
Pointer to the thread state that this TC corrseponds to.
void instDone(ThreadID tid, const DynInstPtr &inst)
Function to tell the CPU that an instruction has completed.
std::shared_ptr< FaultBase > Fault
const Params * params() const
void updateThreadPriority()
Update The Order In Which We Process Threads.
void processInterrupts(const Fault &interrupt)
Processes any an interrupt fault.
Stats::Formula totalIpc
Stat for the total IPC.
RegVal readMiscRegNoEffect(int misc_reg, ThreadID tid) const
Register accessors.
CPUPolicy::RenameMap renameMap[Impl::MaxThreads]
The rename map.
void pcState(const TheISA::PCState &newPCState, ThreadID tid)
Sets the commit PC state of a specific thread.
virtual void suspendContext(ThreadID thread_num)
Notify the CPU that the indicated context is now suspended.
void cprintf(const char *format, const Args &...args)
void addThreadToExitingList(ThreadID tid)
Insert tid to the list of threads trying to exit.
FullO3CPU class, has each of the stages (fetch through commit) within it, as well as all of the time ...
void regProbePoints() override
Register probe points.
Stats::Scalar ccRegfileWrites
CPUPolicy::Rename rename
The dispatch stage.