ordec.core.schema — Common schema for IC design data

This common schema ensures that different modules of ORDeC speak the same language and can interact seamlessly.

General stuff

class ordec.core.schema.PolyVec2R(**kwargs)

One vertex of a Vec2R polygonal chain or polygon.

in_subgraphs = [<class 'ordec.core.schema.Symbol'>, <class 'ordec.core.schema.Schematic'>]
ref: int = <ordec.core.ordb.LocalRef object>
order: int = <ordec.core.ordb.Attr object>

Order of the point in the polygonal chain

pos: Vec2R = <ordec.core.ordb.Attr object>
ref_idx = <ordec.core.ordb.Index object>

Symbols

class ordec.core.schema.Symbol(**kwargs)

A symbol of an individual cell.

outline: Rect4R = <ordec.core.ordb.Attr object>
caption: str = <ordec.core.ordb.Attr object>
cell: Cell = <ordec.core.ordb.Attr object>
portmap(**kwargs)
webdata()
Frozen

alias of Frozen

Mutable

alias of Mutable

Tuple

alias of Tuple

class ordec.core.schema.Pin(**kwargs)

Pins are single wire connections exposed through a symbol.

in_subgraphs = [<class 'ordec.core.schema.Symbol'>]
pintype: PinType = <ordec.core.ordb.Attr object>
pos: Vec2R = <ordec.core.ordb.Attr object>
align: D4 = <ordec.core.ordb.Attr object>
class ordec.core.schema.PinType(value)
In = 'in'
Out = 'out'
Inout = 'inout'
class ordec.core.schema.SymbolArc(**kwargs)

A drawn circle or circular segment in Symbol. For visual purposes only.

in_subgraphs = [<class 'ordec.core.schema.Symbol'>]
pos: Vec2R = <ordec.core.ordb.Attr object>

Center point

radius: Rational = <ordec.core.ordb.Attr object>

Radius of the arc.

angle_start: Rational = <ordec.core.ordb.Attr object>

Must be less than angle_end and between -1 and 1, with -1 representing -360° and 1 representing 360°.

angle_end: Rational = <ordec.core.ordb.Attr object>

Must be greater than angle_start and between -1 and 1, with -1 representing -360° and 1 representing 360°.

svg_path() str

Returns string representation of arc suitable for “d” attribute of SVG <path>.

Schematics

class ordec.core.schema.Schematic(**kwargs)

A schematic of an individual cell.

symbol: Symbol = <ordec.core.ordb.SubgraphRef object>
outline: Rect4R = <ordec.core.ordb.Attr object>
cell: Cell = <ordec.core.ordb.Attr object>
default_supply: int = <ordec.core.ordb.LocalRef object>
default_ground: int = <ordec.core.ordb.LocalRef object>
webdata()
class ordec.core.schema.Net(**kwargs)
in_subgraphs = [<class 'ordec.core.schema.Schematic'>]
pin: int = <ordec.core.ordb.ExternalRef object>
route: bool = <ordec.core.ordb.Attr object>

Controls whether the Net is routed by schematic_routing

pin_idx = <ordec.core.ordb.Index object>
class ordec.core.schema.SchemPort(**kwargs)

Port of a Schematic, corresponding to a Pin of the schematic’s Symbol.

in_subgraphs = [<class 'ordec.core.schema.Schematic'>]
ref: int = <ordec.core.ordb.LocalRef object>
ref_idx = <ordec.core.ordb.Index object>
pos: Vec2R = <ordec.core.constraints.ConstrainableAttr object>
align: D4 = <ordec.core.ordb.Attr object>
class ordec.core.schema.SchemWire(vertices: list[Vec2R | Vec2I] | int = None, **kwargs)

A drawn schematic wire representing an electrical connection.

in_subgraphs = [<class 'ordec.core.schema.Schematic'>]
ref: int = <ordec.core.ordb.LocalRef object>
ref_idx = <ordec.core.ordb.Index object>
class ordec.core.schema.SchemInstance(connect=None, **kwargs)

An instance of a Symbol in a Schematic (foundation for schematic hierarchy).

in_subgraphs = [<class 'ordec.core.schema.Schematic'>]
pos: Vec2R = <ordec.core.constraints.ConstrainableAttr object>
orientation: D4 = <ordec.core.ordb.Attr object>
symbol: Symbol = <ordec.core.ordb.SubgraphRef object>
loc_transform()
subcursor()
conns()
class ordec.core.schema.SchemInstanceConn(**kwargs)

