Struct libreda_lefdef::lef_ast::LEF

source ·
pub struct LEF {
    pub version: Option<String>,
    pub busbitchars: (char, char),
    pub dividerchar: char,
    pub vias: BTreeMap<String, ViaDefinition>,
    pub sites: BTreeMap<String, SiteDefinition>,
    pub technology: TechnologyLef,
    pub library: LibraryLef,
    pub extensions: BTreeMap<String, ()>,
}
Expand description

Top-level structure of a LEF library.

Fields§

§version: Option<String>

LEF version.

§busbitchars: (char, char)

Characters used to indicate bus bits. Default is [ and ].

§dividerchar: char

Character used as path separator. Default is /.

§vias: BTreeMap<String, ViaDefinition>

Definitions of fixed VIAs by name.

§sites: BTreeMap<String, SiteDefinition>

All SITE definitions by name.

§technology: TechnologyLef

Technology information of the design.

§library: LibraryLef

Cell and macro information.

§extensions: BTreeMap<String, ()>

Extensions as defined by BEGINEXT blocks.

Implementations§

source§

impl LEF

source

pub fn load<R: Read>(reader: &mut R) -> Result<LEF, LefDefParseError>

Deserialize a LEF from a Write trait object.

source

pub fn load_file(path: impl AsRef<Path>) -> Result<LEF, LefDefParseError>

Shortcut for reading a LEF library from a file.

Trait Implementations§

source§

impl Clone for LEF

source§

fn clone(&self) -> LEF

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LEF

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for LEF

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl HierarchyBase for LEF

§

type NameType = String

Type for names of cells, instances, etc.
source§

fn cell_by_name(&self, name: &str) -> Option<Self::CellId>

Find a cell by its name. Return the cell with the given name. Returns None if the cell does not exist.
source§

fn cell_instance_by_name( &self, parent_cell: &Self::CellId, name: &str ) -> Option<Self::CellInstId>

Find a cell instance by its name. Returns None if the name does not exist.
source§

fn cell_name(&self, CellId: &Self::CellId) -> Self::NameType

Get the name of the cell.
source§

fn cell_instance_name( &self, cell_inst: &Self::CellInstId ) -> Option<Self::NameType>

Get the name of the cell instance.
source§

fn parent_cell(&self, cell_instance: &Self::CellInstId) -> Self::CellId

Get the ID of the parent cell of this instance.
source§

fn template_cell(&self, cell_instance: &Self::CellInstId) -> Self::CellId

Get the ID of the template cell of this instance.
source§

fn for_each_cell<F>(&self, f: F)where F: FnMut(Self::CellId),

Call a function on each cell of the netlist.
source§

fn for_each_cell_instance<F>(&self, cell: &Self::CellId, f: F)where F: FnMut(Self::CellInstId),

Call a function on each instance in this cell.
source§

fn for_each_cell_dependency<F>(&self, cell: &Self::CellId, f: F)where F: FnMut(Self::CellId),

Call a function for each cell that is a child of this cell.
source§

fn for_each_dependent_cell<F>(&self, cell: &Self::CellId, f: F)where F: FnMut(Self::CellId),

Call a function for each cell that directly depends on cell.
source§

fn for_each_cell_reference<F>(&self, cell: &Self::CellId, f: F)where F: FnMut(Self::CellInstId),

Iterate over all instances of this cell, i.e. instances that use this cell as a template.
source§

fn num_child_instances(&self, cell: &Self::CellId) -> usize

Get the number of cell instances inside the cell.
source§

fn num_cells(&self) -> usize

Get the number of cell templates.
§

fn each_cell_vec(&self) -> Vec<Self::CellId, Global>

Get a Vec of all cell IDs in this netlist.
§

fn each_cell(&self) -> Box<dyn Iterator<Item = Self::CellId>, Global>

Iterate over all cells.
§

fn each_cell_instance_vec( &self, cell: &Self::CellId ) -> Vec<Self::CellInstId, Global>

Get a Vec of the IDs of all instances in this cell.
§

fn each_cell_instance( &self, cell: &Self::CellId ) -> Box<dyn Iterator<Item = Self::CellInstId>, Global>

Iterate over all instances in a cell.
§

fn each_cell_dependency_vec( &self, cell: &Self::CellId ) -> Vec<Self::CellId, Global>

Get a Vec of each cell that is a child of this cell.
§

