Go to the documentation of this file.
37 #include "debug/MipsPRA.hh"
38 #include "params/MipsISA.hh"
46 "Index",
"MVPControl",
"MVPConf0",
"MVPConf1",
"",
"",
"",
"",
47 "Random",
"VPEControl",
"VPEConf0",
"VPEConf1",
48 "YQMask",
"VPESchedule",
"VPEScheFBack",
"VPEOpt",
49 "EntryLo0",
"TCStatus",
"TCBind",
"TCRestart",
50 "TCHalt",
"TCContext",
"TCSchedule",
"TCScheFBack",
51 "EntryLo1",
"",
"",
"",
"",
"",
"",
"",
52 "Context",
"ContextConfig",
"",
"",
"",
"",
"",
"",
53 "PageMask",
"PageGrain",
"",
"",
"",
"",
"",
"",
54 "Wired",
"SRSConf0",
"SRCConf1",
"SRSConf2",
55 "SRSConf3",
"SRSConf4",
"",
"",
56 "HWREna",
"",
"",
"",
"",
"",
"",
"",
57 "BadVAddr",
"",
"",
"",
"",
"",
"",
"",
58 "Count",
"",
"",
"",
"",
"",
"",
"",
59 "EntryHi",
"",
"",
"",
"",
"",
"",
"",
60 "Compare",
"",
"",
"",
"",
"",
"",
"",
61 "Status",
"IntCtl",
"SRSCtl",
"SRSMap",
"",
"",
"",
"",
62 "Cause",
"",
"",
"",
"",
"",
"",
"",
63 "EPC",
"",
"",
"",
"",
"",
"",
"",
64 "PRId",
"EBase",
"",
"",
"",
"",
"",
"",
65 "Config",
"Config1",
"Config2",
"Config3",
"",
"",
"",
"",
66 "LLAddr",
"",
"",
"",
"",
"",
"",
"",
67 "WatchLo0",
"WatchLo1",
"WatchLo2",
"WatchLo3",
68 "WatchLo4",
"WatchLo5",
"WatchLo6",
"WatchLo7",
69 "WatchHi0",
"WatchHi1",
"WatchHi2",
"WatchHi3",
70 "WatchHi4",
"WatchHi5",
"WatchHi6",
"WatchHi7",
71 "XCContext64",
"",
"",
"",
"",
"",
"",
"",
72 "",
"",
"",
"",
"",
"",
"",
"",
73 "",
"",
"",
"",
"",
"",
"",
"",
74 "Debug",
"TraceControl1",
"TraceControl2",
"UserTraceData",
75 "TraceBPC",
"",
"",
"",
76 "DEPC",
"",
"",
"",
"",
"",
"",
"",
77 "PerfCnt0",
"PerfCnt1",
"PerfCnt2",
"PerfCnt3",
78 "PerfCnt4",
"PerfCnt5",
"PerfCnt6",
"PerfCnt7",
79 "ErrCtl",
"",
"",
"",
"",
"",
"",
"",
80 "CacheErr0",
"CacheErr1",
"CacheErr2",
"CacheErr3",
"",
"",
"",
"",
81 "TagLo0",
"DataLo1",
"TagLo2",
"DataLo3",
82 "TagLo4",
"DataLo5",
"TagLo6",
"DataLo7",
83 "TagHi0",
"DataHi1",
"TagHi2",
"DataHi3",
84 "TagHi4",
"DataHi5",
"TagHi6",
"DataHi7",
85 "ErrorEPC",
"",
"",
"",
"",
"",
"",
"",
86 "DESAVE",
"",
"",
"",
"",
"",
"",
"",
117 uint32_t num_vpe_regs =
sizeof(per_vpe_regs) / 4;
118 for (
int i = 0;
i < num_vpe_regs;
i++) {
133 uint32_t num_tc_regs =
sizeof(per_tc_regs) / 4;
135 for (
int i = 0;
i < num_tc_regs;
i++) {
143 const MipsISAParams *
165 DPRINTF(MipsPRA,
"Resetting CP0 State with %i TCs and %i VPEs\n",
169 panic(
"CP state must be set before the following code is used");
176 DPRINTF(MipsPRA,
"Initializing CP0 State.... ");
179 procId.coOp =
cp.CP0_PRId_CompanyOptions;
180 procId.coId =
cp.CP0_PRId_CompanyID;
181 procId.procId =
cp.CP0_PRId_ProcessorID;
192 cfg.be =
cp.CP0_Config_BE;
193 cfg.at =
cp.CP0_Config_AT;
194 cfg.ar =
cp.CP0_Config_AR;
195 cfg.mt =
cp.CP0_Config_MT;
196 cfg.vi =
cp.CP0_Config_VI;
200 RegVal cfg_Mask = 0x7FFF0007;
206 cfg1.mmuSize =
cp.CP0_Config1_MMU;
207 cfg1.is =
cp.CP0_Config1_IS;
208 cfg1.il =
cp.CP0_Config1_IL;
209 cfg1.ia =
cp.CP0_Config1_IA;
210 cfg1.ds =
cp.CP0_Config1_DS;
211 cfg1.dl =
cp.CP0_Config1_DL;
212 cfg1.da =
cp.CP0_Config1_DA;
213 cfg1.fp =
cp.CP0_Config1_FP;
214 cfg1.ep =
cp.CP0_Config1_EP;
215 cfg1.wr =
cp.CP0_Config1_WR;
216 cfg1.md =
cp.CP0_Config1_MD;
217 cfg1.c2 =
cp.CP0_Config1_C2;
218 cfg1.pc =
cp.CP0_Config1_PC;
219 cfg1.m =
cp.CP0_Config1_M;
228 cfg2.tu =
cp.CP0_Config2_TU;
229 cfg2.ts =
cp.CP0_Config2_TS;
230 cfg2.tl =
cp.CP0_Config2_TL;
231 cfg2.ta =
cp.CP0_Config2_TA;
232 cfg2.su =
cp.CP0_Config2_SU;
233 cfg2.ss =
cp.CP0_Config2_SS;
234 cfg2.sl =
cp.CP0_Config2_SL;
235 cfg2.sa =
cp.CP0_Config2_SA;
236 cfg2.m =
cp.CP0_Config2_M;
239 RegVal cfg2_Mask = 0x7000F000;
245 cfg3.dspp =
cp.CP0_Config3_DSPP;
246 cfg3.lpa =
cp.CP0_Config3_LPA;
247 cfg3.veic =
cp.CP0_Config3_VEIC;
248 cfg3.vint =
cp.CP0_Config3_VInt;
249 cfg3.sp =
cp.CP0_Config3_SP;
250 cfg3.mt =
cp.CP0_Config3_MT;
251 cfg3.sm =
cp.CP0_Config3_SM;
252 cfg3.tl =
cp.CP0_Config3_TL;
261 eBase.cpuNum =
cp.CP0_EBase_CPUNum;
265 RegVal EB_Mask = 0x3FFFF000;
272 scsCtl.hss =
cp.CP0_SrsCtl_HSS;
275 RegVal SC_Mask = 0x0000F3C0;
281 intCtl.ipti =
cp.CP0_IntCtl_IPTI;
282 intCtl.ippci =
cp.CP0_IntCtl_IPPCI;
285 RegVal IC_Mask = 0x000003E0;
291 watchHi.m =
cp.CP0_WatchHi_M;
294 RegVal wh_Mask = 0x7FFF0FFF;
300 perfCntCtl.m =
cp.CP0_PerfCtr_M;
301 perfCntCtl.w =
cp.CP0_PerfCtr_W;
304 RegVal pc_Mask = 0x00007FF;
317 pageGrain.esp =
cp.CP0_Config3_SP;
320 RegVal pg_Mask = 0x10000000;
339 RegVal stat_Mask = 0xFF78FF17;
415 return tcBind.curVPE;
423 DPRINTF(MipsPRA,
"Reading CP0 Register:%u Select:%u (%s) (%lx).\n",
438 "Reading CP0 Register:%u Select:%u (%s) with effect (%lx).\n",
451 "[tid:%i] Setting (direct set) CP0 Register:%u "
452 "Select:%u (%s) to %#x.\n",
464 "[tid:%i] Setting CP0 Register: %u Select: %u (%s) to %#x\n",
480 "[tid:%i] Setting CP0 Register:%u "
481 "Select:%u (%s) to %#x, with effect.\n",
508 "filterCP0Write: Mask: %lx, Inverse Mask: %lx, write Val: %x, "
509 "current val: %lx, written val: %x\n",
526 cpu->schedule(cp0_event, cpu->clockEdge(delay));
539 ThreadID num_threads = mvpConf0.ptc + 1;
541 for (
ThreadID tid = 0; tid < num_threads; tid++) {
546 if (tcHalt.h == 1 || tcStatus.a == 0) {
548 }
else if (tcHalt.h == 0 && tcStatus.a == 1) {
553 num_threads = mvpConf0.ptc + 1;
562 switch (cp0EventType)
573 MipsISAParams::create()
std::vector< BankType > bankType
void replaceBits(T &val, int first, int last, B bit_val)
A convenience function to replace bits first to last of val with bit_val in place.
static const Priority CPU_Tick_Pri
CPU ticks must come after other associated CPU events (such as writebacks).
int16_t ThreadID
Thread index/ID type.
void setMiscRegNoEffect(int misc_reg, RegVal val, ThreadID tid=0)
static std::string miscRegNames[NumMiscRegs]
const Params * params() const
virtual ThreadContext * getContext(int tn)
Given a thread num get tho thread context for it.
std::vector< std::vector< RegVal > > miscRegFile_WriteMask
RegVal readMiscReg(int misc_reg, ThreadID tid=0)
RegVal filterCP0Write(int misc_reg, 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
void updateCPU(BaseCPU *cpu)
void setMiscReg(int misc_reg, RegVal val, ThreadID tid=0)
void processCP0Event(BaseCPU *cpu, CP0EventType)
Process a CP0 event.
RegVal readMiscRegNoEffect(int misc_reg, ThreadID tid=0) const
const SimObjectParams * _params
Cached copy of the object parameters.
Cycles is a wrapper class for representing cycle counts, i.e.
unsigned getVPENum(ThreadID tid) const
void scheduleCP0Update(BaseCPU *cpu, Cycles delay=Cycles(0))
virtual BaseCPU * getCpuPtr()=0
void setRegMask(int misc_reg, RegVal val, ThreadID tid=0)
#define panic(...)
This implements a cprintf based panic() function.
void restoreThread(TC *tc)
Generated on Wed Sep 30 2020 14:01:59 for gem5 by doxygen 1.8.17