LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Best way to transfer single point data between loops on FPGA

Hi,

 

    I used quite number of loops on FPGA and need to transfer single point datas between loops. Only the current value of data is needed so buffer is not necessary. I don't want use target scope FIFO since it require minimum 21 elements and I only need the current value. Is there other way other than local variables?

 

    Thanks for help!

 

    Regards,

 

   Tom

0 Kudos
Message 1 of 9
(4,830 Views)
A few questions:
  • Are the loops running on the same clock or different clocks?
  • What aspect of using Locals are you trying to avoid?
  • You say "buffer is not necessary" - does this mean you do not want any flip flops in the path between the 2 loops? Is this delay a problem?
0 Kudos
Message 2 of 9
(4,825 Views)

Hi,

  • Are the loops running on the same clock or different clocks?

        All loops use same clock. Some are singe cycled timed loop (SCTL) and others are timed while loops.

 

  • What aspect of using Locals are you trying to avoid?

        Not particular. Just would like to explore other methods if possible.

 

  • You say "buffer is not necessary" - does this mean you do not want any flip flops in the path between the 2 loops? Is this delay a problem?

        Delay is not a problem. I say buffer is not necessary because I only need the current data value

 

       Thanks!

 

       Tom

0 Kudos
Message 3 of 9
(4,818 Views)

Thanks for the details. In the case you describe I have only used Locals to move data between Single Cycle Timed Loops (SCTL), but a global should work as well. Note: Locals will insert a flip-flop in the path.


One thought about moving data between SCTL and While Loops - since the While loop may take several FPGA clock cycles to complete an iteration, you should make sure data from an SCTL is constant/present long enough for the While loop to see it. This may require additional handshaking logic between the SCTL and the While Loop.

Message 4 of 9
(4,811 Views)

A memory block is another fine way to transfer data between loops on an FPGA, so long as those loops all run in the same clock domain.

0 Kudos
Message 5 of 9
(4,806 Views)

I think memory block is good to transfer array of data. For single point data it could be overkill?

0 Kudos
Message 6 of 9
(4,799 Views)

Depends what you mean by overkill.  There is a minimum amount of memory used per block, so if you need to transfer a lot of individual points of data it would not be efficient to create a separate memory item for each point.  However, if you only need to transfer a few data points and you don't need that memory for anything else, the memory block is a reasonable choice.

Message 7 of 9
(4,794 Views)

Hi RyanB,

 

You make a note of "local variable" that "Local will a flip-flop in the path".

May I ask more questions about this point ?

 

First, there must be one flip-flop or register corresponding to a "control (or indicator) " with

additional logic and I denote the output of this flip-flop by the letter "Q".

 

Suppose I use a local variable to access the control (or indicator), and I denote the access

point by the letter "A" .

 

Will an additional flip-flop be implemented between path QA and the output of this additional 

flip-flop will be connected to point "A" when compiling the LabVIEW  FPGA code?

 

Dose LabVIEW FPGA use the same way when the local variable is in another clock domain?

If so, how to ensure data coherency and avoid the problem arising from metastablility?

 

Thanks for your help.

 

Godel

0 Kudos
Message 8 of 9
(4,445 Views)

Hi Godel,

 

Since this discussion thread is over 3 years old, it would be better to start a new thread with your specific questions to get quicker help.

 

I did a bit of research on your question, and found this helpful White Paper (http://www.ni.com/white-paper/7727/en/) that discusses the resources used for components in LV FPGA code. For local variables (although it depends on hardware), it looks like it uses Flip-flops and LUTs.

 

As for using local variables with different clock rates, I found this KnowledgeBase article that might help shed some light on your question - some issues can arise from using them with more than one clock rate (http://digital.ni.com/public.nsf/allkb/C683585460E88508862570D1006B7434)

 

Hope this helps! Again, if you have follow-up questions, I would definitely recommend creating a new thread

Xavier
0 Kudos
Message 9 of 9
(4,408 Views)