gem5 v24.0.0.0
Loading...
Searching...
No Matches
isa.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;
9 * redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution;
12 * neither the name of the copyright holders nor the names of its
13 * contributors may be used to endorse or promote products derived from
14 * this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include "arch/mips/isa.hh"
30
31#include "arch/mips/mt.hh"
35#include "arch/mips/regs/int.hh"
37#include "base/bitfield.hh"
38#include "cpu/base.hh"
39#include "cpu/reg_class.hh"
40#include "cpu/thread_context.hh"
41#include "debug/MatRegs.hh"
42#include "debug/MipsPRA.hh"
43#include "params/MipsISA.hh"
44
45namespace gem5
46{
47
48namespace MipsISA
49{
50
51std::string
53{
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", "", "", "", "", "", "", "",
95 "LLFlag"
96};
97
98namespace
99{
100
101/* Not applicable to MIPS. */
102constexpr RegClass vecRegClass(VecRegClass, VecRegClassName, 1,
103 debug::IntRegs);
104constexpr RegClass vecElemClass(VecElemClass, VecElemClassName, 2,
105 debug::IntRegs);
107 debug::IntRegs);
108constexpr RegClass matRegClass(MatRegClass, MatRegClassName, 0, debug::MatRegs);
109constexpr RegClass ccRegClass(CCRegClass, CCRegClassName, 0, debug::IntRegs);
110
111} // anonymous namespace
112
113ISA::ISA(const Params &p) : BaseISA(p, "mips"), numThreads(p.num_threads),
114 numVpes(p.num_vpes)
115{
116 _regClasses.push_back(&intRegClass);
117 _regClasses.push_back(&floatRegClass);
118 _regClasses.push_back(&vecRegClass);
119 _regClasses.push_back(&vecElemClass);
120 _regClasses.push_back(&vecPredRegClass);
121 _regClasses.push_back(&matRegClass);
122 _regClasses.push_back(&ccRegClass);
123 _regClasses.push_back(&miscRegClass);
124
127
128 for (int i = 0; i < misc_reg::NumRegs; i++) {
129 miscRegFile[i].resize(1);
131 }
132
134
135 for (int i = 0; i < misc_reg::NumRegs; i++) {
136 miscRegFile_WriteMask[i].push_back(0);
137 }
138
139 // Initialize all Per-VPE regs
140 uint32_t per_vpe_regs[] = { misc_reg::VpeControl,
148 };
149 uint32_t num_vpe_regs = sizeof(per_vpe_regs) / 4;
150 for (int i = 0; i < num_vpe_regs; i++) {
151 if (numVpes > 1) {
152 miscRegFile[per_vpe_regs[i]].resize(numVpes);
153 }
154 bankType[per_vpe_regs[i]] = perVirtProcessor;
155 }
156
157 // Initialize all Per-TC regs
158 uint32_t per_tc_regs[] = { misc_reg::Status,
164 };
165 uint32_t num_tc_regs = sizeof(per_tc_regs) / 4;
166
167 for (int i = 0; i < num_tc_regs; i++) {
168 miscRegFile[per_tc_regs[i]].resize(numThreads);
169 bankType[per_tc_regs[i]] = perThreadContext;
170 }
171
172 clear();
173}
174
175void
177{
178 for (int i = 0; i < misc_reg::NumRegs; i++) {
179 for (int j = 0; j < miscRegFile[i].size(); j++)
180 miscRegFile[i][j] = 0;
181
182 for (int k = 0; k < miscRegFile_WriteMask[i].size(); k++)
183 miscRegFile_WriteMask[i][k] = (long unsigned int)(-1);
184 }
185}
186
187void
189{
190 // First loop through the integer registers.
191 for (auto &id: intRegClass)
192 tc->setReg(id, src->getReg(id));
193
194 // Then loop through the floating point registers.
195 for (auto &id: floatRegClass)
196 tc->setReg(id, src->getReg(id));
197
198 // Copy misc. registers
199 for (int i = 0; i < misc_reg::NumRegs; i++)
201
202 // Copy over the PC State
203 tc->pcState(src->pcState());
204}
205
206
207void
209{
210 DPRINTF(MipsPRA, "Resetting CP0 State with %i TCs and %i VPEs\n",
212
213 CoreSpecific cp;
214 panic("CP state must be set before the following code is used");
215
216 // Do Default CP0 initialization HERE
217
218 // Do Initialization for MT cores here (eventually use
219 // core_name parameter to toggle this initialization)
220 // ===================================================
221 DPRINTF(MipsPRA, "Initializing CP0 State.... ");
222
225 procId.coId = cp.CP0_PRId_CompanyID;
226 procId.procId = cp.CP0_PRId_ProcessorID;
227 procId.rev = cp.CP0_PRId_Revision;
229
230 // Now, create Write Mask for ProcID register
231 RegVal procIDMask = 0; // Read-Only register
232 replaceBits(procIDMask, 32, 0, 0);
233 setRegMask(misc_reg::Prid, procIDMask);
234
235 // Config
236 ConfigReg cfg = readMiscRegNoEffect(misc_reg::Config);
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;
242 cfg.m = 1;
244 // Now, create Write Mask for Config register
245 RegVal cfg_Mask = 0x7FFF0007;
246 replaceBits(cfg_Mask, 32, 0, 0);
247 setRegMask(misc_reg::Config, cfg_Mask);
248
249 // Config1
250 Config1Reg cfg1 = readMiscRegNoEffect(misc_reg::Config1);
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;
266 // Now, create Write Mask for Config register
267 RegVal cfg1_Mask = 0; // Read Only Register
268 replaceBits(cfg1_Mask, 32,0 , 0);
269 setRegMask(misc_reg::Config1, cfg1_Mask);
270
271 // Config2
272 Config2Reg cfg2 = readMiscRegNoEffect(misc_reg::Config2);
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;
283 // Now, create Write Mask for Config register
284 RegVal cfg2_Mask = 0x7000F000; // Read Only Register
285 replaceBits(cfg2_Mask, 32, 0, 0);
286 setRegMask(misc_reg::Config2, cfg2_Mask);
287
288 // Config3
289 Config3Reg cfg3 = readMiscRegNoEffect(misc_reg::Config3);
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;
299 // Now, create Write Mask for Config register
300 RegVal cfg3_Mask = 0; // Read Only Register
301 replaceBits(cfg3_Mask, 32,0 , 0);
302 setRegMask(misc_reg::Config3, cfg3_Mask);
303
304 // EBase - CPUNum
305 EBaseReg eBase = readMiscRegNoEffect(misc_reg::Ebase);
306 eBase.cpuNum = cp.CP0_EBase_CPUNum;
307 replaceBits(eBase, 31, 31, 1);
309 // Now, create Write Mask for Config register
310 RegVal EB_Mask = 0x3FFFF000;// Except Exception Base, the
311 // entire register is read only
312 replaceBits(EB_Mask, 32, 0, 0);
313 setRegMask(misc_reg::Ebase, EB_Mask);
314
315 // SRS Control - HSS (Highest Shadow Set)
316 SRSCtlReg scsCtl = readMiscRegNoEffect(misc_reg::Srsctl);
317 scsCtl.hss = cp.CP0_SrsCtl_HSS;
319 // Now, create Write Mask for the SRS Ctl register
320 RegVal SC_Mask = 0x0000F3C0;
321 replaceBits(SC_Mask, 32, 0, 0);
323
324 // IntCtl - IPTI, IPPCI
325 IntCtlReg intCtl = readMiscRegNoEffect(misc_reg::Intctl);
326 intCtl.ipti = cp.CP0_IntCtl_IPTI;
327 intCtl.ippci = cp.CP0_IntCtl_IPPCI;
329 // Now, create Write Mask for the IntCtl register
330 RegVal IC_Mask = 0x000003E0;
331 replaceBits(IC_Mask, 32, 0, 0);
333
334 // Watch Hi - M - FIXME (More than 1 Watch register)
335 WatchHiReg watchHi = readMiscRegNoEffect(misc_reg::Watchhi0);
336 watchHi.m = cp.CP0_WatchHi_M;
338 // Now, create Write Mask for the IntCtl register
339 RegVal wh_Mask = 0x7FFF0FFF;
340 replaceBits(wh_Mask, 32, 0, 0);
342
343 // Perf Ctr - M - FIXME (More than 1 PerfCnt Pair)
344 PerfCntCtlReg perfCntCtl = readMiscRegNoEffect(misc_reg::Perfcnt0);
345 perfCntCtl.m = cp.CP0_PerfCtr_M;
346 perfCntCtl.w = cp.CP0_PerfCtr_W;
348 // Now, create Write Mask for the IntCtl register
349 RegVal pc_Mask = 0x00007FF;
350 replaceBits(pc_Mask, 32, 0, 0);
352
353 // Random
355 // Now, create Write Mask for the IntCtl register
356 RegVal random_Mask = 0;
357 replaceBits(random_Mask, 32, 0, 0);
358 setRegMask(misc_reg::Cp0Random, random_Mask);
359
360 // PageGrain
361 PageGrainReg pageGrain = readMiscRegNoEffect(misc_reg::Pagegrain);
362 pageGrain.esp = cp.CP0_Config3_SP;
364 // Now, create Write Mask for the IntCtl register
365 RegVal pg_Mask = 0x10000000;
366 replaceBits(pg_Mask, 32, 0, 0);
368
369 // Status
371 // Only CU0 and IE are modified on a reset - everything else needs
372 // to be controlled on a per CPU model basis
373
374 // Enable CP0 on reset
375 // status.cu0 = 1;
376
377 // Enable ERL bit on a reset
378 status.erl = 1;
379 // Enable BEV bit on a reset
380 status.bev = 1;
381
383 // Now, create Write Mask for the Status register
384 RegVal stat_Mask = 0xFF78FF17;
385 replaceBits(stat_Mask, 32, 0, 0);
386 setRegMask(misc_reg::Status, stat_Mask);
387
388
389 // MVPConf0
390 MVPConf0Reg mvpConf0 = readMiscRegNoEffect(misc_reg::MvpConf0);
391 mvpConf0.tca = 1;
392 mvpConf0.pvpe = numVpes - 1;
393 mvpConf0.ptc = numThreads - 1;
395
396 // VPEConf0
397 VPEConf0Reg vpeConf0 = readMiscRegNoEffect(misc_reg::VpeConf0);
398 vpeConf0.mvp = 1;
400
401 // TCBind
402 for (ThreadID tid = 0; tid < numThreads; tid++) {
403 TCBindReg tcBind = readMiscRegNoEffect(misc_reg::TcBind, tid);
404 tcBind.curTC = tid;
406 }
407 // TCHalt
408 TCHaltReg tcHalt = readMiscRegNoEffect(misc_reg::TcHalt);
409 tcHalt.h = 0;
411
412 // TCStatus
413 // Set TCStatus Activated to 1 for the initial thread that is running
414 TCStatusReg tcStatus = readMiscRegNoEffect(misc_reg::TcStatus);
415 tcStatus.a = 1;
417
418 // Set Dynamically Allocatable bit to 1 for all other threads
419 for (ThreadID tid = 1; tid < numThreads; tid++) {
421 tcStatus.da = 1;
423 }
424
425
426 RegVal mask = 0x7FFFFFFF;
427
428 // Now, create Write Mask for the Index register
429 replaceBits(mask, 32, 0, 0);
431
432 mask = 0x3FFFFFFF;
433 replaceBits(mask, 32, 0, 0);
436
437 mask = 0xFF800000;
438 replaceBits(mask, 32, 0, 0);
440
441 mask = 0x1FFFF800;
442 replaceBits(mask, 32, 0, 0);
444
445 mask = 0x0;
446 replaceBits(mask, 32, 0, 0);
449
450 mask = 0x08C00300;
451 replaceBits(mask, 32, 0, 0);
453
454}
455
456inline unsigned
458{
459 TCBindReg tcBind = miscRegFile[misc_reg::TcBind][tid];
460 return tcBind.curVPE;
461}
462
463RegVal
465{
466 unsigned reg_sel = (bankType[idx] == perThreadContext)
467 ? tid : getVPENum(tid);
468 DPRINTF(MipsPRA, "Reading CP0 Register:%u Select:%u (%s) (%lx).\n",
469 idx / 8, idx % 8, miscRegNames[idx], miscRegFile[idx][reg_sel]);
470 return miscRegFile[idx][reg_sel];
471}
472
473//@TODO: MIPS MT's register view automatically connects
474// Status to TCStatus depending on current thread
475//template <class TC>
476RegVal
478{
479 unsigned reg_sel = (bankType[idx] == perThreadContext)
480 ? tid : getVPENum(tid);
481 DPRINTF(MipsPRA,
482 "Reading CP0 Register:%u Select:%u (%s) with effect (%lx).\n",
483 idx / 8, idx % 8, miscRegNames[idx], miscRegFile[idx][reg_sel]);
484
485 return miscRegFile[idx][reg_sel];
486}
487
488void
490{
491 unsigned reg_sel = (bankType[idx] == perThreadContext)
492 ? tid : getVPENum(tid);
493 DPRINTF(MipsPRA,
494 "[tid:%i] Setting (direct set) CP0 Register:%u "
495 "Select:%u (%s) to %#x.\n",
496 tid, idx / 8, idx % 8, miscRegNames[idx], val);
497
498 miscRegFile[idx][reg_sel] = val;
499}
500
501void
503{
504 unsigned reg_sel = (bankType[idx] == perThreadContext)
505 ? tid : getVPENum(tid);
506 DPRINTF(MipsPRA,
507 "[tid:%i] Setting CP0 Register: %u Select: %u (%s) to %#x\n",
508 tid, idx / 8, idx % 8, miscRegNames[idx], val);
509 miscRegFile_WriteMask[idx][reg_sel] = val;
510}
511
512// PROGRAMMER'S NOTES:
513// (1) Some CP0 Registers have fields that cannot
514// be overwritten. Make sure to handle those particular registers
515// with care!
516void
518{
519 int reg_sel = (bankType[idx] == perThreadContext)
520 ? tid : getVPENum(tid);
521
522 DPRINTF(MipsPRA,
523 "[tid:%i] Setting CP0 Register:%u "
524 "Select:%u (%s) to %#x, with effect.\n",
525 tid, idx / 8, idx % 8, miscRegNames[idx], val);
526
527 RegVal cp0_val = filterCP0Write(idx, reg_sel, val);
528
529 miscRegFile[idx][reg_sel] = cp0_val;
530
532}
533
539RegVal
541{
542 RegVal retVal = val;
543
544 // Mask off read-only regions
545 retVal &= miscRegFile_WriteMask[idx][reg_sel];
546 RegVal curVal = miscRegFile[idx][reg_sel];
547 // Mask off current alue with inverse mask (clear writeable bits)
548 curVal &= (~miscRegFile_WriteMask[idx][reg_sel]);
549 retVal |= curVal; // Combine the two
550 DPRINTF(MipsPRA,
551 "filterCP0Write: Mask: %lx, Inverse Mask: %lx, write Val: %x, "
552 "current val: %lx, written val: %x\n",
553 miscRegFile_WriteMask[idx][reg_sel],
554 ~miscRegFile_WriteMask[idx][reg_sel],
555 val, miscRegFile[idx][reg_sel], retVal);
556 return retVal;
557}
558
559void
561{
562 if (!cp0Updated) {
563 cp0Updated = true;
564
565 //schedule UPDATE
566 auto cp0_event = new EventFunctionWrapper(
567 [this, cpu]{ processCP0Event(cpu, UpdateCP0); },
568 "Coprocessor-0 event", true, Event::CPU_Tick_Pri);
569 cpu->schedule(cp0_event, cpu->clockEdge(delay));
570 }
571}
572
573void
575{
577 //
578 // EVALUATE CP0 STATE FOR MIPS MT
579 //
581 MVPConf0Reg mvpConf0 = readMiscRegNoEffect(misc_reg::MvpConf0);
582 ThreadID num_threads = mvpConf0.ptc + 1;
583
584 for (ThreadID tid = 0; tid < num_threads; tid++) {
585 TCStatusReg tcStatus = readMiscRegNoEffect(misc_reg::TcStatus, tid);
586 TCHaltReg tcHalt = readMiscRegNoEffect(misc_reg::TcHalt, tid);
587
588 //@todo: add vpe/mt check here thru mvpcontrol & vpecontrol regs
589 if (tcHalt.h == 1 || tcStatus.a == 0) {
590 haltThread(cpu->getContext(tid));
591 } else if (tcHalt.h == 0 && tcStatus.a == 1) {
592 restoreThread(cpu->getContext(tid));
593 }
594 }
595
596 num_threads = mvpConf0.ptc + 1;
597
598 // Toggle update flag after we finished updating
599 cp0Updated = false;
600}
601
602void
604{
605 switch (cp0EventType)
606 {
607 case UpdateCP0:
608 updateCPU(cpu);
609 break;
610 }
611}
612
613} // namespace MipsISA
614} // namespace gem5
#define DPRINTF(x,...)
Definition trace.hh:210
virtual ThreadContext * getContext(int tn)
Given a thread num get tho thread context for it.
Definition base.hh:288
ThreadContext * tc
Definition isa.hh:68
RegClasses _regClasses
Definition isa.hh:70
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.
Definition types.hh:79
void processCP0Event(BaseCPU *cpu, CP0EventType)
Process a CP0 event.
Definition isa.cc:603
ISA(const Params &p)
Definition isa.cc:113
void setMiscReg(RegIndex idx, RegVal val, ThreadID tid)
Definition isa.cc:517
std::vector< std::vector< RegVal > > miscRegFile
Definition isa.hh:75
void updateCPU(BaseCPU *cpu)
Definition isa.cc:574
RegVal readMiscRegNoEffect(RegIndex idx, ThreadID tid) const
Definition isa.cc:464
RegVal readMiscReg(RegIndex idx, ThreadID tid)
Definition isa.cc:477
unsigned getVPENum(ThreadID tid) const
Definition isa.cc:457
void setRegMask(RegIndex idx, RegVal val, ThreadID tid=0)
Definition isa.cc:502
void setMiscRegNoEffect(RegIndex idx, RegVal val, ThreadID tid)
Definition isa.cc:489
std::vector< BankType > bankType
Definition isa.hh:77
void scheduleCP0Update(BaseCPU *cpu, Cycles delay=Cycles(0))
Definition isa.cc:560
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 ...
Definition isa.cc:540
std::vector< std::vector< RegVal > > miscRegFile_WriteMask
Definition isa.hh:76
void copyRegsFrom(ThreadContext *src) override
Definition isa.cc:188
static std::string miscRegNames[misc_reg::NumRegs]
Definition isa.hh:159
void configCP()
Definition isa.cc:208
uint8_t numThreads
Definition isa.hh:65
uint8_t numVpes
Definition isa.hh:66
void clear() override
Definition isa.cc:176
MipsISAParams Params
Definition isa.hh:61
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual RegVal getReg(const RegId &reg) const
virtual void setMiscRegNoEffect(RegIndex misc_reg, RegVal val)=0
virtual BaseCPU * getCpuPtr()=0
virtual void setReg(const RegId &reg, 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.
Definition bitfield.hh:216
void schedule(Event &event, Tick when)
Definition eventq.hh:1012
static const Priority CPU_Tick_Pri
CPU ticks must come after other associated CPU events (such as writebacks).
Definition eventq.hh:207
#define panic(...)
This implements a cprintf based panic() function.
Definition logging.hh:188
ISA-specific helper functions for multithreaded execution.
constexpr RegClass matRegClass
Definition mat.hh:92
constexpr RegClass vecElemClass
Definition vec.hh:105
Bitfield< 5, 0 > status
constexpr RegClass intRegClass
Definition int.hh:173
constexpr RegClass vecPredRegClass
Definition vec.hh:109
constexpr RegClass ccRegClass
Definition cc.hh:87
constexpr RegClass miscRegClass
Definition misc.hh:2937
constexpr RegClass vecRegClass
Definition vec.hh:101
void restoreThread(TC *tc)
Definition mt.hh:152
void haltThread(TC *tc)
Definition mt.hh:133
Bitfield< 0 > p
Bitfield< 15, 8 > procId
Bitfield< 23 > k
Bitfield< 2 > i
Bitfield< 63 > val
Definition misc.hh:804
constexpr RegClass floatRegClass
Definition float.hh:143
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
uint16_t RegIndex
Definition types.hh:176
int16_t ThreadID
Thread index/ID type.
Definition types.hh:235
uint64_t RegVal
Definition types.hh:173
constexpr char CCRegClassName[]
Definition reg_class.hh:81
constexpr char VecPredRegClassName[]
Definition reg_class.hh:79
constexpr char VecRegClassName[]
Definition reg_class.hh:77
constexpr char MatRegClassName[]
Definition reg_class.hh:80
@ VecPredRegClass
Definition reg_class.hh:67
@ MatRegClass
Matrix Register.
Definition reg_class.hh:68
@ CCRegClass
Condition-code register.
Definition reg_class.hh:69
@ VecRegClass
Vector Register.
Definition reg_class.hh:64
@ VecElemClass
Vector Register Native Elem lane.
Definition reg_class.hh:66
constexpr char VecElemClassName[]
Definition reg_class.hh:78
unsigned CP0_PRId_CompanyOptions
Definition types.hh:109

Generated on Tue Jun 18 2024 16:23:57 for gem5 by doxygen 1.11.0