Case study: verification environment
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.
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.
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.
| Block | Tests | Reference and checks | Found |
|---|---|---|---|
| openofdm_tx | 9 | An 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 reset | A B C D |
| openofdm_rx | 7 | Generated and captured vectors with expected headers and payloads; impairments (gain, CFO), AWGN at each rate's required SNR, header limits, back-to-back frames | K O |
| tx_intf | 8 | BRAM image equal to the frame model; DAC samples exact across the clock crossing; queue priority, A-MPDU, CTS-to-self, antenna modes | E F |
| rx_intf | 6 | DMA packet equal to descriptor + PSDU; filtered frames never reach DMA; DMA stalls and resets; loopback source; interrupt bounds | H I J |
| xpu | 10 | ACK, CTS and BlockAck images and SIFS timing; CSMA/CA state machine; retransmission and contention window; filter against a reference model; RSSI and listen-before-talk | G L M |
| side_ch | 5 | CSI and IQ record format as the driver parses it, match filters, triggers, equaliser count | H (waived) |
| chip | 12 | The six IPs wired as in the block design, peer station above | four testbench defects, all fixed |
Each test prints its bins; a script merges them across runs.
The same UVM code runs on Verilator, with no vendor licence, and on the Vivado simulator, which the receiver's Xilinx IP models need.
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.
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.
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