Module Hardcaml__.Fifo
type t={q : Hardcaml.Signal.t;full : Hardcaml.Signal.t;empty : Hardcaml.Signal.t;nearly_full : Hardcaml.Signal.t;nearly_empty : Hardcaml.Signal.t;used : Hardcaml.Signal.t;}
val sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.t
val create : ?nearly_empty:Hardcaml__.Import.int -> ?nearly_full:Hardcaml__.Import.int -> ?overflow_check:Hardcaml__.Import.bool -> ?reset:Hardcaml.Signal.t -> ?showahead:Hardcaml__.Import.bool -> ?underflow_check:Hardcaml__.Import.bool -> Hardcaml__.Import.unit -> capacity:Hardcaml__.Import.int -> clock:Hardcaml.Signal.t -> clear:Hardcaml.Signal.t -> wr:Hardcaml.Signal.t -> d:Hardcaml.Signal.t -> rd:Hardcaml.Signal.t -> tcreate ~clk ~clr ~wr ~d ~rd capacitybuilds a FIFO withcapacityelements which is written withdwhenwris high and read whenrdis high.The default reset configuration is to use a synchronous
clrsignal. An asynchronousrstmay be optionally provided. One ofclrorrstmust be non-empty.Optional overflow and underflow checking may be used. Data will not be written(/read) when the fifo is
full(/empty) regardles or thewr/(rd) signals.nearly_emtpyandnearly_fullmay be programmed to go high when the fifo is nearing an underflow or overflow state.The
showaheadmode changes the read behaviour of the FIFO. When showahead isfalseread data is available 1 cycle afterrdis high. With showaheadtruethe data is available on the same cycle asrdis high. To supportshowaheadbehaviour the timing of thefull/emptyflag also changes (although they still correctly indicate when it is safe to read or write to the FIFO).showaheadmode has some extra cost in terms of extra logic and reduced frequency.Note;
showaheadis sometimes referred to as "first word fall through".The
usedoutput indicates the number of elements currently in the FIFO.