You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
microwatt/scripts/mw_debug
Matt Johnston 9c64f8a98b mw_debug: Add Lattice ECP5 support
"-b ecp5" will select ECP5 interface that talks to a JTAGG
primitive.

For example with a FT232H JTAG board:

./mw_debug  -t 'ft2232 vid=0x0403 pid=0x6014'  -s 30000000 -b ecp5 mr ff003888 6
Connected to libftdi driver.
Found device ID: 0x41113043
00000000ff003888: 6d6f636c65570a0a  ..Welcom
00000000ff003890: 63694d206f742065  e to Mic
00000000ff003898: 2120747461776f72  rowatt !
00000000ff0038a0: 0000000000000a0a  ........
00000000ff0038a8: 67697320636f5320   Soc sig
00000000ff0038b0: 203a65727574616e  nature:
Core: running
 NIA: c0000000000187f8
 MSR: 9000000000001033

Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
3 years ago
..
Makefile mw_debug: Link urjtag statically 3 years ago
README mw_debug: Add README 5 years ago
mw_debug.c mw_debug: Add Lattice ECP5 support 3 years ago

README

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
```