Go to the documentation of this file.
50 #include "debug/Context.hh"
51 #include "debug/Quiesce.hh"
53 #include "params/BaseCPU.hh"
62 const auto ®Classes =
one->getIsaPtr()->regClasses();
71 panic(
"Int reg idx %d doesn't match, one: %#x, two: %#x",
80 panic(
"Float reg idx %d doesn't match, one: %#x, two: %#x",
89 one->getReg(
id, vec1.data());
90 two->
getReg(
id, vec2.data());
92 panic(
"Vec reg idx %d doesn't match, one: %#x, two: %#x",
93 id.
index(), vec_class->valString(vec1.data()),
94 vec_class->valString(vec2.data()));
103 one->getReg(
id, pred1.data());
104 two->
getReg(
id, pred2.data());
105 if (pred1 != pred2) {
106 panic(
"Pred reg idx %d doesn't match, one: %s, two: %s",
107 id.
index(), vec_pred_class->valString(pred1.data()),
108 vec_pred_class->valString(pred2.data()));
113 const auto *mat_class = regClasses.at(
MatRegClass);
117 one->getReg(
id, mat1.data());
118 two->
getReg(
id, mat2.data());
120 panic(
"Mat reg idx %d doesn't match, one: %#x, two: %#x",
121 id.
index(), mat_class->valString(mat1.data()),
122 mat_class->valString(mat2.data()));
130 panic(
"Misc reg idx %d doesn't match, one: %#x, two: %#x",
139 panic(
"CC reg idx %d doesn't match, one: %#x, two: %#x",
143 panic(
"PC state doesn't match.");
144 int id1 =
one->cpuId();
145 int id2 = two->
cpuId();
147 panic(
"CPU ids don't match, one: %d, two: %d", id1, id2);
152 panic(
"Context ids don't match, one: %d, two: %d", id1, id2);
163 port->sendFunctional(pkt);
201 const size_t reg_bytes = reg_class->regBytes();
202 const size_t reg_count = reg_class->numRegs();
203 const size_t array_bytes = reg_bytes * reg_count;
205 uint8_t regs[array_bytes];
206 auto *reg_ptr = regs;
207 for (
const auto &
id: *reg_class) {
209 reg_ptr += reg_bytes;
212 arrayParamOut(cp, std::string(
"regs.") + reg_class->name(), regs,
229 const size_t reg_bytes = reg_class->regBytes();
230 const size_t reg_count = reg_class->numRegs();
231 const size_t array_bytes = reg_bytes * reg_count;
233 uint8_t regs[array_bytes];
234 arrayParamIn(cp, std::string(
"regs.") + reg_class->name(), regs,
237 auto *reg_ptr = regs;
238 for (
const auto &
id: *reg_class) {
240 reg_ptr += reg_bytes;
244 std::unique_ptr<PCStateBase> pc_state(tc.
pcState().
clone());
245 pc_state->unserialize(cp);
void unserialize(ThreadContext &tc, CheckpointIn &cp)
static void compare(ThreadContext *one, ThreadContext *two)
function to compare two thread contexts (for debugging)
virtual System * getSystemPtr()=0
@ Halted
Permanently shut down.
virtual RegVal getReg(const RegId ®) const
@ CCRegClass
Condition-code register.
void quiesce(ContextID id)
virtual const PCStateBase & pcState() const =0
virtual void setStatus(Status new_status)=0
virtual ContextID contextId() const =0
virtual int cpuId() const =0
void takeOverFrom(ThreadContext &ntc, ThreadContext &otc)
Copy state between thread contexts in preparation for CPU handover.
virtual Status status() const =0
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
void quiesceTick(ContextID id, Tick when)
virtual void setThreadId(int id)=0
virtual Port & getDataPort()=0
Purely virtual method that returns a reference to the data port.
@ FloatRegClass
Floating-point register.
virtual void copyArchRegs(ThreadContext *tc)=0
void quiesceTick(Tick resume)
Quiesce, suspend, and schedule activate at resume.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
void quiesce()
Quiesce thread context.
@ MatRegClass
Matrix Register.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
uint64_t Tick
Tick count type.
const RegClasses & regClasses() const
void serialize(const ThreadContext &tc, CheckpointOut &cp)
Thread context serialization helpers.
virtual void sendFunctional(PacketPtr pkt)
virtual RegVal readMiscRegNoEffect(RegIndex misc_reg) const =0
virtual void setContextId(ContextID id)=0
decltype(std::begin(std::declval< const T & >()), std::end(std::declval< const T & >()), void()) arrayParamOut(CheckpointOut &os, const std::string &name, const T ¶m)
void serialize(CheckpointOut &cp) const override
Serialize an object.
virtual Process * getProcessPtr()=0
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
@ IntRegClass
Integer register.
@ MiscRegClass
Control (misc) register.
int ContextID
Globally unique thread context ID.
std::ostream CheckpointOut
virtual BaseCPU * getCpuPtr()=0
virtual int threadId() const =0
@ VecRegClass
Vector Register.
virtual BaseISA * getIsaPtr() const =0
void arrayParamIn(CheckpointIn &cp, const std::string &name, CircleBuf< T > ¶m)
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
virtual PCStateBase * clone() const =0
Register ID: describe an architectural register with its class and index.
#define panic(...)
This implements a cprintf based panic() function.
virtual void setReg(const RegId ®, RegVal val)
Generated on Sun Jul 30 2023 01:56:47 for gem5 by doxygen 1.8.17