Module libreda_pnr::db::reference_access[][src]

Expand description

Experimental

Wrappers around the HierarchyBase, NetlistBase, LayoutBase and L2NBase traits which provide more object like access methods.

Examples

use libreda_db::prelude::*;

// Create some netlist/layout.
let mut chip = Chip::new();
let top_id = chip.create_cell("TOP".into());
let sub_id = chip.create_cell("SUB".into());
let sub_inst1_id = chip.create_cell_instance(&top_id, &sub_id, Some("inst1".into()));

// Create read-only object-like access.
let top = chip.cell_ref(&top_id);
// `top` can now be used like an object to navigate the cell hierarchy, layout and netlist.
for subcell in top.each_cell_instance() {
    println!("{} contains {:?} which is a {}", top.name(), subcell.name(), subcell.template().name());
}

// Also the netlist can be traversed in a similar way.
for pin in top.each_pin() {
    println!("Pin {} of {} is connected to net {:?}.",
        pin.name(), top.name(), pin.net().and_then(|net| net.name())
    );
}

Structs

Default implementation for CellInstRef. This is just a wrapper around a netlist and a cell ID.

A reference to a cell. This is just a wrapper around a netlist and a cell ID.

Reference to a layer.

A reference to a net. This is just a wrapper around a netlist and a net ID.

A reference to a pin instance. This is just a wrapper around a netlist and a pin instance ID.

A reference to a pin. This is just a wrapper around a netlist and a pin ID.

Reference to a shape.

Enums

Either a pin or a pin instance.

Traits

Trait that provides object-like read access to a cell hierarchy structure and its elements.

Trait that provides object-like read access to a layout structure and its elements.

Trait that provides object-like read access to a hierarchical netlist structure and its elements.