Skip to content

[rtl] Split data and ECC of the register file#2364

Open
nasahlpa wants to merge 4 commits intolowRISC:masterfrom
nasahlpa:upstream_split_rf
Open

[rtl] Split data and ECC of the register file#2364
nasahlpa wants to merge 4 commits intolowRISC:masterfrom
nasahlpa:upstream_split_rf

Conversation

@nasahlpa
Copy link
Member

@nasahlpa nasahlpa commented Feb 3, 2026

Until now, a single instance of the register file containing 32-bit data words and 7-bit ECC tags was used. While the input of the register file was driven by the main core, the output of the register file was distributed to the main and the shadow core.

In this PR, we are splitting up the data and ECC parts into two different register file instances:

  1. This instance is driven by the main core and only operates on the 32-bit data words. The outputs (32-bit data words) are forwarded to the main and the shadow core.
  2. This instance is driven by the shadow core and only operates on the 7-bit ECC words. The 7-bit ECC output is combined with the delayed 32-bit data output of the (1) RF instance. The shadow core uses ECC checkers to check if data and ECC (a) match and (b) are not manipulated using FI.

This helps us to save around 6 kGE of area.

@nasahlpa nasahlpa force-pushed the upstream_split_rf branch 4 times, most recently from e138d32 to 410556d Compare February 3, 2026 13:30
@rswarbrick
Copy link
Contributor

If I understand correctly, I've looked at some of this change already (where it looked good to me). The only differences since what I've already seen seem to be

  • Removal of the dependencies on prim_onehot* in ibex_dv.f and syn_yosys.sh
  • Removal of the mention of prim_onehot_check in integration.rst
  • Removal of the code that disables some assertions that have been removed
  • Removal of fcov that tracks rf_alert_major_internal (which has been removed)

That looks really sensible to me, but doesn't this leave dut.u_ibex_top.u_ibex_core.u_fcov_bind.rf_we_glitch_err undriven? I think it probably needs removing from the functional coverage interface and the coverage plan too?

As we are switching to a redundancy based fault injection mitigation
approach for the register file in the following commits, remove the
`WrenCheck` and `RdataMuxCheck` countermeasures from the register file.

Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org>
Until now, a single instance of the register file containing 32-bit
data words and 7-bit ECC tags was used. While the input of the
register file was driven by the main core, the output of the
register file was distributed to the main and the shadow core.

In this commit, we are splitting up the data and ECC parts into two
different register file instances:
 - (1) This instance is driven by the main core and only operates on
       the 32-bit data words. The outputs (32-bit data words) are
       forwarded to the main and the shadow core.
 - (2) This instance is driven by the shadow core and only operates
       on the 7-bit ECC words. The 7-bit ECC output is combined with
       the delayed 32-bit data output of the (1) RF instance. The
       shadow core uses ECC checkers to check if data and ECC (a)
       match and (b) are not manipulated using FI.

This helps us to save around 6 kGE of area.

Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org>
Due to the new register file split architecture, adapt the DV test accordingly.

Target the address of either the main or shadow core register file. Check if
we see an ECC error that is generated by the shadow core.

Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org>
Fix the port name and wait LockstepOffset cycles before reading the
alert.

Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org>
@nasahlpa
Copy link
Member Author

nasahlpa commented Feb 4, 2026

Thanks for the review, Rupert!

  • I've removed dut.u_ibex_top.u_ibex_core.u_fcov_bind.rf_we_glitch_err
  • Instead, I have added dut.u_ibex_top.u_ibex_core.u_fcov_bind.rf_glitch_err
  • In that context, I have noticed that two RF glitch tests no longer worked - I have updated them in the last two commits

Copy link
Contributor

@vogelpi vogelpi left a comment

Choose a reason for hiding this comment

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

Thanks @nasahlpa , I've reviewed the RTL and it's identical to what I've reviewed before, LGTM!

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.

3 participants