50 #include "arch/kernel_stats.hh" 51 #include "config/the_isa.hh" 60 #include "debug/Activity.hh" 61 #include "debug/Drain.hh" 62 #include "debug/O3CPU.hh" 63 #include "debug/Quiesce.hh" 64 #include "enums/MemoryMode.hh" 71 #if THE_ISA == ALPHA_ISA 73 #include "debug/Activity.hh" 98 tickEvent([this]{
tick(); },
"FullO3CPU tick",
118 params->numPhysVecPredRegs,
144 if (!
params->switched_out) {
202 active_threads =
params->workload.size();
204 if (active_threads > Impl::MaxThreads) {
205 panic(
"Workload Size too large. Increase the 'MaxThreads' " 206 "constant in your O3CPU impl. file (e.g. o3/alpha/impl.hh) " 207 "or edit your workload size.");
229 RegIndex invalidFPReg = TheISA::NumFloatRegs + 1;
243 for (
ThreadID tid = 0; tid < active_threads; tid++) {
277 renameMap[tid].setEntry(lrid, phys_elem);
309 this->
thread.resize(this->numThreads);
314 assert(this->numThreads == 1);
317 if (tid < params->workload.size()) {
321 (
typename Impl::O3CPU *)(
this),
322 tid,
params->workload[tid]);
332 (
typename Impl::O3CPU *)(
this),
352 o3_tc->
cpu = (
typename Impl::O3CPU *)(
this);
360 this->
thread[tid]->tc = tc;
368 fatal(
"FullO3CPU %s has no interrupt controller.\n" 369 "Ensure createInterruptController() is called.\n",
name());
373 this->
thread[tid]->setFuncExeInst(0);
376 template <
class Impl>
381 template <
class Impl>
390 fetch.regProbePoints();
392 iew.regProbePoints();
396 template <
class Impl>
405 .
desc(
"Number of times that the entire CPU went into an idle state and" 406 " unscheduled itself")
411 .
desc(
"Total number of cycles that the CPU has spent unscheduled due " 417 .
desc(
"Total number of cycles that CPU has spent quiesced or waiting " 428 .
desc(
"Number of Instructions Simulated")
434 .
desc(
"Number of Ops (including micro ops) Simulated")
439 .
desc(
"CPI: Cycles Per Instruction")
445 .
desc(
"CPI: Total CPI of All Threads")
451 .
desc(
"IPC: Instructions Per Cycle")
457 .
desc(
"IPC: Total IPC of All Threads")
461 this->
fetch.regStats();
464 this->
iew.regStats();
466 this->
rob.regStats();
469 .
name(
name() +
".int_regfile_reads")
470 .
desc(
"number of integer regfile reads")
474 .
name(
name() +
".int_regfile_writes")
475 .
desc(
"number of integer regfile writes")
480 .
desc(
"number of floating regfile reads")
484 .
name(
name() +
".fp_regfile_writes")
485 .
desc(
"number of floating regfile writes")
489 .
name(
name() +
".vec_regfile_reads")
490 .
desc(
"number of vector regfile reads")
494 .
name(
name() +
".vec_regfile_writes")
495 .
desc(
"number of vector regfile writes")
499 .
name(
name() +
".pred_regfile_reads")
500 .
desc(
"number of predicate regfile reads")
504 .
name(
name() +
".pred_regfile_writes")
505 .
desc(
"number of predicate regfile writes")
510 .
desc(
"number of cc regfile reads")
514 .
name(
name() +
".cc_regfile_writes")
515 .
desc(
"number of cc regfile writes")
519 .
name(
name() +
".misc_regfile_reads")
520 .
desc(
"number of misc regfile reads")
524 .
name(
name() +
".misc_regfile_writes")
525 .
desc(
"number of misc regfile writes")
529 template <
class Impl>
533 DPRINTF(
O3CPU,
"\n\nFullO3CPU: Ticking main, FullO3CPU.\n");
588 template <
class Impl>
597 thread[tid]->noSquashFromTC =
true;
604 thread[tid]->noSquashFromTC =
false;
609 template <
class Impl>
617 fetch.startupStage();
624 template <
class Impl>
631 DPRINTF(
O3CPU,
"[tid:%i] Calling activate thread.\n", tid);
635 DPRINTF(
O3CPU,
"[tid:%i] Adding to active threads list\n",
642 template <
class Impl>
650 DPRINTF(
O3CPU,
"[tid:%i] Calling deactivate thread.\n", tid);
654 DPRINTF(
O3CPU,
"[tid:%i] Removing from active threads list\n",
659 fetch.deactivateThread(tid);
660 commit.deactivateThread(tid);
663 template <
class Impl>
676 template <
class Impl>
689 template <
class Impl>
712 fetch.wakeFromQuiesce();
728 template <
class Impl>
732 DPRINTF(
O3CPU,
"[tid:%i] Suspending Thread Context.\n", tid);
744 DPRINTF(Quiesce,
"Suspending Context\n");
749 template <
class Impl>
754 DPRINTF(
O3CPU,
"[tid:%i] Halt Context called. Deallocating\n", tid);
763 template <
class Impl>
781 renameMap[tid].setEntry(reg_id, phys_reg);
789 renameMap[tid].setEntry(reg_id, phys_reg);
797 renameMap[tid].setEntry(reg_id, phys_reg);
812 commit.rob->resetEntries();
815 template <
class Impl>
819 DPRINTF(
O3CPU,
"[tid:%i] Removing thread context from CPU.\n", tid);
833 fetch.clearStates(tid);
836 iew.clearStates(tid);
841 assert(
iew.instQueue.getCount(tid) == 0);
842 assert(
iew.ldstQueue.getCount(tid) == 0);
843 assert(
commit.rob->isEmpty(tid));
859 template <
class Impl>
878 template <
class Impl>
886 template <
class Impl>
899 DPRINTF(
O3CPU,
"Interrupt %s being handled\n", interrupt->name());
900 this->
trap(interrupt, 0,
nullptr);
903 template <
class Impl>
912 template <
class Impl>
916 DPRINTF(
O3CPU,
"[tid:%i] Executing syscall().\n\n", tid);
918 DPRINTF(Activity,
"Activity: syscall() called.\n");
922 ++(this->
thread[tid]->funcExeInst);
925 this->
thread[tid]->syscall(fault);
929 --(this->
thread[tid]->funcExeInst);
932 template <
class Impl>
936 thread[tid]->serialize(cp);
939 template <
class Impl>
943 thread[tid]->unserialize(cp);
946 template <
class Impl>
957 DPRINTF(Drain,
"Draining...\n");
973 DPRINTF(Drain,
"Currently suspended so activate %i \n",
984 DPRINTF(Drain,
"CPU not drained\n");
988 DPRINTF(Drain,
"CPU is already drained\n");
1009 template <
class Impl>
1019 DPRINTF(Drain,
"CPU done draining, processing drain event\n");
1025 template <
class Impl>
1030 fetch.drainSanityCheck();
1031 decode.drainSanityCheck();
1032 rename.drainSanityCheck();
1033 iew.drainSanityCheck();
1034 commit.drainSanityCheck();
1037 template <
class Impl>
1044 DPRINTF(Drain,
"Main CPU structures not drained.\n");
1048 if (!
fetch.isDrained()) {
1049 DPRINTF(Drain,
"Fetch not drained.\n");
1053 if (!
decode.isDrained()) {
1054 DPRINTF(Drain,
"Decode not drained.\n");
1058 if (!
rename.isDrained()) {
1059 DPRINTF(Drain,
"Rename not drained.\n");
1063 if (!
iew.isDrained()) {
1064 DPRINTF(Drain,
"IEW not drained.\n");
1068 if (!
commit.isDrained()) {
1069 DPRINTF(Drain,
"Commit not drained.\n");
1076 template <
class Impl>
1080 fetch.drainStall(tid);
1083 template <
class Impl>
1090 DPRINTF(Drain,
"Resuming...\n");
1093 fetch.drainResume();
1099 DPRINTF(Drain,
"Activating thread: %i\n",
i);
1113 template <
class Impl>
1128 template <
class Impl>
1134 fetch.takeOverFrom();
1150 template <
class Impl>
1155 fatal(
"The O3 CPU requires the memory system to be in " 1156 "'timing' mode.\n");
1160 template <
class Impl>
1164 return this->
isa[tid]->readMiscRegNoEffect(misc_reg);
1167 template <
class Impl>
1172 return this->
isa[tid]->readMiscReg(misc_reg,
tcBase(tid));
1175 template <
class Impl>
1179 this->
isa[tid]->setMiscRegNoEffect(misc_reg, val);
1182 template <
class Impl>
1187 this->
isa[tid]->setMiscReg(misc_reg, val,
tcBase(tid));
1190 template <
class Impl>
1198 template <
class Impl>
1206 template <
class Impl>
1215 template <
class Impl>
1224 template <
class Impl>
1232 template <
class Impl>
1241 template <
class Impl>
1250 template <
class Impl>
1258 template <
class Impl>
1266 template <
class Impl>
1274 template <
class Impl>
1282 template <
class Impl>
1290 template <
class Impl>
1299 template <
class Impl>
1307 template <
class Impl>
1318 template <
class Impl>
1329 template <
class Impl>
1339 template <
class Impl>
1349 template <
class Impl>
1359 template <
class Impl>
1369 template <
class Impl>
1379 template <
class Impl>
1390 template <
class Impl>
1401 template <
class Impl>
1412 template <
class Impl>
1422 template <
class Impl>
1432 template <
class Impl>
1442 template <
class Impl>
1453 template <
class Impl>
1457 return commit.pcState(tid);
1460 template <
class Impl>
1464 commit.pcState(val, tid);
1467 template <
class Impl>
1471 return commit.instAddr(tid);
1474 template <
class Impl>
1478 return commit.nextInstAddr(tid);
1481 template <
class Impl>
1485 return commit.microPC(tid);
1488 template <
class Impl>
1492 this->
thread[tid]->noSquashFromTC =
true;
1493 this->
commit.generateTCEvent(tid);
1496 template <
class Impl>
1505 template <
class Impl>
1510 if (!inst->isMicroop() || inst->isLastMicroop()) {
1517 thread[tid]->comInstEventQueue.serviceEvents(
thread[tid]->numInst);
1526 template <
class Impl>
1530 DPRINTF(
O3CPU,
"Removing committed instruction [tid:%i] PC %s " 1532 inst->threadNumber, inst->pcState(), inst->seqNum);
1540 template <
class Impl>
1544 DPRINTF(
O3CPU,
"Thread %i: Deleting instructions from instruction" 1549 bool rob_empty =
false;
1553 }
else if (
rob.isEmpty(tid)) {
1554 DPRINTF(
O3CPU,
"ROB is empty, squashing all insts.\n");
1558 end_it = (
rob.readTailInst(tid))->getInstListIt();
1559 DPRINTF(
O3CPU,
"ROB is not empty, squashing insts not in ROB.\n");
1570 while (inst_it != end_it) {
1585 template <
class Impl>
1597 DPRINTF(
O3CPU,
"Deleting instructions from instruction " 1598 "list that are from [tid:%i] and above [sn:%lli] (end=%lli).\n",
1599 tid, seq_num, (*inst_iter)->seqNum);
1601 while ((*inst_iter)->seqNum > seq_num) {
1603 bool break_loop = (inst_iter ==
instList.begin());
1614 template <
class Impl>
1618 if ((*instIt)->threadNumber == tid) {
1620 "[tid:%i] [sn:%lli] PC %s\n",
1621 (*instIt)->threadNumber,
1623 (*instIt)->pcState());
1626 (*instIt)->setSquashed();
1635 template <
class Impl>
1641 "[tid:%i] [sn:%lli] PC %s\n",
1661 template <
class Impl>
1669 cprintf(
"Dumping Instruction List\n");
1671 while (inst_list_it !=
instList.end()) {
1672 cprintf(
"Instruction:%i\nPC:%#x\n[tid:%i]\n[sn:%lli]\nIssued:%i\n" 1674 num, (*inst_list_it)->instAddr(), (*inst_list_it)->threadNumber,
1675 (*inst_list_it)->seqNum, (*inst_list_it)->isIssued(),
1676 (*inst_list_it)->isSquashed());
1689 template <
class Impl>
1694 DPRINTF(Activity,
"CPU already running.\n");
1698 DPRINTF(Activity,
"Waking up CPU\n");
1711 template <
class Impl>
1720 DPRINTF(Quiesce,
"Suspended Processor woken\n");
1724 template <
class Impl>
1738 template <
class Impl>
1747 unsigned high_thread = *list_begin;
1755 template <
class Impl>
1759 DPRINTF(
O3CPU,
"Thread %d is inserted to exitingThreads list\n", tid);
1775 template <
class Impl>
1782 template <
class Impl>
1803 template <
class Impl>
1814 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.
DrainState
Object drain/handover states.
Fault getInterrupts()
Returns the Fault for any valid interrupt.
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.
static const Priority CPU_Tick_Pri
CPU ticks must come after other associated CPU events (such as writebacks).
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.
DrainState drainState() const
Return the current drain state of an object.
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.
void signalDrainDone() const
Signal that an object is drained.
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.
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.
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 deschedule(Event &event)
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.
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.
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()
bool scheduled() const
Determine if the current event is scheduled.
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.
EventFunctionWrapper tickEvent
The tick event used for scheduling CPU ticks.
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 setVecReg(PhysRegIdPtr phys_reg, const VecRegContainer &val)
Sets a vector register to the given value.
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.
Draining buffers pending serialization/handover.
virtual const std::string name() const
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?
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.
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)
GenericISA::SimplePCState< MachInst > PCState
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.
ProbeManager * getProbeManager()
Get the probe manager for this object.
RegVal readCCReg(PhysRegIdPtr phys_reg)
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.
void schedule(Event &event, Tick when)
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.
constexpr unsigned NumVecElemPerVecReg
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)
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.
static const Priority CPU_Exit_Pri
If we want to exit a thread in a CPU, it comes after CPU_Tick_Pri.
Stats::Scalar ccRegfileWrites
CPUPolicy::Rename rename
The dispatch stage.