Memory Protection - Getting violating address

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User19424
Level 3
Level 3
First solution authored First like received
Hello

I am using the memory protection system and have ran into an issue.
Say the program encounters a read/write violation, and thus activates the trap; is there a way to know what memory location caused the violation?

For code execution protection this is solved since the trap saves the last PC location in the a11 register. But I can't find how to get the address the code tried to read from/write to.

Example:
(Say I have PROTEN enabled and my memory protection policy does not allow the following)

 ld.d e2, [a10]0x38 


Once I jump to the Trap (Class 1), How Can I get that [a10]0x38 value (or any value for that matter)?

Thanks.
0 Likes
2 Replies
NeMa_4793301
Level 6
Level 6
10 likes received 10 solutions authored 5 solutions authored
Check DEADD:

Data Memory Protection Traps
Data memory protection traps (MPW, MPR, MPP, MPN) are raised by the memory protection system when a protection violation occurs.
Whenever a data memory protection trap occurs the DSTR (Data synchronous trap register) and the DEADD (Data Error Address Register) are updated.
0 Likes
User19424
Level 3
Level 3
First solution authored First like received
UC_wrangler wrote:
Check DEADD:


Yes!
Thank you very much.
0 Likes