Skip to content

Conversation

@AlexJones0
Copy link

The current SRAM controller ifetch / execution enablement logic only considers that the configured ifetch enable property should be true, in addition to the OTP HW_CFG1.EN_SRAM_IFETCH field and the sram_ctrl CSR EXEC.EN field. This is likely based on the EXEC.EN documentation which states that:

Note that this register only takes effect if the EN_SRAM_IFETCH switch in the OTP HW_CFG1 partition is set to kMultiBitBool8True. Otherwise execution from SRAM cannot be enabled via this register.

While this isn't incorrect, it doesn't paint the full picture. From the RTL:

    assign en_ifetch = (mubi8_test_true_strict(otp_en_sram_ifetch)) ? reg_ifetch_en :
                                                                      lc_ifetch_en;

In the case that the OTP iftech is disabled, the CSR value is entirely ignored and instead the value of the pervasive lifecycle controller hw_debug_en broadcast signal is used to determine SRAM ifetch enablement. This PR implements this functionality, retaining the behaviour that the ifetch config property acts a disable regardless of the HW_DEBUG_EN value.

Copy link

@jwnrt jwnrt left a comment

Choose a reason for hiding this comment

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

LGTM

When the OTP SRAM ifetch is disabled, hardware does not check the CSR
iftech but instead checks whether the pervasive `HW_DEBUG_EN` signal
from the lifecycle controller is being broadcast. If so, it allows
ifetch/execution from SRAM.

For now, it is kept that the property-configured `ifetch` still
overrides the LC HW_DEBUG_EN ifetch enablement, so that this
configuration ifetch is seen as a "global" disable that can override all
other ifetch enablement mechanisms.

Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
Connect the lifecycle controller's broadcast `LC_HW_DEBUG_EN` signal to
each SRAM controller in both tops, to match the ifetch/execution
enablement conditions that are specified in the RTL.

Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
@AlexJones0 AlexJones0 force-pushed the sram_lc_hw_debug_ifetch branch from ea44c3c to e17da38 Compare December 8, 2025 12:41
Copy link

@rivos-eblot rivos-eblot left a comment

Choose a reason for hiding this comment

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

LGTM. Maybe add a link to a ticket for the doc to be updated?

@AlexJones0
Copy link
Author

Maybe add a link to a ticket for the doc to be updated?

Done, I just opened a PR instead: lowRISC/opentitan#28900

@AlexJones0
Copy link
Author

Merging as CI failures are unrelated.

@AlexJones0 AlexJones0 merged commit 13e5cb4 into lowRISC:ot-10.1.0 Dec 9, 2025
8 of 10 checks passed
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