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),
61 params.mmu, params.isa[
i], params.decoder[
i]);
65 params.workload[
i], params.mmu,
66 params.isa[
i], params.decoder[
i]);
71 threadContexts.push_back(tc);
76 fatal(
"The Minor model doesn't support checking (yet)\n");
102 if (!params().switched_out &&
system->getMemoryMode() != enums::timing) {
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);
146 assert(tid < numThreads);
160 for (
ThreadID tid = 0; tid < numThreads; tid++)
168 deschedulePowerGatingEvent();
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");
210 if (!
system->isTimingMode()) {
211 fatal(
"The Minor CPU requires the memory system to be in "
215 for (
ThreadID tid = 0; tid < numThreads; tid++){
222 schedulePowerGatingEvent();
228 DPRINTF(Drain,
"MinorCPU memWriteback\n");
236 assert(!switchedOut());
237 BaseCPU::switchOut();
263 threads[thread_id]->activate();
266 if (!
threads[thread_id]->getUseForClone())
273 {
pipeline->wakeupFetch(thread_id); },
"wakeupFetch");
277 BaseCPU::activateContext(thread_id);
287 BaseCPU::suspendContext(thread_id);
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
void unserialize(ThreadContext &tc, CheckpointIn &cp)
minor::Pipeline * pipeline
pipeline is a container for the clockable pipeline stage objects.
void memWriteback() override
@ Halted
Permanently shut down.
MinorCPU is an in-order CPU model with four fixed pipeline stages:
void drainResume() override
void unserialize(CheckpointIn &cp) override
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.
void takeOverFrom(ThreadContext &ntc, ThreadContext &otc)
Copy state between thread contexts in preparation for CPU handover.
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.
DrainState
Object drain/handover states.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
MinorCPU(const MinorCPUParams ¶ms)
void regStats() override
Stats interface from SimObject (by way of BaseCPU)
@ Suspended
Temporarily inactive.
Counter totalOps() const override
void init() override
Starting, waking and initialisation.
void suspendContext(ThreadID thread_id) override
void serialize(CheckpointOut &cp) const override
Serialize pipeline data.
The constructed pipeline.
void wakeup(ThreadID tid) override
@ Drained
Buffers drained, ready for serialization/handover.
void serialize(const ThreadContext &tc, CheckpointOut &cp)
Thread context serialization helpers.
void unserializeThread(CheckpointIn &cp, ThreadID tid) override
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
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.
void serializeThread(CheckpointOut &cp, ThreadID tid) const override
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.
std::ostream CheckpointOut
const FlagsType init
This Stat is Initialized.
minor::MinorActivityRecorder * activityRecorder
Activity recording for pipeline.
Port & getInstPort() override
Return a reference to the instruction port.
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 Tue Feb 8 2022 11:46:55 for gem5 by doxygen 1.8.17