aboutsummaryrefslogtreecommitdiff
path: root/debug/Makefile
diff options
context:
space:
mode:
authorMegan Wachs <megan@sifive.com>2017-04-17 14:20:53 -0700
committerMegan Wachs <megan@sifive.com>2017-04-17 14:20:53 -0700
commit2091a5bfc777c2d3edc167148802f2e928960d5f (patch)
treed093eca6b7f9d15156edbb7a4a42c7af5eee1434 /debug/Makefile
parenteca66b135bbbc4fb804ac49a93fb2bf70f6e739f (diff)
downloadriscv-tests-2091a5bfc777c2d3edc167148802f2e928960d5f.zip
riscv-tests-2091a5bfc777c2d3edc167148802f2e928960d5f.tar.gz
riscv-tests-2091a5bfc777c2d3edc167148802f2e928960d5f.tar.bz2
debug: Checkpoint restoring Spike functionality
Diffstat (limited to 'debug/Makefile')
-rw-r--r--debug/Makefile19
1 files changed, 18 insertions, 1 deletions
diff --git a/debug/Makefile b/debug/Makefile
index 79e89cb..1916bda 100644
--- a/debug/Makefile
+++ b/debug/Makefile
@@ -1,6 +1,23 @@
RISCV_SIM ?= spike
XLEN ?= 64
+OPENOCD_INSTALL ?= $(abspath .)/openocd-install
+OPENOCD_VERSION = 860b42a3c4f6aa37d8d4fe50a71000b7cff66b85
+
+OPENOCD_DIR = $(OPENOCD_INSTALL)_$(OPENOCD_VERSION)/
+
+$(OPENOCD_DIR)/bin/openocd:
+ rm -rf riscv-openocd
+ git clone http://github.com/riscv/riscv-openocd.git
+ cd riscv-openocd ; \
+ git checkout $(OPENOCD_VERSION) ; \
+ ./bootstrap ; \
+ ./configure --enable-remote_bitbang --prefix=$(OPENOCD_INSTALL)_$(OPENOCD_VERSION) --disable-werror; \
+ make ; \
+ make install
+
+install_openocd: $(OPENOCD_DIR)/bin/openocd
+
src_dir ?= .
GDBSERVER_PY = $(src_dir)/gdbserver.py
@@ -12,7 +29,7 @@ pylint:
pylint --rcfile=pylint.rc *.py
%.log:
- $(GDBSERVER_PY) --isolate --$(subst .log,,$@) \
+ $(GDBSERVER_PY) --isolate --$(subst .log,,$@) --server_cmd $(OPENOCD_DIR)/bin/openocd \
> $@ 2>&1 || (sed s/^/$@:\ / $@ && false)
clean: