HW requirements

Requirement: Single source for hardware facts HW-001
status: Accepted
evidence: not evaluated
design_source: requirements/HW.md
links incoming: KRN-IRQ-029

Every peripheral instance, interrupt binding, clock setting, pin assignment, memory region, and flash partition shall originate in the hardware description.

Rationale: No hand-written board C for things the description knows (01 §6).

Status: Accepted 2026-10-07

Verification: Analysis: CI grep for register addresses and IRQ numbers in boards/ and soc/ C sources; review of generated outputs.

Trace: SPEC-014 §3 to §6; ADR-004

Normative source.

Requirement: Schema validation with named errors HW-002
status: Accepted
evidence: not evaluated
design_source: requirements/HW.md

The hardware model shall be validated against a published schema before generation; validation errors shall name the file and node.

Rationale: Authors fix descriptions, not generator stack traces.

Status: Accepted 2026-10-07

Verification: Generator tests with malformed inputs; the error message names file and node path.

Trace: SPEC-014 §1, §7

Normative source.

Requirement: Reproducible generated files HW-003
status: Accepted
evidence: not evaluated
design_source: requirements/HW.md

Generated files shall be reproducible and never edited by hand.

Rationale: BLD-004; drift between description and code is the failure this pipeline prevents.

Status: Accepted 2026-10-07

Verification: CI regenerates and diffs against the committed outputs.

Trace: SPEC-014 §9

Normative source.

Requirement: SVD and DeviceTree importers HW-004
status: Accepted
evidence: not evaluated
design_source: requirements/HW.md

Importers for CMSIS-SVD and DeviceTree source shall exist to bootstrap SoC and board descriptions; the SVD importer builds on EmbCC’s embsvd parser (09 §9).

Rationale: Authors curate rather than transcribe.

Status: Accepted 2026-10-07

Verification: Importer tests on the STM32F407 SVD and a Zephyr board DTS; the drafts validate and carry provenance.

Trace: SPEC-014 §8

Normative source.

Requirement: Normalized JSON export HW-005
status: Accepted
evidence: not evaluated
design_source: requirements/HW.md

The normalized model shall be exported in a stable JSON form for tooling.

Rationale: EmbStudio, EmbDebug, the HIL runner, and the harness consume one artifact and never parse YAML.

Status: Accepted 2026-10-07

Verification: Schema for hw.json; consumer tests.

Trace: SPEC-014 §6, §9

Normative source.

Requirement: Two linker outputs from one region model HW-006
status: Accepted
evidence: not evaluated
design_source: requirements/HW.md

From the same region model, the generator shall emit both a GNU ld linker script and an embld option set (-Ttext, -Tdata, --rom-limit); the two outputs shall be tested for agreement.

Rationale: Preserve a common layout with the legacy AVR option-set path. EmbCC now supports AVR scripts (09 §7, reviewed 2026-10-14); the existing two-output contract is retained, not justified by a current compiler limitation. Removing that compatibility output requires a separate reviewed amendment; the generator remains unimplemented.

Status: Accepted 2026-10-07

Verification: Generator test comparing the memory maps produced by both outputs for the Uno board.

Trace: SPEC-014 §6; SPEC-012 §8

Normative source.

Requirement: Three description kinds and common conventions HW-007
status: Accepted
evidence: not evaluated
design_source: requirements/HW.md

Descriptions shall be YAML 1.2 files of kind soc, board, or system with a schema_version, validated by JSON Schema 2020-12, supporting unit suffixes, cross-file references, extends inheritance, provenance, curated marks, and doc text.

Rationale: One grammar for every hardware fact; DeviceTree’s good ideas without its macro layer (R-002 §1).

Status: Accepted 2026-10-07

Verification: Schema files exist for the three kinds; conformance of the shipped descriptions.

Trace: SPEC-014 §1, §2

Normative source.

Requirement: SoC and board content HW-008
status: Accepted
evidence: not evaluated
design_source: requirements/HW.md

A SoC description shall carry arch, cpu, memory, interrupts, and peripherals (clocks, DMA, flash, power, errata, debug optional) and shall reference a port manifest; a board description shall carry the SoC reference, oscillators, pins, devices, console, flash partitions, LEDs, buttons, probe hints, and defaults.

