From ae4ae4460fbda8c594e95d4555abd4a30290f6fe Mon Sep 17 00:00:00 2001 From: Prashanth Mundkur Date: Tue, 15 May 2018 09:22:35 -0700 Subject: Fix the ebreak instruction to trap, and remove the now obsolete internal exception. This should fix the sbreak test. --- riscv/main.sail | 1 - riscv/riscv.sail | 3 ++- riscv/riscv_types.sail | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/riscv/main.sail b/riscv/main.sail index 28afe5ac..0a46181b 100644 --- a/riscv/main.sail +++ b/riscv/main.sail @@ -43,7 +43,6 @@ function main () = { loop () } catch { Error_not_implemented(s) => print_string("Error: Not implemented: ", s), - Error_EBREAK() => print("EBREAK"), Error_internal_error() => print("Error: internal error") } } diff --git a/riscv/riscv.sail b/riscv/riscv.sail index 374ea4a9..e855a53d 100644 --- a/riscv/riscv.sail +++ b/riscv/riscv.sail @@ -573,7 +573,8 @@ union clause ast = EBREAK : unit function clause decode 0b000000000001 @ 0b00000 @ 0b000 @ 0b00000 @ 0b1110011 = Some(EBREAK()) -function clause execute EBREAK() = { throw Error_EBREAK() } +function clause execute EBREAK() = + handle_mem_exception(PC, E_Breakpoint) function clause print_insn (EBREAK()) = "ebreak" diff --git a/riscv/riscv_types.sail b/riscv/riscv_types.sail index ee0eb94d..5a71c737 100644 --- a/riscv/riscv_types.sail +++ b/riscv/riscv_types.sail @@ -259,7 +259,6 @@ function trapVectorMode_of_bits (m) = { union exception = { Error_not_implemented : string, - Error_EBREAK : unit, Error_internal_error : unit } -- cgit v1.2.3