Hardcaml_xilinx.Ram_port_with_clearStatemachine for clearing a RAM via one of it's ports.
This wraps a Ram_port.t with a small state machine that on clear sets all memory location values to the clear_to value. While the memory is being cleared, the output clear_busy will be high. Writes and reads while in this state will be ignored.
The port signals require an extra mutliplexer delay for this function.
Note that use of other ports on the RAM for writing is discouraged during the clear operation. For maximum safety one can guard the write enable to the other port with
{other_port.write_enable &: ~:port_with_clear.clear_busy}
include Ppx_deriving_hardcaml_runtime.Interface.S with type 'a t := 'a tval sexp_of_t : ( 'a -> Sexplib0.Sexp.t ) -> 'a t -> Sexplib0.Sexp.tval iter : 'a t -> f:( 'a -> Base.unit ) -> Base.unitval to_list : 'a t -> 'a Base.listval t : (Base.string * Base.int) tinclude Base.Equal.S1 with type 'a t := 'a tval equal : 'a Base__Equal.equal -> 'a t Base__Equal.equalval port_names : Base.string tRTL names specified in the interface definition - commonly also the OCaml field name.
val port_widths : Base.int tBit widths specified in the interface definition.
module Unsafe_assoc_by_port_name : sig ... endval fold : 'a t -> init:'acc -> f:( 'acc -> 'a -> 'acc ) -> 'accval offsets : ?rev:Base.bool -> Base.unit -> Base.int tOffset of each field within the interface. The first field is placed at the least significant bit, unless the rev argument is true.
Take a list of interfaces and produce a single interface where each field is a list.
Create a list of interfaces from a single interface where each field is a list. Raises if all lists don't have the same length.
Similar to Monad.all for lists -- combine and lift the monads to outside the interface.
Equivalent to All(Or_error).all. This is made a special case for convenience.
module type Comb = sig ... endmodule Of_bits : Comb with type comb = Hardcaml.Bits.tmodule Of_signal : sig ... endmodule Of_always : sig ... endHelper functions to ease usage of the Always API when working with interfaces.
module Names_and_widths : sig ... endval create :
clear_to:Hardcaml.Signal.t ->
clear:Hardcaml.Signal.t ->
clock:Hardcaml.Signal.t ->
size:Base.int ->
port:Hardcaml.Signal.t Ram_port.t ->
Hardcaml.Signal.t t