Visits every module in the circuit, starting at the leaf nodes.
Visits every module in the circuit, starting at the leaf nodes.
Every module is hashed in order to find ones that have the exact
same structure and are thus functionally equivalent.
Every unique hash is mapped to a human-readable tag which starts with Dedup#
.
CircuitTarget
Sequence of modules from leaf to top
names of modules that should not be deduped
A map from tag to names of modules with the same structure and a RenameMap which maps Module names to their Tag.
Change's a module's internal signal names, types, infos, and modules.
Change's a module's internal signal names, types, infos, and modules.
Function to rename a signal. Called on declaration and references.
Function to retype a signal. Called on declaration, references, and subfields
Function to re-info a statement
Function to rename an instance's module
Module to change internals
Changed Module
Dedup a module's instances based on dedup map
Dedup a module's instances based on dedup map
Will fixes up module if deduped instance's ports are differently named
CircuitTarget of circuit
Module name who's instances will be deduped
Map of module name to its original module
Map of module name to the module deduping it. Not mutated in this function.
Will be modified to keep track of renames in this function
fixed up module deduped instances
Deduplicate
Deduplicate
Circuit
list of modules to not dedup
rename map to populate when deduping
Map of original Module name -> Deduped Module
Utility functions for DedupModules