Maps one Pin of a SchemInstance to a Net of its Schematic.

in_subgraphs = [<class 'ordec.core.schema.Schematic'>]
ref: int = <ordec.core.ordb.LocalRef object>
ref_idx = <ordec.core.ordb.Index object>
here: int = <ordec.core.ordb.LocalRef object>
there: int = <ordec.core.ordb.ExternalRef object>
ref_pin_idx = <ordec.core.ordb.CombinedIndex object>
class ordec.core.schema.SchemTapPoint(**kwargs)

A schematic tap point for connecting points by label, typically visualized using the net’s name.

in_subgraphs = [<class 'ordec.core.schema.Schematic'>]
ref: int = <ordec.core.ordb.LocalRef object>
ref_idx = <ordec.core.ordb.Index object>
pos: Vec2R = <ordec.core.ordb.Attr object>
align: D4 = <ordec.core.ordb.Attr object>
loc_transform()
class ordec.core.schema.SchemConnPoint(**kwargs)

A schematic point to indicate a connection at a 3- or 4-way junction of wires.

in_subgraphs = [<class 'ordec.core.schema.Schematic'>]
ref: int = <ordec.core.ordb.LocalRef object>
ref_idx = <ordec.core.ordb.Index object>
pos: Vec2R = <ordec.core.ordb.Attr object>

Simulation hierarchy

class ordec.core.schema.SimHierarchy(**kwargs)
schematic: Schematic = <ordec.core.ordb.SubgraphRef object>
cell: Cell = <ordec.core.ordb.Attr object>
sim_type: SimType = <ordec.core.ordb.Attr object>
sim_data: SimArray = <ordec.core.ordb.Attr object>

Packed simulation result data shared by all SimNet/SimInstance nodes.

time_field: str = <ordec.core.ordb.Attr object>

Column name in sim_data for the time axis (transient), or None.

freq_field: str = <ordec.core.ordb.Attr object>

Column name in sim_data for the frequency axis (AC), or None.

sweep_field: str = <ordec.core.ordb.Attr object>

Column name in sim_data for the DC sweep axis, or None.

property time
property freq
subcursor()
schematic_or_symbol_at(inst: SimInstance | None)

Helper function for of_subgraph of SimNet.eref and SimInstance.eref.

classmethod from_schematic(schematic: Schematic)

Create a simulation hierarchy from a schematic. The returned SimHierarchy can be used to run simulations with HighlevelSim.

webdata()
class ordec.core.schema.SimNet(**kwargs)
in_subgraphs = [<class 'ordec.core.schema.SimHierarchy'>]
parent_inst: int = <ordec.core.ordb.LocalRef object>
trans_field: str = <ordec.core.ordb.Attr object>

Column name in root sim_data for transient voltage.

ac_field: str = <ordec.core.ordb.Attr object>

Column name in root sim_data for AC voltage.

dc_sweep_field: str = <ordec.core.ordb.Attr object>

Column name in root sim_data for DC sweep voltage.

dc_voltage: float = <ordec.core.ordb.Attr object>
property trans_voltage
property ac_voltage
property dc_sweep_voltage
eref: int = <ordec.core.ordb.ExternalRef object>
full_path_list() list[str | int]
parent_eref_idx = <ordec.core.ordb.CombinedIndex object>
class ordec.core.schema.SimInstance(**kwargs)
in_subgraphs = [<class 'ordec.core.schema.SimHierarchy'>]
parent_inst: int = <ordec.core.ordb.LocalRef object>
trans_field: str = <ordec.core.ordb.Attr object>

Column name in root sim_data for transient current.

ac_field: str = <ordec.core.ordb.Attr object>

Column name in root sim_data for AC current.

dc_sweep_field: str = <ordec.core.ordb.Attr object>

Column name in root sim_data for DC sweep current.

dc_current: float = <ordec.core.ordb.Attr object>
property trans_current
property ac_current
property dc_sweep_current
schematic: Schematic = <ordec.core.ordb.SubgraphRef object>
eref: int = <ordec.core.ordb.ExternalRef object>
parent_eref_idx = <ordec.core.ordb.CombinedIndex object>
subcursor()
subcursor_schematic()
subcursor_symbol()
full_path_list() list[str | int]

