Packets, with no processor in the path
This design sends and receives network packets in hardware. It implements Ethernet, IP, and UDP on a Digilent Nexys A7 FPGA board. There is no processor on the data path: the packet is handled as it arrives. A packet sent to port 50000 is echoed. In simulation the payload comes back in 2 clock cycles, which is 20 ns at 100 MHz.

Last Vivado build: 2026-08-10, Vivado 2025.2, part xc7a100tcsg324-1.
| Fact | Value |
|---|---|
Payload echo |
2 cycles (20 ns) at 100 MHz |
Timing |
WNS +1.985 ns, WHS +0.037 ns, 0 failing endpoints |
Fabric |
756 LUT (1.19%), 599 FF (0.47%), 52 IOB (24.8%), 0.115 W |
1. Introduction
NASDAQ’s Mold-wrapped ITCH feed rides on UDP. Before a parser sees a byte, the FPGA has to bring up the LAN8720 over RMII, strip Ethernet framing, demux IPv4, parse UDP, and hand payload bytes to application logic. This repository is that column: 15 SystemVerilog files from RX to TX, so itch can worry about messages.
Today the proof point is a UDP echo. Tomorrow the same MAC, IP, and UDP spine can replace loopback_echo with Mold unwrap. Same RJ45, different payload handler.
1.1. Reading order
Architecture for the loop, Bring-up for the bench, Implementation for the post-route numbers. The engineering log is the 2026-08-08 note in the sidebar.
2. Architecture
Every lab session is the same loop on one FPGA. Live traffic hits the LAN8720. Payload bytes reach loopback_echo without a CPU copy. The reply rebuilds Ethernet, IPv4, and UDP headers with swapped addresses and leaves through the same PHY.
2.1. Hierarchy
Inside udp_stack_core: eth_demux to ip_rx to udp_rx to loopback_echo to axis_fifo to stack_tx.
The synthesized top is top with u_mdio, u_phy, u_mac, u_stack, and u_seg7.
| Role | Path |
|---|---|
Board top |
|
Stack core |
|
Sim top |
|
3. Design
Each layer drops what it does not understand. A packet is echoed only when it is IPv4, UDP, destination-IP match, and destination port 50000.
-
RMII RX and MDIO link detect, with a 50/100 MHz clock-domain crossing.
link_updrivesLED[13]andLED[15]. -
eth_mac_axisstrips the RX preamble and emits TX preamble, FCS, and interframe gap. -
ip_rxparses the IPv4 header and filters on destination address. Non-UDP IPv4 raisesip_errorand is dropped. -
udp_rxfilters destination port50000. -
loopback_echoforwards the payload cut-through. Simulation latency is 2 cycles. -
stack_txrebuilds headers with source and destination swapped. TX IP and UDP checksums are zero-filled lab values. RX does not validate checksums beyond structure and the filter. -
ARP is detected by EtherType and stored in a single-entry
arp_cache. Dynamic lookup is not wired. Pre-seedHOST_MACintop.sv, or use broadcast255.255.255.255on a direct cable.
TCP, DHCP, and ICMP are dropped.
4. Interfaces
The bench face of the stack is the RJ45, a handful of LEDs, the 7-segment heartbeat, and two Python tools.
| Signal | Meaning |
|---|---|
|
RX / TX pulse |
|
Echo cycle count |
|
Link up |
Port |
UDP destination the filter accepts |
send_udp.py and bench_check.py send the datagram, including broadcast for a direct cable. Pin constraints live in nexys_a7_100t.xdc and match eth_rxd, eth_txd, mdc, and mdio in top.sv.
5. Bring-up
The bitstream is built in Vivado 2025.2 from core/rtl/. The GUI walkthrough is core/README.md. The post-route result for that output is Implementation: WNS +1.985 ns at 100 MHz on the 2026-08-10 build.
5.1. On the bench
-
Ethernet cable to the host or a direct cable using broadcast.
-
Program
top.bit. -
Confirm link LEDs before sending a packet.
-
send_udp.pyto port50000. -
The FPGA returns the datagram.
LED[12]shows the measured cycle count.
Switch-mirrored LEDs and the 7-segment heartbeat show the bitstream is alive before any packet is sent.
6. Verification
cocotb covers the loopback plus UDP, IP, ARP, and MAC gates. The latency source is sim/results/latency_summary.json.
The payload loopback budget is at most 20 cycles. The measured echo is 2 cycles, 20 ns at 100 MHz.
A passing sim does not replace the bench photo. Silicon evidence is the programmed part in Bring-up and the routed reports in Implementation.
7. Implementation
Numbers are copied from core/core.runs/impl_1/ for the 2026-08-10 build. They are not estimated.
| Report | File |
|---|---|
Timing |
|
Utilization |
|
Power |
|
7.1. Timing at 100 MHz
| Metric | Value |
|---|---|
WNS |
+1.985 ns |
TNS |
0.000 ns |
WHS |
+0.037 ns |
THS |
0.000 ns |
Failing endpoints |
0 |
7.2. Utilization
| Resource | Used | Percent |
|---|---|---|
Slice LUTs |
756 |
1.19% |
Slice FFs |
599 |
0.47% |
Bonded IOB |
52 |
24.76% |
BUFG |
2 |
6.25% |
The stack is light on fabric and heavy on I/O, which is what a wire-facing design should look like. Vivado’s project summary rounds LUT and FF to 1% and I/O to 25%.
7.3. Power and floorplan
Total on-chip power is 0.115 W (dynamic 0.018 W, device static 0.097 W). Estimated junction temperature is 25.5 °C. Source: top_power_routed.rpt.
8. Performance
Measured on the 2026-08-10 routed build and the cocotb loopback. Nothing in this table is extrapolated.
| Quantity | Value | Source |
|---|---|---|
Echo latency |
2 cycles, 20 ns |
|
Clock |
100 MHz, WNS +1.985 ns |
|
LUTs / FFs |
756 / 599 |
|
Power |
0.115 W |
|
Line-rate throughput of the 100 Mbps PHY is not separately benchmarked. The claim that is measured is the echo latency and the closed timing, not a packets-per-second sweep.
9. Known limitations
-
ARP is a lab stub. Dynamic lookup is not wired.
-
ITCH parsing is not in this repository. Payload handling stops at echo.
-
TCP, DHCP, and ICMP are dropped.
-
TX checksums are zero-filled. RX does not validate header checksums beyond structure and the filter.
-
A packet is echoed only for IPv4 + UDP + destination match + port
50000. -
Published numbers are the ones in Performance. Anything else is
TBD (unmeasured).
10. Engineering log
Each note below is the original project log, in chronological order. Open the arrow in the sidebar to jump to an entry.
10.1. 2026-08-08 — Understanding the UDP stack and connecting to ITCH
In my personal exploration (shoutouts to my Wharton folks), I have learned the need for both the ITCH protocol and a UDP stack. TCP is not your friend if speed is your goal. TCP has the three-way handshake protocol, which, for its own good, severely limits rapid data transmission.
UDP, however, couldn't care less if you received the full data or not; it serves to inject real-time data with the least latency. For first-time engineers in the trading field, the goal is to fire the latest open book data and make live decisions on buying low and selling high.
---
The Hardware Advantage
Processing ITCH feeds on a standard Von Neumann CPU is bottlenecked by the operating system's networking stack and the latency of mandatory data movement across the memory bus.
Parsing ITCH in hardware solves that by placing an FPGA in the loop instead of relying on PCIe bottlenecks and OS interrupts. This way, baked logic can make deterministic decisions in nanoseconds, and only inform the "slow" yet powerful CPU when necessary.
---
The Next Hurdle: The Networking Stack
How does itch-hw, for instance, receive the data?
The TCP Overhead
TCP uses a three-way handshake. All of this overhead costs bits, and thus adds latency or reduces throughput across a fixed benchmark:
A → BsendsSYNB → AsendsSYN-ACKA → BsendsACK
Additionally, 100 computers communicating via TCP with a server means the server needs to acknowledge each of them, and that overhead grows exponentially for 1000s of computers.
| Protocol | Priority | Analogy | Data Integrity |
|---|---|---|---|
TCP | Reliability | Downloading a file | Ensures packet order and maintains all data. Network interruptions pause downloads, never dropping data. |
UDP | Speed & Recency | Live video call | Drops lagging frames. Always pushes the absolute latest data, ignoring missing packets. |
The Goal
UDP multicast is the answer. If the network lags, we don't want an old frame loaded again. We always want the absolute latest data. But someone's got to build that hardware parser, and that's exactly what this project is for:
A custom UDP stack on my FPGA board!
About me
I’m Tyrone Marhguy, a Computer Engineering student at the University of Pennsylvania, class of 2028. This stack is my 100 Mbps UDP/IP datapath for a Nexys A7.
I grew up between Kumasi and Accra. In 2021, Achimota School denied me admission because I wear dreadlocks as an expression of my Rastafarian faith. Ghana’s High Court ordered the school to admit me; I finished secondary school there, then came to Penn on a full scholarship. BBC Pidgin and Deutsche Welle covered the case.
I design the architecture, build the boards, and write the software. Tomato is a 32-bit computer with a running FPGA implementation and discrete boards in progress. I also build systems software, including a search engine, a compiler, and a database, and I contribute fixes to open-source EDA tools such as LibreLane, OpenROAD, Verilator, and OpenFPGA. That work has included production software at Aragorn AI and battery-management hardware at Vero Electric.
Hardware
-
Tomato, a 32-bit computer (repository)
-
Pineapple GPU, a programmable 3D GPU on a Nexys A7
-
riscv64xO3, a 2-wide out-of-order RV64IMAC
-
MAC, a BFloat16 multiply-accumulate for SkyWater 130 nm
-
UDP/IP stack, a 100 Mbps datapath on a Nexys A7
-
ITCH parser, NASDAQ ITCH 5.0 on a Nexys A7
-
6T SRAM, a full-custom SRAM study
Software and systems
Open source
See open-source work for contributions to LibreLane, OpenROAD, Verilator, and OpenFPGA.