From: Kajol Jain Date: Tue, 11 Jun 2019 08:59:35 +0000 (+0530) Subject: arch-power: Added Illegal type Program interrupt support X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6142a94107817ca721cd99656a7586c4167d779b;p=gem5.git arch-power: Added Illegal type Program interrupt support Added suppot for illegal or unknown instruction type program interrupt. * Check if instruction is unknown or invalid and incase its unknown raise Illegal type program interrupt. * Added Illegal instruction interrupt handler. Change-Id: Ib203cfc3542f47b9e0141a2a3f170dc6becf8a90 Signed-off-by: Kajol Jain --- diff --git a/src/arch/power/faults.hh b/src/arch/power/faults.hh index 863b3f7b9..6bcd87923 100644 --- a/src/arch/power/faults.hh +++ b/src/arch/power/faults.hh @@ -34,6 +34,7 @@ #include "sim/faults.hh" #define SRR1_PRI_BIT 17 +#define SRR1_ILLEGAL_INSTR_BIT 18 #define setbit(shift, mask) ( (uint64_t)1 << shift | mask) #define unsetbit(shift,mask) ( ~((uint64_t)1 << shift) & mask) @@ -154,6 +155,19 @@ class ProgramInterrupt : public PowerInterrupt } }; +class ProgramIllegalInterrupt : public ProgramInterrupt +{ + public: + ProgramIllegalInterrupt() + { + } + virtual void invoke(ThreadContext * tc, const StaticInstPtr &inst = + StaticInst::nullStaticInstPtr) + { + ProgramInterrupt::invoke(tc, inst ,setBitMask(SRR1_ILLEGAL_INSTR_BIT)); + } +}; + class ProgramPriInterrupt : public ProgramInterrupt { public: diff --git a/src/arch/power/isa/formats/unknown.isa b/src/arch/power/isa/formats/unknown.isa index d83f79cf2..38b923bca 100644 --- a/src/arch/power/isa/formats/unknown.isa +++ b/src/arch/power/isa/formats/unknown.isa @@ -71,10 +71,14 @@ output exec {{ Fault Unknown::execute(ExecContext *xc, Trace::InstRecord *traceData) const { - panic("attempt to execute unknown instruction at %#x" + if (FullSystem) { + return std::make_shared(); + } else { + panic("attempt to execute unknown instruction at %#x" "(inst 0x%08x, opcode 0x%x, binary: %s)", xc->pcState().pc(), machInst, PO, inst2string(machInst)); - return std::make_shared(); + return std::make_shared(); + } } }};