# Oroshi Documentation

# Oroshi - Analog Devices Layouts

Public Member Functions | List of all members
CapacitorStack Class Reference

Draws the layout of a compact capacitor or a matrix of adjacent identical capacitors. More...

Inheritance diagram for CapacitorStack:
[legend]

## Public Member Functions

def | __init__ (self, device, capacitance, capacitorType, abutmentBoxPosition, nets, unitCap=0, matrixDim=[1, matchingMode=False, matchingScheme=[], dummyRing=False, dummyElement=False)
| This is the class constructor. More...
def | __isUnitCap__ (self)
def | __isMatchingSchemeOK__ (self)
def | capacitorIdOccurence (self, capacitorIdentifier)
def | create (self, bbMode=False)
| Draw the compact or matrix of capacitors. More...
def | capacitorLine (self, dy, abutmentBox_spacing, matchingSchemeRowIndex=0)
| Iteratively draws a horizontal or vertical line of capacitors according to the `direction` parameter. More...
def | capacitorMatrix (self, abutmentBox_spacing=0)
| Draws a matrix of identical capacitors. More...
def | drawAbutmentBox (self, abutmentBox_spacing=0)
| Draws the abutment box of the matrix or campact capacitor. More...
def | drawBottomPlatesRLayers (self, bottomPlateRLayer, drawnCapacitor)
| Draws the routing layers connecting the bottom plate in the matrix of capacitors. More...
def | drawTopPlatesRLayers (self, topPlateRLayer, drawnCapacitor)
| Draws the routing layers connecting the top plates in the matrix of capacitors. More...
def | getVerticalRoutingTrack_width (self)
def | getMatrixDim (self)
def | getMatchingScheme (self)
Public Member Functions inherited from CapacitorUnit
def | __init__ (self, device, capacitorType, abutmentBoxPosition, capacitance=0, capDim={})
| This is the class constructor. More...
def | __setCapacitorPerUnit__ (self, capacitorType)
| Sets the area and perimeter capacitances as specified in 350 nm AMS technology and according to `capacitorType` (MIM or PIP). More...
def | __computeCapDim__ (self, capacitance, capacitorType)
| Computes width and length of the capacitor. More...
def | __isCapacitorUnitOK__ (self, capDim)
| Checks if the computed capacitor dimensions exceed or are less than maximum and minimum limits, respectively, as specified in technology rules. More...
def | setRules (self)
| Selects technological rules according to the capacitor type. More...
def | getCapacitorType (self)
def | getMaximumCapWidth (self)
| maximum size of capacitor's top plate. More...
def | getMinimumCapWidth (self)
def | getLayers (self)
| Loads the technology file then extracts the adequate layers according to the capacitor type (MIM or PIP). More...
def | create (self, t, b, bbMode=False, vEnclosure_botPlate_abtBox=None, hEnclosure_botPlate_abtBox=None)
| When bonding box mode is activated, the function draws all layout physical layers of the capacitor after checking its dimensions. More...
def | drawCapacitor (self, layerDict, t, b)
| Draws all layout physicial layers of the capacitor. More...
def | computeBottomPlateCuts (self)
| Computes needed parameters to draw bottom plate cuts in its exact position, including : More...
def | computeTopPlateCuts (self)
| Computes needed parameters to draw top plate cuts in its exact position, including : More...
def | drawAbutmentBox (self)
| Draws the abutment box of the capacitor in position `<`(abutmentBoxXMin, abutmentBoxYMin)>. More...
def | drawOnePlate (self, layer, net, boxDimensions)
| Draws the top or bottom plate through inflation of the Box under it. More...
def | drawBottomPlateCut (self, layer, b)
| Draws the required cuts to connect the bottom plate. More...
def | drawTopPlateCut (self, layer, t)
| Draws the top plate's cuts after computing the maximal number of cuts that can be placed and its exact enclosure in the top plate. More...
def | drawRoutingLayers (self, bottomPlateLayer, topPlateLayer, t, b)
| Draws the routing layers of both bottom and top plates after computing widths and the exact position of these layers. More...
def | cutMaxNumber (self, width_layer, width_cut, spacing_cut, enclosure_cut)
| Computes the maximal number of cuts to be placed on a layer of width `width_layer` considering specifications such as the spacing between the cuts, its width and its enclosure in the layer. More...
def | cutLine (self, net, layer, firstCutXCenter, firstCutYCenter, width_cut, height_cut, spacing_cut, cutNumber, direction)
| Creates a horizontal or vertical line of contacts according to the specified direction. More...
def | cutMatrix (self, net, layer, firstCutXCenter, firstCutYCenter, width_cut, height_cut, spacing_cut, cutColumnNumber, cutRowNumber)
| Creates a matrix of cuts by vertically stacking horizontal lines of identical cuts. More...
def | getBottomPlateYMax (self)
def | getBottomPlateLeftCutXMin (self)
def | getBottomPlateLeftCutYMin (self)
def | getBottomPlateLeftCutYMax (self)
def | getBottomPlateRightCutXMin (self)
def | getBottomPlateRightCutYMin (self)
def | getBottomPlateRightCutYMax (self)
def | getBotPlateLeftRLayerXMax (self)
def | getBottomPlateRightCutYCenter (self)
def | getBotPlateLeftRLayerXMin (self)
def | getBotPlateRLayerYMin (self)
def | getBotPlateRLayerYMax (self)
def | getBotPlateRLayerWidth (self)
def | getBotPlateRightRLayerXCenter (self)
def | getBotPlateLeftRLayerXCenter (self)
def | getTopPlateRLayerYMin (self)
def | getTopPlateRLayerYMax (self)
def | getTopPlateRLayerWidth (self)
def | getTopPlateRLayerXCenter (self)
def | getTopPlateRLayerXMin (self)
def | getTopPlateRLayerXMax (self)

## Detailed Description

Draws the layout of a compact capacitor or a matrix of adjacent identical capacitors.

The matrix can be composed of one type of capacitors, either Poly-Poly or Metal-Metal in 350 nm AMS CMOS technology. When matching mode is off, every adjacent plates of any consecutive elementary capacitors are connected to each other using vertical routing layers. Otherwise, when matching mode is on, any of elementary capacitors can belong to, or according to the entered matching scheme. Thus, routing is not done in this class. In both modes, the complete routing process is done using the `RoutCapacitor` class.

## Constructor & Destructor Documentation

## ◆ __init__()

def __init__ | ( |  | self,
|  |  | device,
|  |  | capacitance,
|  |  | capacitorType,
|  |  | abutmentBoxPosition,
|  |  | nets,
|  |  | unitCap = `0`,
|  |  | matrixDim = `[1`,
|  |  | matchingMode = `False`,
|  |  | matchingScheme = `[]`,
|  |  | dummyRing = `False`,
|  |  | dummyElement = `False`
| ) |  |

This is the class constructor.

Basically, the class there are three categories of attributes. There are the ones related to the capacitor caracteristics, its type, dimensions. Also, there are attributes to parametrize the class into matching mode or not and there are other attributes realted to the layout varibales. The class has defaut input values, thus, in this constructor, there are two "sub-constructors" according to the entered input parameters. The class attributes are :

Parameters

  device | The Hurricane AMS device into which the layout is drawn.
  capacitance | The value of the capacitor, expressed in femto Farad (fF).
  capacitorType | Can be MIM or PIP type capacitor.
  abutmentPosition | Refers to the abscissa (XMin) of the bottom left corner of the abutment Box.
  abutmentBoxYMin | Refers to the ordinate (YMin) of the bottom left corner of the abutment Box.

Except the two last arguments, all the parameters are common with the CapacitorUnit class because the `CapacitorStack` constructor calls the mother class constructor to create either a compact capacitor of `capacitance` value or `rowNumber*` `columnNumber` unity capacitors.

Parameters

  rowNumber | Number of rows in the matrix of capacitors.
  columnNumber | Number of columns in the matrix of capacitors.

References CapacitorStack.__areInputDataOK__(), CapacitorUnit.__computeCapDim__(), CapacitorStack.__initGivenNonZeroUnitCap__(), CapacitorStack.__initGivenNonZeroUnitCapInMatchingMode__(), CapacitorStack.__initGivenZeroUnitCap__(), CapacitorStack.__initGivenZeroUnitCapInMatchingMode__(), CapacitorStack.__initMatrixMode__(), CapacitorUnit.__isCapacitorUnitOK__(), CapacitorUnit.abutmentBox, CapacitorStack.abutmentBox_spacing, CapacitorStack.abutmentBoxPosition, CapacitorStack.capacitance, CapacitorStack.capacitorIdOccurence(), CapacitorStack.capacitorsNumber, CapacitorUnit.capacitorType, CapacitorStack.compactCapDim, CapacitorStack.computeUnitCap(), CapacitorUnit.device, Stack.device, CapacitorStack.doMatrix, CapacitorStack.dummyElement, CapacitorStack.dummyRing, CapacitorStack.dummyRingPosition, CapacitorStack.evaluateUnitCap(), CapacitorStack.matchingMode, CapacitorStack.matchingScheme, CapacitorStack.matrixDim, CapacitorStack.minEnclosure_hRoutingLayer_topPlate_cut, CapacitorStack.minEnclosure_vRoutingTrackCut, CapacitorStack.minSpacing_vRoutingTrack, CapacitorStack.minSpacing_vRoutingTrackCut, CapacitorStack.minWidth_hRoutingLayer_topPlate_cut, CapacitorStack.minWidth_vRoutingTrack, CapacitorStack.minWidth_vRoutingTrackCut, CapacitorStack.nets, CapacitorStack.unitCapacitance, CapacitorStack.unitCapDim, and CapacitorStack.vRoutingTrack_width.

## Member Function Documentation

## ◆ __isUnitCap__()

def __isUnitCap__ | ( |  | self | ) |

Returns
  True if the drawn capacitor is a compact one. This function is useful when an instance is called in another class. Example : when the matrix or the compact capacitors are to be fully routed.

Referenced by RoutMatchedCapacitor.route().

## ◆ __isMatchingSchemeOK__()

def __isMatchingSchemeOK__ | ( |  | self | ) |

Returns
  `True` if the matching scheme specifications are correct. Specifications are :
  - Similar number of elements as total number of elementary capacitor in the matrix.
  - Equal number of affected capacitors to C1 as to C2.
  - Capacitor identifiers equal to '1' or '2' only.
  - Otherwise, the function returns `False`.

References CapacitorStack.matchingScheme, and CapacitorStack.matrixDim.

Referenced by CapacitorStack.capacitorIdOccurence().

## ◆ capacitorIdOccurence()

def capacitorIdOccurence | ( |  | self,
|  |  | capacitorIdentifier
| ) |  |

Returns
  occurence of capacitor identifier in the entered matching scheme. This is useful to verify that `self.matchingScheme` is correct.

References CapacitorStack.__areMatrixDimOK__(), CapacitorStack.__isMatchingSchemeOK__(), CapacitorStack.capacitorsNumber, CapacitorStack.dummyElement, CapacitorStack.dummyRing, CapacitorStack.matchingMode, CapacitorStack.matchingScheme, CapacitorStack.matrixDim, and CapacitorStack.nets.

Referenced by CapacitorStack.__init__().

## ◆ create()

def create | ( |  | self,
|  |  | bbMode = `False`
| ) |  |

Draw the compact or matrix of capacitors.

First, . Second, . Finally, .

References CapacitorStack.__initMatchingMode__(), CapacitorStack.abutmentBox_spacing, CapacitorStack.abutmentBoxPosition, CapacitorStack.capacitance, CapacitorStack.capacitorMatrix(), CapacitorUnit.capacitorType, CapacitorStack.computeBondingBoxDimensions(), CapacitorUnit.device, Stack.device, CapacitorStack.doMatrix, CapacitorUnit.drawAbutmentBox(), CapacitorStack.drawBottomPlatesRLayers(), CapacitorStack.drawCapacitorStack(), CapacitorStack.drawTopPlatesRLayers(), CapacitorStack.dummyRing, CapacitorStack.matchingMode, CapacitorStack.matrixDim, CapacitorStack.nets, and CapacitorUnit.setRules().

Referenced by CapacitorStack.capacitorLine(), and CapacitorStack.capacitorMatrix().

## ◆ capacitorLine()

def capacitorLine | ( |  | self,
|  |  | dy,
|  |  | abutmentBox_spacing,
|  |  | matchingSchemeRowIndex = `0`
| ) |  |

Iteratively draws a horizontal or vertical line of capacitors according to the `direction` parameter.

An exception is raised if the specified direction is different from `{'horizontal'`,'vertical'}. At every iteration, an instance of the CapacitorUnit class is created and its layout is drawn.

