gem5  v22.1.0.0
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"
33 #include "arch/sparc/interrupts.hh"
34 #include "arch/sparc/regs/float.hh"
35 #include "arch/sparc/regs/int.hh"
36 #include "arch/sparc/regs/misc.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/Timer.hh"
43 #include "params/SparcISA.hh"
44 
45 namespace gem5
46 {
47 
48 namespace SparcISA
49 {
50 
51 static PSTATE
53 {
54  PSTATE mask = 0;
55  mask.ie = 1;
56  mask.priv = 1;
57  mask.am = 1;
58  mask.pef = 1;
59  mask.mm = 3;
60  mask.tle = 1;
61  mask.cle = 1;
62  mask.pid1 = 1;
63  return mask;
64 }
65 
66 static const PSTATE PstateMask = buildPstateMask();
67 
68 namespace
69 {
70 
71 /* Not applicable for SPARC */
72 RegClass vecRegClass(VecRegClass, VecRegClassName, 1, debug::IntRegs);
75  debug::IntRegs);
76 RegClass ccRegClass(CCRegClass, CCRegClassName, 0, debug::IntRegs);
77 
78 } // anonymous namespace
79 
81 {
82  _regClasses.push_back(&flatIntRegClass);
83  _regClasses.push_back(&floatRegClass);
84  _regClasses.push_back(&vecRegClass);
85  _regClasses.push_back(&vecElemClass);
86  _regClasses.push_back(&vecPredRegClass);
87  _regClasses.push_back(&ccRegClass);
88  _regClasses.push_back(&miscRegClass);
89 
90  clear();
91 }
92 
93 static void
95 {
96  uint8_t tl = src->readMiscRegNoEffect(MISCREG_TL);
97 
98  // Read all the trap level dependent registers and save them off
99  for (int i = 1; i <= MaxTL; i++) {
102 
111  }
112 
113  // Save off the traplevel
116 
117 
118  // ASRs
119 // dest->setMiscRegNoEffect(MISCREG_Y,
120 // src->readMiscRegNoEffect(MISCREG_Y));
121 // dest->setMiscRegNoEffect(MISCREG_CCR,
122 // src->readMiscRegNoEffect(MISCREG_CCR));
123  dest->setMiscReg(MISCREG_ASI,
137 
138  // Priv Registers
147  dest->setMiscReg(MISCREG_CWP,
149 // dest->setMiscRegNoEffect(MISCREG_CANSAVE,
150 // src->readMiscRegNoEffect(MISCREG_CANSAVE));
151 // dest->setMiscRegNoEffect(MISCREG_CANRESTORE,
152 // src->readMiscRegNoEffect(MISCREG_CANRESTORE));
153 // dest->setMiscRegNoEffect(MISCREG_OTHERWIN,
154 // src->readMiscRegNoEffect(MISCREG_OTHERWIN));
155 // dest->setMiscRegNoEffect(MISCREG_CLEANWIN,
156 // src->readMiscRegNoEffect(MISCREG_CLEANWIN));
157 // dest->setMiscRegNoEffect(MISCREG_WSTATE,
158 // src->readMiscRegNoEffect(MISCREG_WSTATE));
160 
161  // Hyperprivilged registers
172 
173  // FSR
176 
177  // Strand Status Register
180 
181  // MMU Registers
190 
191  // Scratchpad Registers
208 
209  // Queue Registers
226 }
227 
228 void
230 {
231  // First loop through the integer registers.
232  int old_gl = src->readMiscRegNoEffect(MISCREG_GL);
233  int old_cwp = src->readMiscRegNoEffect(MISCREG_CWP);
234  // Globals
235  for (int x = 0; x < MaxGL; ++x) {
236  src->setMiscReg(MISCREG_GL, x);
238  // Skip %g0 which is always zero.
239  for (int y = 1; y < 8; y++) {
240  RegId reg = intRegClass[y];
241  tc->setReg(reg, src->getReg(reg));
242  }
243  }
244  // Locals and ins. Outs are all also ins.
245  for (int x = 0; x < NWindows; ++x) {
246  src->setMiscReg(MISCREG_CWP, x);
248  for (int y = 16; y < 32; y++) {
249  RegId reg = intRegClass[y];
250  tc->setReg(reg, src->getReg(reg));
251  }
252  }
253  // Microcode reg and pseudo int regs (misc regs in the integer regfile).
254  for (int y = int_reg::NumArchRegs;
256  RegId reg = intRegClass[y];
257  tc->setReg(reg, src->getReg(reg));
258  }
259 
260  // Restore src's GL, CWP
261  src->setMiscReg(MISCREG_GL, old_gl);
262  src->setMiscReg(MISCREG_CWP, old_cwp);
263 
264 
265  // Then loop through the floating point registers.
266  for (int i = 0; i < SparcISA::float_reg::NumArchRegs; ++i) {
268  tc->setReg(reg, src->getReg(reg));
269  }
270 
271  // Copy misc. registers
272  copyMiscRegs(src, tc);
273 
274  // Lastly copy PC/NPC
275  tc->pcState(src->pcState());
276 }
277 
278 void
280 {
283  // Microcode registers.
284  for (int i = 0; i < int_reg::NumMicroRegs; i++)
290 }
291 
292 void
294 {
295  assert(offset >= 0 && offset + NumWindowedRegs <= int_reg::NumRegs);
296  RegIndex *mapChunk = intRegMap + offset;
297  for (int i = 0; i < NumWindowedRegs; i++)
298  mapChunk[i] = TotalGlobals +
300 }
301 
302 void
304 {
305  assert(offset >= 0 && offset + NumGlobalRegs <= int_reg::NumRegs);
306  RegIndex *mapChunk = intRegMap + offset;
307  mapChunk[0] = 0;
308  for (int i = 1; i < NumGlobalRegs; i++)
309  mapChunk[i] = i + gl * NumGlobalRegs;
310 }
311 
312 void
314 {
315  cwp = 0;
316  gl = 0;
317  reloadRegMap();
318 
319  // y = 0;
320  // ccr = 0;
321  asi = 0;
322  tick = 1ULL << 63;
323  fprs = 0;
324  gsr = 0;
325  softint = 0;
326  tick_cmpr = 0;
327  stick = 0;
328  stick_cmpr = 0;
329  memset(tpc, 0, sizeof(tpc));
330  memset(tnpc, 0, sizeof(tnpc));
331  memset(tstate, 0, sizeof(tstate));
332  memset(tt, 0, sizeof(tt));
333  tba = 0;
334  pstate = 0;
335  tl = 0;
336  pil = 0;
337  // cansave = 0;
338  // canrestore = 0;
339  // cleanwin = 0;
340  // otherwin = 0;
341  // wstate = 0;
342  // In a T1, bit 11 is apparently always 1
343  hpstate = 0;
344  hpstate.id = 1;
345  memset(htstate, 0, sizeof(htstate));
346  hintp = 0;
347  htba = 0;
348  hstick_cmpr = 0;
349  // This is set this way in Legion for some reason
350  strandStatusReg = 0x50000;
351  fsr = 0;
352 
353  priContext = 0;
354  secContext = 0;
355  partId = 0;
356  lsuCtrlReg = 0;
357 
358  memset(scratchPad, 0, sizeof(scratchPad));
359 
360  cpu_mondo_head = 0;
361  cpu_mondo_tail = 0;
362  dev_mondo_head = 0;
363  dev_mondo_tail = 0;
364  res_error_head = 0;
365  res_error_tail = 0;
366  nres_error_head = 0;
367  nres_error_tail = 0;
368 
369  // If one of these events is active, it's not obvious to me how to get
370  // rid of it cleanly. For now we'll just assert that they're not.
371  if (tickCompare != NULL && sTickCompare != NULL && hSTickCompare != NULL)
372  panic("Tick comparison event active when clearing the ISA object.\n");
373 }
374 
375 RegVal
377 {
378 
379  // The three idxs are moved up from the switch statement
380  // due to more frequent calls.
381 
382  if (idx == MISCREG_GL)
383  return gl;
384  if (idx == MISCREG_CWP)
385  return cwp;
386  if (idx == MISCREG_TLB_DATA) {
387  /* Package up all the data for the tlb:
388  * 6666555555555544444444443333333333222222222211111111110000000000
389  * 3210987654321098765432109876543210987654321098765432109876543210
390  * secContext | priContext | |tl|partid| |||||^hpriv
391  * ||||^red
392  * |||^priv
393  * ||^am
394  * |^lsuim
395  * ^lsudm
396  */
397  return (uint64_t)hpstate.hpriv |
398  (uint64_t)hpstate.red << 1 |
399  (uint64_t)pstate.priv << 2 |
400  (uint64_t)pstate.am << 3 |
401  bits((uint64_t)lsuCtrlReg,3,2) << 4 |
402  bits((uint64_t)partId,7,0) << 8 |
403  bits((uint64_t)tl,2,0) << 16 |
404  (uint64_t)priContext << 32 |
405  (uint64_t)secContext << 48;
406  }
407 
408  switch (idx) {
409  // case MISCREG_TLB_DATA:
410  // [original contents see above]
411  // case MISCREG_Y:
412  // return y;
413  // case MISCREG_CCR:
414  // return ccr;
415  case MISCREG_ASI:
416  return asi;
417  case MISCREG_FPRS:
418  return fprs;
419  case MISCREG_TICK:
420  return tick;
421  case MISCREG_PCR:
422  panic("PCR not implemented\n");
423  case MISCREG_PIC:
424  panic("PIC not implemented\n");
425  case MISCREG_GSR:
426  return gsr;
427  case MISCREG_SOFTINT:
428  return softint;
429  case MISCREG_TICK_CMPR:
430  return tick_cmpr;
431  case MISCREG_STICK:
432  return stick;
433  case MISCREG_STICK_CMPR:
434  return stick_cmpr;
435 
437  case MISCREG_TPC:
438  return tpc[tl-1];
439  case MISCREG_TNPC:
440  return tnpc[tl-1];
441  case MISCREG_TSTATE:
442  return tstate[tl-1];
443  case MISCREG_TT:
444  return tt[tl-1];
445  case MISCREG_PRIVTICK:
446  panic("Priviliged access to tick registers not implemented\n");
447  case MISCREG_TBA:
448  return tba;
449  case MISCREG_PSTATE:
450  return (RegVal)pstate;
451  case MISCREG_TL:
452  return tl;
453  case MISCREG_PIL:
454  return pil;
455  // CWP, GL moved
456  // case MISCREG_CWP:
457  // return cwp;
458  // case MISCREG_CANSAVE:
459  // return cansave;
460  // case MISCREG_CANRESTORE:
461  // return canrestore;
462  // case MISCREG_CLEANWIN:
463  // return cleanwin;
464  // case MISCREG_OTHERWIN:
465  // return otherwin;
466  // case MISCREG_WSTATE:
467  // return wstate;
468  // case MISCREG_GL:
469  // return gl;
470 
472  case MISCREG_HPSTATE:
473  return (RegVal)hpstate;
474  case MISCREG_HTSTATE:
475  return htstate[tl-1];
476  case MISCREG_HINTP:
477  return hintp;
478  case MISCREG_HTBA:
479  return htba;
481  return strandStatusReg;
482  case MISCREG_HSTICK_CMPR:
483  return hstick_cmpr;
484 
486  case MISCREG_FSR:
487  DPRINTF(MiscRegs, "FSR read as: %#x\n", fsr);
488  return fsr;
489 
491  return priContext;
493  return secContext;
494  case MISCREG_MMU_PART_ID:
495  return partId;
497  return lsuCtrlReg;
498 
500  return scratchPad[0];
502  return scratchPad[1];
504  return scratchPad[2];
506  return scratchPad[3];
508  return scratchPad[4];
510  return scratchPad[5];
512  return scratchPad[6];
514  return scratchPad[7];
516  return cpu_mondo_head;
518  return cpu_mondo_tail;
520  return dev_mondo_head;
522  return dev_mondo_tail;
524  return res_error_head;
526  return res_error_tail;
528  return nres_error_head;
530  return nres_error_tail;
531  default:
532  panic("Miscellaneous register %d not implemented\n", idx);
533  }
534 }
535 
536 RegVal
538 {
539  switch (idx) {
540  // tick and stick are aliased to each other in niagra
541  // well store the tick data in stick and the interrupt bit in tick
542  case MISCREG_STICK:
543  case MISCREG_TICK:
544  case MISCREG_PRIVTICK:
545  // I'm not sure why legion ignores the lowest two bits, but we'll go
546  // with it
547  // change from curCycle() to instCount() until we're done with legion
548  DPRINTF(Timer, "Instruction Count when TICK read: %#X stick=%#X\n",
549  tc->getCpuPtr()->instCount(), stick);
550  return mbits(tc->getCpuPtr()->instCount() + (int64_t)stick,62,2) |
551  mbits(tick,63,63);
552  case MISCREG_FPRS:
553  // in legion if fp is enabled du and dl are set
554  return fprs | 0x3;
555  case MISCREG_PCR:
556  case MISCREG_PIC:
557  panic("Performance Instrumentation not impl\n");
558  case MISCREG_SOFTINT_CLR:
559  case MISCREG_SOFTINT_SET:
560  panic("Can read from softint clr/set\n");
561  case MISCREG_SOFTINT:
562  case MISCREG_TICK_CMPR:
563  case MISCREG_STICK_CMPR:
564  case MISCREG_HINTP:
565  case MISCREG_HTSTATE:
566  case MISCREG_HTBA:
567  case MISCREG_HVER:
569  case MISCREG_HSTICK_CMPR:
578  case MISCREG_HPSTATE:
579  return readFSReg(idx);
580  }
581  return readMiscRegNoEffect(idx);
582 }
583 
584 void
586 {
587  switch (idx) {
588 // case MISCREG_Y:
589 // y = val;
590 // break;
591 // case MISCREG_CCR:
592 // ccr = val;
593 // break;
594  case MISCREG_ASI:
595  asi = val;
596  break;
597  case MISCREG_FPRS:
598  fprs = val;
599  break;
600  case MISCREG_TICK:
601  tick = val;
602  break;
603  case MISCREG_PCR:
604  panic("PCR not implemented\n");
605  case MISCREG_PIC:
606  panic("PIC not implemented\n");
607  case MISCREG_GSR:
608  gsr = val;
609  break;
610  case MISCREG_SOFTINT:
611  softint = val;
612  break;
613  case MISCREG_TICK_CMPR:
614  tick_cmpr = val;
615  break;
616  case MISCREG_STICK:
617  stick = val;
618  break;
619  case MISCREG_STICK_CMPR:
620  stick_cmpr = val;
621  break;
622 
624  case MISCREG_TPC:
625  tpc[tl-1] = val;
626  break;
627  case MISCREG_TNPC:
628  tnpc[tl-1] = val;
629  break;
630  case MISCREG_TSTATE:
631  tstate[tl-1] = val;
632  break;
633  case MISCREG_TT:
634  tt[tl-1] = val;
635  break;
636  case MISCREG_PRIVTICK:
637  panic("Priviliged access to tick regesiters not implemented\n");
638  case MISCREG_TBA:
639  // clear lower 7 bits on writes.
640  tba = val & ~0x7FFFULL;
641  break;
642  case MISCREG_PSTATE:
643  pstate = (val & PstateMask);
644  break;
645  case MISCREG_TL:
646  tl = val;
647  break;
648  case MISCREG_PIL:
649  pil = val;
650  break;
651  case MISCREG_CWP:
652  cwp = val;
653  break;
654 // case MISCREG_CANSAVE:
655 // cansave = val;
656 // break;
657 // case MISCREG_CANRESTORE:
658 // canrestore = val;
659 // break;
660 // case MISCREG_CLEANWIN:
661 // cleanwin = val;
662 // break;
663 // case MISCREG_OTHERWIN:
664 // otherwin = val;
665 // break;
666 // case MISCREG_WSTATE:
667 // wstate = val;
668 // break;
669  case MISCREG_GL:
670  gl = val;
671  break;
672 
674  case MISCREG_HPSTATE:
675  hpstate = val;
676  break;
677  case MISCREG_HTSTATE:
678  htstate[tl-1] = val;
679  break;
680  case MISCREG_HINTP:
681  hintp = val;
682  break;
683  case MISCREG_HTBA:
684  htba = val;
685  break;
688  break;
689  case MISCREG_HSTICK_CMPR:
690  hstick_cmpr = val;
691  break;
692 
694  case MISCREG_FSR:
695  fsr = val;
696  DPRINTF(MiscRegs, "FSR written with: %#x\n", fsr);
697  break;
698 
700  priContext = val;
701  break;
703  secContext = val;
704  break;
705  case MISCREG_MMU_PART_ID:
706  partId = val;
707  break;
709  lsuCtrlReg = val;
710  break;
711 
713  scratchPad[0] = val;
714  break;
716  scratchPad[1] = val;
717  break;
719  scratchPad[2] = val;
720  break;
722  scratchPad[3] = val;
723  break;
725  scratchPad[4] = val;
726  break;
728  scratchPad[5] = val;
729  break;
731  scratchPad[6] = val;
732  break;
734  scratchPad[7] = val;
735  break;
738  break;
741  break;
744  break;
747  break;
750  break;
753  break;
756  break;
759  break;
760  default:
761  panic("Miscellaneous register %d not implemented\n", idx);
762  }
763 }
764 
765 void
767 {
768  RegVal new_val = val;
769 
770  switch (idx) {
771  case MISCREG_ASI:
772  tc->getDecoderPtr()->as<Decoder>().setContext(val);
773  break;
774  case MISCREG_STICK:
775  case MISCREG_TICK:
776  // stick and tick are same thing on niagra
777  // use stick for offset and tick for holding intrrupt bit
778  stick = mbits(val,62,0) - tc->getCpuPtr()->instCount();
779  tick = mbits(val,63,63);
780  DPRINTF(Timer, "Writing TICK=%#X\n", val);
781  break;
782  case MISCREG_FPRS:
783  // Configure the fpu based on the fprs
784  break;
785  case MISCREG_PCR:
786  // Set up performance counting based on pcr value
787  break;
788  case MISCREG_PSTATE:
789  pstate = val & PstateMask;
790  return;
791  case MISCREG_TL:
792  {
793  tl = val;
794  if (hpstate.tlz && tl == 0 && !hpstate.hpriv)
796  else
798  return;
799  }
800  case MISCREG_CWP:
801  new_val = val >= NWindows ? NWindows - 1 : val;
802  if (val >= NWindows)
803  new_val = NWindows - 1;
804 
806  installWindow(new_val - 1, NextWindowOffset);
807  installWindow(new_val + 1, PreviousWindowOffset);
808  break;
809  case MISCREG_GL:
813  break;
814  case MISCREG_PIL:
815  case MISCREG_SOFTINT:
816  case MISCREG_SOFTINT_SET:
817  case MISCREG_SOFTINT_CLR:
818  case MISCREG_TICK_CMPR:
819  case MISCREG_STICK_CMPR:
820  case MISCREG_HINTP:
821  case MISCREG_HTSTATE:
822  case MISCREG_HTBA:
823  case MISCREG_HVER:
825  case MISCREG_HSTICK_CMPR:
834  case MISCREG_HPSTATE:
835  setFSReg(idx, val);
836  return;
837  }
838  setMiscRegNoEffect(idx, new_val);
839 }
840 
841 void
843 {
882 
883  Tick tick_cmp = 0, stick_cmp = 0, hstick_cmp = 0;
885  tick_cmp = tickCompare->when();
887  stick_cmp = sTickCompare->when();
889  hstick_cmp = hSTickCompare->when();
890 
891  SERIALIZE_SCALAR(tick_cmp);
892  SERIALIZE_SCALAR(stick_cmp);
893  SERIALIZE_SCALAR(hstick_cmp);
894 }
895 
896 void
898 {
912  {
913  uint16_t pstate;
915  this->pstate = pstate;
916  }
921  reloadRegMap();
922  {
923  uint64_t hpstate;
925  this->hpstate = hpstate;
926  }
946 
947  Tick tick_cmp = 0, stick_cmp = 0, hstick_cmp = 0;
948  UNSERIALIZE_SCALAR(tick_cmp);
949  UNSERIALIZE_SCALAR(stick_cmp);
950  UNSERIALIZE_SCALAR(hstick_cmp);
951 
952  if (tick_cmp) {
953  tickCompare = new TickCompareEvent(this);
954  schedule(tickCompare, tick_cmp);
955  }
956  if (stick_cmp) {
957  sTickCompare = new STickCompareEvent(this);
958  schedule(sTickCompare, stick_cmp);
959  }
960  if (hstick_cmp) {
961  hSTickCompare = new HSTickCompareEvent(this);
962  schedule(hSTickCompare, hstick_cmp);
963  }
964 }
965 
966 } // namespace SparcISA
967 } // namespace gem5
#define DPRINTF(x,...)
Definition: trace.hh:186
void postInterrupt(ThreadID tid, int int_num, int index)
Definition: base.cc:194
Tick instCount()
Definition: base.hh:217
void clearInterrupt(ThreadID tid, int int_num, int index)
Definition: base.hh:238
ThreadContext * tc
Definition: isa.hh:65
RegClasses _regClasses
Definition: isa.hh:67
Type & as()
Definition: decoder.hh:71
Register ID: describe an architectural register with its class and index.
Definition: reg_class.hh:91
void reloadRegMap()
Definition: isa.cc:279
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: isa.cc:897
void installWindow(int cwp, int offset)
Definition: isa.cc:293
static const int RegsPerWindow
Definition: isa.hh:150
uint64_t softint
Definition: isa.hh:66
ISA(const Params &p)
Definition: isa.cc:80
uint64_t dev_mondo_head
Definition: isa.hh:115
STickCompareEvent * sTickCompare
Definition: isa.hh:140
uint64_t tstate[MaxTL]
Definition: isa.hh:77
@ PreviousWindowOffset
Definition: isa.hh:161
@ CurrentGlobalsOffset
Definition: isa.hh:155
@ PreviousGlobalsOffset
Definition: isa.hh:160
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:229
static const int NumWindowedRegs
Definition: isa.hh:146
uint8_t fprs
Definition: isa.hh:64
uint64_t res_error_head
Definition: isa.hh:117
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:766
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:537
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:842
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
EventWrapper< ISA, &ISA::processSTickCompare > STickCompareEvent
Definition: isa.hh:139
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
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
uint64_t stick
Definition: isa.hh:68
uint64_t tick_cmpr
Definition: isa.hh:67
RegVal readMiscRegNoEffect(RegIndex idx) const override
Definition: isa.cc:376
uint64_t res_error_tail
Definition: isa.hh:118
uint8_t gl
Definition: isa.hh:91
uint8_t tl
Definition: isa.hh:83
uint64_t hstick_cmpr
Definition: isa.hh:98
uint64_t stick_cmpr
Definition: isa.hh:69
uint64_t tnpc[MaxTL]
Definition: isa.hh:75
EventWrapper< ISA, &ISA::processHSTickCompare > HSTickCompareEvent
Definition: isa.hh:142
uint64_t tba
Definition: isa.hh:80
void installGlobals(int gl, int offset)
Definition: isa.cc:303
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:585
void clear() override
Definition: isa.cc:313
uint64_t htstate[MaxTL]
Definition: isa.hh:95
EventWrapper< ISA, &ISA::processTickCompare > TickCompareEvent
Definition: isa.hh:136
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 const PCStateBase & pcState() const =0
virtual void setReg(const RegId &reg, RegVal val)
virtual InstDecoder * getDecoderPtr()=0
virtual BaseCPU * getCpuPtr()=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:76
constexpr T mbits(T val, unsigned first, unsigned last)
Mask off the given bits in place like bits() but without shifting.
Definition: bitfield.hh:103
constexpr uint64_t mask(unsigned nbits)
Generate a 64-bit mask of 'nbits' 1s, right justified.
Definition: bitfield.hh:63
bool scheduled() const
Determine if the current event is scheduled.
Definition: eventq.hh:465
void schedule(Event &event, Tick when)
Definition: eventq.hh:1019
Tick when() const
Get the time that the event is scheduled.
Definition: eventq.hh:508
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:178
#define UNSERIALIZE_ARRAY(member, size)
Definition: serialize.hh:618
#define SERIALIZE_ARRAY(member, size)
Definition: serialize.hh:610
constexpr RegClass ccRegClass(CCRegClass, CCRegClassName, cc_reg::NumRegs, debug::CCRegs)
Bitfield< 7 > i
Definition: misc_types.hh:67
Bitfield< 23, 0 > offset
Definition: types.hh:144
constexpr RegClass vecElemClass
Definition: vec.hh:105
constexpr RegClass vecPredRegClass
Definition: vec.hh:109
constexpr RegClass vecRegClass
Definition: vec.hh:101
Bitfield< 23, 20 > tl
const int NumArchRegs
Definition: float.hh:45
const int NumRegs
Definition: int.hh:67
static PSTATE buildPstateMask()
Definition: isa.cc:52
static void copyMiscRegs(ThreadContext *src, ThreadContext *dest)
Definition: isa.cc:94
@ MISCREG_MMU_PART_ID
Definition: misc.hh:93
@ MISCREG_SOFTINT_CLR
Definition: misc.hh:54
@ MISCREG_HTBA
Definition: misc.hh:82
@ MISCREG_CWP
Definition: misc.hh:70
@ 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_PIC
Definition: misc.hh:51
@ MISCREG_PSTATE
Definition: misc.hh:67
@ MISCREG_MMU_P_CONTEXT
MMU Internal Registers.
Definition: misc.hh:91
@ MISCREG_FPRS
Definition: misc.hh:49
@ MISCREG_QUEUE_DEV_MONDO_TAIL
Definition: misc.hh:110
@ MISCREG_PCR
Definition: misc.hh:50
@ MISCREG_TT
Definition: misc.hh:64
@ MISCREG_TICK
Definition: misc.hh:48
@ 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_PIL
Definition: misc.hh:69
@ 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_TL
Definition: misc.hh:68
@ 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_GL
Definition: misc.hh:76
@ MISCREG_TNPC
Definition: misc.hh:62
@ MISCREG_QUEUE_DEV_MONDO_HEAD
Definition: misc.hh:109
@ MISCREG_STRAND_STS_REG
Definition: misc.hh:84
@ MISCREG_TBA
Definition: misc.hh:66
@ MISCREG_FSR
Floating Point Status Register.
Definition: misc.hh:88
@ MISCREG_SOFTINT
Definition: misc.hh:55
@ MISCREG_SCRATCHPAD_R2
Definition: misc.hh:99
@ MISCREG_GSR
Definition: misc.hh:52
@ MISCREG_HVER
Definition: misc.hh:83
@ 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
Definition: sparc_traits.hh:44
constexpr RegClass floatRegClass(FloatRegClass, FloatRegClassName, float_reg::NumRegs, debug::FloatRegs)
static const PSTATE PstateMask
Definition: isa.cc:66
constexpr RegClass miscRegClass(MiscRegClass, MiscRegClassName, NumMiscRegs, debug::MiscRegs)
const int MaxGL
Definition: sparc_traits.hh:40
const int MaxTL
Definition: sparc_traits.hh:39
Bitfield< 4 > x
Definition: pagetable.hh:61
Bitfield< 54 > p
Definition: pagetable.hh:70
Bitfield< 5, 3 > reg
Definition: types.hh:92
Bitfield< 63 > val
Definition: misc.hh:776
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
constexpr char CCRegClassName[]
Definition: reg_class.hh:78
uint16_t RegIndex
Definition: types.hh:176
constexpr char VecPredRegClassName[]
Definition: reg_class.hh:77
std::ostream CheckpointOut
Definition: serialize.hh:66
constexpr char VecRegClassName[]
Definition: reg_class.hh:75
uint64_t Tick
Tick count type.
Definition: types.hh:58
uint64_t RegVal
Definition: types.hh:173
@ VecPredRegClass
Definition: reg_class.hh:66
@ CCRegClass
Condition-code register.
Definition: reg_class.hh:67
@ VecRegClass
Vector Register.
Definition: reg_class.hh:63
@ VecElemClass
Vector Register Native Elem lane.
Definition: reg_class.hh:65
constexpr char VecElemClassName[]
Definition: reg_class.hh:76
#define UNSERIALIZE_SCALAR(scalar)
Definition: serialize.hh:575
#define SERIALIZE_SCALAR(scalar)
Definition: serialize.hh:568

Generated on Wed Dec 21 2022 10:22:23 for gem5 by doxygen 1.9.1