Struct libreda_pnr::db::RcNetlist[][src]

pub struct RcNetlist { /* fields omitted */ }

Collection of circuits.

Implementations

impl RcNetlist[src]

pub fn new() -> RcNetlist[src]

Create a new empty netlist.

pub fn create_circuit<S>(
    &mut self,
    name: S,
    pins: Vec<Pin, Global>
) -> Rc<Circuit> where
    S: Into<String>, 
[src]

Create a new and empty circuit.

Example

use libreda_db::netlist::prelude::*;

let mut netlist = RcNetlist::new();
let pins = vec![
    Pin::new("Input_A", Direction::Input),
    Pin::new("Output_B", Direction::Output)
];
// Create a circuit with a given name and pin definition.
let top = netlist.create_circuit("TOP", pins);
assert_eq!(top.pin_by_id(0).unwrap().name(), "Input_A");
assert_eq!(top.pin_by_id(1).unwrap().name(), "Output_B");

pub fn circuit_by_id(&self, id: &Index<Circuit>) -> Option<Rc<Circuit>>[src]

Return the circuit with the given id. Returns None if the circuit does not exist.

pub fn circuit_by_name<S>(&self, name: &S) -> Option<Rc<Circuit>> where
    S: Hash + Eq + ?Sized,
    String: Borrow<S>, 
[src]

Return the circuit with the given name. Returns None if the circuit does not exist.

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

Iterate over all circuits in this netlist.

pub fn each_circuit_bottom_up(&self)[src]

Iterate over all circuits in this netlist starting with leaf circuits.

pub fn each_circuit_top_down(&self)[src]

Iterate over all circuits in this netlist starting with the root circuits.

pub fn flatten_circuit(&mut self, circuit: &Rc<Circuit>)[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.

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

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

pub fn remove_circuit(&mut self, circuit: &Rc<Circuit>)[src]

Delete the given circuit if it exists.

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

Return number of top circuits (roots).

Trait Implementations

impl Clone for RcNetlist[src]

impl Debug for RcNetlist[src]

impl Display for RcNetlist[src]

impl NetlistBase for RcNetlist[src]

type NameType = String

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

type PinId = Rc<Pin>

Pin identifier type.

type PinInstId = Rc<PinInstance>

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

type TerminalId = ()

Either a pin or a pin instance ID.

type CircuitId = Rc<Circuit>

Circuit identifier type.

type CircuitInstId = Rc<CircuitInstance>

Circuit instance identifier type.

type NetId = Rc<Net>

Net identifier type.

pub fn each_pin_vec(
    &self,
    circuit: &<RcNetlist as NetlistBase>::CircuitId
) -> Vec<<RcNetlist as NetlistBase>::PinId, Global>
[src]

Get a Vec with the IDs of all pins of this circuit.

pub fn each_pin_instance_vec(
    &self,
    circuit_instance: &<RcNetlist as NetlistBase>::CircuitInstId
) -> Vec<<RcNetlist as NetlistBase>::PinInstId, Global>
[src]

Get a Vec with the IDs of all pin instance of this circuit instance.

impl NetlistEdit for RcNetlist[src]

Auto Trait Implementations

impl !RefUnwindSafe for RcNetlist

impl !Send for RcNetlist

impl !Sync for RcNetlist

impl Unpin for RcNetlist

impl !UnwindSafe for RcNetlist

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.