diff options
author | Megan Wachs <megan@sifive.com> | 2017-04-18 15:09:55 -0700 |
---|---|---|
committer | Megan Wachs <megan@sifive.com> | 2017-04-18 15:09:55 -0700 |
commit | 2b116f9fb820641cb0a3a04e51164f2ef76478d6 (patch) | |
tree | 3022795d926a051c6ee386ad832fc45b458b1b0d /debug | |
parent | b9cc9c27522499f91709d2ea6814692ed6131069 (diff) | |
download | riscv-tests-2b116f9fb820641cb0a3a04e51164f2ef76478d6.zip riscv-tests-2b116f9fb820641cb0a3a04e51164f2ef76478d6.tar.gz riscv-tests-2b116f9fb820641cb0a3a04e51164f2ef76478d6.tar.bz2 |
debug: Don't halt out of reset. It's unrealistic. Use a program which loops (actually it just gets an exception anyway).
Diffstat (limited to 'debug')
-rwxr-xr-x | debug/programs/infinite_loop | bin | 0 -> 6344 bytes | |||
-rw-r--r-- | debug/programs/infinite_loop.c | 14 | ||||
-rw-r--r-- | debug/targets.py | 4 | ||||
-rw-r--r-- | debug/targets/spike/openocd.cfg | 3 | ||||
-rw-r--r-- | debug/testlib.py | 4 |
5 files changed, 20 insertions, 5 deletions
diff --git a/debug/programs/infinite_loop b/debug/programs/infinite_loop Binary files differnew file mode 100755 index 0000000..628fd24 --- /dev/null +++ b/debug/programs/infinite_loop diff --git a/debug/programs/infinite_loop.c b/debug/programs/infinite_loop.c new file mode 100644 index 0000000..460f78a --- /dev/null +++ b/debug/programs/infinite_loop.c @@ -0,0 +1,14 @@ +#include <stdio.h> +#include <string.h> +#include <stdint.h> +#include <stdlib.h> + + +int main() +{ + + volatile int forever = 1; + while (forever); + + return 1; +} diff --git a/debug/targets.py b/debug/targets.py index d49b397..a69f43d 100644 --- a/debug/targets.py +++ b/debug/targets.py @@ -76,14 +76,14 @@ class Spike64Target(SpikeTarget): use_fpu = True def target(self): - return testlib.Spike(self.sim_cmd, halted=True) + return testlib.Spike(self.sim_cmd) class Spike32Target(SpikeTarget): name = "spike32" xlen = 32 def target(self): - return testlib.Spike(self.sim_cmd, halted=True, xlen=32) + return testlib.Spike(self.sim_cmd, xlen=32) class FreedomE300Target(Target): name = "freedom-e300" diff --git a/debug/targets/spike/openocd.cfg b/debug/targets/spike/openocd.cfg index 881d745..29f5040 100644 --- a/debug/targets/spike/openocd.cfg +++ b/debug/targets/spike/openocd.cfg @@ -13,5 +13,6 @@ target create $_TARGETNAME riscv -chain-position $_TARGETNAME -rtos riscv gdb_report_data_abort enable init - halt + +echo "Ready for Remote Connections"
\ No newline at end of file diff --git a/debug/testlib.py b/debug/testlib.py index f1f0fe1..a66d59a 100644 --- a/debug/testlib.py +++ b/debug/testlib.py @@ -78,7 +78,7 @@ class Spike(object): cmd += ['--rbb-port', '0'] os.environ['REMOTE_BITBANG_HOST'] = 'localhost' cmd.append("-m32") - cmd.append('pk') + cmd.append('programs/infinite_loop') if binary: cmd.append(binary) logfile = open(self.logname, "w") @@ -195,7 +195,7 @@ class Openocd(object): messaged = False while True: log = open(Openocd.logname).read() - if "OK GO NOW" in log: + if "Ready for Remote Connections" in log: break if not self.process.poll() is None: raise Exception( |