Repository navigation
uncore: size local memories from the range mask, not RANGE/8 words - #1987
Open
davidharrishmc wants to merge 1 commit into
Open
davidharrishmc wants to merge 1 commit into
davidharrishmc wants to merge 1 commit into
Conversation
UNCORE_RAM_RANGE and the other *_RANGE parameters are masks (size-1), but ram_ahb sized its backing array as RANGE/8 entries of XLEN bits. On RV32 that backs only 64 MiB of the 128 MiB RAM region and the 24-bit index silently aliases 0x84000000+ onto 0x80000000+ on writeback; on RV64 the region's top doubleword is out of the array. rom_ahb, dtim and irom have the same off-by-one shape. Size them all as (RANGE+1)/(XLEN/8) entries. Add tests/coverage/ramtop.S and tests/coverage32/ramtop32.S (coverage32 march gains Zicbom), which force lines through the RAM with cbo.flush and fail on main. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
The *_RANGE parameters are masks (size-1), but ram_ahb sized its backing array as RANGE/8 entries of XLEN bits. On RV32 that backs only 64 MiB of the 128 MiB RAM region and the 24-bit index silently aliases 0x84000000+ onto 0x80000000+ on writeback; on RV64 the region's top doubleword is out of the array. rom_ahb, dtim and irom have the same off-by-one, so all four now size as (RANGE+1)/(XLEN/8) entries. The new tests/coverage/ramtop.S and tests/coverage32/ramtop32.S force lines through the RAM with cbo.flush (coverage32 march gains Zicbom) and fail on main.
🤖 Generated with Claude Code