#fpga #tftp #astronomy

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

#555 in Hardware support

Download history 2/week @ 2024-01-16 1/week @ 2024-02-13 8/week @ 2024-02-20 19/week @ 2024-02-27 10/week @ 2024-03-12 33/week @ 2024-03-19 4/week @ 2024-03-26 30/week @ 2024-04-02 46/week @ 2024-04-09

123 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