package hardcaml

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Hardcaml.CircuitSource

Creation and manipulation of hardware circuits

Sourcetype t

circuit data structure

Sourceval sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.t
Sourcetype 'a with_create_options = ?detect_combinational_loops:Base.Bool.t -> ?normalize_uids:Base.Bool.t -> 'a

with_create_options specifies the optional arguments that can be supplied to create_exn.

detect_combinational_loops determines whether create_exn ensures that there is no path from a signal to itself that does not pass through a register or memory.

normalize_uids determines whether create_exn renumbers the uids of all signals in the circuit starting at one. Uid normalization ensures that circuits will print the same (as sexps or rtl) regardless of the environment in which they are constructed (in particular with regard to the global uid generator).

create circuit data structure

Sourceval inputs : t -> Signal.t Base.List.t

return circuit inputs

Sourceval outputs : t -> Signal.t Base.List.t

return circuit outputs

Sourceval signal_graph : t -> Signal_graph.t
Sourceval name : t -> Base.String.t

return circuit name

Sourceval with_name : t -> name:Base.String.t -> t

Return identical circuit except for the name.

Sourceval is_input : t -> Signal.t -> Base.Bool.t

is the signal an input to the circuit

Sourceval is_output : t -> Signal.t -> Base.Bool.t

is the signal an output of the circuit

Sourceval find_signal_exn : t -> Signal.Uid.t -> Signal.t
Sourceval set_phantom_inputs : t -> (Base.String.t * Base.Int.t) Base.List.t -> t

For internal use. Add phantom input ports to the circuit when writing RTL. This can be necessary to ensure Interface based input specifications match those discovered when traversing the hardware design from its outputs. It is especially important when working with hierarchical designs.

Sourceval phantom_inputs : t -> (Base.String.t * Base.Int.t) Base.List.t
Sourcemodule Signal_map : sig ... end

Map of uids to Signal.ts.

Sourceval signal_map : t -> Signal_map.t

Get map of uids to Signal.ts.

Compute and return a Fan_out_map.t. The computation is lazy and only performed the first time fan_out_map is called.

Compute and return a Fan_in_map.t. The computation is lazy and only performed the first time fan_in_map is called.

Sourceval structural_compare : ?check_names:Base.Bool.t -> t -> t -> Base.Bool.t

compare 2 circuits to see if they are the same

Sourcemodule Create_options : sig ... end

Create_options is a record with one field for each with_create_options argument. It allows one to define a function of type _ with_create_options that takes the same optional arguments as create_exn and to pass those options on to create_exn, without every having to directly refer to any of the arguments. This makes wrapper code robust to changes in what the optional arguments are. Here is the usage idiom:

Sourceval with_create_options : (Create_options.t -> 'a) -> 'a with_create_options
Sourceval call_with_create_options : 'a with_create_options -> Create_options.t -> 'a
Sourcemodule Port_checks : sig ... end

Check if the ports specified in the interface match those defined in the circuit.

Sourcemodule With_interface (I : Interface.S) (O : Interface.S) : sig ... end
OCaml

Innovation. Community. Security.