pub trait NetlistEditUtil: NetlistEdit {
    // Provided methods
    fn connect_terminal(
        &mut self,
        terminal: &TerminalId<Self>,
        net: Option<Self::NetId>
    ) -> Option<Self::NetId> { ... }
    fn disconnect_terminal(
        &mut self,
        terminal: &TerminalId<Self>
    ) -> Option<Self::NetId> { ... }
    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§

source

fn connect_terminal( &mut self, terminal: &TerminalId<Self>, net: Option<Self::NetId> ) -> Option<Self::NetId>

Connect a terminal to a net. Returns the old connected net, if any.

source

fn disconnect_terminal( &mut self, terminal: &TerminalId<Self> ) -> Option<Self::NetId>

Disconnect the terminal from any connected net. Returns the old connected net, if any.

source

fn replace_net(&mut self, old_net: &Self::NetId, new_net: &Self::NetId)

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.

source

fn flatten_circuit_instance(&mut self, circuit_instance: &Self::CellInstId)

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.

source

fn flatten_circuit(&mut self, circuit: &Self::CellId)

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.

source

fn purge_nets_in_circuit(&mut self, circuit_id: &Self::CellId) -> usize

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

source

fn purge_nets(&mut self) -> usize

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

source

fn create_net_names_in_circuit( &mut self, circuit_id: &Self::CellId, prefix: &str )

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.

Implementors§

source§

impl<N> NetlistEditUtil for Nwhere N: NetlistEdit + ?Sized,