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>
pos_idx = <ordec.core.ordb.Index object>

Symbols

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

A symbol of an individual cell.

view_context

alias of SymbolViewContext

outline: Rect4R = <ordec.core.ordb.Attr object>
caption: str = <ordec.core.ordb.Attr object>
cell: Cell = <ordec.core.ordb.Attr object>
portmap(**kwargs)
place_pins(hpadding=3, vpadding=3)
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.

view_context

alias of SchematicViewContext

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>
resolve_instances()
auto_wire()
check(add_conn_points=False, add_terminal_taps=False)
has_errors() bool
class ordec.core.schema.Net(**kwargs)
in_subgraphs = [<class 'ordec.core.schema.Schematic'>]
pin: int = <ordec.core.ordb.ExternalRef object>
auto_wire: bool = <ordec.core.ordb.Attr object>

Controls whether the Net is auto-wired

pin_idx = <ordec.core.ordb.Index object>
property port
property pos
property align
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>
pos_idx = <ordec.core.ordb.Index 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>
pos_idx = <ordec.core.ordb.Index 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>
pos_idx = <ordec.core.ordb.Index 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 Simulator.

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

Column name in root sim_data for voltage.

property 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>
schematic: Schematic = <ordec.core.ordb.SubgraphRef object>
eref: int = <ordec.core.ordb.ExternalRef object>
parent_eref_idx = <ordec.core.ordb.CombinedIndex object>
property params: SimInstanceParamCursor
subcursor()
subcursor_schematic()
subcursor_symbol()
full_path_list() list[str | int]
full_path_str() str

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.

view_context

alias of LayoutViewContext

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.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>
lx

Descriptor that delegates reads to a sub-attribute of another attribute.

Carries metadata (source_attr, name) so that LayoutInstanceSubcursor can retrieve the full source object for coordinate transformation before extracting the sub-attribute.

ly

Descriptor that delegates reads to a sub-attribute of another attribute.

Carries metadata (source_attr, name) so that LayoutInstanceSubcursor can retrieve the full source object for coordinate transformation before extracting the sub-attribute.

ux

Descriptor that delegates reads to a sub-attribute of another attribute.

Carries metadata (source_attr, name) so that LayoutInstanceSubcursor can retrieve the full source object for coordinate transformation before extracting the sub-attribute.

uy

Descriptor that delegates reads to a sub-attribute of another attribute.

Carries metadata (source_attr, name) so that LayoutInstanceSubcursor can retrieve the full source object for coordinate transformation before extracting the sub-attribute.

cx

Descriptor that delegates reads to a sub-attribute of another attribute.

Carries metadata (source_attr, name) so that LayoutInstanceSubcursor can retrieve the full source object for coordinate transformation before extracting the sub-attribute.

cy

Descriptor that delegates reads to a sub-attribute of another attribute.

Carries metadata (source_attr, name) so that LayoutInstanceSubcursor can retrieve the full source object for coordinate transformation before extracting the sub-attribute.

width

Descriptor that delegates reads to a sub-attribute of another attribute.

Carries metadata (source_attr, name) so that LayoutInstanceSubcursor can retrieve the full source object for coordinate transformation before extracting the sub-attribute.

height

Descriptor that delegates reads to a sub-attribute of another attribute.

Carries metadata (source_attr, name) so that LayoutInstanceSubcursor can retrieve the full source object for coordinate transformation before extracting the sub-attribute.

size

Descriptor that delegates reads to a sub-attribute of another attribute.

Carries metadata (source_attr, name) so that LayoutInstanceSubcursor can retrieve the full source object for coordinate transformation before extracting the sub-attribute.

center

Descriptor that delegates reads to a sub-attribute of another attribute.

Carries metadata (source_attr, name) so that LayoutInstanceSubcursor can retrieve the full source object for coordinate transformation before extracting the sub-attribute.

north

Descriptor that delegates reads to a sub-attribute of another attribute.

Carries metadata (source_attr, name) so that LayoutInstanceSubcursor can retrieve the full source object for coordinate transformation before extracting the sub-attribute.

south

Descriptor that delegates reads to a sub-attribute of another attribute.

Carries metadata (source_attr, name) so that LayoutInstanceSubcursor can retrieve the full source object for coordinate transformation before extracting the sub-attribute.

east

Descriptor that delegates reads to a sub-attribute of another attribute.

Carries metadata (source_attr, name) so that LayoutInstanceSubcursor can retrieve the full source object for coordinate transformation before extracting the sub-attribute.

west

Descriptor that delegates reads to a sub-attribute of another attribute.

Carries metadata (source_attr, name) so that LayoutInstanceSubcursor can retrieve the full source object for coordinate transformation before extracting the sub-attribute.

northwest

Descriptor that delegates reads to a sub-attribute of another attribute.

Carries metadata (source_attr, name) so that LayoutInstanceSubcursor can retrieve the full source object for coordinate transformation before extracting the sub-attribute.

northeast

Descriptor that delegates reads to a sub-attribute of another attribute.

Carries metadata (source_attr, name) so that LayoutInstanceSubcursor can retrieve the full source object for coordinate transformation before extracting the sub-attribute.

southwest

Descriptor that delegates reads to a sub-attribute of another attribute.

Carries metadata (source_attr, name) so that LayoutInstanceSubcursor can retrieve the full source object for coordinate transformation before extracting the sub-attribute.

southeast

Descriptor that delegates reads to a sub-attribute of another attribute.

Carries metadata (source_attr, name) so that LayoutInstanceSubcursor can retrieve the full source object for coordinate transformation before extracting the sub-attribute.

x_extent

Descriptor that delegates reads to a sub-attribute of another attribute.

Carries metadata (source_attr, name) so that LayoutInstanceSubcursor can retrieve the full source object for coordinate transformation before extracting the sub-attribute.

y_extent

Descriptor that delegates reads to a sub-attribute of another attribute.

Carries metadata (source_attr, name) so that LayoutInstanceSubcursor can retrieve the full source object for coordinate transformation before extracting the sub-attribute.

contains(other)
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, LayoutRect, or LayoutPath.

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