Hygiene: digit-terminate all generated refdeses — clears kicad-cli annotation errors

33 component refs (J_E->J_E1, C_VCAP->C_VCAP1, C_IN5a->C_IN5a1, ...) plus 8
power-symbol refs (#FLG15IN->#FLG15IN1, #PWRC_E1g->#PWRC_E1g1, ...) now end
in a digit; emit helpers normalize tags so future sheets stay clean.
kicad-cli netlist annotation warning GONE. ERC 133->133 identical types;
analyzer +73/-4/~0 unchanged; SPICE 24 pass / 2 benign warn / 0 fail.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
noise
2026-07-04 09:35:29 -04:00
parent dbfe4b22f7
commit 8124b411bf
6 changed files with 378 additions and 371 deletions

View File

@@ -97,8 +97,10 @@ def emit_glabel(net, x, y, ang=0):
body.append(f'\t(global_label "{net}"\n\t\t(shape input)\n\t\t(at {x} {y} {ang})\n'
f'\t\t(effects (font (size 1.27 1.27)) (justify left))\n\t\t(uuid "{U("gl-"+net+f"-{x}-{y}")}")\n\t)\n')
def emit_nc(x, y, tag):
tag = tag if tag[-1].isdigit() else tag + "1" # refs must end in a digit (KiCad annotation)
body.append(f'\t(no_connect (at {x} {y}) (uuid "{U("nc-"+tag)}"))\n')
def emit_gnd(x, y, tag):
tag = tag if tag[-1].isdigit() else tag + "1" # refs must end in a digit (KiCad annotation)
body.append(f'\t(symbol\n\t\t(lib_id "power:GND")\n\t\t(at {x} {y} 0)\n\t\t(unit 1)\n'
f'\t\t(exclude_from_sim no) (in_bom yes) (on_board yes) (dnp no)\n\t\t(uuid "{U("gnd-"+tag)}")\n'
f'\t\t(property "Reference" "#PWR{tag}" (at {x} {y+3} 0) (effects (font (size 1.27 1.27)) (hide yes)))\n'
@@ -134,17 +136,17 @@ def place(lib_id, ref, value, footprint, ox, oy, pin_nets):
GND = ('gnd',); NC = ('nc',)
# ---- the GPS + PPS block ----------------------------------------------------------
place("Connector_Generic:Conn_01x05", "J_GPS", "GPS_5pin_PPS_UART", "Connector_PinHeader_2.54mm:PinHeader_1x05_P2.54mm_Vertical",
place("Connector_Generic:Conn_01x05", "J_GPS1", "GPS_5pin_PPS_UART", "Connector_PinHeader_2.54mm:PinHeader_1x05_P2.54mm_Vertical",
60, 80, {'1': 'GPS_PPS_RAW', '2': 'GPIO5', '3': 'GPIO4', '4': '+3V3_AUX', '5': GND})
place("Device:D_TVS", "TVS_PPS", "PESD3V3L1BA", "Diode_SMD:D_SOD-323", 85, 95, {'1': 'GPS_PPS_RAW', '2': GND})
place("Device:D_TVS", "TVS_PPS1", "PESD3V3L1BA", "Diode_SMD:D_SOD-323", 85, 95, {'1': 'GPS_PPS_RAW', '2': GND})
# 74LVC1G17: 1=NC 2=A 3=GND 4=Y 5=VCC (KiCad lib types: input/power_in/output/power_in)
place("74xGxx:74LVC1G17", "U_PPS", "74LVC1G17", "Package_TO_SOT_SMD:SOT-23-5",
place("74xGxx:74LVC1G17", "U_PPS1", "74LVC1G17", "Package_TO_SOT_SMD:SOT-23-5",
110, 80, {'2': 'GPS_PPS_RAW', '4': 'PPS_CLEAN', '5': '+3V3_AUX', '3': GND, '1': NC})
place("Device:C", "C_PPS", "100n", "Capacitor_SMD:C_0402_1005Metric", 100, 95, {'1': '+3V3_AUX', '2': GND})
place("Device:C", "C_GPS", "10u", "Capacitor_SMD:C_0603_1608Metric", 70, 95, {'1': '+3V3_AUX', '2': GND})
place("Device:C", "C_PPS1", "100n", "Capacitor_SMD:C_0402_1005Metric", 100, 95, {'1': '+3V3_AUX', '2': GND})
place("Device:C", "C_GPS1", "10u", "Capacitor_SMD:C_0603_1608Metric", 70, 95, {'1': '+3V3_AUX', '2': GND})
# series R guards the LVC1G17 output against a driver fight (CM5 pin 18 is bidi;
# board policy configures it as input — spec Rs 33-100R, pick 33R)
place("Device:R", "R_PPS", "33", "Resistor_SMD:R_0402_1005Metric", 140, 80, {'1': 'PPS_CLEAN', '2': 'SYNC_OUT'})
place("Device:R", "R_PPS1", "33", "Resistor_SMD:R_0402_1005Metric", 140, 80, {'1': 'PPS_CLEAN', '2': 'SYNC_OUT'})
place("Connector_Generic:Conn_01x02", "J_PPS1", "PPS_tap_UWB", "Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical",
170, 75, {'1': 'PPS_CLEAN', '2': GND})
place("Connector_Generic:Conn_01x02", "J_PPS2", "PPS_tap_scope", "Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical",