Repository navigation
Fix inverted SRAM bank mapping in dmem read MUX - #4046
Merged
eder-matheus merged 1 commit intoMar 25, 2026
Merged
eder-matheus merged 1 commit into
eder-matheus merged 1 commit into
Conversation
The sel_mem case arms were reversed, causing every memory read to return data from the wrong SRAM bank. Signed-off-by: Ashnaa Seth <ashnaaseth2325@gmail.com> Signed-off-by: ashnaaseth2325-oss <ashnaaseth2325@gmail.com>
ashnaaseth2325-oss
force-pushed
the
fix/dmem-read-mux-inversion
branch
from
March 24, 2026 13:53
a86ded3 to
035008c
Compare
Contributor
Author
|
Hi @eder-matheus @maliberty, |
maliberty
approved these changes
Mar 24, 2026
Member
|
I'll assume you got this right as it doesn't matter much to OR in any case. |
Contributor
Author
|
Hi @maliberty, |
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.
1. SUMMARY
This PR fixes an incorrect read data selection in the
dmemmodule where the output MUX returned data from the wrong SRAM bank. The issue affectsflow/designs/src/riscv32i/dmem.v(lines 60–67), causing all memory reads to be inconsistent with the corresponding write bank.2. FIX
3. VERIFICATION
Run the existing RISC-V testbench and write a known value (e.g.,
0xDEADBEEF) to an address in a specific memory bank (e.g.,0x8000_0000fordmem3), then read it back. Before the fix, the read returns data from the wrong bank; after the fix, it correctly returns the written value. Repeat across other address regions to confirm all banks map correctly.