#astronomy #fpga #tftp

tapcp

An implementation of the TAPCP protocol for CASPER FPGA devices

2 unstable releases

0.2.1 Jan 21, 2024
0.1.0 Mar 17, 2023

#756 in Hardware support

Download history 5/week @ 2023-11-03 7/week @ 2023-11-10 8/week @ 2023-11-17 7/week @ 2023-11-24 6/week @ 2023-12-01 4/week @ 2023-12-08 5/week @ 2023-12-15 6/week @ 2023-12-22 3/week @ 2023-12-29 5/week @ 2024-01-05 4/week @ 2024-01-12 49/week @ 2024-01-19 10/week @ 2024-01-26 7/week @ 2024-02-02 12/week @ 2024-02-09 47/week @ 2024-02-16

79 downloads per month
Used in casperfpga

Apache-2.0 OR MIT

41KB
733 lines

tapcp_rs

A rust implementation of the TAPCP protocol for interacting with certain CASPER Collaboration FPGA boards.

Currently not quite feature complete, mainly missing interactions with the flash memory.

TODO

Reimplement CSL in rust so we don't have to rely on an external C compiler and unsafe FFI

Why does this include an implementation of TFTP

I couldn't find a TFTP client crate and it seemed easy enough with "canonical" implementations only ~300 lines of C.

Talking to remote TAPCP Client

Unrelated to the details of this package, I have found an easy way to interact with remote TFTP clients, including those running TAPCP. The problem is that TFTP runs over UDP, so you can't use an SSH proxy to access it. To solve this, you could use a VPN or a nice piece of software called sshuttle. Using the TPROXY mode, you can proxy all of the traffic on a given subnet to your remote machine without admin access on the server.

For example, I use this command to test this package:

On first boot (on the client), I run

ip route add local default dev lo table 100
ip rule add fwmark 0x01 lookup 100
ip -6 route add local default dev lo table 100
ip -6 rule add fwmark 0x01 lookup 100

Then to turn on the proxy to the 192.168.0.x subnet, I do:

sudo sshuttle --method=tproxy -t 0x01 -r <username@server-addr> 192.168.0.0/24

TODO

Make nostd so we can run this on an FPGA softcore at some point

Dependencies

~2–2.9MB
~54K SLoC