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.... ");
245 RegVal cfg_Mask = 0x7FFF0007;
284 RegVal cfg2_Mask = 0x7000F000;
310 RegVal EB_Mask = 0x3FFFF000;
320 RegVal SC_Mask = 0x0000F3C0;
330 RegVal IC_Mask = 0x000003E0;
339 RegVal wh_Mask = 0x7FFF0FFF;
349 RegVal pc_Mask = 0x00007FF;
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",
548 curVal &= (~miscRegFile_WriteMask[idx][reg_sel]);
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.
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 void setMiscRegNoEffect(RegIndex misc_reg, RegVal val)=0
virtual BaseCPU * getCpuPtr()=0
virtual void setReg(const RegId ®, RegVal val)
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 intRegClass
constexpr RegClass vecPredRegClass
constexpr RegClass ccRegClass
constexpr RegClass miscRegClass
constexpr RegClass vecRegClass
void restoreThread(TC *tc)
constexpr RegClass floatRegClass
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria 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[]
unsigned CP0_IntCtl_IPPCI
unsigned CP0_PRId_Revision
unsigned CP0_PRId_CompanyID
unsigned CP0_PRId_CompanyOptions
unsigned CP0_EBase_CPUNum
unsigned CP0_PRId_ProcessorID