Hardcaml_step_testbench_effectful.Imperativeinclude module type of struct include Imperative endmodule type S = Imperative.Sinclude Smodule I_data : sig ... endmodule O_data : sig ... endmodule Handler : sig ... endval cycle :
Handler.t @ local ->
(?num_cycles:int ->
(unit ->
unit) @ local) @ localcycle i_data ~num_cycles waits for num_cycles cycles of the simulator to run. cycle raises if num_cycles < 1.
val start :
Handler.t @ local ->
((Handler.t @ local -> ('a -> 'b) @ local) ->
('a ->
('b, I_data.t)
Hardcaml_step_testbench_kernel.Step_effect.Component_finished.t) @ local) @ localtype ('a, 'i) finished_event =
('a, 'i) Hardcaml_step_testbench_kernel.Step_effect.Component_finished.t
Hardcaml_step_testbench_kernel.Step_effect.Event.tval spawn :
?period:int ->
Handler.t @ local ->
((Handler.t @ local -> (unit -> 'a) @ local) ->
('a, unit) finished_event) @ localLaunch a new task within the current simulation step.
val wait_for : Handler.t @ local -> (('a, 'i) finished_event -> 'a) @ localWait for the given event to occur, and extract its return value.
val wait_for_with_timeout :
Handler.t @ local ->
(('a, 'i) finished_event ->
(timeout_in_cycles:int ->
'a option) @ local) @ localLike wait_for except it stops waiting after timeout_in_cycles and returns None. Note that the spawned task continues to execute.
val forever :
Handler.t @ local ->
((Handler.t @ local -> (unit -> unit) @ local) ->
Core.never_returns) @ localRuns the given step function forever.
val run_monadic_computation :
Handler.t @ local ->
(('a, O_data.t, I_data.t) Hardcaml_step_testbench_kernel.Step_monad.t ->
'a) @ localmodule As_monad : sig ... endmodule Expert : sig ... endmodule Cyclesim : sig ... endmodule Event_driven_sim : sig ... end