Skip to content

UnsignedChad/pdnkit-kicad

Repository files navigation

pdnkit-kicad

pdnkit (power integrity analysis) as a KiCad plugin. Pulls the live board from a running KiCad over the IPC API and opens the full pdnkit panel set on it: IR drop heat-maps, plane Z(f) with decaps, transient, IPC-2152 DRC, right-click probe-R. Also opens .kicad_pcb files directly for standalone use.

The physics, panels and file parser come from circuitcore, pinned by tag in CMakeLists.txt. This repo is the thin shell: an nng/protobuf client for KiCad's IPC API, a protobuf-to-board-model mapper, and a window.

Build (Debian/Ubuntu)

sudo apt install -y qt6-base-dev libqt6opengl6-dev libqt6openglwidgets6 \
    libeigen3-dev libspdlog-dev libsuitesparse-dev \
    libnng-dev libprotobuf-dev protobuf-compiler ninja-build cmake

cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build

First configure clones circuitcore at the pinned tag and builds just the libraries it needs.

Run

./build/pdnkit-kicad board.kicad_pcb     # standalone, from a file
./build/pdnkit-kicad                     # live board when launched by KiCad
./build/pdnkit-kicad --probe-kicad [f]   # headless: pull the live board,
                                         # print counts (vs file parse of f)

Install from KiCad's Plugin Manager

  1. Preferences > Plugins > tick "Enable KiCad API", restart KiCad.

  2. Plugin and Content Manager > Manage... > add repository:

    https://raw.githubusercontent.com/UnsignedChad/pdnkit-kicad/main/repo/repository.json

  3. Pick the new repository in the dropdown, install pdnkit, Apply Pending Changes.

  4. Open a board in pcbnew and hit the pdnkit toolbar button.

The Windows package bundles the Qt runtime (self-contained). The Linux package expects distro Qt6/Eigen/spdlog/nng/protobuf (the build deps below).

Install as a KiCad plugin (manual)

  1. KiCad 9+: Preferences > Plugins > tick "Enable KiCad API" (off by default), restart KiCad.
  2. scripts/install-plugin.sh copies the binary + plugin.json to ~/.local/share/kicad/9.0/plugins/pdnkit/.
  3. Open a board in pcbnew and hit the pdnkit toolbar button. The window opens with the live board loaded.

How it talks to KiCad

KiCad 9's IPC API: protobuf messages in ApiRequest/ApiResponse envelopes over an nng req0 socket. KiCad hands the socket path + auth token to the plugin via KICAD_API_SOCKET / KICAD_API_TOKEN. The proto definitions are vendored under third_party/kicad-proto/ from the KiCad 9.0.8 source tree and compiled at build time.

The mapper is validated by pulling the same board both ways: parsed from the file and fetched over IPC from a running pcbnew, then comparing (--probe-kicad <file>). Net, segment, via, zone, pad and component counts match exactly; stackup thickness agrees to the micrometer.

KiCad has no net-highlight API (neither 9 nor 10), so pushback is selection-based: KiCad > Select Net in pcbnew replaces pcbnew's selection with every copper item of the chosen net (tracks, arcs, vias, zones, pads). --probe-kicad exercises the same path headlessly and reads the selection back.

GPL-3.0-or-later.

About

pdnkit power integrity analysis as a KiCad IPC plugin

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors