Using Clock Domains to Control the Execution Rate of Clock-Driven Loops
- 更新时间2023-02-17
- 阅读时长2分钟
Using Clock Domains to Control the Execution Rate of Clock-Driven Loops
What to Use
- Clock-Driven Loop
- Clock terminal of the Clock-Driven Loop
What to Do
Create the following diagram to implement clock domains that control the execution rates of code within Clock-Driven Loops.
Customize the gray sections for your unique programming goals.

|
|
Divide your code into sections according to the separate timing objectives of your application. Place each section inside a Clock-Driven Loop. |
|
|
When you wire a clock to the Clock-Driven Loop, all
code placed within the loop attempts to execute within one clock
cycle of the chosen clock. For each Clock-Driven
Loop on your diagram, select a clock that allows you
to execute code at a rate that meets your timing objective for that
section of code. Note To execute more
than one Clock-Driven Loop at the same
clock rate, wire a single clock constant to multiple loops. Tip To
create modular code for use with different clocks in different
applications, wire a clock control to the Clock-Driven
Loop instead of a clock constant. |
Troubleshooting
If your code fails to meet the timing objectives of your application using the clocks you choose:
- Create derived clocks to run code at a lower frequency.
- Use pipelining to reduce the length of the critical path. In the Timing Violations tab, you can highlight the critical path on the diagram.
Examples
Search within the programming environment to access the following installed example: Multiple Clock Domains.
相关内容
- Customizing the Execution Rate of Clock-Driven Loops
If none of the FPGA target base clocks meets the timing objectives of your Clock-Driven Loop or Clock-Driven Logic document, create a derived clock that scales the frequency of the base clocks to achieve faster or slower execution rates.
- Clocks and Timing on an FPGA
This synchronous digital circuit is driven by a clock, which is a periodic digital signal that determines the allowed propagation delay. Propagation delay is the time it takes a signal to travel along a combinatorial logic path from one register to the next. The combinatorial path is the collection of logic and wiring that a signal encounters between two registers.
- Resolving Timing Violations on the FPGA
Timing violations occur when the execution time requested by sections of code is shorter than execution time the bitfile achieves after compiling. If the Timing Violations tab displays timing violations after you build a bitfile, you must resolve the timing violations and rebuild the bitfile before deploying the bitfile to the FPGA.