Technology definitions

class ordec.core.schema.GdsLayer(layer, data_type)
layer: int

GDS layer number (0…65535)

data_type: int

GDS data type number (0…65535)

class ordec.core.schema.RGBColor(r, g, b)
r: int

red component (0…255)

g: int

red green (0…255)

b: int

red blue (0…255)

class ordec.core.schema.LayerStack(**kwargs)
cell: Cell = <ordec.core.ordb.Attr object>
unit: Rational = <ordec.core.ordb.Attr object>
class ordec.core.schema.Layer(**kwargs)
in_subgraphs = [<class 'ordec.core.schema.LayerStack'>]
gdslayer_text: GdsLayer = <ordec.core.ordb.Attr object>
gdslayer_shapes: GdsLayer = <ordec.core.ordb.Attr object>
style_fill: RGBColor = <ordec.core.ordb.Attr object>
style_stroke: RGBColor = <ordec.core.ordb.Attr object>
style_crossrect: bool = <ordec.core.ordb.Attr object>
is_pinlayer: bool = <ordec.core.ordb.Attr object>

Indicates whether the present layer is suitable for pin shapes / text. This flag affects the behavior of the pinlayer() method.

pinlayer() Layer

Returns the layer on which pin shapes corresponding to the current layer should be placed. This could be the layer itself, or its .pin child (e.g. Metal1.pin).

gdslayer_text_index = <ordec.core.ordb.Index object>
gdslayer_shapes_index = <ordec.core.ordb.Index object>
inline_css() str

Layout

class ordec.core.schema.Layout(**kwargs)

Subgraph containing integrated circuit layout elements, possibly including hierarchical instances of other Layout subgraphs.

cell: Cell = <ordec.core.ordb.Attr object>
symbol: Symbol = <ordec.core.ordb.SubgraphRef object>

All LayoutPins in this subgraph reference this symbol.

ref_layers: LayerStack = <ordec.core.ordb.SubgraphRef object>

All .layer attributes of nodes in this subgraph reference this LayerStack.

webdata()
class ordec.core.schema.LayoutLabel(**kwargs)

Arbitrary text label, equivalent to GDS TEXT element. When entering layouts, prefer LayoutPin to raw LayoutLabels.

in_subgraphs = [<class 'ordec.core.schema.Layout'>]
layer: int = <ordec.core.ordb.ExternalRef object>
pos: Vec2I = <ordec.core.constraints.ConstrainableAttr object>
text: str = <ordec.core.ordb.Attr object>
class ordec.core.schema.LayoutPoly(vertices: list[Vec2R | Vec2I] | int = None, **kwargs)

Simple (no self intersection, no holes) polygon with CCW orientation. (LayoutPoly cannot represent an open polygonal chain. Thus, the first and last vertex should not be identical.)

At GDS import, the “simple” property is currently assumed, and CW polygons are flipped automatically to CCW orientation.

in_subgraphs = [<class 'ordec.core.schema.Layout'>]
layer: int = <ordec.core.ordb.ExternalRef object>
class ordec.core.schema.LayoutPath(*args, **kwargs)

Layout path (polygonal chain with width).

in_subgraphs = [<class 'ordec.core.schema.Layout'>]
endtype: PathEndType = <ordec.core.ordb.Attr object>
ext_bgn: int = <ordec.core.ordb.Attr object>

Mandatory if endtype is PathEndType.Custom, else ignored.

ext_end: int = <ordec.core.ordb.Attr object>

Mandatory if endtype is PathEndType.Custom, else ignored.

layer: int = <ordec.core.ordb.ExternalRef object>
width: int = <ordec.core.ordb.Attr object>
class ordec.core.schema.LayoutRectPoly(vertices: list[Vec2R | Vec2I] | int = None, **kwargs)

Compact rectilinear polygon. Each vertex is connected to its successor through two segments. The first segment in start_direction, the second segment perpendicular to the first. Each vertex has to differ in both x and y coordiante from its successor. The successor of the last vertex is the first vertex.

This representation of a rectilinear polygon requires half the vertices as an equivalent LayoutPoly.

One use case is for rectangles, which this class can represent using just two corner vertices.

