gm/Id — Blocks

Functional-block view of a recognised op-amp, for the gm/Id sizer.

Groups the FBR slot devices into typed blocks (input pair, first-stage load, gain stages, tail, bias, compensation) and classifies the kind of each load / tail (current-mirror, cascode, resistor, plain current-source). This is the structural layer beneath the Analyze phase (analyze): the load kind drives the first-stage gain factor, the cascode detection feeds the DC headroom budget (bias), and node_rout() gives the evaluation phase its cascode-aware output resistance.

class circuitgenome.sizer.gmid.blocks.LoadKind(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

How a stage load converts/combines current (sets gain & headroom).

MIRROR = 'mirror'
CASCODE = 'cascode'
RESISTOR = 'resistor'
CURRENT_SOURCE = 'current_source'
NONE = 'none'
circuitgenome.sizer.gmid.blocks.cascode_device_refs(slot_transistors)[source]

Refs of cascode devices: a non-signal device whose source sits on another same-slot device’s drain (i.e. it is stacked on a device below).

Parameters:

slot_transistors (dict[str, list[Device]])

Return type:

set[str]

circuitgenome.sizer.gmid.blocks.node_rout(out_net, mosfets, model, sizing, stop=frozenset({}))[source]

Cascode-aware output resistance (Ω) at out_net = parallel of every device whose drain is out_net (each looking-in, cascode-boosted).

stop lists nets to treat as AC ground (typically the input-pair tail node) so the input pair contributes ro, not a tail-degenerated cascode.

Parameters:
Return type:

float

circuitgenome.sizer.gmid.blocks.classify_load(mosfets, resistors)[source]

Classify a load slot by its devices.

Parameters:
Return type:

LoadKind

class circuitgenome.sizer.gmid.blocks.Block(name, mosfets=<factory>, resistors=<factory>, load_kind=LoadKind.NONE)[source]

Bases: object

A functional group of devices from one or more FBR slots.

Parameters:
name: str
mosfets: list[Device]
resistors: list[Device]
load_kind: LoadKind = 'none'
property signal_device: Device | None

The gm-contributing device (gate on a signal net), if any.

property is_cascode: bool
class circuitgenome.sizer.gmid.blocks.OpAmpBlocks(blocks, is_fully_differential, n_stages)[source]

Bases: object

The block decomposition of a recognised op-amp.

Parameters:
blocks: dict[str, Block]
is_fully_differential: bool
n_stages: int
property input_pair: Block | None
property load: Block | None
property tail: Block | None
first_stage_gain_factor()[source]

k_fs: 0.5 for a single-ended non-mirror first-stage load, else 1.0.

Return type:

float

has_cascode_load()[source]
Return type:

bool

has_cascode_tail()[source]

True if the tail current source is a cascode (series-stacked) stack.

The tail slot is never run through classify_load() (only the load slot is), so this relies on Block.is_cascode’s structural _has_cascode fallback rather than load_kind.

Return type:

bool

first_stage_out_net()[source]

First-stage output node = the next stage’s signal-device gate.

None for a one-stage opamp (no downstream stage to read it from).

Return type:

str | None

tail_net()[source]

The input-pair source (tail) node.

Return type:

str | None

circuitgenome.sizer.gmid.blocks.build_blocks(slot_transistors, slot_resistors)[source]

Build the OpAmpBlocks view from the FBR slot device lists.

Parameters:
Return type:

OpAmpBlocks