Returns
  a list containing the drawn capacitors.

Parameters

  dy | the vertical position of the first cut in cut line.

Remarks
  An exception is raised if the specified direction is different from `{'horizontal'`,'vertical'}

References CapacitorStack.abutmentBoxPosition, CapacitorUnit.capacitorType, CapacitorStack.create(), CapacitorStack.createElementInCapacitorLine(), CapacitorUnit.device, Stack.device, CapacitorStack.dummyRing, CapacitorStack.matchingMode, CapacitorStack.matchingScheme, CapacitorStack.matrixDim, CapacitorStack.nets, and CapacitorStack.unitCapacitance.

Referenced by CapacitorStack.capacitorMatrix().

## ◆ capacitorMatrix()

def capacitorMatrix | ( |  | self,
|  |  | abutmentBox_spacing = `0`
| ) |  |

Draws a matrix of identical capacitors.

The matrix is iterativelly constructed. At every iteration, a new horizontal line of capacitors is drawn.

Returns
  a nested list of elementary capacitors.

References CapacitorStack.abutmentBox_spacing, CapacitorStack.abutmentBoxPosition, CapacitorStack.capacitorLine(), CapacitorUnit.capacitorType, CapacitorStack.create(), CapacitorUnit.device, Stack.device, CapacitorStack.dummyRing, CapacitorStack.getCapDim(), CapacitorStack.matrixDim, CapacitorStack.nets, and CapacitorStack.unitCapacitance.

