From 25d0c57d7988901c7621a3e4af2b4a32533584b6 Mon Sep 17 00:00:00 2001 From: Me Here Date: Sat, 30 May 2026 23:49:50 -0500 Subject: [PATCH] PM_K-1 hardware: fix indicator.py scoping bug (p15 rebind in threshold()) The committed indicator.py errored (UnboundLocalError: p15) -- an augmented assign on a global Net inside threshold() made it local. Flipped to rt[1]+=p15. Now ERC 0 / netlist 0. Co-Authored-By: Claude Opus 4.8 (1M context) --- hardware/eda/circuits/indicator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardware/eda/circuits/indicator.py b/hardware/eda/circuits/indicator.py index 84f7870..e2c2922 100644 --- a/hardware/eda/circuits/indicator.py +++ b/hardware/eda/circuits/indicator.py @@ -47,7 +47,7 @@ def peak_detect(src): def threshold(div_top, div_bot): n = Net(); rt = R(value=div_top); rb = R(value=div_bot) - p15 += rt[1]; rt[2] += n; rb[1] += n; rb[2] += gnd + rt[1] += p15; rt[2] += n; rb[1] += n; rb[2] += gnd # rt[1]+=p15 (not p15+=...) to avoid local rebind return n # signal-present: low threshold ; clip: high threshold (TUNABLE)