Visible to Intel only — GUID: iga1457468819698
Ixiasoft
Visible to Intel only — GUID: iga1457468819698
Ixiasoft
38.8.1.4. Funnel Latency
Funnel latency is the time required for the interrupt funnel to switch context. Funnel latency can include saving and restoring registers, managing preemption, and managing the stack pointer. Funnel latency depends on the following factors:
- Whether a separate interrupt stack is used
- The number of clock cycles required for load and store instructions
- Whether the interrupt requires switching to a different register set
- Whether the interrupt is preempting another interrupt within the same register set
- Whether preemption within the register set is allowed
Preemption within the register set requires special attention. The HAL VIC driver provides special funnel code if an interrupt is allowed to preempt another interrupt assigned to the same register set. In this case, the funnel incurs additional overhead to save and restore the register contents. When creating the BSP, you can control preemption within the register set by using the VIC driver’s altera_vic_driver_enable_preemption_rs_<n> setting.
Funnel Type | Clock Cycles Required for Load or Store | |
---|---|---|
1 | 2 | |
Shadow register set, preemption within the register set disabled | 10 | 13 |
Shadow register set, preemption within the register set enabled | 42 Same register set (sstatus.SRS=0) |
64 Same register set (sstatus.SRS=0) |
26 Different register set (sstatus.SRS=1) |
32 Different register set (sstatus.SRS=1) |
Funnel Type | Clock Cycles Required for Load or Store | |
---|---|---|
1 | 2 | |
Shadow register set, preemption within the register set disabled | 11 Not preempting another interrupt (sstatus.IH=0) |
14 Not preempting another interrupt (sstatus.IH=0) |
12 Preempting another interrupt (sstatus.IH=1) |
15 Preempting another interrupt (sstatus.IH=1) |
|
Shadow register set, preemption within the register set enabled | 42 Same register set (sstatus.SRS=0) |
64 Same register set (sstatus.SRS=0) |
27
|
33
|
|
28
|
34
|
In the tables above, notice that the lowest latencies occur under the following conditions:
- A different register set—Shadow register set switch; the ISR runs in a different register set from the interrupted task, eliminating any need to save or restore registers.
- Preemption (nesting) within the register set disabled.
Conversely, the highest latencies occur under the following conditions:
- The same register set—No shadow register set switch; the ISR runs in the same register set as the interrupted task, requiring the funnel code to save and restore registers.
- Preemption within the register set enabled.
Of these two important factors, preemption makes the largest difference in latencies. With preemption disabled, much lower latencies occur regardless of other factors.