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.SourceLocInfo(filename: str, line: int, column: int)

Source location of the ORD/Python statement that created a node.

filename: str

Alias for field number 0

line: int

Alias for field number 1

column: int

Alias for field number 2

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>
class ordec.core.schema.PolyVec2I(**kwargs)

One vertex of a Vec2I polygonal chain or polygon.

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

Order of the point in the polygonal chain

pos: Vec2I = <ordec.core.constraints.ConstrainableAttr object>
ref_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.SymbolPoly(vertices: list[Vec2R | Vec2I] | int = None, **kwargs)

A drawn polygonal chain in Symbol. For visual purposes only.

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()
src_loc: SourceLocInfo = <ordec.core.ordb.Attr object>
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>
class ordec.core.schema.SchemErrorMarker(**kwargs)

An error marker indicating a schematic check failure.

in_subgraphs = [<class 'ordec.core.schema.Schematic'>]
ref: int = <ordec.core.ordb.LocalRef object>
pos: Vec2R = <ordec.core.ordb.Attr object>
align: D4 = <ordec.core.ordb.Attr object>
error_type: SchemErrorType = <ordec.core.ordb.Attr object>
class ordec.core.schema.SchemErrorType(value)
OverlappingTerminals = 'Overlapping terminals'
MissingTerminalConnection = 'Missing terminal connection'
IncorrectTerminalConnection = 'Incorrect terminal connection'
GeometricShort = 'Geometric short'
OverlappingWires = 'Overlapping wires'
OverlappingSchemConnPoints = 'Overlapping connection points'
IncorrectlyPlacedSchemConnPoint = 'Incorrectly placed connection point'
UnconnectedPin = 'Unconnected pin'
StrayPinsInPortmap = 'Stray pins in portmap'
SchemConnPointOverlappingTerminal = 'Connection point overlapping terminal'
TerminalMultipleConnections = 'Terminal with multiple connections'
UnconnectedWiring = 'Unconnected wiring'
StraySchemConnPoint = 'Stray connection point'
MissingSchemConnPoint = 'Missing connection point'
NetMissesWiring = 'Net misses wiring'
OverlappingInstances = 'Overlapping instances'

Unresolved schematic instances

During schematic construction, instances may reference a Symbol that is not determined yet. These nodes hold the pending placement, connections and parameters until the referenced Symbol is resolved into a SchemInstance.

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

An instance of a Symbol that is not determined yet.

class ParamWrapper(inst)
in_subgraphs = [<class 'ordec.core.schema.Schematic'>]
pos: Vec2R = <ordec.core.constraints.ConstrainableAttr object>
orientation: D4 = <ordec.core.ordb.Attr object>
resolver: object = <ordec.core.ordb.Attr object>
property params
loc_transform()
src_loc: SourceLocInfo = <ordec.core.ordb.Attr object>
class ordec.core.schema.SchemInstanceUnresolvedConn(**kwargs)

Unresolved SchemInstanceConn.

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: tuple = <ordec.core.ordb.Attr object>

Tuple of str or int = requested path in future symbol

class ordec.core.schema.SchemInstanceUnresolvedParameter(**kwargs)
in_subgraphs = [<class 'ordec.core.schema.Schematic'>]
ref: int = <ordec.core.ordb.LocalRef object>
ref_idx = <ordec.core.ordb.Index object>
name: str = <ordec.core.ordb.Attr object>
value: object = <ordec.core.ordb.Attr object>

TODO - should be immutable.

Simulation hierarchy

class ordec.core.schema.SimHierarchy(**kwargs)
view_context

alias of SimulationViewContext

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()
simulate(enable_savecurrents: bool = True, batch: bool = True)
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()
to_numpy(include=None, translate_names=True)

Convert simulation data to a numpy structured array.

Parameters:
  • include – None to include all fields, or an iterable of SimNet/SimPin/SimParam nodes. The independent variable (time/freq/sweep) is always included first.

  • translate_names – If True (default), translate ngspice field names to ORDB-style paths. If False, keep raw ngspice names.

