summaryrefslogtreecommitdiff
path: root/riscv
diff options
context:
space:
mode:
authorPrashanth Mundkur2018-05-15 09:22:35 -0700
committerPrashanth Mundkur2018-05-15 09:22:35 -0700
commitae4ae4460fbda8c594e95d4555abd4a30290f6fe (patch)
tree49d1cd0c8979ece95199dcc01a31f1bff982e4bb /riscv
parent1af099d46188cacd115639ec6d465ca8163ae07f (diff)
Fix the ebreak instruction to trap, and remove the now obsolete internal exception. This should fix the sbreak test.
Diffstat (limited to 'riscv')
-rw-r--r--riscv/main.sail1
-rw-r--r--riscv/riscv.sail3
-rw-r--r--riscv/riscv_types.sail1
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
}