arch-arm: Add undefined helper to ArmStaticInst

In this way we can generate an Undefined Instruction fault
from the instruction object without requiring to access its
menmonic or opcode

This is generalizing the existing disabledFault helper

Change-Id: Ib7dec9399f142c35d75057f37ab53cce102fa01e
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61671
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
This commit is contained in:
Giacomo Travaglini
2022-07-14 11:06:57 +01:00
parent 25bdb73b9f
commit 07b6f4261c

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010-2013,2016-2018 ARM Limited
* Copyright (c) 2010-2013,2016-2018, 2022 Arm Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -398,12 +398,7 @@ class ArmStaticInst : public StaticInst
xc->pcState(pc);
}
inline Fault
disabledFault() const
{
return std::make_shared<UndefinedInstruction>(machInst, false,
mnemonic, true);
}
inline Fault disabledFault() const { return undefined(true); }
// Utility function used by checkForWFxTrap32 and checkForWFxTrap64
// Returns true if processor has to trap a WFI/WFE instruction.
@@ -587,6 +582,13 @@ class ArmStaticInst : public StaticInst
{
return getCurSveVecLenInBits(tc) / (8 * sizeof(T));
}
inline Fault
undefined(bool disabled=false) const
{
return std::make_shared<UndefinedInstruction>(
machInst, false, mnemonic, disabled);
}
};
} // namespace ArmISA