版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
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. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 藝術(shù)品交易鑒定規(guī)則
- 如何做一個(gè)企業(yè)規(guī)劃
- 課件重要理念教學(xué)課件
- 潔凈區(qū)的管理
- 初中日語(yǔ)人教版七年級(jí)全冊(cè)+八年級(jí)一二單元單詞聽(tīng)寫(xiě) 課件
- 端午節(jié)團(tuán)隊(duì)活動(dòng)策劃
- 兒童抽搐應(yīng)急措施
- 快速性心律失常藥物治療
- 初中地理教案課后反思
- 級(jí)神奇的紙說(shuō)課稿
- 人民調(diào)解講稿課件
- 新蘇科版八年級(jí)上冊(cè)初中數(shù)學(xué)全冊(cè)教案
- 變截面現(xiàn)澆連續(xù)箱梁支架法施工方案
- 機(jī)械傷害應(yīng)急預(yù)案演練記錄
- 整體施工方案施工組織總體設(shè)想、方案針對(duì)性和施工劃分
- 拼音拼讀練習(xí)過(guò)關(guān)訓(xùn)練(無(wú)漢字)
- 乳腺癌相關(guān)解剖和手術(shù)技巧體會(huì)-PPT課件
- 電廠氨區(qū)液氨儲(chǔ)罐置換方案
- 地理說(shuō)課ppt課件
- ket分類詞匯表
- 茶藝館會(huì)員制度管理辦法
評(píng)論
0/150
提交評(píng)論