bag3_analog.layout.res_diff

This module defines differential resistors.

Module Contents

Classes

ResDiff

An abstract template that draws analog resistors array and connections.

class bag3_analog.layout.res_diff.ResDiff(temp_db: bag.layout.template.TemplateDB, params: bag.util.immutable.Param, **kwargs: Any)[source]

Bases: xbase.layout.res.base.ResArrayBase

An abstract template that draws analog resistors array and connections.

This template assumes that the resistor array uses 4 routing layers, with directions x/y/x/y. The lower 2 routing layers is used to connect between adjacent resistors, and pin will be drawn on the upper 2 routing layers.

Like for MOSBase, conn_layer should return the top-most layer of the primitive, i.e. the pin layer. We can then connect BBoxs or WireArrays to the pins using the next layer. Unlike BAG2, we assume the conn_layer is BELOW the bottom-most routing layer described above (i.e. below the first horizontal resistor routing layer). This is to allow for more control of the low level wire placement. One effect of this is that resistor primitives can be either WireArrays or BBoxs, so classes using ResArrayBase need to be coded for both. Primitives must be design with connecting to the above horizontal metal in mind.

classmethod get_schematic_class() Optional[Type[bag.design.module.Module]][source]
classmethod get_params_info() Mapping[str, str][source]

Returns a dictionary from parameter names to descriptions.

Returns:

param_info – dictionary from parameter names to descriptions.

Return type:

Mapping[str, str]

classmethod get_default_param_values() Mapping[str, Any][source]

Returns a dictionary containing default parameter values.

Override this method to define default parameter values. As good practice, you should avoid defining default values for technology-dependent parameters (such as channel length, transistor width, etc.), but only define default values for technology-independent parameters (such as number of tracks).

Returns:

default_params – dictionary of default parameter values.

Return type:

Mapping[str, Any]

draw_layout() None[source]

Draw the layout of this template.

Override this method to create the layout.

WARNING: you should never call this method yourself.

connect_stack(tr_manager: bag.layout.routing.base.TrackManager, warr: bag.layout.routing.base.WireArray, top_layer: int, w_type: str = 'sig', mid_layer: int = -1)[source]