/jitx-skills:jitx-interconnect-constraintsfrom jitx-skills
Applies signal integrity constraints in JITX: timing, skew matching, insertion loss, pin models, differential pairs, protocol constraints (PCIe, USB, DDR, Ethernet), reference planes, and topology definitions.
Ships in jitx-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
SI constraints (timing, insertion loss, intra-pair skew, skew to a reference): Topology(begin, end) names a path's ends, routes and pin models let the runtime follow it, and the design issues report proves it measured.
Environment setup is handled by the base jitx skill. Ensure it has been invoked first.
The worked patterns this skill points at are modules in the jitxexamples package, which the base jitx skill's Step 1 installs. If import jitxexamples raises ModuleNotFoundError, it is not installed: run that step's jitxexamples and eseries lines. If jitxexamples imports but a pointed-at module does not, the installed jitxexamples predates these patterns: rerun that step's jitxexamples line, which upgrades it to the supported release, and if the module is still missing, say so and work from the rules here.
import jitx
from jitx.si import Constrain, ConstrainDiffPair, ConstrainReferenceDifference
from jitx.si import DiffPairConstraint, SignalConstraint, ReferencePlanes
from jitx.si import PinModel, BridgingPinModel, TerminatingPinModel
from jitx.net import DiffPair, Net, Port, PortAttachment, Topology
from jitx.circuit import Circuit, Route
from jitx.toleranced import Toleranced
from jitx import current
These DO NOT EXIST — never import:
jitx.topology, jitx.constraints.si, jitx.diffpair, jitx.signal,
jitxlib.si, jitxlib.constraints
TopologyNet is in jitx.net, routing structures in jitx.si; Topology is also re-exported from jitx.si.
Apply per-lane or per-pair constraints by iterating a typed collection (self.lanes: list[DiffPair]), never a string-keyed dict or sibling getattr attributes, and hold constraints in a typed list or dataclass, never dict[str, Any] (jitx/references/architectural-patterns.md). Optional self-critique: jitx-code-review.
Join the path with ordinary nets (+ or Net([...])) and name its two ends with Topology(begin, end). The runtime infers the path between them from the routes, crossing parts that carry pin models, so >> (TopologyNet) is not needed for timing, loss or skew. It is dispreferred, fixing the connection order before routing. Use it only for a daisy chain whose order is part of the design (Daisy chains).
Store every net, constraint, helper, pin model and route on self; one left unstored logs ... lost during instantiation and never reaches the report.
Topology(begin, end) names the path and connects nothing. Delay is in seconds, loss in dB; rs50 = current.substrate.routing_structure(50.0):
self.cst = Constrain(Topology(self.drv.o, self.rcv.i)).timing(500e-12).insertion_loss(1.0).structure(rs50)
Worked pattern: jitxexamples.patterns.si_point_to_point. .timing(high=..., low=...) sets a window; Constrain([topo_a, topo_b]) takes several paths.
A timing constraint alone draws no meander: length is added only inside an envelope (Route.Config(envelope_overhead=...) on a code route section, or envelope_overhead on an interactive route, jitx-interactive-layout), and a path left short reports UnmetTime (jitx-code-layout, length matching).
Cover every timed path with one routing structure, on its own constraint or, in a daisy chain, the longest path's. Without one the measurement is not the structure's, and Missing routing structure on Path: ... is a defect to fix. Constrain.structure() takes only a single-ended RoutingStructure; differential work uses ConstrainDiffPair or DiffPairConstraint.
Name the true end-to-end pads and check each measured line reads from <begin> to <end> with them; an intermediate pad measures a shorter span silently. A circuit port resolves to the first pad behind it, so behind a series part in a sub-circuit, constrain the chip's pad (self.phy.chip.tx, not self.phy.tx).
With a series part in each of two sub-circuits, the segment between them, on the net holding the ports, reports Missing routing structure despite .structure(...). On a single-ended net, a structure-only constraint across the ports clears it: self.mid = Constrain(Topology(self.a.p, self.b.p)).structure(rs50). Untried on a diff pair. Measured case: Ends Inside Sub-Circuits.
Pin model delay and loss are SI inputs the measurement adds: take them from the datasheet, IBIS or vendor model, or the user, never placeholders, and label a fictional part's values illustrative.
A path stops at a part with no BridgingPinModel, reporting No path for signal constraint ... the part between <x> and <y>, which has no pin model. Give one to every part with a path through it between two pins (AC coupling cap, series resistor, common-mode choke, an ESD channel whose datasheet gives an in-to-out path), on the component class or in the circuit: self.bridge = BridgingPinModel(self.cap.a, self.cap.b, delay=6e-12, loss=0.5) (s, dB). A flow-through package whose opposite pin is not connected inside gets none: its two lands are one net joined by board copper, and a model would hide an open line. Worked pattern: jitxexamples.patterns.si_series_part.
A bare No path, naming no part, can come from an unrouted net crossing a circuit's bundle port (route it), a circuit-port end reaching several pads (name the pad), or an unresolved assignment (pin-assigned ports).
Adds a chip or connector pin's package delay and loss, one per pin, whenever package or connector data is supplied: pkg = [TerminatingPinModel(p, delay=15e-12, loss=0.2) for p in (tx.p, tx.n)]. Worked pattern: jitxexamples.patterns.si_point_to_point. Every modeled delay on a path counts toward its delay limits as well as its skews: both ends' pin models, via models and bridging models. A length rule written as a delay limit therefore includes them. Holding the trace alone instead means raising each limit by delays that, on a require()d end or an unrouted path, are not known until assignment and routing; state which reading the constraint applies.
A via adds the delay and loss in its models, keyed by layer pair. The substrate declares the via class (jitx-substrate-modeler); a design-local subclass adds the models, and PortAttachment(port, via) nets it:
class EscapeVia(MySubstrate.THVia):
models = {(0, 1): PinModel(delay=6e-12, loss=0.04)} # layer 0 to layer 1
Give every via on a constrained path a models entry for the layers it spans; without one it measures on a placeholder (Structure model from [0] to [1] not found ...), which is unresolved. Worked pattern: jitxexamples.patterns.si_via_model.
Path inference follows routed copper. Unrouted, nothing measures: the report carries Unconnected Topology on Path: <a>, <b> per segment, or Signal path from <a> to <b> is not routed yet. Route in the board view, or close the path from code so the proof runs headless:
self.via = EscapeVia().at(0, 0)
self.via_net = PortAttachment(self.drv.o, self.via)
self.routes = [
Route(self.drv.o, self.via, layer=0),
Route(self.via, self.rcv.i, layer=1),
]
These routes are what the runtime follows to infer the path between the Topology ends: a path crosses a via, or a part with a pin model, where routes land on both sides of it. Route between physical pads, vias and control points, one segment per hop. A route the router cannot make reports Unable to find path for requested route under Routing, and the constraint Missing Connection on Path: <a>, <b>. Control points and route mechanics: jitx-code-layout.
A bundle net (self.src.tx + self.dst.rx) joins each leg; drs100 = current.substrate.differential_routing_structure(100.0):
self.dp_cst = (
ConstrainDiffPair(Topology(self.src.tx, self.dst.rx))
.timing_difference(3e-12).timing(600e-12).insertion_loss(3.0).structure(drs100)
)
timing_difference is the P-to-N skew window, one Skew line per pair; timing and loss apply per leg. ConstrainDiffPair also takes a list of topologies. DiffPairConstraint(skew=Toleranced(...), loss=..., structure=...) is a reusable helper with no delay limit: store it on self, then call .constrain(src, dst) per pair. Worked pattern: jitxexamples.patterns.si_diff_pair (both forms). LanePair (jitx.common) bundles a TX and an RX DiffPair.
Matches data to a clock or strobe (RGMII, DDR DQ to DQS) or lane to lane (PCIe, SFP):
self.bus_skew = ConstrainReferenceDifference(
guide=Topology(self.src.clk, self.dst.clk),
topologies=[Topology(s, d) for s, d in zip(self.src.data, self.dst.data)],
).timing_difference(Toleranced(0, 11e-12))
The guide must run between single pins (Guide must be a single pin type), so across diff pairs one leg is the guide; each compared leg prints a Skew line. The window is guide delay minus target delay; the printed Target drops the sign. Worked pattern: jitxexamples.patterns.si_bundle_skew.
Reference planes name the return-path Net per routing layer: with ReferencePlanes(self.GND): (every layer), with ReferencePlanes({0: self.GND, 1: self.GND, 2: self.PWR}):, or .structure(rs50, ref_layers={0: self.GND}). A bare Port raises 'Port' object has no attribute 'connected'. A structure with .reference() layers errors at build without them; for one with none the context is inert, so check the structure definition.
For nets that share one structure and carry no timing, loss or skew limits, apply the structure by a routing_structure rule on the nets' tag: jitx-layout-constraints, Routing structures by tag. Its reference planes come from ref_net= or ref_layer_nets=, not ref_layers=. If a rule and .structure(...) both give one net a structure, the rule wins with no issue, so use one or the other.
Subclass SignalConstraint[T] (T the bundle Port), override constrain(self, src: T, dst: T), and keep the standard's cited numbers in a parameter class. An __init__ calls super().__init__() first (the base creates what self.add(...) extends). Store helpers and the instance on self, and call constrain(src, dst) on the true ends. For a transmit and a receive pair, constrain applies src.tx to dst.rx and dst.tx to src.rx (the crossover), never tx to tx. constrain_topology adds nothing on plain nets. Worked pattern: jitxexamples.patterns.si_signal_constraint.
For several signal groups, compose one constraint per group, called from constrain, as jitxexamples.protocols.memory does for DDR4 and LPDDR4, every number cited.
jitxlib.protocols holds protocol constraints with their port bundles: usb (USB2, USBSuperSpeed, USB_C), displayport (DisplayPort), ethernet.mii.rgmii (RGMII), ethernet.mdi.mdi100base_tx (MDI100BaseTX), ethernet.mdi.mdi1000base_t (MDI1000BaseT). Find what your installed version has with your Grep tool (pattern class.*Constraint.*SignalConstraint, path .venv, glob *.py). Per-standard parameters: references/protocol-standards.md.
SingleViaStructure(via, ground_cages=[PolarViaGroundCage(...)], antipads=[]) (jitxlib.via_structures; via a class with models; the keyword-only ground_cages and antipads required) is a Circuit with sig_in, sig_out and COMMON ports around signal_via. Net it in like a part, join COMMON to ground, route to signal_via on each layer, and name the outer pads; it binds on plain nets and counts the via's models (single-ended and differential, both measured). A cage that closes the via off fails the routes (Missing Connection on Path): size it, turn it with theta=, or gap it with skips=. Worked pattern: jitxexamples.patterns.si_via_structure.
DifferentialViaStructure(vias, pitch, ground_cages=..., antipads=...) has DiffPair ports and vias via_p and via_n; enterOn / exitOn add pair insertions. Neither takes insertion_points.
These DO NOT EXIST; never import:
jitx.via_structures, jitx.si.ViaStructure, jitxlib.vias
A constraint on a require()d port measures only once the assignment resolves (until then Unassigned Pin on Path, or No path between fixed physical ends). Code routes on the provider's physical pins resolve it, P/N inversion included; a route matching no offered mapping is dropped (Code route dropped: it conflicts with other connections) and the pin reported unassigned. A route cannot end on a require()d port, and a require()d port cannot be stored on self. Proof routes fix one mapping, so they belong in a verification design. Report paths name a require()d bundle after the first stored Net holding any of its signals, so store a net of the whole bundle first (jitx-pin-assignment). Full rules: jitx-pin-assignment.
>>)A daisy chain feeds loads in a fixed order, such as a DDR flyby clock. self.a0 = self.ctrl.a0 >> self.dram0.a0 >> self.dram1.a0 builds a TopologyNet recording that order before routing. Apply the structure once, over the longest path; a second structure on a shared segment adds Overlapping routing structures along path from ... and, routed, Ambiguous routing structures meet at <pad>. A plain Net chain also measures once code-routed in order. How the autorouter treats a chain, with or without >>, is unverified: claim neither. Worked pattern: jitxexamples.patterns.si_daisy_chain.
self.src.data = self.dst.data is Python assignment, not a connection.Proving each SI constraint applied (width and clearance: jitx-layout-constraints; geometry: jitx-code-layout).
Prove binding on a verification design per constrained interface: parts placed, every path code-routed between physical pads (on a pin-assigned port, the provider's pins). The shipping assembly carries no proof routes. Details: references/verification.md.
Type check: pyright path/to/circuit.py.
Read the design issues from Python, as a script run from the project root while the project's runtime is running (jitx runtime start --background):
import jitx
from mypkg.main import MyDesign
def main() -> None:
with jitx.runtime as rt:
report = rt.submit(MyDesign).issues(satisfied=True, wait=30)
if not report.complete:
print("report incomplete: raise wait and run again")
for group in report.groups():
print("met" if group.satisfied else "NOT MET", group.text)
if len(group.issues) > 1:
for issue in group:
print(" ", issue.text)
if __name__ == "__main__":
main()
Without satisfied=True a met constraint is left out. group.text shows only a group's first issue. Keep the code in main(): design discovery imports the project's .py files. jitx.run is experimental. Builds against one project run in sequence (Build safety).
Count a constraint applied only when its group carries a Time, Loss or Skew measurement naming the intended ends (met Time: <delay> - Target: 500ps ± 500ps from <begin> to <end>); status: ok or a clean type check is not evidence. Compliance is group.satisfied, the only verdict: the text reads the same met or unmet, and a skew Target drops its sign. A group also holding an unresolved text (table) is neither proven nor met. Report binding and compliance separately, an unmet measurement as a violation. In the binding report, say what closes each path (code routes, each crossed part's pin model and each via's models) and, outside a daisy chain, why it needs no >>.
ruff format path/to/circuit.py
evals/cases/reference/si-channel-bga-to-connector/NOTES.md (opens in a new tab)evals/cases/reference/si-channel-bga-to-connector/check_si_channel.py (opens in a new tab)evals/cases/reference/si-channel-bga-to-connector/si_channel_design.py (opens in a new tab)evals/cases/si-channel-bga-to-connector.json (opens in a new tab)evals/cases/si-patterns-retrieval.json (opens in a new tab)evals/eval-contract.yaml (opens in a new tab)evals/routing.jsonl (opens in a new tab)references/protocol-standards.md (opens in a new tab)references/verification.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub jitx-inc/jitx-skills --plugin jitx-skills13 skills in this plugin
/jitxBase skill for JITX Python PCB design: install, the jitx CLI, auth and the runtime, building designs, the viewers, exports, code quality (ruff, pyright, type annotations, check.py and grep gates), and design introspection (jitx.inspect, jitx.query, runtime submit). Use to set up JITX, start the runtime, build or find a design, open the viewer, fix a build or environment error, or find things in a design from Python. Route a whole board from requirements to jitx-project-builder, code self-review to jitx-code-review, component modeling to jitx-component-modeler, wiring and passives to jitx-circuit-builder, stackups to jitx-substrate-modeler, layout in code and realized-geometry checks to jitx-code-layout, open-layout place and route to jitx-interactive-layout, design rules, stitching, fencing and routing structures by tag to jitx-layout-constraints, SI constraints to jitx-interconnect-constraints, pin flexibility to jitx-pin-assignment, mechanical CAD to jitx-mechanical, and JLCPCB fab and parts to jitx-jlcpcb./jitx-circuit-builderUse when the user asks to "wire up", "connect", "build a circuit", create an "application circuit", declare a circuit's typed ports or bundles (Power, I2C, RGMII), compose sub-circuits into a hierarchy and connect them port to port, "place components" or sub-circuits (fixed or floating), add passives (resistors, capacitors, inductors) or decoupling, or set up power connections. Covers the Circuit class, nets and the + operator, typed ports, hierarchy, placement, and jitxlib-parts passives. Drawing a pour or copper is jitx-code-layout; pour rules are jitx-layout-constraints; provide/require pin assignment is jitx-pin-assignment./jitx-code-layoutUse when the user asks to write a fixed PCB layout in Python: place vias, and parts relative to another instance (Circuit.place), code routes through control points (RoutePoint, PairPoint, PairInsertion), Route.Sketch, Route.Config, a Route.Target taper, narrowing a route in a BGA field or a fine-pitch pad, escape or fanout geometry fixed by a stated number or pad geometry, a connector launch on its pad axis, serpentine or deskew settings on a matched section, thermal vias in an exposed pad, pours, keepouts, cutouts, Copper or OverlappableCopper (antennas, net ties), or reading the realized layout back (capture, Empty pours, 'Unable to find path'). Sorts control points between code and jitx-interactive-layout. Tag rules, escape width rules, stitching and fencing go to jitx-layout-constraints; stackups, vias and structure definitions to jitx-substrate-modeler; land-pattern mask, paste and thermal pads to jitx-component-modeler; nets and passives to jitx-circuit-builder; timing to jitx-interconnect-constraints./jitx-code-reviewSame-model self-critique pass for JITX Python code just written in this workspace. Use when the user asks to "review my JITX code", "self-critique", "check JITX conventions", "find string-hacking", "check framework-boundary issues", "audit before merge", or any equivalent. Mandatory for complete-board tier at task acceptance (folds into Think Twice); user-invoked for single-task work. Catches the architectural failure modes that grep gates and static linters miss — parallel string-keyed models, reflection-as-iteration (regardless of whether on self), owner-shaped data misplaced in design code, build-spec-then-iterate, module-import-time parallel models, and framework-boundary-bypass (the "framework does it, therefore so can I" trap). Applies an ownership test to every banned-pattern hit or proposed exception. Produces severity-tagged findings (CRITICAL / WARNING / NOTE) that fold into the task acceptance block./jitx-component-modelerCreate JITX Python component code from datasheets, KiCad footprints, vendor pin files, or user specifications. ALWAYS use this skill when user asks to "create a component", "model a part", "generate a component", "add a component", or "make a JITX component" - even without a datasheet. Also triggers on part numbers (NE555, LM1117, RP2040) and package types (SOIC, QFN, BGA, SON, SOT). Covers JITX generators for standard packages, a vendor's KiCad footprint read directly for non-standard ones, multi-unit symbols, thermal pads, pin mappings, and datasheet checks with jitx.test.TestCase. Also covers generating from a vendor's machine-readable pinout file rather than a drawing ("generate the FPGA from the pin file", "parse the package pinout file", "model this 1000-ball BGA"): parse-don't-transcribe, reconcile the ball inventory before emitting, and a committed generator with a regenerate-and-diff check. For choosing and placing an ordinary queried passive, use jitx-circuit-builder instead./jitx-interactive-layoutUse when the user asks to place components, route nets, drop vias, add pair insertions or route points, or draw pours in the open board layout from a script, so the result stays editable in the board editor: place and route a board or circuit, fan out a BGA, route DDR byte lanes, change a layout the user edited by hand, fix blocked routes, report layout issues or skew margin. Runs Python against a live design through jitx design session and jitx design exec, with the rd.layout requests (place, route, via, route_point, pair_insertion, region, modify, delete), and reads the result back through route status, rd.issues() and the bundled checks. Assumes the layout constraints are already in the design. Design rules, net classes, tags and escape-width rules in code belong to jitx-layout-constraints; decoupling modules to jitx-circuit-builder; copper, code-placed vias, code Route objects and control points in code to jitx-code-layout; topology, timing and skew constraints to jitx-interconnect-constraints.Other plugins' skills for the same job