Returns:

numpy structured array with requested fields.

write_csv(filename, include=None, translate_names=True)

Write simulation data to a CSV file.

Parameters:
  • filename – Path to the output CSV file.

  • include – None to include all fields, or an iterable of SimNet/SimPin/SimParam nodes. The independent variable (time/freq/sweep) is always included first.

  • translate_names – If True (default), translate ngspice field names to ORDB-style paths. If False, keep raw ngspice names.

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
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.SimPin(**kwargs)
in_subgraphs = [<class 'ordec.core.schema.SimHierarchy'>]
instance: int = <ordec.core.ordb.LocalRef object>
eref: int = <ordec.core.ordb.ExternalRef object>
current_field: str = <ordec.core.ordb.Attr object>

Column name in root sim_data for current.

property current
instance_eref_idx = <ordec.core.ordb.CombinedIndex object>
class ordec.core.schema.SimParam(**kwargs)
in_subgraphs = [<class 'ordec.core.schema.SimHierarchy'>]
instance: int = <ordec.core.ordb.LocalRef object>
name: str = <ordec.core.ordb.Attr object>

“gm”, “gds”, “vth”, “region”, etc.

Type:

Parameter name

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

Column name in root sim_data.

property value
instance_name_idx = <ordec.core.ordb.CombinedIndex object>
class ordec.core.schema.SimType(value)
OP = 'op'
TRAN = 'tran'
AC = 'ac'
DCSWEEP = 'dcsweep'

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)

ordec.core.schema.rgb_color(s) RGBColor

Parse a hex color string like ‘#0012EF’ into an RGBColor.

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

Routing

Routing specifications parametrize the SRouter independently of the LayerStack, describing the per-layer widths, via geometry and routing order used to connect nets.

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

Routing specification for SRouter, decoupled from LayerStack.

ref_layers: LayerStack = <ordec.core.ordb.SubgraphRef object>
class ordec.core.schema.RoutingSpecLayer(**kwargs)

Per-layer routing parameters for SRouter.

in_subgraphs = [<class 'ordec.core.schema.RoutingSpec'>]
layer: int = <ordec.core.ordb.ExternalRef object>
route_id: int = <ordec.core.ordb.Attr object>

route_id determines the routing order. To route from layer n to layer m (m > n), all layers with route_ids x where m > x > n must be traversed. route_ids should alternate between metal (even) and vias (odd).

route_via_width: int = <ordec.core.ordb.Attr object>
route_via_height: int = <ordec.core.ordb.Attr object>
route_wire_width: int = <ordec.core.ordb.Attr object>
route_wire_ext: int = <ordec.core.ordb.Attr object>
route_id_index = <ordec.core.ordb.Index object>
layer_index = <ordec.core.ordb.Index object>

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

Reports and plots

Reports are subgraphs of vertically stacked report elements, used to present textual, tabular and graphical results (e.g. course lesson feedback or simulation plots) in the web interface.

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

Represents a list of vertically stacked report elements.

Report elements are stored as ORDB nodes. The helper methods preserve the append-style API for building reports programmatically.

view_context

alias of ReportViewContext

fill_height: bool = <ordec.core.ordb.Attr object>
elements()
markdown(markdown: str)
preformatted(text: str)
html(html: str)
svg(view)
plot2d(series, **kwargs)
passfail(label: str, passed: bool, instructions: str = '', hint: str = None)
webdata()
class ordec.core.schema.ReportElement(**kwargs)

Base class for all report element nodes.

in_subgraphs = [<class 'ordec.core.schema.Report'>]
element_webdata() dict

Returns JSON-serializable web representation.

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

Markdown text rendered as HTML in the web interface.

Links using the ‘docs:’ pseudo-scheme, e.g. [WebUI](docs:webui.html), point to the ORDeC documentation matching the installed version.

