using namespace AlphaISA;
-Fault
-SimpleThread::hwrei()
-{
- auto *stats = dynamic_cast<AlphaISA::Kernel::Statistics *>(kernelStats);
- assert(stats || !kernelStats);
-
- PCState pc = pcState();
- if (!(pc.pc() & 0x3))
- return std::make_shared<UnimplementedOpcodeFault>();
-
- pc.npc(readMiscRegNoEffect(IPR_EXC_ADDR));
- pcState(pc);
-
- CPA::cpa()->swAutoBegin(this, pc.npc());
-
- if (stats)
- stats->hwrei();
-
- // FIXME: XXX check for interrupts? XXX
- return NoFault;
-}
-
/**
* Check for special simulator handling of specific PAL calls.
* If return value is false, actual PAL call will be suppressed.
void setStCondFailures(unsigned int sc_failures) override {}
/////////////////////////////////////////////////////
- Fault hwrei() override { return thread->hwrei(); }
bool simPalCheck(int palFunc) override
{ return thread->simPalCheck(palFunc); }
void wakeup(ThreadID tid) override { }
* @name Alpha-Specific Interfaces
*/
- /**
- * Somewhat Alpha-specific function that handles returning from an
- * error or interrupt.
- */
- virtual Fault hwrei() = 0;
-
/**
* Check for special simulator handling of specific PAL calls. If
* return value is false, actual PAL call will be suppressed.
return thread.setMiscReg(reg.index(), val);
}
- Fault
- hwrei() override
- {
-#if THE_ISA == ALPHA_ISA
- return thread.hwrei();
-#else
- return NoFault;
-#endif
- }
-
bool
simPalCheck(int palFunc) override
{
*/
}
-template <class Impl>
-Fault
-FullO3CPU<Impl>::hwrei(ThreadID tid)
-{
-#if THE_ISA == ALPHA_ISA
- // Need to clear the lock flag upon returning from an interrupt.
- this->setMiscRegNoEffect(AlphaISA::MISCREG_LOCKFLAG, false, tid);
-
- auto *stats = dynamic_cast<AlphaISA::Kernel::Statistics *>(
- this->thread[tid]->kernelStats);
- assert(stats);
- stats->hwrei();
-
- // FIXME: XXX check for interrupts? XXX
-#endif
- return NoFault;
-}
-
template <class Impl>
bool
FullO3CPU<Impl>::simPalCheck(int palFunc, ThreadID tid)
/** Traps to handle given fault. */
void trap(const Fault &fault, ThreadID tid, const StaticInstPtr &inst);
- /** HW return from error interrupt. */
- Fault hwrei(ThreadID tid);
-
bool simPalCheck(int palFunc, ThreadID tid);
/** Check if a change in renaming is needed for vector registers.
}
}
}
- /** Calls hardware return from error interrupt. */
- Fault hwrei() override;
/** Traps to handle specified fault. */
void trap(const Fault &fault);
bool simPalCheck(int palFunc) override;
return this->fault;
}
-template <class Impl>
-Fault
-BaseO3DynInst<Impl>::hwrei()
-{
-#if THE_ISA == ALPHA_ISA
- // Can only do a hwrei when in pal mode.
- if (!(this->instAddr() & 0x3))
- return std::make_shared<AlphaISA::UnimplementedOpcodeFault>();
-
- // Set the next PC based on the value of the EXC_ADDR IPR.
- AlphaISA::PCState pc = this->pcState();
- pc.npc(this->cpu->readMiscRegNoEffect(AlphaISA::IPR_EXC_ADDR,
- this->threadNumber));
- this->pcState(pc);
- if (CPA::available()) {
- ThreadContext *tc = this->cpu->tcBase(this->threadNumber);
- CPA::cpa()->swAutoBegin(tc, this->nextInstAddr());
- }
-
- // Tell CPU to clear any state it needs to if a hwrei is taken.
- this->cpu->hwrei(this->threadNumber);
-#else
-
-#endif
- // FIXME: XXX check for interrupts? XXX
- return NoFault;
-}
-
template <class Impl>
void
BaseO3DynInst<Impl>::trap(const Fault &fault)
/** Returns a pointer to the ThreadContext. */
ThreadContext *tcBase() override { return thread->getTC(); }
- /**
- * Somewhat Alpha-specific function that handles returning from an
- * error or interrupt.
- */
- Fault hwrei() override { return thread->hwrei(); }
-
/**
* Check for special simulator handling of specific PAL calls. If
* return value is false, actual PAL call will be suppressed.
// The following methods are defined in src/arch/alpha/ev5.cc for
// Alpha.
#if THE_ISA != ALPHA_ISA
-Fault
-SimpleThread::hwrei()
-{
- return NoFault;
-}
bool
SimpleThread::simPalCheck(int palFunc)
void dumpFuncProfile() override;
- Fault hwrei();
-
bool simPalCheck(int palFunc);
/*******************************************