Rationale: SPEC-014 §3, §4 fix what the generator can rely on.

Status: Accepted 2026-10-07

Verification: Schema required fields; the STM32F407, RP2350, and ATmega328P descriptions validate.

Trace: SPEC-014 §3, §4

Normative source.

Requirement: System description as the static source HW-009
status: Accepted
evidence: not evaluated
design_source: requirements/HW.md

The system description shall declare the profile, configuration overrides, partitions, kernel-partition threads and objects, ceiling mutexes with users, shares, trace and log configuration, and images; the generator shall derive kstore sizes, capability tables, ceilings, and init ordering from it.

Rationale: SPEC-009 §4.1, §5.2; SPEC-010 §2; SPEC-005 §3.4.

Status: Accepted 2026-10-07

Verification: Generator tests for a two-partition system; the isolated reference configuration is one.

Trace: SPEC-014 §5

Normative source.

Requirement: Generated outputs HW-010
status: Accepted
evidence: not evaluated
design_source: requirements/HW.md

The generator shall emit hw_config.h, soc_devices.c, soc_clocks.c, board_pins.c, regions.ld and embld.opts, partitions.c, caps_init.c, ceilings.h, init_order.c, Kconfig.board and Kconfig.system, board.md, hw.json, build_report.md, and the CTF trace metadata, each as SPEC-014 §6 describes.

Rationale: The complete list is what downstream specifications depend on.

Status: Accepted 2026-10-07

Verification: Generator golden-file tests per output.

Trace: SPEC-014 §6

Normative source.

Requirement: Semantic validation HW-011
status: Accepted
evidence: not evaluated
design_source: requirements/HW.md

The generator shall fail the build, naming file and node, on unresolved references, duplicate names, overlapping or misaligned regions or partitions, independently writable flash partitions sharing erase units or violating write/update alignment, duplicate or out-of-range interrupts, pin conflicts, clock cycles or bus overspeed, dependency cycles, partition hardware constraint violations, undeclared ceiling users, port manifest mismatches, inapplicable errata, and uncurated nodes under the safety attribute.

Rationale: Every rule here was a runtime bug somewhere else.

Status: Accepted 2026-10-07

Verification: One negative generator test per rule.

Trace: SPEC-014 §7

Normative source.

Requirement: Importers produce drafts, never overwrites HW-012
status: Accepted
evidence: not evaluated
design_source: requirements/HW.md

Importers shall produce drafts with imported_from provenance and todo markers; re-import shall produce a diff for the author and shall never overwrite curated nodes.

Rationale: Curation is the value; tooling must not destroy it.

Status: Accepted 2026-10-07

Verification: Importer tests: re-import after curation leaves curated nodes intact and reports differences.

Trace: SPEC-014 §8

Normative source.

Requirement: Determinism and stamps HW-013
status: Accepted
evidence: not evaluated
design_source: requirements/HW.md

Generated outputs shall be sorted, free of timestamps, and stamped with the generator version, schema version, and input hashes; hw.json shall carry the same stamps.

Rationale: HW-003 made checkable.

Status: Accepted 2026-10-07

Verification: Two generator runs produce identical outputs; stamp fields present.

Trace: SPEC-014 §9

Normative source.

Requirement: Schema versioning and migration HW-014
status: Accepted
evidence: not evaluated
design_source: requirements/HW.md

Schema v0 is unstable until its own stable release and ships a migration tool for breaking changes; from that release the schema shall follow the API versioning policy.

Rationale: Descriptions are long-lived assets of users.

Status: Accepted 2026-10-07

Verification: Migration test on a v0 fixture at each breaking change.

Trace: SPEC-014 §10; SPEC-001 §11

Normative source.

Requirement: Benchmark and tooling metadata HW-015
status: Accepted
evidence: not evaluated
design_source: requirements/HW.md

hw.json shall provide the board, SoC revision, clock, and timer-source fields the benchmark metadata record of 05 §4.4 requires, and the probe hints the HIL runner needs.

Rationale: One source for the numbers that make measurements comparable (R-003 §6).

Status: Accepted 2026-10-07

Verification: Harness metadata test reads them from hw.json.

Trace: SPEC-014 §4, §6; TEST-012

Normative source.