markdown: str = <ordec.core.ordb.Attr object>
element_webdata() dict
class ordec.core.schema.PreformattedText(**kwargs)

Preformatted text rendered using a monospace font.

text: str = <ordec.core.ordb.Attr object>
element_webdata() dict
class ordec.core.schema.Html(**kwargs)

Raw HTML content rendered directly in the web interface.

html: str = <ordec.core.ordb.Attr object>
element_webdata() dict
class ordec.core.schema.PassFail(**kwargs)

Single pass/fail check result, e.g. for course lessons. A lesson is considered passed when all PassFail elements of its report pass.

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

short name of the check

passed: bool = <ordec.core.ordb.Attr object>
instructions: str = <ordec.core.ordb.Attr object>

what the user should achieve / status details

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

optional hint, shown only on user request

element_webdata() dict
class ordec.core.schema.Svg(**kwargs)

Static SVG element rendered without zoom.

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

SVG markup inside the <svg> element

viewbox_min_x: float = <ordec.core.ordb.Attr object>

viewBox left edge

viewbox_min_y: float = <ordec.core.ordb.Attr object>

viewBox top edge

viewbox_width: float = <ordec.core.ordb.Attr object>

viewBox width

viewbox_height: float = <ordec.core.ordb.Attr object>

viewBox height

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

CSS width string (e.g. “120px”)

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

CSS height string (e.g. “80px”)

classmethod from_view(view) Svg

Creates an SVG report element from an object exposing webdata().

element_webdata() dict
class ordec.core.schema.PlotGroup(**kwargs)

Groups Plot2D elements that share a synchronized x-axis.

in_subgraphs = [<class 'ordec.core.schema.Report'>]
class ordec.core.schema.Plot2D(**kwargs)

2D plot element rendered with the frontend simulation plot component.

x: tuple = <ordec.core.ordb.Attr object>
xlabel: str = <ordec.core.ordb.Attr object>
ylabel: str = <ordec.core.ordb.Attr object>
xscale: ScaleType = <ordec.core.ordb.Attr object>
yscale: ScaleType = <ordec.core.ordb.Attr object>
height: float = <ordec.core.ordb.Attr object>

plot height in pixels

plot_group: int = <ordec.core.ordb.LocalRef object>
series()
element_webdata() dict
class ordec.core.schema.Plot2DSeries(**kwargs)

A single data series belonging to a Plot2D element.

in_subgraphs = [<class 'ordec.core.schema.Report'>]
ref: int = <ordec.core.ordb.LocalRef object>
ref_idx = <ordec.core.ordb.Index object>
name: str = <ordec.core.ordb.Attr object>
values: tuple = <ordec.core.ordb.Attr object>
class ordec.core.schema.ScaleType(value)
Linear = 'linear'
Log = 'log'

Design rule checking (DRC)

A DRC report collects design rule violations found in a Layout. Violations are grouped into categories and attached to the cell they occur in; each item carries one or more geometry nodes (boxes, edges, polygons, paths, text or values) locating and describing the violation.

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

DRC report containing design rule check results.

view_context

alias of AssignableViewContext

ref_layout: Layout = <ordec.core.ordb.SubgraphRef object>
top_cell_name: str = <ordec.core.ordb.Attr object>
nresults() int

Count total DrcItems.

summary() dict[str, int]

Category name -> count mapping.

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

Category of DRC violations (e.g., ‘Minimum spacing’, ‘Minimum width’).

in_subgraphs = [<class 'ordec.core.schema.DrcReport'>]
name: str = <ordec.core.ordb.Attr object>
description: str = <ordec.core.ordb.Attr object>
parent: int = <ordec.core.ordb.LocalRef object>
parent_idx = <ordec.core.ordb.Index object>
class ordec.core.schema.DrcCell(**kwargs)

Cell of the checked layout hierarchy that DRC violations attach to.

