pub trait NetlistEditUtil: NetlistEdit {
    fn replace_net(&mut self, old_net: &Self::NetId, new_net: &Self::NetId) { ... }
    fn flatten_circuit_instance(&mut self, circuit_instance: &Self::CellInstId) { ... }
    fn flatten_circuit(&mut self, circuit: &Self::CellId) { ... }
    fn purge_nets_in_circuit(&mut self, circuit_id: &Self::CellId) -> usize { ... }
    fn purge_nets(&mut self) -> usize { ... }
    fn create_net_names_in_circuit(
        &mut self,
        circuit_id: &Self::CellId,
        prefix: &str
    ) { ... } }
Expand description

Modifying utility functions for netlists. Import the this trait to use the utility functions all types that implement the NetlistBase trait.

Provided Methods

Take all terminals that are connected to old_net and connect them to new_net instead. The old net is no longer used and removed.

This is a default implementation that can possibly be implemented more efficiently for a concrete netlist type.

Replace the circuit instance with its contents. Remove the circuit instance afterwards. Does not purge nets nor unconnected instances. So there could be unconnected nets or unconnected instances.

Nets keep their names if possible. If the net name already exists in this circuit, the name will be set to None.

The content of the circuit instance will be renamed by appending the names like a path.

Flatten all instances of this circuit by replacing them with their content. Remove the circuit from the netlist afterwards. For top level circuits this is equivalent to removing them.

Delete all unconnected nets in this circuit. Return number of purged nets.

Delete all unconnected nets in all circuits. Return number of purged nets.

Create names for all unnamed nets in the specified circuit. The names will consist of the prefix and an appended number. After calling this method, no net inside this circuit will be unnamed.