Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file cyclesim_intf.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121openBasemoduletypeCyclesim=sigmodulePort_list=Cyclesim0.Port_listmoduleDigest=Cyclesim0.DigestmoduleConfig=Cyclesim0.Config(** base type of the cycle based simulators *)type('i,'o)ttypet_port_list=(Port_list.t,Port_list.t)t(** returns the circuit used to compile the simulation. *)valcircuit:_t->Circuit.toption(** advance by 1 clock cycle (check->comb->seq->comb) *)valcycle:_t->unit(** check inputs are valid before a simulation cycle *)valcycle_check:_t->unit(** update combinatorial logic before clock edge and relative to new inputs. *)valcycle_before_clock_edge:_t->unit(** update sequential logic - registers and memories. *)valcycle_at_clock_edge:_t->unit(** update combinatorial logic after clock edge *)valcycle_after_clock_edge:_t->unit(** reset simulator *)valreset:_t->unit(** get input port given a name *)valin_port:_t->string->Bits.tref(** get a traced internal port given a name. *)valinternal_port:_t->string->Bits.tref(** Get output port given a name. If [clock_edge] is [Before] the outputs are computed
prior to the clock edge - [After] means the outputs are computed after the clock
edge. *)valout_port:?clock_edge:Side.t(** default is [After]. *)->_t->string->Bits.trefvalinputs:('i,_)t->'ivaloutputs:?clock_edge:Side.t->(_,'o)t->'ovalin_ports:_t->Port_list.tvalout_ports:?clock_edge:Side.t->_t->Port_list.t(** get list of internal nodes *)valinternal_ports:_t->Port_list.tvaldigest:_t->Digest.tref(** Peek at internal registers, return Some _ if it's present. Note
that the node must marked as traced in [Cyclesim.Config.t] when creating
simulations for this to return (Some _). Writing to the [Bits.Mutable.t]
will change the simulation internal node's value and affect the results of
simulation.
*)vallookup_reg:_t->string->Bits.Mutable.toption(** Similar to [lookup_data], but for memories. This is very useful
for initializing memory contents without having to simulate the entire
circuit.
*)vallookup_mem:_t->string->Bits.Mutable.tarrayoptionmoduleViolated_or_not:sigtypet=|Violatedofintlist(* cycles on which assertion was violated *)|Not_violated[@@derivingsexp_of]endvalresults_of_assertions:_t->Violated_or_not.tMap.M(String).t(** construct a simulator from a circuit *)valcreate:?config:Config.t->Circuit.t->t_port_listmoduleCombine_error=Cyclesim_combine.Combine_error(** Combine 2 simulators. The inputs are set on the 1st simulator and copied to the
2nd. Outputs are checked and [on_error] is called if a difference is found. By
default, [on_error] raises.
The simulators should have the same input and output port sets, unless
[port_sets_may_differ] is [true], in which case only ports which exist on both
simulators are checked. *)valcombine:?port_sets_may_differ:bool(** Default is [false]. *)->?on_error:(Combine_error.t->unit)->('i,'o)t->('i,'o)t->('i,'o)tmoduleWith_interface(I:Interface.S)(O:Interface.S):sigtypenonrect=(Bits.trefI.t,Bits.trefO.t)t[@@derivingsexp_of](** Create a simulator using the provided [Create_fn]. The returned simulator ports
are coerced to the input and output interface types. *)valcreate:?config:Config.t->?circuit_config:Circuit.Config.t->Circuit.With_interface(I)(O).create->t(** Coerce simulator port types to use the provided input and output interfaces. *)valcoerce:t_port_list->tendmodulePrivate:Cyclesim0.Privatewithtype('i,'o)t:=('i,'o)tandtypeport_list=Port_list.tandtypet_port_list:=t_port_listend