11.07.2015 Views

IAR PowerPac RTOS User Guide

IAR PowerPac RTOS User Guide

IAR PowerPac RTOS User Guide

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

●●●●●Latencies caused by cache write back.A cache miss may cause a line to be replaced. If this line is marked as dirty, it needs to be written back to mainmemory, causing an additional delay.Latencies caused by MMU translation table walks.Translation table walks can take a considerable amount of time, especially as they involve potentially slow mainmemory accesses. In real-time interrupt handlers, translation table walks caused by the TLB not containingtranslations for the handler and/or the data it accesses can increase interrupt latency significantly.Application program.Of course, the application program can cause additional latencies by disabling interrupts. This can make sense insome situations, but of course causes add. latencies.Interrupt routines.On most systems, one interrupt disables further interrupts. Even if the interrupts are re-enabled in the ISR, thistakes a few instructions, causing add. latency.<strong>RTOS</strong> (Real-time Operating system).An <strong>RTOS</strong> also needs to temporarily disable the interrupts which can call API-functions of the <strong>RTOS</strong>. Some<strong>RTOS</strong>es disable all interrupts, effectively increasing interrupt latencies for all interrupts, some (like <strong>IAR</strong> <strong>PowerPac</strong><strong>RTOS</strong>) disable only low-priority interrupts and do thereby not affect the latency of high priority interrupts.Zero interrupt latencyZero interrupt latency in the strict sense is not possible as explained above. What we mean when we say "Zero interruptlatency" is that the latency of high-priority interrupts is not affected by the <strong>RTOS</strong>; a system using <strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong>will have the same worst-case interrupt latency for high priority interrupts as a system running without <strong>IAR</strong> <strong>PowerPac</strong><strong>RTOS</strong>.High / low priority interruptsMost CPUs support interrupts with different priorities. Different priorities have two effects:● If different interrupts occur simultaneously, the interrupt with higher priority takes precedence and its ISR isexecuted first.● Interrupts can never be interrupted by other interrupts of the same or lower level of priority.How many different levels of interrupts there are depend on the CPU and the interrupt controller. Details are explainedin the CPU/MCU/SOC manuals and the CPU & Compiler Specifics manual of <strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong>. <strong>IAR</strong> <strong>PowerPac</strong><strong>RTOS</strong> distinguishes two different levels of interrupts: High / Low priority interrupts. The <strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong> portspecific documentation explains where "the line is drawn", which interrupts are considered high and which interruptsare considered low priority. In general, the differences are:Low-priority interrupts●●May call <strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong> API functionsLatencies caused by <strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong>High-priority interrupts●●May not call <strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong> API functionsNo Latencies caused by <strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong> (Zero latency)Example of different interrupt priority levelsARM CPUs support normal interrupts (IRQ) and fast interrupt (FIQ). Using <strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong>, the FIQ is treatedas “High priority interrupt”.100<strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong>for ARM CoresPP<strong>RTOS</strong>-2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!