When pipelining functions or loops, the OCCURRENCE directive specifies that the code in a location is executed at a lower rate than the surrounding function or loop. This allows the code that is executed at the lower rate to be pipelined at a slower rate, and potentially shared within the top-level pipeline. For example:
- A loop iterates N times.
- Part of the loop is protected by a conditional statement and only executes M times, where N is an integer multiple of M.
- The code protected by the conditional is said to have an occurrence of N/M.
Identifying a region with an OCCURRENCE rate allows the functions and loops in this region to be pipelined with an initiation interval that is slower than the enclosing function or loop.
set_directive_occurrence [OPTIONS] <location>
<location>specifies the location with a slower rate of execution.
- Specifies the occurrence N/M where:
Important: N must be an integer multiple of M.
- N is the number of times the enclosing function or loop is executed.
- M is the number of times the conditional region is executed.
Cond_Region in function
foo has an occurrence of 4. It executes at a
rate four times slower than the code that encompasses it.
set_directive_occurrence -cycle 4 foo/Cond_Region