03-07-2013
08:14 AM
- last edited on
01-10-2025
01:26 PM
by
Content Cleaner
Hi Everybody!
This week I would like to talk about a very important and unique feature of FPGA programming; the Single-Cycle Timed Loop.
The Single-Cycle Timed Loop (SCTL) is the FPGA version of the Timed Loop that you see in Real-Time programming. It is very useful because it allows us to perform multiple operations within a single tick of the FPGA’s clock. Please refer to the link below.
Using Single-Cycle Timed Loops to Optimize FPGA VIs (FPGA Module)
So if we are using the default 40 MHz clock as our Top-Level Clock, each tick (or clock cycle) will take 25 ns to execute. In the example above, that means it would take 100 ns to execute the code inside the while loop (excluding the 2 ticks of overhead for the while loop). By placing that code inside an SCTL, it only takes 25 ns!
Unfortunately, we cannot just place all of our code inside an SCTL. If you try and place too much code in a single combinatorial path inside the loop, you may get a timing violation, which means that compiler cannot fit all of that code into a single tick. There are several ways to fix the timing violation, but some of the easiest ones are to either reduce the clock speed by deriving a slower clock, or by parallelizing the code with a technique called pipelining. Below is another great resource for learning how to optimize FPGA code.
Optimizing your LabVIEW FPGA VIs: Parallel Execution and Pipelining
If you have any questions about Single-Cycle Timed Loops, please feel free to post them here!
Best,
Jeff S
09-30-2014 11:45 AM
I've also encountered situations, where a SCTL will compile but the code doesn't performed as desired.
10-03-2014
03:12 PM
- last edited on
01-10-2025
01:26 PM
by
Content Cleaner
Hi Isaac,
Please post here or on the LabVIEW FPGA Discussion Forum (probably more eyes will see it there) if there's anything specific we can help with.
For more details on practical implementation of SCTL's, I recommend the LabVIEW High Performance FPGA Developer's Guide.