Hardcaml_circuits.StagesRepresents a computation broken into multiple stages. Each stage is returned in an array.
Used to implement generic register pipelining structures.
val sexp_of_t : ( 'a -> Sexplib0.Sexp.t ) -> 'a t -> Sexplib0.Sexp.tFunction called to construct each stage. It receives the current stage index, the output from the previous stage and produces the next stage input.
Create an array of stages. The returned array carries both the input and output data for each stage.
val input : 'a t Base.array -> 'aThe initial input of the stages construction.
val output : 'a t Base.array -> 'aThe final output of the stages construction.
val pipeline :
Hardcaml.Reg_spec.t ->
Base.int ->
enable:Hardcaml.Signal.t ->
init:Hardcaml.Signal.t ->
f:Hardcaml.Signal.t stage_fn ->
Hardcaml.Signal.t t Base.arrayCreate a pipeline of registers. The enable controls the whole pipeline.
val pipeline_with_enable :
Hardcaml.Reg_spec.t ->
Base.int ->
enable:Hardcaml.Signal.t ->
init:Hardcaml.Signal.t ->
f:Hardcaml.Signal.t stage_fn ->
enabled_stage t Base.arrayCreate a pipeline of registers. The enable is passed down the pipeline with the data.