FPGA Lesson 3 (Host Interface)

20
LabVIEW FPGA and the PXI- 7831R Training

description

fpga host interface

Transcript of FPGA Lesson 3 (Host Interface)

Page 1: FPGA Lesson 3 (Host Interface)

LabVIEW FPGA and the PXI-7831R Training

Page 2: FPGA Lesson 3 (Host Interface)

Lesson 3Host Interface, Interrupts, FPGA\Host

Synchronization

Chad EvansApplications Engineer

Page 3: FPGA Lesson 3 (Host Interface)

• Used to control and communicate with the FPGA VI from RT or Windows

• Either on RT or Windows, depending on the final Run-Time configuration

Host Interface VI

Page 4: FPGA Lesson 3 (Host Interface)

LabVIEW FPGA Host Functions

• Built on top of VISA (Virtual Instrument Software Architecture)

Page 5: FPGA Lesson 3 (Host Interface)

RIO Host Interface Palette

Open VI Reference

Close VI Reference

Read/Write Control

Invoke Method

Page 6: FPGA Lesson 3 (Host Interface)

Open VI Reference• Edit Time

– Selected Target VI (FPGA VI) used to determine available controls

– Selected VI becomes a hidden subVI of the Open VI Reference

– Uses RIO board 0 by default• Run Time

– Downloads the selected VI (bit file) to FPGA unless already downloaded

– Returns a reference

Page 7: FPGA Lesson 3 (Host Interface)

External VISA Input

• Allows user to programmatically select board

• Useful for built applications

Page 8: FPGA Lesson 3 (Host Interface)

Board Selection (Relative)1. Select FPGA menu item2. Select Board

Page 9: FPGA Lesson 3 (Host Interface)

Close VI Reference

Aborts the VI on the FPGA

Leaves the FPGA VI running

Page 10: FPGA Lesson 3 (Host Interface)

Read/Write Control (Edit Time)

*

Page 11: FPGA Lesson 3 (Host Interface)

Read/Write Control (Run Time)

• The controls (or indicators) are written (or read) in the order they appear in the Read/Write Control

• Reads and Writes are double buffered• Complex data, such as arrays and clusters are supported

Page 12: FPGA Lesson 3 (Host Interface)

Exercise 3.1

• To create a Host Interface VI (to run on the RT PXI Controller) for the VI created in Exercise 2.1 (Digital I/O VI).

Page 13: FPGA Lesson 3 (Host Interface)

• Run• Download (Force Download reinitializes)• Wait on IRQ

• Acknowledge IRQ• Abort

Invoke Method

Page 14: FPGA Lesson 3 (Host Interface)

Wait on IRQ

• Only one should be called at a time• IRQ Number(s) – Will accept an array of IRQ numbers• Timeout – milliseconds, -1 to never timeout• Timed Out – returns true for Timeout, false for interrupt• IRQ(s) Asserted – returns array of all IRQ’s asserted

.

..

0

31M

ASK ...

IRQ Line

Written by this VI

Page 15: FPGA Lesson 3 (Host Interface)

Acknowledge IRQ

• Clears logical interrupts specified by IRQ Number(s)

Page 16: FPGA Lesson 3 (Host Interface)

RIO/Host Synchronization

Host

FPGA

Page 17: FPGA Lesson 3 (Host Interface)

Polling

• Depending on the application, polling may be a better solution than using interrupts.

Page 18: FPGA Lesson 3 (Host Interface)

How do I know if the host is fast enough?

• Ideas for checking that the host is keeping up– See examples

• C:\Program Files\National Instruments\LabVIEW 7.0\examples\FPGA\Host Synchronization

– Compare Loop Timer times– Use handshaking through controls/indicators

• Read an iteration indicator with each read to verify that only one iteration transpired.

– Be clever, build your own!

Page 19: FPGA Lesson 3 (Host Interface)

Exercise 3.2

• To create a Host VI for the FPGA VI created in Exercise 2.2 (Timed AI/AO with Interrupts).

Page 20: FPGA Lesson 3 (Host Interface)

Lesson 3 Summary

• FPGA Interface is what controls and communicates with the FPGA VI

• Use Interrupts for synchronizing FPGA VI and Host VI