Skip to content

Fix size mismatch and tag typo in register type merging - #117

Open
ThyMYthOS wants to merge 1 commit into
AdaCore:masterfrom
ThyMYthOS:size-mismatch
Open

ThyMYthOS wants to merge 1 commit into
AdaCore:masterfrom
ThyMYthOS:size-mismatch

Conversation

@ThyMYthOS

Copy link
Copy Markdown

Similar_Type decides two registers can share one generated Ada type by comparing field count, Dim, and field equality, but never compared Reg_Properties.Size. Equal, right above it, already does. Registers whose names share a stem after Common_Prefix strips trailing digits (e.g. FLUSH64/FLUSH32) could merge into one type despite different sizes, producing a register typed narrower or wider than its real width. Add the missing size check, matching Equal and placed next to the existing Dim check.

Also fix "modifiedWriteValue" to "modifiedWriteValues", matching the actual CMSIS-SVD tag and descriptors-field.adb's spelling. The typo silently dropped every register-level <modifiedWriteValues> element into the catch-all branch instead of recording it.

Similar_Type decides two registers can share one generated Ada
type by comparing field count, Dim, and field equality, but never
compared Reg_Properties.Size. Equal, right above it, already does.
Registers whose names share a stem after Common_Prefix strips
trailing digits (e.g. FLUSH64/FLUSH32) could merge into one type
despite different sizes, producing a register typed narrower or
wider than its real width. Add the missing size check, matching
Equal and placed next to the existing Dim check.

Also fix "modifiedWriteValue" to "modifiedWriteValues", matching
the actual CMSIS-SVD tag and descriptors-field.adb's spelling.
The typo silently dropped every register-level
<modifiedWriteValues> element into the catch-all branch instead
of recording it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@CLAassistant

CLAassistant commented Oct 6, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

2 participants