[rdlexporter] Fix register export on systemrdl-compiler 1.32.2 - #19
Merged
engdoreis merged 2 commits intoSep 8, 2026
Merged
Conversation
`RdlExporter._arrays` tested `component.is_array`, but that attribute was
removed from the raw *Component* layer in systemrdl-compiler 1.32.2 by
commit 25748b96c227 ("Remove .is_array from internal Component layer as it
can be trivially derived"). The change is not called out in the 1.32.2
release notes, but its docstring documented `is_array` as simply meaning
"``array_dimensions`` and ``array_stride`` are valid".
Up to 1.32.1 the exporter relied on `is_array` being present on the
Component objects it walks (`rdlc.root.comp_defs`); on 1.32.2, exporting any
block with registers raises:
AttributeError: 'Reg' object has no attribute 'is_array'
The dependency is declared as `systemrdl-compiler~=1.32.1`, so a fresh
resolve already picks up the broken 1.32.2.
Derive array-ness from `array_dimensions` instead, exactly as upstream
intends: it is None for non-array components.
Signed-off-by: Harry Callahan <hcallahan@lowrisc.org>
Add `test_cli_arrays_from_file`, a focused round-trip snapshot covering both branches of `RdlExporter._arrays`: a plain register (`CTRL`) and a register array (`DATA[4]`). This guards the `is_array` regression fixed in the previous commit, which is functional across old and new versions of systemrdl-compiler. Signed-off-by: Harry Callahan <hcallahan@lowrisc.org>
hcallahan-lowrisc
force-pushed
the
fix-reg-array-is-array-1.32.2
branch
from
September 8, 2026 10:59
1c5314b to
2041398
Compare
engdoreis
approved these changes
Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rdlexporterfails to export any block containing registers when resolved against systemrdl-compiler 1.32.2:RdlExporter._arraystestedcomponent.is_array, but that attribute was removed from the raw Component layer in systemrdl-compiler 1.32.2 by25748b96c227("Remove .is_array from internal Component layer as it can be trivially derived"). The change is not mentioned in the 1.32.2 release notes, but its own docstring definedis_arrayas simply meaning "array_dimensionsandarray_strideare valid". Up to 1.32.1 the exporter relied onis_arraybeing present on the Component objects it walks (rdlc.root.comp_defs).Because the dependency is declared
systemrdl-compiler~=1.32.1, a fresh resolve already picks up the broken 1.32.2 — e.g. the OpenTitan reggen integration that consumes this package.Changes
component.array_dimensions(present with identical semantics in every supported systemrdl version;Nonefor non-array components), exactly as upstream intends.test_cli_arrays_from_file— a round-trip snapshot covering both branches of_arrays(a plain registerCTRLand a register arrayDATA[4]).The dependency floor is intentionally left at
systemrdl-compiler~=1.32.1: the fix works identically on 1.32.1 and 1.32.2, and raising the floor would break other consumers in the workspace that must stay on the older release. Nopyproject.tomloruv.lockchanges are included.Verification
Against systemrdl-compiler 1.32.2:
is_arrayAttributeError.rdlexporter4 passed,rdl2ot5 passed,ruffclean,reuse lintcompliant.This PR includes AI-assisted content generated with Claude Code. All changes have been reviewed and are the responsibility of the listed author(s).