Skip to content

netlist_carpentry.routines.opt.loadless

A collection of optimization algorithms removing loadless elements from a given circuit module.

Functions:

opt_loadless

opt_loadless(module: Module) -> bool

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:

  • module

    (Module) –

    The module from the netlist to be optimized.

Returns:

  • any_removed ( bool ) –

    True if any optimizations were performed, False otherwise.

opt_loadless_wires

opt_loadless_wires(module: Module) -> bool

Identifies and removes wires with no associated loads from a module.

Iterates through the module's wires, identifies those without loads, and removes them.

Parameters:

  • module

    (Module) –

    The module from the netlist to be optimized.

Returns:

  • bool

    True if any wires were removed, False otherwise.

opt_loadless_instances

opt_loadless_instances(module: Module) -> bool

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:

  • module

    (Module) –

    The module from the netlist to be optimized.

Returns:

  • bool

    True if any instances were removed, False otherwise.