bag.design.instance
This module defines classes representing various design instances.
Module Contents
Classes
This class represents an instance inside a schematic. |
- class bag.design.instance.SchInstance(db: bag.design.database.ModuleDB, inst_ptr: pybag.core.PySchInstRef, master: Optional[bag.design.module.Module] = None, prev_name: str = '', dx: int = 0, dy: int = 0)[source]
This class represents an instance inside a schematic.
- Parameters:
db (ModuleDB) – the design database.
inst_ptr (PySchInstRef) – a reference to the actual schematic instance object.
- property database: bag.design.database.ModuleDB[source]
the schematic database.
- Type:
- property master: Optional[bag.design.module.Module][source]
the master object of this instance.
- Type:
Optional[Module]
- property master_class: Optional[Type[bag.design.module.Module]][source]
the class object of the master of this instance.
- Type:
Optional[Type[Module]]
- property prev_name: str[source]
the instance name before being arrayed or renamed; empty if instance is not arrayed or renamed.
- Type:
- property is_primitive: bool[source]
True if this is a primitive (static or in BAG_prim) schematic instance.
- Type:
- property master_key: Optional[Any][source]
A unique key identifying the master object.
- Type:
Optional[Any]
- change_generator(gen_lib_name: str, gen_cell_name: str, static: bool = False, keep_connections: bool = False) None [source]
Change the circuit generator responsible for producing this instance.
Parameter
- gen_lib_namestr
new generator library name.
- gen_cell_namestr
new generator cell name.
- staticbool
True if this is actually a fixed schematic, not a generator.
- keep_connectionsbool
True to keep the old connections when the instance master changed.
- set_param(key: str, val: Any) None [source]
Sets the parameters of this instance.
- Parameters:
key (str) – the parameter name.
val (Any) – the parameter value.
- update_connection(inst_name: str, term_name: str, net_name: str) None [source]
Update connections of this schematic instance.
- check_connections()[source]
Check that the connections of this instance is valid.
This method is called by the finalize() method, and checks that the user connected every port of this instance.
- connections() Mapping[str, str] [source]
Convert the connections iterator method into a dictionary representation.
- params() Mapping[str, Union[int, float, bool, str]] [source]
Convert the params iterator method into a dictionary representation.