Hardcaml.StructuralHardware generation API that includes tri-states - used for toplevel module generation.
The API is very similar to Signal except for instantiation which is done differently.
type signal = | Empty | |
| Module_input of id * name * width | |
| Module_output of id * name * width * signal Stdlib.ref | |
| Module_tristate of id * name * width * signal list Stdlib.ref | |
| Internal_wire of id * width * signal Stdlib.ref | |
| Internal_triwire of id * width * signal list Stdlib.ref | |
| Instantiation_output of id * name | (* reference to instantiation *) |
| Instantiation_tristate of id * name | |
| Instantiation of id
* name
* (string * generic) list
* (string * signal) list
* (string * signal) list
* (string * signal) list | |
| Rtl_op of id * width * rtl_op |
exception Invalid_submodule_input_connection of string * string * signalexception Invalid_submodule_output_connection of string * string * signalexception Invalid_submodule_tristate_connection of string * string * signalexception Wire_already_assigned of signalexception Invalid_assignment_target of signalexception Cant_assign_wire_with of signalexception Cant_assign_triwire_with of signalexception Invalid_name of signalexception Invalid_width of signalexception Invalid_id of signalexception Rtl_op_arg_not_readable of signalval find_circuit : string -> circuitfind circuit in database
val width : signal -> intval mk_input : string -> int -> signalval mk_output : string -> int -> signalval mk_tristate : string -> int -> signalval mk_wire : int -> signalval mk_triwire : int -> signalval is_connected : signal -> boolval of_bit_string : string -> signalval z : int -> signalmodule type Config = sig ... endthe comb API must be (rebuilt) between each circuit
module Base0 : Comb.Primitives with type t = signalprogressively more structural APIs
module Base1 : Comb.Primitives with type t = signalincludes mux, concat, select
module Base2 : Comb.Primitives with type t = signalincludes consts
val write_verilog : ( string -> unit ) -> circuit -> unitmodule Lib : sig ... end