Derive the page and summary context with .pick().extend() on the report
schema, as #16346 does for the other firmware views, instead of
destructuring report fields.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
A 4 KiB page can now hold SVD-covered addresses classified svd_peripheral
and uncovered ones classified by bus convention. Page groups were keyed by
address alone and took their region kind and basis from the first access,
so a region_kind group filter depended on access order and could hide
matching accesses.
Page identities now include the region kind, in both the grouping index
and the literal-pool pre-allocation measurement, so each kind forms its own
group with its own basis.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
The count-mismatch test added a removed field, so the strict report schema
rejected it before the count check ran. It now changes counts.loads on a
schema-valid report, with the unchanged report as a control.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
The firmware-mmio view accepted region_kind, peripheral_name and access_kind
on every collection, but ignored all of them for anomalies and access_kind
for peripheral_groups, while echoing them in the result view. It now
refuses those combinations with an input issue on the filter field.
Tests cover the compact top-16 summary against complete group pages,
matching and non-matching filters, filtered pagination, and the refusals.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
When two equal-width CMSIS-SVD peripherals covered a loaded constant, the
literal-pool classifier treated it as outside the profile. For arm-a32 it
became `other`, and the default mmio_only filter dropped the access, even
though the supplied SVD declares that address as peripheral space.
findSvdMatch now reports ambiguous coverage separately from no coverage.
Such a constant is classified as svd_peripheral, or as the Cortex-M PPB on
arm-thumb, with no peripheral name. Each such address adds one anomaly,
charged in the representation measurement, matching how split-immediate
architectures report competing peripherals.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
The literal-pool representation pass recounted a peripheral name's UTF-8
bytes and built an `svd:` group key from it for every access, and grouping
built that key again per access. With 16,384 loads of one 1 MiB name, a
default call copied about 16 GiB of text and took about 20 s to refuse.
Grouping now keys an index on the identity itself (peripheral name, block
name or page), so a name is hashed once per string. The measurement pass
caches each name's byte length. The same refusal now takes about 0.4 s.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
Merge the literal-pool and split-immediate guides into one firmware MMIO
guide covering both instruction tables, the shared access rows and groups,
attribution basis, budgets and the firmware-mmio view. Update the
documentation index, firmware overview and skill reference.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
inspect_firmware_literal_pools and inspect_firmware_mmio_synthesis answered
the same question and differed only in the instruction idiom they decode.
One tool, inspect_firmware_mmio, now takes a single architecture vocabulary
across all nine ISAs and dispatches to the literal-pool or split-immediate
decoder.
Both decoders write the same report:
- accesses rows: instruction, address register, access kind and width,
address and MIPS physical address, region kind, architectural block, and
CMSIS-SVD peripheral and register facts;
- a source object with the decoder's own facts: pool slot and disassembly,
or pattern and high instruction;
- decoder facts on the report.
firmwareMmioGroups.ts owns grouping MMIO accesses by SVD peripheral,
architectural block or 4 KiB page. mmioAttributionBasis owns the group
basis. The retained view kind is firmware-mmio, with collections accesses,
peripheral_groups and anomalies, and its summary lists the top 16 groups as
compact rows.
max_references and max_syntheses are removed, since max_representation_bytes
already bounds the rows they counted. The literal-pool pre-allocation
measurement now includes an upper bound for each group, so its refusal
reports the exact required bytes. max_scan_bytes defaults to its 16 MiB
maximum, so one call covers a whole application image. mmio_only, default
true, now also drops literal-pool constants that are not MMIO;
counts.candidate_accesses still counts every decoded access.
BREAKING CHANGE: inspect_firmware_literal_pools and
inspect_firmware_mmio_synthesis (CLI inspect-firmware-literal-pools and
inspect-firmware-mmio-synthesis) and the retained view kinds
firmware-literal-pools and firmware-mmio-synthesis are replaced by
inspect_firmware_mmio (inspect-firmware-mmio) and view kind firmware-mmio.
isa becomes architecture, max_svd_nodes becomes max_svd_xml_nodes, and
max_references and max_syntheses are removed. Neither old tool has been
released.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
An address claimed by N overlapping CMSIS-SVD peripherals produced an
anomaly that listed all N names. With 4,000 overlapping peripherals each
such anomaly was about 20 KB, so 1,024 ambiguous addresses built a report
over the 16 MiB representation budget and the call was refused.
Each anomaly now names the first 8 candidates in name order and counts the
rest, and is charged at its actual size.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>