Check VLEN against the minimum VRF address stride - #484
Open
om-mahesh wants to merge 1 commit into
Open
Conversation
The vector-register address calculation uses vlenb / NrLanes / 8 as the per-register stride. If VLEN is smaller than 64 * NrLanes, this integer expression becomes zero and all architectural vector registers map to the same VRF address. For example, VLEN=128 with four lanes currently passes the existing VLEN configuration checks and reports vlenb=16, but its vector-register stride is zero. Add a configuration check requiring VLEN >= 64 * NrLanes so this invalid configuration is diagnosed explicitly.
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
Add a configuration check for VLEN/NrLanes combinations that produce a zero vector-register address stride.
Ara's vector-register addressing uses
vaddr = vid * (vlenb / NrLanes / 8)withvlenb = VLEN / 8, so the per-register stride isVLEN / (64 * NrLanes)and must be non-zero.For example
VLEN=128, NrLanes=4currently satisfies the existing VLEN checks and reportsvlenb = 16, but16 / 4 / 8 = 0, so all architectural vector registers map to the same VRF address. Reproduced by writing distinct values intov0, v1, v2, v3, v8, v16, v31before storing any of them: all seven read back the value written last (v31). Elaboration is clean andvlenbreads correctly, so nothing currently reports the problem.The check requires
VLEN >= 64 * NrLanesso the unsupported configuration is diagnosed explicitly. Consistent with the neighbouring parameter checks this uses$error; note Ara's Verilator flow passes-Wno-fatal, so like the existing checks it emits a diagnostic rather than halting the build.Boundary checks