making the most of your fpga design - niaustralia.ni.com/sites/default/files/making the most of...
TRANSCRIPT
![Page 1: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/1.jpg)
ni.com
Making the Most of your FPGA Design
Rejwan Ali
Marketing Engineer
![Page 2: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/2.jpg)
ni.com
Overview
• Introduction to “Making the most”
• Maintainability through Simulation
• Creating Scalable LVFPGA
• Reactor Pattern in LVFPGA
![Page 3: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/3.jpg)
ni.com
Making the Most of our FPGA
Maintainable – The code is easy to test and
changeScalable – Maximize FPGA capabilities
![Page 4: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/4.jpg)
4ni.com
LabVIEW FPGA
• Reconfigurable I/O
• Custom hardware algorithms
![Page 5: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/5.jpg)
5ni.com
LV FPGA Development Process
Requirements
Design
Implement
Test
Deploy
![Page 6: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/6.jpg)
6ni.com
LV FPGA Development Process
Implement
Compile
Test
![Page 7: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/7.jpg)
7ni.com
LV FPGA Development Process
Implement
Compile
Test
15 sec
544 sec
65 sec
87% spent compiling
![Page 8: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/8.jpg)
8ni.com
Reduce Development Time
• Buy a faster compilation machine
• Improve the compiler (Xilinx, NI)
• Simulation
ni.com/trycompilecloud
![Page 9: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/9.jpg)
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
![Page 10: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/10.jpg)
10ni.com
Simulation On Windows
Pre-FPGA
WindowsFPGA code Post-
FPGA
Windows
![Page 11: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/11.jpg)
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
![Page 12: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/12.jpg)
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
![Page 13: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/13.jpg)
13ni.com
Development Computer with Simulated I/O
1.
2.
![Page 14: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/14.jpg)
14ni.com
Development Computer with Simulated I/O
![Page 15: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/15.jpg)
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
![Page 16: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/16.jpg)
16ni.com
Conditional Disable
Allows changing FPGA source easily by switching
between FPGA and Development Computer context
![Page 17: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/17.jpg)
17ni.com
Conditional Disable
Quick
Changes functionality automatically
+Branches code
Windows VIs unsupported
-
![Page 18: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/18.jpg)
18ni.com
LV FPGA Desktop Execution Node
LV FPGA
Host-side
![Page 19: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/19.jpg)
19ni.com
LV FPGA Desktop Execution Node
![Page 20: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/20.jpg)
20ni.com
LV FPGA Desktop Execution Node
Test Harness
Unit Test
![Page 21: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/21.jpg)
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
![Page 22: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/22.jpg)
22ni.com
Testbench
Embedded Testbench – An application which verifies functionality of software and hardware through simulation
![Page 23: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/23.jpg)
23ni.com
Testbench
I/O Simulation
Testbench
FPGA
Example
FPGA Interface
![Page 24: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/24.jpg)
24ni.com
Testbench
Full Simulation
Test FPGA Interface
UI available
Customizable I/O
Waveform Probes
+Ensure Simulation starts first
-
Use case: System testing
![Page 25: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/25.jpg)
25ni.com
Scalable LabVIEW FPGA
How difficult to scale this FPGA Code?
![Page 26: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/26.jpg)
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
![Page 27: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/27.jpg)
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?
![Page 28: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/28.jpg)
28ni.com
Purple Wires
VI-Defined
Local FIFOs
Memory
Registers
References
Inputs
Outputs
DMA FIFOs
Local FIFOs
Memory
Registers
Timing
Sources
![Page 29: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/29.jpg)
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
![Page 30: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/30.jpg)
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
![Page 31: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/31.jpg)
33ni.com
Reactor Pattern
Reactor Pattern– A design pattern for handling information that is being sent concurrently. Very common is networking software.
![Page 32: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/32.jpg)
34ni.com
Reactor Pattern
Channel 0
Channel 1
Channel N
Channel 2
……..
Dispatcher Aggregator
Host Application
FPGA
Local FIFODMA FIFO
![Page 33: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/33.jpg)
37ni.com
Reactor Pattern
Advantages
• Very scalable
• Works on all NI Targets
• Concurrency
Disadvantages
• Difficult without simulation
• FIFO sizing can be tricky
![Page 34: Making the Most of your FPGA Design - NIaustralia.ni.com/sites/default/files/Making The Most Of FPGA.pdf · Making the Most of your FPGA Design Rejwan Ali Marketing Engineer. ni.com](https://reader031.vdocument.in/reader031/viewer/2022030500/5aabf6697f8b9a2e088c7d60/html5/thumbnails/34.jpg)
39ni.com
Maintainable Scalable
Questions