package hardcaml

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Make_enums.One_hotSource

include Interface.S
Sourcetype 'a t
Sourceval sexp_of_t : ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.t
Sourceval iter : 'a t -> f:('a -> Base.unit) -> Base.unit
Sourceval iter2 : 'a t -> 'b t -> f:('a -> 'b -> Base.unit) -> Base.unit
Sourceval map : 'a t -> f:('a -> 'b) -> 'b t
Sourceval map2 : 'a t -> 'b t -> f:('a -> 'b -> 'c) -> 'c t
Sourceval to_list : 'a t -> 'a Base.list
Sourceval port_names_and_widths : (Base.string * Base.int) t
include Base.Equal.S1 with type 'a t := 'a t
Sourceval port_names : Base.string t

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

Sourceval port_widths : Base.int t

Bit widths specified in the interface definition.

Sourceval const : 'a -> 'a t

const x sets each port to x

Sourcetype tag
Sourceval tags : tag t
Sourceval to_alist : 'a t -> (tag * 'a) Base.list

Create association list indexed by tag.

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

Create interface from association list indexed by tag.

Sourceval sum_of_port_widths : Base.int

Sum of all port widths specified in the interface definition.

Sourcemodule Unsafe_assoc_by_port_name : sig ... end
Sourceval zip : 'a t -> 'b t -> ('a * 'b) t
Sourceval zip3 : 'a t -> 'b t -> 'c t -> ('a * 'b * 'c) t
Sourceval zip4 : 'a t -> 'b t -> 'c t -> 'd t -> ('a * 'b * 'c * 'd) t
Sourceval zip5 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> ('a * 'b * 'c * 'd * 'e) t
Sourceval map3 : 'a t -> 'b t -> 'c t -> f:('a -> 'b -> 'c -> 'd) -> 'd t
Sourceval map4 : 'a t -> 'b t -> 'c t -> 'd t -> f:('a -> 'b -> 'c -> 'd -> 'e) -> 'e t
Sourceval map5 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> f:('a -> 'b -> 'c -> 'd -> 'e -> 'f) -> 'f t
Sourceval iter3 : 'a t -> 'b t -> 'c t -> f:('a -> 'b -> 'c -> Base.unit) -> Base.unit
Sourceval iter4 : 'a t -> 'b t -> 'c t -> 'd t -> f:('a -> 'b -> 'c -> 'd -> Base.unit) -> Base.unit
Sourceval iter5 : 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> f:('a -> 'b -> 'c -> 'd -> 'e -> Base.unit) -> Base.unit
Sourceval fold : 'a t -> init:'acc -> f:('acc -> 'a -> 'acc) -> 'acc
Sourceval fold2 : 'a t -> 'b t -> init:'acc -> f:('acc -> 'a -> 'b -> 'acc) -> 'acc
Sourceval scan : 'a t -> init:'acc -> f:('acc -> 'a -> 'acc * 'b) -> 'b t
Sourceval scan2 : 'a t -> 'b t -> init:'acc -> f:('acc -> 'a -> 'b -> 'acc * 'c) -> 'c t
Sourceval offsets : ?rev:Base.bool -> Base.unit -> Base.int 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 t Base.list -> 'a Base.list t

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

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

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

Sourcemodule type Comb = sig ... end
Sourcemodule Names_and_widths : sig ... end
Sourceval of_enum : (module Comb.S with type t = 'a) -> Cases.t -> 'a t
Sourceval to_enum_exn : Bits.t t -> Cases.t
Sourceval (==:) : (module Comb.S with type t = 'a) -> 'a t -> 'a t -> 'a
Sourceval match_ : (module Comb.S with type t = 'a) -> ?default:'a -> 'a t -> (Cases.t * 'a) Base.list -> 'a
Sourceval to_raw : 'a t -> 'a
type 'a outer := 'a t
Sourcemodule Of_signal : sig ... end
Sourcemodule Of_bits : sig ... end
Sourcemodule Of_always : sig ... end

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

Sourcemodule Make_comb (X : Comb.S) : sig ... end

Set an input port in simulation to a concrete Cases value.

Sourceval sim_set_raw : Bits.t Base.ref t -> Bits.t -> Base.unit

Similar to sim_set, but operates on raw Bits.t instead.

Read an output port from simulation to a concreate Cases value. Returns Ok enum when the Bits.t value can be parsed, and Error _ when the value is unhandled.

Sourceval sim_get_exn : Bits.t Base.ref t -> Cases.t

Equivalent to ok_exn (sim_get x)

Sourceval sim_get_raw : Bits.t Base.ref t -> Bits.t

Similar to sim_get, but operates on raw Bits.t instead. This doesn't return _ Or_error.t. Undefined values will be returned as it is.

Sourceval unwrap : 'a t -> 'a
Sourcemodule Unsafe : sig ... end
OCaml

Innovation. Community. Security.