package hardcaml_step_testbench

  1. Overview
  2. Docs
Hardcaml Testbench Monad

Install

Dune Dependency

Authors

Maintainers

Sources

v0.17.0.tar.gz
sha256=a21b13cf03b84f06471e7c31ecbac8df1b08f8ac1156d0f3a41d2250ea293b2f

doc/hardcaml_step_testbench.digital_components/Digital_components/Component/Make/index.html

Module Component.MakeSource

Parameters

Signature

Sourcemodule Input_monad : Base.Monad.S with type 'a t = 'a Input_monad.t
Sourcetype ('i, 'o) t_

t is mostly abstract, but we expose is as a constructor so that the type checker knows that t is injective.

Sourcetype ('i, 'o) t =
  1. | T of ('i, 'o) t_
Sourceval sexp_of_t : ('i -> Sexplib0.Sexp.t) -> ('o -> Sexplib0.Sexp.t) -> ('i, 'o) t -> Sexplib0.Sexp.t
Sourcetype ('i, 'o) t_module = (module Digital_components__.Component_intf.Module.S with type Input.t = 'i and type Output.t = 'o)
Sourceval sexp_of_input : ('i, _) t -> 'i -> Base.Sexp.t
Sourceval sexp_of_output : (_, 'o) t -> 'o -> Base.Sexp.t
Sourceval input_module : ('i, _) t -> 'i Data.t
Sourceval output_module : (_, 'o) t -> 'o Data.t
Sourceval create : ('i, 'o) t_module -> ('i, 'o) t
Sourceval output : ('i, 'o) t -> 'i -> 'o

output returns the output based on an input and its current state, but does not update the state. A component is called "combinational" if output t i ignores t. A component is called "sequential" if output t i uses t. A sequential component is called a "moore machine" if it ignores i and a "mealy machine" if it uses i.

Sourceval update_state : ?prune:Base.bool -> ('i, _) t -> 'i -> Base.unit

update_state updates t's state based on an input and its current state

Sourceval run_with_inputs : ('i, 'o) t -> 'i Base.list -> ('i * 'o) Base.list

run_with_inputs t is runs length is steps with t, on each step calling update_state and then output, pairing the input of that step with the output.

Sourceval prune_children : ('i, 'o) t -> Base.unit

Remove all children that has finished

Sourceval has_children : ('i, 'o) t -> Base.bool

Whether the component has any children

Sourcemodule Next_input : sig ... end
Sourceval run_until_finished : ?show_steps:Base.bool -> ('i, 'o) t -> first_input:'i -> next_input:('o -> 'i Next_input.t Input_monad.t) -> Base.unit Input_monad.t

Component combinators

Sourceval sequence : ('a, 'b) t -> ('b, 'c) t -> ('a, 'c) t
Sourceval map_input : ('i2, 'o) t -> 'i1 Data.t -> f:('i1 -> 'i2) -> ('i1, 'o) t
Sourceval map_output : ('i, 'o1) t -> 'o2 Data.t -> f:('o1 -> 'o2) -> ('i, 'o2) t

Combinational components

Sourcemodule Combinational : sig ... end
Sourceval create_combinational : ('i, 'o) Combinational.t -> ('i, 'o) t

Sequential components

Sourceval flip_flop : Base.unit -> (Base.bool, Base.bool) t
OCaml

Innovation. Community. Security.