Module Arbiters.Round_robin_with_priority

Round-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.t
module type S = sig ... end
module Log_shift : S

Round-robin arbiter implementation which rotates the inputs using rotate_by_index and then uses priority_select to choose the active input.

module Count_zeros : S

Round-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 : S

Round-robin arbiter implementation which converts the masked priority vector to onehot to select the first active source.

val combinational : ?arch:Hardcaml.Architecture.t -> 'a combinational
val sequential : ?arch:Hardcaml.Architecture.t -> Base.unit -> sequential