Trait libreda_db::netlist::traits::NetlistEdit [−][src]
Trait for netlists that support editing.
Required methods
fn create_circuit(
&mut self,
name: Self::NameType,
pins: Vec<(Self::NameType, Direction)>
) -> Self::CircuitId
[src]
&mut self,
name: Self::NameType,
pins: Vec<(Self::NameType, Direction)>
) -> Self::CircuitId
Create a new and empty circuit.
fn remove_circuit(&mut self, circuit_id: &Self::CircuitId)
[src]
Delete the given circuit if it exists.
fn create_circuit_instance(
&mut self,
parent_circuit: &Self::CircuitId,
template_circuit: &Self::CircuitId,
name: Option<Self::NameType>
) -> Self::CircuitInstId
[src]
&mut self,
parent_circuit: &Self::CircuitId,
template_circuit: &Self::CircuitId,
name: Option<Self::NameType>
) -> Self::CircuitInstId
Create a new circuit instance.
fn remove_circuit_instance(&mut self, id: &Self::CircuitInstId)
[src]
Remove circuit instance if it exists.
fn create_net(
&mut self,
parent: &Self::CircuitId,
name: Option<Self::NameType>
) -> Self::NetId
[src]
&mut self,
parent: &Self::CircuitId,
name: Option<Self::NameType>
) -> Self::NetId
Create a net net that lives in the parent
circuit.
fn rename_net(
&mut self,
parent_circuit: &Self::CircuitId,
net_id: &Self::NetId,
new_name: Option<Self::NameType>
)
[src]
&mut self,
parent_circuit: &Self::CircuitId,
net_id: &Self::NetId,
new_name: Option<Self::NameType>
)
Set a new name for the net. This might panic if the name already exists.
fn remove_net(&mut self, net: &Self::NetId)
[src]
Delete the net if it exists and disconnect all connected terminals.
fn connect_pin(
&mut self,
pin: &Self::PinId,
net: Option<Self::NetId>
) -> Option<Self::NetId>
[src]
&mut self,
pin: &Self::PinId,
net: Option<Self::NetId>
) -> Option<Self::NetId>
Connect a pin to a net. Returns the old connected net, if any.
fn connect_pin_instance(
&mut self,
pin: &Self::PinInstId,
net: Option<Self::NetId>
) -> Option<Self::NetId>
[src]
&mut self,
pin: &Self::PinInstId,
net: Option<Self::NetId>
) -> Option<Self::NetId>
Connect a pin instance to a net. Returns the old connected net, if any.
Provided methods
fn disconnect_pin(&mut self, pin: &Self::PinId) -> Option<Self::NetId>
[src]
Disconnect the pin from any connected net. Returns the old connected net, if any.
fn disconnect_pin_instance(
&mut self,
pin_instance: &Self::PinInstId
) -> Option<Self::NetId>
[src]
&mut self,
pin_instance: &Self::PinInstId
) -> Option<Self::NetId>
Disconnect the pin instance from any connected net. Returns the old connected net, if any.
fn replace_net(&mut self, old_net: &Self::NetId, new_net: &Self::NetId)
[src]
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.
fn flatten_circuit_instance(&mut self, circuit_instance: &Self::CircuitInstId)
[src]
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.
fn flatten_circuit(&mut self, circuit: &Self::CircuitId)
[src]
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.
fn purge_nets_in_circuit(&mut self, circuit_id: &Self::CircuitId) -> usize
[src]
Delete all unconnected nets in this circuit. Return number of purged nets.
fn purge_nets(&mut self) -> usize
[src]
Delete all unconnected nets in all circuits. Return number of purged nets.
Implementors
impl NetlistEdit for HashMapNetlist
[src]
fn create_circuit(
&mut self,
name: Self::NameType,
pins: Vec<(Self::NameType, Direction)>
) -> CircuitId
[src]
&mut self,
name: Self::NameType,
pins: Vec<(Self::NameType, Direction)>
) -> CircuitId
Create a new circuit with a given list of pins.
fn remove_circuit(&mut self, circuit_id: &CircuitId)
[src]
Remove all instances inside the circuit,
fn create_circuit_instance(
&mut self,
parent: &CircuitId,
circuit_template: &CircuitId,
name: Option<Self::NameType>
) -> CircuitInstId
[src]
&mut self,
parent: &CircuitId,
circuit_template: &CircuitId,
name: Option<Self::NameType>
) -> CircuitInstId
Create a new instance of circuit_template
in the parent
circuit.
fn remove_circuit_instance(&mut self, circuit_inst_id: &CircuitInstId)
[src]
Remove a circuit instance after disconnecting it from the nets.
fn create_net(
&mut self,
parent: &CircuitId,
name: Option<Self::NameType>
) -> NetId
[src]
&mut self,
parent: &CircuitId,
name: Option<Self::NameType>
) -> NetId
Create a new net in the parent
circuit.
fn rename_net(
&mut self,
parent_circuit: &Self::CircuitId,
net_id: &Self::NetId,
new_name: Option<Self::NameType>
)
[src]
&mut self,
parent_circuit: &Self::CircuitId,
net_id: &Self::NetId,
new_name: Option<Self::NameType>
)
fn remove_net(&mut self, net: &NetId)
[src]
Disconnect all connected terminals and remove the net.
fn connect_pin(&mut self, pin: &PinId, net: Option<NetId>) -> Option<NetId>
[src]
Connect the pin to a net.
fn connect_pin_instance(
&mut self,
pin: &PinInstId,
net: Option<NetId>
) -> Option<Self::NetId>
[src]
&mut self,
pin: &PinInstId,
net: Option<NetId>
) -> Option<Self::NetId>
Connect the pin to a net.
impl NetlistEdit for RcNetlist
[src]
fn create_circuit(
&mut self,
name: Self::NameType,
pins: Vec<(Self::NameType, Direction)>
) -> Self::CircuitId
[src]
&mut self,
name: Self::NameType,
pins: Vec<(Self::NameType, Direction)>
) -> Self::CircuitId
fn remove_circuit(&mut self, circuit_id: &Self::CircuitId)
[src]
fn create_circuit_instance(
&mut self,
parent_circuit: &Self::CircuitId,
template_circuit: &Self::CircuitId,
name: Option<Self::NameType>
) -> Self::CircuitInstId
[src]
&mut self,
parent_circuit: &Self::CircuitId,
template_circuit: &Self::CircuitId,
name: Option<Self::NameType>
) -> Self::CircuitInstId
fn remove_circuit_instance(&mut self, circuit_inst: &Self::CircuitInstId)
[src]
fn create_net(
&mut self,
parent: &Self::CircuitId,
name: Option<Self::NameType>
) -> Self::NetId
[src]
&mut self,
parent: &Self::CircuitId,
name: Option<Self::NameType>
) -> Self::NetId
fn rename_net(
&mut self,
parent_circuit: &Self::CircuitId,
net_id: &Self::NetId,
new_name: Option<Self::NameType>
)
[src]
&mut self,
parent_circuit: &Self::CircuitId,
net_id: &Self::NetId,
new_name: Option<Self::NameType>
)
fn remove_net(&mut self, net: &Self::NetId)
[src]
fn connect_pin(
&mut self,
pin: &Self::PinId,
net: Option<Self::NetId>
) -> Option<Self::NetId>
[src]
&mut self,
pin: &Self::PinId,
net: Option<Self::NetId>
) -> Option<Self::NetId>
fn connect_pin_instance(
&mut self,
pin_inst: &Self::PinInstId,
net: Option<Self::NetId>
) -> Option<Self::NetId>
[src]
&mut self,
pin_inst: &Self::PinInstId,
net: Option<Self::NetId>
) -> Option<Self::NetId>