Analogous to LvsCircuitPair for LVS reports. KLayout deep-mode DRC reports each violation once, attached to the cell it occurs in, with coordinates in that cell’s local space. ref_layout resolves the cell name back to its Layout subgraph; None if the name is unresolvable (e.g. KLayout variant cells like ‘sub$VAR1’).

in_subgraphs = [<class 'ordec.core.schema.DrcReport'>]
name: str = <ordec.core.ordb.Attr object>
ref_layout: Layout = <ordec.core.ordb.SubgraphRef object>
class ordec.core.schema.DrcItem(**kwargs)

Individual DRC violation item within a category.

in_subgraphs = [<class 'ordec.core.schema.DrcReport'>]
category: int = <ordec.core.ordb.LocalRef object>
category_idx = <ordec.core.ordb.Index object>
cell: int = <ordec.core.ordb.LocalRef object>
cell_idx = <ordec.core.ordb.Index object>
class ordec.core.schema.DrcBox(**kwargs)

Box geometry in a DRC item.

in_subgraphs = [<class 'ordec.core.schema.DrcReport'>]
item: int = <ordec.core.ordb.LocalRef object>
item_idx = <ordec.core.ordb.Index object>
order: int = <ordec.core.ordb.Attr object>
tag: str = <ordec.core.ordb.Attr object>
rect: Rect4I = <ordec.core.ordb.Attr object>
class ordec.core.schema.DrcEdge(**kwargs)

Edge geometry in a DRC item.

in_subgraphs = [<class 'ordec.core.schema.DrcReport'>]
item: int = <ordec.core.ordb.LocalRef object>
item_idx = <ordec.core.ordb.Index object>
order: int = <ordec.core.ordb.Attr object>
tag: str = <ordec.core.ordb.Attr object>
p1: Vec2I = <ordec.core.ordb.Attr object>
p2: Vec2I = <ordec.core.ordb.Attr object>
class ordec.core.schema.DrcEdgePair(**kwargs)

Edge pair geometry in a DRC item (e.g., for spacing violations).

in_subgraphs = [<class 'ordec.core.schema.DrcReport'>]
item: int = <ordec.core.ordb.LocalRef object>
item_idx = <ordec.core.ordb.Index object>
order: int = <ordec.core.ordb.Attr object>
tag: str = <ordec.core.ordb.Attr object>
edge1_p1: Vec2I = <ordec.core.ordb.Attr object>
edge1_p2: Vec2I = <ordec.core.ordb.Attr object>
edge2_p1: Vec2I = <ordec.core.ordb.Attr object>
edge2_p2: Vec2I = <ordec.core.ordb.Attr object>
class ordec.core.schema.DrcPoly(vertices: list[Vec2R | Vec2I] | int = None, **kwargs)

Polygon geometry in a DRC item.

in_subgraphs = [<class 'ordec.core.schema.DrcReport'>]
vertex_cls

alias of PolyVec2I

item: int = <ordec.core.ordb.LocalRef object>
item_idx = <ordec.core.ordb.Index object>
order: int = <ordec.core.ordb.Attr object>
tag: str = <ordec.core.ordb.Attr object>
class ordec.core.schema.DrcPath(vertices: list[Vec2R | Vec2I] | int = None, **kwargs)

Path geometry in a DRC item.

in_subgraphs = [<class 'ordec.core.schema.DrcReport'>]
vertex_cls

alias of PolyVec2I

item: int = <ordec.core.ordb.LocalRef object>
item_idx = <ordec.core.ordb.Index object>
order: int = <ordec.core.ordb.Attr object>
endtype: PathEndType = <ordec.core.ordb.Attr object>
tag: str = <ordec.core.ordb.Attr object>
width: int = <ordec.core.ordb.Attr object>
class ordec.core.schema.DrcText(**kwargs)

Text geometry in a DRC item.

