付费下载
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、LabVIEW FPGA Algorithm Design Digital Protocol Case StudyFPGA Design FlowState MachinesReset BehaviorsSimulation and Debug in LabVIEWLabVIEW FPGA Algorithm Design Digital Protocol Case StudyState Machine TheoryStates represent logical configurations of the memory of a systemTransitions occur when ce
2、rtain input conditions are met, and can initiate actions and/or update outputs when entering or exiting a stateState A: Entry ActionState B: Entry ActionExit ActionTransition ConditionState Machine TheoryTransition Conditions are based on inputsEntry and Exit Actions update outputs, and are based on
3、 inputs and current stateState A: Entry ActionState B: Entry ActionExit ActionTransition ConditionState Machine ExampleYou are either programming or waiting on a compile to finish. When programming, your boss may tell you to hurry, at which point you press compile to initiate a compilation. After th
4、e computer is done compiling, it notifies you by indicating that it is done.Waiting: compile, done = FALSEProgramming:hurry = FALSEcompile = TRUEhurry = TRUEdone = TRUEState Machines in LabVIEWState-Specific Output LogicState-Specific Next State LogicGeneric Next State LogicGeneric Output LogicAddit
5、ional “State”Additional “State”State Machine TimingDecision and/or I/O rate = loop rate, by defaultMay want to dynamically support multiple rates, decouple decision-making and I/O rates, etc.Must conditionally execute state machine, introduce additional states, or modify action timing to “slow” exec
6、utionState-Specific Output LogicState-Specific Next State LogicGeneric Next State LogicGeneric Output LogicInputs sampled, next state selected, and outputs calculated each clock cycle/loop iterationState Machine TimingOption 1: Conditionally execute state machineOption 2: Wait state for every stateO
7、ption 3: One wait state, but must calculate subsequent transition in advanceOption 4: Wait in-state, but use entry and output actionsState Machine TimingOption 1: Conditionally execute state machineState-Specific Output LogicState-Specific Next State LogicGeneric Next State LogicGeneric Output Logic
8、State A: Entry ActionState C: Entry ActionExit ActionC A transitionState B: Entry ActionA B transitionB C transitionExit ActionExit ActionState Machine TimingOption 1: Conditionally execute state machineState A: Entry ActionState C: Entry ActionState B: Entry ActionState Machine TimingOption 1: Cond
9、itionally execute state machineClocking OptionsDivide by NSimpleLimited resolution and no operation close to loop rateState Machine TimingDirect Digital Synthesis (DDS)Fractional accumulator more complexHigh resolution and operation up to loop rateLogic clocked by state machine must be able to execu
10、te within minimum periodFor example: To execute at 26.6% of the loop rate (loop rate / 3.75), 75% of the time the code will execute every 4 loop iterations, and 25% of the time the code will execute every 3 loop iterations, so signals connected to state machine output must tolerate minimum (3 / loop
11、 rate) period.State Machine TimingOption 2: Wait state for every stateState A: Entry ActionState C: Entry ActionState B: Entry ActionWait AWait BWait CState Machine TimingOption 3: Single wait stateState A: Entry ActionState C: Entry ActionState B: Entry ActionWaitNext State = CNext State = ANext St
12、ate = BState Machine TimingOption 4: Wait in-stateState A: Entry ActionState C: Entry ActionState B: Entry ActionWaiting doneWaiting doneWaiting doneWaitingWaitingWaitingState Machine TimingComparing OptionsProsConsOption 1: Conditionally execute state machine Simple to implement in LabVIEW Easy to
13、support DDS-based rates Increased critical path length All code must execute at divided rateOption 2: Wait state for every state Minimal logic for highest loop frequencies State diagram complexity Increases width of state encoding (could enter critical path) Must execute wait state at least onceOpti
14、on 3: Single wait state Adds only one state Must reproduce much of the transition logic in wait state, or decide upon the following state (after wait) in prior state, adding latency Must execute wait state at least onceOption 4: Wait in-state Minimizes number of states Execution can occur at loop ra
15、te Adds some complexity to each state (calculate outputs upon first execution of state vs. each execution)Case Study: About SPISerial Peripheral InterfaceMaster/Slave architectureBi-directional, full-duplexMSB-firstClock must be gated by MasterActive low Slave SelectCPHA determines whether inputs la
16、tched on 1st or 2nd clock edgeCPOL determines polarity of clockSource: WikipediaCase Study: SPI ImplementationTo ensure explicit clock level, use digital output rather than clock output pin100 MHz target loop rate for 50 MHz SPI interface speedChoose Option 4, wait in-state representationUp to 32 bi
17、t data wordsData to write must be MSB-packedData read is LSB-packedTX control (toggled by host) latches data word and word length, initiates transferFPGA Design FlowDesign behavioral modelEstablish functional requirementsEstablish performance requirementsThroughput / SpeedPrecisionIncorporate target
18、 knowledge Use processor-optimized functions and toolkitsImplement structural IP on FPGARe-useLabVIEW built-inXilinx CORE GeneratorIPNet/NI LabsCreateLabVIEWConvert to FXPSchedule codeInside SCTLOutside SCTLVHDLSimulationFunctional simulation under My ComputerSimulated or previously-obtained dataCat
19、ches implementation errors before compilationCompileStart with target clock rateAnalyze timing margins and critical pathTestSimulated data at speedReal-world I/ODoes not meet timing or size requirementsCannot realize behavioral modelSimulation does not function correctly or meet performance requirem
20、entsDesign does not meet performance requirements in real-world operating conditionsFPGA Design FlowImplement structural IP on FPGARe-useLabVIEW built-inXilinx CORE GeneratorIPNet/NI LabsCreateLabVIEWConvert to FXPSchedule codeInside SCTLOutside SCTLVHDLSimulationFunctional simulation under My Compu
21、terSimulated or previously-obtained dataCatches implementation errors before compilationCompileStart with target clock rateAnalyze timing margins and critical pathTestSimulated data at speedReal-world I/ODoes not meet timing or size requirementsCannot realize behavioral modelSimulation does not func
22、tion correctly or meet performance requirementsDesign does not meet performance requirements in real-world operating conditionsDesign behavioral modelEstablish functional requirementsEstablish performance requirementsThroughput / SpeedPrecisionIncorporate target knowledge Use processor-optimized fun
23、ctions and toolkitsCase Study: Master SPI EngineLatch MISO and Toggle SCLKWait for TXAssert MOSI and Toggle SCLKRESETAssert MOSIToggle SCLKCPHA = 0CPHA = 1_SS = 0_SS = 1_SS = 1_SS = 0CCount HCPCCount HCPCCount HCPCCount HCPDCount = 0 & CPHA = 1- HCP Half Clock Period- CCount = HCP assumed for some t
24、ransitions- All cases have path to RESETDCount != 0DCount = 0 & CPHA = 0FPGA Design FlowSimulationFunctional simulation under My ComputerSimulated or previously-obtained dataCatches implementation errors before compilationCompileStart with target clock rateAnalyze timing margins and critical pathTes
25、tSimulated data at speedReal-world I/ODesign behavioral modelEstablish functional requirementsEstablish performance requirementsThroughput / SpeedPrecisionIncorporate target knowledge Use processor-optimized functions and toolkitsDoes not meet timing or size requirementsCannot realize behavioral mod
26、elSimulation does not function correctly or meet performance requirementsDesign does not meet performance requirements in real-world operating conditionsImplement structural IP on FPGARe-useLabVIEW built-inXilinx CORE GeneratorIPNet/NI LabsCreateLabVIEWConvert to FXPSchedule codeInside SCTLOutside S
27、CTLVHDLCase Study: Master SPI EngineLatch MISO and Toggle SCLKWait for TXAssert MOSI and Toggle SCLKRESETAssert MOSIToggle SCLKCPHA = 0CPHA = 1_SS = 0_SS = 1_SS = 1_SS = 0CCount HCPCCount HCPCCount HCPCCount HCPDCount = 0 & CPHA = 1DCount != 0DCount = 0 & CPHA = 0FPGA Design FlowImplement structural
28、 IP on FPGARe-useLabVIEW built-inXilinx CORE GeneratorIPNet/NI LabsCreateLabVIEWConvert to FXPSchedule codeInside SCTLOutside SCTLVHDLCompileStart with target clock rateAnalyze timing margins and critical pathTestSimulated data at speedReal-world I/ODesign behavioral modelEstablish functional requir
29、ementsEstablish performance requirementsThroughput / SpeedPrecisionIncorporate target knowledge Use processor-optimized functions and toolkitsDoes not meet timing or size requirementsCannot realize behavioral modelSimulation does not function correctly or meet performance requirementsDesign does not
30、 meet performance requirements in real-world operating conditionsSimulationFunctional simulation under My ComputerSimulated or previously-obtained dataCatches implementation errors before compilationCase Study: SPIDigital Debugging: Instrument the FPGA CodeCase Study: SPIDigital Debugging: Host Code
31、Case Study: SPIDigital Debugging: Host CodeCase Study: SPIDigital Debugging: Debug DisplayCase Study: SPIDigital Debugging: Debug DisplayLatch MISO and Toggle SCLKWait for TXAssert MOSI and Toggle SCLKRESETAssert MOSIToggle SCLKCPHA = 0CPHA = 1_SS = 0_SS = 1_SS = 1_SS = 0CCount HCPCCount HCPCCount H
32、CPCCount HCPDCount = 0 & CPHA = 1DCount != 0DCount = 0 & CPHA = 0Case Study: SPIDigital Debugging: Debug DisplayLatch MISO and Toggle SCLKWait for TXAssert MOSI and Toggle SCLKRESETAssert MOSIToggle SCLKCPHA = 0CPHA = 1_SS = 0_SS = 1_SS = 1_SS = 0CCount HCPCCount HCPCCount HCPCCount HCPDCount = 0 &
33、CPHA = 1DCount != 0DCount = 0 & CPHA = 0CPHA = 1Case Study: SPIDigital Debugging: Debug DisplayCPHA = 1Case Study: SPIDigital Debugging: Debug DisplayCPHA = 1CPOL = 1Case Study: SPIDigital Debugging: Debug DisplayCPHA = 0CPOL = 0Data Length = 8 Case Study: SPIDigital Debugging: Debug DisplayCPHA = 0
34、CPOL = 0Data Length = 32 Case Study: SPIDigital Debugging: Debug DisplayCPHA = 0CPOL = 0Data Length = 32HCP = 2 Case Study: SPIDigital Debugging: Slave StimulusTwo options:Build structural model of slave on FPGAComplete coverageMore challenging implementationEmulate slave behavior with test bench an
35、d / or fixed test vectorSimpler implementationMay not “respond” to all master stimulusCase Study: SPIDigital Debugging: Slave Stimulus (FPGA)Case Study: SPIDigital Debugging: Slave Stimulus (Host)Case Study: SPIDigital Debugging: Slave Stimulus (Host)CPHA = 0CPOL = 0Case Study: SPIDigital Debugging:
36、 Slave Stimulus (Host)CPHA = 1CPOL = 0Case Study: SPIDigital Debugging: Slave Stimulus (Host)CPHA = 1CPOL = 1FPGA Design FlowImplement structural IP on FPGARe-useLabVIEW built-inXilinx CORE GeneratorIPNet/NI LabsCreateLabVIEWConvert to FXPSchedule codeInside SCTLOutside SCTLVHDLSimulationFunctional
37、simulation under My ComputerSimulated or previously-obtained dataCatches implementation errors before compilationTestSimulated data at speedReal-world I/ODesign behavioral modelEstablish functional requirementsEstablish performance requirementsThroughput / SpeedPrecisionIncorporate target knowledge
38、Use processor-optimized functions and toolkitsDoes not meet timing or size requirementsCannot realize behavioral modelSimulation does not function correctly or meet performance requirementsDesign does not meet performance requirements in real-world operating conditionsCompileStart with target clock
39、rateAnalyze timing margins and critical pathCase Study: SPICompilationFPGA Design FlowImplement structural IP on FPGACreateLabVIEWVHDLRe-useLabVIEW built-inXilinx CORE GeneratorSimulationOn the hostSimulated or previously-obtained dataCatches implementation errors before compilationCompileStart with
40、 target clock rate; vary to explore IP limitationsConcurrent compilations with compile serverDoes not meet timing or size requirementsCannot realize behavioral modelSimulation does not function correctly or meet performance requirementsDesign does not meet performance requirements in real-world oper
41、ating conditionsDesign behavioral modelUse host-based functions and toolkitsEstablish performance requirementsThroughput / SpeedFixed pointIncorporate target knowledgeTestSimulated data at speedReal-world I/OClock SamplingWhen receiving source-synchronous transmissions and clock only available on da
42、ta line (as opposed to regional or global clock input)Must sample (loop rate) as least 2x faster than maximum clock frequency, in accordance with NyquistSimilar implementation options as Master SPI caseState MachineSlave SPI EngineAssert MISOWait for _SSLatch MOSIRESET_SS = 0 & SCLK edge & CPHA = 1
43、| _SS falling edge & CPHA = 0- All cases have path to RESETSCLK edgeSCLK edgeDcount = 0Exercise 6-1: Build, integrate with Master, and debug Slave SPI engineImplement a digital protocol / LabVIEW FPGA state machineDebug interactions between Master and Slave before compilingDigital DebouncingGlitches
44、 can be disregarded with de-bouncing logicUseful for:Sampling physical switchesHardware insertion/removalPower up detection (power supply stability)Filtering significant noise in low-frequency signalsMetastability potentially an issue use synchronization registersUndesirableSimple Debouncing ImplementationLatch
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年浙江温州市乐清市教育研究培训院选调研训员2名的笔试模拟试题及答案详解
- 2026年伊春市乌伊岭区网格员招聘笔试备考试题及答案详解
- 2026吉林省彩虹人才开发咨询服务有限公司招聘劳务派遣制岗位工作人员4人笔试备考试题及答案详解
- 2026浙江温州海关综合技术服务中心招聘编外人员2人笔试模拟试题及答案详解
- 2026泰兴市新源农产品加工投资发展有限公司招聘专业添加目录笔试参考题库及答案详解
- 2026四川宜宾市珙县县属国有企业第一次招聘调整部分岗位开考比例等相关事宜笔试备考试题及答案详解
- 2025年鸡西市滴道区网格员招聘考试试题及答案详解
- 2026福建雁翔实业发展集团有限公司所属企业招聘管理及专业技术人员1人补充笔试参考题库及答案详解
- 2026中国人民大学人事处国际交流合作部(港澳台办公室)招聘1人笔试模拟试题及答案详解
- 2026四川宜宾南溪区农业农村领域高校毕业生就业岗位招聘15人(第二批)笔试模拟试题及答案详解
- 异常工况安全处置准则解读
- 窜货联保协议书
- 《经济学导论》教学课件
- 三体系基础知识培训课件
- 建设工程施工合同GF-2024-0201住建部
- 煤矿师傅带徒弟管理制度
- 广东2025年01月广东省廉江市人力资源和社会保障局等2个单位2025年公开招考政府雇员笔试历年典型考题(历年真题考点)解题思路附带答案详解
- 高血压社区规范化管理与药物治疗
- 保险顺延申请书范本
- DBJ41-T 099-2010 河南省附属绿地绿化规划设计规范
- 《冲击波治疗骨肌疾病技术规范》
评论
0/150
提交评论