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/sparc/isa.hh"
30
31#include "arch/sparc/asi.hh"
32#include "arch/sparc/decoder.hh"
38#include "base/bitfield.hh"
39#include "base/trace.hh"
40#include "cpu/base.hh"
41#include "cpu/thread_context.hh"
42#include "debug/MatRegs.hh"
43#include "debug/Timer.hh"
44#include "params/SparcISA.hh"
45
46namespace gem5
47{
48
49namespace SparcISA
50{
51
52static PSTATE
54{
55 PSTATE mask = 0;
56 mask.ie = 1;
57 mask.priv = 1;
58 mask.am = 1;
59 mask.pef = 1;
60 mask.mm = 3;
61 mask.tle = 1;
62 mask.cle = 1;
63 mask.pid1 = 1;
64 return mask;
65}
66
67static const PSTATE PstateMask = buildPstateMask();
68
69namespace
70{
71
72/* Not applicable for SPARC */
76 debug::IntRegs);
78RegClass ccRegClass(CCRegClass, CCRegClassName, 0, debug::IntRegs);
79
80} // anonymous namespace
81
82ISA::ISA(const Params &p) : BaseISA(p, "sparc")
83{
84 _regClasses.push_back(&flatIntRegClass);
85 _regClasses.push_back(&floatRegClass);
86 _regClasses.push_back(&vecRegClass);
87 _regClasses.push_back(&vecElemClass);
88 _regClasses.push_back(&vecPredRegClass);
89 _regClasses.push_back(&matRegClass);
90 _regClasses.push_back(&ccRegClass);
91 _regClasses.push_back(&miscRegClass);
92
93 clear();
94}
95
96static void
98{
99 uint8_t tl = src->readMiscRegNoEffect(MISCREG_TL);
100
101 // Read all the trap level dependent registers and save them off
102 for (int i = 1; i <= MaxTL; i++) {
105
114 }
115
116 // Save off the traplevel
119
120
121 // ASRs
122// dest->setMiscRegNoEffect(MISCREG_Y,
123// src->readMiscRegNoEffect(MISCREG_Y));
124// dest->setMiscRegNoEffect(MISCREG_CCR,
125// src->readMiscRegNoEffect(MISCREG_CCR));
140
141 // Priv Registers
152// dest->setMiscRegNoEffect(MISCREG_CANSAVE,
153// src->readMiscRegNoEffect(MISCREG_CANSAVE));
154// dest->setMiscRegNoEffect(MISCREG_CANRESTORE,
155// src->readMiscRegNoEffect(MISCREG_CANRESTORE));
156// dest->setMiscRegNoEffect(MISCREG_OTHERWIN,
157// src->readMiscRegNoEffect(MISCREG_OTHERWIN));
158// dest->setMiscRegNoEffect(MISCREG_CLEANWIN,
159// src->readMiscRegNoEffect(MISCREG_CLEANWIN));
160// dest->setMiscRegNoEffect(MISCREG_WSTATE,
161// src->readMiscRegNoEffect(MISCREG_WSTATE));
163
164 // Hyperprivilged registers
175
176 // FSR
179
180 // Strand Status Register
183
184 // MMU Registers
193
194 // Scratchpad Registers
211
212 // Queue Registers
229}
230
231void
233{
234 // First loop through the integer registers.
235 int old_gl = src->readMiscRegNoEffect(MISCREG_GL);
236 int old_cwp = src->readMiscRegNoEffect(MISCREG_CWP);
237 // Globals
238 for (int x = 0; x < MaxGL; ++x) {
239 src->setMiscReg(MISCREG_GL, x);
241 // Skip %g0 which is always zero.
242 for (int y = 1; y < 8; y++) {
243 RegId reg = intRegClass[y];
244 tc->setReg(reg, src->getReg(reg));
245 }
246 }
247 // Locals and ins. Outs are all also ins.
248 for (int x = 0; x < NWindows; ++x) {
249 src->setMiscReg(MISCREG_CWP, x);
251 for (int y = 16; y < 32; y++) {
252 RegId reg = intRegClass[y];
253 tc->setReg(reg, src->getReg(reg));
254 }
255 }
256 // Microcode reg and pseudo int regs (misc regs in the integer regfile).
257 for (int y = int_reg::NumArchRegs;
259 RegId reg = intRegClass[y];
260 tc->setReg(reg, src->getReg(reg));
261 }
262
263 // Restore src's GL, CWP
264 src->setMiscReg(MISCREG_GL, old_gl);
265 src->setMiscReg(MISCREG_CWP, old_cwp);
266
267
268 // Then loop through the floating point registers.
269 for (int i = 0; i < SparcISA::float_reg::NumArchRegs; ++i) {
271 tc->setReg(reg, src->getReg(reg));
272 }
273
274 // Copy misc. registers
275 copyMiscRegs(src, tc);
276
277 // Lastly copy PC/NPC
278 tc->pcState(src->pcState());
279}
280
281void
294
295void
297{
298 assert(offset >= 0 && offset + NumWindowedRegs <= int_reg::NumRegs);
299 RegIndex *mapChunk = intRegMap + offset;
300 for (int i = 0; i < NumWindowedRegs; i++)
301 mapChunk[i] = TotalGlobals +
303}
304
305void
307{
308 assert(offset >= 0 && offset + NumGlobalRegs <= int_reg::NumRegs);
309 RegIndex *mapChunk = intRegMap + offset;
310 mapChunk[0] = 0;
311 for (int i = 1; i < NumGlobalRegs; i++)
312 mapChunk[i] = i + gl * NumGlobalRegs;
313}
314
315void
317{
318 cwp = 0;
319 gl = 0;
320 reloadRegMap();
321
322 // y = 0;
323 // ccr = 0;
324 asi = 0;
325 tick = 1ULL << 63;
326 fprs = 0;
327 gsr = 0;
328 softint = 0;
329 tick_cmpr = 0;
330 stick = 0;
331 stick_cmpr = 0;
332 memset(tpc, 0, sizeof(tpc));
333 memset(tnpc, 0, sizeof(tnpc));
334 memset(tstate, 0, sizeof(tstate));
335 memset(tt, 0, sizeof(tt));
336 tba = 0;
337 pstate = 0;
338 tl = 0;
339 pil = 0;
340 // cansave = 0;
341 // canrestore = 0;
342 // cleanwin = 0;
343 // otherwin = 0;
344 // wstate = 0;
345 // In a T1, bit 11 is apparently always 1
346 hpstate = 0;
347 hpstate.id = 1;
348 memset(htstate, 0, sizeof(htstate));
349 hintp = 0;
350 htba = 0;
351 hstick_cmpr = 0;
352 // This is set this way in Legion for some reason
353 strandStatusReg = 0x50000;
354 fsr = 0;
355
356 priContext = 0;
357 secContext = 0;
358 partId = 0;
359 lsuCtrlReg = 0;
360
361 memset(scratchPad, 0, sizeof(scratchPad));
362
363 cpu_mondo_head = 0;
364 cpu_mondo_tail = 0;
365 dev_mondo_head = 0;
366 dev_mondo_tail = 0;
367 res_error_head = 0;
368 res_error_tail = 0;
369 nres_error_head = 0;
370 nres_error_tail = 0;
371
372 // If one of these events is active, it's not obvious to me how to get
373 // rid of it cleanly. For now we'll just assert that they're not.
374 if (tickCompare != NULL && sTickCompare != NULL && hSTickCompare != NULL)
375 panic("Tick comparison event active when clearing the ISA object.\n");
376}
377
378RegVal
380{
381
382 // The three idxs are moved up from the switch statement
383 // due to more frequent calls.
384
385 if (idx == MISCREG_GL)
386 return gl;
387 if (idx == MISCREG_CWP)
388 return cwp;
389 if (idx == MISCREG_TLB_DATA) {
390 /* Package up all the data for the tlb:
391 * 6666555555555544444444443333333333222222222211111111110000000000
392 * 3210987654321098765432109876543210987654321098765432109876543210
393 * secContext | priContext | |tl|partid| |||||^hpriv
394 * ||||^red
395 * |||^priv
396 * ||^am
397 * |^lsuim
398 * ^lsudm
399 */
400 return (uint64_t)hpstate.hpriv |
401 (uint64_t)hpstate.red << 1 |
402 (uint64_t)pstate.priv << 2 |
403 (uint64_t)pstate.am << 3 |
404 bits((uint64_t)lsuCtrlReg,3,2) << 4 |
405 bits((uint64_t)partId,7,0) << 8 |
406 bits((uint64_t)tl,2,0) << 16 |
407 (uint64_t)priContext << 32 |
408 (uint64_t)secContext << 48;
409 }
410
411 switch (idx) {
412 // case MISCREG_TLB_DATA:
413 // [original contents see above]
414 // case MISCREG_Y:
415 // return y;
416 // case MISCREG_CCR:
417 // return ccr;
418 case MISCREG_ASI:
419 return asi;
420 case MISCREG_FPRS:
421 return fprs;
422 case MISCREG_TICK:
423 return tick;
424 case MISCREG_PCR:
425 panic("PCR not implemented\n");
426 case MISCREG_PIC:
427 panic("PIC not implemented\n");
428 case MISCREG_GSR:
429 return gsr;
430 case MISCREG_SOFTINT:
431 return softint;
433 return tick_cmpr;
434 case MISCREG_STICK:
435 return stick;
437 return stick_cmpr;
438
440 case MISCREG_TPC:
441 return tpc[tl-1];
442 case MISCREG_TNPC:
443 return tnpc[tl-1];
444 case MISCREG_TSTATE:
445 return tstate[tl-1];
446 case MISCREG_TT:
447 return tt[tl-1];
448 case MISCREG_PRIVTICK:
449 panic("Priviliged access to tick registers not implemented\n");
450 case MISCREG_TBA:
451 return tba;
452 case MISCREG_PSTATE:
453 return (RegVal)pstate;
454 case MISCREG_TL:
455 return tl;
456 case MISCREG_PIL:
457 return pil;
458 // CWP, GL moved
459 // case MISCREG_CWP:
460 // return cwp;
461 // case MISCREG_CANSAVE:
462 // return cansave;
463 // case MISCREG_CANRESTORE:
464 // return canrestore;
465 // case MISCREG_CLEANWIN:
466 // return cleanwin;
467 // case MISCREG_OTHERWIN:
468 // return otherwin;
469 // case MISCREG_WSTATE:
470 // return wstate;
471 // case MISCREG_GL:
472 // return gl;
473
475 case MISCREG_HPSTATE:
476 return (RegVal)hpstate;
477 case MISCREG_HTSTATE:
478 return htstate[tl-1];
479 case MISCREG_HINTP:
480 return hintp;
481 case MISCREG_HTBA:
482 return htba;
484 return strandStatusReg;
486 return hstick_cmpr;
487
489 case MISCREG_FSR:
490 DPRINTF(MiscRegs, "FSR read as: %#x\n", fsr);
491 return fsr;
492
494 return priContext;
496 return secContext;
498 return partId;
500 return lsuCtrlReg;
501
503 return scratchPad[0];
505 return scratchPad[1];
507 return scratchPad[2];
509 return scratchPad[3];
511 return scratchPad[4];
513 return scratchPad[5];
515 return scratchPad[6];
517 return scratchPad[7];
519 return cpu_mondo_head;
521 return cpu_mondo_tail;
523 return dev_mondo_head;
525 return dev_mondo_tail;
527 return res_error_head;
529 return res_error_tail;
531 return nres_error_head;
533 return nres_error_tail;
534 default:
535 panic("Miscellaneous register %d not implemented\n", idx);
536 }
537}
538
539RegVal
541{
542 switch (idx) {
543 // tick and stick are aliased to each other in niagra
544 // well store the tick data in stick and the interrupt bit in tick
545 case MISCREG_STICK:
546 case MISCREG_TICK:
547 case MISCREG_PRIVTICK:
548 // I'm not sure why legion ignores the lowest two bits, but we'll go
549 // with it
550 // change from curCycle() to instCount() until we're done with legion
551 DPRINTF(Timer, "Instruction Count when TICK read: %#X stick=%#X\n",
552 tc->getCpuPtr()->instCount(), stick);
553 return mbits(tc->getCpuPtr()->instCount() + (int64_t)stick,62,2) |
554 mbits(tick,63,63);
555 case MISCREG_FPRS:
556 // in legion if fp is enabled du and dl are set
557 return fprs | 0x3;
558 case MISCREG_PCR:
559 case MISCREG_PIC:
560 panic("Performance Instrumentation not impl\n");
563 panic("Can read from softint clr/set\n");
564 case MISCREG_SOFTINT:
567 case MISCREG_HINTP:
568 case MISCREG_HTSTATE:
569 case MISCREG_HTBA:
570 case MISCREG_HVER:
581 case MISCREG_HPSTATE:
582 return readFSReg(idx);
583 }
584 return readMiscRegNoEffect(idx);
585}
586
587void
589{
590 switch (idx) {
591// case MISCREG_Y:
592// y = val;
593// break;
594// case MISCREG_CCR:
595// ccr = val;
596// break;
597 case MISCREG_ASI:
598 asi = val;
599 break;
600 case MISCREG_FPRS:
601 fprs = val;
602 break;
603 case MISCREG_TICK:
604 tick = val;
605 break;
606 case MISCREG_PCR:
607 panic("PCR not implemented\n");
608 case MISCREG_PIC:
609 panic("PIC not implemented\n");
610 case MISCREG_GSR:
611 gsr = val;
612 break;
613 case MISCREG_SOFTINT:
614 softint = val;
615 break;
617 tick_cmpr = val;
618 break;
619 case MISCREG_STICK:
620 stick = val;
621 break;
623 stick_cmpr = val;
624 break;
625
627 case MISCREG_TPC:
628 tpc[tl-1] = val;
629 break;
630 case MISCREG_TNPC:
631 tnpc[tl-1] = val;
632 break;
633 case MISCREG_TSTATE:
634 tstate[tl-1] = val;
635 break;
636 case MISCREG_TT:
637 tt[tl-1] = val;
638 break;
639 case MISCREG_PRIVTICK:
640 panic("Priviliged access to tick regesiters not implemented\n");
641 case MISCREG_TBA:
642 // clear lower 7 bits on writes.
643 tba = val & ~0x7FFFULL;
644 break;
645 case MISCREG_PSTATE:
646 pstate = (val & PstateMask);
647 break;
648 case MISCREG_TL:
649 tl = val;
650 break;
651 case MISCREG_PIL:
652 pil = val;
653 break;
654 case MISCREG_CWP:
655 cwp = val;
656 break;
657// case MISCREG_CANSAVE:
658// cansave = val;
659// break;
660// case MISCREG_CANRESTORE:
661// canrestore = val;
662// break;
663// case MISCREG_CLEANWIN:
664// cleanwin = val;
665// break;
666// case MISCREG_OTHERWIN:
667// otherwin = val;
668// break;
669// case MISCREG_WSTATE:
670// wstate = val;
671// break;
672 case MISCREG_GL:
673 gl = val;
674 break;
675
677 case MISCREG_HPSTATE:
678 hpstate = val;
679 break;
680 case MISCREG_HTSTATE:
681 htstate[tl-1] = val;
682 break;
683 case MISCREG_HINTP:
684 hintp = val;
685 break;
686 case MISCREG_HTBA:
687 htba = val;
688 break;
691 break;
694 break;
695
697 case MISCREG_FSR:
698 fsr = val;
699 DPRINTF(MiscRegs, "FSR written with: %#x\n", fsr);
700 break;
701
703 priContext = val;
704 break;
706 secContext = val;
707 break;
709 partId = val;
710 break;
712 lsuCtrlReg = val;
713 break;
714
716 scratchPad[0] = val;
717 break;
719 scratchPad[1] = val;
720 break;
722 scratchPad[2] = val;
723 break;
725 scratchPad[3] = val;
726 break;
728 scratchPad[4] = val;
729 break;
731 scratchPad[5] = val;
732 break;
734 scratchPad[6] = val;
735 break;
737 scratchPad[7] = val;
738 break;
741 break;
744 break;
747 break;
750 break;
753 break;
756 break;
759 break;
762 break;
763 default:
764 panic("Miscellaneous register %d not implemented\n", idx);
765 }
766}
767
768void
770{
771 RegVal new_val = val;
772
773 switch (idx) {
774 case MISCREG_ASI:
775 tc->getDecoderPtr()->as<Decoder>().setContext(val);
776 break;
777 case MISCREG_STICK:
778 case MISCREG_TICK:
779 // stick and tick are same thing on niagra
780 // use stick for offset and tick for holding intrrupt bit
781 stick = mbits(val,62,0) - tc->getCpuPtr()->instCount();
782 tick = mbits(val,63,63);
783 DPRINTF(Timer, "Writing TICK=%#X\n", val);
784 break;
785 case MISCREG_FPRS:
786 // Configure the fpu based on the fprs
787 break;
788 case MISCREG_PCR:
789 // Set up performance counting based on pcr value
790 break;
791 case MISCREG_PSTATE:
793 return;
794 case MISCREG_TL:
795 {
796 tl = val;
797 if (hpstate.tlz && tl == 0 && !hpstate.hpriv)
799 else
801 return;
802 }
803 case MISCREG_CWP:
804 new_val = val >= NWindows ? NWindows - 1 : val;
805 if (val >= NWindows)
806 new_val = NWindows - 1;
807
809 installWindow(new_val - 1, NextWindowOffset);
811 break;
812 case MISCREG_GL:
816 break;
817 case MISCREG_PIL:
818 case MISCREG_SOFTINT:
823 case MISCREG_HINTP:
824 case MISCREG_HTSTATE:
825 case MISCREG_HTBA:
826 case MISCREG_HVER:
837 case MISCREG_HPSTATE:
838 setFSReg(idx, val);
839 return;
840 }
841 setMiscRegNoEffect(idx, new_val);
842}
843
844void
846{
848
887
888 Tick tick_cmp = 0, stick_cmp = 0, hstick_cmp = 0;
890 tick_cmp = tickCompare->when();
892 stick_cmp = sTickCompare->when();
894 hstick_cmp = hSTickCompare->when();
895
896 SERIALIZE_SCALAR(tick_cmp);
897 SERIALIZE_SCALAR(stick_cmp);
898 SERIALIZE_SCALAR(hstick_cmp);
899}
900
901void
903{
917 {
918 uint16_t pstate;
920 this->pstate = pstate;
921 }
926 reloadRegMap();
927 {
928 uint64_t hpstate;
930 this->hpstate = hpstate;
931 }
951
952 Tick tick_cmp = 0, stick_cmp = 0, hstick_cmp = 0;
953 UNSERIALIZE_SCALAR(tick_cmp);
954 UNSERIALIZE_SCALAR(stick_cmp);
955 UNSERIALIZE_SCALAR(hstick_cmp);
956
957 if (tick_cmp) {
958 tickCompare = new TickCompareEvent(*this);
959 schedule(tickCompare, tick_cmp);
960 }
961 if (stick_cmp) {
962 sTickCompare = new STickCompareEvent(*this);
963 schedule(sTickCompare, stick_cmp);
964 }
965 if (hstick_cmp) {
967 schedule(hSTickCompare, hstick_cmp);
968 }
969}
970
971} // namespace SparcISA
972} // namespace gem5
#define DPRINTF(x,...)
Definition trace.hh:210
void postInterrupt(ThreadID tid, int int_num, int index)
Definition base.cc:231
Tick instCount()
Definition base.hh:221
void clearInterrupt(ThreadID tid, int int_num, int index)
Definition base.hh:242
ThreadContext * tc
Definition isa.hh:68
RegClasses _regClasses
Definition isa.hh:70
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition isa.hh:136
Register ID: describe an architectural register with its class and index.
Definition reg_class.hh:94
void reloadRegMap()
Definition isa.cc:282
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition isa.cc:902
void installWindow(int cwp, int offset)
Definition isa.cc:296
static const int RegsPerWindow
Definition isa.hh:150
uint64_t softint
Definition isa.hh:66
ISA(const Params &p)
Definition isa.cc:82
uint64_t dev_mondo_head
Definition isa.hh:115
STickCompareEvent * sTickCompare
Definition isa.hh:140
uint64_t tstate[MaxTL]
Definition isa.hh:77
uint64_t cpu_mondo_head
Definition isa.hh:113
uint16_t priContext
MMU Internal Registers.
Definition isa.hh:106
void copyRegsFrom(ThreadContext *src) override
Definition isa.cc:232
static const int NumWindowedRegs
Definition isa.hh:146
uint8_t fprs
Definition isa.hh:64
uint64_t res_error_head
Definition isa.hh:117
MemberEventWrapper<&ISA::processSTickCompare > STickCompareEvent
Definition isa.hh:139
uint64_t fsr
Floating point misc registers.
Definition isa.hh:103
static const int TotalGlobals
Definition isa.hh:149
void setMiscReg(RegIndex idx, RegVal val) override
Definition isa.cc:769
TickCompareEvent * tickCompare
Definition isa.hh:137
uint8_t asi
Definition isa.hh:62
uint8_t pil
Definition isa.hh:84
RegVal readMiscReg(RegIndex idx) override
Definition isa.cc:540
SparcISAParams Params
Definition isa.hh:203
RegIndex intRegMap[TotalInstIntRegs]
Definition isa.hh:165
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition isa.cc:845
uint64_t strandStatusReg
Definition isa.hh:100
uint64_t tick
Definition isa.hh:63
uint64_t dev_mondo_tail
Definition isa.hh:116
uint64_t scratchPad[8]
Definition isa.hh:111
HSTickCompareEvent * hSTickCompare
Definition isa.hh:143
uint16_t partId
Definition isa.hh:108
uint64_t cpu_mondo_tail
Definition isa.hh:114
static const int TotalWindowed
Definition isa.hh:151
uint8_t cwp
Definition isa.hh:85
uint16_t tt[MaxTL]
Definition isa.hh:78
uint64_t gsr
Definition isa.hh:65
uint64_t hintp
Definition isa.hh:96
HPSTATE hpstate
Hyperprivileged Registers.
Definition isa.hh:94
static const int NumGlobalRegs
Definition isa.hh:145
uint64_t nres_error_head
Definition isa.hh:119
uint64_t tpc[MaxTL]
Definition isa.hh:73
MemberEventWrapper<&ISA::processHSTickCompare > HSTickCompareEvent
Definition isa.hh:142
uint64_t htba
Definition isa.hh:97
void setFSReg(int miscReg, RegVal val)
Definition ua2005.cc:92
uint64_t nres_error_tail
Definition isa.hh:120
PSTATE pstate
Definition isa.hh:82
MemberEventWrapper<&ISA::processTickCompare > TickCompareEvent
Definition isa.hh:136
uint64_t stick
Definition isa.hh:68
uint64_t tick_cmpr
Definition isa.hh:67
RegVal readMiscRegNoEffect(RegIndex idx) const override
Definition isa.cc:379
uint64_t res_error_tail
Definition isa.hh:118
uint64_t hstick_cmpr
Definition isa.hh:98
uint64_t stick_cmpr
Definition isa.hh:69
uint64_t tnpc[MaxTL]
Definition isa.hh:75
uint64_t tba
Definition isa.hh:80
void installGlobals(int gl, int offset)
Definition isa.cc:306
uint16_t secContext
Definition isa.hh:107
uint64_t lsuCtrlReg
Definition isa.hh:109
RegVal readFSReg(int miscReg)
Definition ua2005.cc:248
void setMiscRegNoEffect(RegIndex idx, RegVal val) override
Definition isa.cc:588
void clear() override
Definition isa.cc:316
uint64_t htstate[MaxTL]
Definition isa.hh:95
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual void setMiscReg(RegIndex misc_reg, RegVal val)=0
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 InstDecoder * getDecoderPtr()=0
virtual const PCStateBase & pcState() const =0
virtual RegVal readMiscRegNoEffect(RegIndex misc_reg) const =0
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
Definition bitfield.hh:79
constexpr T mbits(T val, unsigned first, unsigned last)
Mask off the given bits in place like bits() but without shifting.
Definition bitfield.hh:106
bool scheduled() const
Determine if the current event is scheduled.
Definition eventq.hh:458
void schedule(Event &event, Tick when)
Definition eventq.hh:1012
Tick when() const
Get the time that the event is scheduled.
Definition eventq.hh:501
#define panic(...)
This implements a cprintf based panic() function.
Definition logging.hh:188
#define UNSERIALIZE_ARRAY(member, size)
Definition serialize.hh:618
#define SERIALIZE_ARRAY(member, size)
Definition serialize.hh:610
Bitfield< 3, 0 > mask
Definition pcstate.hh:63
Bitfield< 7 > i
Definition misc_types.hh:67
constexpr RegClass matRegClass
Definition mat.hh:92
Bitfield< 23, 0 > offset
Definition types.hh:144
constexpr RegClass vecElemClass
Definition vec.hh:105
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
Bitfield< 23, 20 > tl
Bitfield< 0 > p
Bitfield< 3 > x
Definition pagetable.hh:73
const int NumRegs
Definition int.hh:67
static PSTATE buildPstateMask()
Definition isa.cc:53
static void copyMiscRegs(ThreadContext *src, ThreadContext *dest)
Definition isa.cc:97
@ MISCREG_MMU_PART_ID
Definition misc.hh:93
@ MISCREG_SOFTINT_CLR
Definition misc.hh:54
@ MISCREG_SCRATCHPAD_R1
Definition misc.hh:98
@ MISCREG_QUEUE_RES_ERROR_HEAD
Definition misc.hh:111
@ MISCREG_SCRATCHPAD_R5
Definition misc.hh:102
@ MISCREG_HPSTATE
Hyper privileged registers.
Definition misc.hh:79
@ MISCREG_SCRATCHPAD_R3
Definition misc.hh:100
@ MISCREG_SCRATCHPAD_R0
Scratchpad regiscers.
Definition misc.hh:97
@ MISCREG_PSTATE
Definition misc.hh:67
@ MISCREG_MMU_P_CONTEXT
MMU Internal Registers.
Definition misc.hh:91
@ MISCREG_QUEUE_DEV_MONDO_TAIL
Definition misc.hh:110
@ MISCREG_QUEUE_CPU_MONDO_HEAD
Definition misc.hh:107
@ MISCREG_STICK_CMPR
Definition misc.hh:58
@ MISCREG_TLB_DATA
Definition misc.hh:117
@ MISCREG_QUEUE_NRES_ERROR_TAIL
Definition misc.hh:114
@ MISCREG_TICK_CMPR
Definition misc.hh:56
@ MISCREG_HTSTATE
Definition misc.hh:80
@ MISCREG_TSTATE
Definition misc.hh:63
@ MISCREG_MMU_LSU_CTRL
Definition misc.hh:94
@ MISCREG_ASI
Ancillary State Registers.
Definition misc.hh:47
@ MISCREG_HINTP
Definition misc.hh:81
@ MISCREG_SCRATCHPAD_R6
Definition misc.hh:103
@ MISCREG_SCRATCHPAD_R4
Definition misc.hh:101
@ MISCREG_HSTICK_CMPR
Definition misc.hh:85
@ MISCREG_PRIVTICK
Definition misc.hh:65
@ MISCREG_QUEUE_CPU_MONDO_TAIL
Definition misc.hh:108
@ MISCREG_SOFTINT_SET
Definition misc.hh:53
@ MISCREG_QUEUE_DEV_MONDO_HEAD
Definition misc.hh:109
@ MISCREG_STRAND_STS_REG
Definition misc.hh:84
@ MISCREG_FSR
Floating Point Status Register.
Definition misc.hh:88
@ MISCREG_SOFTINT
Definition misc.hh:55
@ MISCREG_SCRATCHPAD_R2
Definition misc.hh:99
@ MISCREG_STICK
Definition misc.hh:57
@ MISCREG_TPC
Privilged Registers.
Definition misc.hh:61
@ MISCREG_QUEUE_RES_ERROR_TAIL
Definition misc.hh:112
@ MISCREG_MMU_S_CONTEXT
Definition misc.hh:92
@ MISCREG_SCRATCHPAD_R7
Definition misc.hh:104
@ MISCREG_QUEUE_NRES_ERROR_HEAD
Definition misc.hh:113
constexpr RegClass flatIntRegClass
Definition int.hh:83
constexpr RegClass intRegClass
Definition int.hh:78
const int NWindows
static const PSTATE PstateMask
Definition isa.cc:67
const int MaxGL
const int MaxTL
Bitfield< 5, 3 > reg
Definition types.hh:92
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
uint64_t RegVal
Definition types.hh:173
constexpr char CCRegClassName[]
Definition reg_class.hh:81
constexpr char VecPredRegClassName[]
Definition reg_class.hh:79
std::ostream CheckpointOut
Definition serialize.hh:66
constexpr char VecRegClassName[]
Definition reg_class.hh:77
uint64_t Tick
Tick count type.
Definition types.hh:58
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
#define UNSERIALIZE_SCALAR(scalar)
Definition serialize.hh:575
#define SERIALIZE_SCALAR(scalar)
Definition serialize.hh:568

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