39 #include "debug/MipsPRA.hh"
40 #include "params/MipsISA.hh"
48 "Index",
"MVPControl",
"MVPConf0",
"MVPConf1",
"",
"",
"",
"",
49 "Random",
"VPEControl",
"VPEConf0",
"VPEConf1",
50 "YQMask",
"VPESchedule",
"VPEScheFBack",
"VPEOpt",
51 "EntryLo0",
"TCStatus",
"TCBind",
"TCRestart",
52 "TCHalt",
"TCContext",
"TCSchedule",
"TCScheFBack",
53 "EntryLo1",
"",
"",
"",
"",
"",
"",
"",
54 "Context",
"ContextConfig",
"",
"",
"",
"",
"",
"",
55 "PageMask",
"PageGrain",
"",
"",
"",
"",
"",
"",
56 "Wired",
"SRSConf0",
"SRCConf1",
"SRSConf2",
57 "SRSConf3",
"SRSConf4",
"",
"",
58 "HWREna",
"",
"",
"",
"",
"",
"",
"",
59 "BadVAddr",
"",
"",
"",
"",
"",
"",
"",
60 "Count",
"",
"",
"",
"",
"",
"",
"",
61 "EntryHi",
"",
"",
"",
"",
"",
"",
"",
62 "Compare",
"",
"",
"",
"",
"",
"",
"",
63 "Status",
"IntCtl",
"SRSCtl",
"SRSMap",
"",
"",
"",
"",
64 "Cause",
"",
"",
"",
"",
"",
"",
"",
65 "EPC",
"",
"",
"",
"",
"",
"",
"",
66 "PRId",
"EBase",
"",
"",
"",
"",
"",
"",
67 "Config",
"Config1",
"Config2",
"Config3",
"",
"",
"",
"",
68 "LLAddr",
"",
"",
"",
"",
"",
"",
"",
69 "WatchLo0",
"WatchLo1",
"WatchLo2",
"WatchLo3",
70 "WatchLo4",
"WatchLo5",
"WatchLo6",
"WatchLo7",
71 "WatchHi0",
"WatchHi1",
"WatchHi2",
"WatchHi3",
72 "WatchHi4",
"WatchHi5",
"WatchHi6",
"WatchHi7",
73 "XCContext64",
"",
"",
"",
"",
"",
"",
"",
74 "",
"",
"",
"",
"",
"",
"",
"",
75 "",
"",
"",
"",
"",
"",
"",
"",
76 "Debug",
"TraceControl1",
"TraceControl2",
"UserTraceData",
77 "TraceBPC",
"",
"",
"",
78 "DEPC",
"",
"",
"",
"",
"",
"",
"",
79 "PerfCnt0",
"PerfCnt1",
"PerfCnt2",
"PerfCnt3",
80 "PerfCnt4",
"PerfCnt5",
"PerfCnt6",
"PerfCnt7",
81 "ErrCtl",
"",
"",
"",
"",
"",
"",
"",
82 "CacheErr0",
"CacheErr1",
"CacheErr2",
"CacheErr3",
"",
"",
"",
"",
83 "TagLo0",
"DataLo1",
"TagLo2",
"DataLo3",
84 "TagLo4",
"DataLo5",
"TagLo6",
"DataLo7",
85 "TagHi0",
"DataHi1",
"TagHi2",
"DataHi3",
86 "TagHi4",
"DataHi5",
"TagHi6",
"DataHi7",
87 "ErrorEPC",
"",
"",
"",
"",
"",
"",
"",
88 "DESAVE",
"",
"",
"",
"",
"",
"",
"",
93 :
SimObject(p), numThreads(p->num_threads), numVpes(p->num_vpes)
119 uint32_t num_vpe_regs =
sizeof(per_vpe_regs) / 4;
120 for (
int i = 0;
i < num_vpe_regs;
i++) {
135 uint32_t num_tc_regs =
sizeof(per_tc_regs) / 4;
137 for (
int i = 0;
i < num_tc_regs;
i++) {
145 const MipsISAParams *
167 DPRINTF(MipsPRA,
"Resetting CP0 State with %i TCs and %i VPEs\n",
171 panic(
"CP state must be set before the following code is used");
178 DPRINTF(MipsPRA,
"Initializing CP0 State.... ");
241 MiscReg cfg2_Mask = 0x7000F000;
341 MiscReg stat_Mask = 0xFF78FF17;
417 return tcBind.curVPE;
425 DPRINTF(MipsPRA,
"Reading CP0 Register:%u Select:%u (%s) (%lx).\n",
440 "Reading CP0 Register:%u Select:%u (%s) with effect (%lx).\n",
453 "[tid:%i]: Setting (direct set) CP0 Register:%u "
454 "Select:%u (%s) to %#x.\n",
455 tid, misc_reg / 8, misc_reg % 8,
miscRegNames[misc_reg], val);
466 "[tid:%i]: Setting CP0 Register: %u Select: %u (%s) to %#x\n",
467 tid, misc_reg / 8, misc_reg % 8,
miscRegNames[misc_reg], val);
483 "[tid:%i]: Setting CP0 Register:%u "
484 "Select:%u (%s) to %#x, with effect.\n",
485 tid, misc_reg / 8, misc_reg % 8,
miscRegNames[misc_reg], val);
511 "filterCP0Write: Mask: %lx, Inverse Mask: %lx, write Val: %x, "
512 "current val: %lx, written val: %x\n",
527 cpu->schedule(cp0_event, cpu->clockEdge(delay));
540 ThreadID num_threads = mvpConf0.ptc + 1;
542 for (
ThreadID tid = 0; tid < num_threads; tid++) {
547 if (tcHalt.h == 1 || tcStatus.a == 0) {
549 }
else if (tcHalt.h == 0 && tcStatus.a == 1) {
554 num_threads = mvpConf0.ptc + 1;
561 :
Event(CPU_Tick_Pri),
cp0(_cp0), cpu(_cpu), cp0EventType(e_type)
567 switch (cp0EventType)
578 return "Coprocessor-0 event";
584 cpu->reschedule(
this, cpu->clockEdge(delay),
true);
597 MipsISAParams::create()
void unscheduleEvent()
Unschedule This Event.
Cycles is a wrapper class for representing cycle counts, i.e.
unsigned getVPENum(ThreadID tid) const
unsigned CP0_EBase_CPUNum
void restoreThread(TC *tc)
const Params * params() const
unsigned CP0_PRId_ProcessorID
void updateCPU(BaseCPU *cpu)
virtual BaseCPU * getCpuPtr()=0
ThreadContext is the external interface to all thread state for anything outside of the CPU...
CP0Event(CP0 *_cp0, BaseCPU *_cpu, CP0EventType e_type)
Constructs a CP0 event.
ISA-specific helper functions for multithreaded execution.
void scheduleEvent(Cycles delay)
Schedule This Event.
std::vector< std::vector< MiscReg > > miscRegFile
MiscReg readMiscRegNoEffect(int misc_reg, ThreadID tid=0) const
MiscReg filterCP0Write(int misc_reg, int reg_sel, const MiscReg &val)
This method doesn't need to adjust the Control Register Offset since it has already been done in the ...
unsigned CP0_PRId_CompanyID
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 std::string miscRegNames[NumMiscRegs]
unsigned CP0_PRId_CompanyOptions
void scheduleCP0Update(BaseCPU *cpu, Cycles delay=Cycles(0))
int16_t ThreadID
Thread index/ID type.
void setMiscRegNoEffect(int misc_reg, const MiscReg &val, ThreadID tid=0)
unsigned CP0_PRId_Revision
unsigned CP0_IntCtl_IPPCI
const SimObjectParams * _params
Cached copy of the object parameters.
void setRegMask(int misc_reg, const MiscReg &val, ThreadID tid=0)
std::vector< BankType > bankType
virtual void process()
Process this event.
void setMiscReg(int misc_reg, const MiscReg &val, ThreadContext *tc, ThreadID tid=0)
const char * description() const
Returns the description of this event.
Abstract superclass for simulation objects.
std::vector< std::vector< MiscReg > > miscRegFile_WriteMask
MiscReg readMiscReg(int misc_reg, ThreadContext *tc, ThreadID tid=0)