package hardcaml_axi

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

Packed arrays are a flattened version of X.t represented as an array of 32 bit vectors.

They may be used as fields within a register interface to encode larger or grouped values.

Parameters

module X : sig ... end

Signature

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

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

val port_widths : Base.int t

Bit widths specified in the interface definition.

val const : 'a -> 'a t

const x sets each port to x

type tag
val tags : tag t
val to_alist : 'a t -> (tag * 'a) Base.list

Create association list indexed by tag.

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

Create interface from association list indexed by tag.

val sum_of_port_widths : Base.int

Sum of all port widths specified in the interface definition.

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

val 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.

val 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.

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

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

val 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.

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

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

module Names_and_widths : sig ... end
val to_packed_array : (module Hardcaml.Comb.S with type t = 'a) -> 'a X.t -> 'a t
val to_packed_array_latch_on_read : read_latency:Base.int -> Hardcaml.Reg_spec.t -> Hardcaml.Signal.t X.t -> Hardcaml.Signal.t t -> Hardcaml.Signal.t t
val of_packed_array : (module Hardcaml.Comb.S with type t = 'a) -> 'a t -> 'a X.t
val of_packed_array_with_valid : (module Hardcaml.Comb.S with type t = 'a) -> 'a Hardcaml.With_valid.t t -> 'a Hardcaml.With_valid.t X.t
val extract_field_as_int : (Base.int t -> Base.int) X.t
val extract_field_as_int64 : (Base.int t -> Base.int64) X.t
val extract_field_as_bytes : (Base.int t -> Base.Bytes.t -> Base.unit) X.t
val extract_field_as_string : (Base.int t -> Base.String.t) X.t
val set_field_as_int : (Base.int t -> Base.int -> Base.unit) X.t
val set_field_as_int64 : (Base.int t -> Base.int64 -> Base.unit) X.t
val set_field_as_bytes : (Base.int t -> Base.Bytes.t -> Base.unit) X.t
val set_field_as_string : (Base.int t -> Base.String.t -> Base.unit) X.t
val hold : Register_mode.t t
val of_packed_int_array : Base.int t -> Base.int X.t
val to_packed_int_array : Base.int X.t -> Base.int t
OCaml

Innovation. Community. Security.