Arbiters.Index
Priority is specified as either a offset to start searching from, or as a special mask.
The mask has the form:
0
11..1111
1
11..1110
2
11..1100
3
11..1000
num_sources-1
10..0000
val next_mask : Hardcaml.Signal.t -> Hardcaml.Signal.t
Compute the next value of a priority mask register. The initial (reset) value should be all ones, though it probably doesn't matter too much if it comes up all zeros as it will correctly set itself in the next cycle.