aboutsummaryrefslogtreecommitdiff
path: root/debug_rom
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2016-05-01 12:05:48 -0700
committerTim Newsome <tim@sifive.com>2016-05-23 12:12:11 -0700
commit990c6c48098e83584edf5282d119187abae04a4d (patch)
treed2ba581b281dce0c329822f98cc7c21faf868323 /debug_rom
parent57ff1b6595e485b8b002238ddbd10483bbd62fb3 (diff)
downloadspike-990c6c48098e83584edf5282d119187abae04a4d.zip
spike-990c6c48098e83584edf5282d119187abae04a4d.tar.gz
spike-990c6c48098e83584edf5282d119187abae04a4d.tar.bz2
Have Debug memory kind of working again.
Debug exception -> ROM -> RAM -> ROM, then something goes wrong.
Diffstat (limited to 'debug_rom')
-rwxr-xr-xdebug_rom/debug_rom.S11
-rw-r--r--debug_rom/debug_rom.h16
2 files changed, 13 insertions, 14 deletions
diff --git a/debug_rom/debug_rom.S b/debug_rom/debug_rom.S
index a3339b4..832ac49 100755
--- a/debug_rom/debug_rom.S
+++ b/debug_rom/debug_rom.S
@@ -12,13 +12,11 @@
#define DSCRATCH 0x792
-# TODO: Should be 0x400
-#define DEBUG_RAM (-0x400)
+#define DEBUG_RAM 0x400
#define DEBUG_RAM_SIZE 64
-# TODO: Should be 0x100, 0x108
-#define SETHALTNOT (-0x100)
-#define CLEARDEBINT (-0x108)
+#define SETHALTNOT 0x100
+#define CLEARDEBINT 0x108
.global entry
.global resume
@@ -58,7 +56,8 @@ check_halt:
exit:
# Restore s0.
csrr s0, DSCRATCH
- eret
+ # TODO: dret?
+ mret
_entry:
diff --git a/debug_rom/debug_rom.h b/debug_rom/debug_rom.h
index b096c80..3ab78a1 100644
--- a/debug_rom/debug_rom.h
+++ b/debug_rom/debug_rom.h
@@ -1,16 +1,16 @@
static const unsigned char debug_rom_raw[] = {
- 0x6f, 0x00, 0xc0, 0x04, 0xf3, 0x24, 0x50, 0xf1, 0x23, 0x2c, 0x90, 0xee,
+ 0x6f, 0x00, 0xc0, 0x04, 0xf3, 0x24, 0x40, 0xf1, 0x23, 0x24, 0x90, 0x10,
0x0f, 0x00, 0xf0, 0x0f, 0xf3, 0x24, 0x00, 0xf1, 0x63, 0xc6, 0x04, 0x00,
- 0x83, 0x24, 0xc0, 0xc3, 0x6f, 0x00, 0x80, 0x01, 0x93, 0x94, 0x14, 0x00,
- 0x63, 0xc6, 0x04, 0x00, 0x83, 0x34, 0x80, 0xc3, 0x6f, 0x00, 0x80, 0x00,
+ 0x83, 0x24, 0xc0, 0x43, 0x6f, 0x00, 0x80, 0x01, 0x93, 0x94, 0x14, 0x00,
+ 0x63, 0xc6, 0x04, 0x00, 0x83, 0x34, 0x80, 0x43, 0x6f, 0x00, 0x80, 0x00,
0x13, 0x00, 0x00, 0x00, 0x73, 0x24, 0x00, 0x79, 0x13, 0x74, 0x84, 0x00,
0x63, 0x04, 0x04, 0x00, 0x6f, 0x00, 0x40, 0x05, 0x73, 0x24, 0x20, 0x79,
- 0x73, 0x00, 0x00, 0x10, 0x73, 0x10, 0x24, 0x79, 0x73, 0x24, 0x00, 0x79,
+ 0x73, 0x00, 0x20, 0x30, 0x73, 0x10, 0x24, 0x79, 0x73, 0x24, 0x00, 0x79,
0x13, 0x74, 0x74, 0x00, 0x13, 0x04, 0xd4, 0xff, 0x63, 0x16, 0x04, 0x02,
- 0x73, 0x24, 0x00, 0xf1, 0x63, 0x46, 0x04, 0x00, 0x23, 0x2e, 0x90, 0xc2,
- 0x67, 0x00, 0x00, 0xc0, 0x13, 0x14, 0x14, 0x00, 0x63, 0x46, 0x04, 0x00,
- 0x23, 0x3c, 0x90, 0xc2, 0x67, 0x00, 0x00, 0xc0, 0x13, 0x00, 0x00, 0x00,
- 0x67, 0x00, 0x00, 0xc0, 0x73, 0x24, 0x50, 0xf1, 0x23, 0x20, 0x80, 0xf0,
+ 0x73, 0x24, 0x00, 0xf1, 0x63, 0x46, 0x04, 0x00, 0x23, 0x2e, 0x90, 0x42,
+ 0x67, 0x00, 0x00, 0x40, 0x13, 0x14, 0x14, 0x00, 0x63, 0x46, 0x04, 0x00,
+ 0x23, 0x3c, 0x90, 0x42, 0x67, 0x00, 0x00, 0x40, 0x13, 0x00, 0x00, 0x00,
+ 0x67, 0x00, 0x00, 0x40, 0x73, 0x24, 0x40, 0xf1, 0x23, 0x20, 0x80, 0x10,
0x73, 0x60, 0x04, 0x79, 0x73, 0x24, 0x00, 0x79, 0x13, 0x74, 0x04, 0x40,
0xe3, 0x0c, 0x04, 0xfe, 0x6f, 0xf0, 0x1f, 0xfc
};