fn each_cell_dependency<'a>( &'a self, cell: &Self::CellId ) -> Box<dyn Iterator<Item = Self::CellId> + 'a, Global>

Iterate over all cells that are instantiated in this cell.
§

fn num_cell_dependencies(&self, cell: &Self::CellId) -> usize

Count all cells that are dependencies of cell.
§

fn each_dependent_cell_vec( &self, cell: &Self::CellId ) -> Vec<Self::CellId, Global>

Get a Vec of each cell that directly depends on cell.
§

fn each_dependent_cell<'a>( &'a self, cell: &Self::CellId ) -> Box<dyn Iterator<Item = Self::CellId> + 'a, Global>

Iterate over each cell that directly depends on cell.
§

fn num_dependent_cells(&self, cell: &Self::CellId) -> usize

Count all cells that are directly dependent on cell, i.e. contain an instance of cell.
§

fn each_cell_reference_vec( &self, cell: &Self::CellId ) -> Vec<Self::CellInstId, Global>

Get a Vec with all cell instances referencing this cell.
§

fn each_cell_reference( &self, cell: &Self::CellId ) -> Box<dyn Iterator<Item = Self::CellInstId>, Global>

Iterate over all instances of this cell, i.e. instances that use this cell as a template.
§

fn num_cell_references(&self, cell: &Self::CellId) -> usize

Count all instantiations of cell.
§

fn get_chip_property(&self, key: &Self::NameType) -> Option<PropertyValue>

Get a property of the top-level chip data structure.
§

fn get_cell_property( &self, cell: &Self::CellId, key: &Self::NameType ) -> Option<PropertyValue>

Get a property of a cell.
§

fn get_cell_instance_property( &self, inst: &Self::CellInstId, key: &Self::NameType ) -> Option<PropertyValue>

Get a property of a cell instance.
source§

impl HierarchyIds for LEF

§

type CellId = CellId

Cell/module identifier type.
§

type CellInstId = ()

Cell instance identifier type.
source§

impl LayoutBase for LEF

source§

fn dbu(&self) -> Self::Coord

Get the distance unit used in this layout in ‘pixels per micron’.
source§

fn each_layer(&self) -> Box<dyn Iterator<Item = Self::LayerId> + '_>

Iterate over all defined layers.
source§

fn layer_info(&self, layer: &Self::LayerId) -> LayerInfo<Self::NameType>

Get the LayerInfo data structure for this layer.
source§

fn find_layer(&self, index: u32, datatype: u32) -> Option<Self::LayerId>

Find layer index by the (index, data type) tuple.
source§

fn layer_by_name(&self, name: &str) -> Option<Self::LayerId>

Find layer index by the name.
source§

fn bounding_box_per_layer( &self, cell: &Self::CellId, layer: &Self::LayerId ) -> Option<Rect<Self::Coord>>

Compute the bounding box of the shapes on one layer. The bounding box also includes all child cell instances.
source§

fn each_shape_id( &self, cell: &Self::CellId, layer: &Self::LayerId ) -> Box<dyn Iterator<Item = Self::ShapeId>>

Iterate over the IDs of all shapes in the cell on a specific layer.
source§

fn for_each_shape<F>(&self, CellId: &Self::CellId, layer: &Self::LayerId, f: F)where F: FnMut(&Self::ShapeId, &Geometry<Self::Coord>),

Call a function for each shape on this layer.
source§

fn with_shape<F, R>(&self, shape_id: &Self::ShapeId, f: F) -> Rwhere F: FnMut(&Self::LayerId, &Geometry<Self::Coord>) -> R,

Access a shape by its ID.
source§

fn parent_of_shape( &self, shape_id: &Self::ShapeId ) -> (Self::CellId, Self::LayerId)

Get the parent cell and the layer of a shape as a (cell, layer) tuple.
source§

fn get_transform( &self, _cell_inst: &Self::CellInstId ) -> SimpleTransform<Self::Coord>

Get the geometric transform that describes the location of a cell instance relative to its parent.
§

fn bounding_box(&self, cell: &Self::CellId) -> Option<Rect<Self::Coord>>

Compute the bounding box of the cell over all layers. The bounding box is not defined if the cell is empty. In this case return None.
§

fn shape_geometry(&self, shape_id: &Self::ShapeId) -> Geometry<Self::Coord>

Get a clone of the shape geometry.
§

fn shape_layer(&self, shape_id: &Self::ShapeId) -> Self::LayerId

Get the layer of a shape.
§

