package hardcaml

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
include Comb with type comb = Signal.t
type comb = Signal.t
type t = comb t
val sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.t
val widths : t -> Base.Int.t t

Actual bit widths of each field.

val assert_widths : t -> Hardcaml__.Import.Unit.t

Raise if the widths of t do not match those specified in the interface.

val of_int : Base.Int.t -> t

Each field is set to the constant integer value provided.

val of_ints : Base.Int.t t -> t

consts c sets each field to the integer value in c using the declared field bit width.

val const : Base.Int.t -> t
  • deprecated [since 2019-11] interface const
val consts : Base.Int.t t -> t
  • deprecated [since 2019-11] interface consts
val pack : ?rev:Hardcaml__.Import.Bool.t -> t -> comb

Pack interface into a vector.

val unpack : ?rev:Hardcaml__.Import.Bool.t -> comb -> t

Unpack interface from a vector.

val mux : comb -> t Hardcaml__.Import.List.t -> t

Multiplex a list of interfaces.

val mux2 : comb -> t -> t -> t
val concat : t Hardcaml__.Import.List.t -> t

Concatenate a list of interfaces.

val priority_select : ((comb, t) With_valid.t2 Hardcaml__.Import.List.t -> (comb, t) With_valid.t2) Comb.optional_branching_factor
val priority_select_with_default : ((comb, t) With_valid.t2 Hardcaml__.Import.List.t -> default:t -> t) Comb.optional_branching_factor
val onehot_select : ((comb, t) With_valid.t2 Hardcaml__.Import.List.t -> t) Comb.optional_branching_factor
val wires : ?named:Hardcaml__.Import.Bool.t -> ?from:t -> Hardcaml__.Import.Unit.t -> t

Create a wire for each field. If named is true then wires are given the RTL field name. If from is provided the wire is attached to each given field in from.

val assign : t -> t -> Hardcaml__.Import.Unit.t
val (<==) : t -> t -> Hardcaml__.Import.Unit.t
val inputs : Hardcaml__.Import.Unit.t -> t

inputs t is wires () ~named:true.

val outputs : t -> t

outputs t is wires () ~from:t ~named:true.

val apply_names : ?prefix:Hardcaml__.Import.String.t -> ?suffix:Hardcaml__.Import.String.t -> ?naming_op:(comb -> Hardcaml__.Import.String.t -> comb) -> t -> t

Apply name to field of the interface. Add prefix and suffix if specified.

OCaml

Innovation. Community. Security.