lowRISC / lowRISC/opentitan

[memutil] Allow compilation with memories > Width

Open Beginner friendly
#2,517 2 comments 0 reactions 0 assignees View on GitHub
Component:DV Earlgrey-PROD Triaged Type:Enhancement
Dominant language
SystemVerilog
Stars
3.6k
Forks
1.1k
Avg merge
2d 22h
Merged PRs (30d)
141

Description

If memories are larger than Width bit Verilator fails to compile the design
with (example error message for Width == 128):

`%Error: prim_util_memload.sv:44:23: Extracting 256 bits from only
128 bit number`.

The expected behavior is to return `0` (false) in the DPI call for memories larger than Width, but still allow compilation.

We probably need a localparam "WidthMax" which is used in the part-select `mem[index] = val[WidthMax-1:0];`.

Contributor guide

Open the contributing guide

Research direction

Start in prim_util_memload.sv at the reported part-select around line 44 and inspect the DPI memory-load path. Confirm that memories wider than Width compile successfully and that the DPI call returns false for them; use the issue's example error and expected behavior to verify completion.

Written by the indexing model from the issue text.

Assessment

Domain
embedded-iot
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.