From de49ebb80d1e2ef8283818332a0ac6bf5d70440d Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Sun, 12 May 2024 13:28:53 -0600 Subject: platform/wavelet3d: implement JTAG TAP bridge in simulation --- platform/wavelet3d/remote_bitbang.h | 53 +++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 platform/wavelet3d/remote_bitbang.h (limited to 'platform/wavelet3d/remote_bitbang.h') diff --git a/platform/wavelet3d/remote_bitbang.h b/platform/wavelet3d/remote_bitbang.h new file mode 100644 index 0000000..0e294e8 --- /dev/null +++ b/platform/wavelet3d/remote_bitbang.h @@ -0,0 +1,53 @@ +// https://github.com/pulp-platform/riscv-dbg/blob/master/tb/remote_bitbang/remote_bitbang.h +// See LICENSE.Berkeley for license details. + +#ifndef REMOTE_BITBANG_H +#define REMOTE_BITBANG_H + +#include +#include + +#define VERBOSE 0 + +extern int rbs_err; + +extern unsigned char tck; +extern unsigned char tms; +extern unsigned char tdi; +extern unsigned char trstn; +extern unsigned char tdo; +extern unsigned char quit; + +extern int socket_fd; +extern int client_fd; + +//static const ssize_t buf_size = 64 * 1024; +extern char recv_buf[64 * 1024]; +extern ssize_t recv_start, recv_end; + +// Create a new server, listening for connections from localhost on the given +// port. +int rbs_init(uint16_t port); + +// Do a bit of work. +void rbs_tick(unsigned char *jtag_tck, unsigned char *jtag_tms, + unsigned char *jtag_tdi, unsigned char *jtag_trstn, + unsigned char jtag_tdo); + +unsigned char rbs_done(); + +int rbs_exit_code(); + +// Check for a client connecting, and accept if there is one. +void rbs_accept(); +// Execute any commands the client has for us. +// But we only execute 1 because we need time for the +// simulation to run. +void rbs_execute_command(); + +void rbs_reset(); //Assert TRST +void rbs_set(); //Deassert TRST + +void rbs_set_pins(char _tck, char _tms, char _tdi); + +#endif -- cgit v1.2.3