Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sram_ctrl] Add readback feature #23212

Merged
merged 1 commit into from
May 26, 2024
Merged

Conversation

nasahlpa
Copy link
Member

When enabled with the SRAM_CTRL.READBACK CSR, the SRAM readback mode checks each read and write to the SRAM.

On a read, the readback mode issues a second read to the same address to check, whether the correct data was fetched from memory. On a write, the readback mode issues a read to check, whether the data was actually written into the memory. To avoid that the holding register is read, the readback is delayed by one cycle.

On a mismatch, a fatal error is triggered and the STATUS.READBACK_ERROR register is set.

To avoid RTL changes as much as possible, the readback mode is implemented in the tlul_sram_byte module. In this module, after the initial read or write was executed, the bus interface to the host is stalled and the readback is performed. Due to the bus stalling, a performance impact is expected.

@nasahlpa nasahlpa requested review from mundaym, a team and msfschaffner as code owners May 21, 2024 05:29
@nasahlpa nasahlpa requested review from rswarbrick, jon-flatley, GregAC, andreaskurth, vogelpi, cdgori, moidx and johannheyszl and removed request for a team, mundaym, rswarbrick and jon-flatley May 21, 2024 05:29
@nasahlpa nasahlpa force-pushed the sram_readback branch 11 times, most recently from 6270e58 to 72e0d3d Compare May 22, 2024 08:04
@nasahlpa nasahlpa force-pushed the sram_readback branch 2 times, most recently from 8c4c146 to de3b69f Compare May 25, 2024 12:18
When enabled with the SRAM_CTRL.READBACK CSR, the SRAM readback mode
checks each read and write to the SRAM.

On a read, the readback mode issues a second read to the same address
to check, whether the correct data was fetched from memory. On a write,
the readback mode issues a read to check, whether the data was actually
written into the memory. To avoid that the holding register is read,
the readback is delayed by one cycle.

On a mismatch, a fatal error is triggered and the STATUS.READBACK_ERROR
register is set.

To avoid RTL changes as much as possible, the readback mode is
implemented in the tlul_sram_byte module. In this module, after the
initial read or write was executed, the bus interface to the host is
stalled and the readback is performed. Due to the bus stalling, a
performance impact is expected.

Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org>
Co-authored-by: Greg Chadwick <gac@lowrisc.org>
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 for addressing the additional feedback. This looks great!

@andreaskurth
Copy link
Contributor

The one failing CI check (CW310 Test ROM) seems to be unrelated to this PR; all other checks passed --> merging

@andreaskurth andreaskurth merged commit ee5f4a1 into lowRISC:master May 26, 2024
30 of 32 checks passed
@nasahlpa nasahlpa deleted the sram_readback branch May 26, 2024 15:56
nasahlpa added a commit to nasahlpa/ibex that referenced this pull request May 28, 2024
This commit updates the RAM ports inside ibex_top to reflect recent
changes introduced with lowRISC/opentitan#23212 (SRAM readback mode).

Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org>
nasahlpa added a commit to nasahlpa/opentitan that referenced this pull request May 30, 2024
This commit adds the DIF functions for the readback mode (c.f.
lowRISC#23212)and a basic test.

Closes lowRISC#23365

Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org>
nasahlpa added a commit to nasahlpa/opentitan that referenced this pull request May 30, 2024
This commit adds the DIF functions for the readback mode (c.f.
lowRISC#23212) and a basic test.

Closes lowRISC#23365

Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org>
nasahlpa added a commit to nasahlpa/opentitan that referenced this pull request May 30, 2024
This commit adds the DIF functions for the readback mode (c.f.
lowRISC#23212) and a basic test.

Closes lowRISC#23365

Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org>
nasahlpa added a commit to nasahlpa/ibex that referenced this pull request Jun 4, 2024
This commit updates the RAM ports inside ibex_top to reflect recent
changes introduced with lowRISC/opentitan#23212 (SRAM readback mode).

Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org>
GregAC pushed a commit to lowRISC/ibex that referenced this pull request Jun 6, 2024
This commit updates the RAM ports inside ibex_top to reflect recent
changes introduced with lowRISC/opentitan#23212 (SRAM readback mode).

Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org>
vogelpi pushed a commit that referenced this pull request Jul 8, 2024
This commit adds the DIF functions for the readback mode (c.f.
#23212) and a basic test.

Closes #23365

Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org>
nasahlpa added a commit to nasahlpa/opentitan that referenced this pull request Dec 10, 2024
With the introduction of the SRAM readback mode (c.f.,
lowRISC#23212) memory requests can be delayed.

The sram_ctrl_passthru_mem_tl_intg_err failed occasionally
because the integrity alert was expected to arrive without
any delay. This commit increases the max_delay parameter for
the expected alert to take the readback mode delay into
account.

Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org>
nasahlpa added a commit to nasahlpa/opentitan that referenced this pull request Dec 10, 2024
With the introduction of the SRAM readback mode (c.f.,
lowRISC#23212) memory requests can be delayed.
The SRAM DV tests are adapted such that the readback feature
can be disabled or enabled anytime during a test.

The sram_ctrl_passthru_mem_tl_intg_err failed occasionally
because the integrity alert was expected to arrive without
any delay. This commit increases the max_delay parameter for
the expected alert to take the readback mode delay as well as
a potential enabling or disabling of the feature into
account.

Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org>
nasahlpa added a commit that referenced this pull request Dec 11, 2024
With the introduction of the SRAM readback mode (c.f.,
#23212) memory requests can be delayed.
The SRAM DV tests are adapted such that the readback feature
can be disabled or enabled anytime during a test.

The sram_ctrl_passthru_mem_tl_intg_err failed occasionally
because the integrity alert was expected to arrive without
any delay. This commit increases the max_delay parameter for
the expected alert to take the readback mode delay as well as
a potential enabling or disabling of the feature into
account.

Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org>
Razer6 pushed a commit to Razer6/opentitan that referenced this pull request Jan 2, 2025
With the introduction of the SRAM readback mode (c.f.,
lowRISC#23212) memory requests can be delayed.
The SRAM DV tests are adapted such that the readback feature
can be disabled or enabled anytime during a test.

The sram_ctrl_passthru_mem_tl_intg_err failed occasionally
because the integrity alert was expected to arrive without
any delay. This commit increases the max_delay parameter for
the expected alert to take the readback mode delay as well as
a potential enabling or disabling of the feature into
account.

Signed-off-by: Pascal Nasahl <nasahlpa@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.

3 participants