RisingEdge.pro
Sign in to run

One-Hot Watchdog

The set-top box SoC's bus arbiter has one job: assert exactly one grant line out of eight, every cycle. Twice during bring-up it did not (once granting two DMA engines in the same burst window, once granting nobody at all), and both times the corruption took a week to trace back. So the bring-up build got a watchdog: a combinational checker on the grant bus, raising fault the moment the bus is anything other than one-hot.

Now the production netlist review has it on the chopping block. The die reads 97 percent full and the integration lead deletes anything that cannot justify its area. The offer is blunt: 30 cells in the synthesized netlist and it ships, one over and it is gone. The bring-up draft, which checks the bus against the eight legal one-hot patterns, synthesizes to 37. There are sharper ways to ask "is exactly one bit set". The team record stands at 21 cells.

Interface

PortDirectionTypeDescription
grantin8-bit vectorArbiter grant bus, one line per master
faultout1 bitHigh when grant is not one-hot

Behavior

  • fault = 0 when exactly one bit of grant is 1
  • fault = 1 when grant is all zeros
  • fault = 1 when two or more bits of grant are 1
  • The testbench drives all 256 values of grant

Constraints

Purely combinational: no clock, no registers, no latches. The area target is 30 cells or fewer after synthesis (the team record is 21); count by adding up the Netlist tab's stats-bar categories (gates, FFs, muxes, arithmetic). The testbench cannot check cell count; it only enforces behavior. The budget is on your honor, and the Netlist tab keeps the score.

combinationalarbiterdataflow
Loading editor...

Click Run to execute your code. Output will appear here.