Struct libreda_db::chip::Chip
source · [−]pub struct Chip<C: CoordinateType = Coord> {Show 20 fields
circuits: FnvHashMap<CellId, Circuit<C>>,
circuits_by_name: HashMap<String, CellId>,
circuit_instances: FnvHashMap<CellInstId, CircuitInst>,
nets: FnvHashMap<NetId, Net>,
pins: FnvHashMap<PinId, Pin>,
pin_instances: FnvHashMap<PinInstId, PinInst>,
properties: PropertyStore<String>,
id_counter_circuit: u32,
id_counter_circuit_inst: usize,
id_counter_pin: u32,
id_counter_pin_inst: usize,
id_counter_net: usize,
dbu: C,
layer_index_generator: IndexGenerator<LayerInfo<String>, u16>,
layers_by_name: HashMap<String, LayerId>,
layers_by_index_datatype: FnvHashMap<(UInt, UInt), LayerId>,
layer_info: FnvHashMap<LayerId, LayerInfo<String>>,
shape_index_generator: IndexGenerator<Shape<C>>,
shape_parents: FnvHashMap<ShapeId, (CellId, LayerId)>,
net_shapes: FnvHashMap<NetId, FnvHashSet<ShapeId>>,
}
Expand description
A netlist is the container of circuits.
Fields
circuits: FnvHashMap<CellId, Circuit<C>>
circuits_by_name: HashMap<String, CellId>
circuit_instances: FnvHashMap<CellInstId, CircuitInst>
nets: FnvHashMap<NetId, Net>
pins: FnvHashMap<PinId, Pin>
pin_instances: FnvHashMap<PinInstId, PinInst>
properties: PropertyStore<String>
Top-level properties.
id_counter_circuit: u32
id_counter_circuit_inst: usize
id_counter_pin: u32
id_counter_pin_inst: usize
id_counter_net: usize
dbu: C
layer_index_generator: IndexGenerator<LayerInfo<String>, u16>
Counter for generating the next layer index.
layers_by_name: HashMap<String, LayerId>
Lookup table for finding layers by name.
layers_by_index_datatype: FnvHashMap<(UInt, UInt), LayerId>
Lookup table for finding layers by index/datatype numbers.
layer_info: FnvHashMap<LayerId, LayerInfo<String>>
Info structures for all layers.
shape_index_generator: IndexGenerator<Shape<C>>
ID generator for shapes.
shape_parents: FnvHashMap<ShapeId, (CellId, LayerId)>
Link to the cell and layer that contain a shape.
net_shapes: FnvHashMap<NetId, FnvHashSet<ShapeId>>
Link to the shapes of a net.
Implementations
sourceimpl Chip<Coord>
impl Chip<Coord>
sourcefn circuit_by_name<S: ?Sized + Eq + Hash>(&self, name: &S) -> Option<CellId> where
String: Borrow<S>,
fn circuit_by_name<S: ?Sized + Eq + Hash>(&self, name: &S) -> Option<CellId> where
String: Borrow<S>,
Find a circuit by its name.
sourcefn rename_cell(&mut self, cell: &CellId, name: String)
fn rename_cell(&mut self, cell: &CellId, name: String)
sourcefn rename_cell_instance(&mut self, inst: &CellInstId, name: Option<String>)
fn rename_cell_instance(&mut self, inst: &CellInstId, name: Option<String>)
sourcefn create_circuit(
&mut self,
name: String,
pins: Vec<(String, Direction)>
) -> CellId
fn create_circuit(
&mut self,
name: String,
pins: Vec<(String, Direction)>
) -> CellId
Create a new circuit template.
sourcefn remove_circuit(&mut self, circuit_id: &CellId)
fn remove_circuit(&mut self, circuit_id: &CellId)
Remove all instances inside the circuit, remove all instances of the circuit and remove finally the circuit itself.
sourcefn create_circuit_instance(
&mut self,
parent: &CellId,
circuit_template: &CellId,
name: Option<String>
) -> CellInstId
fn create_circuit_instance(
&mut self,
parent: &CellId,
circuit_template: &CellId,
name: Option<String>
) -> CellInstId
Create a new instance of circuit_template
in the parent
circuit.
sourcefn remove_circuit_instance(&mut self, circuit_inst_id: &CellInstId)
fn remove_circuit_instance(&mut self, circuit_inst_id: &CellInstId)
Remove a circuit instance after disconnecting it from the nets.
sourcefn create_net(&mut self, parent: &CellId, name: Option<String>) -> NetId
fn create_net(&mut self, parent: &CellId, name: Option<String>) -> NetId
Create a new net in the parent
circuit.
sourcefn rename_net(
&mut self,
net_id: &NetId,
new_name: Option<String>
) -> Option<String>
fn rename_net(
&mut self,
net_id: &NetId,
new_name: Option<String>
) -> Option<String>
Change the name of the net.
sourcefn remove_net(&mut self, net: &NetId)
fn remove_net(&mut self, net: &NetId)
Disconnect all connected terminals and remove the net.
sourcefn disconnect_pin(&mut self, pin: &PinId) -> Option<NetId>
fn disconnect_pin(&mut self, pin: &PinId) -> Option<NetId>
Disconnect pin and return the ID of the net that was connected.
sourcefn connect_pin(&mut self, pin: &PinId, net: Option<NetId>) -> Option<NetId>
fn connect_pin(&mut self, pin: &PinId, net: Option<NetId>) -> Option<NetId>
Connect the pin to a net.
sourcefn disconnect_pin_instance(&mut self, pin: &PinInstId) -> Option<NetId>
fn disconnect_pin_instance(&mut self, pin: &PinInstId) -> Option<NetId>
Disconnect the pin instance and return the net to which it was connected.
sourcefn connect_pin_instance(
&mut self,
pin: &PinInstId,
net: Option<NetId>
) -> Option<NetId>
fn connect_pin_instance(
&mut self,
pin: &PinInstId,
net: Option<NetId>
) -> Option<NetId>
Connect the pin to a net.
sourcefn circuit_mut(&mut self, id: &CellId) -> &mut Circuit
fn circuit_mut(&mut self, id: &CellId) -> &mut Circuit
Get a mutable reference to the circuit by its ID.
sourcefn circuit_inst(&self, id: &CellInstId) -> &CircuitInst
fn circuit_inst(&self, id: &CellInstId) -> &CircuitInst
Get a reference to a circuit instance.
sourcefn circuit_inst_mut(&mut self, id: &CellInstId) -> &mut CircuitInst
fn circuit_inst_mut(&mut self, id: &CellInstId) -> &mut CircuitInst
Get a mutable reference to a circuit instance.
sourcefn pin_inst_mut(&mut self, id: &PinInstId) -> &mut PinInst
fn pin_inst_mut(&mut self, id: &PinInstId) -> &mut PinInst
Get a mutable reference to a pin instance by its ID.
sourcefn next_id_counter_usize(ctr: &mut usize) -> usize
fn next_id_counter_usize(ctr: &mut usize) -> usize
Get the value of a counter and increment the counter afterwards.
sourcefn next_id_counter_u32(ctr: &mut u32) -> u32
fn next_id_counter_u32(ctr: &mut u32) -> u32
Get the value of a counter and increment the counter afterwards.
sourcefn create_pin(
&mut self,
parent: CellId,
name: String,
direction: Direction
) -> PinId
fn create_pin(
&mut self,
parent: CellId,
name: String,
direction: Direction
) -> PinId
Append a new pin to the parent
circuit.
Update all circuit instances with the new pin.
sourcefn create_pin_inst(&mut self, circuit: CellInstId, pin: PinId) -> PinInstId
fn create_pin_inst(&mut self, circuit: CellInstId, pin: PinId) -> PinInstId
Insert a new pin instance to a circuit instance.
sourcefn pins_for_net(&self, net: &NetId) -> impl Iterator<Item = PinId> + '_
fn pins_for_net(&self, net: &NetId) -> impl Iterator<Item = PinId> + '_
Iterate over all pins connected to a net.
sourcefn pins_instances_for_net(
&self,
net: &NetId
) -> impl Iterator<Item = PinInstId> + '_
fn pins_instances_for_net(
&self,
net: &NetId
) -> impl Iterator<Item = PinInstId> + '_
Iterate over all pin instances connected to a net.
Trait Implementations
sourceimpl<C: Clone + CoordinateType> Clone for Chip<C>
impl<C: Clone + CoordinateType> Clone for Chip<C>
sourceimpl<C: Debug + CoordinateType> Debug for Chip<C>
impl<C: Debug + CoordinateType> Debug for Chip<C>
sourceimpl<C: CoordinateType + One> Default for Chip<C>
impl<C: CoordinateType + One> Default for Chip<C>
sourceimpl<'de, C: CoordinateType> Deserialize<'de> for Chip<C> where
C: Deserialize<'de>,
impl<'de, C: CoordinateType> Deserialize<'de> for Chip<C> where
C: Deserialize<'de>,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl HierarchyBase for Chip<Coord>
impl HierarchyBase for Chip<Coord>
type CellInstId = CellInstId
type CellInstId = CellInstId
Cell instance identifier type.
sourcefn cell_by_name(&self, name: &str) -> Option<CellId>
fn cell_by_name(&self, name: &str) -> Option<CellId>
Find a cell by its name.
Return the cell with the given name. Returns None
if the cell does not exist. Read more
sourcefn cell_instance_by_name(
&self,
parent_circuit: &Self::CellId,
name: &str
) -> Option<Self::CellInstId>
fn cell_instance_by_name(
&self,
parent_circuit: &Self::CellId,
name: &str
) -> Option<Self::CellInstId>
Find a cell instance by its name.
Returns None
if the name does not exist. Read more
sourcefn cell_instance_name(
&self,
circuit_inst: &Self::CellInstId
) -> Option<Self::NameType>
fn cell_instance_name(
&self,
circuit_inst: &Self::CellInstId
) -> Option<Self::NameType>
Get the name of the cell instance.
sourcefn parent_cell(&self, circuit_instance: &Self::CellInstId) -> Self::CellId
fn parent_cell(&self, circuit_instance: &Self::CellInstId) -> Self::CellId
Get the ID of the parent cell of this instance.
sourcefn template_cell(&self, circuit_instance: &Self::CellInstId) -> Self::CellId
fn template_cell(&self, circuit_instance: &Self::CellInstId) -> Self::CellId
Get the ID of the template cell of this instance.
sourcefn 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.
sourcefn for_each_cell_instance<F>(&self, circuit: &Self::CellId, f: F) where
F: FnMut(Self::CellInstId),
fn for_each_cell_instance<F>(&self, circuit: &Self::CellId, f: F) where
F: FnMut(Self::CellInstId),
Call a function on each instance in this cell.
sourcefn each_cell_instance(
&self,
circuit: &Self::CellId
) -> Box<dyn Iterator<Item = Self::CellInstId> + '_>
fn each_cell_instance(
&self,
circuit: &Self::CellId
) -> Box<dyn Iterator<Item = Self::CellInstId> + '_>
Iterate over all instances in a cell.
sourcefn for_each_cell_dependency<F>(&self, circuit: &Self::CellId, f: F) where
F: FnMut(Self::CellId),
fn for_each_cell_dependency<F>(&self, circuit: &Self::CellId, f: F) where
F: FnMut(Self::CellId),
Call a function for each cell that is a child of this cell
.
sourcefn each_cell_dependency(
&self,
circuit: &Self::CellId
) -> Box<dyn Iterator<Item = Self::CellId> + '_>
fn each_cell_dependency(
&self,
circuit: &Self::CellId
) -> Box<dyn Iterator<Item = Self::CellId> + '_>
Iterate over all cells that are instantiated in this cell
.
sourcefn 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
.
sourcefn for_each_dependent_cell<F>(&self, circuit: &Self::CellId, f: F) where
F: FnMut(Self::CellId),
fn for_each_dependent_cell<F>(&self, circuit: &Self::CellId, f: F) where
F: FnMut(Self::CellId),
Call a function for each cell that directly depends on cell
.
sourcefn each_dependent_cell(
&self,
circuit: &Self::CellId
) -> Box<dyn Iterator<Item = Self::CellId> + '_>
fn each_dependent_cell(
&self,
circuit: &Self::CellId
) -> Box<dyn Iterator<Item = Self::CellId> + '_>
Iterate over each cell that directly depends on cell
.
sourcefn 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
.
sourcefn for_each_cell_reference<F>(&self, circuit: &Self::CellId, f: F) where
F: FnMut(Self::CellInstId),
fn for_each_cell_reference<F>(&self, circuit: &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. Read more
sourcefn each_cell_reference(
&self,
circuit: &Self::CellId
) -> Box<dyn Iterator<Item = Self::CellInstId> + '_>
fn each_cell_reference(
&self,
circuit: &Self::CellId
) -> Box<dyn Iterator<Item = Self::CellInstId> + '_>
Iterate over all instances of this cell
, i.e. instances that use this cell as
a template. Read more
sourcefn num_cell_references(&self, cell: &Self::CellId) -> usize
fn num_cell_references(&self, cell: &Self::CellId) -> usize
Count all instantiations of cell
.
sourcefn num_child_instances(&self, cell: &Self::CellId) -> usize
fn num_child_instances(&self, cell: &Self::CellId) -> usize
Get the number of cell instances inside the cell
.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn each_cell_vec(&self) -> Vec<Self::CellId>
fn each_cell_vec(&self) -> Vec<Self::CellId>
Get a Vec
of all cell IDs in this netlist.
sourcefn each_cell_instance_vec(&self, cell: &Self::CellId) -> Vec<Self::CellInstId>
fn each_cell_instance_vec(&self, cell: &Self::CellId) -> Vec<Self::CellInstId>
Get a Vec
of the IDs of all instances in this cell.
sourcefn each_cell_dependency_vec(&self, cell: &Self::CellId) -> Vec<Self::CellId>
fn each_cell_dependency_vec(&self, cell: &Self::CellId) -> Vec<Self::CellId>
Get a Vec
of each cell that is a child of this cell
.
sourcefn each_dependent_cell_vec(&self, cell: &Self::CellId) -> Vec<Self::CellId>
fn each_dependent_cell_vec(&self, cell: &Self::CellId) -> Vec<Self::CellId>
Get a Vec
of each cell that directly depends on cell
.
sourcefn each_cell_reference_vec(&self, cell: &Self::CellId) -> Vec<Self::CellInstId>
fn each_cell_reference_vec(&self, cell: &Self::CellId) -> Vec<Self::CellInstId>
Get a Vec
with all cell instances referencing this cell.
sourceimpl HierarchyEdit for Chip<Coord>
impl HierarchyEdit for Chip<Coord>
sourcefn create_cell(&mut self, name: Self::NameType) -> Self::CellId
fn create_cell(&mut self, name: Self::NameType) -> Self::CellId
Create a new and empty cell template. A cell template can be be instantiated in other cells. Read more
sourcefn remove_cell(&mut self, cell_id: &Self::CellId)
fn remove_cell(&mut self, cell_id: &Self::CellId)
Remove a cell and all the instances of it. Read more
sourcefn create_cell_instance(
&mut self,
parent_cell: &Self::CellId,
template_cell: &Self::CellId,
name: Option<Self::NameType>
) -> Self::CellInstId
fn create_cell_instance(
&mut self,
parent_cell: &Self::CellId,
template_cell: &Self::CellId,
name: Option<Self::NameType>
) -> Self::CellInstId
Create a new instance of template_cell
in parent_cell
.
Recursive instantiation is forbidden and might panic. Read more
sourcefn remove_cell_instance(&mut self, id: &Self::CellInstId)
fn remove_cell_instance(&mut self, id: &Self::CellInstId)
Remove cell instance if it exists. Read more
sourcefn rename_cell_instance(
&mut self,
inst: &Self::CellInstId,
new_name: Option<Self::NameType>
)
fn rename_cell_instance(
&mut self,
inst: &Self::CellInstId,
new_name: Option<Self::NameType>
)
Change the name of a cell instance. Read more
sourcefn rename_cell(&mut self, cell: &Self::CellId, new_name: Self::NameType)
fn rename_cell(&mut self, cell: &Self::CellId, new_name: Self::NameType)
Change the name of a cell. Read more
sourcefn set_chip_property(&mut self, key: Self::NameType, value: PropertyValue)
fn set_chip_property(&mut self, key: Self::NameType, value: PropertyValue)
Set a property of the top-level chip data structure..
sourcefn set_cell_property(
&mut self,
cell: &Self::CellId,
key: Self::NameType,
value: PropertyValue
)
fn set_cell_property(
&mut self,
cell: &Self::CellId,
key: Self::NameType,
value: PropertyValue
)
Set a property of a cell.
sourcefn set_cell_instance_property(
&mut self,
inst: &Self::CellInstId,
key: Self::NameType,
value: PropertyValue
)
fn set_cell_instance_property(
&mut self,
inst: &Self::CellInstId,
key: Self::NameType,
value: PropertyValue
)
Set a property of a cell instance.
sourceimpl L2NBase for Chip<Coord>
impl L2NBase for Chip<Coord>
sourcefn shapes_of_net(
&self,
net_id: &Self::NetId
) -> Box<dyn Iterator<Item = Self::ShapeId> + '_>
fn shapes_of_net(
&self,
net_id: &Self::NetId
) -> Box<dyn Iterator<Item = Self::ShapeId> + '_>
Iterate over all shapes that are marked to belong to the specified net.
sourcefn shapes_of_pin(
&self,
pin_id: &Self::PinId
) -> Box<dyn Iterator<Item = Self::ShapeId> + '_>
fn shapes_of_pin(
&self,
pin_id: &Self::PinId
) -> Box<dyn Iterator<Item = Self::ShapeId> + '_>
Iterate over all shapes that are part of the pin.
sourcefn get_net_of_shape(&self, shape_id: &Self::ShapeId) -> Option<Self::NetId>
fn get_net_of_shape(&self, shape_id: &Self::ShapeId) -> Option<Self::NetId>
Get the net of a shape.
sourcefn get_pin_of_shape(&self, shape_id: &Self::ShapeId) -> Option<Self::PinId>
fn get_pin_of_shape(&self, shape_id: &Self::ShapeId) -> Option<Self::PinId>
Get the pin that belongs to the shape (if any).
sourceimpl L2NEdit for Chip<Coord>
impl L2NEdit for Chip<Coord>
sourceimpl LayoutBase for Chip<Coord>
impl LayoutBase for Chip<Coord>
type Area = i64
type Area = i64
Number type for areas.
This is possibly another type then Coord
for the following reasons: Read more
sourcefn each_layer(&self) -> Box<dyn Iterator<Item = Self::LayerId> + '_>
fn each_layer(&self) -> Box<dyn Iterator<Item = Self::LayerId> + '_>
Iterate over all defined layers.
sourcefn layer_info(&self, layer: &Self::LayerId) -> LayerInfo<Self::NameType>
fn layer_info(&self, layer: &Self::LayerId) -> LayerInfo<Self::NameType>
Get the LayerInfo
data structure for this layer.
sourcefn find_layer(&self, index: u32, datatype: u32) -> Option<Self::LayerId>
fn find_layer(&self, index: u32, datatype: u32) -> Option<Self::LayerId>
Find layer index by the (index, data type) tuple.
sourcefn layer_by_name(&self, name: &str) -> Option<Self::LayerId>
fn layer_by_name(&self, name: &str) -> Option<Self::LayerId>
Find layer index by the name.
sourcefn bounding_box_per_layer(
&self,
cell: &Self::CellId,
layer: &Self::LayerId
) -> Option<Rect<Coord>>
fn bounding_box_per_layer(
&self,
cell: &Self::CellId,
layer: &Self::LayerId
) -> Option<Rect<Coord>>
Compute the bounding box of the shapes on one layer. The bounding box also includes all child cell instances. Read more
sourcefn each_shape_id(
&self,
cell: &Self::CellId,
layer: &Self::LayerId
) -> Box<dyn Iterator<Item = Self::ShapeId> + '_>
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.
sourcefn for_each_shape<F>(&self, cell_id: &Self::CellId, layer: &Self::LayerId, f: F) where
F: FnMut(&Self::ShapeId, &Geometry<Self::Coord>),
fn for_each_shape<F>(&self, cell_id: &Self::CellId, layer: &Self::LayerId, f: F) where
F: FnMut(&Self::ShapeId, &Geometry<Self::Coord>),
Call a function for each shape on this layer.
sourcefn with_shape<F, R>(&self, shape_id: &Self::ShapeId, f: F) -> R where
F: FnMut(&Self::LayerId, &Geometry<Self::Coord>) -> R,
fn with_shape<F, R>(&self, shape_id: &Self::ShapeId, f: F) -> R where
F: FnMut(&Self::LayerId, &Geometry<Self::Coord>) -> R,
Access a shape by its ID.
sourcefn parent_of_shape(
&self,
shape_id: &Self::ShapeId
) -> (Self::CellId, Self::LayerId)
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.
sourcefn get_transform(
&self,
cell_inst: &Self::CellInstId
) -> SimpleTransform<Self::Coord>
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.
sourcefn get_shape_property(
&self,
shape: &Self::ShapeId,
key: &Self::NameType
) -> Option<PropertyValue>
fn get_shape_property(
&self,
shape: &Self::ShapeId,
key: &Self::NameType
) -> Option<PropertyValue>
Get a property of a shape.
sourcefn bounding_box(&self, cell: &Self::CellId) -> Option<Rect<Self::Coord>>
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
. Read more
sourcefn shape_geometry(&self, shape_id: &Self::ShapeId) -> Geometry<Self::Coord>
fn shape_geometry(&self, shape_id: &Self::ShapeId) -> Geometry<Self::Coord>
Get a clone of the shape geometry.
sourcefn shape_layer(&self, shape_id: &Self::ShapeId) -> Self::LayerId
fn shape_layer(&self, shape_id: &Self::ShapeId) -> Self::LayerId
Get the layer of a shape.
sourcefn 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>),
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
. Read more
sourceimpl LayoutEdit for Chip<Coord>
impl LayoutEdit for Chip<Coord>
sourcefn set_dbu(&mut self, dbu: Self::Coord)
fn set_dbu(&mut self, dbu: Self::Coord)
Set the distance unit used in this layout in ‘pixels per micron’.
sourcefn create_layer(&mut self, index: u32, datatype: u32) -> Self::LayerId
fn create_layer(&mut self, index: u32, datatype: u32) -> Self::LayerId
Create a new layer.
Use set_layer_name()
to define a name. Read more
sourcefn create_layer_with_id(
&mut self,
layer_id: Self::LayerId,
index: u32,
datatype: u32
) -> Result<(), ()>
fn create_layer_with_id(
&mut self,
layer_id: Self::LayerId,
index: u32,
datatype: u32
) -> Result<(), ()>
Create a new layer with a specific ID. This is used to clone layer-stacks between layouts while preserving their IDs.
Returns an Err
when the ID already exists. Read more
sourcefn set_layer_name(
&mut self,
layer: &Self::LayerId,
name: Option<Self::NameType>
) -> Option<Self::NameType>
fn set_layer_name(
&mut self,
layer: &Self::LayerId,
name: Option<Self::NameType>
) -> Option<Self::NameType>
Set the name of a layer or clear the layer name when passing None
.
This method should not change the ID of the layer.
Returns the previous name of the layer. Read more
sourcefn insert_shape(
&mut self,
parent_cell: &Self::CellId,
layer: &Self::LayerId,
geometry: Geometry<Self::Coord>
) -> Self::ShapeId
fn insert_shape(
&mut self,
parent_cell: &Self::CellId,
layer: &Self::LayerId,
geometry: Geometry<Self::Coord>
) -> Self::ShapeId
Insert a geometric shape into the parent cell.
sourcefn remove_shape(
&mut self,
shape_id: &Self::ShapeId
) -> Option<Geometry<Self::Coord>>
fn remove_shape(
&mut self,
shape_id: &Self::ShapeId
) -> Option<Geometry<Self::Coord>>
Remove shape from the parent cell.
sourcefn replace_shape(
&mut self,
shape_id: &Self::ShapeId,
geometry: Geometry<Self::Coord>
) -> Geometry<Self::Coord>
fn replace_shape(
&mut self,
shape_id: &Self::ShapeId,
geometry: Geometry<Self::Coord>
) -> Geometry<Self::Coord>
Replace the geometry of a shape.
sourcefn set_transform(
&mut self,
cell_inst: &Self::CellInstId,
tf: SimpleTransform<Self::Coord>
)
fn set_transform(
&mut self,
cell_inst: &Self::CellInstId,
tf: SimpleTransform<Self::Coord>
)
Set the geometric transform that describes the location of a cell instance relative to its parent.
sourcefn set_shape_property(
&mut self,
shape: &Self::ShapeId,
key: Self::NameType,
value: PropertyValue
)
fn set_shape_property(
&mut self,
shape: &Self::ShapeId,
key: Self::NameType,
value: PropertyValue
)
Set a property of a shape.
sourceimpl NetlistBase for Chip
impl NetlistBase for Chip
type PinInstId = PinInstId
type PinInstId = PinInstId
Pin instance identifier type. Uniquely identifies a pin instance in the whole netlist. A pin instance is a pin of a circuit instance. Read more
sourcefn template_pin(&self, pin_instance: &Self::PinInstId) -> Self::PinId
fn template_pin(&self, pin_instance: &Self::PinInstId) -> Self::PinId
Get the ID of the template pin of this pin instance.
sourcefn pin_direction(&self, pin: &Self::PinId) -> Direction
fn pin_direction(&self, pin: &Self::PinId) -> Direction
Get the signal direction of the pin.
sourcefn pin_by_name(
&self,
parent_circuit: &Self::CellId,
name: &str
) -> Option<Self::PinId>
fn pin_by_name(
&self,
parent_circuit: &Self::CellId,
name: &str
) -> Option<Self::PinId>
Find a pin by its name.
Returns None
if no such pin can be found. Read more
sourcefn parent_cell_of_pin(&self, pin: &Self::PinId) -> Self::CellId
fn parent_cell_of_pin(&self, pin: &Self::PinId) -> Self::CellId
Get the ID of the parent circuit of this pin.
sourcefn parent_of_pin_instance(&self, pin_inst: &Self::PinInstId) -> Self::CellInstId
fn parent_of_pin_instance(&self, pin_inst: &Self::PinInstId) -> Self::CellInstId
Get the ID of the circuit instance that holds this pin instance.
sourcefn parent_cell_of_net(&self, net: &Self::NetId) -> Self::CellId
fn parent_cell_of_net(&self, net: &Self::NetId) -> Self::CellId
Get the ID of the parent circuit of this net.
sourcefn net_of_pin(&self, pin: &Self::PinId) -> Option<Self::NetId>
fn net_of_pin(&self, pin: &Self::PinId) -> Option<Self::NetId>
Get the internal net attached to this pin.
sourcefn net_of_pin_instance(&self, pin_inst: &Self::PinInstId) -> Option<Self::NetId>
fn net_of_pin_instance(&self, pin_inst: &Self::PinInstId) -> Option<Self::NetId>
Get the external net attached to this pin instance.
sourcefn net_zero(&self, parent_circuit: &Self::CellId) -> Self::NetId
fn net_zero(&self, parent_circuit: &Self::CellId) -> Self::NetId
Get the net of the logical constant zero.
sourcefn net_one(&self, parent_circuit: &Self::CellId) -> Self::NetId
fn net_one(&self, parent_circuit: &Self::CellId) -> Self::NetId
Get the net of the logical constant one.
sourcefn net_by_name(
&self,
parent_circuit: &Self::CellId,
name: &str
) -> Option<Self::NetId>
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. Read more
sourcefn for_each_pin<F>(&self, circuit: &Self::CellId, f: F) where
F: FnMut(Self::PinId),
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.
sourcefn each_pin(&self, circuit_id: &CellId) -> Box<dyn Iterator<Item = PinId> + '_>
fn each_pin(&self, circuit_id: &CellId) -> Box<dyn Iterator<Item = PinId> + '_>
Iterate over all pins of a circuit.
sourcefn for_each_pin_instance<F>(&self, circuit_inst: &Self::CellInstId, f: F) where
F: FnMut(Self::PinInstId),
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.
sourcefn each_pin_instance<'a>(
&'a self,
circuit_inst: &Self::CellInstId
) -> Box<dyn Iterator<Item = Self::PinInstId> + 'a>
fn each_pin_instance<'a>(
&'a self,
circuit_inst: &Self::CellInstId
) -> Box<dyn Iterator<Item = Self::PinInstId> + 'a>
Iterate over all pin instances of a circuit.
sourcefn for_each_internal_net<F>(&self, circuit: &Self::CellId, f: F) where
F: FnMut(Self::NetId),
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.
sourcefn each_internal_net(
&self,
circuit: &Self::CellId
) -> Box<dyn Iterator<Item = Self::NetId> + '_>
fn each_internal_net(
&self,
circuit: &Self::CellId
) -> Box<dyn Iterator<Item = Self::NetId> + '_>
Iterate over all defined nets inside a circuit.
sourcefn num_internal_nets(&self, circuit: &Self::CellId) -> usize
fn num_internal_nets(&self, circuit: &Self::CellId) -> usize
Return the number of nets defined inside a cell.
sourcefn for_each_pin_of_net<F>(&self, net: &Self::NetId, f: F) where
F: FnMut(Self::PinId),
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.
sourcefn each_pin_of_net<'a>(
&'a self,
net: &Self::NetId
) -> Box<dyn Iterator<Item = Self::PinId> + 'a>
fn each_pin_of_net<'a>(
&'a self,
net: &Self::NetId
) -> Box<dyn Iterator<Item = Self::PinId> + 'a>
Iterate over all pins of a net.
sourcefn for_each_pin_instance_of_net<F>(&self, net: &Self::NetId, f: F) where
F: FnMut(Self::PinInstId),
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.
sourcefn each_pin_instance_of_net<'a>(
&'a self,
net: &Self::NetId
) -> Box<dyn Iterator<Item = Self::PinInstId> + 'a>
fn each_pin_instance_of_net<'a>(
&'a self,
net: &Self::NetId
) -> Box<dyn Iterator<Item = Self::PinInstId> + 'a>
Iterate over all pins of a net.
sourcefn pin_instance(
&self,
cell_inst: &Self::CellInstId,
pin: &Self::PinId
) -> Self::PinInstId
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.
sourcefn net_of_terminal(&self, terminal: &TerminalId<Self>) -> Option<Self::NetId>
fn net_of_terminal(&self, terminal: &TerminalId<Self>) -> Option<Self::NetId>
Get the net that is attached to this terminal.
sourcefn each_pin_vec(&self, circuit: &Self::CellId) -> Vec<Self::PinId>
fn each_pin_vec(&self, circuit: &Self::CellId) -> Vec<Self::PinId>
Get a Vec
with the IDs of all pins of this circuit.
sourcefn each_pin_instance_vec(
&self,
circuit_instance: &Self::CellInstId
) -> Vec<Self::PinInstId>
fn each_pin_instance_vec(
&self,
circuit_instance: &Self::CellInstId
) -> Vec<Self::PinInstId>
Get a Vec
with the IDs of all pin instance of this circuit instance.
sourcefn each_external_net<'a>(
&'a self,
circuit_instance: &Self::CellInstId
) -> Box<dyn Iterator<Item = Self::NetId> + 'a>
fn each_external_net<'a>(
&'a self,
circuit_instance: &Self::CellInstId
) -> Box<dyn Iterator<Item = Self::NetId> + 'a>
Iterate over all external nets connected to the circuit instance. A net might appear more than once. Read more
sourcefn for_each_external_net<F>(&self, circuit_instance: &Self::CellInstId, f: F) where
F: FnMut(Self::NetId),
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. Read more
sourcefn each_external_net_vec(
&self,
circuit_instance: &Self::CellInstId
) -> Vec<Self::NetId>
fn each_external_net_vec(
&self,
circuit_instance: &Self::CellInstId
) -> Vec<Self::NetId>
Get a vector of all external nets connected to the circuit instance. A net might appear more than once. Read more
sourcefn each_internal_net_vec(&self, circuit: &Self::CellId) -> Vec<Self::NetId>
fn each_internal_net_vec(&self, circuit: &Self::CellId) -> Vec<Self::NetId>
Get a Vec
with all nets in this circuit.
sourcefn num_net_pins(&self, net: &Self::NetId) -> usize
fn num_net_pins(&self, net: &Self::NetId) -> usize
Get the number of pins that are connected to this net.
sourcefn num_net_pin_instances(&self, net: &Self::NetId) -> usize
fn num_net_pin_instances(&self, net: &Self::NetId) -> usize
Get the number of pin instances that are connected to this net.
sourcefn num_net_terminals(&self, net: &Self::NetId) -> usize
fn num_net_terminals(&self, net: &Self::NetId) -> usize
Get the number of terminals that are connected to this net.
sourcefn each_pin_of_net_vec(&self, net: &Self::NetId) -> Vec<Self::PinId>
fn each_pin_of_net_vec(&self, net: &Self::NetId) -> Vec<Self::PinId>
Get a Vec
with all pin IDs connected to this net.
sourcefn each_pin_instance_of_net_vec(&self, net: &Self::NetId) -> Vec<Self::PinInstId>
fn each_pin_instance_of_net_vec(&self, net: &Self::NetId) -> Vec<Self::PinInstId>
Get a Vec
with all pin instance IDs connected to this net.
sourcefn for_each_terminal_of_net<F>(&self, net: &Self::NetId, f: F) where
F: FnMut(TerminalId<Self>),
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.
sourcefn each_terminal_of_net_vec(&self, net: &Self::NetId) -> Vec<TerminalId<Self>>
fn each_terminal_of_net_vec(&self, net: &Self::NetId) -> Vec<TerminalId<Self>>
Get a Vec
with all terminal IDs connected to this net.
sourcefn each_terminal_of_net<'a>(
&'a self,
net: &Self::NetId
) -> Box<dyn Iterator<Item = TerminalId<Self>> + 'a>
fn each_terminal_of_net<'a>(
&'a self,
net: &Self::NetId
) -> Box<dyn Iterator<Item = TerminalId<Self>> + 'a>
Iterate over all terminals of a net.
sourceimpl NetlistEdit for Chip
impl NetlistEdit for Chip
sourcefn create_pin(
&mut self,
circuit: &Self::CellId,
name: Self::NameType,
direction: Direction
) -> Self::PinId
fn create_pin(
&mut self,
circuit: &Self::CellId,
name: Self::NameType,
direction: Direction
) -> Self::PinId
Create a new pin in this cell. Also adds the pin to all instances of the cell. Read more
sourcefn remove_pin(&mut self, id: &Self::PinId)
fn remove_pin(&mut self, id: &Self::PinId)
Remove the pin from this circuit and from all instances of this circuit.
sourcefn rename_pin(
&mut self,
pin: &Self::PinId,
new_name: Self::NameType
) -> Self::NameType
fn rename_pin(
&mut self,
pin: &Self::PinId,
new_name: Self::NameType
) -> Self::NameType
Change the name of the pin, returns the old name. Read more
sourcefn create_net(&mut self, parent: &CellId, name: Option<Self::NameType>) -> NetId
fn create_net(&mut self, parent: &CellId, name: Option<Self::NameType>) -> NetId
Create a net net that lives in the parent
circuit.
sourcefn rename_net(
&mut self,
net_id: &Self::NetId,
new_name: Option<Self::NameType>
) -> Option<Self::NameType>
fn rename_net(
&mut self,
net_id: &Self::NetId,
new_name: Option<Self::NameType>
) -> Option<Self::NameType>
Set a new name for the net. This might panic if the name already exists. Returns the old name. Read more
sourcefn remove_net(&mut self, net: &NetId)
fn remove_net(&mut self, net: &NetId)
Delete the net if it exists and disconnect all connected terminals.
sourcefn connect_pin(&mut self, pin: &PinId, net: Option<NetId>) -> Option<NetId>
fn connect_pin(&mut self, pin: &PinId, net: Option<NetId>) -> Option<NetId>
Connect a pin to a net. Returns the old connected net, if any. Read more
sourcefn connect_pin_instance(
&mut self,
pin: &PinInstId,
net: Option<NetId>
) -> Option<Self::NetId>
fn connect_pin_instance(
&mut self,
pin: &PinInstId,
net: Option<NetId>
) -> Option<Self::NetId>
Connect a pin instance to a net. Returns the old connected net, if any. Read more
sourcefn disconnect_pin(&mut self, pin: &Self::PinId) -> Option<Self::NetId>
fn disconnect_pin(&mut self, pin: &Self::PinId) -> Option<Self::NetId>
Disconnect the pin from any connected net. Returns the old connected net, if any. Read more
sourcefn disconnect_pin_instance(
&mut self,
pin_instance: &Self::PinInstId
) -> Option<Self::NetId>
fn disconnect_pin_instance(
&mut self,
pin_instance: &Self::PinInstId
) -> Option<Self::NetId>
Disconnect the pin instance from any connected net. Returns the old connected net, if any. Read more
sourcefn connect_terminal(
&mut self,
terminal: &TerminalId<Self>,
net: Option<Self::NetId>
) -> Option<Self::NetId>
fn connect_terminal(
&mut self,
terminal: &TerminalId<Self>,
net: Option<Self::NetId>
) -> Option<Self::NetId>
Connect a terminal to a net. Returns the old connected net, if any. Read more
sourcefn disconnect_terminal(
&mut self,
terminal: &TerminalId<Self>
) -> Option<Self::NetId>
fn disconnect_terminal(
&mut self,
terminal: &TerminalId<Self>
) -> Option<Self::NetId>
Disconnect the terminal from any connected net. Returns the old connected net, if any. Read more
Auto Trait Implementations
impl<C> RefUnwindSafe for Chip<C> where
C: RefUnwindSafe,
impl<C> Send for Chip<C> where
C: Send,
impl<C> Sync for Chip<C> where
C: Sync,
impl<C> Unpin for Chip<C> where
C: Unpin,
impl<C> UnwindSafe for Chip<C> where
C: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<N> HierarchyEditUtil for N where
N: HierarchyEdit,
impl<N> HierarchyEditUtil for N where
N: HierarchyEdit,
sourcefn clear_cell_instances(&mut self, cell: &Self::CellId)
fn clear_cell_instances(&mut self, cell: &Self::CellId)
Remove all child instances inside the cell
.
sourcefn prune_cell_instance(&mut self, inst: &Self::CellInstId)
fn prune_cell_instance(&mut self, inst: &Self::CellInstId)
Remove the cell instance and all cells which are then not used anymore.
sourcefn prune_cell(&mut self, cell: &Self::CellId)
fn prune_cell(&mut self, cell: &Self::CellId)
Remove the cell and all other cells which are then not used anymore.
sourceimpl<N> HierarchyUtil for N where
N: HierarchyBase,
impl<N> HierarchyUtil for N where
N: HierarchyBase,
sourcefn 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. Read more
sourcefn 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. Read more
sourcefn each_top_level_cell(&self) -> Box<dyn Iterator<Item = Self::CellId> + '_>
fn each_top_level_cell(&self) -> Box<dyn Iterator<Item = Self::CellId> + '_>
Iterate over all top level cells.
sourcefn each_leaf_cell(&self) -> Box<dyn Iterator<Item = Self::CellId> + '_>
fn each_leaf_cell(&self) -> Box<dyn Iterator<Item = Self::CellId> + '_>
Iterate over all leaf cells, i.e. cells which contain no other cells.
sourcefn each_cell_bottom_to_top(&self) -> Box<dyn Iterator<Item = Self::CellId> + '_>
fn each_cell_bottom_to_top(&self) -> Box<dyn Iterator<Item = Self::CellId> + '_>
Iterate over topologically sorted cells (from leaf-cells to top-cells).
sourceimpl<L> LayoutEditUtil for L where
L: LayoutEdit,
impl<L> LayoutEditUtil for L where
L: LayoutEdit,
sourcefn find_or_create_layer(&mut self, index: u32, datatype: u32) -> Self::LayerId
fn find_or_create_layer(&mut self, index: u32, datatype: u32) -> Self::LayerId
Create a layer or return an existing one.
sourceimpl<N> NetlistEditUtil for N where
N: NetlistEdit + ?Sized,
impl<N> NetlistEditUtil for N where
N: NetlistEdit + ?Sized,
sourcefn replace_net(&mut self, old_net: &Self::NetId, new_net: &Self::NetId)
fn replace_net(&mut self, old_net: &Self::NetId, new_net: &Self::NetId)
Take all terminals that are connected to old_net
and connect them to new_net
instead.
The old net is no longer used and removed. Read more
sourcefn flatten_circuit_instance(&mut self, circuit_instance: &Self::CellInstId)
fn flatten_circuit_instance(&mut self, circuit_instance: &Self::CellInstId)
Replace the circuit instance with its contents. Remove the circuit instance afterwards. Does not purge nets nor unconnected instances. So there could be unconnected nets or unconnected instances. Read more
sourcefn flatten_circuit(&mut self, circuit: &Self::CellId)
fn flatten_circuit(&mut self, circuit: &Self::CellId)
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. Read more
sourcefn purge_nets_in_circuit(&mut self, circuit_id: &Self::CellId) -> usize
fn purge_nets_in_circuit(&mut self, circuit_id: &Self::CellId) -> usize
Delete all unconnected nets in this circuit. Return number of purged nets. Read more
sourcefn purge_nets(&mut self) -> usize
fn purge_nets(&mut self) -> usize
Delete all unconnected nets in all circuits. Return number of purged nets. Read more
sourcefn create_net_names_in_circuit(&mut self, circuit_id: &Self::CellId, prefix: &str)
fn create_net_names_in_circuit(&mut self, circuit_id: &Self::CellId, prefix: &str)
Create names for all unnamed nets in the specified circuit.
The names will consist of the prefix
and an appended number.
After calling this method, no net inside this circuit will be unnamed. Read more
sourceimpl<N> NetlistUtil for N where
N: NetlistBase,
impl<N> NetlistUtil for N where
N: NetlistBase,
sourcefn is_constant_net(&self, net: &Self::NetId) -> bool
fn is_constant_net(&self, net: &Self::NetId) -> bool
Check if the net is either the constant LOW or HIGH.
sourcefn nets_of_cell_instance(
&self,
inst: &Self::CellInstId
) -> Box<dyn Iterator<Item = Self::NetId> + '_>
fn nets_of_cell_instance(
&self,
inst: &Self::CellInstId
) -> Box<dyn Iterator<Item = Self::NetId> + '_>
Get all nets that are connected to the circuit instance.
sourcefn for_each_circuit_instance_of_net<F>(&self, net: &Self::NetId, f: F) where
F: FnMut(Self::CellInstId),
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. Read more
sourcefn each_circuit_instance_of_net_vec(
&self,
net: &Self::NetId
) -> Vec<Self::CellInstId>
fn each_circuit_instance_of_net_vec(
&self,
net: &Self::NetId
) -> Vec<Self::CellInstId>
Iterate over all circuit instances connected to this net. An instance is touched not more than once. Read more