From: Luke Kenneth Casson Leighton Date: Fri, 14 Jun 2019 07:03:30 +0000 (+0100) Subject: add open question trap_isans as a vector table X-Git-Tag: convert-csv-opcode-to-binary~4636 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=355fd1ad1a665303c43188c81c69063bddfe5ce5;p=libreriscv.git add open question trap_isans as a vector table --- diff --git a/isa_conflict_resolution/isamux_isans.mdwn b/isa_conflict_resolution/isamux_isans.mdwn index 9504ce123..1f0134077 100644 --- a/isa_conflict_resolution/isamux_isans.mdwn +++ b/isa_conflict_resolution/isamux_isans.mdwn @@ -122,6 +122,39 @@ trap_exit(): +# Why not have TRAP-ISANS as a vector table, matching mtvec? + +Use case to be determined. Rather than be a global per-priv-level value, +TRAP-ISANS is a table of length exactly equal to the mtvec/utvec/stvec table, +with corresponding entries that specify the assembly-code namespace in which +the trap handler routine is written. + +Open question: see + + +
+trap_entry(x_cause)
+{
+    if (ISANS != TRAP_ISANS[xcause]) // musn't change if already there
+    {
+        LAST-ISANS = ISANS // record the old NS
+        ISANS = TRAP_ISANS[xcause] // traps are executed in "trap" NS
+    }
+}
+
+and trap_exit:
+
+trap_exit(x_cause):
+{
+    if (LAST-ISANS != TRAP_ISANS[x_cause])
+    {
+        ISANS = LAST-ISANS
+        LAST-ISANS = TRAP_ISANS[x_cause]
+    }
+}
+
+
+ # What happens if this scheme is not adopted? Why is it better than leaving things well alone? At the first sign of an emergency non-backwards compatible and unavoidable