Go to the documentation of this file.
43 #include "debug/Drain.hh"
44 #include "debug/MinorCPU.hh"
45 #include "debug/Quiesce.hh"
52 threadPolicy(params.threadPolicy),
76 fatal(
"The Minor model doesn't support checking (yet)\n");
103 fatal(
"The Minor CPU requires the memory system to be in "
119 threads[thread_id]->serialize(cp);
125 threads[thread_id]->unserialize(cp);
145 DPRINTF(Drain,
"[tid:%d] MinorCPU wakeup\n", tid);
171 DPRINTF(Drain,
"Minor CPU switched out, draining not needed.\n");
175 DPRINTF(Drain,
"MinorCPU drain\n");
180 DPRINTF(Drain,
"MinorCPU drained\n");
183 DPRINTF(Drain,
"MinorCPU not finished draining\n");
191 DPRINTF(Drain,
"MinorCPU drain done\n");
204 DPRINTF(Drain,
"drainResume while switched out. Ignoring\n");
208 DPRINTF(Drain,
"MinorCPU drainResume\n");
211 fatal(
"The Minor CPU requires the memory system to be in "
228 DPRINTF(Drain,
"MinorCPU memWriteback\n");
263 threads[thread_id]->activate();
266 if (!
threads[thread_id]->getUseForClone())
273 {
pipeline->wakeupFetch(thread_id); },
"wakeupFetch");
293 DPRINTF(Quiesce,
"Event wakeup from stage %d\n", stage_id);
318 ret += (*i)->numInst;
statistics::Scalar quiesceCycles
Number of cycles in quiescent state.
#define fatal(...)
This implements a cprintf based fatal() function.
void takeOverFrom(BaseCPU *old_cpu) override
Load the state of a CPU from the previous CPU object, invoked on all new CPUs that are about to be sw...
minor::Pipeline * pipeline
pipeline is a container for the clockable pipeline stage objects.
bool switchedOut() const
Determine if the CPU is switched out.
void memWriteback() override
Write back dirty buffers to memory using functional writes.
@ Halted
Permanently shut down.
void startup() override
startup() is the final initialization call before simulation.
void unserialize(CheckpointIn &cp) override
Reconstruct the state of this object from a checkpoint.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
MinorCPU is an in-order CPU model with four fixed pipeline stages:
void schedule(Event &event, Tick when)
void drainResume() override
Resume execution after a successful drain.
void unserialize(CheckpointIn &cp) override
Reconstruct the state of this object from a checkpoint.
void schedulePowerGatingEvent()
The SimpleThread object provides a combination of the ThreadState object and the ThreadContext interf...
Counter totalInsts() const override
Simple inst count interface from BaseCPU.
void wakeupOnEvent(unsigned int stage_id)
Interface for stages to signal that they have become active after a callback or eventq event where th...
Port & getDataPort() override
Return a reference to the data port.
std::vector< minor::MinorThread * > threads
These are thread state-representing objects for this CPU.
Cycles is a wrapper class for representing cycle counts, i.e.
minor::MinorStats stats
Processor-specific statistics.
ThreadID numThreads
Number of threads we're actually simulating (<= SMT_MAX_THREADS).
void regStats() override
Callback to set stat parameters.
void deschedulePowerGatingEvent()
DrainState
Object drain/handover states.
virtual void suspendContext(ThreadID thread_num)
Notify the CPU that the indicated context is now suspended.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
MinorCPU(const BaseMinorCPUParams ¶ms)
void regStats() override
Stats interface from SimObject (by way of BaseCPU)
const Params & params() const
@ Suspended
Temporarily inactive.
Counter totalOps() const override
void serialize(CheckpointOut &cp) const override
Serialize this object to the given output stream.
void init() override
Starting, waking and initialisation.
enums::MemoryMode getMemoryMode() const
Get the memory mode of the system.
void suspendContext(ThreadID thread_id) override
Notify the CPU that the indicated context is now suspended.
void serialize(CheckpointOut &cp) const override
Serialize pipeline data.
The constructed pipeline.
void wakeup(ThreadID tid) override
@ Drained
Buffers drained, ready for serialization/handover.
bool isTimingMode() const
Is the system in timing mode?
void unserializeThread(CheckpointIn &cp, ThreadID tid) override
Unserialize one thread.
void signalDrainDone()
Signal from Pipeline that MinorCPU should signal that a drain is complete and set its drainState.
DrainState drain() override
Drain interface.
void setStatus(Status newStatus) override
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 activateContext(ThreadID thread_id) override
Thread activation interface from BaseCPU.
void signalDrainDone() const
Signal that an object is drained.
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
ThreadContext * getTC()
Returns the pointer to this SimpleThread's ThreadContext.
void reset()
Clears the time buffer and the activity count.
void activateStage(const int idx)
Marks a stage as active.
std::vector< ThreadContext * > threadContexts
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 serializeThread(CheckpointOut &cp, ThreadID tid) const override
Serialize a single thread.
virtual void activateContext(ThreadID thread_num)
Notify the CPU that the indicated context is now active.
Ports are used to interface objects to each other.
SimpleThread MinorThread
Minor will use the SimpleThread state for now.
double Counter
All counters are of 64-bit values.
void switchOut() override
Switching interface from BaseCPU.
virtual void switchOut()
Prepare for another CPU to take over execution.
std::ostream CheckpointOut
minor::MinorActivityRecorder * activityRecorder
Activity recording for pipeline.
Port & getInstPort() override
Return a reference to the instruction port.
void startup() override
startup() is the final initialization call before simulation.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
EventFunctionWrapper * fetchEventWrapper
@ Draining
Draining buffers pending serialization/handover.
int16_t ThreadID
Thread index/ID type.
Generated on Sun Jul 30 2023 01:56:47 for gem5 by doxygen 1.8.17