Referenced by CapacitorStack.create().

## ◆ drawAbutmentBox()

def drawAbutmentBox | ( |  | self,
|  |  | abutmentBox_spacing = `0`
| ) |  |

Draws the abutment box of the matrix or campact capacitor.

References CapacitorUnit.abutmentBox, CapacitorStack.abutmentBox_spacing, CapacitorStack.abutmentBoxPosition, CapacitorUnit.computeAbutmentBoxDimensions(), CapacitorUnit.device, and Stack.device.

## ◆ drawBottomPlatesRLayers()

def drawBottomPlatesRLayers | ( |  | self,
|  |  | bottomPlateRLayer,
|  |  | drawnCapacitor
| ) |  |

Draws the routing layers connecting the bottom plate in the matrix of capacitors.

First, the relative positions of the routing layer is of the is extracted from the elementary capacitor instance. Then, its width is computed in a way to connect adjacent plates. Then, the routing layers are iterativelly drawn. The two borders are .

References CapacitorUnit.getBotPlateLeftRLayerXMax(), CapacitorUnit.getBotPlateRLayerWidth(), CapacitorUnit.getBotPlateRLayerYMax(), CapacitorUnit.getBottomPlateLeftCutXMin(), CapacitorUnit.getBottomPlateRightCutXMin(), CapacitorStack.matrixDim, and CapacitorStack.nets.

