Go to the documentation of this file.
46 #include "config/the_isa.hh"
54 #include "debug/Activity.hh"
55 #include "debug/Drain.hh"
56 #include "debug/O3CPU.hh"
57 #include "debug/Quiesce.hh"
58 #include "enums/MemoryMode.hh"
76 tickEvent([this]{
tick(); },
"FullO3CPU tick",
78 threadExitEvent([
this]{ exitThreads(); },
"FullO3CPU exit threads",
83 removeInstsThisCycle(
false),
93 regFile(params.numPhysIntRegs,
94 params.numPhysFloatRegs,
95 params.numPhysVecRegs,
96 params.numPhysVecPredRegs,
100 freeList(
name() +
".freelist", ®File),
104 scoreboard(
name() +
".scoreboard",
105 regFile.totalNumPhysRegs()),
107 isa(numThreads, NULL),
109 timeBuffer(params.backComSize, params.forwardComSize),
110 fetchQueue(params.backComSize, params.forwardComSize),
111 decodeQueue(params.backComSize, params.forwardComSize),
112 renameQueue(params.backComSize, params.forwardComSize),
113 iewQueue(params.backComSize, params.forwardComSize),
114 activityRec(
name(), NumStages,
115 params.backComSize + params.forwardComSize,
120 lastRunningCycle(curCycle()),
124 "SMT is not supported in O3 in full system mode currently.");
127 "More workload items (%d) than threads (%d) on CPU %s.",
128 params.workload.size(), params.numThreads,
name());
130 if (!params.switched_out) {
133 _status = SwitchedOut;
136 if (params.checker) {
137 BaseCPU *temp_checker = params.checker;
140 checker->setSystem(params.system);
146 thread.resize(numThreads);
147 tids.resize(numThreads);
155 fetch.setActiveThreads(&activeThreads);
156 decode.setActiveThreads(&activeThreads);
157 rename.setActiveThreads(&activeThreads);
158 iew.setActiveThreads(&activeThreads);
159 commit.setActiveThreads(&activeThreads);
162 fetch.setTimeBuffer(&timeBuffer);
163 decode.setTimeBuffer(&timeBuffer);
164 rename.setTimeBuffer(&timeBuffer);
165 iew.setTimeBuffer(&timeBuffer);
166 commit.setTimeBuffer(&timeBuffer);
169 fetch.setFetchQueue(&fetchQueue);
170 decode.setFetchQueue(&fetchQueue);
171 commit.setFetchQueue(&fetchQueue);
172 decode.setDecodeQueue(&decodeQueue);
173 rename.setDecodeQueue(&decodeQueue);
174 rename.setRenameQueue(&renameQueue);
175 iew.setRenameQueue(&renameQueue);
176 iew.setIEWQueue(&iewQueue);
177 commit.setIEWQueue(&iewQueue);
178 commit.setRenameQueue(&renameQueue);
180 commit.setIEWStage(&iew);
181 rename.setIEWStage(&iew);
182 rename.setCommitStage(&commit);
188 active_threads = params.workload.size();
190 if (active_threads > Impl::MaxThreads) {
191 panic(
"Workload Size too large. Increase the 'MaxThreads' "
192 "constant in your O3CPU impl. file (e.g. o3/alpha/impl.hh) "
193 "or edit your workload size.");
204 rename.setScoreboard(&scoreboard);
205 iew.setScoreboard(&scoreboard);
208 for (
ThreadID tid = 0; tid < numThreads; tid++) {
209 isa[tid] =
dynamic_cast<TheISA::ISA *
>(params.isa[tid]);
227 for (
ThreadID tid = 0; tid < active_threads; tid++) {
239 commitRenameMap[tid].setEntry(
246 if (vecMode == Enums::Full) {
251 renameMap[tid].setEntry(rid, phys_reg);
252 commitRenameMap[tid].setEntry(rid, phys_reg);
261 renameMap[tid].setEntry(lrid, phys_elem);
262 commitRenameMap[tid].setEntry(lrid, phys_elem);
270 commitRenameMap[tid].setEntry(
281 rename.setRenameMap(renameMap);
282 commit.setRenameMap(commitRenameMap);
283 rename.setFreeList(&freeList);
288 lastActivatedCycle = 0;
290 DPRINTF(O3CPU,
"Creating O3CPU object.\n");
293 this->thread.resize(this->numThreads);
295 for (
ThreadID tid = 0; tid < this->numThreads; ++tid) {
298 assert(this->numThreads == 1);
299 this->thread[tid] =
new Thread(
this, 0, NULL);
301 if (tid < params.workload.size()) {
302 DPRINTF(O3CPU,
"Workload[%i] process is %#x",
303 tid, this->thread[tid]);
305 (
typename Impl::O3CPU *)(
this),
306 tid, params.workload[tid]);
316 (
typename Impl::O3CPU *)(
this),
331 if (params.checker) {
333 o3_tc, this->checker);
336 o3_tc->
cpu = (
typename Impl::O3CPU *)(
this);
338 o3_tc->
thread = this->thread[tid];
341 this->thread[tid]->tc = tc;
344 this->threadContexts.push_back(tc);
348 if (!params.switched_out && interrupts.empty()) {
349 fatal(
"FullO3CPU %s has no interrupt controller.\n"
350 "Ensure createInterruptController() is called.\n",
name());
353 for (
ThreadID tid = 0; tid < this->numThreads; tid++)
354 this->thread[tid]->setFuncExeInst(0);
357 template <
class Impl>
362 template <
class Impl>
371 fetch.regProbePoints();
372 rename.regProbePoints();
373 iew.regProbePoints();
374 commit.regProbePoints();
377 template <
class Impl>
382 "Number of times that the entire CPU went into an idle state "
383 "and unscheduled itself"),
385 "Total number of cycles that the CPU has spent unscheduled due "
388 "Total number of cycles that CPU has spent quiesced or waiting "
392 "Number of Ops (including micro ops) Simulated"),
394 "CPI: Cycles Per Instruction"),
396 "CPI: Total CPI of All Threads"),
398 "IPC: Instructions Per Cycle"),
400 "IPC: Total IPC of All Threads"),
403 "Number of integer regfile writes"),
406 "Number of floating regfile writes"),
409 "number of vector regfile writes"),
411 "number of predicate regfile reads"),
413 "number of predicate regfile writes"),
494 template <
class Impl>
498 DPRINTF(
O3CPU,
"\n\nFullO3CPU: Ticking main, FullO3CPU.\n");
553 template <
class Impl>
562 thread[tid]->noSquashFromTC =
true;
569 thread[tid]->noSquashFromTC =
false;
574 template <
class Impl>
580 fetch.startupStage();
587 template <
class Impl>
594 DPRINTF(
O3CPU,
"[tid:%i] Calling activate thread.\n", tid);
598 DPRINTF(
O3CPU,
"[tid:%i] Adding to active threads list\n",
605 template <
class Impl>
611 assert(!
commit.executingHtmTransaction(tid));
617 DPRINTF(
O3CPU,
"[tid:%i] Calling deactivate thread.\n", tid);
621 DPRINTF(
O3CPU,
"[tid:%i] Removing from active threads list\n",
626 fetch.deactivateThread(tid);
627 commit.deactivateThread(tid);
630 template <
class Impl>
643 template <
class Impl>
656 template <
class Impl>
679 fetch.wakeFromQuiesce();
695 template <
class Impl>
699 DPRINTF(
O3CPU,
"[tid:%i] Suspending Thread Context.\n", tid);
711 DPRINTF(Quiesce,
"Suspending Context\n");
716 template <
class Impl>
721 DPRINTF(
O3CPU,
"[tid:%i] Halt Context called. Deallocating\n", tid);
739 template <
class Impl>
757 renameMap[tid].setEntry(reg_id, phys_reg);
765 renameMap[tid].setEntry(reg_id, phys_reg);
773 renameMap[tid].setEntry(reg_id, phys_reg);
788 commit.rob->resetEntries();
791 template <
class Impl>
795 DPRINTF(
O3CPU,
"[tid:%i] Removing thread context from CPU.\n", tid);
809 fetch.clearStates(tid);
812 iew.clearStates(tid);
826 assert(
iew.instQueue.getCount(tid) == 0);
827 assert(
iew.ldstQueue.getCount(tid) == 0);
828 assert(
commit.rob->isEmpty(tid));
844 template <
class Impl>
856 }
else if (
vecMode == Enums::Full) {
866 template <
class Impl>
886 template <
class Impl>
894 template <
class Impl>
907 DPRINTF(
O3CPU,
"Interrupt %s being handled\n", interrupt->name());
908 this->
trap(interrupt, 0,
nullptr);
911 template <
class Impl>
920 template <
class Impl>
927 template <
class Impl>
934 template <
class Impl>
945 DPRINTF(Drain,
"Draining...\n");
961 DPRINTF(Drain,
"Currently suspended so activate %i \n",
972 DPRINTF(Drain,
"CPU not drained\n");
976 DPRINTF(Drain,
"CPU is already drained\n");
997 template <
class Impl>
1007 DPRINTF(Drain,
"CPU done draining, processing drain event\n");
1013 template <
class Impl>
1018 fetch.drainSanityCheck();
1019 decode.drainSanityCheck();
1020 rename.drainSanityCheck();
1021 iew.drainSanityCheck();
1022 commit.drainSanityCheck();
1025 template <
class Impl>
1032 DPRINTF(Drain,
"Main CPU structures not drained.\n");
1036 if (!
fetch.isDrained()) {
1037 DPRINTF(Drain,
"Fetch not drained.\n");
1041 if (!
decode.isDrained()) {
1042 DPRINTF(Drain,
"Decode not drained.\n");
1046 if (!
rename.isDrained()) {
1047 DPRINTF(Drain,
"Rename not drained.\n");
1051 if (!
iew.isDrained()) {
1052 DPRINTF(Drain,
"IEW not drained.\n");
1056 if (!
commit.isDrained()) {
1057 DPRINTF(Drain,
"Commit not drained.\n");
1064 template <
class Impl>
1068 fetch.drainStall(tid);
1071 template <
class Impl>
1078 DPRINTF(Drain,
"Resuming...\n");
1081 fetch.drainResume();
1087 DPRINTF(Drain,
"Activating thread: %i\n",
i);
1101 template <
class Impl>
1116 template <
class Impl>
1122 fetch.takeOverFrom();
1138 template <
class Impl>
1143 fatal(
"The O3 CPU requires the memory system to be in "
1144 "'timing' mode.\n");
1148 template <
class Impl>
1152 return this->
isa[tid]->readMiscRegNoEffect(misc_reg);
1155 template <
class Impl>
1160 return this->
isa[tid]->readMiscReg(misc_reg);
1163 template <
class Impl>
1167 this->
isa[tid]->setMiscRegNoEffect(misc_reg,
val);
1170 template <
class Impl>
1175 this->
isa[tid]->setMiscReg(misc_reg,
val);
1178 template <
class Impl>
1186 template <
class Impl>
1194 template <
class Impl>
1202 template <
class Impl>
1210 template <
class Impl>
1218 template <
class Impl>
1226 template <
class Impl>
1234 template <
class Impl>
1242 template <
class Impl>
1250 template <
class Impl>
1258 template <
class Impl>
1267 template <
class Impl>
1275 template <
class Impl>
1284 template <
class Impl>
1292 template <
class Impl>
1303 template <
class Impl>
1314 template <
class Impl>
1323 template <
class Impl>
1332 template <
class Impl>
1342 template <
class Impl>
1351 template <
class Impl>
1360 template <
class Impl>
1371 template <
class Impl>
1382 template <
class Impl>
1393 template <
class Impl>
1403 template <
class Impl>
1413 template <
class Impl>
1423 template <
class Impl>
1434 template <
class Impl>
1438 return commit.pcState(tid);
1441 template <
class Impl>
1448 template <
class Impl>
1452 return commit.instAddr(tid);
1455 template <
class Impl>
1459 return commit.nextInstAddr(tid);
1462 template <
class Impl>
1466 return commit.microPC(tid);
1469 template <
class Impl>
1473 this->
thread[tid]->noSquashFromTC =
true;
1474 this->
commit.generateTCEvent(tid);
1477 template <
class Impl>
1486 template <
class Impl>
1491 if (!inst->isMicroop() || inst->isLastMicroop()) {
1493 thread[tid]->threadStats.numInsts++;
1497 thread[tid]->comInstEventQueue.serviceEvents(
thread[tid]->numInst);
1500 thread[tid]->threadStats.numOps++;
1506 template <
class Impl>
1510 DPRINTF(
O3CPU,
"Removing committed instruction [tid:%i] PC %s "
1512 inst->threadNumber, inst->pcState(), inst->seqNum);
1520 template <
class Impl>
1524 DPRINTF(
O3CPU,
"Thread %i: Deleting instructions from instruction"
1529 bool rob_empty =
false;
1533 }
else if (
rob.isEmpty(tid)) {
1534 DPRINTF(
O3CPU,
"ROB is empty, squashing all insts.\n");
1538 end_it = (
rob.readTailInst(tid))->getInstListIt();
1539 DPRINTF(
O3CPU,
"ROB is not empty, squashing insts not in ROB.\n");
1550 while (inst_it != end_it) {
1565 template <
class Impl>
1577 DPRINTF(
O3CPU,
"Deleting instructions from instruction "
1578 "list that are from [tid:%i] and above [sn:%lli] (end=%lli).\n",
1579 tid, seq_num, (*inst_iter)->seqNum);
1581 while ((*inst_iter)->seqNum > seq_num) {
1583 bool break_loop = (inst_iter ==
instList.begin());
1594 template <
class Impl>
1598 if ((*instIt)->threadNumber == tid) {
1600 "[tid:%i] [sn:%lli] PC %s\n",
1601 (*instIt)->threadNumber,
1603 (*instIt)->pcState());
1606 (*instIt)->setSquashed();
1615 template <
class Impl>
1621 "[tid:%i] [sn:%lli] PC %s\n",
1641 template <
class Impl>
1649 cprintf(
"Dumping Instruction List\n");
1651 while (inst_list_it !=
instList.end()) {
1652 cprintf(
"Instruction:%i\nPC:%#x\n[tid:%i]\n[sn:%lli]\nIssued:%i\n"
1654 num, (*inst_list_it)->instAddr(), (*inst_list_it)->threadNumber,
1655 (*inst_list_it)->seqNum, (*inst_list_it)->isIssued(),
1656 (*inst_list_it)->isSquashed());
1669 template <
class Impl>
1674 DPRINTF(Activity,
"CPU already running.\n");
1678 DPRINTF(Activity,
"Waking up CPU\n");
1691 template <
class Impl>
1700 DPRINTF(Quiesce,
"Suspended Processor woken\n");
1704 template <
class Impl>
1718 template <
class Impl>
1727 unsigned high_thread = *list_begin;
1735 template <
class Impl>
1739 DPRINTF(
O3CPU,
"Thread %d is inserted to exitingThreads list\n", tid);
1755 template <
class Impl>
1762 template <
class Impl>
1783 template <
class Impl>
1794 bool readyToExit = it->second;
1807 template <
class Impl>
1818 this->
iew.ldstQueue.resetHtmStartsStops(tid);
1819 this->
commit.resetHtmStartsStops(tid);
1826 req->setContext(this->
thread[tid]->contextId());
1827 req->setHtmAbortCause(cause);
1829 assert(req->isHTMAbort());
1832 uint8_t *memData =
new uint8_t[8];
1838 if (!this->
iew.ldstQueue.getDataPort().sendTimingReq(abort_pkt)) {
1839 panic(
"HTM abort signal was not sent to the memory subsystem.");
virtual void wakeup(ThreadID tid) override
const ThreadID InvalidThreadID
const TheISA::VecRegContainer & readVecReg(PhysRegIdPtr phys_reg) const
Reads a vector register.
const TheISA::VecElem & readArchVecElem(const RegIndex ®_idx, const ElemIndex &ldx, ThreadID tid) const
#define fatal(...)
This implements a cprintf based fatal() function.
void takeOverFrom(BaseCPU *oldCPU) override
Takes over from another CPU.
bool scheduled() const
Determine if the current event is scheduled.
void setArchFloatReg(int reg_idx, RegVal val, ThreadID tid)
FullO3CPU class, has each of the stages (fetch through commit) within it, as well as all of the time ...
const TheISA::VecElem & readVecElem(PhysRegIdPtr reg_idx) const
void setReg(PhysRegIdPtr phys_reg)
Sets the register as ready.
void deactivateThread(ThreadID tid)
Remove Thread from Active Threads List.
Fault getInterrupts()
Returns the Fault for any valid interrupt.
void regProbePoints() override
Register probe points.
TimeBuffer< TimeStruct > timeBuffer
The main time buffer to do backwards communication.
CPUPolicy::ROB rob
The re-order buffer.
CPUPolicy::RenameMap commitRenameMap[Impl::MaxThreads]
The commit rename map.
CPUPolicy::Rename rename
The dispatch stage.
void updateThreadPriority()
Update The Order In Which We Process Threads.
void setVecElem(PhysRegIdPtr reg_idx, const TheISA::VecElem &val)
@ Running
Running normally.
@ HTM_ABORT
The request aborts a HTM transaction.
static const Priority CPU_Tick_Pri
CPU ticks must come after other associated CPU events (such as writebacks).
VecReg::Container VecRegContainer
MicroPC microPC(ThreadID tid)
Reads the commit micro PC of a specific thread.
@ VecElemClass
Vector Register Native Elem lane.
void addThreadToExitingList(ThreadID tid)
Insert tid to the list of threads trying to exit.
bool isTimingMode() const
Is the system in timing mode?
void setMiscRegNoEffect(int misc_reg, RegVal val, ThreadID tid)
Sets a miscellaneous register.
void startup() override
startup() is the final initialization call before simulation.
Counter totalInsts() const override
Count the Total Instructions Committed in the CPU.
static Enums::VecRegRenameMode mode(const TheISA::PCState &)
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
void setVectorsAsReady(ThreadID tid)
Mark vector fields in scoreboard as ready right after switching vector mode, since software may read ...
Checker< Impl > * checker
Pointer to the checker, which can dynamically verify instruction results at run time.
void activateThread(ThreadID tid)
Add Thread to Active Threads List.
void serializeThread(CheckpointOut &cp, ThreadID tid) const override
Serialize a single thread.
int16_t ThreadID
Thread index/ID type.
std::unordered_map< ThreadID, bool > exitingThreads
This is a list of threads that are trying to exit.
void setArchVecPredReg(int reg_idx, const TheISA::VecPredRegContainer &val, ThreadID tid)
void setArchIntReg(int reg_idx, RegVal val, ThreadID tid)
Architectural register accessors.
Addr nextInstAddr(ThreadID tid)
Reads the next PC of a specific thread.
bool isThreadExiting(ThreadID tid) const
Is the thread trying to exit?
void switchRenameMode(ThreadID tid, UnifiedFreeList *freelist)
Check if a change in renaming is needed for vector registers.
EventFunctionWrapper tickEvent
The tick event used for scheduling CPU ticks.
void setArchCCReg(int reg_idx, RegVal val, ThreadID tid)
ProbePointArg generates a point for the class of Arg.
VecPredReg::Container VecPredRegContainer
TheISA::VecRegContainer & getWritableVecReg(PhysRegIdPtr reg_idx)
Read physical vector register for modification.
ThreadContext * tcBase(ThreadID tid)
Returns a pointer to a thread context.
void drainResume() override
Resumes execution after a drain.
Stats::Scalar idleCycles
Stat for total number of cycles the CPU spends descheduled.
void removeThread(ThreadID tid)
Remove all of a thread's context from CPU.
std::shared_ptr< Request > RequestPtr
ListIt addInst(const DynInstPtr &inst)
Function to add instruction onto the head of the list of the instructions.
TimeBuffer< FetchStruct > fetchQueue
The fetch stage's instruction queue.
void deschedule(Event &event)
BaseCPU::BaseCPUStats baseStats
Addr instAddr(ThreadID tid)
Reads the commit PC of a specific thread.
void deschedulePowerGatingEvent()
void setArchVecReg(int reg_idx, const TheISA::VecRegContainer &val, ThreadID tid)
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
void advance()
Advances the activity buffer, decrementing the activityCount if active communication just left the ti...
FullO3CPU::FullO3CPUStats cpuStats
Status _status
Overall CPU status.
void removeFrontInst(const DynInstPtr &inst)
Remove an instruction from the front end of the list.
Helper structure to get the vector register mode for a given ISA.
Stats::Vector committedOps
Stat for the number of committed ops (including micro ops) per thread.
InstSeqNum globalSeqNum
The global sequence number counter.
bool active()
Returns if the CPU should be active.
Stats::Scalar miscRegfileReads
void squashFromTC(ThreadID tid)
Initiates a squash of all in-flight instructions for a given thread.
void switchOut() override
Switches out this CPU.
Register ID: describe an architectural register with its class and index.
void updateCycleCounters(CPUState state)
base method keeping track of cycle progression
void cleanUpRemovedInsts()
Cleans up all instructions on the remove list.
Derived & flags(Flags _flags)
Set the flags and marks this stat to print at the end of simulation.
FullO3CPUStats(FullO3CPU *cpu)
@ Drained
Buffers drained, ready for serialization/handover.
void setCCReg(PhysRegIdPtr phys_reg, RegVal val)
Sets a condition-code register to the given value.
TheISA::VecPredRegContainer & getWritableArchVecPredReg(int reg_idx, ThreadID tid)
void commitDrained(ThreadID tid)
Commit has reached a safe point to drain a thread.
CPUPolicy::Commit commit
The commit stage.
Stats::Vector committedInsts
Stat for the number of committed instructions per thread.
DrainState
Object drain/handover states.
CPUPolicy::Fetch fetch
The fetch stage.
static const Priority CPU_Exit_Pri
If we want to exit a thread in a CPU, it comes after CPU_Tick_Pri.
int64_t Counter
Statistics counter type.
PhysRegFile regFile
The register file.
void suspendContext(ThreadID tid) override
Remove Thread from Active Threads List.
const TheISA::VecElem & readVecElem(PhysRegIdPtr phys_reg) const
Reads a vector element.
void removeInstsNotInROB(ThreadID tid)
Remove all instructions that are not currently in the ROB.
void setCCReg(PhysRegIdPtr phys_reg, RegVal val)
Stats::Scalar fpRegfileReads
void schedule(Event &event, Tick when)
void setIntReg(PhysRegIdPtr phys_reg, RegVal val)
O3CPUImpl ::DynInstPtr DynInstPtr
@ FloatRegClass
Floating-point register.
void setVecPredReg(PhysRegIdPtr phys_reg, const TheISA::VecPredRegContainer &val)
Sets a predicate register to the given value.
std::list< DynInstPtr >::iterator ListIt
ThreadContext is the external interface to all thread state for anything outside of the CPU.
void wakeCPU()
Wakes the CPU, rescheduling the CPU if it's not already active.
Derived & prereq(const Stat &prereq)
Set the prerequisite stat and marks this stat to print at the end of simulation.
void setArchVecElem(const RegIndex ®_idx, const ElemIndex &ldx, const TheISA::VecElem &val, ThreadID tid)
void activateContext(ThreadID tid) override
Add Thread to Active Threads List.
void verifyMemoryMode() const override
Verify that the system is in a memory mode supported by the CPU.
std::list< DynInstPtr > instList
List of all the instructions in flight.
Stats::Scalar fpRegfileWrites
TimeBuffer< DecodeStruct > decodeQueue
The decode stage's instruction queue.
RegVal readIntReg(PhysRegIdPtr phys_reg) const
Reads an integer register.
RegVal readMiscRegNoEffect(int misc_reg, ThreadID tid) const
Register accessors.
void cprintf(const char *format, const Args &...args)
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
@ Halted
Permanently shut down.
Stats::Scalar timesIdled
Stat for total number of times the CPU is descheduled.
std::shared_ptr< FaultBase > Fault
O3ThreadState< Impl > Thread
EventFunctionWrapper threadExitEvent
The exit event used for terminating all ready-to-exit threads.
std::vector< BaseInterrupts * > interrupts
void setFloatReg(PhysRegIdPtr phys_reg, RegVal val)
static PacketPtr createRead(const RequestPtr &req)
Constructor-like methods that return Packets based on Request objects.
ActivityRecorder activityRec
The activity recorder; used to tell if the CPU has any activity remaining or if it can go to idle and...
CPUPolicy::RenameMap renameMap[Impl::MaxThreads]
The rename map.
std::vector< ThreadContext * > threadContexts
Cycles curCycle() const
Determine the current cycle, corresponding to a tick aligned to a clock edge.
constexpr unsigned NumVecElemPerVecReg
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...
Stats::Scalar vecRegfileWrites
@ STRICT_ORDER
The request is required to be strictly ordered by CPU models and is non-speculative.
void setIcachePort(RequestPort *icache_port)
Stats::Scalar miscRegfileWrites
FreeList class that simply holds the list of free integer and floating point registers.
FullO3CPU(const DerivO3CPUParams ¶ms)
Constructs a CPU with the given parameters.
CPUPolicy::FreeList freeList
The free list.
RegVal readCCReg(PhysRegIdPtr phys_reg)
Reads a condition-code register.
virtual void activateContext(ThreadID thread_num)
Notify the CPU that the indicated context is now active.
bool removeInstsThisCycle
Records if instructions need to be removed this cycle due to being retired or squashed.
Stats::Formula totalCpi
Stat for the total CPI.
void setHtmTransactional(uint64_t val)
Stipulates that this packet/request originates in the CPU executing in transactional mode,...
Stats::Scalar vecPredRegfileReads
void signalDrainDone() const
Signal that an object is drained.
ThreadID getFreeTid()
Gets a free thread id.
RegVal readIntReg(PhysRegIdPtr phys_reg)
void instDone(ThreadID tid, const DynInstPtr &inst)
Function to tell the CPU that an instruction has completed.
void removeInstsUntil(const InstSeqNum &seq_num, ThreadID tid)
Remove all instructions younger than the given sequence number.
void setVecReg(PhysRegIdPtr reg_idx, const TheISA::VecRegContainer &val)
Stats::Scalar vecRegfileReads
constexpr decltype(nullptr) NoFault
std::vector< Thread * > thread
Pointers to all of the threads in the CPU.
void reset()
Clears the time buffer and the activity count.
const TheISA::VecRegContainer & readVecReg(PhysRegIdPtr reg_idx) const
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
virtual void setStatus(Status new_status)=0
RegVal readFloatReg(PhysRegIdPtr phys_reg)
const std::string & name()
Derived & init(size_type size)
Set this vector to have the given size.
void insertThread(ThreadID tid)
Setup CPU to insert a thread's context.
Tick lastActivatedCycle
The cycle that the CPU was last activated by a new thread.
void processInterrupts(const Fault &interrupt)
Processes any an interrupt fault.
@ IntRegClass
Integer register.
System * system
Pointer to the system.
Stats::Scalar intRegfileWrites
bool isCpuDrained() const
Check if a system is in a drained state.
Stats::Formula ipc
Stat for the IPC per thread.
void drainSanityCheck() const
Perform sanity checks after a drain.
@ CCRegClass
Condition-code register.
std::vector< ThreadID > tids
Available thread ids in the cpu.
virtual TheISA::PCState pcState() const =0
DrainState drainState() const
Return the current drain state of an object.
uint32_t taskId() const
Get cpu task id.
Enums::VecRegRenameMode vecMode
The rename mode of the vector registers.
std::list< ThreadID > activeThreads
Active Threads List.
void dumpInsts()
Debug function to print all instructions on the list.
#define UNIT_RATE(T1, T2)
bool tryDrain()
Check if the pipeline has drained and signal drain done.
std::queue< ListIt > removeList
List of all the instructions that will be removed at the end of this cycle.
@ VecRegClass
Vector Register.
@ Suspended
Temporarily inactive.
RegVal readCCReg(PhysRegIdPtr phys_reg)
const TheISA::VecRegContainer & readArchVecReg(int reg_idx, ThreadID tid) const
void quiesceCycles(ThreadContext *tc, uint64_t cycles)
RegVal readArchIntReg(int reg_idx, ThreadID tid)
void scheduleTickEvent(Cycles delay)
Schedule tick event, regardless of its current state.
Derived & precision(int _precision)
Set the precision and marks this stat to print at the end of simulation.
GenericISA::DelaySlotPCState< MachInst > PCState
void activity()
Records that there is activity this cycle.
void schedulePowerGatingEvent()
void dataStatic(T *p)
Set the data pointer to the following value that should not be freed.
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...
Stats::Scalar intRegfileReads
TimeBuffer< RenameStruct > renameQueue
The rename stage's instruction queue.
TheISA::VecPredRegContainer & getWritableVecPredReg(PhysRegIdPtr phys_reg)
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
TheISA::VecPredRegContainer & getWritableVecPredReg(PhysRegIdPtr reg_idx)
virtual void switchOut()
Prepare for another CPU to take over execution.
RequestorID _dataRequestorId
data side request id that must be placed in all requests
void squashInstIt(const ListIt &instIt, ThreadID tid)
Removes the instruction pointed to by the iterator.
void haltContext(ThreadID tid) override
Remove Thread from Active Threads List && Remove Thread Context from CPU.
void htmSendAbortSignal(ThreadID tid, uint64_t htm_uid, HtmFailureFaultCause cause)
Stats::Scalar ccRegfileReads
uint16_t ElemIndex
Logical vector register elem index type.
@ PHYSICAL
The virtual address is also the physical address.
Stats::Formula cpi
Stat for the CPI per thread.
ThreadID numThreads
Number of threads we're actually simulating (<= SMT_MAX_THREADS).
CPUPolicy::IEW iew
The issue/execute/writeback stages.
O3ThreadState< Impl > * thread
Pointer to the thread state that this TC corrseponds to.
void tick()
Ticks CPU, calling tick() on each stage, and checking the overall activity to see if the CPU should d...
Cycles is a wrapper class for representing cycle counts, i.e.
Tick nextCycle() const
Based on the clock of the object, determine the start tick of the first cycle that is at least one cy...
#define UNIT_CYCLE
Convenience macros to declare the unit of a stat.
std::vector< TheISA::ISA * > isa
Derived ThreadContext class for use with the Checker.
void init() override
Initialize the CPU.
std::ostream CheckpointOut
void startup() override
startup() is the final initialization call before simulation.
const TheISA::VecPredRegContainer & readArchVecPredReg(int reg_idx, ThreadID tid) const
CPUPolicy::Decode decode
The decode stage.
void regProbePoints() override
Register probe points for this object.
TimeBuffer< IEWStruct > iewQueue
The IEW stage's instruction queue.
virtual void suspendContext(ThreadID thread_num)
Notify the CPU that the indicated context is now suspended.
void pcState(const TheISA::PCState &newPCState, ThreadID tid)
Sets the commit PC state of a specific thread.
Tick curTick()
The universal simulation clock.
BaseO3CPU(const BaseCPUParams ¶ms)
TheISA::VecRegContainer & getWritableArchVecReg(int reg_idx, ThreadID tid)
Read architectural vector register for modification.
const RegIndex & index() const
Index accessors.
void exitThreads()
Terminate all threads that are ready to exit.
void trap(const Fault &fault, ThreadID tid, const StaticInstPtr &inst)
Traps to handle given fault.
void setMiscReg(int misc_reg, RegVal val, ThreadID tid)
Sets a misc.
TheISA::VecRegContainer & getWritableVecReg(PhysRegIdPtr phys_reg)
Reads a vector register for modification.
Counter totalOps() const override
Count the Total Ops (including micro ops) committed in the CPU.
void setFloatReg(PhysRegIdPtr phys_reg, RegVal val)
void unscheduleTickEvent()
Unschedule tick event, regardless of its current state.
bool switchedOut() const
Determine if the CPU is switched out.
const TheISA::VecPredRegContainer & readVecPredReg(PhysRegIdPtr phys_reg) const
Reads a predicate register.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
RegVal readFloatReg(PhysRegIdPtr phys_reg) const
Scoreboard scoreboard
Integer Register Scoreboard.
const FlagsType total
Print the total.
void setIntReg(PhysRegIdPtr phys_reg, RegVal val)
Sets an integer register to the given value.
const TheISA::VecPredRegContainer & readVecPredReg(PhysRegIdPtr reg_idx) const
void setVecPredReg(PhysRegIdPtr reg_idx, const TheISA::VecPredRegContainer &val)
virtual void probeInstCommit(const StaticInstPtr &inst, Addr pc)
Helper method to trigger PMU probes for a committed instruction.
DrainState drain() override
Starts draining the CPU's pipeline of all instructions in order to stop all memory accesses.
RegVal readArchCCReg(int reg_idx, ThreadID tid)
void setVecElem(PhysRegIdPtr phys_reg, const TheISA::VecElem val)
Sets a vector register to the given value.
void unserializeThread(CheckpointIn &cp, ThreadID tid) override
Unserialize one thread.
Stats::Formula totalIpc
Stat for the total IPC.
RegVal readMiscReg(int misc_reg, ThreadID tid)
Reads a misc.
O3CPU * cpu
Pointer to the CPU.
void scheduleThreadExitEvent(ThreadID tid)
If a thread is trying to exit and its corresponding trap event has been completed,...
void setVecReg(PhysRegIdPtr phys_reg, const TheISA::VecRegContainer &val)
Sets a vector register to the given value.
@ Draining
Draining buffers pending serialization/handover.
RegVal readArchFloatReg(int reg_idx, ThreadID tid)
Stats::Scalar vecPredRegfileWrites
#define panic(...)
This implements a cprintf based panic() function.
Stats::Scalar quiesceCycles
Stat for total number of cycles the CPU spends descheduled due to a quiesce operation or waiting for ...
Stats::Scalar ccRegfileWrites
Cycles lastRunningCycle
The cycle that the CPU was last running, used for statistics.
Derived ThreadContext class for use with the O3CPU.
Generated on Tue Mar 23 2021 19:41:18 for gem5 by doxygen 1.8.17