in_subgraphs = [<class 'ordec.core.schema.Layout'>]
start_direction: RectDirection = <ordec.core.ordb.Attr object>
layer: int = <ordec.core.ordb.ExternalRef object>
class ordec.core.schema.LayoutRectPath(*args, **kwargs)

Compact rectilinear path. Each vertex is connected to its successor through two segments. The first segment in start_direction, the second segment perpendicular to the first. Each vertex has to differ in both x and y coordiante from its successor. The last vertex has no successor (i.e. open path).

This representation of a rectilinear path requires half the vertices as an equivalent LayoutPath.

in_subgraphs = [<class 'ordec.core.schema.Layout'>]
start_direction: RectDirection = <ordec.core.ordb.Attr object>
endtype: PathEndType = <ordec.core.ordb.Attr object>
ext_bgn: int = <ordec.core.ordb.Attr object>

Mandatory if endtype is PathEndType.Custom, else ignored.

ext_end: int = <ordec.core.ordb.Attr object>

Mandatory if endtype is PathEndType.Custom, else ignored.

layer: int = <ordec.core.ordb.ExternalRef object>
width: int = <ordec.core.ordb.Attr object>
class ordec.core.schema.LayoutRect(**kwargs)

Layout rectangle.

in_subgraphs = [<class 'ordec.core.schema.Layout'>]
layer: int = <ordec.core.ordb.ExternalRef object>
rect: Rect4I = <ordec.core.constraints.ConstrainableAttr object>
class ordec.core.schema.LayoutInstance(**kwargs)

Hierarchical layout instance, equivalent to GDS SRef.

in_subgraphs = [<class 'ordec.core.schema.Layout'>]
pos: Vec2I = <ordec.core.constraints.ConstrainableAttr object>
orientation: D4 = <ordec.core.ordb.Attr object>
ref: Layout = <ordec.core.ordb.SubgraphRef object>

Can be a Layout or a frame (which is also a Layout)…

subcursor()
loc_transform()
class ordec.core.schema.LayoutInstanceArray(**kwargs)

Hierarchical layout instance array, equivalent to GDS ARef.

in_subgraphs = [<class 'ordec.core.schema.Layout'>]
cols: int = <ordec.core.ordb.Attr object>

Number of columns or None (=1 column). If None, LayoutInstanceSubcursor indices are collaposed to row-only.

rows: int = <ordec.core.ordb.Attr object>

Number of rows or None (=1 row). If None, LayoutInstanceSubcursor indices are collaposed to column-only.

vec_col: Vec2I = <ordec.core.ordb.Attr object>

Vector separating instances in adjacent columns. None value is permitted only if cols is None, too.

vec_row: Vec2I = <ordec.core.ordb.Attr object>

Vector separating instances in adjacent rows. None value is permitted only if cols is None, too.

orientation: D4 = <ordec.core.ordb.Attr object>
pos: Vec2I = <ordec.core.constraints.ConstrainableAttr object>
ref: Layout = <ordec.core.ordb.SubgraphRef object>

Can be a Layout or a frame (which is also a Layout)…

class ordec.core.schema.LayoutPin(**kwargs)

A LayoutPin associates a particular shape with a Pin of the layout’s symbol. The advantages to a plain LayoutLabel are: (a) the LayoutPin maintains a semantic connection to the symbol, and (b) the LayoutPin can be added to a non-pin layer, and a corresponding pin layer shape is created automatically by expand_pins (in write_gds or the web viewer).

The associated shape can be a LayoutPoly, LayoutRectPoly, LayoutRect, LayoutPath or LayoutRectPath.

in_subgraphs = [<class 'ordec.core.schema.Layout'>]
ref: int = <ordec.core.ordb.LocalRef object>
pin: int = <ordec.core.ordb.ExternalRef object>
class ordec.core.schema.PathEndType(value)

Could also be named ‘linecap’.

Flush = 0

Path begins/ends right at the vertex

Square = 2

Path extended by half width beyond start/end vertex

Custom = 4

Path extended by custom lengths beyond start/end vertex

class ordec.core.schema.RectDirection(value)

Used by LayoutRectPoly and LayoutRectPath.

Vertical = 0

Indicates that shape is encoded with vertical edge first, horizontal edge second.

Horizontal = 1

Indicates that shape is encoded with horizontal edge first, vertical edge second.