Module Hardcaml.Combinational_op

A custom combinational operation that can be inserted into a simulation.

A create_fn is required for Cyclesim.create_functional and a create_fn_mutable for Cyclesim.create_imperative. Only one needs to be provided and the other will be automatically derived. For efficiency's sake, prefer create_fn_mutable and Cyclsim.create_imperative.

type create_fn = Bits.t Hardcaml__.Import.list -> Bits.t Hardcaml__.Import.list

Implementation of the custom operation using Bits.t

type create_fn_mutable = Bits.Mutable.t Hardcaml__.Import.list -> Bits.Mutable.t Hardcaml__.Import.list -> Hardcaml__.Import.unit

Implementation of the custom operation using Bits.Mutable.t

type t
val sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.t
val create : ?⁠create_fn:create_fn -> ?⁠create_fn_mutable:create_fn_mutable -> Hardcaml__.Import.unit -> name:Hardcaml__.Import.string -> input_widths:Hardcaml__.Import.int Hardcaml__.Import.list -> output_widths:Hardcaml__.Import.int Hardcaml__.Import.list -> t

One must supply at least one of create_fn and create_fn_mutable.

val name : t -> Hardcaml__.Import.string
val create_fn : t -> create_fn
val create_fn_mutable : t -> create_fn_mutable
val instantiate : t -> inputs:Signal.t Hardcaml__.Import.list -> Signal.t Hardcaml__.Import.list

Instantiate a custom operation within a hardcaml design.