in_subgraphs = [<class 'ordec.core.schema.DrcReport'>]
item: int = <ordec.core.ordb.LocalRef object>
item_idx = <ordec.core.ordb.Index object>
order: int = <ordec.core.ordb.Attr object>
tag: str = <ordec.core.ordb.Attr object>
pos: Vec2I = <ordec.core.ordb.Attr object>
text: str = <ordec.core.ordb.Attr object>
class ordec.core.schema.DrcValue(**kwargs)

Arbitrary string value in a DRC item.

in_subgraphs = [<class 'ordec.core.schema.DrcReport'>]
item: int = <ordec.core.ordb.LocalRef object>
item_idx = <ordec.core.ordb.Index object>
order: int = <ordec.core.ordb.Attr object>
tag: str = <ordec.core.ordb.Attr object>
value: str = <ordec.core.ordb.Attr object>

Layout vs. schematic (LVS)

An LVS report captures the comparison of an extracted Layout against its Schematic. Results are organized per circuit pair, with individual items recording the match status of nets, devices, pins and subcircuits.

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

LVS report containing layout vs. schematic comparison results.

view_context

alias of AssignableViewContext

ref_layout: Layout = <ordec.core.ordb.SubgraphRef object>
ref_schematic: Schematic = <ordec.core.ordb.SubgraphRef object>
top_cell: str = <ordec.core.ordb.Attr object>
status: LvsStatus = <ordec.core.ordb.Attr object>
clean()
webdata()
class ordec.core.schema.LvsCircuitPair(**kwargs)

Comparison record for a layout cell vs schematic cell pair.

in_subgraphs = [<class 'ordec.core.schema.LvsReport'>]
ref_layout: Layout = <ordec.core.ordb.SubgraphRef object>

Direct ref to the Layout being compared. Only set for top-level circuit (where LVSDB cell name matches top_cell); None for subcircuits.

ref_schematic: Schematic = <ordec.core.ordb.SubgraphRef object>

Direct ref to the Schematic being compared. Only set for top-level.

status: LvsStatus = <ordec.core.ordb.Attr object>
message: str = <ordec.core.ordb.Attr object>
layout_cell: str = <ordec.core.ordb.Attr object>
schem_cell: str = <ordec.core.ordb.Attr object>
class ordec.core.schema.LvsItem(**kwargs)

Individual LVS comparison item (net, device, pin, or subcircuit).

in_subgraphs = [<class 'ordec.core.schema.LvsReport'>]
circuit: int = <ordec.core.ordb.LocalRef object>
circuit_idx = <ordec.core.ordb.Index object>
item_type: LvsItemType = <ordec.core.ordb.Attr object>
status: LvsStatus = <ordec.core.ordb.Attr object>
layout_pos: Vec2I = <ordec.core.ordb.Attr object>
layout_params: tuple = <ordec.core.ordb.Attr object>
schem: int = <ordec.core.ordb.ExternalRef object>
schem_params: tuple = <ordec.core.ordb.Attr object>
message: str = <ordec.core.ordb.Attr object>
layout_name: str = <ordec.core.ordb.Attr object>
schem_name: str = <ordec.core.ordb.Attr object>
class ordec.core.schema.LvsStatus(value)

Status of an LVS comparison item or circuit pair, following KLayout’s LVSDB status vocabulary (see dbLayoutVsSchematicFormatDefs.h).

Match = 'match'
Mismatch = 'mismatch'

Paired, but the comparison failed (KLayout ‘0’), e.g. paired nets whose connectivity differs.

NoMatch = 'nomatch'

No correspondence found on the other side (KLayout ‘X’).

MatchWarning = 'warning'

a device that matched topologically but with deviating parameters, or an ambiguous net/pin/subcircuit match (e.g. between topologically symmetric nets).

Type:

Matched with warning (KLayout ‘W’)

Skipped = 'skipped'

Not compared (KLayout ‘S’), e.g. a circuit pair whose subcircuits already failed to compare.

class ordec.core.schema.LvsItemType(value)

Type of LVS comparison item.

Net = 'net'
Device = 'device'
Pin = 'pin'
Subcircuit = 'subcircuit'