package hardcaml_step_testbench
Module Imperative.Event_driven_simSource
include S
include Imperative.S with module Step_monad = Monads.Step_monad
include Core.Monad.S with type 'a t := 'a t
module Monad_infix : sig ... endval return : 'a -> 'a tmodule Let_syntax : sig ... endcycle i_data ~num_cycles waits for num_cycles cycles of the simulator to run. cycle raises if num_cycles < 1.
for_ i j f does f i, f (i+1), ... f j in sequence. If j < i, then for_ i j immediately returns unit.
Launch a new task within the current simulation step.
Wait for the given event to occur, and extract its return value.
Like wait_for except it stops waiting after timeout_in_cycles and returns None. Note that the spawned task continues to execute.
Source
type ('a, 'r) run =
?timeout:int ->
?simulation_step:Simulation_step.t ->
unit ->
clock:
Hardcaml_event_driven_sim.Two_state_logic.t
Hardcaml_step_testbench__.Imperative_event_driven_sim_intf.Simulator.Event_simulator.Signal.t ->
testbench:(unit -> 'a t) ->
'rSource
val deferred :
('a,
unit ->
'a option
Hardcaml_step_testbench__.Imperative_event_driven_sim_intf.Simulator.Event_simulator.Async.Deferred.t)
runCreate an event sim deferred that can be run inside a process. The result of the step testbench is returned. None is returned if the simulation times out.
The clock signal should be driven externally - do NOT set it within the step moand.