From: Megan Wachs Date: Tue, 18 Apr 2017 22:09:55 +0000 (-0700) Subject: debug: Don't halt out of reset. It's unrealistic. Use a program which loops (actually... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2b116f9fb820641cb0a3a04e51164f2ef76478d6;p=riscv-tests.git debug: Don't halt out of reset. It's unrealistic. Use a program which loops (actually it just gets an exception anyway). --- diff --git a/debug/programs/infinite_loop b/debug/programs/infinite_loop new file mode 100755 index 0000000..628fd24 Binary files /dev/null and b/debug/programs/infinite_loop differ 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 +#include +#include +#include + + +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(