Interrupt and exception handling

187 views
Skip to first unread message

sajjad ahmed

unread,
Sep 8, 2020, 5:45:51 PM9/8/20
to RISC-V HW Dev

Hello everyone.

i want to implement interrupt and exception handling in my design but confused about the handler. like how we handle an exception in hardware. for example i have an exception of load address misaligned. i have raised the exception flag and i know the csr mapping on exceptions but what will be the operation of handling this exception. whether i have to jump to a handler code or i will have some logic circuit for handling this. same thing goes for interrupts.
please guide me.

your support is always appreciated.

 

Kelvin Goveas

unread,
Sep 14, 2020, 2:40:34 PM9/14/20
to RISC-V HW Dev, sajjad.a...@gmail.com
Please read sections 3.1.7, 3.1.8 and 3.1.9 of the RISC V privileged spec for the architectural handling of traps and interrupts. You can then decide on your micro-architectural implementation. The net effect is the core would transition to executing code in an exception handler at a virtual address which is a function of m[s]tvec, m[s]edeleg/m[s]ideleg and update m[s]cause and m[s]epc. The latest spec can be found at following link:

Kelvin
Reply all
Reply to author
Forward
0 new messages