Struct libreda_db::netlist::hashmap_netlist::HashMapNetlist[][src]

pub struct HashMapNetlist { /* fields omitted */ }

A netlist is the container of circuits.

Implementations

impl HashMapNetlist[src]

pub fn circuit(&self, id: &CircuitId) -> &Circuit[src]

Get a circuit reference by its ID.

pub fn circuit_inst(&self, id: &CircuitInstId) -> &CircuitInst[src]

Get a reference to a circuit instance.

pub fn net(&self, id: &NetId) -> &Net[src]

Get a reference to a net by its ID.

pub fn pin(&self, id: &PinId) -> &Pin[src]

Get a reference to a pin by its ID.

pub fn pin_inst(&self, id: &PinInstId) -> &PinInst[src]

Get a reference to a pin instance by its ID.

pub fn circuit_inst_nets(
    &self,
    circuit_inst_id: &CircuitInstId
) -> impl Iterator<Item = NetId> + '_
[src]

Get all nets that are connected to the circuit instance.

pub fn pins_for_net(&self, net: &NetId) -> impl Iterator<Item = PinId> + '_[src]

Iterate over all pins connected to a net.

pub fn pins_instances_for_net(
    &self,
    net: &NetId
) -> impl Iterator<Item = PinInstId> + '_
[src]

Iterate over all pin instances connected to a net.

pub fn terminals_for_net(
    &self,
    net: &NetId
) -> impl Iterator<Item = TerminalId> + '_
[src]

Iterate over all pins and pin instances connected to a net.

pub fn purge_nets(&mut self) -> usize[src]

Remove all unconnected nets. Return number of purged nets.

pub fn top_circuit_count(&self) -> usize[src]

Return number of top level circuits (roots of the circuit tree).

pub fn each_net(&self) -> impl Iterator<Item = NetId> + '_[src]

Iterate through all nets that are defined in the netlist.

Trait Implementations

impl Debug for HashMapNetlist[src]

impl Default for HashMapNetlist[src]

impl NetlistBase for HashMapNetlist[src]

type NameType = RcString

Type for names of circuits, instances, pins, etc.

type PinId = PinId

Pin identifier type.

type PinInstId = PinInstId

Pin instance identifier type. A pin instance is a pin of a circuit instance. Read more

type TerminalId = TerminalId

Either a pin or a pin instance ID.

type CircuitId = CircuitId

Circuit identifier type.

type CircuitInstId = CircuitInstId

Circuit instance identifier type.

type NetId = NetId

Net identifier type.

fn new() -> Self[src]

Create an empty netlist.

fn circuit_by_name<S: ?Sized + Eq + Hash>(&self, name: &S) -> Option<CircuitId> where
    Self::NameType: Borrow<S>, 
[src]

Find a circuit by its name.

fn net_of_pin(&self, pin: &Self::PinId) -> Option<Self::NetId>[src]

Get the net connected to this pin.

fn net_of_pin_instance(&self, pin_inst: &Self::PinInstId) -> Option<Self::NetId>[src]

Get the net connected to this pin instance.

fn each_circuit(&self) -> Box<dyn Iterator<Item = CircuitId>>[src]

Iterate over all circuits.

fn each_pin(&self, circuit_id: &CircuitId) -> Box<dyn Iterator<Item = PinId>>[src]

Iterate over all pins of a circuit.

impl NetlistEdit for HashMapNetlist[src]

fn create_circuit(
    &mut self,
    name: Self::NameType,
    pins: Vec<(Self::NameType, Direction)>
) -> CircuitId
[src]

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]

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]

Create a new net in the parent circuit.

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]

Connect the pin to a net.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.