Arbiters.Round_robin_with_priorityRound-robin arbiters with priority.
These functions take an index at which to start searching for the next valid input. They will wrap at the top back down to 0 and then on to index-1.
type 'a combinational =
(module Hardcaml.Comb.S with type t = 'a) ->
index:'a Index.t ->
data:'a Hardcaml.With_valid.t Base.list ->
'a Hardcaml.With_valid.ttype sequential =
clock:Hardcaml.Signal.t ->
clear:Hardcaml.Signal.t ->
index:Hardcaml.Signal.t Index.t ->
data:Hardcaml.Signal.t Hardcaml.With_valid.t Base.list ->
Hardcaml.Signal.t Hardcaml.With_valid.tmodule type S = sig ... endRound-robin arbiter implementation which rotates the inputs using rotate_by_index and then uses priority_select to choose the active input.
module Count_zeros : SRound-robin arbiter implementation which uses masks and a trailing_zeros counter to find the next active input relative to index and then a mux to select the data. The architecture will work, but be horribly inefficient if the number of input sources is not a power of 2.
module Onehot_cleaner : SRound-robin arbiter implementation which converts the masked priority vector to onehot to select the first active source.
val combinational : ?arch:Hardcaml.Architecture.t -> 'a combinationalval sequential : ?arch:Hardcaml.Architecture.t -> Base.unit -> sequential