54 {
"power_on_reset", 0x001, 0, {
H,
H, H},
FaultStat()};
58 {
"watch_dog_reset", 0x002, 120, {
H,
H, H},
FaultStat()};
62 {
"externally_initiated_reset", 0x003, 110, {
H,
H, H},
FaultStat()};
66 {
"software_initiated_reset", 0x004, 130, {
SH,
SH,
H},
FaultStat()};
70 {
"RED_state_exception", 0x005, 1, {
H,
H, H},
FaultStat()};
74 {
"store_error", 0x007, 201, {
H,
H, H},
FaultStat()};
78 {
"instruction_access_exception", 0x008, 300, {
H,
H, H},
FaultStat()};
87 {
"instruction_access_error", 0x00A, 400, {
H,
H, H},
FaultStat()};
91 {
"illegal_instruction", 0x010, 620, {
H,
H, H},
FaultStat()};
95 {
"privileged_opcode", 0x011, 700, {P,
SH, SH},
FaultStat()};
109 {
"fp_disabled", 0x020, 800, {P, P,
H},
FaultStat()};
113 {
"fp_exception_ieee_754", 0x021, 1110, {P, P,
H},
FaultStat()};
117 {
"fp_exception_other", 0x022, 1110, {P, P,
H},
FaultStat()};
121 {
"tag_overflow", 0x023, 1400, {P, P,
H},
FaultStat()};
125 {
"clean_window", 0x024, 1010, {P, P,
H},
FaultStat()};
129 {
"division_by_zero", 0x028, 1500, {P, P,
H},
FaultStat()};
133 {
"internal_processor_error", 0x029, 4, {
H,
H, H},
FaultStat()};
137 {
"instruction_invalid_tsb_entry", 0x02A, 210, {
H,
H,
SH},
FaultStat()};
141 {
"data_invalid_tsb_entry", 0x02B, 1203, {
H,
H, H},
FaultStat()};
145 {
"data_access_exception", 0x030, 1201, {
H,
H, H},
FaultStat()};
154 {
"data_access_error", 0x032, 1210, {
H,
H, H},
FaultStat()};
158 {
"data_access_protection", 0x033, 1207, {
H,
H, H},
FaultStat()};
162 {
"mem_address_not_aligned", 0x034, 1020, {
H,
H, H},
FaultStat()};
166 {
"LDDF_mem_address_not_aligned", 0x035, 1010, {
H,
H, H},
FaultStat()};
170 {
"STDF_mem_address_not_aligned", 0x036, 1010, {
H,
H, H},
FaultStat()};
178 {
"LDQF_mem_address_not_aligned", 0x038, 1010, {
H,
H, H},
FaultStat()};
182 {
"STQF_mem_address_not_aligned", 0x039, 1010, {
H,
H, H},
FaultStat()};
186 {
"instruction_real_translation_miss", 0x03E, 208, {
H,
H,
SH},
FaultStat()};
190 {
"data_real_translation_miss", 0x03F, 1203, {
H,
H, H},
FaultStat()};
199 {
"interrupt_level_n", 0x040, 0, {P, P,
SH},
FaultStat()};
203 {
"hstick_match", 0x05E, 1601, {
H,
H, H},
FaultStat()};
211 {
"interrupt_vector", 0x060, 2630, {
H,
H, H},
FaultStat()};
215 {
"PA_watchpoint", 0x061, 1209, {
H,
H, H},
FaultStat()};
219 {
"VA_watchpoint", 0x062, 1120, {P, P,
SH},
FaultStat()};
223 {
"fast_instruction_access_MMU_miss", 0x064, 208, {
H,
H,
SH},
FaultStat()};
227 {
"fast_data_access_MMU_miss", 0x068, 1203, {
H,
H, H},
FaultStat()};
231 {
"fast_data_access_protection", 0x06C, 1207, {
H,
H, H},
FaultStat()};
235 {
"instruction_break", 0x076, 610, {
H,
H, H},
FaultStat()};
239 {
"cpu_mondo", 0x07C, 1608, {P, P,
SH},
FaultStat()};
243 {
"dev_mondo", 0x07D, 1611, {P, P,
SH},
FaultStat()};
247 {
"resume_error", 0x07E, 3330, {P, P,
SH},
FaultStat()};
251 {
"spill_n_normal", 0x080, 900, {P, P,
H},
FaultStat()};
255 {
"spill_n_other", 0x0A0, 900, {P, P,
H},
FaultStat()};
259 {
"fill_n_normal", 0x0C0, 900, {P, P,
H},
FaultStat()};
263 {
"fill_n_other", 0x0E0, 900, {P, P,
H},
FaultStat()};
267 {
"trap_instruction", 0x100, 1602, {P, P,
H},
FaultStat()};
341 bool priv = pstate.priv;
353 bool changedCWP =
true;
356 else if (0x80 <= tt && tt <= 0xbf)
357 CWP += (CANSAVE + 2);
358 else if (0xc0 <= tt && tt <= 0xff)
444 pstate.cle = pstate.tle;
449 bool changedCWP =
true;
452 else if (0x80 <= tt && tt <= 0xbf)
453 CWP += (CANSAVE + 2);
454 else if (0xc0 <= tt && tt <= 0xff)
469 const Addr RSTVAddr = 0xFFF0000000
ULL;
470 PC = RSTVAddr | ((TT << 5) & 0xFF);
478 PC = (HTBA & ~
mask(14)) | ((TT << 5) &
mask(14));
486 PC = (TBA & ~
mask(15)) |
487 (TL > 1 ? (1 << 14) : 0) |
488 ((TT << 5) &
mask(14));
512 current = Hyperprivileged;
513 else if (pstate.priv)
514 current = Privileged;
520 if (hpstate.red || (tl ==
MaxTL - 1)) {
526 }
else if (tl ==
MaxTL) {
527 panic(
"Should go to error state here.. crap\n");
531 }
else if (tl >
MaxPTL && level == Privileged) {
535 }
else if (level == Hyperprivileged ||
536 (level == Privileged && trapType() >= 384)) {
621 SparcFaultBase::invoke(tc, inst);
629 panic(
"Tried to execute unmapped address %#x.\n",
vaddr);
642 bool is_real_address = !
bits(tlbdata, 4);
646 bool trapped =
bits(tlbdata, 18, 16) > 0;
652 int primary_context =
bits(tlbdata, 47, 32);
655 int const partition_id = 0;
659 int context_id = (is_real_address || trapped) ? 0 : primary_context;
666 tc->
getITBPtr()->insert(alignedvaddr, partition_id, context_id,
675 SparcFaultBase::invoke(tc, inst);
687 panic(
"Tried to access unmapped address %#x.\n",
vaddr);
703 int primary_context =
bits(tlbdata, 47, 32);
719 int is_real_address = !
bits(tlbdata, 5);
731 ASI asi =
static_cast<ASI>(reg_asi);
737 bool trapped =
bits(tlbdata, 18, 16) > 0;
741 int context_id = ((!hpriv && !red && is_real_address) ||
744 ? 0 : primary_context;
747 int const partition_id = 0;
754 tc->
getDTBPtr()->insert(alignedvaddr, partition_id, context_id,
763 SparcFaultBase::invoke(tc, inst);
782 SparcFaultBase::invoke(tc, inst);
801 SparcFaultBase::invoke(tc, inst);
void getHyperVector(ThreadContext *tc, Addr &PC, Addr &NPC, MiscReg TT)
void doNormalFault(ThreadContext *tc, TrapType tt, bool gotoHpriv)
This sets everything up for a normal trap except for actually jumping to the handler.
virtual MiscReg readMiscRegNoEffect(int misc_reg) const =0
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
virtual void setMiscReg(int misc_reg, const MiscReg &val)=0
virtual Process * getProcessPtr()=0
virtual TheISA::PCState pcState()=0
ThreadContext is the external interface to all thread state for anything outside of the CPU...
virtual uint64_t readIntReg(int reg_idx)=0
virtual TheISA::TLB * getDTBPtr()=0
Hyper privileged registers.
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.
void enterREDState(ThreadContext *tc)
This causes the thread context to enter RED state.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
#define ULL(N)
uint64_t constant
Ancillary State Registers.
SignedBitfield< 15, 8 > SH
bool fixupStackFault(Addr vaddr)
Attempt to fix up a fault at vaddr by allocating a page on the stack.
Declarations of a non-full system Page Table.
MipsFaultBase::FaultVals FaultVals
virtual void handleTrap(int trapNum, ThreadContext *tc, Fault *fault)
void doREDFault(ThreadContext *tc, TrapType tt)
This sets everything up for a RED state trap except for actually jumping to the handler.
void getREDVector(MiscReg TT, Addr &PC, Addr &NPC)
virtual bool lookup(Addr vaddr, TheISA::TlbEntry &entry)=0
Lookup function.
void getPrivVector(ThreadContext *tc, Addr &PC, Addr &NPC, MiscReg TT, MiscReg TL)
T bits(T val, int first, int last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it...
virtual void setMiscRegNoEffect(int misc_reg, const MiscReg &val)=0
std::shared_ptr< FaultBase > Fault
virtual TheISA::TLB * getITBPtr()=0
virtual void invoke(ThreadContext *tc, const StaticInstPtr &inst=StaticInst::nullStaticInstPtr)