bag.data.dc

This module defines classes for computing DC operating point.

Module Contents

Classes

DCCircuit

A class that solves DC operating point of a circuit.

class bag.data.dc.DCCircuit(ndb: bag.tech.mos.MosCharDB, pdb: bag.tech.mos.MosCharDB)[source]

Bases: object

A class that solves DC operating point of a circuit.

Parameters:
  • ndb (MosCharDB) – nmos characterization database.

  • pdb (MosCharDB) – pmos characterization database.

_get_node_id(name: str) int[source]
set_voltage_source(node_name: str, voltage: float) None[source]

Specify voltage the a node.

Parameters:
  • node_name (str) – the net name.

  • voltage (float) – voltage of the given net.

add_transistor(d_name: str, g_name: str, s_name: str, b_name: str, mos_type: str, intent: str, w: Union[float, int], lch: float, fg: int = 1) None[source]

Adds a small signal transistor model to the circuit.

Parameters:
  • d_name (str) – drain net name.

  • g_name (str) – gate net name.

  • s_name (str) – source net name.

  • b_name (str) – body net name. Defaults to ‘gnd’.

  • mos_type (str) – transistor type. Either ‘nch’ or ‘pch’.

  • intent (str) – transistor threshold flavor.

  • w (Union[float, int]) – transistor width.

  • lch (float) – transistor channel length.

  • fg (int) – transistor number of fingers.

solve(env: str, guess_dict: Dict[str, float], itol: float = 1e-10, inorm: float = 1e-06) Dict[str, float][source]

Solve DC operating point.

Parameters:
  • env (str) – the simulation environment.

  • guess_dict (Dict[str, float]) – initial guess dictionary.

  • itol (float) – current error tolerance.

  • inorm (float) – current normalization factor.

Returns:

op_dict – DC operating point dictionary.

Return type:

Dict[str, float]