SPRUI04F july 2015 – april 2023
On the C6000 architecture, interrupts cannot be taken in the delay slots of a branch. In some instances the compiler can generate code that cannot be interrupted for a potentially large number of cycles. For a given real-time system, there may be a hard limit on how long interrupts can be disabled.
The --interrupt_threshold=n option specifies an interrupt threshold value n. The threshold value specifies the maximum number of cycles that the compiler can disable interrupts. If the n is omitted, the compiler assumes that the code is never interrupted. In Code Composer Studio, to specify that the code is never interrupted, select the Interrupt Threshold check box and leave the text box blank in the Build Options dialog box on the Compiler tab, Advanced category.
If the --interrupt_threshold=n option is not specified, then interrupts are only explicitly disabled around software pipelined loops. When using the --interrupt_threshold=n option, the compiler analyzes the loop structure and loop counter to determine the maximum number of cycles it takes to execute a loop. If it can determine that the maximum number of cycles is less than the threshold value, the compiler generates the fastest/optimal version of the loop. If the loop is smaller than six cycles, interrupts are not able to occur because the loop is always executing inside the delay slots of a branch. Otherwise, the compiler generates a loop that can be interrupted (and still generate correct results—single assignment code), which in most cases degrades the performance of the loop.
The --interrupt_threshold=n option does not comprehend the effects of the memory system. When determining the maximum number of execution cycles for a loop, the compiler does not compute the effects of using slow off-chip memory or memory bank conflicts. It is recommended that a conservative threshold value is used to adjust for the effects of the memory system.
See Section 7.9.13 or the TMS320C6000 Programmer's Guide for more information.
The run-time-support library files provided with the compiler are not built with the interrupt flexibility option. Refer to the readme file to see how the run-time-support library files were built for your release. See Section 9.4 to build your own run-time-support library files with the interrupt flexibility option.
The --interrupt_threshold=0 option generates the same code to disable interrupts around software-pipelined loops as when the --interrupt_threshold option is not used.
The --interrupt_threshold option (the threshold value is omitted) means that no code is added to disable interrupts around software pipelined loops, which means that the code cannot be safely interrupted. Also, loop performance does not degrade because the compiler is not trying to make the loop interruptible by ensuring that there is at least one cycle in the loop kernel that is not in the delay slot of a branch instruction.