Module Hardcaml__.Fifo
include Hardcaml__.Fifo_intf.S
include module type of Hardcaml__.Fifo_intf.T with type 'a T.t = 'a Hardcaml__.Fifo_intf.T.t
type 'a t= 'a Hardcaml__.Fifo_intf.T.t={q : 'a;full : 'a;empty : 'a;nearly_full : 'a;nearly_empty : 'a;used : 'a;}
val sexp_of_t : ('a -> Ppx_sexp_conv_lib.Sexp.t) -> 'a t -> Ppx_sexp_conv_lib.Sexp.tval iter : 'a t -> f:('a -> Hardcaml__.Import.unit) -> Hardcaml__.Import.unitval iter2 : 'a t -> 'b t -> f:('a -> 'b -> Hardcaml__.Import.unit) -> Hardcaml__.Import.unitval map : 'a t -> f:('a -> 'b) -> 'b tval map2 : 'a t -> 'b t -> f:('a -> 'b -> 'c) -> 'c tval to_list : 'a t -> 'a Hardcaml__.Import.listval t : (Hardcaml__.Import.string * Hardcaml__.Import.int) tval equal : 'a Hardcaml__.Import.Equal.equal -> 'a t Hardcaml__.Import.Equal.equalval port_names : Hardcaml__.Import.string tval port_widths : Hardcaml__.Import.int tval to_alist : 'a t -> (Hardcaml__.Import.string * 'a) Hardcaml__.Import.listval of_alist : (Hardcaml__.Import.string * 'a) Hardcaml__.Import.list -> 'a tval zip : 'a t -> 'b t -> ('a * 'b) tval zip3 : 'a t -> 'b t -> 'c t -> ('a * 'b * 'c) tval zip4 : 'a t -> 'b t -> 'c t -> 'd t -> ('a * 'b * 'c * 'd) tval zip5 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> ('a * 'b * 'c * 'd * 'e) tval map3 : 'a t -> 'b t -> 'c t -> f:('a -> 'b -> 'c -> 'd) -> 'd tval map4 : 'a t -> 'b t -> 'c t -> 'd t -> f:('a -> 'b -> 'c -> 'd -> 'e) -> 'e tval map5 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> f:('a -> 'b -> 'c -> 'd -> 'e -> 'f) -> 'f tval iter3 : 'a t -> 'b t -> 'c t -> f:('a -> 'b -> 'c -> Hardcaml__.Import.unit) -> Hardcaml__.Import.unitval iter4 : 'a t -> 'b t -> 'c t -> 'd t -> f:('a -> 'b -> 'c -> 'd -> Hardcaml__.Import.unit) -> Hardcaml__.Import.unitval iter5 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> f:('a -> 'b -> 'c -> 'd -> 'e -> Hardcaml__.Import.unit) -> Hardcaml__.Import.unitval fold : 'a t -> init:'acc -> f:('acc -> 'a -> 'acc) -> 'accval fold2 : 'a t -> 'b t -> init:'acc -> f:('acc -> 'a -> 'b -> 'acc) -> 'accval scan : 'a t -> init:'acc -> f:('acc -> 'a -> 'acc * 'b) -> 'b tval scan2 : 'a t -> 'b t -> init:'acc -> f:('acc -> 'a -> 'b -> 'acc * 'c) -> 'c tval offsets : ?rev:Hardcaml__.Import.bool -> Hardcaml__.Import.unit -> Hardcaml__.Import.int tval of_interface_list : 'a t Hardcaml__.Import.list -> 'a Hardcaml__.Import.list tval to_interface_list : 'a Hardcaml__.Import.list t -> 'a t Hardcaml__.Import.list
module type Comb = sig ... endmodule Make_comb : functor (Comb : Hardcaml.Comb.S) -> sig ... endmodule Of_bits : sig ... endmodule Of_signal : sig ... endtype 'a create_params= ?nearly_empty:Hardcaml__.Import.int -> ?nearly_full:Hardcaml__.Import.int -> ?overflow_check:Hardcaml__.Import.bool -> ?reset:Hardcaml.Signal.t -> ?underflow_check:Hardcaml__.Import.bool -> ?ram_attributes:Hardcaml.Rtl_attribute.t Hardcaml__.Import.list -> ?scope:Hardcaml.Scope.t -> 'atype create_fifo= (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 -> Hardcaml.Signal.t t) create_params
module Kinded_fifo = Hardcaml__.Fifo_intf.Kinded_fifoBase RTL FIFO
val create : ?showahead:Hardcaml__.Import.bool -> Hardcaml__.Fifo_intf.T.create_fifocreate ~clock ~clear ~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. The implementation ensures the output is registered and timing performance is good - nearly as fast as the underlying RAM allows..Note;
showaheadis sometimes referred to as "first word fall through". It uses the write-before-read ram mode which is problematic in synthesis so we include special logic that performs collision detection.The
usedoutput indicates the number of elements currently in the FIFO.
Functions to derive fifo architectures from other architecetures.
val showahead_fifo_of_classic_fifo : Kinded_fifo.create_classic -> Kinded_fifo.create_showahead Hardcaml__.Import.Staged.t
Derived FIFO architectures.
val create_classic_with_extra_reg : Hardcaml__.Fifo_intf.T.create_fifoAdds an extra output register to the non-showahead fifo. This delays the output, but ensures there is no logic data on the fifo output. Adds an extra cycle of latency (2 cycles from write to empty low).
val create_showahead_from_classic : create_fifoConstructs a showahead fifo from a non-showahead fifo. Only modifies the control flags. Has 2 cycles of latency.
val create_showahead_with_extra_reg : create_fifoConstructs a fifo similarly to
create_showahead_from_classicand ensures the output data is registered. Has 3 cycles of latency, but is slightly faster thancreate ~showahead:true- it seems to only be limited by the underlying RAM frequency.
module type Config = Hardcaml__.Fifo_intf.Configmodule With_interface : functor (Config : Config) -> sig ... endCreate FIFO using interfaces.