aboutsummaryrefslogtreecommitdiff
path: root/debug_rom
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2016-06-03 13:08:09 -0700
committerTim Newsome <tim@sifive.com>2016-06-03 13:08:09 -0700
commit127cf78387447aba8f6bd19783a0c66ae5f3791a (patch)
tree054af4fca6678e93f45847695111ef3caf96d71b /debug_rom
parente977e2297aa83f244501bb4a5c3752d2c73bddc9 (diff)
downloadspike-127cf78387447aba8f6bd19783a0c66ae5f3791a.zip
spike-127cf78387447aba8f6bd19783a0c66ae5f3791a.tar.gz
spike-127cf78387447aba8f6bd19783a0c66ae5f3791a.tar.bz2
DCSR cause was moved, bug debug ROM wasn't updated
As a result Debug ROM would always take the spontaneous halt code path. This didn't hurt spike since (so far?) the spike debug handler doesn't attempt to do anything quick while code is running. But now the ROM is more correct.
Diffstat (limited to 'debug_rom')
-rwxr-xr-xdebug_rom/debug_rom.S4
-rw-r--r--debug_rom/debug_rom.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/debug_rom/debug_rom.S b/debug_rom/debug_rom.S
index 457104f..9e83098 100755
--- a/debug_rom/debug_rom.S
+++ b/debug_rom/debug_rom.S
@@ -72,9 +72,9 @@ _entry:
# Check why we're here
csrr s0, CSR_DCSR
- # cause is in bits 2:0 of dcsr
+ # cause is in bits 8:6 of dcsr
andi s0, s0, DCSR_CAUSE
- addi s0, s0, -DCSR_CAUSE_DEBUGINT
+ addi s0, s0, -(DCSR_CAUSE_DEBUGINT<<6)
bnez s0, spontaneous_halt
jdebugram:
diff --git a/debug_rom/debug_rom.h b/debug_rom/debug_rom.h
index bbd7f23..a929a27 100644
--- a/debug_rom/debug_rom.h
+++ b/debug_rom/debug_rom.h
@@ -8,7 +8,7 @@ static const unsigned char debug_rom_raw[] = {
0x73, 0x24, 0x00, 0x7b, 0x13, 0x74, 0x84, 0x00, 0x63, 0x04, 0x04, 0x00,
0x6f, 0x00, 0x80, 0x05, 0x73, 0x24, 0x20, 0x7b, 0x73, 0x00, 0x20, 0x7b,
0x73, 0x10, 0x24, 0x7b, 0x73, 0x24, 0x00, 0x7b, 0x13, 0x74, 0x04, 0x1c,
- 0x13, 0x04, 0xd4, 0xff, 0x63, 0x18, 0x04, 0x02, 0x0f, 0x10, 0x00, 0x00,
+ 0x13, 0x04, 0x04, 0xf4, 0x63, 0x18, 0x04, 0x02, 0x0f, 0x10, 0x00, 0x00,
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,