Go to the documentation of this file.
53 #include "debug/Activity.hh"
54 #include "debug/Drain.hh"
55 #include "debug/O3CPU.hh"
56 #include "debug/Quiesce.hh"
57 #include "enums/MemoryMode.hh"
75 tickEvent([this]{
tick(); },
"O3CPU tick",
77 threadExitEvent([
this]{ exitThreads(); },
"O3CPU exit threads",
82 removeInstsThisCycle(
false),
89 regFile(params.numPhysIntRegs,
90 params.numPhysFloatRegs,
91 params.numPhysVecRegs,
92 params.numPhysVecPredRegs,
93 params.numPhysMatRegs,
95 params.isa[0]->regClasses()),
97 freeList(
name() +
".freelist", ®File),
101 scoreboard(
name() +
".scoreboard", regFile.totalNumPhysRegs()),
103 isa(numThreads, NULL),
105 timeBuffer(params.backComSize, params.forwardComSize),
106 fetchQueue(params.backComSize, params.forwardComSize),
107 decodeQueue(params.backComSize, params.forwardComSize),
108 renameQueue(params.backComSize, params.forwardComSize),
109 iewQueue(params.backComSize, params.forwardComSize),
110 activityRec(
name(), NumStages,
111 params.backComSize + params.forwardComSize,
116 lastRunningCycle(curCycle()),
120 "SMT is not supported in O3 in full system mode currently.");
123 "More workload items (%d) than threads (%d) on CPU %s.",
124 params.workload.size(), params.numThreads,
name());
126 if (!params.switched_out) {
129 _status = SwitchedOut;
132 if (params.checker) {
133 BaseCPU *temp_checker = params.checker;
134 checker =
dynamic_cast<Checker<DynInstPtr> *
>(temp_checker);
135 checker->setIcachePort(&fetch.getInstPort());
136 checker->setSystem(params.system);
142 thread.resize(numThreads);
143 tids.resize(numThreads);
151 fetch.setActiveThreads(&activeThreads);
152 decode.setActiveThreads(&activeThreads);
153 rename.setActiveThreads(&activeThreads);
154 iew.setActiveThreads(&activeThreads);
155 commit.setActiveThreads(&activeThreads);
158 fetch.setTimeBuffer(&timeBuffer);
159 decode.setTimeBuffer(&timeBuffer);
160 rename.setTimeBuffer(&timeBuffer);
161 iew.setTimeBuffer(&timeBuffer);
162 commit.setTimeBuffer(&timeBuffer);
165 fetch.setFetchQueue(&fetchQueue);
166 decode.setFetchQueue(&fetchQueue);
167 commit.setFetchQueue(&fetchQueue);
168 decode.setDecodeQueue(&decodeQueue);
169 rename.setDecodeQueue(&decodeQueue);
170 rename.setRenameQueue(&renameQueue);
171 iew.setRenameQueue(&renameQueue);
172 iew.setIEWQueue(&iewQueue);
173 commit.setIEWQueue(&iewQueue);
174 commit.setRenameQueue(&renameQueue);
176 commit.setIEWStage(&iew);
177 rename.setIEWStage(&iew);
178 rename.setCommitStage(&commit);
184 active_threads = params.workload.size();
187 panic(
"Workload Size too large. Increase the 'MaxThreads' "
188 "constant in cpu/o3/limits.hh or edit your workload size.");
194 const auto ®Classes = params.isa[0]->regClasses();
196 assert(params.numPhysIntRegs >=
197 numThreads * regClasses.at(
IntRegClass)->numRegs());
198 assert(params.numPhysFloatRegs >=
200 assert(params.numPhysVecRegs >=
201 numThreads * regClasses.at(
VecRegClass)->numRegs());
202 assert(params.numPhysVecPredRegs >=
204 assert(params.numPhysMatRegs >=
205 numThreads * regClasses.at(
MatRegClass)->numRegs());
206 assert(params.numPhysCCRegs >=
207 numThreads * regClasses.at(
CCRegClass)->numRegs());
212 params.numPhysCCRegs != 0,
213 "Non-zero number of physical CC regs specified, even though\n"
214 " ISA does not use them.");
216 rename.setScoreboard(&scoreboard);
217 iew.setScoreboard(&scoreboard);
220 for (
ThreadID tid = 0; tid < numThreads; tid++) {
221 isa[tid] = params.isa[tid];
222 commitRenameMap[tid].init(regClasses, ®File, &freeList);
223 renameMap[tid].init(regClasses, ®File, &freeList);
228 for (
ThreadID tid = 0; tid < active_threads; tid++) {
231 for (
auto &
id: *regClasses.at(
type)) {
235 renameMap[tid].setEntry(
id, phys_reg);
236 commitRenameMap[tid].setEntry(
id, phys_reg);
241 rename.setRenameMap(renameMap);
242 commit.setRenameMap(commitRenameMap);
243 rename.setFreeList(&freeList);
248 lastActivatedCycle = 0;
250 DPRINTF(O3CPU,
"Creating O3CPU object.\n");
253 thread.resize(numThreads);
255 for (
ThreadID tid = 0; tid < numThreads; ++tid) {
258 assert(numThreads == 1);
259 thread[tid] =
new ThreadState(
this, 0, NULL);
261 if (tid < params.workload.size()) {
262 DPRINTF(O3CPU,
"Workload[%i] process is %#x", tid,
264 thread[tid] =
new ThreadState(
this, tid, params.workload[tid]);
268 Process* dummy_proc = NULL;
270 thread[tid] =
new ThreadState(
this, tid, dummy_proc);
277 auto *o3_tc =
new ThreadContext;
283 if (params.checker) {
284 tc =
new CheckerThreadContext<ThreadContext>(o3_tc, checker);
288 o3_tc->thread = thread[tid];
291 thread[tid]->tc = tc;
294 threadContexts.push_back(tc);
298 if (!params.switched_out && interrupts.empty()) {
299 fatal(
"O3CPU %s has no interrupt controller.\n"
300 "Ensure createInterruptController() is called.\n",
name());
322 : statistics::
Group(cpu),
324 "Number of times that the entire CPU went into an idle state "
325 "and unscheduled itself"),
326 ADD_STAT(idleCycles, statistics::units::Cycle::get(),
327 "Total number of cycles that the CPU has spent unscheduled due "
330 "Total number of cycles that CPU has spent quiesced or waiting "
347 DPRINTF(O3CPU,
"\n\nO3CPU: Ticking main, O3CPU.\n");
383 DPRINTF(O3CPU,
"Switched out!\n");
392 DPRINTF(O3CPU,
"Scheduling next tick!\n");
410 thread[tid]->noSquashFromTC =
true;
415 thread[tid]->noSquashFromTC =
false;
438 DPRINTF(O3CPU,
"[tid:%i] Calling activate thread.\n", tid);
442 DPRINTF(O3CPU,
"[tid:%i] Adding to active threads list\n", tid);
459 DPRINTF(O3CPU,
"[tid:%i] Calling deactivate thread.\n", tid);
463 DPRINTF(O3CPU,
"[tid:%i] Removing from active threads list\n",
537 DPRINTF(O3CPU,
"[tid:%i] Suspending Thread Context.\n", tid);
549 DPRINTF(Quiesce,
"Suspending Context\n");
558 DPRINTF(O3CPU,
"[tid:%i] Halt Context called. Deallocating\n", tid);
579 DPRINTF(O3CPU,
"[tid:%i] Initializing thread into CPU");
589 const auto ®Classes =
isa[tid]->regClasses();
593 for (
auto &
id: *regClasses.at(
type)) {
617 DPRINTF(O3CPU,
"[tid:%i] Removing thread context from CPU.\n", tid);
685 DPRINTF(O3CPU,
"Interrupt %s being handled\n", interrupt->name());
686 trap(interrupt, 0,
nullptr);
699 thread[tid]->serialize(cp);
705 thread[tid]->unserialize(cp);
718 DPRINTF(Drain,
"Draining...\n");
734 DPRINTF(Drain,
"Currently suspended so activate %i \n",
745 DPRINTF(Drain,
"CPU not drained\n");
749 DPRINTF(Drain,
"CPU is already drained\n");
779 DPRINTF(Drain,
"CPU done draining, processing drain event\n");
802 DPRINTF(Drain,
"Main CPU structures not drained.\n");
807 DPRINTF(Drain,
"Fetch not drained.\n");
812 DPRINTF(Drain,
"Decode not drained.\n");
817 DPRINTF(Drain,
"Rename not drained.\n");
822 DPRINTF(Drain,
"IEW not drained.\n");
827 DPRINTF(Drain,
"Commit not drained.\n");
842 DPRINTF(Drain,
"Resuming...\n");
851 DPRINTF(Drain,
"Activating thread: %i\n",
i);
868 DPRINTF(O3CPU,
"Switching out\n");
892 auto *oldO3CPU =
dynamic_cast<CPU *
>(oldCPU);
904 fatal(
"The O3 CPU requires the memory system to be in "
912 return isa[tid]->readMiscRegNoEffect(misc_reg);
919 return isa[tid]->readMiscReg(misc_reg);
925 isa[tid]->setMiscRegNoEffect(misc_reg,
val);
932 isa[tid]->setMiscReg(misc_reg,
val);
1110 thread[tid]->noSquashFromTC =
true;
1126 if (!inst->isMicroop() || inst->isLastMicroop()) {
1128 thread[tid]->threadStats.numInsts++;
1132 thread[tid]->comInstEventQueue.serviceEvents(
thread[tid]->numInst);
1135 thread[tid]->threadStats.numOps++;
1144 DPRINTF(O3CPU,
"Removing committed instruction [tid:%i] PC %s "
1146 inst->threadNumber, inst->pcState(), inst->seqNum);
1157 DPRINTF(O3CPU,
"Thread %i: Deleting instructions from instruction"
1162 bool rob_empty =
false;
1167 DPRINTF(O3CPU,
"ROB is empty, squashing all insts.\n");
1172 DPRINTF(O3CPU,
"ROB is not empty, squashing insts not in ROB.\n");
1183 while (inst_it != end_it) {
1209 DPRINTF(O3CPU,
"Deleting instructions from instruction "
1210 "list that are from [tid:%i] and above [sn:%lli] (end=%lli).\n",
1211 tid, seq_num, (*inst_iter)->seqNum);
1213 while ((*inst_iter)->seqNum > seq_num) {
1215 bool break_loop = (inst_iter ==
instList.begin());
1229 if ((*instIt)->threadNumber == tid) {
1230 DPRINTF(O3CPU,
"Squashing instruction, "
1231 "[tid:%i] [sn:%lli] PC %s\n",
1232 (*instIt)->threadNumber,
1234 (*instIt)->pcState());
1237 (*instIt)->setSquashed();
1250 DPRINTF(O3CPU,
"Removing instruction, "
1251 "[tid:%i] [sn:%lli] PC %s\n",
1277 cprintf(
"Dumping Instruction List\n");
1279 while (inst_list_it !=
instList.end()) {
1280 cprintf(
"Instruction:%i\nPC:%#x\n[tid:%i]\n[sn:%lli]\nIssued:%i\n"
1282 num, (*inst_list_it)->pcState().instAddr(),
1283 (*inst_list_it)->threadNumber,
1284 (*inst_list_it)->seqNum, (*inst_list_it)->isIssued(),
1285 (*inst_list_it)->isSquashed());
1301 DPRINTF(Activity,
"CPU already running.\n");
1305 DPRINTF(Activity,
"Waking up CPU\n");
1326 DPRINTF(Quiesce,
"Suspended Processor woken\n");
1351 unsigned high_thread = *list_begin;
1362 DPRINTF(O3CPU,
"Thread %d is inserted to exitingThreads list\n", tid);
1414 bool readyToExit = it->second;
1417 DPRINTF(O3CPU,
"Exiting thread %d\n", thread_id);
1445 req->setContext(
thread[tid]->contextId());
1446 req->setHtmAbortCause(cause);
1448 assert(req->isHTMAbort());
1451 uint8_t *memData =
new uint8_t[8];
1458 panic(
"HTM abort signal was not sent to the memory subsystem.");
bool isDrained() const
Has the stage drained?
Tick curTick()
The universal simulation clock.
#define fatal(...)
This implements a cprintf based fatal() function.
void addThreadToExitingList(ThreadID tid)
Insert tid to the list of threads trying to exit.
void takeOverFrom()
Takes over from another CPU's thread.
void dumpInsts()
Debug function to print all instructions on the list.
void * getWritableArchReg(const RegId ®, ThreadID tid)
ProbePointArg< std::pair< DynInstPtr, PacketPtr > > * ppDataAccessComplete
bool isCpuDrained() const
Check if a system is in a drained state.
std::vector< ThreadID > tids
Available thread ids in the cpu.
@ HTM_ABORT
The request aborts a HTM transaction.
constexpr decltype(nullptr) NoFault
bool switchedOut() const
Determine if the CPU is switched out.
bool sendTimingReq(PacketPtr pkt)
Attempt to send a timing request to the responder port by calling its corresponding receive function.
std::queue< ListIt > removeList
List of all the instructions that will be removed at the end of this cycle.
void tick()
Ticks rename, which processes all input signals and attempts to rename as many instructions as possib...
std::vector< BaseInterrupts * > interrupts
void regProbePoints()
Registers probes.
void drainSanityCheck() const
Perform sanity checks after a drain.
bool removeInstsThisCycle
Records if instructions need to be removed this cycle due to being retired or squashed.
std::list< DynInstPtr >::iterator ListIt
gem5::o3::CPU::CPUStats cpuStats
void cprintf(const char *format, const Args &...args)
InstSeqNum globalSeqNum
The global sequence number counter.
void removeInstsUntil(const InstSeqNum &seq_num, ThreadID tid)
Remove all instructions younger than the given sequence number.
DynInstPtr readTailInst(ThreadID tid)
Returns pointer to the tail instruction within the ROB.
RegVal getReg(PhysRegIdPtr phys_reg, ThreadID tid)
void drain()
Initializes the draining of commit.
Cycles curCycle() const
Determine the current cycle, corresponding to a tick aligned to a clock edge.
@ Halted
Permanently shut down.
void startup() override
startup() is the final initialization call before simulation.
PhysRegFile regFile
The register file.
DrainState drainState() const
Return the current drain state of an object.
@ VecElemClass
Vector Register Native Elem lane.
int getCount()
Returns the number of instructions in all of the queues.
Decode decode
The decode stage.
std::list< ThreadID > activeThreads
Active Threads List.
void setThreads(std::vector< ThreadState * > &threads)
Sets the list of threads.
UnifiedFreeList freeList
The free list.
void processInterrupts(const Fault &interrupt)
Processes any an interrupt fault.
@ CCRegClass
Condition-code register.
const PCStateBase & pcState(ThreadID tid)
Reads the PC of a specific thread.
void clearStates(ThreadID tid)
Clear all thread-specific states.
void * getWritableReg(PhysRegIdPtr phys_reg)
void drainStall(ThreadID tid)
Stall the fetch stage after reaching a safe drain point.
virtual const PCStateBase & pcState() const =0
statistics::Scalar quiesceCycles
Stat for total number of cycles the CPU spends descheduled due to a quiesce operation or waiting for ...
Fault getInterrupts()
Returns the Fault for any valid interrupt.
void squashInstIt(const ListIt &instIt, ThreadID tid)
Removes the instruction pointed to by the iterator.
void htmSendAbortSignal(ThreadID tid, uint64_t htm_uid, HtmFailureFaultCause cause) override
This function is used to instruct the memory subsystem that a transaction should be aborted and the s...
void updateCycleCounters(CPUState state)
base method keeping track of cycle progression
void wakeFromQuiesce()
Tells fetch to wake up from a quiesce instruction.
void takeOverFrom()
Takes over from another CPU's thread.
void startupStage()
Initializes stage by sending back the number of free entries.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
void clearStates(ThreadID tid)
Clear all thread-specific states.
Status _status
Overall CPU status.
void setHtmTransactional(uint64_t val)
Stipulates that this packet/request originates in the CPU executing in transactional mode,...
TimeBuffer< TimeStruct > timeBuffer
The main time buffer to do backwards communication.
virtual void setStatus(Status new_status)=0
void advance()
Advances the activity buffer, decrementing the activityCount if active communication just left the ti...
void setReg(PhysRegIdPtr phys_reg, RegVal val)
void removeThread(ThreadID tid)
Remove all of a thread's context from CPU.
void schedule(Event &event, Tick when)
void setMiscReg(int misc_reg, RegVal val, ThreadID tid)
Sets a misc.
UnifiedRenameMap renameMap[MaxThreads]
The rename map.
std::vector< std::unique_ptr< CommitCPUStats > > commitStats
void clearStates(ThreadID tid)
Clear all thread-specific states.
std::list< DynInstPtr > instList
List of all the instructions in flight.
bool isDrained() const
Has the stage drained?
void verifyMemoryMode() const override
Verify that the system is in a memory mode supported by the CPU.
void deactivateThread(ThreadID tid)
Remove Thread from Active Threads List.
void unserializeThread(CheckpointIn &cp, ThreadID tid) override
Unserialize one thread.
static const Priority CPU_Exit_Pri
If we want to exit a thread in a CPU, it comes after CPU_Tick_Pri.
void schedulePowerGatingEvent()
@ STRICT_ORDER
The request is required to be strictly ordered by CPU models and is non-speculative.
void drainSanityCheck() const
Perform sanity checks after a drain.
void serializeThread(CheckpointOut &cp, ThreadID tid) const override
Serialize a single thread.
void cleanUpRemovedInsts()
Cleans up all instructions on the remove list.
void deactivateThread(ThreadID tid)
Deschedules a thread from scheduling.
void resetEntries()
Re-adjust ROB partitioning.
TimeBuffer< IEWStruct > iewQueue
The IEW stage's instruction queue.
ProbePointArg< PacketPtr > * ppInstAccessComplete
void startupStage()
Initializes stage; sends back the number of free IQ and LSQ entries.
void resetHtmStartsStops(ThreadID tid)
gem5::Checker< DynInstPtr > * checker
Pointer to the checker, which can dynamically verify instruction results at run time.
void unscheduleTickEvent()
Unschedule tick event, regardless of its current state.
Cycles is a wrapper class for representing cycle counts, i.e.
Counter totalInsts() const override
Count the Total Instructions Committed in the CPU.
void drainSanityCheck() const
Perform sanity checks after a drain.
ThreadID numThreads
Number of threads we're actually simulating (<= SMT_MAX_THREADS).
statistics::Scalar idleCycles
Stat for total number of cycles the CPU spends descheduled.
InstructionQueue instQueue
Instruction queue.
TimeBuffer< DecodeStruct > decodeQueue
The decode stage's instruction queue.
void dataStatic(T *p)
Set the data pointer to the following value that should not be freed.
void drainResume()
Resume after a drain.
@ FloatRegClass
Floating-point register.
void deschedulePowerGatingEvent()
void clearStates(ThreadID tid)
Clear all thread-specific states.
DrainState
Object drain/handover states.
void generateTCEvent(ThreadID tid)
Records that commit needs to initiate a squash due to an external state update through the TC.
virtual void suspendContext(ThreadID thread_num)
Notify the CPU that the indicated context is now suspended.
gem5::BaseCPU::BaseCPUStats baseStats
void takeOverFrom()
Takes over from another CPU's thread.
void tick()
Ticks decode, processing all input signals and decoding as many instructions as possible.
uint32_t taskId() const
Get cpu task id.
RequestorID _dataRequestorId
data side request id that must be placed in all requests
bool tryDrain()
Check if the pipeline has drained and signal drain done.
virtual void wakeup(ThreadID tid) override
PhysRegIdPtr getReg(RegClassType type)
Gets a free register of type type.
O3CPU class, has each of the stages (fetch through commit) within it, as well as all of the time buff...
void insertThread(ThreadID tid)
Setup CPU to insert a thread's context.
bool isDrained() const
Has the stage drained?
ThreadContext is the external interface to all thread state for anything outside of the CPU.
std::shared_ptr< FaultBase > Fault
void scheduleTickEvent(Cycles delay)
Schedule tick event, regardless of its current state.
@ MatRegClass
Matrix Register.
Counter totalOps() const override
Count the Total Ops (including micro ops) committed in the CPU.
void suspendContext(ThreadID tid) override
Remove Thread from Active Threads List.
bool isDrained() const
Has the stage drained?
@ Suspended
Temporarily inactive.
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
void setReg(PhysRegIdPtr phys_reg)
Sets the register as ready.
Fetch fetch
The fetch stage.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
statistics::Scalar numCycles
void scheduleThreadExitEvent(ThreadID tid)
If a thread is trying to exit and its corresponding trap event has been completed,...
void pcState(const PCStateBase &new_pc_state, ThreadID tid)
Sets the commit PC state of a specific thread.
RegVal getReg(PhysRegIdPtr phys_reg) const
bool isDrained() const
Has the stage drained?
std::shared_ptr< Request > RequestPtr
void squashFromTC(ThreadID tid)
Initiates a squash of all in-flight instructions for a given thread.
RegVal readMiscRegNoEffect(int misc_reg, ThreadID tid) const
Register accessors.
void resetHtmStartsStops(ThreadID)
gem5::ThreadContext * tcBase(ThreadID tid)
Returns a pointer to a thread context.
void activateThread(ThreadID tid)
Add Thread to Active Threads List.
void regProbePoints() override
Register probe points for this object.
std::vector< ThreadState * > thread
Pointers to all of the threads in the CPU.
void deactivateThread(ThreadID tid)
For priority-based fetch policies, need to keep update priorityList.
void clearStates(ThreadID tid)
Clear all thread-specific states.
statistics::Scalar timesIdled
Stat for total number of times the CPU is descheduled.
const ThreadID InvalidThreadID
DrainState drain() override
Starts draining the CPU's pipeline of all instructions in order to stop all memory accesses.
void wakeCPU()
Wakes the CPU, rescheduling the CPU if it's not already active.
EventFunctionWrapper tickEvent
The tick event used for scheduling CPU ticks.
void switchOut() override
Switches out this CPU.
CPU(const BaseO3CPUParams ¶ms)
Constructs a CPU with the given parameters.
@ Drained
Buffers drained, ready for serialization/handover.
bool isTimingMode() const
Is the system in timing mode?
void setMiscRegNoEffect(int misc_reg, RegVal val, ThreadID tid)
Sets a miscellaneous register.
TimeBuffer< RenameStruct > renameQueue
The rename stage's instruction queue.
ROB rob
The re-order buffer.
void tick()
Ticks IEW stage, causing Dispatch, the IQ, the LSQ, Execute, and Writeback to run for one cycle.
void tick()
Ticks the fetch stage, processing all inputs signals and fetching as many instructions as possible.
virtual void probeInstCommit(const StaticInstPtr &inst, Addr pc)
Helper method to trigger PMU probes for a committed instruction.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
const std::string & name()
std::vector< std::unique_ptr< ExecuteCPUStats > > executeStats
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...
void deschedule(Event &event)
void activity()
Records that there is activity this cycle.
void startupStage()
Initialize stage.
ProbePointArg generates a point for the class of Arg.
void regProbePoints() override
Register probe points.
System * system
Pointer to the system.
void signalDrainDone() const
Signal that an object is drained.
Tick nextCycle() const
Based on the clock of the object, determine the start tick of the first cycle that is at least one cy...
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
void reset()
Clears the time buffer and the activity count.
@ IntRegClass
Integer register.
ProbeManager * getProbeManager()
Get the probe manager for this object.
Cycles lastRunningCycle
The cycle that the CPU was last running, used for statistics.
void updateThreadPriority()
Update The Order In Which We Process Threads.
static constexpr int MaxThreads
void * getWritableReg(PhysRegIdPtr phys_reg, ThreadID tid)
#define warn_if(cond,...)
Conditional warning macro that checks the supplied condition and only prints a warning if the conditi...
Rename rename
The dispatch stage.
TimeBuffer< FetchStruct > fetchQueue
The fetch stage's instruction queue.
void takeOverFrom(BaseCPU *oldCPU) override
Takes over from another CPU.
std::vector< ThreadContext * > threadContexts
IEW iew
The issue/execute/writeback stages.
void removeInstsNotInROB(ThreadID tid)
Remove all instructions that are not currently in the ROB.
void drainSanityCheck() const
Perform sanity checks after a drain.
void exitThreads()
Terminate all threads that are ready to exit.
Tick lastActivatedCycle
The cycle that the CPU was last activated by a new thread.
void drainResume()
Resumes execution after draining.
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...
RegClassType
Enumerate the classes of registers.
virtual void activateContext(ThreadID thread_num)
Notify the CPU that the indicated context is now active.
bool executingHtmTransaction(ThreadID) const
Is the CPU currently processing a HTM transaction?
Derived & prereq(const Stat &prereq)
Set the prerequisite stat and marks this stat to print at the end of simulation.
void commitDrained(ThreadID tid)
Commit has reached a safe point to drain a thread.
void quiesceCycles(ThreadContext *tc, uint64_t cycles)
void takeOverFrom()
Takes over from another CPU's thread.
UnifiedRenameMap commitRenameMap[MaxThreads]
The commit rename map.
void trap(const Fault &fault, ThreadID tid, const StaticInstPtr &inst)
Traps to handle given fault.
void drainResume() override
Resumes execution after a drain.
ThreadID getFreeTid()
Gets a free thread id.
ListIt addInst(const DynInstPtr &inst)
Function to add instruction onto the head of the list of the instructions.
void setArchReg(const RegId ®, RegVal val, ThreadID tid)
bool isEmpty() const
Returns if the ROB is empty.
bool isThreadExiting(ThreadID tid) const
Is the thread trying to exit?
void drainSanityCheck() const
Perform sanity checks after a drain.
EventFunctionWrapper threadExitEvent
The exit event used for terminating all ready-to-exit threads.
PhysRegIdPtr lookup(const RegId &arch_reg) const
Look up the physical register mapped to an architectural register.
double Counter
All counters are of 64-bit values.
virtual void switchOut()
Prepare for another CPU to take over execution.
RegVal readMiscReg(int misc_reg, ThreadID tid)
Reads a misc.
void startupStage()
Initializes variables for the stage.
std::ostream CheckpointOut
std::unordered_map< ThreadID, bool > exitingThreads
This is a list of threads that are trying to exit.
void regProbePoints()
Registers probes.
RequestPort & getDataPort()
bool active()
Returns if the CPU should be active.
void tick()
Ticks the commit stage, which tries to commit instructions.
@ PHYSICAL
The virtual address is also the physical address.
void regProbePoints()
Registers probes.
Scoreboard scoreboard
Integer Register Scoreboard.
@ Running
Running normally.
@ VecRegClass
Vector Register.
LSQ ldstQueue
Load / store queue.
Commit commit
The commit stage.
void haltContext(ThreadID tid) override
Remove Thread from Active Threads List && Remove Thread Context from CPU.
static const Priority CPU_Tick_Pri
CPU ticks must come after other associated CPU events (such as writebacks).
ActivityRecorder activityRec
The activity recorder; used to tell if the CPU has any activity remaining or if it can go to idle and...
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
static PacketPtr createRead(const RequestPtr &req)
Constructor-like methods that return Packets based on Request objects.
const FlagsType total
Print the total.
std::vector< BaseISA * > isa
void activateContext(ThreadID tid) override
Add Thread to Active Threads List.
void takeOverFrom()
Takes over from another CPU's thread.
void tick()
Ticks CPU, calling tick() on each stage, and checking the overall activity to see if the CPU should d...
RegVal getArchReg(const RegId ®, ThreadID tid)
Architectural register accessors.
constexpr RegClassType classValue() const
void startup() override
startup() is the final initialization call before simulation.
void setReg(PhysRegIdPtr phys_reg, RegVal val, ThreadID tid)
void drainSanityCheck() const
Perform sanity checks after a drain.
@ Draining
Draining buffers pending serialization/handover.
void instDone(ThreadID tid, const DynInstPtr &inst)
Function to tell the CPU that an instruction has completed.
bool scheduled() const
Determine if the current event is scheduled.
int16_t ThreadID
Thread index/ID type.
void init() override
Initialize the CPU.
Register ID: describe an architectural register with its class and index.
#define panic(...)
This implements a cprintf based panic() function.
void setEntry(const RegId &arch_reg, PhysRegIdPtr phys_reg)
Update rename map with a specific mapping.
void removeFrontInst(const DynInstPtr &inst)
Remove an instruction from the front end of the list.
void regProbePoints()
Registers probes.
unsigned getCount(ThreadID tid)
Returns the number of used entries for a thread.
Generated on Sun Jul 30 2023 01:56:47 for gem5 by doxygen 1.8.17