LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA Design pattern

Solved!
Go to solution

Hi, I want to use the object-oriented-programming to program for the FPGA, the FPGA wil control a pumpe to create pressure, is there any advise for the design pattern?

0 Kudos
Message 1 of 6
(4,391 Views)
Solution
Accepted by topic author alre

It seems that not all features of LabVIEW OO are available in FPGA.  I'm guessing things like dynamic dispatch aren't something that can be represented in gates easily.

 

http://zone.ni.com/reference/en-XX/help/371599H-01/lvfpgaconcepts/fpgaclassesinvis/

 

http://digital.ni.com/public.nsf/allkb/376C9F5112F10A8C8625795A0059D2D5

 

I've never needed OO in FPGA.  Usually OO is great for flexibility and ever changing requirements, and to me an FPGA is usually a very dedicated piece of hardware doing a specified task that it can do deterministically.  These two things in my mind don't mesh well.

Message 2 of 6
(4,363 Views)
Solution
Accepted by topic author alre

While I agree with what hooovahh posted in that LVOOP on FPGA strikes me as forign that does not rule out applying OO paterns to define the design and the interface presented by the FPGA.

 

Example:

Factory Pattern - On RT offers a variety of modes of operation for the FPGA under RT and the appropriate bit file file is loaded the make the realize the mystery-magic machine spit out by the Factory Pattern.

 

Just my 2 cents,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 6
(4,360 Views)

Thank you for all your answer.

0 Kudos
Message 4 of 6
(4,326 Views)

As one of the developers of LabVIEW Class support on FPGA, I might be a bit biased : ) but there are many use cases for classes on the FPGA. As others have previously mentioned, the FPGA compiler doesn't currently support all of the features of LabVIEW classes, but the features it does support are still quite powerful.

 

For instance, run-time dynamic dispatch is not supported, but dynamic dispatch calls that can be determined at compile-time are. Therefore, one can design libraries that are generic across multiple families of targets, servos, I/O adapters, etc. and quickly create small composite classes that define the proper behavior for each specific use case. 

 

I have personally helped some customers refactor some complicated multi-target code into simpler, actor-driven designs using classes to help wrap the customizable (e.g. pluggable) behaviors.

 

Also, keep in mind that classes can be used for OO design, but they are not strictly for OO design. You can use features of classes for other design patterns without having to use OO. For instance, you can do a more aspect-oriented design using classes if that suits your application better.

 

LabVIEW classes are still in their infancy in hardware designs, and not just for LabVIEW but for the entire hardware industry. So I would love to see some of your designs and talk through on the forums how they can be class-ified : )

Message 5 of 6
(4,084 Views)

Oh, and for those that are worried about performance implications of classes, I wanted to mention that classes are optimized as efficiently as any other feature by the LabVIEW FPGA compiler.

 

In other words, the LabVIEW class abstraction does not add any overhead that would not be required by your application anyway for what you are trying to solve. Essentially, the classes are lowered to clusters and the compiler optimizes them like they would any application that does not use classes.

0 Kudos
Message 6 of 6
(4,080 Views)