Referenced by CapacitorStack.create().

## ◆ drawTopPlatesRLayers()

def drawTopPlatesRLayers | ( |  | self,
|  |  | topPlateRLayer,
|  |  | drawnCapacitor
| ) |  |

Draws the routing layers connecting the top plates in the matrix of capacitors.

First, the relative positions of the routing layers is of the is extracted from the elementary capacitor instance. Then, its width is computed in a way to connect adjacent plates. Then, the routing layers are iterativelly drawn. The two borders are .

Remarks
  An exception is raised if the number of rows in the matrix is lower than 2.

References CapacitorUnit.getTopPlateRLayerWidth(), CapacitorUnit.getTopPlateRLayerXCenter(), CapacitorUnit.getTopPlateRLayerYMax(), CapacitorUnit.getTopPlateRLayerYMin(), CapacitorStack.matrixDim, and CapacitorStack.nets.

Referenced by CapacitorStack.create().

## ◆ getVerticalRoutingTrack_width()

def getVerticalRoutingTrack_width | ( |  | self | ) |

Returns
  The width of the vertical routing tracks in matching mode.

Remark: This function is useful in matching mode, ie., in RoutCapacitor class, when routing the two capacitors.

## ◆ getMatrixDim()

def getMatrixDim | ( |  | self | ) |

Returns
  A dictionary contaning capacitor matrix's dimensions

References CapacitorStack.compactCapDim, and CapacitorStack.doMatrix.

## ◆ getMatchingScheme()

def getMatchingScheme | ( |  | self | ) |

Returns
  the matching scheme. The function is useful in `RoutMatchedCapacitor` class to load `self.matchingScheme` attribute.

The documentation for this class was generated from the following file:

- capacitormatrix.py