Slice board formats

formats.yaml holds every Slice fact drawn on the board: the outline, the bus row, the mounting holes, the zones the case imposes, and where each MCU’s core parts sit. Each value names its source in a comment. scripts/validate_board.py checks a board against it.

Frame

Millimetres, in the board’s own frame as a designer sees it in KiCad, as in Slice Interface 1: the bus edge on the left, x from the bus edge toward the front edge, y up from the bottom edge (the edge the MCU’s USB faces).

The check puts a board in this frame from its Edge.Cuts outline: x from the outline’s left edge, y from its bottom edge. Where the board sits on KiCad’s page does not matter. Part positions are footprint origins, rot is KiCad’s footprint rotation, and side is F or B.

One home per fact

A fact drawn in the board frame is written here once. bread-infra reads nothing from other repositories. bread-mechanical will read this file at a pinned bread-infra tag, as slices pin bread-infra’s workflows, and keep only what the case and backplane share in its slot interface. Where the case puts a keep-out on the board (the bus window, the bosses, the front opening), the number lives here.

Versions

A format’s name carries its version. slice-S-v0 and slice-L-v0 are the SI1 boards as built today, taken from the public templates. A redesigned core or a changed outline is a new pattern, such as slice-S-v1, and a slice moves to it by changing hardware.mounting.pattern in its slice.yaml. Nothing changes under a board that has not moved.

What the check looks at

The check reads hardware.mounting.pattern and hardware.mcu.form_factor from slice.yaml, and the one .kicad_pcb in hardware/.

  • Outline, corner radius, holes and bus row, against the format, within its tolerance. The bus row is the centroid of the bus socket’s pads.
  • Core: each part of the MCU’s core, found by reference (a list accepts any of them) and, where two match, the one with the expected footprint. It must be present, have that footprint, and sit at its position, rotation and side within the core’s tolerance. A finding gives the offset.
  • Zones: a keep-out zone may hold only what its allow lets in (bus, the bus socket). A zone with holds is where those parts go: a matching part outside it is a finding. A part’s extent is its courtyard, or its pads’ bounding box where it has no courtyard; the finding says which. A part occupies its own side, and both sides if it has plated through-hole pads. Mounting-hole footprints are left out.
  • Hole keep-out: no part within holes.keepout_r of a hole centre.

Findings are named so an exception can match them: outline, corner_r, bus, holes, holes.keepout:R3, core.led, zones.bus_window:D1.

A board with pattern: null, or a pattern with no entry here, is skipped with a message. A board whose MCU has no core in its format is checked without the core, and says so.

Exceptions

Where a board knowingly differs from its format, its slice.yaml says so (schema 2.1, manifest spec):

hardware:
  exceptions:
    - item: core.led
      reason: LED moved beside the light pipe
      retire_by: slice-S-v1
      issue: 12

item matches a finding of that name, and the findings under it: core covers core.led, and zones.front_io covers zones.front_io:J2. A matched finding is reported as excepted, with its reason, and does not fail. An exception that matches no finding is itself a finding, so a fixed board drops its exception.

Modes

python3 scripts/validate_board.py <repo> --master-lib <KiCad-Master-Lib>                    # report
python3 scripts/validate_board.py <repo> --master-lib <KiCad-Master-Lib> --format enforce   # enforce
  • report (the default) prints the findings and never fails, so a slice that has not met its format keeps a green CI.
  • enforce fails on every finding that is not excepted. The templates run it; a slice moves to it once it meets its format.

A zone marked enforced: false is reported in both modes and never fails. In v0 that is front_io: connectors outside the front opening are listed, not failed, until the opening’s width is settled on the real case.