Skip to content

Conversation

@jwnrt
Copy link
Contributor

@jwnrt jwnrt commented Dec 2, 2025

This test needs to read a CSR from the AES block. dif_aes_alert_force was chosen because the instruction that writes to the ALERT_TEST CSR comes close to the beginning of the function and makes the crash dump accurate

The address of the function causing the error. The functions
that cause the error are chosen so they perform a CSR read
shortly after the function entry, so crash_dump's mcpc is
expected to be past the possible error pc by no more than about 8
instructions, meaning 8 * 4 bytes.

However triggering an alert will be problematic once OTTF starts catching alerts triggered by tests.

Switch to dif_aes_get_status instead which I have confirmed does the CSR access within two instructions from aes_csr_access.

200107a0 <aes_csr_access>:
200107a0: 41100537 lui a0,0x41100
200107a4: 08452503 lw  a0,132(a0) # 41100084
200107a8: 8082     ret

Cross reference with 3250128 which changed from _get_status to _alert_force presumably because the CSR access was generated further away at the time.

This test needs to read a CSR from the AES block. `dif_aes_alert_force`
was chosen as the instruction that writes to the `ALERT_TEST` CSR comes
close to the beginning of the function and makes the crash dump accurate

> The address of the function causing the error.  The functions
> that cause the error are chosen so they perform a CSR read
> shortly after the function entry, so crash_dump's mcpc is
> expected to be past the possible error pc by no more than about 8
> instructions, meaning 8 * 4 bytes.

However triggering an alert will be problematic once OTTF starts
catching alerts triggered by tests.

Switch to `dif_aes_get_status` instead which I have confirmed does the
CSR access within two instructions from `aes_csr_access`.

```
200107a0 <aes_csr_access>:
200107a0: 41100537 lui a0,0x41100
200107a4: 08452503 lw  a0,132(a0) # 41100084
200107a8: 8082     ret
```

Signed-off-by: James Wainwright <[email protected]>
@jwnrt jwnrt requested review from AlexJones0 and pamaury December 2, 2025 14:33
@jwnrt jwnrt requested a review from a team as a code owner December 2, 2025 14:33
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.

1 participant