lowRISC / lowRISC/mocha

`prim_ram_1p.sv` can behave inconsistently for synthesis/simulation

Open
#694 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
SystemVerilog
Stars
38
Forks
21
Avg merge
2d 23h
Merged PRs (30d)
14

Description

prim_ram_1p.sv describes one-port RAM primitive.

The generic implementation (prim_generic/rtl/prim_ram_1p.sv) supports write masks of arbitrary granularity

The Xilinx implementation has a generate if/else constructs that switches between two possible implementation
The current configuration uses the same implementation as the generic which is fine
If the configuration is changed it switches to an implementation that does not support write masks

This strikes me as a major verification hazard - a primitive should never have different behaviour in simulation vs. synthesis.

This has already been fixed upstream in OpenTitan and the fix should be vendored in

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare the Xilinx prim_ram_1p.sv implementation with prim_generic/rtl/prim_ram_1p.sv, focusing on the generate branches and write-mask behavior. Check the corresponding upstream OpenTitan fix, then verify that the vendored implementation behaves consistently for synthesis and simulation under the available configurations.

Written by the indexing model from the issue text.

Assessment

Domain
embedded-iot
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.