Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of...
-
Upload
nguyenkhanh -
Category
Documents
-
view
215 -
download
0
Transcript of Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of...
ni.com
Making the Most of your FPGA Design
Rejwan Ali
Marketing Engineer
ni.com
Overview
• Introduction to “Making the most”
• Maintainability through Simulation
• Creating Scalable LVFPGA
• Reactor Pattern in LVFPGA
ni.com
Making the Most of our FPGA
Maintainable – The code is easy to test and
changeScalable – Maximize FPGA capabilities
4ni.com
LabVIEW FPGA
• Reconfigurable I/O
• Custom hardware algorithms
5ni.com
LV FPGA Development Process
Requirements
Design
Implement
Test
Deploy
6ni.com
LV FPGA Development Process
Implement
Compile
Test
7ni.com
LV FPGA Development Process
Implement
Compile
Test
15 sec
544 sec
65 sec
87% spent compiling
8ni.com
Reduce Development Time
• Buy a faster compilation machine
• Improve the compiler (Xilinx, NI)
• Simulation
ni.com/trycompilecloud
9ni.com
Simulation
Simulation– The imitation of the operation of a real-world system over time.
LVFPGA Simulation Options
1. Simulation on Windows
2. Development Computer with Simulated I/O
3. Conditional Disable Structures
4. LVFPGA Desktop Execution Node
5. Testbench
10ni.com
Simulation On Windows
Pre-FPGA
WindowsFPGA code Post-
FPGA
Windows
11ni.com
Simulation On Windows
Quick
Good for inline algorithms
Allows Windows VIs
+No/incorrect timing
I/O does not work
Code snipetsonly
-
Use case: Quick functionality
12ni.com
Development Computer with Simulated I/O
FPGA Target Press RunGenerate
VHDLCompile
BitfileRun on
Hardware
Development Computer w/
Sim I/OPress Run
Run Diagram on Windows (Simulation)
Debug Code
13ni.com
Development Computer with Simulated I/O
1.
2.
14ni.com
Development Computer with Simulated I/O
15ni.com
Development Computer with Simulated I/O
Full simulation
Memory, FIFOs and I/O supported
Standard debug tool available
+Inputs are random data by default
Windows VIs unsupported on FPGA
-
Use case: Functional test
16ni.com
Conditional Disable
Allows changing FPGA source easily by switching
between FPGA and Development Computer context
17ni.com
Conditional Disable
Quick
Changes functionality automatically
+Branches code
Windows VIs unsupported
-
18ni.com
LV FPGA Desktop Execution Node
LV FPGA
Host-side
19ni.com
LV FPGA Desktop Execution Node
20ni.com
LV FPGA Desktop Execution Node
Test Harness
Unit Test
21ni.com
LV FPGA Desktop Execution Node
Iteration Accurate
Simulates I/O
Memory and FIFO supported
+Not Tick Accurate
-
Use case: Unit Testing &
Integration Testing
22ni.com
Testbench
Embedded Testbench – An application which verifies functionality of software and hardware through simulation
23ni.com
Testbench
I/O Simulation
Testbench
FPGA
Example
FPGA Interface
24ni.com
Testbench
Full Simulation
Test FPGA Interface
UI available
Customizable I/O
Waveform Probes
+Ensure Simulation starts first
-
Use case: System testing
25ni.com
Scalable LabVIEW FPGA
How difficult to scale this FPGA Code?
26ni.com
Scalable LabVIEW FPGA
1. Copy/Paste
2. Change IO
3. Add more memory blocks to
the project
4. Add more DMA FIFOs
5. Change the names of
controls and indicators
DO NOT DO THIS:
• Unmaintainable
• Limited DMA FIFOs
• Huge Diagrams make it hard to debug/simulate
27ni.com
Scalable SubVIs
1. Create SubVI
2. Copy SubVIs
3. …..
4. Profit???
Problems:
1. I/O is incorrect
2. Same memory blocks in each copy
3. Same DMA FIFO in each SubVI
4. How do we change the Delay?
28ni.com
Purple Wires
VI-Defined
Local FIFOs
Memory
Registers
References
Inputs
Outputs
DMA FIFOs
Local FIFOs
Memory
Registers
Timing
Sources
29ni.com
Single-cycle Timed Loops
Problems
• Some hardware MUST be run inside a SCTL
• SCTL is not compatible with some operations
Not allowed in
SCTL
30ni.com
Single-cycle Timed Loops
Bonus
• SCTL code can be used in non-SCTL locations
• SCTL code is typically smaller than non-SCTL
• SCTL code is very deterministic
33ni.com
Reactor Pattern
Reactor Pattern– A design pattern for handling information that is being sent concurrently. Very common is networking software.
34ni.com
Reactor Pattern
Channel 0
Channel 1
Channel N
Channel 2
……..
Dispatcher Aggregator
Host Application
FPGA
Local FIFODMA FIFO
37ni.com
Reactor Pattern
Advantages
• Very scalable
• Works on all NI Targets
• Concurrency
Disadvantages
• Difficult without simulation
• FIFO sizing can be tricky
39ni.com
Maintainable Scalable
Questions