Skip to content

silicon: NUCLEO-G474RE anchor protocol scaffolding (board-prep)#37

Open
avrabe wants to merge 1 commit intomainfrom
feat/silicon-anchor-nucleo-g474re
Open

silicon: NUCLEO-G474RE anchor protocol scaffolding (board-prep)#37
avrabe wants to merge 1 commit intomainfrom
feat/silicon-anchor-nucleo-g474re

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented May 3, 2026

Summary

Scaffolding for the silicon-anchor protocol so that when the
NUCLEO-G474RE arrives this week, taking a capture is a single
`bash silicon/capture.sh --board nucleo_g474re --variant baseline --sweep long`
away. No firmware code touched; no CI changes. Manual-flow only,
recorded directly into the repo.

Companion to PR #36 (overhead compensation + SCOPE.md). Composes
cleanly on top — when #36 lands, silicon captures will already
emit the `overhead_cycles,` metadata and be apples-to-apples
with the post-compensation Renode CI numbers.

Architecture

  • CI = Renode, deterministic, parallel-safe, every PR.
  • Silicon = manual, periodic, single board shared across the
    team, recorded as immutable evidence in `silicon/runs//`.
    Citeable from any blog post via stable git URL.

The relationship `silicon_median / renode_median` per RPM step is
what the anchor establishes. Once consistent across multiple
captures it can be cited as the Renode-silicon multiplier for that
bench/board combination.

What's in this PR

Path What
`silicon/README.md` Protocol doc — why we anchor, the recorded-run-in-git convention, capture procedure for NUCLEO-G474RE, comparison workflow against Renode CI, anchor cadence, don't-do-this list (overwriting dated dirs, mixing pre/post-overhead-compensation captures, claiming WCET)
`silicon/capture.sh` Build + flash + capture + tag + manifest, one invocation. Auto-detects the USB serial port on macOS / Linux. Refuses to overwrite an existing dated dir.
`silicon/capture.py` Cross-platform pyserial UART capture. Reads until `=== END ===` or wall-clock timeout.
`silicon/boards/nucleo_g474re/` Board overlay (currently empty — Zephyr defaults are right) + board notes (clock, UART, programming)
`silicon/runs/.gitkeep` Placeholder; first dated capture goes here
`README.md` Methodology section now points at `silicon/`

Each captured run will commit:

  • `output.csv` — raw firmware UART
  • `events.csv` — tagged through `tag_events.py`
  • `firmware.elf` + `firmware.elf.sha256`
  • `manifest.txt` — board, MCU, gale_sha, rustc, west, zephyr_sha, ELF sha256, capture timestamp, port, timeout

CSV row counts are small (~50–500 KB per long-sweep run). At one
capture per board per major bench-relevant commit, repo growth is
modest.

Test plan

  • `bash -n capture.sh` syntax-clean
  • `python3 -c 'import ast; ast.parse(open(...))'` clean
  • First end-to-end capture on the NUCLEO-G474RE when it
    arrives — that's the validation that matters; this PR is
    preparation only.

Out of scope

  • ESP32-C3-DevKit-RUST-1 board: separate work, will need its own
    Renode equivalent built first (RISC-V port of engine_control)
    before silicon makes sense. Tracked separately.
  • Analyzer `--silicon-anchor` flag for single-call Renode-vs-silicon
    side-by-side rendering: deferred until the first capture exists
    to test against.

🤖 Generated with Claude Code

CI = Renode (deterministic, parallel-safe). Silicon captures are
manual, periodic, and shared across one board per architecture.
Recorded captures live in the repo as immutable evidence, citeable
from any blog post via stable git URLs. This commit is the
scaffolding — protocol doc, build wrapper, board overlay, capture
script — that makes a silicon capture a flash-and-go operation
the moment hardware is in hand.

Files:

  silicon/README.md
    Protocol: why we silicon-anchor, the recorded-run-in-git
    convention, the capture procedure for the NUCLEO-G474RE, the
    comparison workflow against Renode CI, anchor cadence, and
    the don't-do-this list (overwriting, mixing pre/post-overhead-
    compensation captures, claiming WCET).

  silicon/capture.sh
    Build + flash + capture + tag + manifest, in one invocation.
    --board nucleo_g474re --variant {baseline,gale} [--sweep ...].
    Auto-detects the serial port on macOS / Linux. Refuses to
    overwrite an existing dated dir.

  silicon/capture.py
    Cross-platform pyserial UART capture. Reads until '=== END ===',
    times out at the wall clock, writes the raw stream to a file.

  silicon/boards/nucleo_g474re/{README.md,prj.conf}
    Board notes + (currently empty) Kconfig overlay. Cortex-M4F + FPU
    @ 170 MHz, ST-Link/V3E with VCP at 115200, DWT_CYCCNT works
    identically to stm32f4_disco. Closest production-shape silicon
    to our existing Renode target.

  silicon/runs/.gitkeep
    Placeholder; first dated capture goes in here.

Each captured run will commit:
  - output.csv (raw firmware UART)
  - events.csv (tagged through tag_events.py)
  - firmware.elf + firmware.elf.sha256
  - manifest.txt (board, MCU, gale_sha, rustc, west, zephyr_sha,
    ELF sha256, capture timestamp, port, timeout)

Manual flow only — no CI changes. README updated to point at
silicon/ from the methodology section.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant