Isai Olvera
Work / Kernel, 2019–2026

Hardware CI for a KiCad Migration

Kernel's circuit boards lived in Altium, on an SVN server reached over remote desktop. I moved them to KiCad and git. A migrated board only counts as done when it's provably the same board, so I built the checks that prove it and ran every board through them on every change.

Copper of a four-layer board drawn as fine outlines on black: top-layer traces and pads in orange, bottom-layer traces in faint blue, a dense grid of BGA vias near the centre and connector rows along the top and bottom edges.
The sync box base board, top copper (orange) over bottom copper (blue), drawn from its KiCad fabrication files. Designed in 2021 by Kernel's electrical team; migrated and verified by me.
RoleSet the equivalence standard; built the verification pipeline, CI and release tooling; imported and signed off each board
Scope29 boards in CI, 23 migrated from Altium
PeriodOct 20 – Dec 4, 2026
ToolsKiCad 10 · Python · GitHub Actions
The problem

Why the migration needed verification

About fifty production boards: headset electronics, flex circuits, test fixtures. Redrawing them was never an option. A board that has been built, tested and shipped carries years of fixes, and a redraw throws that history away.

KiCad can import an Altium project, but the import is a translation, and translations drop things without saying so. One missing connection among 245 nets is invisible in a schematic, and it costs a board spin to find.

The standard

A board built from the KiCad files must work and perform the same as one built from Altium. Pixel-for-pixel isn't the goal. Functional equivalence is:

  • 1
    Same circuit. Same parts, values, footprints and nets, pin for pin.
  • 2
    Same board. Same copper, solder mask, paste, drill and outline in the fabrication files.
  • 3
    Still the same after KiCad pours it. The next revision will refill every copper zone; the board must survive that with every connection intact.
The pipeline

Three gates between an Altium board and a KiCad release

Each board follows one route. The orange stations are gates: they pass, or every remaining difference is explained in the board's verification report before it moves on.

  1. Altium exportsNetlist, ODB++, Gerbers, drill, layout file
    me
  2. KiCad importLayers mapped in the fabrication stack order
    me
  3. Repair passesChannels, harnesses, ports, rules, mask, stackup, 3D models
    scripted
  4. Netlist gateEvery net, pin for pin
    gate 1
  5. Gerber XOREvery fab layer and every drill hit
    gate 2
  6. Refill checkKiCad re-pours; nothing lost
    gate 3
  7. Pull requestCI repeats the checks in a pinned KiCad container
    CI
  8. Tag → releaseFabrication and assembly package built from the tag
    CI
Gate 1 · the circuit

Gate 1: the netlist must match pin for pin

Altium's own netlist export is the reference. KiCad's netlist must hold the same parts, and every Altium net with two or more pins must be exactly one KiCad net holding exactly the same pins. Net names may differ; connections may not. The gate also fails if KiCad joins pins that Altium keeps apart, and it reports any value or footprint that changed.

Some projects reuse designators across repeated channel sheets, so their exported netlist can't be trusted as a reference. For those, the reference is rebuilt from the ODB++ fabrication data: the netlist of the board that was actually made.

The gate runs for every migrated board in CI, on every pull request that touches it.

Illustration of one net on a bus that ran through an Altium signal harness. Designators are generic.

Gate 2 · the fabrication files

Gerber XOR: subtract one board from the other

Gerbers and drill files are what the board house builds, so they get compared directly. Each layer from both tools is rasterized at 10–25 µm per pixel and aligned by fitting the drill hits (the most common hole-to-hole shift). Then the two images are XORed. Anything left over is measured in mm².

Differences narrower than 40 µm are rasterization noise and are ignored; every larger one must be explained. Drill files are compared hole by hole. Below is the real comparison for one board: drag across it to wipe between the two tools, and switch on the differences.

AltiumKiCad
copper (or mask, silk) in the fileonly in Altium's fileonly in KiCad's fileDifferences drawn enlarged so they show at this size.