fn for_each_shape_recursive<F>( &self, cell: &Self::CellId, layer: &Self::LayerId, f: F )where F: FnMut(SimpleTransform<Self::Coord>, &Self::ShapeId, &Geometry<Self::Coord>),

Call a function f for each shape of this cell and its sub cells. Along to the geometric shape f also gets a transformation as argument. The transformation describes the actual position of the geometric shape relative to the cell.
§

fn get_shape_property( &self, shape: &Self::ShapeId, key: &Self::NameType ) -> Option<PropertyValue>

Get a property of a shape.
source§

impl LayoutIds for LEF

§

type Coord = i32

Number type used for coordinates and distances.
§

type Area = i64

Number type for areas. This is possibly another type then Coord for the following reasons: Read more
§

type LayerId = String

Layer identifier type.
§

type ShapeId = ShapeId

Shape identifier type.
source§

impl NetlistBase for LEF

source§

fn template_pin(&self, pin_instance: &Self::PinInstId) -> Self::PinId

Get the ID of the template pin of this pin instance.
source§

fn pin_direction(&self, (cell, pin_name): &Self::PinId) -> Direction

Get the signal direction of the pin.
source§

fn pin_name(&self, (_macro_name, pin_name): &Self::PinId) -> Self::NameType

Get the name of the pin.
source§

fn pin_by_name( &self, parent_circuit: &Self::CellId, pin_name: &str ) -> Option<Self::PinId>

Find a pin by its name. Returns None if no such pin can be found.
source§

fn parent_cell_of_pin(&self, (CellId, pin_name): &Self::PinId) -> Self::CellId

Get the ID of the parent circuit of this pin.
source§

fn parent_of_pin_instance(&self, pin_inst: &Self::PinInstId) -> Self::CellInstId

Get the ID of the circuit instance that holds this pin instance.
source§

fn parent_cell_of_net(&self, _net: &Self::NetId) -> Self::CellId

Get the ID of the parent circuit of this net.
source§

fn net_of_pin(&self, _pin: &Self::PinId) -> Option<Self::NetId>

Get the internal net attached to this pin.
source§

fn net_of_pin_instance( &self, _pin_instance: &Self::PinInstId ) -> Option<Self::NetId>

Get the external net attached to this pin instance.
source§

fn net_zero(&self, parent_circuit: &Self::CellId) -> Self::NetId

Get the net of the logical constant zero.
source§

fn net_one(&self, parent_circuit: &Self::CellId) -> Self::NetId

Get the net of the logical constant one.
source§

fn net_by_name( &self, parent_circuit: &Self::CellId, name: &str ) -> Option<Self::NetId>

Find a net by its name inside the parent circuit. Returns None if no such net can be found.
source§

fn net_name(&self, net: &Self::NetId) -> Option<Self::NameType>

Get the name of the net.
source§

fn for_each_pin<F>(&self, circuit: &Self::CellId, f: F)where F: FnMut(Self::PinId),

Call a function for each pin of the circuit.
source§

fn for_each_pin_instance<F>(&self, _circuit_inst: &Self::CellInstId, _f: F)where F: FnMut(Self::PinInstId),

Call a function for each pin instance of the circuit instance.
source§

fn for_each_internal_net<F>(&self, _circuit: &Self::CellId, _f: F)where F: FnMut(Self::NetId),

Call a function for net of the circuit.
source§

fn num_pins(&self, CellId: &Self::CellId) -> usize

Get the number of pins of a circuit.
source§

fn for_each_pin_of_net<F>(&self, net: &Self::NetId, f: F)where F: FnMut(Self::PinId),

Call a function for each pin connected to this net.
source§

fn for_each_pin_instance_of_net<F>(&self, net: &Self::NetId, f: F)where F: FnMut(Self::PinInstId),

Call a function for each pin instance connected to this net.
§

fn pin_instance( &self, cell_inst: &Self::CellInstId, pin: &Self::PinId ) -> Self::PinInstId

Get the ID of a pin instance given the cell instance and the pin ID.
§

fn each_pin_vec(&self, circuit: &Self::CellId) -> Vec<Self::PinId, Global>

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

fn each_pin<'a>( &'a self, circuit: &Self::CellId ) -> Box<dyn Iterator<Item = Self::PinId> + 'a, Global>

Iterate over all pins of a circuit.
§

fn each_pin_instance_vec( &self, circuit_instance: &Self::CellInstId ) -> Vec<Self::PinInstId, Global>

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

