pub struct LEFDesignRuleAdapter<'a, L: LayoutBase> {
    lef: &'a LEF,
    dbu: f64,
    layer_mapping: HashMap<L::LayerId, &'a Layer>,
    layer_stack: Vec<(L::LayerId, &'a Layer)>,
    ty: PhantomData<L>,
}
Expand description

Provides standardized read access to the design-rules defined in a LEF structure.

Fields§

§lef: &'a LEF

Underlying LEF data.

§dbu: f64

Data-base units per micron.

§layer_mapping: HashMap<L::LayerId, &'a Layer>

Mapping from layer IDs to actual LEF layer data.

§layer_stack: Vec<(L::LayerId, &'a Layer)>

Layers sorted by the processing order: Starts with layers close to the substrate, ends with top level metal layers.

§ty: PhantomData<L>

Implementations§

source§

impl<'a, L> LEFDesignRuleAdapter<'a, L>where L: LayoutBase, L::Coord: ToPrimitive,

source

fn db_distance_to_lef(&self, db_distance: L::Coord) -> f64

Convert from a distance in data-base units into a LEF distance (f64).

source§

impl<'a, L> LEFDesignRuleAdapter<'a, L>where L: LayoutBase, L::Coord: FromPrimitive,

source

fn lef_distance_to_db(&self, lef_distance: f64) -> L::Coord

Convert from a LEF distance (f64) into the correct unit used by the layout.

source§

impl<'a, L> LEFDesignRuleAdapter<'a, L>where L: LayoutBase, L::Coord: FromPrimitive + ToPrimitive,

source

pub fn new(lef: &'a LEF, layout: &L) -> Self

Create a new design rule adapter for a LEF data structure. Derives the mapping from layer IDs and LEF layers based on the layer names.

source

pub fn new_from_layer_mapping( lef: &'a LEF, layer_ids_by_name: &HashMap<String, L::LayerId>, dbu: f64 ) -> Self

Create a new design rule adapter for a LEF data structure with a custom mapping between layer names and layer IDs.

source

fn extract_layer_mapping_from_layout(layout: &L) -> HashMap<String, L::LayerId>

Find the mapping from layer names to layer IDs.

source

fn create_layer_mapping( &mut self, layer_ids_by_name: &HashMap<String, L::LayerId> )

Initialize the mapping: layer ID -> LEF layer structure.

Trait Implementations§

source§

impl<'a, L> DefaultWidth for LEFDesignRuleAdapter<'a, L>where L: LayoutBase, L::Coord: FromPrimitive,

source§

fn default_width( &self, layer_id: &Self::LayerId, shape_length: Option<Self::Distance> ) -> Option<Self::Distance>

Default width of a wire segment of a certain length.
source§

impl<'a, L: LayoutBase> DistanceRuleBase for LEFDesignRuleAdapter<'a, L>

§

type Distance = <L as LayoutIds>::Coord

Type used to express distances.
§

type Area = <L as LayoutIds>::Coord

Type used to express areas.
source§

impl<'a, L: LayoutBase> MinimumSpacing for LEFDesignRuleAdapter<'a, L>where L::Coord: ToPrimitive + FromPrimitive,

source§

fn min_spacing_absolute( &self, layer_id: &Self::LayerId ) -> Option<Self::Distance>

Absolute minimum spacing between two shapes on the layer.
source§

fn min_spacing( &self, layer_id: &Self::LayerId, run_length: Self::Distance, width: Self::Distance ) -> Option<Self::Distance>

Minimum spacing between two shapes on the layer dependent on the geometries.
source§

impl<'a, L> MinimumWidth for LEFDesignRuleAdapter<'a, L>where L: LayoutBase, L::Coord: FromPrimitive,

source§

fn min_width( &self, layer_id: &Self::LayerId, shape_length: Option<Self::Distance> ) -> Option<Self::Distance>

Minimal width of a shape with a certain length.
source§

impl<'a, L: LayoutBase> PreferredRoutingDirection for LEFDesignRuleAdapter<'a, L>where L::Coord: ToPrimitive + FromPrimitive,

source§

fn preferred_routing_direction( &self, layer_id: &Self::LayerId ) -> Option<Orientation2D>

Get the preferred routing direction on this metal layer.
source§

impl<'a, L: LayoutBase> RoutingLayerStack for LEFDesignRuleAdapter<'a, L>

source§

fn layer_stack(&self) -> Vec<RoutingLayer<Self::LayerId>>

Get the stack of routing and via layers in process order.
§

fn layer_stack_ids(&self) -> Vec<Self::LayerId, Global>

Get the layer ids of the layer stack (routing layers and via layers).
§

fn routing_layer_stack(&self) -> Vec<Self::LayerId, Global>

Get the stack of routing metal layers in process order.
§

fn via_layer_stack(&self) -> Vec<Self::LayerId, Global>

Get the stack of via layers in process order.
§

fn get_upper_metal_layer(&self, layer: &Self::LayerId) -> Option<Self::LayerId>

Find the closest metal layer above the given layer.
§

fn get_lower_metal_layer(&self, layer: &Self::LayerId) -> Option<Self::LayerId>

Find the closest metal layer under the given layer.
source§

impl<'a, L> RoutingRules for LEFDesignRuleAdapter<'a, L>where L: LayoutBase, L::Coord: ToPrimitive + FromPrimitive,

source§

fn default_pitch( &self, layer_id: &Self::LayerId ) -> Option<(Self::Distance, Self::Distance)>

Get the default routing pitch on this layer for x and y directions.
§

fn default_pitch_preferred_direction( &self, layer: &Self::LayerId ) -> Option<Self::Distance>

Get the default routing pitch for wires with the preferred routing direction. Return None if no default pitch or no routing direction is defined for this layer.
source§

impl<'a, L: LayoutBase> RuleBase for LEFDesignRuleAdapter<'a, L>

§

type LayerId = <L as LayoutIds>::LayerId

Type used as layer identifier.

Auto Trait Implementations§

§

impl<'a, L> RefUnwindSafe for LEFDesignRuleAdapter<'a, L>where L: RefUnwindSafe, <L as LayoutIds>::LayerId: RefUnwindSafe,

§

impl<'a, L> Send for LEFDesignRuleAdapter<'a, L>where L: Send, <L as LayoutIds>::LayerId: Send,

§

impl<'a, L> Sync for LEFDesignRuleAdapter<'a, L>where L: Sync, <L as LayoutIds>::LayerId: Sync,

§

impl<'a, L> Unpin for LEFDesignRuleAdapter<'a, L>where L: Unpin, <L as LayoutIds>::LayerId: Unpin,

§

impl<'a, L> UnwindSafe for LEFDesignRuleAdapter<'a, L>where L: UnwindSafe, <L as LayoutIds>::LayerId: UnwindSafe,

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.

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.

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.