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.

Nexys A7 on the bench with Ethernet connected and the link LED lit
Nexys A7-100T running the UDP stack

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

Post-route utilization. LUT 1.19 percent. Flip-flops 0.47 percent. I/O 24.8 percent. BUFG 6.25 percent.
Figure 1. Post-route utilization

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.

UDP echo pathRMII PHY: LAN8720 ingress.; MAC: Preamble strip on receive, FCS on transmit.; IPv4 and UDP: Destination filter, port 50000.; Echo: Swap headers. 2-cycle payload latency in simulation.; RMII egress: The reply leaves through the same PHY. UDP echo path Cut-through loop on one FPGA 01 RMII PHY LAN8720 ingress. 02 MAC Preamble strip on receive, FCS on transmit. 03 IPv4 and UDP Destination filter, port 50000. 04 Echo Swap headers. 2-cycle payload latency in simulation. 05 RMII egress The reply leaves through the same PHY.
Figure 2. Cut-through echo

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.

Synthesized RTL schematic
Figure 3. RTL schematic, board I/O and PHY/MAC ingress
Synthesized RTL schematic
Figure 4. RTL schematic, stack core and RMII egress
Role Path

Board top

core/rtl/top.sv

Stack core

core/rtl/stack/udp_stack_core.sv

Sim top

sim/hdl/udp_loopback_top.sv

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_up drives LED[13] and LED[15].

  • eth_mac_axis strips the RX preamble and emits TX preamble, FCS, and interframe gap.

  • ip_rx parses the IPv4 header and filters on destination address. Non-UDP IPv4 raises ip_error and is dropped.

  • udp_rx filters destination port 50000.

  • loopback_echo forwards the payload cut-through. Simulation latency is 2 cycles.

  • stack_tx rebuilds 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-seed HOST_MAC in top.sv, or use broadcast 255.255.255.255 on 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

LED[9] / LED[10]

RX / TX pulse

LED[12]

Echo cycle count

LED[13] / LED[15]

Link up

Port 50000

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.

Vivado hardware manager showing the Nexys A7 programmed with the UDP stack
Figure 5. Hardware manager with the programmed part

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

Nexys A7 on the bench with Ethernet connected
Figure 6. Nexys A7 running the stack
  1. Ethernet cable to the host or a direct cable using broadcast.

  2. Program top.bit.

  3. Confirm link LEDs before sending a packet.

  4. send_udp.py to port 50000.

  5. 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.

Measured UDP echo latency of 2 cycles against a 20-cycle budget
Figure 7. Echo latency against the 20-cycle budget

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

top_timing_summary_routed.rpt

Utilization

top_utilization_placed.rpt

Power

top_power_routed.rpt

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

Post-route slack: WNS 1.985 ns and WHS 0.037 ns
Figure 8. Setup and hold slack
Vivado project summary with synthesis and implementation complete and WNS +1.985 ns
Figure 9. Vivado project summary
Vivado dashboard showing utilization
Figure 10. Vivado dashboard

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.

Post-route device floorplan on the Artix-7
Figure 11. Post-route floorplan
Synthesized design schematic
Figure 12. Synthesis schematic

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

sim/results/latency_summary.json

Clock

100 MHz, WNS +1.985 ns

top_timing_summary_routed.rpt

LUTs / FFs

756 / 599

top_utilization_placed.rpt

Power

0.115 W

top_power_routed.rpt

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:

  1. A → B sends SYN
  2. B → A sends SYN-ACK
  3. A → B sends ACK

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.

ProtocolPriorityAnalogyData Integrity
TCPReliabilityDownloading a fileEnsures packet order and maintains all data. Network interruptions pause downloads, never dropping data.
UDPSpeed & RecencyLive video callDrops 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

Software and systems

Open source

See open-source work for contributions to LibreLane, OpenROAD, Verilator, and OpenFPGA.