Local interrupts have higher priority than global interrupts. As such, if a local and a global inter-
rupt arrive at a hart on the same cycle, the local interrupt will be taken if it is enabled.
Priorities of local interrupts are determined by the local interrupt ID, with Local Interrupt 15 being
highest priority. For example, if both Local Interrupt 15 and Local Interrupt 14 arrive in the same
cycle, Local Interrupt 15 will be taken.
Local Interrupt 15 is the highest-priority interrupt in the E31 Core Complex. Given that Local
Interrupt 15’s exception code is also the greatest, it occupies the last slot in the interrupt vector
table. This unique position in the vector table allows for Local Interrupt 15’s trap handler to be
placed in-line, without the need for a jump instruction as with other interrupts when operating in
vectored mode. Hence, Local Interrupt 15 should be used for the most latency-sensitive inter-
rupt in the system for a given hart. Individual priorities of global interrupts are determined by the
PLIC, as discussed in Chapter 7.
E31 Core Complex interrupts are prioritized as follows, in decreasing order of priority:
• Local Interrupt 15
• …
• Local Interrupt 0
• Machine external interrupts
• Machine software interrupts
• Machine timer interrupts
Interrupt latency for the E31 Core Complex is 4 cycles, as counted by the numbers of cycles it
takes from signaling of the interrupt to the hart to the first instruction fetch of the handler.
Global interrupts routed through the PLIC incur additional latency of 3 cycles where the PLIC is
clocked by
clock
. This means that the total latency, in cycles, for a global interrupt is: 4 + 3
(
core_clock_0
Hz
clock
Hz). This is a best case cycle count and assumes the handler is
cached or located in ITIM. It does not take into account additional latency from a peripheral
source.
Additionally, the hart will not abandon a Divide instruction in flight. This means if an interrupt
handler tries to use a register that is the destination register of a divide instruction the pipeline
stalls until the divide is complete.
Copyright © 2017–2018, SiFive Inc. All rights reserved.
21