Convert ethernet/RoCEv2 to pure VHDL, removing all generated Verilog and the 36 CRC table files - #1468
Open
ruck314 wants to merge 15 commits into
Open
Convert ethernet/RoCEv2 to pure VHDL, removing all generated Verilog and the 36 CRC table files#1468ruck314 wants to merge 15 commits into
ruck314 wants to merge 15 commits into
Conversation
…VHDL Nine Bluespec-generated Verilog primitives replaced by hand-written VHDL equivalents: BypassWire, RWire, RWire0, RegN, RegUN, ConfigRegN, CRegN5, CRegUN5, and Counter. Each was proven cycle-exact against its Verilog original before the original was removed.
FIFO2, FIFO20, and SizedFIFO. A native surf.Fifo wrapper was built and measured for SizedFIFO first; the reuse verdict rejected it, so a direct translation ships instead.
A surf.TrueDualPortRam wrapper was built and measured first; the reuse verdict rejected it, so a direct translation using a shared-variable memory ships instead.
33,443 lines of Bluespec-compiler Verilog transpiled to VHDL. mkQP is the leaf of the instantiation chain, not its summit, so it had to land first for anything above it to elaborate. Proven bit-exact against the Verilog original over random-scenario and directed goldens covering queue-pair progression, receiver-not-ready, completion, and reset.
15,995 lines transpiled, binding mkQP through a component declaration. Proven bit-exact through a full work-request-to-completion cycle.
3,944 lines transpiled, completing the three-level generated hierarchy. The Verilog module declares mkAxiSTransportLayer with a capital S; the emitted entity follows the input file stem, as the transpiler's own output-naming rule requires. Proven bit-exact over AXI-Stream scenarios.
Replaces the Bluespec-generated blue-crc engine with hand-written VHDL. The 36 lookup tables that shipped as separate .mem files are now a VHDL constant in RoCEv2ICrcPkg, generated from the same recurrence and proven against all 9,216 original values.
Both wrappers now instantiate the native VHDL engine. This removes the last two Bluespec-generated Verilog files outside blue-rdma along with all 36 crc_tab_*.mem lookup tables.
The engine instantiated the transport layer through a component declaration that existed only to reach a Verilog module. With the VHDL entity in the same library, the declaration is no longer needed.
blue-rdma and blue-lib load as VHDL 2008 by directory. RoCEv2 is also reachable in the non-Vivado path now: its whole dependency closure is available without Vivado, unlike the other ethernet subdirectories, whose ruckus.tcl files call loadIpCore over an .xci or .dcp.
mkQP.vhd and mkTransportLayer.vhd are machine-generated and must never be hand-edited, so style findings against them are not actionable.
roce_test_utils gains an independent Python iCRC reference model, its table generator, and an AXI-Stream protocol checker, with a simulator-free self-test. path_selector coverage asserts that RoCEv2 source changes route to the RoCEv2 suite.
Directed Send and Recv goldens covering every partial-beat width, the zero-residue contract, random breadth under backpressure, corner coverage, and reset recovery. A GHDL sweep proves the shipped table constant against the reference recurrence, mutation-proven so it fails when the table is wrong.
The instantiation closure is the whole converted directory plus the blue-lib children, so elaborating and simulating it is a stronger gate than any standalone analyze check. The directed case walks a queue pair from RESET to RTS, posts a payload, and checks every field of the emitted frame against a reference built independently of this RTL.
Each directory states what its files are, what was proven at conversion time against Verilog sources that no longer ship here, which gates run today, and what is not claimed.
ruck314
force-pushed
the
roce-vhdl-refactor
branch
from
August 17, 2026 03:17
41075b3 to
f8a948e
Compare
ruck314
marked this pull request as ready for review
August 17, 2026 04:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
PR #1465 bundles three changes into one merge: the Verilog to VHDL port, a functional rewrite (responder path, RDMA READ, multi queue pair), and a redesigned AXI-Lite map that breaks downstream PyRogue integrations. With the Verilog deleted there is no golden reference to attribute a failure to, and its validation suite lives outside surf, so surf CI gains no regression coverage.
This PR does only the port, bit-exact and register-compatible, and adds the cocotb suite surf was missing. Optimization comes after this PR, once the port has established a verified baseline to measure against: with one KCU105 and a full build per iteration.
Description
Convert
ethernet/RoCEv2from mixed Verilog/VHDL to pure VHDL. All 18 Bluespec-compiler-generated Verilog files and all 36crc_tab_*.memlookup tables are deleted, so the whole RoCEv2 stack can now be simulated with GHDL and cocotb, which was impossible while any Verilog remained because the aptghdlbuild has no mixed-language support. Resource use drops on theRoCEv2_10GbeRudpKcu105Examplebuild (LUT 88679 to 81168, FF 126004 to 113840, BRAM tiles 217 to 279.5 as the CRC tables move from LUT ROM into block RAM), timing closes with no failing endpoints, and the converted design has been validated on a KCU105.Details
blue-libBluespec runtime primitives in VHDL rather than transpiling them, becauseCRegN5intra-cycle read-after-write ordering andRWirevalid-bit semantics need human judgment.blue-rdmamodules to VHDL, each verified byte-regenerable from its unmodified Verilog source and compared cycle by cycle against it with zero mismatches before that source was deleted.blue-crcoutright with a nativeRoCEv2ICrcbuilt onsurf.CrcPkg, generating its lookup tables at elaboration from a deferred constant instead of reading the 36.memfiles. Send side drops from 6569 LUT / 7342 FF to 2147 LUT / 690 FF, receive side from 6582 LUT / 7170 FF to 2183 LUT / 705 FF.RoCEv2Engine.vhdas a direct VHDL entity, so the RDMA datapath is all-VHDL from the engine down.ethernet/RoCEv2inethernet/ruckus.tcl's non-Vivado branch, the one Ethernet subdirectory whose whole dependency closure is reachable without Vivado, so all 37 sources reach the GHDL import farm andmake analysiscovers them on every run.RoCEv2AxiStreamRdmatop level, whose directed-write case walks a queue pair from RESET to RTS and checks the resulting frame field by field against a spec-derived reference.blue-rdmatranslations, along with roughly 1 MB of committed vectors, since it recorded from Verilog sources this change deletes and CI never installediverilogto record with.blue-rdma/README.mdkeeps its conversion-time findings as history, separate from what runs on every push.mkQP.vhdandmkTransportLayer.vhdfrom VSG, since both are regenerated rather than edited and exceed the file-length and line-length rules. They were the only two files in the repository reporting either rule.Validation performed:
make MODULES="$PWD" analysisexited 0, analyzing 533 files including all 37 underethernet/RoCEv2.pytest -n auto --dist=worksteal tests: 936 passed, 21 skipped, no failures. The skips are pre-existing and outside the changed directories.tests/ethernet/RoCEv2passed 32 items with no skips, 14 of them launching a GHDL simulation.rocev2PrbsTest.pyruns on a KCU105 across three configurations all exited 0 with a PASS verdict and zero receive errors.