LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FIFO reports "Ready for Input" to be false despite never writing anything to FIFO

Here's my FPGA code

Not Ready FPGA.png

Here's my RT code

Not Ready RT.png

 

I would expect "Ready" to always be true because "enable" is staying false and there should always be room on the FPGA block ram.  But, when I run the above code on RT, the first time it reports 0 "not ready"s the second time I get 92 for "Not Ready" and the third time I get 184 meaning there were 92 cycles where the FIFO is unavailable. Is that expected behavior?

 

I should add that I'm running this on an NI Linux RIO target (sbRIO 9627)

 

0 Kudos
Message 1 of 11
(4,023 Views)

Your buffer 1000000 points. And as I see, you run FPGA code at 80 MHz. So, for full FIFO enough 1/80 sec or 12,4 ms. May be your RT code can't take data from FIFO enough fast.

0 Kudos
Message 2 of 11
(3,975 Views)

The enable boolean is always false. There should be no actual data being transfered.

0 Kudos
Message 3 of 11
(3,949 Views)

Oh, I see. Try use FIFO.Start after FIFO.conf.

0 Kudos
Message 4 of 11
(3,935 Views)

I tried and it makes no difference

0 Kudos
Message 5 of 11
(3,929 Views)

Are the FPGA running? 

I don't see a Start for the FPGA. 

0 Kudos
Message 6 of 11
(3,915 Views)

I have "Run" set in the configuration of "Open FPGA VI Reference" and I don't see how "not ready" could be incrementing if the FPGA wasn't running.

0 Kudos
Message 7 of 11
(3,881 Views)

Hello nanocyte,

 

Thanks for the post! I think there might be a mix up in our understanding of "Ready for Input".

 

According to the help manual "Ready for Input returns TRUE if this node is ready to accept new input data." 

 

Write (FIFO Method) - https://zone.ni.com/reference/en-XX/help/371599K-01/lvfpga/fifo_write/

 

This mean that it will only be true once it finishes an operation. So if we never finish an operation since we never get "Input Valid" as true, we shouldn't expect "Ready for Input" to be true either. I believe what you are seeing in "Not Ready Count" is expected.

 

Moving past that, if you have a specific throughput applciaiton in mind this interface method would make more sense.

 

There is a good walk through of how handshaking is supposed to work in the walk through below.

 

Scheduling Timing Using Handshaking Signals (FPGA Module) - http://zone.ni.com/reference/en-XX/help/371599F-01/lvfpgaconcepts/fpga_handshaking/

 

JY
Application Engineer, RF and Communications
National Instruments
0 Kudos
Message 8 of 11
(3,861 Views)

A) Why wouln't the node be ready for input before it's completed some operation?

B) If that were the case, we'd expect ready to always be false and that is not true either. I can run the FPGA in interactive mode and it would be a free running counter but that is not the case. I could put a delay in after the first "not ready count" read and expect a different number on the second read. That's not the case either. Ready is false for 92 itterations some time after my last  "not ready count". It seems sort of arbitrary and a little scary.

0 Kudos
Message 9 of 11
(3,852 Views)

Hey Nanocyte,

 

Do you ever do a manual 'Download' method call from the host (after that 'Not Ready 2' read)? Could you try placing one right after the open?

 

What is the behavior if you copy-paste your code again, so that you have 'Not Ready [1-4] all in series at the end?

 

Try wiring an initial value of 0 to that feedback node on your counter. Does that change the behavior between runs? (you could potentially do this instead of my first suggestion).

 

I'd expect your first 'Not Ready Count' to be 0. Then you're reconfiguring the FIFO, which means you're stopping it if it's running, configuring the host-side buffer, then restarting it when you do your next read. I think (guessing here) 'Ready for Input' is going false while that configuration is happening, even though the FPGA-side buffer has plenty of room available. It goes up by 92 each time you run this because the memory for that feedback node isn't being reinitialized between runs.

 

Another theory is that a reset is happening, and the synchronization between your logic (80MHz) and the DMA bus logic(125MHz?) takes 92 cycles to happen.

Cheers!

TJ G
Message 10 of 11
(3,840 Views)