版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Lesson 8Optimizing FPGA Application for Speed and SizeBenchmarkingHow LabVIEW is Transformed for FPGAOptimizing for SpeedOptimizing for SizeA. Benchmarking1 Tick = 1 Clock cycleClock cycle depends on compile rate (Default 40 MHz) 32-bit counter increments on rising edge of the clockThe Tick Count VI
2、 returns the counter valueBenchmark the Loop Rate of a VIBenchmark the Loop Rate of a VITimestamp each iterationCalculate the differenceMeasurements done in parallel*Code can be removed later*Take advantage of parallel execution of FPGABenchmark the Execution Time of a VIGet initial timeExecute code
3、Get final timeCalculate the differenceMeasurements done in parallel*Code can be removed later*Take advantage of parallel execution of FPGABenchmarking the Size of a VISpeedTheoretical maximum compile rate shown in parenthesisSizeIOBs Input/output blocksMULT18X18s multipliersSLICEs Combination of loo
4、kup tables (LUTs) and flip flops (FFs)BUFGMUXs portal to the clock net, which clocks FFsB. How LabVIEW is Transformed for FPGAThree components necessary to maintain data flowThe corresponding logic functionSynchronizationThe enable chainEnforcing Dataflow in FPGAEnforcing Dataflow in FPGA (Continued
5、)C. Optimizing for SpeedParallel LoopsPipeliningSingle-Cycle Timed LoopsParallel ExecutionGraphical programming promotes parallel code architecturesLabVIEW Windows and Real-Time serialize executionLabVIEW FPGA implements truly parallel executionParallel Execution ExampleLoop rates limited by longest
6、 pathAI takes 170 ticks, DI takes 1 tickSeparate functions to allow DI to run independent of AI173 Ticks 4.3Sec4 Ticks .1 SecPipeliningWithin a loop you can separate your code into different loop iterations to reduce the length of each iterationHandle different parts of the process flow in parallel
7、within one loop iterationPass data to the next iteration using shift registersPipelining Example720 clock cycles (18 s)365 clock cycles (9.13 s)Single-Cycle Timed Loop (SCTL)Loop contents execute in a single clock periodMinimizes synchronization and enable chain overheadHowever, there are restrictio
8、nsSome VIs and functions cant be used in the loop at allAnalog input, analog outputNested loopsAny that require more than a single clock cycle to executeShared resourcesLoop timerWaitSCTL ExampleSaved 5 Ticks by placing this code in a SCTL1 Tick6 TicksImproving Loop PerformanceWhat to do if your dia
9、gram executes too slowly?12 clock cycles12345678910FFsFFsFFsFFsFFsFFsFFsFFsFFsFFsFFsFFsFFsFFs1112Reduce the Depth of the Data FlowShorten the longest path9 clock cycles1234567FFsFFsFFsFFsFFsFFsFFsFFsFFsFFsFFsFFs89Pipeline the DiagramWatch out for pipeline effects6 clock cycles1234FFsFFsFFsFFsFFsFFsF
10、FsFFsFFsFFsFFsFFs56Use the Single-Cycle Timed LoopEliminates synchronization and enables chain in the loop1 clock cycle1FFsFFsFFsFFsFFsD. Optimizing for SizeSubVIsFront Panel ObjectsDatatypesFunctions Using Lots of SpaceSingle-Cycle Timed LoopsNon-reentrant subVI is a shared resourceSlower execution
11、Less space (generally)Sharing SubVIsReentrant subVI recreates logic for each instanceFaster executionMore space (generally)Reentrant Non-Reentrant Number of MULT18X18s 18 out of 40 45%3 out of 40 7%Number of SLICEs 2116 out of 5120 41%2028 out of 5120 39%Limit Front Panel Objects (FPO)Have additiona
12、l logic to control data transfers to/from hostFront panel arrays are very expensiveReduce array sizeStore data in user memory insteadBetter Data Transfer MethodUse scalars to pass data between FPGA memory and the host. Using a front panel array to pass data to the host takes up a significant portion
13、 of FPGA space.Use Minimum Datatype NecessaryDatatype BitpackingCombine small datatypes into a 32-bit numericReduces front panel objectsFaster data transfers to/from hostSplit NumberFunctions Using Lots of Space Quotient Remainder Scale By Power of 2 (Use a constant for power) Array Functions (Use c
14、onstants where possible)FFsFFsFFsFFsFFsFFsFFsFFsFFsFFsFFsFFsFFsSingle-Cycle Timed Loop Removes Enable Chain OverheadFFsOptimize for Size ExampleThis VI is too large to compile.Optimize for Size Example (Continued)This VI takes 21% of the 1M gate FPGA. Optimize for Size Example (Continued)This VI takes 9% of the FPGA.Optimize for Size Example (Continued)This VI uses 8% of the FPGA.SummaryUse Timing VIs to benchmark the codeFPGA uses an enable chain to maintain dataflowImprove speed performance byReducing depth of dataflow pathUsing p
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年武汉海事职业学院马克思主义基本原理概论期末考试模拟题附答案解析(必刷)
- 2025年夏县幼儿园教师招教考试备考题库附答案解析
- 2025年江苏城乡建设职业学院马克思主义基本原理概论期末考试模拟题含答案解析(夺冠)
- 2025年审计工作人员面试题库及答案
- 2025年中工教育保教笔试及答案
- 2025年公务员网上面试题库答案
- 2025年德保质监站事业编考试及答案
- 2025年邮政校园招聘在线笔试及答案
- 2025年盐城盐都区事业单位考试及答案
- 2025年云阳县事业单位面试题库及答案
- 2026年上海市宝山区初三上学期一模化学试卷和答案及评分标准
- 内蒙古赤峰市松山区2025-2026学年高一上学期期末数学试题(含答案)
- 2026年官方标准版离婚协议书
- 二十届中纪委五次全会知识测试题及答案解析
- 黑龙江大庆市2026届高三年级第二次教学质量检测化学(含答案)
- 未来五年造纸及纸制品企业数字化转型与智慧升级战略分析研究报告
- 2025年贵州省高考化学试卷真题(含答案及解析)
- 紧固件 弹簧垫圈 标准型(2025版)
- 2025年数字印刷技术应用项目可行性研究报告
- 2024年第41届全国中学生竞赛预赛物理试题(解析版)
- 民间借贷合同规范示范文本
评论
0/150
提交评论