Module Hardcaml_kernel.InterfaceSource

Interfaces specify the widths and names of a group of signals, and some functions for manipulating the signals as a group.

They are generally used with ppx_hardcaml as follows

  type t = { ... } [@@deriving hardcaml]

The sexp_of is required, and must appear before hardcaml. This syntax generates a call to Interface.Make, which therefore does not need to be explicitly called.

Sourcemodule type S = sig ... end
Sourcemodule type S_Of_signal = sig ... end
Sourcemodule type Ast = sig ... end

The PPX can optionally generate an ast field containing an Ast.t. This represents the structure of the interface, including how it is constructed from fields, arrays, lists and sub-modules.

Sourcemodule type Empty = sig ... end
Sourcemodule Ast : Ast

The PPX can optionally generate an ast field containing an Ast.t. This represents the structure of the interface, including how it is constructed from fields, arrays, lists and sub-modules.

Sourcemodule type S_with_ast = sig ... end
Sourcemodule type S_with_clock_domains = sig ... end
Sourcemodule Create_fn (I : S) (O : S) : sig ... end

Type of functions representing the implementation of a circuit from an input to output interface.

Sourcemodule Make (X : Pre) : S with type 'a t := 'a X.t
Sourcemodule Make_with_wave_formats (X : sig ... end) : S with type 'a t := 'a X.t
Sourcemodule Update (Pre : Pre) (M : sig ... end) : S with type 'a t = 'a Pre.t

Recreate a Hardcaml Interface with the same type, but different port names / widths.

Sourcemodule Make_interface_with_conversion (Repr : S) (M : sig ... end) : S with type 'a t = 'a M.t

Creates a new hardcaml interface by converting between functions. This can be used to implement Hardcaml.Interface.S on types that otherwise can't use @@deriving hardcaml