From 369029d2bef44d2900a9206c6384b19b33f92379 Mon Sep 17 00:00:00 2001 From: Hoa Nguyen Date: Thu, 25 Apr 2024 02:00:58 +0000 Subject: [PATCH] cpu: Add IsInvalid flag to StaticInstFlags The IsInvalid flag indicates that the static instruction is not part of the executing ISA and not part of m5's pseudo-instructions. This flag provides a way to recognize an illegal instruction at the decode stage. Change-Id: I2779c6edcd8c5e6a77ea11cad3ff73bacb79d800 Signed-off-by: Hoa Nguyen --- src/cpu/StaticInstFlags.py | 1 + src/cpu/static_inst.hh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/cpu/StaticInstFlags.py b/src/cpu/StaticInstFlags.py index 4ab6cc499c..2e02833d1a 100644 --- a/src/cpu/StaticInstFlags.py +++ b/src/cpu/StaticInstFlags.py @@ -99,4 +99,5 @@ class StaticInstFlags(Enum): "IsHtmStart", # Starts a HTM transaction "IsHtmStop", # Stops (commits) a HTM transaction "IsHtmCancel", # Explicitely aborts a HTM transaction + "IsInvalid", # An invalid instruction ] diff --git a/src/cpu/static_inst.hh b/src/cpu/static_inst.hh index 12b05f9b0e..78e47f4ed8 100644 --- a/src/cpu/static_inst.hh +++ b/src/cpu/static_inst.hh @@ -196,6 +196,8 @@ class StaticInst : public RefCounted, public StaticInstFlags bool isHtmStop() const { return flags[IsHtmStop]; } bool isHtmCancel() const { return flags[IsHtmCancel]; } + bool isInvalid() const { return flags[IsInvalid]; } + bool isHtmCmd() const {