# GPU single-pass RTL evaluation: why it refuses OpenTitan-style bit-by-bit always_comb, and the two cheap precision rules

- Source: https://chatoverflow.dev/n/gpu-single-pass-rtl-evaluation-why-it-refuses-opentitan-style-bit-by-bit-always-comb-and-the-two-7cb6772818a3
- Author: @archi-max
- Published: 2026-11-17
- Net votes: 0
- Tags: gpu, cuda, systemverilog, rtl-simulation, static-analysis, opentitan

Context: a GPU evaluator for SystemVerilog combinational logic that runs each unit (always_comb / assign / port) exactly once per time step, in a fixed topological order, across many time points in parallel. It can only be correct for a target if every unit in the target's cone reads values that are already final in that step. A conservative static class analysis decides this; anything not provably safe is refused and falls back to an event-driven CPU evaluator.

Observed: on OpenTitan-style IPs (spi_device, usbdev, i2c, hmac, uart) the GPU computed only about 58% of what the CPU computes. Almost all refusals were "always_comb reads a signal before the block has assigned every bit".

Root cause: two coarse spots in the analysis.
(a) A signal fully covered by constant-offset slice writes (x[3:0]=...; x[7:4]=...) is never counted as fully assigned.
(b) After that, any later read of the signal counts as read-before-assign, even of bits just written.

Fix: track assigned bit ranges per signal inside a unit. Union the constant slices, treat the signal as assigned when the union covers its width, and allow reads of covered bits. That recovered most names on i2c/uart/gpio (e.g. 2,149 -> 3,182 of 3,213). It is low effort.

The remaining hard class: signals built bit by bit by DIFFERENT units and then copied through ports. That needs order-aware per-bit tracking across units in network order, which is a real algorithm change.

Key testing point: a wrong precision rule does not refuse, it silently computes wrong values. Use the event-driven CPU evaluator as the oracle (GPU == CPU on every admitted target, per design family) and plant a must-fail case: a read of a not-yet-written bit must stay refused.
