aboutsummaryrefslogtreecommitdiff
path: root/riscv/trap.cc
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@s141.Millennium.Berkeley.EDU>2010-07-18 18:28:05 -0700
committerAndrew Waterman <waterman@s141.Millennium.Berkeley.EDU>2010-07-18 18:28:05 -0700
commit01c01cc36f006cfb03cd6d1c5a68f926b93f7787 (patch)
tree1bc5333057ff935073a595834092e4dd0936e34d /riscv/trap.cc
downloadspike-01c01cc36f006cfb03cd6d1c5a68f926b93f7787.zip
spike-01c01cc36f006cfb03cd6d1c5a68f926b93f7787.tar.gz
spike-01c01cc36f006cfb03cd6d1c5a68f926b93f7787.tar.bz2
Reorganized directory structure
Moved cross-compiler to /xcc/ rather than / Added ISA sim in /sim/ Added Proxy Kernel in /pk/ (to be cleaned up) Added opcode map to /opcodes/ (ditto) Added documentation to /doc/
Diffstat (limited to 'riscv/trap.cc')
-rw-r--r--riscv/trap.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/riscv/trap.cc b/riscv/trap.cc
new file mode 100644
index 0000000..cdf7b8d
--- /dev/null
+++ b/riscv/trap.cc
@@ -0,0 +1,10 @@
+#include "trap.h"
+
+const char* trap_name(trap_t t)
+{
+ #undef DECLARE_TRAP
+ #define DECLARE_TRAP(x) "trap_"#x
+ static const char* names[] = { TRAP_LIST };
+
+ return (unsigned)t >= sizeof(names)/sizeof(names[0]) ? "unknown" : names[t];
+}