Struct libreda_pnr::db::CircuitInstance[][src]

pub struct CircuitInstance { /* fields omitted */ }

Represents an instantiation of a Circuit (a sub-circuit).

Implementations

impl CircuitInstance[src]

pub fn parent_circuit(&self) -> Weak<Circuit>[src]

Gets the parent circuit where this instance lives in.

pub fn circuit_ref(&self) -> Weak<Circuit>[src]

Gets the circuit template referenced by this instance.

pub fn circuit_id(&self) -> Index<Circuit>[src]

Gets the ID of the circuit template referenced by this instance.

pub fn connect_pin_by_id(
    &self,
    pin_instance_id: usize,
    net: Option<Rc<Net>>
) -> Option<Rc<Net>>
[src]

Connect a pin on the outside of the sub circuit to a net that is defined in the parent circuit.

Returns the previously connected net.

Panics

Panics if the supplied net does not exist in the parent circuit. Also panics if the referenced pin does not exist.

pub fn connect_pin(
    &self,
    pin: &Rc<PinInstance>,
    net: Option<Rc<Net>>
) -> Option<Rc<Net>>
[src]

Connect a pin on the outside of the sub circuit to a net that is defined in the parent circuit.

Returns the previously connected net.

Panics

  • Panics if the pin instance does not live in this circuit instance.
  • Panics if the net does not live in the same parent circuit as this circuit instance.

pub fn disconnect_pin_by_id(&self, pin_instance_id: usize) -> Option<Rc<Net>>[src]

Disconnects a pin on the outside from the attached net. Short-cut for .connect_pin_by_id(pin_id, None).

Returns the previously connected net.

Panics

Panics if the referenced pin does not exist.

pub fn disconnect_pin(&self, pin_instance: &Rc<PinInstance>) -> Option<Rc<Net>>[src]

Disconnects a pin on the outside from the attached net. Short-cut for .connect_pin(pin_instance, None). Returns the previously connected net.

pub fn each_pin_instance(
    &self
) -> impl ExactSizeIterator + Iterator<Item = &Rc<PinInstance>>
[src]

Iterate over all pins instances.

pub fn each_pin_instance_vec(&self) -> Vec<Rc<PinInstance>, Global>[src]

Get a Vec with all pins instances.

pub fn id(&self) -> Index<CircuitInstance>[src]

Get index of this circuit instance.

pub fn name(&self) -> Option<&String>[src]

Get the name of this circuit instance.

pub fn net_for_pin(&self, pin_index: usize) -> Option<Rc<Net>>[src]

Get the net connected to the referenced pin.

Panics

Panics if the referenced pin does not exist.

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

Return the number of pins.

pub fn pin_instance_by_id(&self, pin_index: usize) -> Rc<PinInstance>[src]

Get the pin instance by the pin ID.

Panics

Panics if the pin with this ID does not exist.

Trait Implementations

impl Debug for CircuitInstance[src]

impl Eq for CircuitInstance[src]

impl Hash for CircuitInstance[src]

impl PartialEq<CircuitInstance> for CircuitInstance[src]

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.