Skip to content

Three sensible constraints that can never all hold – and nobody checks randomize()

best-practice / multi-constraint / plausible-pass

SpecFor a DMA descriptor (addr, len)

  • addr (descriptor start) lands in the start window [0x1000:0x1FFF].
  • len (transfer length) is at least 4097 bytes, the current minimum burst.
  • The buffer this window addresses is 8 KB (0x2000 bytes), based at 0x1000; a descriptor never reads past its end.

desc_item is what a model writes with confidence from that spec: one constraint per bullet, each fine on its own. They only contradict each other together.

The loop that drives it is the usual create, randomize, use. Right now every descriptor comes back with addr == 0 and len == 0, and randomize()’s return value, which says so, is never read. Verilator prints an UNSATCONSTR warning each time, but a warning fails no regression.

Fix what’s actually broken against the spec, not a leftover default.

Source on GitHub

unchecked_randomize_hides_unsat_conflict.sv