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 X.t
val sexp_of_t : comb X.t -> Sexplib0.Sexp.t
val assert_widths : comb X.t -> Base.unit

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

val of_int : Base.int -> comb X.t

Each field is set to the constant integer value provided.

val pack : ?rev:Base.bool -> comb X.t -> comb

Pack interface into a vector.

val unpack : ?rev:Base.bool -> comb -> comb X.t

Unpack interface from a vector.

val mux : comb -> comb X.t Base.list -> comb X.t

Multiplex a list of interfaces.

val mux2 : comb -> comb X.t -> comb X.t -> comb X.t
val concat : comb X.t Base.list -> comb X.t

Concatenate a list of interfaces.

val priority_select_with_default : ((comb, comb X.t) Comb.with_valid2 Base.list -> default:comb X.t -> comb X.t) Comb.optional_branching_factor
val onehot_select : ((comb, comb X.t) Comb.with_valid2 Base.list -> comb X.t) Comb.optional_branching_factor
val widths : t -> Base.int X.t

Actual bit widths of each field.

val of_ints : Base.int X.t -> t

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

val wires : ?named:Base.bool -> ?from:t -> Base.unit -> 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 reg : ?enable:Signal.t -> Reg_spec.t -> t -> t

Defines a register over values in this interface. enable defaults to vdd.

val pipeline : ?attributes:Rtl_attribute.t Base.list -> ?enable:Signal.t -> n:Base.int -> Reg_spec.t -> t -> t

Defines a register pipeline over values in this interface. enable defaults to vdd and attributes defaults to an empty list.

val assign : t -> t -> Base.unit
val (<==) : t -> t -> Base.unit
val inputs : Base.unit -> t

inputs t is wires () ~named:true.

val outputs : t -> t

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

val apply_names : ?prefix:Base.string -> ?suffix:Base.string -> ?naming_op:(Signal.t -> Base.string -> Signal.t) -> t -> t

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

val validate : t -> Base.unit

Checks the port widths of the signals in the interface. Raises if they mismatch.

OCaml

Innovation. Community. Security.