Module Interface.MakeSource

Parameters

module X : Pre

Signature

include Hardcaml_interface_types.Pre with type 'a t := 'a X.t
include Hardcaml_interface_types.Pre_partial with type 'a t := 'a X.t
include Ppx_compare_lib.Equal.S1 with type 'a t := 'a X.t
include Ppx_compare_lib.Equal.S1__local with type 'a t := 'a X.t
include Ppx_compare_lib.Comparable.S1 with type 'a t := 'a X.t
val compare : ('a -> 'a -> int) -> 'a X.t -> 'a X.t -> int
include Ppx_compare_lib.Comparable.S1__local with type 'a t := 'a X.t
val sexp_of_t : ('a -> Sexplib0.Sexp.t) -> 'a X.t -> Sexplib0.Sexp.t
val iter : 'a X.t -> f:('a -> unit) @ local -> unit
val iter2 : 'a X.t -> 'b X.t -> f:('a -> ('b -> unit) @ local) @ local -> unit
val map : 'a X.t -> f:('a -> 'b) @ local -> 'b X.t
val map2 : 'a X.t -> 'b X.t -> f:('a -> ('b -> 'c) @ local) @ local -> 'c X.t
val to_list : 'a X.t -> 'a list
val port_names_and_widths : (string * int) X.t
include Base.Equal.S1__local with type 'a t := 'a X.t
Sourceval port_names : string X.t

RTL names specified in the interface definition - commonly also the OCaml field name.

Sourceval port_widths : int X.t

Bit widths specified in the interface definition.

Sourceval const : 'a -> 'a X.t

const x sets each port to x

Sourcetype tag
Sourceval equal_tag : tag -> tag -> bool
Sourceval equal_tag__local : tag @ local -> tag @ local -> bool
Sourceval tags : tag X.t
Sourceval to_alist : 'a X.t -> (tag * 'a) list

Create association list indexed by tag.

Sourceval of_alist : (tag * 'a) list -> 'a X.t

Create interface from association list indexed by tag.

Sourceval sum_of_port_widths : int

Sum of all port widths specified in the interface definition.

Sourcemodule Unsafe_assoc_by_port_name : sig ... end
Sourceval zip : 'a X.t -> 'b X.t -> ('a * 'b) X.t
Sourceval zip3 : 'a X.t -> 'b X.t -> 'c X.t -> ('a * 'b * 'c) X.t
Sourceval zip4 : 'a X.t -> 'b X.t -> 'c X.t -> 'd X.t -> ('a * 'b * 'c * 'd) X.t
Sourceval zip5 : 'a X.t -> 'b X.t -> 'c X.t -> 'd X.t -> 'e X.t -> ('a * 'b * 'c * 'd * 'e) X.t
Sourceval map3 : 'a X.t -> 'b X.t -> 'c X.t -> f:('a -> ('b -> ('c -> 'd) @ local) @ local) @ local -> 'd X.t
Sourceval map4 : 'a X.t -> 'b X.t -> 'c X.t -> 'd X.t -> f:('a -> ('b -> ('c -> ('d -> 'e) @ local) @ local) @ local) @ local -> 'e X.t
Sourceval map5 : 'a X.t -> 'b X.t -> 'c X.t -> 'd X.t -> 'e X.t -> f: ('a -> ('b -> ('c -> ('d -> ('e -> 'f) @ local) @ local) @ local) @ local) @ local -> 'f X.t
Sourceval iter3 : 'a X.t -> 'b X.t -> 'c X.t -> f:('a -> ('b -> ('c -> unit) @ local) @ local) @ local -> unit
Sourceval iter4 : 'a X.t -> 'b X.t -> 'c X.t -> 'd X.t -> f:('a -> ('b -> ('c -> ('d -> unit) @ local) @ local) @ local) @ local -> unit
Sourceval iter5 : 'a X.t -> 'b X.t -> 'c X.t -> 'd X.t -> 'e X.t -> f: ('a -> ('b -> ('c -> ('d -> ('e -> unit) @ local) @ local) @ local) @ local) @ local -> unit
Sourceval fold : 'a X.t -> init:'acc -> f:('acc -> ('a -> 'acc) @ local) @ local -> 'acc
Sourceval fold2 : 'a X.t -> 'b X.t -> init:'acc -> f:('acc -> ('a -> ('b -> 'acc) @ local) @ local) @ local -> 'acc
Sourceval scan : 'a X.t -> init:'acc -> f:('acc -> ('a -> 'acc * 'b) @ local) @ local -> 'b X.t
Sourceval scan2 : 'a X.t -> 'b X.t -> init:'acc -> f:('acc -> ('a -> ('b -> 'acc * 'c) @ local) @ local) @ local -> 'c X.t
Sourceval offsets : ?rev:bool -> unit -> int X.t

Offset of each field within the interface. The first field is placed at the least significant bit, unless the rev argument is true.

Sourceval of_interface_list : 'a X.t list -> 'a list X.t

Take a list of interfaces and produce a single interface where each field is a list.

Sourceval to_interface_list : 'a list X.t -> 'a X.t 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.

Sourcemodule All (M : Base.Monad.S) : sig ... end

Similar to Monad.all for lists -- combine and lift the monads to outside the interface.

Sourceval or_error_all : 'a Core.Or_error.t X.t -> 'a X.t Core.Or_error.t

Equivalent to All(Or_error).all. This is made a special case for convenience.

Sourcemodule type Comb = sig ... end
Sourcemodule Make_comb (Comb : Comb.S) : Comb with type comb = Comb.t
Sourcemodule Of_bits : Comb with type comb = Bits.t
Sourcemodule Of_signal : sig ... end
Sourcemodule Of_clocked_signal : sig ... end
Sourcemodule Of_always : sig ... end

Helper functions to ease usage of the Always API when working with interfaces.

Sourcemodule Names_and_widths : sig ... end
Sourceval wave_formats : Wave_format.t X.t

Optional Metadata