Trait NetlistEdit

Source
pub trait NetlistEdit: NetlistBase + HierarchyEdit {
    // Required methods
    fn create_pin(
        &mut self,
        cell: &Self::CellId,
        name: Self::NameType,
        direction: Direction,
    ) -> Self::PinId;
    fn remove_pin(&mut self, id: &Self::PinId);
    fn rename_pin(
        &mut self,
        pin: &Self::PinId,
        new_name: Self::NameType,
    ) -> Self::NameType;
    fn create_net(
        &mut self,
        parent: &Self::CellId,
        name: Option<Self::NameType>,
    ) -> Self::NetId;
    fn rename_net(
        &mut self,
        net_id: &Self::NetId,
        new_name: Option<Self::NameType>,
    ) -> Option<Self::NameType>;
    fn remove_net(&mut self, net: &Self::NetId);
    fn connect_pin(
        &mut self,
        pin: &Self::PinId,
        net: Option<Self::NetId>,
    ) -> Option<Self::NetId>;
    fn connect_pin_instance(
        &mut self,
        pin: &Self::PinInstId,
        net: Option<Self::NetId>,
    ) -> Option<Self::NetId>;

    // Provided methods
    fn disconnect_pin(&mut self, pin: &Self::PinId) -> Option<Self::NetId> { ... }
    fn disconnect_pin_instance(
        &mut self,
        pin_instance: &Self::PinInstId,
    ) -> Option<Self::NetId> { ... }
}
Expand description

Trait for netlists that support editing.

This includes:

  • creation and removal of pins and nets
  • connecting pins and pin instances to nets
  • renaming nets
  • renaming pins

More complex operations which can be build on top of the basic operations are provided by the NetlistEditUtil trait.

Required Methods§

Source

fn create_pin( &mut self, cell: &Self::CellId, name: Self::NameType, direction: Direction, ) -> Self::PinId

Create a new pin in this cell. Also adds the pin to all instances of the cell.

Source

fn remove_pin(&mut self, id: &Self::PinId)

Remove the pin from this circuit and from all instances of this circuit.

Source

fn rename_pin( &mut self, pin: &Self::PinId, new_name: Self::NameType, ) -> Self::NameType

Change the name of the pin, returns the old name.

§Panics

Panics when the name is already occupied.

Source

fn create_net( &mut self, parent: &Self::CellId, name: Option<Self::NameType>, ) -> Self::NetId

Create a net net that lives in the parent circuit.

Source

fn rename_net( &mut self, net_id: &Self::NetId, new_name: Option<Self::NameType>, ) -> Option<Self::NameType>

Set a new name for the net. This might panic if the name already exists. Returns the old name.

Source

fn remove_net(&mut self, net: &Self::NetId)

Delete the net if it exists and disconnect all connected terminals.

Source

fn connect_pin( &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.

Source

fn connect_pin_instance( &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§

Source

fn disconnect_pin(&mut self, pin: &Self::PinId) -> Option<Self::NetId>

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

Source

fn disconnect_pin_instance( &mut self, pin_instance: &Self::PinInstId, ) -> Option<Self::NetId>

Disconnect the pin instance from any connected net. Returns the old connected net, if any.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> NetlistEdit for &mut T
where T: NetlistEdit,

Source§

fn disconnect_pin(&mut self, pin: &Self::PinId) -> Option<Self::NetId>

Source§

fn remove_net(&mut self, net: &Self::NetId)

Source§

fn rename_net( &mut self, net_id: &Self::NetId, new_name: Option<Self::NameType>, ) -> Option<Self::NameType>

Source§

fn connect_pin( &mut self, pin: &Self::PinId, net: Option<Self::NetId>, ) -> Option<Self::NetId>

Source§

fn create_pin( &mut self, cell: &Self::CellId, name: Self::NameType, direction: Direction, ) -> Self::PinId

Source§

fn rename_pin( &mut self, pin: &Self::PinId, new_name: Self::NameType, ) -> Self::NameType

Source§

fn connect_pin_instance( &mut self, pin: &Self::PinInstId, net: Option<Self::NetId>, ) -> Option<Self::NetId>

Source§

fn disconnect_pin_instance( &mut self, pin_instance: &Self::PinInstId, ) -> Option<Self::NetId>

Source§

fn create_net( &mut self, parent: &Self::CellId, name: Option<Self::NameType>, ) -> Self::NetId

Source§

fn remove_pin(&mut self, id: &Self::PinId)

Source§

impl<T> NetlistEdit for Box<T>
where T: NetlistEdit,

Source§

fn remove_pin(&mut self, id: &Self::PinId)

Source§

fn rename_pin( &mut self, pin: &Self::PinId, new_name: Self::NameType, ) -> Self::NameType

Source§

fn connect_pin_instance( &mut self, pin: &Self::PinInstId, net: Option<Self::NetId>, ) -> Option<Self::NetId>

Source§

fn disconnect_pin(&mut self, pin: &Self::PinId) -> Option<Self::NetId>

Source§

fn create_pin( &mut self, cell: &Self::CellId, name: Self::NameType, direction: Direction, ) -> Self::PinId

Source§

fn create_net( &mut self, parent: &Self::CellId, name: Option<Self::NameType>, ) -> Self::NetId

Source§

fn rename_net( &mut self, net_id: &Self::NetId, new_name: Option<Self::NameType>, ) -> Option<Self::NameType>

Source§

fn remove_net(&mut self, net: &Self::NetId)

Source§

fn connect_pin( &mut self, pin: &Self::PinId, net: Option<Self::NetId>, ) -> Option<Self::NetId>

Source§

fn disconnect_pin_instance( &mut self, pin_instance: &Self::PinInstId, ) -> Option<Self::NetId>

Implementors§