arch-riscv: Fix incorrect trap value of instruction fault

As we add rv_type bit in machInst at 62, It will get the machine
code with rv_type specification if we just return machInst. We
only need return machine code for handling instruction fault.

Change-Id: I9dd7a25047d4a13df5b47dc9e422345ba44b7b09
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/67677
Reviewed-by: Yu-hsin Wang <yuhsingw@google.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Roger Chang
2023-01-17 10:38:11 +08:00
parent 4b1c245420
commit 3b4f241fb5

View File

@@ -173,7 +173,7 @@ class InstFault : public RiscvFault
: RiscvFault(n, FaultType::OTHERS, INST_ILLEGAL), _inst(inst)
{}
RegVal trap_value() const override { return _inst; }
RegVal trap_value() const override { return bits(_inst, 31, 0); }
};
class UnknownInstFault : public InstFault