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

@@ -134,9 +134,11 @@ def loc_label(name, x, y, ang):
f'\t\t(effects (font (size 1.27 1.27)) (justify left))\n\t\t(uuid "{U("ll-"+name+"-"+str(x)+"-"+str(y))}")\n\t)\n')
def no_connect(x, y, tag):
tag = tag if tag[-1].isdigit() else tag + "1" # refs must end in a digit (KiCad annotation)
return f'\t(no_connect (at {x} {y}) (uuid "{U("nc-"+tag)}"))\n'
def gnd_sym(x, y, tag):
tag = tag if tag[-1].isdigit() else tag + "1" # refs must end in a digit (KiCad annotation)
return (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'
f'\t\t(uuid "{U("gnd-"+tag)}")\n'
@@ -148,6 +150,7 @@ def gnd_sym(x, y, tag):
f'\t\t(instances (project "{PROJECT}" (path "/{ROOT_UUID}/{SHEET_SYMBOL_UUID}" (reference "#PWR{tag}") (unit 1))))\n\t)\n')
def pwr_flag(x, y, tag):
tag = tag if tag[-1].isdigit() else tag + "1" # refs must end in a digit (KiCad annotation)
return (f'\t(symbol\n\t\t(lib_id "power:PWR_FLAG")\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'
f'\t\t(uuid "{U("pflag-"+tag)}")\n'
@@ -172,7 +175,7 @@ def passive(lib_id, ref, value, footprint, x, y, tag):
def socket_symbol():
# the placed J_E (multi-unit symbol uses unit 1; both graphic units share lib def)
props = ('\t\t(property "Reference" "J_E" (at 170 53 0) (effects (font (size 1.27 1.27))))\n'
props = ('\t\t(property "Reference" "J_E1" (at 170 53 0) (effects (font (size 1.27 1.27))))\n'
'\t\t(property "Value" "M.2_Ekey_WiFi" (at 170 55 0) (effects (font (size 1.27 1.27))))\n'
'\t\t(property "Footprint" "Connector_PCBEdge:M.2_2230-xx-E" (at 170 105 0) (effects (font (size 1.27 1.27)) (hide yes)))\n'
'\t\t(property "Datasheet" "" (at 170 105 0) (effects (font (size 1.27 1.27)) (hide yes)))\n'
@@ -180,8 +183,8 @@ def socket_symbol():
pins = "".join(f'\t\t(pin "{n}" (uuid "{U("jepin-"+n)}"))\n' for n in sorted(SOCK_PINS, key=int))
return (f'\t(symbol\n\t\t(lib_id "Connector:Bus_M.2_Socket_E")\n\t\t(at {PX} {PY} 0)\n\t\t(unit 1)\n'
f'\t\t(exclude_from_sim no) (in_bom yes) (on_board yes) (dnp no)\n'
f'\t\t(uuid "{U("J_E")}")\n' + props + pins +
f'\t\t(instances (project "{PROJECT}" (path "/{ROOT_UUID}/{SHEET_SYMBOL_UUID}" (reference "J_E") (unit 1))))\n\t)\n')
f'\t\t(uuid "{U("J_E1")}")\n' + props + pins +
f'\t\t(instances (project "{PROJECT}" (path "/{ROOT_UUID}/{SHEET_SYMBOL_UUID}" (reference "J_E1") (unit 1))))\n\t)\n')
# ---- assemble the sheet ------------------------------------------------------------
body = []