Module Hardcaml.Recipe
Hardware generation in an imperative style.
This module is undergoing significant rewriting and refactoring, and subject to many breaking changes.
include Hardcaml__.Import.Monad.S with type 'a t := 'a t
include Base__.Monad_intf.S_without_syntax with type 'a t := 'a t
module Monad_infix : Base__.Monad_intf.Infix with type 'a t := 'a tval return : 'a -> 'a treturn vreturns the (trivial) computation that returns v.
val skip : Hardcaml__.Import.unit tskip 1 cycle
val wait : Hardcaml__.Import.int -> Hardcaml__.Import.unit tskip n cycles
val par : ?comb_fin:Hardcaml__.Import.bool -> 'a t Hardcaml__.Import.list -> 'a Hardcaml__.Import.list tPerform ts in parallel.
comb_fincontrols the finish signal generation. When false and extra cycle is taken after the ts complete to generate thefinsignal. Otherwise extra combinatorial logic is generated to ensure thefinsignal toggles on the same cycle as the last t to complete.
val par2 : ?comb_fin:Hardcaml__.Import.bool -> 'a t -> 'b t -> ('a * 'b) tval (|||) : 'a t -> 'b t -> ('a * 'b) tval cond : Signal.t -> 'a t -> 'b t -> Hardcaml__.Import.unit tcond c t fperformstifcis high, otherwise performsf
val wait_while : Signal.t -> Hardcaml__.Import.unit twait until
tis low
val wait_until : Signal.t -> Hardcaml__.Import.unit twait until
tis high
val follow : clock:Signal.t -> enable:Signal.t -> Signal.t -> 'a t -> Signal.t * 'afollow t and get result
val new_var : ?name:Hardcaml__.Import.string -> Hardcaml__.Import.int -> var tcreate an new
nbit register
val assign : (var * Signal.t) Hardcaml__.Import.list -> Hardcaml__.Import.unit tassign list of registers - takes 1 cycle
val write_var : var -> Signal.t -> Hardcaml__.Import.unit twrite register with value
val modify_var : (Signal.t -> Signal.t) -> var -> Hardcaml__.Import.unit tmodify current value of resgiter
val rewrite_var : (Signal.t -> Signal.t) -> var -> var -> Hardcaml__.Import.unit tread a register, modify value, write a second register
module SList : Same with type 'a same = 'a Hardcaml__.Import.listmodule SArray : Same with type 'a same = 'a Hardcaml__.Import.array