fn each_pin_instance<'a>( &'a self, circuit_instance: &Self::CellInstId ) -> Box<dyn Iterator<Item = Self::PinInstId> + 'a, Global>

Iterate over all pin instances of a circuit.
§

fn each_external_net<'a>( &'a self, circuit_instance: &Self::CellInstId ) -> Box<dyn Iterator<Item = Self::NetId> + 'a, Global>

Iterate over all external nets connected to the circuit instance. A net might appear more than once.
§

fn for_each_external_net<F>(&self, circuit_instance: &Self::CellInstId, f: F)where F: FnMut(Self::NetId),

Iterate over all external nets connected to the circuit instance. A net might appear more than once.
§

fn each_external_net_vec( &self, circuit_instance: &Self::CellInstId ) -> Vec<Self::NetId, Global>

Get a vector of all external nets connected to the circuit instance. A net might appear more than once.
§

fn each_internal_net_vec( &self, circuit: &Self::CellId ) -> Vec<Self::NetId, Global>

Get a Vec with all nets in this circuit.
§

fn each_internal_net<'a>( &'a self, circuit: &Self::CellId ) -> Box<dyn Iterator<Item = Self::NetId> + 'a, Global>

Iterate over all defined nets inside a circuit.
§

fn num_internal_nets(&self, circuit: &Self::CellId) -> usize

Return the number of nets defined inside a cell.
§

fn num_net_pins(&self, net: &Self::NetId) -> usize

Get the number of pins that are connected to this net.
§

fn num_net_pin_instances(&self, net: &Self::NetId) -> usize

Get the number of pin instances that are connected to this net.
§

fn num_net_terminals(&self, net: &Self::NetId) -> usize

Get the number of terminals that are connected to this net.
§

fn each_pin_of_net_vec(&self, net: &Self::NetId) -> Vec<Self::PinId, Global>

Get a Vec with all pin IDs connected to this net.
§

fn each_pin_of_net<'a>( &'a self, net: &Self::NetId ) -> Box<dyn Iterator<Item = Self::PinId> + 'a, Global>

Iterate over all pins of a net.
§

fn each_pin_instance_of_net_vec( &self, net: &Self::NetId ) -> Vec<Self::PinInstId, Global>

Get a Vec with all pin instance IDs connected to this net.
§

fn each_pin_instance_of_net<'a>( &'a self, net: &Self::NetId ) -> Box<dyn Iterator<Item = Self::PinInstId> + 'a, Global>

Iterate over all pins of a net.
source§

impl NetlistIds for LEF

§

type PinId = (<LEF as HierarchyIds>::CellId, String)

Pin identifier type. Uniquely identifies a pin in the whole netlist.
§

type PinInstId = ()

Pin instance identifier type. Uniquely identifies a pin instance in the whole netlist. A pin instance is a pin of a circuit instance.
§

type NetId = ()

Net identifier type. Uniquely identifies a net in the whole netlist.

Auto Trait Implementations§

§

impl RefUnwindSafe for LEF

§

impl Send for LEF

§

impl Sync for LEF

§

impl Unpin for LEF

§

impl UnwindSafe for LEF

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<H> HierarchyBaseMT for Hwhere H: HierarchyBase + Sync, <H as HierarchyIds>::CellId: Send + Sync, <H as HierarchyIds>::CellInstId: Send + Sync,

§

type CellIdMT = <H as HierarchyIds>::CellId

Identifier type for cells.
§

type CellInstIdMT = <H as HierarchyIds>::CellInstId

Identifier type for cell instances.
§

impl<T> HierarchyReferenceAccess for Twhere T: HierarchyBase,

§

fn each_cell_ref(&self) -> Box<dyn Iterator<Item = CellRef<'_, Self>>, Global>

Iterate over all cell objects.
§

fn cell_ref(&self, cell_id: &Self::CellId) -> CellRef<'_, Self>

Get a cell object by its ID.
§

fn cell_instance_ref(&self, inst_id: &Self::CellInstId) -> CellInstRef<'_, Self>

Get a cell instance object by its ID.
§

impl<N> HierarchyUtil for Nwhere N: HierarchyBase,

§

fn is_top_level_cell(&self, cell: &Self::CellId) -> bool

Check if the cell is a top level cell. This is done by checking that no other cells have an instance of this cell.
§

fn is_leaf_cell(&self, cell: &Self::CellId) -> bool

