LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA Memory Items and Lookup Table Usage

Hello,

Another day, another FPGA question... 

I'm overmapping on my compilation and trying to reduce lookup table (LUT) usage, since that's the problematic area.  Removing some front panel arrays seems like a good way to do this. 

Here's the scenario: I have two loops acquiring analog inputs.  One loop has a lot of calculations and is substantially slower than the other.  The other, faster loop, is also aquiring, and sending data off to the host via a DMA FIFO.  The slower loop was using a front panel array to transfer data because I'm using all three DMA channels already, and I'm trying to eliminate that array.

So... it would be really nice to read the data from the slower loop and append it to the data from the faster loop, sending both sets of data through the same DMA FIFO.  I'm thinking that I can use a "memory item" to do this, having the slow loop write to the memory, and having the fast loop read from it.

Two questions:  Is this solution feasible, and will it reduce my LUT usage?

Thanks,

Jim
0 Kudos
Message 1 of 5
(6,421 Views)
I suggest that the easiest way to handle this is to replace your front panel array indicator with a single element and a boolean to indicate that the element has been read and is ready for the next element.  NI refers to this approach as handshaking.  You can also use an interrupt (IRQ) in place of the boolean.

If you have implemented your slow and fast loops using different clock domains, you cannot use a memory block to transfer data between them.  You can use a FIFO but if your fast loop generates data much faster than your slow loop you will need to compensate for the case when the stream of data from your slow loop is empty.
0 Kudos
Message 2 of 5
(6,405 Views)
Thanks Nathan,

I'm not using different clock domains, so I think the memory block should work (fingers crossed).  I just heard from NI R&D that interrupts don't work within the FPGA scope - they only work between the host VI and the FPGA VI, but the boolean handshake seems like a viable idea if the memory doesn't work out...  I agree - a FIFO isn't going to cut it because the consumer would be reading the FIFO a lot faster than the producer would be writing to it.  I need something equivalant to a notifier in FPGA, and I think the memory could be my best bet.

Thanks for the suggestions...

Jim
0 Kudos
Message 3 of 5
(6,394 Views)
Hi Jim - there must have been a misunderstanding here; I was suggesting that you can use an IRQ instead of a boolean to do your handshaking with the host, not for communication between loops on the FPGA.  In my experience it's simple to set up handshaking and, according to NI, it's much more efficient than a front panel array.  However if you don't have clock rate problems a memory block should be fine.
0 Kudos
Message 4 of 5
(6,387 Views)
Ah, I understand.  I was on a different wavelength, apparently.  Right - handshaking would absolutely work for transferring to the host, and that's another route I could go.  I was thinking so hard about transferring stuff between loops that I missed the concept... (Coffee break?)  Thanks again for your help.

Jim
0 Kudos
Message 5 of 5
(6,382 Views)