Escolar Documentos
Profissional Documentos
Cultura Documentos
Topic:
A. General FPGA Programming Techniques
Agenda
FPGA Palette
Basic FPGA VI
Parallelism and Shared Resources
Integer Math Issues
FPGA Palette
FPGA specific functions
Programming structures
Device I/O
Arithmetic and Boolean Logic
Arrays and clusters
Timing
Math and control functions
Synchronization and FIFOs
Lookup tables
Basic FPGA VI
F=(A+B)CD
A
B
C
D
Compile
Server
Download
Windows OS
LabVIEW FPGA Module
Occurs automatically
after a compile
initiated by the run
button
FPGA VI
Bit File Embedded
Target FPGA
Download
FPGA VI (actually
the bit file)
Interactive Mode
Windows OS
LabVIEW FPGA Module
FPGA VI
(Front Panel)
Updates
FPGA VI
(running)
VI
(Front Panel)
Updates
FPGA VI
(running)
Windows OS
LabVIEW FPGA Module
(targeted to Windows)
Debugging possible
FPGA VI
Exercise 2.1
Create a VI which adds two
numbers and runs a
benchmark in parallel that
determines how fast code is
running
exercise_2.1.doc
Shared Resources
Before a task can begin using a shared resource, it must wait until it
is free.
Task 1
Shared
Task 2
Resource
Running
Waiting
Task 1
Shared
Task 2
Resource
Waiting
Running
Sharing Resources
Shared Resources:
Digital Outputs
Memory/FIFOs
Non-Reentrant VIs
Local Variables
Reentrant VI
Separate set of gates on the FPGA device for each instance
on the diagram (uses more space)
Configure by Right-Clinking on Resource and selecting Properties
Integer Math
No floating point
Singles and doubles type
are not supported
Integer Math
Scaling of data required for analysis and output operations
Replaces floating point multiplication/division on the FPGA
Most useful for 16-bit integers, use 32-bit width during calculation
Operations
Multiply value by integer scaling factor
Scale result by a predetermined power of 2
Combined effect provides non-integer multiplication
Integer Math
For variable scaling, you can determine and set the scaling
factor and bit shift from the host application
Integer Math
Saturation Arithmetic VIs
used to handle or avoid
integer overflow when
performing mathematical
operations
Two types of results when
overflow
-Saturate
-Wrap