12-31-2011 08:36 AM - edited 12-31-2011 08:38 AM
I built a LVOOP class that I would like to re-use on different FPGA VIs. It's wonderful that LVOOP classes can be used on FPGA targets in the first place!!
However, my initial enthusiasm was severely dampened by the fact that my LV 2010 (SP1) was constantly causing problems during compilation:
Hoping that these bugs are fixed in LV2011, I opened the project there. At least, it doesn't crash anymore during compilation, but now I am confronted with another error message: "FPGA targets do not support classes that contain the refnum data type." That was a big disappointment as my original LVOOP class provides functionailty for an on-board buffer that should help me to prevent buffer overflows in the FPGA-to-host FIFO buffer (see attachments for LV2011 and LV2010 versions of the class). With the aim to create a class than can be flexible used with different memory sizes, I used a FPGA memory reference that can be created in the FPGA main VI with the VI-Defined Memory Configuration [nirviLrmPalette_MergeVI_Memory.vi].
Can anybody explain me, why the refnum data type should be a problem on FPGA targets? I just would like to understand...
12-31-2011 11:20 AM
My attempt to do it without LVOOP also failed. I now put all the previous object data into a cluster that his handed on between different VIs (corresponding to the previous class methods).
I have to keep the cluster values in a shift register of a loop in the FPGA main VI. The error message causing a broken main VI is: "Shift Register: Possibility of Dynamic Refnum not supported for current target. Details: Refnums must be constant references in the current target. This construct could potentially cause a reference to be dynamic."
This, again, does not make sense to me as the memory references are type-bound to the underlying data type stored in the FPGA memory (U16) in my case.
See attachment for the library now replacing the original class (LV2010 code).
01-11-2012 10:21 AM
Hi dlanger,
First, sorry about the delay in getting back to you. I've done some looking into this issue, and the issue here is with how the refnum translates onto the FPGA. Specifically, when you place a reference to memory in your FPGA code, the connection between that memory and the code accessing it is hardwired by the FPGA. Placing a memory reference into a shift register or a class creates the possibility that the memory reference could change to point at a different block of memory during the program's operation. FPGAs cannot be reprogrammed dynamically, which is why you're receiving those error messages.
Please post back if you have any additional questions.
01-11-2012 11:15 AM
Thanks, Dan! This explanation makes sense.
01-11-2012 11:25 AM
Glad I could help out!
01-12-2012 03:08 PM
Back to your original post ... there are several known issues with class support in the FPGA module, specifically in LabVIEW 2010 and 2011. I would suggest not using classes for the FPGA right now to keep from getting bit by subtle bugs. However, you should see fixes for these issues as well as new features for classes on the FPGA in a (near) future version of LabVIEW ; )