Sync box base board (designed by Kernel's electrical team, 2021): 4 layers, 315 parts, 665 drill hits matched hole for hole. Rendered at 20 µm per pixel and shown at about 65 µm per pixel.

Gate 3 · the next revision

The board must survive a KiCad refill

The released Altium copper is kept as it was fabricated. But the next revision will be poured by KiCad, and the two tools pour differently. Altium clears an inner plane around a via's removed pad; KiCad clears it around the drilled hole, so its voids come out smaller and the copper creeps closer to vias of other nets.

A clearance rule per via size, taken from the Altium design rules, makes KiCad's voids match. CI then refills every zone in memory and requires zero unconnected items. A per-net copper comparison runs beside the XOR, because a net swap keeps exactly the same shape, and the XOR alone can't see it.

On the sync box board the refill keeps every connection and no net loses copper. KiCad adds 8.0 mm² of slivers on the top layer and 5.8 mm² on the bottom, in corners Altium's pour didn't reach. Pick "after refill" in the viewer above to see them.

A 0.45 mm via with a 0.2 mm hole passing through an inner plane of another net. Void radii as measured on the EEG acquisition board.

What the gates caught

Six things the import got wrong without saying so

None of these produced an error message in KiCad. Each one would have produced a bad board.

CI on every pull request

Every change is checked the same way

Every change is a branch and a pull request. CI works out which boards the change touched (all of them when shared libraries or CI itself changed) and checks each in a pinned KiCad container:

  • ERC, and DRC with schematic-to-board parity. Then a second DRC with every zone refilled, which must show 0 unconnected.
  • The board's netlist gate against its Altium reference.
  • Stackup and libraries. The layer stack must match a reviewed spec, and a fresh clone must open with every symbol, footprint and 3D model resolved and nothing installed.
  • Legacy DRC/ERC items as a baseline. Imported boards arrive with hundreds of legacy DRC/ERC items, accepted as fabricated. They're stored as keys without coordinates, and CI fails only on new ones. Item types whose wording KiCad varies from run to run are compared by count.

The first CI runs reported items the desktop didn't: the container lacked a TrueType font, and two KiCad builds printed the same wire length 100× apart. Normalizing the keys fixed it without loosening the check.

# pull request · check · sync box base board
$ ci check <board>
+ export netlist
+ ERC                         all severities
+ DRC + schematic parity      all severities
+ DRC, zones refilled         errors
Found 0 unconnected items
+ netlist gate <board>
nets: 218/218 Altium nets identical in KiCad (pin for pin)
parts: 315 common; value differs: 0; footprint name differs: 0
PASS
parity 0, unconnected 0
after zone refill: 0 unconnected items
baseline: 0 new DRC/ERC items        297 accepted
stackup check: OK
libs: 0 problems

Real output, with file names and paths removed.

Release rules

Tagging a release

A release is a tag of the form part/revN on the main branch. If the tag's revision doesn't match the revision in the board's own title block, the build stops.

CI then builds the Gerbers, drill, pick-and-place, BOM, assembler files, schematic PDF, STEP and ODB++, zips them and attaches them to a GitHub Release. A local build of the same package adds a coversheet with renders and the stackup, an interactive BOM, and a SHA-256 manifest tied to the git commit. It ends with a status report that says what's missing instead of shipping quietly.

145 release tags so far, most of them headset flex revisions sent to fabrication.

# release status report · sync box base board, Rev. 1
[OK  ] Source (KiCad files)
[OK  ] Checks: ERC, DRC + parity, zone refill, baseline
[OK  ] Gerbers
[OK  ] NC drill (plated / non-plated) + drill map
[OK  ] Pick and place
[OK  ] Assembler BOM + placement + Gerber zip
[OK  ] Interactive HTML BOM
[OK  ] STEP
[OK  ] ODB++
[OK  ] Schematic PDF
[OK  ] 3D renders
[OK  ] Coversheet PDF
[OK  ] Integrity (empty files, truncated PDFs, zip CRCs)

Real report, shortened.

Results · as of Dec 4, 2026

Migration results

29boards in CI
23migrated from Altium
1,289nets checked pin for pin, 0 differences
145release tags
71merged pull requests

Matched nets by board

Most of these boards were designed by others at Kernel; the migration and its verification were mine. Bar length is the board's multi-pin net count; every one matches its Altium reference. Copper, mask, paste, drill and outline are identical on each board, or each difference is explained in its report.

Boards under CI over time

Boards with at least one tagged revision, by date of first tag.

headset flex circuits (from Altium)rigid boards (from Altium)native KiCad boards

Three migrated boards were then rebuilt in KiCad with no design change, released from it, built and tested: the migration proven on real hardware, not just in files. The native KiCad boards include the two EEG test station boards I designed, covered in Flow2.x/EEG System Validation.