Skip to content

D147 — Time-domain matching measured as KiCad 10.0.6 measures it, and KiCad's net-class and pair-coupling semantics

Context

Doc 18 B2 (M21): length and skew groups in picoseconds, with per-layer and via delays from B1's tuning profiles, tuned to a target delay and checked against KiCad's own rules. The gate is a DDR-style generated fixture and two real boards within tolerance by KiCad's DRC, in delay. The engine read ps as a unit but measured lengths its own way, and its router read time rules as lengths. Checking B2 against KiCad also showed that the B1 fixtures (D145) had been judged by a KiCad that read no profile at all (net settings at schema 4). Design: doc 05 §59 and the note at the end of §58. Records: bench/records/m21-b2 and bench/records/m21-b1/runs/b1-v5.

Decision

  • Measure as KiCad 10.0.6 does, quirks included (drc/length.hpp): its chain merge, which depends on order on branched nets (file order here, pointer order in KiCad); via spans; clipping in vias and pads; and its rounding of lengths and delays. The DRC's length and skew check groups items by rule and compares a ps rule with the delay. A minimum skew fails on the reference net, as in 10.0.6.
  • Tune delays in the router (tune_delays): ps windows first, then ps skew groups or pairs, with meanders weighted by each layer's delay per mm. Time rules are no longer read as lengths.
  • Net classes as 10.0.6 resolves them:
  • Default joins a net's effective class when the matched classes leave a field unset, or when none of them has a profile and Default has one.
  • hasNetclass is evaluated.
  • A class with no profile takes Default's.
  • Net settings older than schema 5 lose their profiles, with a warning.
  • Profiled nets are not necked down, and a single-ended profile sets the pair width too.
  • Port KiCad's diff-pair coupling test into the DRC (drc/coupling.hpp, check_diff_pairs), so that diff_pair_gap and diff_pair_uncoupled rules are checked, the profile's implicit gap rule included. The router does not yet use it.
  • The route summary no longer records --view-embed. Like --view-token, it gave away the machine's addresses.

Alternatives

  • Follow KiCad master's merge (simple two-end joints only). It is the better rule, but the judge is 10.0.6, and the two agree on every net that does not branch inside a via.
  • Tune the delay by length, converting each window with one delay per mm. That is wrong as soon as a net changes layer or has a via, and a profile gives each layer its own delay.
  • Keep the B1 results with a note. They were measured by a judge that saw no profile; they had to be redone.
  • Make the router avoid coupling-gap errors now. That needs the coupling test inside the commit check for pair nets with a maximum gap, and the pad-to-pad joins of interleaved connectors handled. It is left open and reported.

Consequences

  • KiCad's QA board: the delays match to 0.01 ps, with the same one violation.
  • Length parity: of 329 nets on four demo boards, 325 match to under 1 µm. Four branched power and mesh nets differ by up to 1.58 mm, because of 10.0.6's order dependence.
  • ddr8, interf_u and RoyalBlue end KiCad-clean on their delay rules (20, 7 and 1 errors with the build before B2), interf_u and RoyalBlue at the same routed counts.
  • B1 rejudged: plane_smd 48/49 with no added error. RoyalBlue drops to 102 (single-ended) and 104/147 (both profiles), from 125: KiCad's exact width with no neck-down is the price of a single-ended profile on Default. Five diff_pair_gap_out_of_range errors remain at RoyalBlue's USB-C connector.
  • Open:
  • the router does not avoid coupling-gap errors;
  • fromTo() is not evaluated;
  • the bus tuner ignores ps skew;
  • a net in two classes uses the first one's parameters;
  • KiCad's pair-name suffixes with trailing digits are not paired.
  • Docs: 05 §58 (rejudged) and §59, 18 §17, 11 (M21 row).