SpinalHDL / openocd_riscv

Spen's Official OpenOCD Mirror
Other
45 stars 33 forks source link

Vexriscv quality-of-life improvements #1

Closed xobs closed 6 years ago

xobs commented 6 years ago

We're using a Vexriscv core in the NeTV2 project via the litex umbrella of projects. This project uses Etherbone via liteeth, which exposes the Wishbone bus over Ethernet, PCIe, or UART.

We have added patches to optionally expose the Vexriscv debug bus over Ethernet at a given offset. This is an extremely convenient method of debugging, as it uses the same debugging interface we already use for other features such as our logic analyzer litescope.

This series of patches includes a number of enhancements aimed at making the debugging process more reliable and efficient:

  1. When the TCP connection is closed, openocd exits as there is nothing left to do.
  2. A shim function is introduced to avoid running JTAG commands when using the TCP interface
  3. Add a new vexriscv configuration verb networkProtocol to enable native Etherbone support. This protocol is described in slide 40 of https://accelconf.web.cern.ch/accelconf/icalepcs2011/talks/webhmult03_talk.pdf however the liteeth project only supports a simplified subset (i.e. one read or write at a time). Depending on this protocol selection, the iverilog or etherbone protocol is used.
  4. Don't reset the PC when doing a system reset. This fixes an issue where running mon reset halt followed by continue wouldn't actually reset the system.
  5. Ensure the target is halted when writing memory. Several times I would forget to halt the system when writing memory, and openocd would simply quit. This prevents that from happening.

Comments are welcome.

Dolu1990 commented 6 years ago

Thanks ! I will check all of that.

Dolu1990 commented 6 years ago

So it look good, i should realy implement a continuous integration XD

On your side, i remember you said that software breakpoint were not working, is that fine now ? (it isn't related to this pull request)

xobs commented 6 years ago

I believe software breakpoints were due to me not understanding the limitations of the system -- I was trying to add breakpoints to instructions in ROM, which doesn't work due to how they're implemented. They're working fine now!

Dolu1990 commented 6 years ago

Cool ^^