Module Hardcaml_kernel.Clock_domainSource

Clock_domain contains functions to work with clock domains.

Sourcemodule Exact : sig ... end

An exact non-constant known clock domain.

Sourcemodule Runtime : sig ... end

The runtime clock domain associated to a Clock_domain.t

Sourcetype t
Sourceval sexp_of_t : t -> Sexplib0.Sexp.t
include Ppx_compare_lib.Equal.S with type t := t
Sourceval equal : t -> t -> bool
Sourceval get_name : t -> string

Obtain the name of the clock domain. Note that the name is only for informational purposes. Clock domain equality is identified via the uid.

Specifically, two clock domains created via Clock_comain.create with the same string argument, will _not_ have the same clock domain.

Sourceval create : loc:lexing_position -> string -> t
Sourceval uid : t -> Uid.t
Sourceval dedup_by_uid : t list -> t list
Sourceval generate_fresh_exact_domain : loc:lexing_position -> t -> Exact.t

Generate a new fresh runtime clock domain value from a given specification value. Calling this function will always generate a new fresh domain.

Sourcetype construct_mapping_error =
  1. | Maps_to_unknown
  2. | Maps_to_multiple of Exact.t list
Sourceval sexp_of_construct_mapping_error : construct_mapping_error -> Sexplib0.Sexp.t
Sourcetype maps_to =
  1. | Exact of Exact.t
  2. | All_constants
Sourceval sexp_of_maps_to : maps_to -> Sexplib0.Sexp.t
Sourcetype mapped_clock_domain = {
  1. specification_domain : t;
  2. maps_to : (maps_to, construct_mapping_error) Core.Result.t;
}
Sourceval sexp_of_mapped_clock_domain : mapped_clock_domain -> Sexplib0.Sexp.t
Sourceval construct_mapping_from_spec_to_exact : (t * Runtime.t) list -> mapped_clock_domain Uid.Map.t

Construct a mapping from a specification domain to an exact domain. The semantics are:

  • If a t has only got constants associated to it, it will not be present in the mapping
  • If a t has any unknowns associated to it, it will get mapped to Error Maps_to_unknown
  • If a t has more than 1 unique runtime clock domain associated to it, it will get mapped to Error (Maps_to_multiple _)
  • Otherwise, it will be Ok exact_domain
Sourcemodule Expert : sig ... end