41#include "debug/MatRegs.hh"
42#include "debug/MipsPRA.hh"
43#include "params/MipsISA.hh"
54 "Index",
"MVPControl",
"MVPConf0",
"MVPConf1",
"",
"",
"",
"",
55 "Random",
"VPEControl",
"VPEConf0",
"VPEConf1",
56 "YQMask",
"VPESchedule",
"VPEScheFBack",
"VPEOpt",
57 "EntryLo0",
"TCStatus",
"TCBind",
"TCRestart",
58 "TCHalt",
"TCContext",
"TCSchedule",
"TCScheFBack",
59 "EntryLo1",
"",
"",
"",
"",
"",
"",
"",
60 "Context",
"ContextConfig",
"",
"",
"",
"",
"",
"",
61 "PageMask",
"PageGrain",
"",
"",
"",
"",
"",
"",
62 "Wired",
"SRSConf0",
"SRCConf1",
"SRSConf2",
63 "SRSConf3",
"SRSConf4",
"",
"",
64 "HWREna",
"",
"",
"",
"",
"",
"",
"",
65 "BadVAddr",
"",
"",
"",
"",
"",
"",
"",
66 "Count",
"",
"",
"",
"",
"",
"",
"",
67 "EntryHi",
"",
"",
"",
"",
"",
"",
"",
68 "Compare",
"",
"",
"",
"",
"",
"",
"",
69 "Status",
"IntCtl",
"SRSCtl",
"SRSMap",
"",
"",
"",
"",
70 "Cause",
"",
"",
"",
"",
"",
"",
"",
71 "EPC",
"",
"",
"",
"",
"",
"",
"",
72 "PRId",
"EBase",
"",
"",
"",
"",
"",
"",
73 "Config",
"Config1",
"Config2",
"Config3",
"",
"",
"",
"",
74 "LLAddr",
"",
"",
"",
"",
"",
"",
"",
75 "WatchLo0",
"WatchLo1",
"WatchLo2",
"WatchLo3",
76 "WatchLo4",
"WatchLo5",
"WatchLo6",
"WatchLo7",
77 "WatchHi0",
"WatchHi1",
"WatchHi2",
"WatchHi3",
78 "WatchHi4",
"WatchHi5",
"WatchHi6",
"WatchHi7",
79 "XCContext64",
"",
"",
"",
"",
"",
"",
"",
80 "",
"",
"",
"",
"",
"",
"",
"",
81 "",
"",
"",
"",
"",
"",
"",
"",
82 "Debug",
"TraceControl1",
"TraceControl2",
"UserTraceData",
83 "TraceBPC",
"",
"",
"",
84 "DEPC",
"",
"",
"",
"",
"",
"",
"",
85 "PerfCnt0",
"PerfCnt1",
"PerfCnt2",
"PerfCnt3",
86 "PerfCnt4",
"PerfCnt5",
"PerfCnt6",
"PerfCnt7",
87 "ErrCtl",
"",
"",
"",
"",
"",
"",
"",
88 "CacheErr0",
"CacheErr1",
"CacheErr2",
"CacheErr3",
"",
"",
"",
"",
89 "TagLo0",
"DataLo1",
"TagLo2",
"DataLo3",
90 "TagLo4",
"DataLo5",
"TagLo6",
"DataLo7",
91 "TagHi0",
"DataHi1",
"TagHi2",
"DataHi3",
92 "TagHi4",
"DataHi5",
"TagHi6",
"DataHi7",
93 "ErrorEPC",
"",
"",
"",
"",
"",
"",
"",
94 "DESAVE",
"",
"",
"",
"",
"",
"",
"",
149 uint32_t num_vpe_regs =
sizeof(per_vpe_regs) / 4;
150 for (
int i = 0;
i < num_vpe_regs;
i++) {
165 uint32_t num_tc_regs =
sizeof(per_tc_regs) / 4;
167 for (
int i = 0;
i < num_tc_regs;
i++) {
210 DPRINTF(MipsPRA,
"Resetting CP0 State with %i TCs and %i VPEs\n",
214 panic(
"CP state must be set before the following code is used");
221 DPRINTF(MipsPRA,
"Initializing CP0 State.... ");
224 procId.coOp =
cp.CP0_PRId_CompanyOptions;
225 procId.coId =
cp.CP0_PRId_CompanyID;
226 procId.procId =
cp.CP0_PRId_ProcessorID;
237 cfg.be =
cp.CP0_Config_BE;
238 cfg.at =
cp.CP0_Config_AT;
239 cfg.ar =
cp.CP0_Config_AR;
240 cfg.mt =
cp.CP0_Config_MT;
241 cfg.vi =
cp.CP0_Config_VI;
245 RegVal cfg_Mask = 0x7FFF0007;
251 cfg1.mmuSize =
cp.CP0_Config1_MMU;
252 cfg1.is =
cp.CP0_Config1_IS;
253 cfg1.il =
cp.CP0_Config1_IL;
254 cfg1.ia =
cp.CP0_Config1_IA;
255 cfg1.ds =
cp.CP0_Config1_DS;
256 cfg1.dl =
cp.CP0_Config1_DL;
257 cfg1.da =
cp.CP0_Config1_DA;
258 cfg1.fp =
cp.CP0_Config1_FP;
259 cfg1.ep =
cp.CP0_Config1_EP;
260 cfg1.wr =
cp.CP0_Config1_WR;
261 cfg1.md =
cp.CP0_Config1_MD;
262 cfg1.c2 =
cp.CP0_Config1_C2;
263 cfg1.pc =
cp.CP0_Config1_PC;
264 cfg1.m =
cp.CP0_Config1_M;
273 cfg2.tu =
cp.CP0_Config2_TU;
274 cfg2.ts =
cp.CP0_Config2_TS;
275 cfg2.tl =
cp.CP0_Config2_TL;
276 cfg2.ta =
cp.CP0_Config2_TA;
277 cfg2.su =
cp.CP0_Config2_SU;
278 cfg2.ss =
cp.CP0_Config2_SS;
279 cfg2.sl =
cp.CP0_Config2_SL;
280 cfg2.sa =
cp.CP0_Config2_SA;
281 cfg2.m =
cp.CP0_Config2_M;
284 RegVal cfg2_Mask = 0x7000F000;
290 cfg3.dspp =
cp.CP0_Config3_DSPP;
291 cfg3.lpa =
cp.CP0_Config3_LPA;
292 cfg3.veic =
cp.CP0_Config3_VEIC;
293 cfg3.vint =
cp.CP0_Config3_VInt;
294 cfg3.sp =
cp.CP0_Config3_SP;
295 cfg3.mt =
cp.CP0_Config3_MT;
296 cfg3.sm =
cp.CP0_Config3_SM;
297 cfg3.tl =
cp.CP0_Config3_TL;
306 eBase.cpuNum =
cp.CP0_EBase_CPUNum;
310 RegVal EB_Mask = 0x3FFFF000;
317 scsCtl.hss =
cp.CP0_SrsCtl_HSS;
320 RegVal SC_Mask = 0x0000F3C0;
326 intCtl.ipti =
cp.CP0_IntCtl_IPTI;
327 intCtl.ippci =
cp.CP0_IntCtl_IPPCI;
330 RegVal IC_Mask = 0x000003E0;
336 watchHi.m =
cp.CP0_WatchHi_M;
339 RegVal wh_Mask = 0x7FFF0FFF;
345 perfCntCtl.m =
cp.CP0_PerfCtr_M;
346 perfCntCtl.w =
cp.CP0_PerfCtr_W;
349 RegVal pc_Mask = 0x00007FF;
362 pageGrain.esp =
cp.CP0_Config3_SP;
365 RegVal pg_Mask = 0x10000000;
384 RegVal stat_Mask = 0xFF78FF17;
460 return tcBind.curVPE;
468 DPRINTF(MipsPRA,
"Reading CP0 Register:%u Select:%u (%s) (%lx).\n",
482 "Reading CP0 Register:%u Select:%u (%s) with effect (%lx).\n",
494 "[tid:%i] Setting (direct set) CP0 Register:%u "
495 "Select:%u (%s) to %#x.\n",
507 "[tid:%i] Setting CP0 Register: %u Select: %u (%s) to %#x\n",
523 "[tid:%i] Setting CP0 Register:%u "
524 "Select:%u (%s) to %#x, with effect.\n",
551 "filterCP0Write: Mask: %lx, Inverse Mask: %lx, write Val: %x, "
552 "current val: %lx, written val: %x\n",
582 ThreadID num_threads = mvpConf0.ptc + 1;
584 for (
ThreadID tid = 0; tid < num_threads; tid++) {
589 if (tcHalt.h == 1 || tcStatus.a == 0) {
591 }
else if (tcHalt.h == 0 && tcStatus.a == 1) {
596 num_threads = mvpConf0.ptc + 1;
605 switch (cp0EventType)
virtual ThreadContext * getContext(int tn)
Given a thread num get tho thread context for it.
BaseISA(const SimObjectParams &p, const std::string &name)
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...
Cycles is a wrapper class for representing cycle counts, i.e.
void processCP0Event(BaseCPU *cpu, CP0EventType)
Process a CP0 event.
void setMiscReg(RegIndex idx, RegVal val, ThreadID tid)
std::vector< std::vector< RegVal > > miscRegFile
void updateCPU(BaseCPU *cpu)
RegVal readMiscRegNoEffect(RegIndex idx, ThreadID tid) const
RegVal readMiscReg(RegIndex idx, ThreadID tid)
unsigned getVPENum(ThreadID tid) const
void setRegMask(RegIndex idx, RegVal val, ThreadID tid=0)
void setMiscRegNoEffect(RegIndex idx, RegVal val, ThreadID tid)
std::vector< BankType > bankType
void scheduleCP0Update(BaseCPU *cpu, Cycles delay=Cycles(0))
RegVal filterCP0Write(RegIndex idx, int reg_sel, RegVal val)
This method doesn't need to adjust the Control Register Offset since it has already been done in the ...
std::vector< std::vector< RegVal > > miscRegFile_WriteMask
void copyRegsFrom(ThreadContext *src) override
static std::string miscRegNames[misc_reg::NumRegs]
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual RegVal getReg(const RegId ®) const
virtual const PCStateBase & pcState() const =0
virtual RegVal readMiscRegNoEffect(RegIndex misc_reg) const =0
constexpr void replaceBits(T &val, unsigned first, unsigned last, B bit_val)
A convenience function to replace bits first to last of val with bit_val in place.
void schedule(Event &event, Tick when)
static const Priority CPU_Tick_Pri
CPU ticks must come after other associated CPU events (such as writebacks).
#define panic(...)
This implements a cprintf based panic() function.
ISA-specific helper functions for multithreaded execution.
constexpr RegClass matRegClass
constexpr RegClass vecElemClass
constexpr RegClass vecPredRegClass
constexpr RegClass ccRegClass
constexpr RegClass vecRegClass
void restoreThread(TC *tc)
constexpr RegClass miscRegClass(MiscRegClass, MiscRegClassName, misc_reg::NumRegs, debug::MiscRegs)
constexpr RegClass intRegClass(IntRegClass, IntRegClassName, int_reg::NumRegs, debug::IntRegs)
constexpr RegClass floatRegClass(FloatRegClass, FloatRegClassName, float_reg::NumRegs, debug::FloatRegs)
Copyright (c) 2024 Arm Limited All rights reserved.
int16_t ThreadID
Thread index/ID type.
constexpr char CCRegClassName[]
constexpr char VecPredRegClassName[]
constexpr char VecRegClassName[]
constexpr char MatRegClassName[]
@ MatRegClass
Matrix Register.
@ CCRegClass
Condition-code register.
@ VecRegClass
Vector Register.
@ VecElemClass
Vector Register Native Elem lane.
constexpr char VecElemClassName[]