LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA Compilation Failed due to timing violations

I don't believe this error occurred in LV7 but now it seems to be the most common fault when compiling under 8.01 even after the server has stated the 'Bitstream Generation is Complete'.
What causes this and how is it best avoided?
Is it just down to minimising the number of components wired sychronously or is it more sensitive on one computer than another (different compile route taken??)
 
Ah, the compilation just failed again, see below. Please offer some advice as all I can do it optimise-compile-fail-optimise-compile-fail and grow old in the process.
 
Status: Compilation failed due to timing violations.
Suggestions for eliminating the problem:
  * Change the code timed by clocks with timing violations
      - Reduce long arithmetic/combinatorial paths
      - Use pipelining within Timed Loops
  * Reduce clock rates if possible
  * Recompile
Compilation Summary
-------------------
Device Utilization Summary:
   Number of BUFGMUXs                  4 out of 16     25%
   Number of External IOBs           142 out of 324    43%
      Number of LOCed IOBs           142 out of 142   100%
   Number of MULT18X18s               12 out of 40     30%
   Number of RAMB16s                  10 out of 40     25%
   Number of SLICEs                 4797 out of 5120   93%
Clock Rates: (Requested rates adjusted for jitter and accuracy)
  Base clock: 40 MHz Onboard Clock
      Compiled Rate:        40.408938MHz
      Theoretical Maximum: 38.598116MHz    <<<=== Timing Violation
0 Kudos
Message 1 of 10
(6,960 Views)

Just to add to this...

I've just re-compiled the exact same code on another PC and it passed, same utilisation, Compiled rate: 40.409 Theoretical Max: 40.548, what is going on????

0 Kudos
Message 2 of 10
(6,952 Views)
I can't explain why you get a difference between the two machines, maybe theres a bad install somewhere but doubt it.

I guess all you can do is optimise the code in order to make it as lean as possible. Have you managed to get around thsi issue or is it still hitting you?
0 Kudos
Message 3 of 10
(6,881 Views)
I'm having this exact same compilation error too. Don't know what the problem is.
0 Kudos
Message 4 of 10
(6,344 Views)
Attached is the vi i tried to compile but keep getting the error shown in the post above. Please any help at this point will be appreciated. Thanks.
0 Kudos
Message 5 of 10
(6,338 Views)

First, to be blunt that fpga code isn't very good. 

 

There are 8 divisions in the code and these should be stripped out wherever possible. Division is quite expensive and that is why such little code is taking 90+% of the FPGA.

 

Here is what I have to offer.

 

You have two x/16 that should replaced with x*2^(-4), same effect but free on the FPGA.

 

There is scaling done on the FPGA that could be done better on the RTHost, provided you don't need high rates. The pressure input may be a good candidate.

 

Do you need FP indicators and the FIFO?  I would pick one.

 

I attached a JPEG showing some ideas for optimization in your code.  I ran the code clean up tool first.

 

I may have something further, given more time.

I would attempt to keep datawidths in check wherever possbile.  Forcing the output of a function will help, provided you KNOW the value won't overflow the datawidth you choose.

 

Good luck.

 

From xflow.log the timing violation seems to come from a fixed point multiply in the loop (as in bold):

 

Timing Summary:
---------------
Speed Grade: -4

Minimum period: 28.046ns (Maximum Frequency: 35.655MHz)
Minimum input arrival time before clock: 15.567ns
Maximum output required time after clock: 10.653ns
Maximum combinational path delay: No path found

Timing Detail:
--------------
All values displayed in nanoseconds (ns)

=========================================================================
Timing constraint: Default period analysis for Clock 'Clk40'
Clock period: 28.046ns (frequency: 35.655MHz)
Total number of paths / destination ports: 5660726965 / 8321
-------------------------------------------------------------------------
Delay: 28.046ns (Levels of Logic = 38)
Source: window/theVI/n_695/n_694/n_692/n_664/clockDataOutInternal_8 (FF)
Destination: window/theVI/n_695/n_694/n_692/prim_MUL_0172/NiLvFxpEnableHandlerx/NiLvFxpEnableHandlerSlvx/cOut_63 (FF)
Source Clock: Clk40 rising
Destination Clock: Clk40 rising

 

0 Kudos
Message 6 of 10
(6,323 Views)

The reason i decided to do all my data manipulation in the FPGA vi is because when i put just the raw data into the DMA FIFO and use my RT vi to do data manipulation/scaling, i get all kinds of weird values, that don't make no sense at all. I even end up with the values being interchanged between my indicators (i.e. crank angle shows up in the index position field and so on).

 

The only reason i chose to use DMA FIFO in the first place is because my RT seemed to be too slow in updating compared to the FPGA resulting in severe data loss. 

 

I've done some optimization and while the FPGA vi compiled, i'm still getting very unreasonable values in my RT vi (which is also doing the data logging) and now, I don't know how to go about getting high resolution data without losing data integrity. 

0 Kudos
Message 7 of 10
(6,304 Views)

Well, I finally got it to compile and meet timing.  I had to use the NI Fixed Point Library.

Attached is a screen cap that shows the multiliers that caused the issue.

Also attached is a solution using the Fixed point library for the multiplies. Unfortunately those multiplies are going to take 3 cycles to complete, hower for an encoder loop it shouldn't slow it too much.

 

Download All
0 Kudos
Message 8 of 10
(6,295 Views)
Anytime you're that high on SLICE utilization, you can bet the compiler will take a LONG time trying to meet the base rate timing just because it's routing options are so limited.
0 Kudos
Message 9 of 10
(6,252 Views)
The vi compiles and runs fine now. The only issue is some of the data i get, using the DMA FIFO are just so wrong. Without the DMA FIFO, i get more accurate data but miss a lot of data points. Anyway, I'll keep trying various options and see how it goes. Thanks y'all.
0 Kudos
Message 10 of 10
(6,240 Views)