bag.layout.tech
This module defines BAG’s technology related classes
Module Contents
Classes
The base technology class. |
- class bag.layout.tech.TechInfo(tech_params: Dict[str, Any], config: Dict[str, Any], config_fname: str)[source]
Bases:
pybag.core.PyTech
The base technology class.
This class provides various methods for querying technology-specific information.
- Parameters:
- property tech_params: Dict[str, Any][source]
the technology parameters dictionary.
- Type:
Dict[str, Any]
- property config: Dict[str, Any][source]
The configuration dictionary used to compute various DRC rules.
- Type:
Dict[str, Any]
- abstract get_margin(is_vertical: bool, edge1: bag.util.immutable.Param, edge2: Optional[bag.util.immutable.Param]) int [source]
- abstract add_cell_boundary(template: bag.layout.template.TemplateBase, box: pybag.core.BBox) None [source]
Adds a cell boundary object to the given template.
This is usually the PR boundary.
- Parameters:
template (TemplateBase) – the template to draw the cell boundary in.
box (BBox) – the cell boundary bounding box.
- abstract draw_device_blockage(template: bag.layout.template.TemplateBase) None [source]
Draw device blockage layers on the given template.
- Parameters:
template (TemplateBase) – the template to draw the device block layers on
- abstract get_metal_em_specs(layer: str, purpose: str, w: int, length: int = -1, vertical: bool = False, dc_temp: int = -1000, rms_dt: int = -1000) Tuple[float, float, float] [source]
Returns a tuple of EM current/resistance specs of the given wire.
- Parameters:
layer (str) – the layer name.
purpose (str) – the purpose name.
w (int) – the width of the metal in resolution units (dimension perpendicular to current flow).
length (int) – the length of the metal in resolution units (dimension parallel to current flow). If negative, disable length enhancement.
vertical (bool) – True to compute vertical current.
dc_temp (int) – the temperature (in Celsius) to calculate DC current EM spec with. If equal to -1000, use technology default.
rms_dt (int) – the temperature delta (in Celsius) to target for when computing AC RMS current EM spec. If equal to -1000, use technology default.
- Returns:
idc (float) – maximum DC current, in Amperes.
iac_rms (float) – maximum AC RMS current, in Amperes.
iac_peak (float) – maximum AC peak current, in Amperes.
- abstract get_via_em_specs(layer_dir: int, layer: str, purpose: str, adj_layer: str, adj_purpose: str, cut_w: int, cut_h: int, m_w: int = -1, m_l: int = -1, adj_m_w: int = -1, adj_m_l: int = -1, array: bool = False, dc_temp: int = -1000, rms_dt: int = -1000) Tuple[float, float, float] [source]
Returns a tuple of EM current/resistance specs of the given via.
- Parameters:
layer_dir (int) – the direction value of the first specified layer. LOWER if the first layer is the bottom layer, UPPER if the first layer is the top layer.
layer (str) – the first layer name.
purpose (str) – the first layer purpose name.
adj_layer (str) – the second layer name.
adj_purpose (str) – the second layer purpose name.
cut_w (int) – the via cut width.
cut_h (int) – the via cut height.
m_w (int) – the first layer wire width, used for EM enhancement calculations. Negative numbers has no effect.
m_l (int) – the first layer wire length, used for EM enhancement calculations. Negative numbers has no effect.
adj_m_w (int) – the second layer wire width, used for EM enhancement calculations. Negative numbers has no effect.
adj_m_l (int) – the second layer wire length, used for EM enhancement calculations. Negative numbers has no effect.
array (bool) – True if this via is in a via array.
dc_temp (int) – the temperature (in Celsius) to calculate DC current EM spec with. If equal to -1000, use technology default.
rms_dt (int) – the temperature delta (in Celsius) to target for when computing AC RMS current EM spec. If equal to -1000, use technology default.
- Returns:
idc (float) – maximum DC current per via, in Amperes.
iac_rms (float) – maximum AC RMS current per via, in Amperes.
iac_peak (float) – maximum AC peak current per via, in Amperes.
- abstract get_res_em_specs(res_type: str, w: int, *, length: int = -1, dc_temp: int = -1000, rms_dt: int = -1000) Tuple[float, float, float] [source]
Returns a tuple of EM current/resistance specs of the given resistor.
- Parameters:
res_type (str) – the resistor type string.
w (int) – the width of the metal in resolution units (dimension perpendicular to current flow).
length (int) – the length of the metal in resolution units (dimension parallel to current flow). If negative, disable length enhancement.
dc_temp (int) – the temperature (in Celsius) to calculate DC current EM spec with. If equal to -1000, use technology default.
rms_dt (int) – the temperature delta (in Celsius) to target for when computing AC RMS current EM spec. If equal to -1000, use technology default.
- Returns:
idc (float) – maximum DC current, in Amperes.
iac_rms (float) – maximum AC RMS current, in Amperes.
iac_peak (float) – maximum AC peak current, in Amperes.
- register_device_tech(dev_name: str, obj: Any) None [source]
Register the A technology class for the given device.
- get_device_tech(dev_name: str, **kwargs: Any) Any [source]
Get an instance of the technology class for the given device.
- get_dc_temp(dc_temp: int = -1000) int [source]
Returns the temperature at which to evaluate DC electro-migration rules.
- get_rms_dt(rms_dt: int = -1000) int [source]
Returns the delta-temperature requirement for RMS electro-migration rules.
- get_well_layers(mos_type: str) Sequence[Tuple[str, str]] [source]
Returns a list of well layers associated with the given transistor type.
- get_implant_layers(mos_type: str, res_type: str = '') Sequence[Tuple[str, str]] [source]
Returns a list of implant layers associated with the given device type.
- get_threshold_layers(mos_type: str, threshold: str, res_type: str = '') Sequence[Tuple[str, str]] [source]
Returns a list of threshold layers.
- get_res_metal_layers(layer_id: int) List[Tuple[str, str]] [source]
Returns a list of layers associated with the given metal resistor.
- get_res_rsquare(res_type: str) float [source]
Returns R-square for the given resistor type.
This is used to do some approximate resistor dimension calculation.
- get_res_width_bounds(res_type: str) Tuple[int, int] [source]
Returns the maximum and minimum resistor width for the given resistor type.
- Parameters:
res_type (str) – the resistor type.
- Returns:
wmin (int) – minimum resistor width, in layout units.
wmax (int) – maximum resistor width, in layout units.
- get_res_length_bounds(res_type: str) Tuple[int, int] [source]
Returns the maximum and minimum resistor length for the given resistor type.
- Parameters:
res_type (str) – the resistor type.
- Returns:
lmin (int) – minimum resistor length, in layout units.
lmax (int) – maximum resistor length, in layout units.
- get_res_min_nsquare(res_type: str) float [source]
Returns the minimum allowable number of squares for the given resistor type.
- get_max_space_fill_info(layer_id: int) bag.layout.data.MaxSpaceFillInfo [source]
- get_idc_scale_factor(layer: str, purpose: str, temp: float, is_res: bool = False) float [source]
Return the Idc EM specs temperature scale factor.
- merge_well(template: bag.layout.template.TemplateBase, inst_list: List[bag.layout.core.PyLayInstance], sub_type: str, *, threshold: str = '', res_type: str = '', merge_imp: bool = False) None [source]
Merge the well of the given instances together.
- finalize_template(template: bag.layout.template.TemplateBase) None [source]
Perform any operations necessary on the given layout template before finalizing it.
By default we add the cell boundary.
- Parameters:
template (TemplateBase) – the template object.
- get_res_info(res_type: str, w: int, l: int, **kwargs: Any) Dict[str, Any] [source]
Returns a dictionary containing EM information of the given resistor.
- Parameters:
res_type (str) – the resistor type.
w (int) – the resistor width in resolution units (dimension perpendicular to current flow).
l (int) – the resistor length in resolution units (dimension parallel to current flow).
**kwargs (Any) – optional parameters for EM rule calculations, such as nominal temperature, AC rms delta-T, etc.
- Returns:
info – A dictionary of wire information. Should have the following:
- resistancefloat
The resistance, in Ohms.
- idcfloat
The maximum allowable DC current, in Amperes.
- iac_rmsfloat
The maximum allowable AC RMS current, in Amperes.
- iac_peakfloat
The maximum allowable AC peak current, in Amperes.
- Return type:
Dict[str, Any]
- get_via_info(bbox: pybag.core.BBox, layer_dir: pybag.enum.Direction, layer: str, adj_layer: str, ex_dir: pybag.enum.Orient2D, *, purpose: str = '', adj_purpose: str = '', wlen: int = -1, adj_wlen: int = -1, extend: bool = True, adj_ex_dir: Optional[pybag.enum.Orient2D] = None, **kwargs: Any) Optional[Dict[str, Any]] [source]
Create a via on the routing grid given the bounding box.
- Parameters:
bbox (BBox) – the bounding box of the via.
layer_dir (Direction) – the direction of the first specified layer. LOWER if the first layer is the bottom layer, UPPER if the first layer is the top layer.
layer (str) – the first layer name.
adj_layer (str) – the second layer name.
ex_dir (Orient2D) – the first layer extension direction.
purpose (str) – first layer purpose name.
adj_purpose (str) – second layer purpose name.
wlen (int) – length of first layer wire connected to this Via, in resolution units. Used for length enhancement EM calculation.
adj_wlen (int) – length of second layer wire connected to this Via, in resolution units. Used for length enhancement EM calculation.
extend (bool) – True if via extension can be drawn outside of bounding box.
adj_ex_dir (Optional[Orient2D]) – second layer extension direction. Can force to extend in same direction as bottom.
**kwargs (Any) – optional parameters for EM rule calculations, such as nominal temperature, AC rms delta-T, etc.
- Returns:
info – A dictionary of via information, or None if no solution. Should have the following:
- resistancefloat
The total via array resistance, in Ohms.
- idcfloat
The total via array maximum allowable DC current, in Amperes.
- iac_rmsfloat
The total via array maximum allowable AC RMS current, in Amperes.
- iac_peakfloat
The total via array maximum allowable AC peak current, in Amperes.
- paramsDict[str, Any]
A dictionary of via parameters.
- Return type:
Optional[Dict[str, Any]]
- design_resistor(res_type: str, res_targ: float, idc: float = 0.0, iac_rms: float = 0.0, iac_peak: float = 0.0, num_even: bool = True, **kwargs: Any) Tuple[int, int, int, int] [source]
Finds the optimal resistor dimension that meets the given specs.
Assumes resistor length does not effect EM specs.
- Parameters:
res_type (str) – the resistor type.
res_targ (float) – target resistor, in Ohms.
idc (float) – maximum DC current spec, in Amperes.
iac_rms (float) – maximum AC RMS current spec, in Amperes.
iac_peak (float) – maximum AC peak current spec, in Amperes.
num_even (int) – True to return even number of resistors.
**kwargs – optional EM spec calculation parameters.
- Returns:
num_par (int) – number of resistors needed in parallel.
num_ser (int) – number of resistors needed in series.
w (int) – width of a unit resistor, in resolution units.
l (int) – length of a unit resistor, in resolution units.