Hardcaml.ScopeScopes control the process of hierarchical circuit generation.
They track a circuit database of instantiated modules, and a scheme for managing the naming of signals within the design.
module Path : sig ... endmodule Naming_scheme : sig ... endControl of name generation in a hierarchy of modules. The position of a module within a hierarchy is determined by a path which leads back to the (single) top most parent module. Signal names may be pre-pended with some representation of that path.
val sexp_of_t : t -> Sexplib0.Sexp.tval create :
?flatten_design:Base.bool ->
?auto_label_hierarchical_ports:Base.bool ->
?trace_properties:Base.bool ->
?naming_scheme:Naming_scheme.t ->
?name:Base.string ->
Base.unit ->
tcreate ?flatten_design ?naming_scheme ?name () creates a new scope. If flatten_design is true, then all module instantions are inlined. Names for wires are determined by naming_scheme.
sub_scope t label returns a new scope with (mangled) label appended to its hierarchical path
path t returns the Path.t associated with t. This will determine the prefix used when naming modules that are associated with this scope.
val circuit_database : t -> Circuit_database.tcircuit_database t returns the circuit database associated with t. Note that circuit databases are shared among sub_scopes.
val flatten_design : t -> Base.boolflatten_design t returns true when HardCaml will inline all module instantiations.
val auto_label_hierarchical_ports : t -> Base.boolauto_label_hierarical_ports t returns true when Hardcaml will add names to input and outputs ports of each hierarchical module.
This is useful with the interactive waveform viewer. The port names are prefixed with i$ and o$ and will be arranged in a tree view automactically.
val trace_properties : t -> Base.booltrace_properties t returns true when tracing of ltl properties is enabled
val naming_scheme : t -> Naming_scheme.tnaming_scheme t returns the Naming.t that t was constructed with.
val name : ?sep:Base.string -> t -> Base.string -> Base.stringname ?sep t signal string creates a heirarchical name based on the path of t and string. sep, when provided, determines the separator for path components in the heirarchical name (default is $).
val instance : t -> Base.string Base.optionReturn the current (mangled) instance name. The top level module has no instance name, so returns None.
Creates a hierarchical name, built with name, and applies it to the signal.
This is typically used as a partial application to construct a new signal naming operator, .e.g:
let (--) = naming scope in
let named_signal = some_signal -- "data" inval make_ltl_ap : t -> Base.string -> Signal.t -> Property.LTL.pathCreates an atomic proposition for use in an LTL formula, naming the AP with the scope's name and the provided string argument
val add_ltl_property : t -> Base.string -> Property.LTL.path -> Base.unitval assertion_manager : t -> Assertion_manager.tval property_manager : t -> Property_manager.t