Hardware support for stack overflow checking #183
Labels
Component:RTL
For issues in the RTL (e.g. for files in the rtl directory)
Type:Enhancement
For feature requests and enhancements
WAIVED:CV32E40P
Issue does not impact a major release of CV32E40P and is waived
In #161 Haugoug proposed an enhancement for stack overflow checking during simulations. This enhancement request is also about support for stachk overflow checking, but this time it is aimed at an RTL implementation aimed at providing stack overflow checking support on silicon.
The proposal below is described 'relative to the proposal in #161.' As #161 is aimed at simulation whereas this ticket is aimed at RTL implementation, difficult requirements/constraints apply, leading to a different proposal.
- We would make key assumptions / simplifications:
- CSR usage
- Upon a stack overflow detection:
Reason for this is to not further complicate the exception handler code (which itself would normally start with ‘addi sp,sp,framesize’ which would then also cause an exception). (The actual splimit therefore needs to be set a little above the actual lower boundary of the stack such that this exception itself can do its work.)
It is the duty of the exception handler to re-initialize splimit once it has taken its other corrective actions.
- TBD:
I am very interested in hearing further opinions on this.
Best regards,
Arjan
The text was updated successfully, but these errors were encountered: