symbol module#

Schematic Symbols#

This module provides classes for defining schematic symbols, pins, and symbol mappings for components. You attach a symbol to a component by assigning it to a member field. The name of the field is not important, and multiple symbols can be attached to the same component to provide multiple symbol units.

class Symbol[source]#

Bases: Structural

Symbols are a structural element in JITX encoding the schematic representation of a part. Symbols often contain electrical connection points represented by Pin, geometric artwork, and Text annotations. Symbols are linked to a design through a Component where a symbol’s Pin objects are mapped to Port objects.

Valid elements in a symbol are:

If a symbol is defined inside another symbol, they will be treated together as one symbol in the design.

For a rectangular symbol with automatic or configurable pin layout, use BoxSymbol.

>>> class MySymbol(Symbol):
...     a = Pin(at=(1, 0), length=1, direction=Direction.Right)
...     b = Pin(at=(-1, 0), length=1, direction=Direction.Left)
...     pin_name_size = 0.3
...     pad_name_size = 0.3
...     orientation = SymbolOrientation(0)
...     rect = rectangle(2, 2)
>>> class MyComponent(Component):
...     ports = [Port() for _ in range(2)]
...     symbol = BoxSymbol()
pin_name_size: float | None = None#

Font size of pin name text of Pin objects in this symbol, in grid units. If unset, defers to a parent Symbol, if a parent exists. This can be overriden at the Pin level by setting its pin_name_size attribute.

pad_name_size: float | None = None#

Font size of pad name text of Pin objects in this symbol, in grid units. If unset, defers to a parent Symbol, if a parent exists. This can be overriden at the Pin level by setting its pad_name_size attribute.

class Direction(*values)[source]#

Bases: Enum

Pin direction on schematic symbols.

Left = 'left'#
Right = 'right'#
Up = 'up'#
Down = 'down'#
class Pin(at, length=0, direction=Direction.Left, pin_name_size=None, pad_name_size=None)[source]#

Bases: Structural

Schematic symbol pin definition.

Parameters:
at: GridPoint#

The position of the pin in grid units.

length: int = 0#

The length of the pin in grid units.

direction: Direction = 'left'#

The direction of the pin.

pin_name_size: float | None = None#

Font size of the pin’s pin name text in grid units, overriding the parent Symbol’s pin_name_size attribute.

pad_name_size: float | None = None#

Font size of the pin’s pad name text in grid units, overriding the parent Symbol’s pad_name_size attribute.

class SymbolMapping(entries)[source]#

Bases: Structural, Ref

Mapping between component ports and schematic symbol pins.

If no symbol mapping is provided, a default mapping will be created that maps ports to symbol pins in declaration order.

>>> class MyComponent(Component):
...     GND = Power()
...     VIN = Power()
...     VOUT = Power()
...
...     symbol = MySymbol()
...     mappings = SymbolMapping({
...         GND: symbol.gnd,
...         VIN: symbol.vin,
...         VOUT: symbol.vout,
...     })
Parameters:

entries (Mapping[Port, Pin] | Iterable[tuple[Port, Pin]])

items()[source]#
values()[source]#
class SymbolOrientation(rotations=())[source]#

Permitted orientations for a schematic symbol.

In initial placement of schematic symbols, the engine may rotate the symbol to be in any of the permitted orientations. If no orientations are specified, then all orientations are permitted.

Parameters:

rotations (list[int])

rotations: list[int]#

List of allowed rotation angles in degrees.