netlist_carpentry.routines.opt.loadless
¶
A collection of optimization algorithms removing loadless elements from a given circuit module.
Functions:
-
opt_loadless–Recursively removes unused wires and instances from a module.
-
opt_loadless_wires–Identifies and removes wires with no associated loads from a module.
-
opt_loadless_instances–Identifies and removes instances with no associated loads.
opt_loadless
¶
Recursively removes unused wires and instances from a module.
This function iteratively checks for and removes unused wires and instances until no more can be removed. It returns True if any removals occurred, False otherwise.
Parameters:
Returns:
-
any_removed(bool) –True if any optimizations were performed, False otherwise.
opt_loadless_wires
¶
opt_loadless_instances
¶
Identifies and removes instances with no associated loads.
Iterates through the module's instances, identifies those without loads, and removes them. An instance is considered to have no loads if all output ports are unconnected.
Parameters:
Returns:
-
bool–True if any instances were removed, False otherwise.