Check if the cell is a leaf cell. This is done by checking that this cell contains no other cell instances.
§

fn each_top_level_cell(&self) -> Box<dyn Iterator<Item = Self::CellId>, Global>

Iterate over all top level cells.
§

fn each_leaf_cell(&self) -> Box<dyn Iterator<Item = Self::CellId>, Global>

Iterate over all leaf cells, i.e. cells which contain no other cells.
§

fn each_cell_bottom_to_top( &self ) -> Box<dyn Iterator<Item = Self::CellId>, Global>

Iterate over topologically sorted cells (from leaf-cells to top-cells).
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<L> LayoutBaseMT for Lwhere L: LayoutBase + HierarchyBaseMT, <L as LayoutIds>::LayerId: Send + Sync, <L as LayoutIds>::ShapeId: Send + Sync,

§

type LayerIdMT = <L as LayoutIds>::LayerId

Identifier for layers.
§

type ShapeIdMT = <L as LayoutIds>::ShapeId

Identifier for shapes.
§

impl<T> LayoutReferenceAccess for Twhere T: LayoutBase,

§

fn shape_ref(&self, shape_id: &Self::ShapeId) -> ShapeRef<'_, Self>

Get a cell object by its ID.
§

fn layer_ref(&self, layer_id: &Self::LayerId) -> LayerRef<'_, Self>

Get a layer object by its ID.
§

fn each_layer_ref(&self) -> Box<dyn Iterator<Item = LayerRef<'_, Self>>, Global>

Iterate over all layers defined in this layout.
§

fn layer_ref_by_name(&self, name: &str) -> Option<LayerRef<'_, Self>>

Get a layer object by the layer name.
§

impl<N> NetlistBaseMT for Nwhere N: NetlistBase + HierarchyBaseMT, <N as NetlistIds>::PinId: Send + Sync, <N as NetlistIds>::PinInstId: Send + Sync, <N as NetlistIds>::NetId: Send + Sync,

§

type PinIdMT = <N as NetlistIds>::PinId

ID of a pin.
§

type PinInstIdMT = <N as NetlistIds>::PinInstId

ID of a pin instance.
§

type NetIdMT = <N as NetlistIds>::NetId

ID of a net.
§

impl<T> NetlistReferenceAccess for Twhere T: NetlistBase,

§

fn pin_ref(&self, pin: &Self::PinId) -> PinRef<'_, Self>

Get a reference to a pin from a pin ID.
§

fn pin_instance_ref(&self, id: &Self::PinInstId) -> PinInstRef<'_, Self>

Get a reference to a pin instance.
§

fn net_ref(&self, net: &Self::NetId) -> NetRef<'_, Self>

Get a reference to a net.
§

fn terminal_ref(&self, t: &TerminalId<Self>) -> TerminalRef<'_, Self>

Get a reference to a terminal.
§

impl<N> NetlistUtil for Nwhere N: NetlistBase,

§

fn net_of_terminal(&self, terminal: &TerminalId<Self>) -> Option<Self::NetId>

Get the net that is attached to this terminal.
§

fn for_each_terminal_of_net<F>(&self, net: &Self::NetId, f: F)where F: FnMut(TerminalId<Self>),

Call a function for each terminal connected to this net.
§

fn each_terminal_of_net_vec( &self, net: &Self::NetId ) -> Vec<TerminalId<Self>, Global>

Get a Vec with all terminal IDs connected to this net.
§

fn each_terminal_of_net<'a>( &'a self, net: &Self::NetId ) -> Box<dyn Iterator<Item = TerminalId<Self>> + 'a, Global>

Iterate over all terminals of a net.
§

fn is_constant_net(&self, net: &Self::NetId) -> bool

Check if the net is either the constant LOW or HIGH.
§

fn nets_of_cell_instance( &self, inst: &Self::CellInstId ) -> Box<dyn Iterator<Item = Self::NetId>, Global>

Get all nets that are connected to the circuit instance.
§

fn for_each_circuit_instance_of_net<F>(&self, net: &Self::NetId, f: F)where F: FnMut(Self::CellInstId),

Visit all circuit instances connected to this net. An instance is touched not more than once.
§

fn each_circuit_instance_of_net_vec( &self, net: &Self::NetId ) -> Vec<Self::CellInstId, Global>

Iterate over all circuit instances connected to this net. An instance is touched not more than once.
§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Write the netlist in a human readable form.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<LN> L2NIds for LNwhere LN: LayoutIds + NetlistIds,