Skip to content

[rtl] RRAM Earlgrey integration#30420

Open
gautschimi wants to merge 9 commits into
lowRISC:masterfrom
gautschimi:rram_integration
Open

[rtl] RRAM Earlgrey integration#30420
gautschimi wants to merge 9 commits into
lowRISC:masterfrom
gautschimi:rram_integration

Conversation

@gautschimi

@gautschimi gautschimi commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

As per RFC , Earlgrey will be extended with support for RRAM based non-volatile memory.

This 1st integration PR adds the moduls rram_ctrl and rram_macro to earlgrey.

A few remarks:

  • flash controller is not yet removed
  • execution is still from flash_ctrl
  • RRAM size is temporary reduced to 1MB to fit on the FPGA (This will be reverted once the flash_ctrl is removed)

This PR is based on #30412
The diff of all commits of this PR can be found here:
https://github.com/lowRISC/opentitan/pull/30420/changes/4ea162e0f59e2650a3d141ead1929208ccf48103..ebb62ca9760b9684d496dcbe52d1f1fb70ca96e7

The last 3 commits are relevant for this PR:

  1. addition of rram_ctrl and rram_macro
  2. all autogen files
  3. align countermeasures in RTL with sec_cm_testplan to to make CI happy
  4. Temporary size reduction of the RRAM to 1MB. This commit was intended to support bitstream build on CW310, but it introduces lint issues.

@gautschimi
gautschimi requested a review from glaserf June 16, 2026 11:53
@gautschimi gautschimi self-assigned this Jun 16, 2026
@gautschimi
gautschimi force-pushed the rram_integration branch 4 times, most recently from 0a4da3b to ebb62ca Compare June 18, 2026 08:11

@glaserf glaserf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gautschimi for the PR. I have reviewed the last three commits and have only added a few minor comments, see below. This LGTM.

Comment thread hw/top_earlgrey/data/xbar_main.hjson
Comment on lines +2097 to +2101
.rma_req_i(lc_ctrl_lc_nvm_rma_req),
.rma_ack_o(),
.rma_seed_i(lc_ctrl_lc_nvm_rma_seed),
.pwrmgr_o(),
.keymgr_o(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess these open ones will be connected in future PRs? Does the rma protocol work without the ack connected?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will get connected in a future PR. In this PR the RMA is still connected to the flash

.rram_macro_o(rram_ctrl_rram_macro_rsp),
.lc_nvm_debug_en_i(lc_ctrl_lc_nvm_debug_en),
.obs_ctrl_i(ast_obs_ctrl),
.rram_obs_o(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this to be connected to AST?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is empty at the moment. But it will be used in the future and connected to the AST.

@gautschimi
gautschimi marked this pull request as ready for review July 14, 2026 12:28
@gautschimi
gautschimi requested review from a team and cfrantz as code owners July 14, 2026 12:28
@gautschimi
gautschimi requested review from hcallahan-lowrisc and timothytrippel and removed request for a team July 14, 2026 12:28
@gautschimi
gautschimi force-pushed the rram_integration branch 2 times, most recently from e09df20 to 3119a92 Compare July 14, 2026 14:26
@gautschimi
gautschimi requested a review from vogelpi July 14, 2026 14:28
@gautschimi
gautschimi force-pushed the rram_integration branch 2 times, most recently from a4cf29c to f2245e3 Compare July 14, 2026 15:15
This commit adds the plug between rram_ctrl and otp_ctrl and will
replace otp_macro.

It converts otp_ctrl transactions to rram read/write operations.

The following operations are supported:
- Read, ReadRaw
- Write, WriteRaw
- Init
- Zeroize

All values are protected with an additional integrity check value that
must match (except for ReadRaw/WriteRaw)

Signed-off-by: Michael Gautschi <mgautschi@lowrisc.org>
The requests from otp_ctrl to rram_ctrl come from the otp_clk domain
(clk_io4) and need to be synchronized to the main clock domain (system
clock).
Two FIFOs (prim_fifo_async_simple) have been added for the request and
response path.

Signed-off-by: Michael Gautschi <mgautschi@lowrisc.org>
And fix remaining issues in rram_ctrl_otp and top. rram_ctrl_otp
required a waifer for FOR_LOOP_BOUNDS, VAR_INDEX_RANGE, LOOP_VAR_OP.

Signed-off-by: Michael Gautschi <mgautschi@lowrisc.org>
After manufacturing the RRAM is unprogrammed and OTP read commands will
result in garbage and integrity mismatches if the read path tries to
remove the address infection.
Addr-infection has been disabled for the full OTP region. Integrity is
guaranteed with the separate integrity word stored in the integrity page.

Signed-off-by: Michael Gautschi <mgautschi@lowrisc.org>
RRAM write operations are less protected than read operations.
Therefore, every OTP write is verified with a subsequent read-back.
If the readback does not match the original data, an alert is created.
(same behaviour as for an OTP read with integrity)

Signed-off-by: Michael Gautschi <mgautschi@lowrisc.org>
This commit adds rram_ctrl + rram_macro and connects them to the bus
system. The RRAM can already be used for read/write operations through
the controller and host port.
Software binaries are still mapped to the flash macro, and otp_ctrl is
not yet connected to rram_ctrl.

No functional change so far as RRAM is not yet used in any testcase
(except for chip level csr_rw test).

Signed-off-by: Michael Gautschi <mgautschi@lowrisc.org>
This commit is to be squashed into the previous one before merge. It
contains all autogen changes that were generated with `make -C hw`

Signed-off-by: Michael Gautschi <mgautschi@lowrisc.org>
Align all security countermeasures in sec_cm_testplan, hjson and RTL

Signed-off-by: Michael Gautschi <mgautschi@lowrisc.org>
This bkdr util is required to preload the RRAM or to examine certain
memory location during tests.

Signed-off-by: Michael Gautschi <mgautschi@lowrisc.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants