This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Cortex-R5: Divide-by-zero

Hello,

I am using Xilinx MpSoc Ultrascale+ ZCU102.

I want to generate an interrupt when dividing by zero.
I read the Cortex-R5 technical reference manual (infocenter.arm.com/.../index.jsp
The system control register C1 has the DZ bit which control the generation of Undefined Instruction exception.

My SW is running as a standalone on R5-0.
The file xreg_cortexr5.h consists the XREG_CP15_CONTROL (the C1 Register Defines) but the DZ bit is not exist there.

When I tried to change this bit by myself (using inline assembler code) according to the ARM Cortex-R5 details mentioned above and handle this with my own function, I got a SW interrupt in every cycle of my application.

Why the DZ bit is not appear in xreg_cortexr5.h?
Why changing its value cause a SW interrupt?

Is there a different way to generate the divide by zero interrupt?

Thanks!

Parents
  • Where did you get xreg_cortexr5.h from?  Is it provided by Xilinx?

    What mode were you in when you attempted to access the SCTLR?  One possible explanation is that you're trying to do it from User mode, you need to be in a privileged mode to access the SCTLR.

Reply
  • Where did you get xreg_cortexr5.h from?  Is it provided by Xilinx?

    What mode were you in when you attempted to access the SCTLR?  One possible explanation is that you're trying to do it from User mode, you need to be in a privileged mode to access the SCTLR.

Children