aboutsummaryrefslogtreecommitdiff
path: root/debug/programs
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2019-03-11 08:43:14 -0700
committerGitHub <noreply@github.com>2019-03-11 08:43:14 -0700
commit4f784ca9b8d3536c16061518c1c2b66e3118cc5c (patch)
tree6d801e89c8836a84ab41646267b8c7170c3326eb /debug/programs
parent26d821d126fd0e36bf286420452f5628c946e7cb (diff)
downloadriscv-tests-4f784ca9b8d3536c16061518c1c2b66e3118cc5c.zip
riscv-tests-4f784ca9b8d3536c16061518c1c2b66e3118cc5c.tar.gz
riscv-tests-4f784ca9b8d3536c16061518c1c2b66e3118cc5c.tar.bz2
Add SmpSimultaneousRunHalt test. (#181)
This test confirms that in SMP configurations OpenOCD halts the harts near-simulatenously. (It'll also check for resume, but that's not implemented yet so commented out for now.)
Diffstat (limited to 'debug/programs')
-rw-r--r--debug/programs/run_halt_timing.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/debug/programs/run_halt_timing.c b/debug/programs/run_halt_timing.c
new file mode 100644
index 0000000..1c9a8ba
--- /dev/null
+++ b/debug/programs/run_halt_timing.c
@@ -0,0 +1,17 @@
+#include <stdio.h>
+#include <string.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+#include "init.h"
+
+int main()
+{
+ int counter = 0;
+ volatile uint64_t mtime_value;
+
+ while (1) {
+ counter = counter + 1;
+ mtime_value = MTIME;
+ }
+}