From 68b6f9c8a1819fdeee737cf369cc6a499b505a6c Mon Sep 17 00:00:00 2001 From: Alec Roelke Date: Thu, 13 Jul 2017 14:24:06 -0400 Subject: riscv: Fix bugs with RISC-V decoder and detailed CPUs This patch fixes some bugs that were missed with the changes to the decoder that enabled compatibility with compressed instructions. In order to accommodate speculation with variable instruction widths, a few assertions in decoder had to be changed to returning faults as the specification describes should normally happen. The rest of these assertions will be changed in a later patch. [Remove commented-out debugging line and add clarifying comment to registerName in utility.hh.] Change-Id: I3f333008430d4a905cb59547a3513f5149b43b95 Reviewed-on: https://gem5-review.googlesource.com/4041 Reviewed-by: Jason Lowe-Power Maintainer: Alec Roelke --- src/arch/riscv/faults.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/arch/riscv/faults.cc') diff --git a/src/arch/riscv/faults.cc b/src/arch/riscv/faults.cc index 58baa4e32..4e44d43f0 100644 --- a/src/arch/riscv/faults.cc +++ b/src/arch/riscv/faults.cc @@ -63,6 +63,13 @@ UnknownInstFault::invoke_se(ThreadContext *tc, const StaticInstPtr &inst) tc->pcState().pc()); } +void +IllegalInstFault::invoke_se(ThreadContext *tc, const StaticInstPtr &inst) +{ + panic("Illegal instruction 0x%08x at pc 0x%016llx: %s", inst->machInst, + tc->pcState().pc(), reason.c_str()); +} + void UnimplementedFault::invoke_se(ThreadContext *tc, const StaticInstPtr &inst) -- cgit v1.2.3