Struct libreda_db::chip::Circuit
source · pub struct Circuit<C = Coord, U = ()>where
C: CoordinateType,
U: Default,{Show 16 fields
id: CellId,
name: String,
instances: FnvHashSet<CellInstId>,
instances_by_name: HashMap<String, CellInstId>,
references: FnvHashSet<CellInstId>,
dependencies: FnvHashMap<CellId, usize>,
dependent_circuits: FnvHashMap<CellId, usize>,
instance_properties: FnvHashMap<CellInstId, PropertyStore<String>>,
properties: PropertyStore<String>,
user_data: U,
pins: Vec<PinId>,
nets: FnvHashSet<NetId>,
nets_by_name: HashMap<String, NetId>,
net_low: NetId,
net_high: NetId,
shapes_map: FnvHashMap<LayerId, Shapes<C>>,
}Expand description
A circuit is defined by an interface (pins) and a content which consists of interconnected circuit instances.
Template parameters:
U: User defined data.
Fields§
§id: CellIdID of this circuit.
name: StringName of the circuit.
instances: FnvHashSet<CellInstId>Instances inside this circuit.
instances_by_name: HashMap<String, CellInstId>Instances inside this circuit indexed by name. Not every instance needs to have a name.
references: FnvHashSet<CellInstId>Circuit instances that reference to this circuit.
dependencies: FnvHashMap<CellId, usize>Set of circuits that are direct dependencies of this circuit. Stored together with a counter of how many instances of the dependency are present. This are the circuits towards the leaves in the dependency tree.
dependent_circuits: FnvHashMap<CellId, usize>Circuits that use a instance of this circuit.
instance_properties: FnvHashMap<CellInstId, PropertyStore<String>>Properties related to the instances in this template. Instance properties are stored here for lower overhead of cell instances.
properties: PropertyStore<String>Properties related to this template.
user_data: UUser-defined data.
pins: Vec<PinId>Pin definitions, the actual pin structs are in the top level Chip struct.
nets: FnvHashSet<NetId>All nets in this circuit.
nets_by_name: HashMap<String, NetId>Nets IDs stored by name.
net_low: NetIdLogic constant LOW net.
net_high: NetIdLogic constant HIGH net.
shapes_map: FnvHashMap<LayerId, Shapes<C>>Mapping from layer indices to geometry data.
Implementations§
source§impl Circuit
impl Circuit
sourcefn shapes(&self, layer_id: &LayerId) -> Option<&Shapes<Coord>>
fn shapes(&self, layer_id: &LayerId) -> Option<&Shapes<Coord>>
Get the shape container of this layer.
Returns None if the shapes object does not exist for this layer.
sourcefn shapes_mut(&mut self, layer_id: &LayerId) -> Option<&mut Shapes<Coord>>
fn shapes_mut(&mut self, layer_id: &LayerId) -> Option<&mut Shapes<Coord>>
Get the mutable shape container of this layer.
Returns None if the shapes object does not exist for this layer.
sourcefn get_or_create_shapes_mut(&mut self, layer_id: &LayerId) -> &mut Shapes<Coord>
fn get_or_create_shapes_mut(&mut self, layer_id: &LayerId) -> &mut Shapes<Coord>
Get a mutable reference to the shapes container of the layer. When none exists
a shapes object is created for this layer.