Release 1.4.0: PDN mode, the config-file workflow, and the dialog editor
tests / archlinux:latest (push) Successful in 39s
tests / debian:12 (push) Successful in 1m17s
tests / fedora:latest (push) Successful in 1m8s
tests / ubuntu:24.04 (push) Successful in 1m23s
tests / ubuntu-latest · py3.11 (push) Successful in 1m25s
tests / ubuntu-latest · py3.13 (push) Successful in 1m5s
tests / NixOS (FHS wrapper from docs/NIXOS.md) (push) Skipped
Build PCM package / build (push) Successful in 11s

Multiple Thevenin supplies and prescribed-current loads on one net,
solved in absolute volts with the Tellegen power balance verified per
run; a source-sink pair table (effective copper resistance per
supply x load pair plus an exactly-summing proportional-sharing loss
attribution), in summary.txt and as its own figure. Bonded terminals
short a package's contacts into one lug so the per-pin split becomes
a solve outcome. Geometry dumps carry the terminal set (schema v8).

The dialog gained a Classic/PDN mode selector and a full PDN editor:
per-role supply/load tables built from the marker rectangles (or a
config's terminal set, which never pins mode or net), with Component
hints, per-terminal Layer scopes, Active checkboxes, comments, a
per-net row filter, resizable tables and a scrolling, screen-sized
dialog. Numbers accept SI suffixes (50m, 4.7k) everywhere.

fill_res_config.json fully specifies a run (classic or PDN) with
validation, comments, named side-by-side configs (the one called
default auto-loads), Load/Save buttons with an editable file name,
and saves that never drop anything drawn on the board.

347 tests, green on Python 3.13 and on the 3.9 macOS wheel stack.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
janik
2026-08-27 17:01:24 +07:00
co-authored by Claude Fable 5
parent 31ef356345
commit 26b1cfaa45
28 changed files with 7363 additions and 406 deletions
+27 -2
View File
@@ -1,6 +1,9 @@
"""All tunable constants. v1 has no GUI dialog: edit here, re-run.
"""All tunable constants; the dialog exposes the common ones per run.
A future version may read overrides from <project>/fill_res_config.json.
A <board dir>/fill_res_config.json (see configfile.py) can override the
run parameters, select physics constants and the marker layers, and in
PDN mode defines the supply/load terminals. Values here remain the
defaults when no config file is present.
"""
from __future__ import annotations # KiCad's macOS Python is 3.9: without
# this, `float | None` annotations are
@@ -79,8 +82,19 @@ TRACK_1D_FACTOR = 3.0 # traces narrower than this many grid cells
LAYER_HINT: str | None = None # e.g. "F.Cu" to disambiguate candidate fills
ELECTRODE_POS_LAYER = "User.1" # rectangles on this layer mark V+ contact parts
ELECTRODE_NEG_LAYER = "User.2" # rectangles on this layer mark V- contact parts
ELECTRODE_PDN_LAYER = "User.3" # PDN mode: rectangles referenced from the
# config file as "rect:NAME" live here, named
# by a text item placed inside them (role
# comes from the config entry, so one layer
# serves supplies and loads alike)
ALWAYS_REFILL = False # refill zones even if KiCad says they are filled
# --- Configuration file ---
CONFIG_FILENAME = "fill_res_config.json"
# searched next to the board file, after the
# board-specific "<stem>.fill_res_config.json"
# (several boards can share a directory)
# --- In-KiCad result overlays (EXPERIMENTAL) ---
PUSH_OVERLAYS = False # after solving, push the per-layer |J|
# heatmaps into the open board as unlocked
@@ -146,6 +160,17 @@ ADAPTIVE_CORRECTION_PASSES = 1 # deferred-correction re-solves fixing the
# cuts the raw ~0.5-2% low bias to <0.03%
# measured; 0 disables
# --- PDN mode ---
PDN_V_NOMINAL = 3.3 # default supply open-circuit voltage [V];
# per-supply v_oc and the config file's
# run.v_nominal override it. Only shifts the
# absolute-volt reporting reference - drops
# and currents are independent of it
PDN_R_OUT_EPS = 1e-12 # supplies with r_out_ohm at or below this
# become ideal (Dirichlet) contacts: the
# exact R_out -> 0 limit, avoiding a huge
# attachment conductance in the matrix
# --- Solver ---
CONTACT_MODEL = "uniform" # "uniform": conductor pressed on top injects
# orthogonally with uniform surface density