MicroBlaze Processor Reference Guide
71
UG081 (v14.7)
Reset, Interrupts, Exceptions, and Break
The address of each fast interrupt handler must be passed to the Interrupt Controller when
initializing the interrupt system. When a particular interrupt occurs, this address is supplied by the
Interrupt Controller, which allows MicroBlaze to directly jump to the handler code.
With this mode, MicroBlaze also directly sends the appropriate interrupt acknowledge to the
Interrupt Controller (via the
Interrupt_Ack
output port), although it is still the responsibility of
the Interrupt Service Routine to acknowledge level sensitive interrupts at the source.
To inform the Interrupt Controller of the interrupt handling events,
Interrupt_Ack
is set to:
•
01 - when MicroBlaze jumps to the interrupt handler code,
•
10 - when the RTID instruction is executed to return from interrupt,
•
11 - when MSR[IE] is changed from 0 to 1, which enables interrupts again.
The
Interrupt_Ack
output port is active during one clock cycle, and is then reset to 00.
This information allows the Interrupt Controller to acknowledge interrupts appropriately, both for
level-sensitive and edge-triggered interrupt.
Latency
The time it takes MicroBlaze to enter an Interrupt Service Routine (ISR) from the time an interrupt
occurs, depends on the configuration of the processor and the latency of the memory controller
storing the interrupt vectors. If MicroBlaze is configured to have a hardware divider, the largest
latency happens when an interrupt occurs during the execution of a division instruction.
With low-latency interrupt mode, the time to enter the ISR is significantly reduced, since the
interrupt vector for each individual interrupt is directly supplied by the Interrupt Controller. With
compiler support for fast interrupts, there is no need for a common ISR at all. Instead, the ISR for
each individual interrupt will be directly called, and the compiler takes care of saving and restoring
registers used by the ISR.
Equivalent Pseudocode
r14
←
PC
if C_USE_INTERRUPT = 2
PC
←
Interrupt_Address
Interrupt_Ack
←
01
else
PC
←
C_BASE_V 0x00000010
MSR[IE]
←
0
MSR[UMS]
←
MSR[UM], MSR[UM]
←
0, MSR[VMS]
←
MSR[VM], MSR[VM]
←
0
Reservation
←
0
User Vector (Exception)
The user exception vector is located at address 0x8. A user exception is caused by inserting a
‘B
RALID R
x
,0x8
’ instruction in the software flow. Although R
x
could be any general purpose
register, Xilinx recommends using R15 for storing the user exception return address, and to use the
RTSD instruction to return from the user exception handler.
Pseudocode
r
x
←
PC
PC
←
C_BASE_V 0x00000008
MSR[UMS]
←
MSR[UM], MSR[UM]
←
0, MSR[VMS]
←
MSR[VM], MSR[VM]
←
0
Reservation
←
0
Содержание MicroBlaze
Страница 1: ...MicroBlaze Processor Reference Guide Embedded Development Kit EDK 14 7 UG081 v14 7...
Страница 4: ...MicroBlaze Processor Reference Guide www xilinx com UG081 v14 7...
Страница 8: ...8 www xilinx com MicroBlaze Processor Reference Guide UG081 v14 7 Chapter 1 Introduction Send Feedback...
Страница 262: ...262 www xilinx com MicroBlaze Processor Reference Guide UG081 v14 7 Send Feedback...