Fix width mismatches in riscv_pkg and drac_pkg#27
Open
Shivam-Shukla0 wants to merge 1 commit into
Open
Conversation
MSTATUS32_WPRI was declared [64:0] instead of [63:0]. DCACHE_BUS_WIDTH was a 10-bit parameter, propagating into width warnings on divisions. VMAXELEM and DCACHE_MAXELEM are 7-bit parameters initialized from 32-bit divisions, now cast explicitly. The DracCfg memory-map literals were 40-bit constants assigned to PHY_ADDR_SIZE-wide fields inside NrMaxRules-sized arrays; they are now explicitly sized and padded. All configuration values are unchanged; the previously implicit truncations/extensions are now explicit, removing the package warnings that appeared in the lint output of every file.
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.
Follow-up to the lint work in #22: width mismatches in the shared packages showed up in the lint output of every single file, hiding real per-file warnings.
riscv_pkg.sv:MSTATUS32_WPRIwas[64:0](65 bits) — typo, every neighbouring constant is[63:0].drac_pkg.sv:DCACHE_BUS_WIDTHwas declared as a 10-bit literal (10'd512), propagating width warnings into every expression using it.drac_pkg.sv:VMAXELEM/DCACHE_MAXELEMare 7-bit params initialized from 32-bit divisions — now cast explicitly.drac_pkg.sv: theDracCfgmemory-map literals were 40-bit constants assigned toPHY_ADDR_SIZE-wide fields insideNrMaxRules-sized arrays — now explicitly sized and padded. Notably,InitMappedEnd's40'h3fffffffffneeds 38 bits and was silently truncating atPHY_ADDR_SIZE=32; the truncation is now explicit.Configuration values are unchanged in every case. Verified on Verilator 5.048 and 5.020: the package warnings no longer appear when linting any RTL file.
Fixes #26