mw_debug: Add README
authorJoel Stanley <joel@jms.id.au>
Mon, 11 May 2020 04:22:41 +0000 (13:52 +0930)
committerJoel Stanley <joel@jms.id.au>
Tue, 19 May 2020 03:57:35 +0000 (13:27 +0930)
This describes how to build the tool on Fedora, and on Debian which lacks a packaged
liburjtag as of mid 2020.

Signed-off-by: Joel Stanley <joel@jms.id.au>
scripts/mw_debug/Makefile
scripts/mw_debug/README [new file with mode: 0644]

index dd1611f475433672d7f7477854a1ec1617b1554b..a669e74a2f405f259b98dca0b65ee8038b72c9d6 100644 (file)
@@ -1,4 +1,5 @@
 CFLAGS = -O2 -g -Wall -std=c99
+# CFLAGS +=  -I urjtag/urjtag/include/ -L urjtag/urjtag/src/.libs/
 
 all: mw_debug
 
diff --git a/scripts/mw_debug/README b/scripts/mw_debug/README
new file mode 100644 (file)
index 0000000..aa26f8e
--- /dev/null
@@ -0,0 +1,63 @@
+mw_debug is the microwatt debugger.
+
+It can talk to the simulator using a socket.
+
+On an Arty board it uses the FTDI device via liburjtag.
+
+## Building on Fedora
+
+```
+dnf install urjtag-devel
+make
+```
+
+If you commonly use it against one target, create an alias as follows:
+```
+alias mw="$HOME/microwatt/scripts/mw_debug/mw_debug -b jtag"
+$ mw gpr 0 10
+Connected to libftdi driver.
+Found device ID: 0x0362d093
+r0:    0000000000001094
+r1:    0000000000001ed0
+r2:    000000000000a000
+r3:    0000000000000003
+r4:    000000000000000d
+r5:    00000000ffff2ca5
+r6:    00000000ffff3eb8
+r7:    0000000000000000
+r8:    00000000ffff3c33
+r9:    0000000000000003
+Core: running
+ NIA: 00000000000011d4
+ MSR: 8000000000000001
+```
+
+## Building on Debian
+
+Debian disables the library in the urjtag package. Instead, build against
+local urjtag:
+
+```
+sudo apt install libftdi-dev
+git clone https://git.code.sf.net/p/urjtag/git urjtag
+cd urjtag/urjtag
+./autogen.sh
+make
+```
+
+And then uncomment the following line in Makefile to build against that copy
+
+```
+CFLAGS +=  -I urjtag/urjtag/include/ -L urjtag/urjtag/src/.libs/
+```
+
+To run:
+```
+alias mw="LD_LIBRARY_PATH=$HOME/microwatt/scripts/mw_debug/urjtag/urjtag/src/.libs/ $HOME/microwatt/scripts/mw_debug/mw_debug -b jtag"
+$ mw
+Connected to libftdi driver.
+Found device ID: 0x0362d093
+Core: running
+ NIA: 00000000000011b8
+ MSR: 8000000000000001
+```