Struct libreda_lefdef::def_impl::LEFDEF
source · struct LEFDEF<'a> {
lef: &'a LEF,
def: &'a DEF,
components_by_name: HashMap<&'a str, &'a Component>,
macro_references: HashMap<&'a str, Vec<&'a Component>>,
}Expand description
Fused LEF and DEF structure. Holds only references to LEF and DEF structs but creates indices for faster name lookup of components.
This data structure implements the HierarchyBase, NetlistBase and LayoutBase view traits.
Fields§
§lef: &'a LEFUnderlying LEF struct.
def: &'a DEFUnderlying DEF struct.
components_by_name: HashMap<&'a str, &'a Component>Index for finding components by name.
macro_references: HashMap<&'a str, Vec<&'a Component>>For each macro name a list of components that instantiate this macro.
Implementations§
source§impl<'a> LEFDEF<'a>
impl<'a> LEFDEF<'a>
sourcepub fn new(lef: &'a LEF, def: &'a DEF) -> Self
pub fn new(lef: &'a LEF, def: &'a DEF) -> Self
Create a new fused LEF/DEF structure from a LEF and DEF struct.
fn top_cell_name(&self) -> &str
fn top_cell(&self) -> CellId
sourcefn component_by_name(&self, name: &str) -> Option<&Component>
fn component_by_name(&self, name: &str) -> Option<&Component>
Find a component by its name using the lookup table.
Trait Implementations§
source§impl<'a> HierarchyBase for LEFDEF<'a>
impl<'a> HierarchyBase for LEFDEF<'a>
source§fn cell_by_name(&self, name: &str) -> Option<Self::CellId>
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,
CellId: &Self::CellId,
name: &str
) -> Option<Self::CellInstId>
fn cell_instance_by_name( &self, CellId: &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_instance_name(
&self,
CellInstId: &Self::CellInstId
) -> Option<Self::NameType>
fn cell_instance_name( &self, CellInstId: &Self::CellInstId ) -> Option<Self::NameType>
Get the name of the cell instance.
source§fn parent_cell(&self, cell_instance: &Self::CellInstId) -> Self::CellId
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, CellInstId: &Self::CellInstId) -> Self::CellId
fn template_cell(&self, CellInstId: &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),
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),
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, CellId: &Self::CellId, f: F)where
F: FnMut(Self::CellId),
fn for_each_cell_dependency<F>(&self, CellId: &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, CellId: &Self::CellId, f: F)where
F: FnMut(Self::CellId),
fn for_each_dependent_cell<F>(&self, CellId: &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, CellId: &Self::CellId, f: F)where
F: FnMut(Self::CellInstId),
fn for_each_cell_reference<F>(&self, CellId: &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, CellId: &Self::CellId) -> usize
fn num_child_instances(&self, CellId: &Self::CellId) -> usize
Get the number of cell instances inside the
cell.§fn each_cell_vec(&self) -> Vec<Self::CellId, Global>
fn each_cell_vec(&self) -> Vec<Self::CellId, Global>
Get a
Vec of all cell IDs in this netlist.§fn each_cell_instance_vec(
&self,
cell: &Self::CellId
) -> Vec<Self::CellInstId, Global>
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>
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>
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>
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
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>
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>
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
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>
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>
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
fn num_cell_references(&self, cell: &Self::CellId) -> usize
Count all instantiations of
cell.§fn get_chip_property(&self, key: &Self::NameType) -> Option<PropertyValue>
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>
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>
fn get_cell_instance_property( &self, inst: &Self::CellInstId, key: &Self::NameType ) -> Option<PropertyValue>
Get a property of a cell instance.
source§impl<'a> HierarchyIds for LEFDEF<'a>
impl<'a> HierarchyIds for LEFDEF<'a>
§type CellInstId = CellInstId
type CellInstId = CellInstId
Cell instance identifier type.
Auto Trait Implementations§
impl<'a> RefUnwindSafe for LEFDEF<'a>
impl<'a> Send for LEFDEF<'a>
impl<'a> Sync for LEFDEF<'a>
impl<'a> Unpin for LEFDEF<'a>
impl<'a> UnwindSafe for LEFDEF<'a>
Blanket Implementations§
§impl<T> HierarchyReferenceAccess for Twhere
T: HierarchyBase,
impl<T> HierarchyReferenceAccess for Twhere T: HierarchyBase,
§fn each_cell_ref(&self) -> Box<dyn Iterator<Item = CellRef<'_, Self>>, Global>
fn each_cell_ref(&self) -> Box<dyn Iterator<Item = CellRef<'_, Self>>, Global>
Iterate over all cell objects.
§fn cell_instance_ref(&self, inst_id: &Self::CellInstId) -> CellInstRef<'_, Self>
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,
impl<N> HierarchyUtil for Nwhere N: HierarchyBase,
§fn is_top_level_cell(&self, cell: &Self::CellId) -> bool
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
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>
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>
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>
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).