Case study: verification environment

A UVM environment for an FPGA Wi-Fi chip that had none

openwifi's six IPs each got their own UVM testbench against references that do not come from the RTL, and a chip testbench that talks to the design over the air like a second station. It runs on Verilator in cloud CI and on the Vivado simulator for the parts that need Xilinx IP.

Ran on our side. Vivado simulator on our own desktop build runner; Verilator checks on GitHub's hosted runners. No customer code or customer machines were involved.

57/57block and chip tests passing on one commit (2 h 27 min run)
11/11coverage spaces at target
13RTL defects found and fixed in the upstream design
220registers modelled from the driver's definitions, and read back on the board
Scoreboards: payload-exact frames both ways, ACK timing in the SIFS window, descriptors, interrupts, CSI records

The chip testbench needs no behavioural PHY model: the verified PHYs act as the other station. Twelve chip tests cover register access, TX, RX, ACK, retransmission, filtering, internal loopback, CSI capture, impairments and stress.

Six block testbenches, each against an independent reference

In every block testbench the neighbours of the IP are models, and results are compared with something that did not come from the RTL. Every testbench also carries interface assertions (AXI-Stream, AXI-Lite, PHY strobes) and a register access test.

BlockTestsReference and checksFound
openofdm_tx9An IEEE 802.11-2020 Python transmitter; exact sample count from 802.11 timing, per-symbol EVM to the fixed-point floor; rate sweep, A-MPDU, back-pressure, scrambler seeds, mid-packet resetA B C D
openofdm_rx7Generated and captured vectors with expected headers and payloads; impairments (gain, CFO), AWGN at each rate's required SNR, header limits, back-to-back framesK O
tx_intf8BRAM image equal to the frame model; DAC samples exact across the clock crossing; queue priority, A-MPDU, CTS-to-self, antenna modesE F
rx_intf6DMA packet equal to descriptor + PSDU; filtered frames never reach DMA; DMA stalls and resets; loopback source; interrupt boundsH I J
xpu10ACK, CTS and BlockAck images and SIFS timing; CSMA/CA state machine; retransmission and contention window; filter against a reference model; RSSI and listen-before-talkG L M
side_ch5CSI and IQ record format as the driver parses it, match filters, triggers, equaliser countH (waived)
chip12The six IPs wired as in the block design, peer station abovefour testbench defects, all fixed

Coverage: every space at target

Each test prints its bins; a script merges them across runs.

Two simulators, one code base

The same UVM code runs on Verilator, with no vendor licence, and on the Vivado simulator, which the receiver's Xilinx IP models need.

  • Cloud CI on every push: testbench elaboration, strict RTL lint, the transmitter against the Python reference, a golden set, and the transmitter's captures decoded by an independent receiver. The full gate runs on pull requests, nightly and on demand.
  • Desktop runner: block and chip regressions on the Vivado simulator, up to three chip tests in parallel.
  • Netlist: the chip testbench also runs on the synthesised core (33,283 LUTs, no latches). That run found a block-RAM read/write collision that RTL simulation cannot show.

Running on two simulators surfaced five Vivado simulator problems (a crash, a hang, randomisation failures, unlabelled assertion failures, a lock between parallel elaborations). The testbench code was rewritten around them, and the run script counts both assertion formats as failures.

New IP gets the same treatment

  • Soft-output decoder: RTL bit-exact against its Python model for every rate, puncturing and tail; the LLR path checked against the receiver's own descrambler.
  • Combiner: frame-exact against a reference model over five seeds and seven scenarios. Mutation checks: switching off the CRC flip or the pairing tag must make the test fail, and does.
  • Combiner to host interface: a testbench written after a board-only bug. Each of the four defects it covers, put back on its own, makes it fail.

When the testbench was wrong

Not every failure is an RTL bug. The chip testbench's own defects were found the same way and fixed in the testbench: peer agents on a gated clock, 16-bit ADC samples that wrapped a gain shift, a tied-off gain input that made an idle channel look busy, and a race in the transmit-start pulse. One reported issue (interrupt count) turned out to be interrupt coalescing that the testbench had not modelled.

Not covered yet. CSI values are checked for structure, not numerically. A full SoC simulation with the processor system and real DMA engines is still to build. Sign-off uses the Xilinx IP models; faster equivalents are for turnaround only.

No verification environment for your radio IP?

We build block and chip UVM, register models, coverage and CI, and hand them over.

Leo Zhang, PhD, BitExact Labs
leo@bitexactlabs.com · WeChat leocheungZR