学号:基于VHDL的UART设计TheUARTDesignBasedonVHDL系别:计算机科学与技术系专业:计算机科学与技术班级:0622班学生姓名:指导教师:日期:2010年3月至2010年6月基于VHDL的UART设计【摘要】UART是设备和设备间进行通信的关键,当一个设备需要和另一个连接的设备进行通信时,通常采用数字信号,这种源自并行的信号必须转换成串行信号才能通过有线或无线传输到另一台设备。在接收端,串行信号又转换成并行信号进行处理,UART处理这种数据总线和串行口之间的串-并和并-串转换。本文所要实现的就是就是这种串-并和并-串的转换,使之能够进行数据的传输。本文介绍了用FPGA技术实现UART电路的一种方法,用VHDL进行编程,在Modelsim下进行编译及仿真等。【关键字】FPGA,VHDL,UART,接收,发送【Abstract】UARTisthekeyofcommunicationsbetweendevices.Whenadeviceneedstocommunicatewithaconnecteddevice,usuallydigitalsignalsapplied,whichmustbetransformedintoserialisedsignaltoanotherdevicethroughwiresorwirelessspace.Whenbeingreceivedtoprocess,theserialisedsignalsmustbetransformedtoparellisedsignals.UARTprocessesthisserial_datatoparallel_data/parallel_datatoserial_datatransformbetweendatabusandslaveport.Thispaperistoimplementthisserialtoparallelandparalleltoserialtransformandmakethetransferringbetweendataproperly.ThispaperintroducesamethodimplementedbyFPGAtechniqueprogrammedbyVHDL,simulatedandcompiledbyModelsim.【Keywords】FPGA,VHDL,UART,receive,send基于VHDL的UART设计目录1绪论.................................................................51.1EDA技术发展概况...................................................51.1.1CAD阶段(20世纪60年代中期—20世纪80年代初期).............51.1.2CAE阶段(20世纪80年代初期—20世纪90年代初期)..............51.1.3EDA阶段(20世纪90年代以来)...................................51.2FPGA的发展及优点....................................................61.3电路设计方法发展....................................................71.3.1自底向下的设计方法................................................8.协同设计;.............................................................9(1)总体结构的设计.....................................................9(2)子模块的激活实现(AcitiveModuleDesign)..........................9(3)模块的最后合并(FinalAssembly)...................................93.模块化分的原则......................................................10(3)将不同优化目标的逻辑分开..........................................10(4)将松约束的逻辑单元归到同一模块....................................10(6)合适的模块规模....................................................104.全局逻辑的设计.......................................................101.4ISE软件介绍........................................................111.6本文主要工作.......................................................122.1常用的计算机接口...................................................132.2RS-232川口通信简介.................................................152.2.2.RS-232协议......................................................161.DSR信号线...........................................................162.DTR信号线..........................................................163.RTS信号线..........................................................164.CTS信号线..........................................................165.DCD信号线..........................................................166.RI信号线............................................................172.2.3.RS-232通信时序和UART...........................................182.2.4.串行通信实现方案................................................193.1UART实现原理.......................................................203.2UART工作流程.......................................................214.3波特率发生器模块的实现.............................................24基于VHDL的UART设计RISE_PULSE_COUNT:BD_COUNT:=BD9600_HPC);...........................25FULL_PULSE_COUNT=10,................................................26RISE_PULSE_COUNT=5..................................................264.4移位寄存器模块的实现...............................................264.5奇偶校验器模块实现..................................................27PARITY_RULE:PARITY:=NONE);........................................274.6总线选择模块的实现.................................................284.7计数器模块的实现...................................................294.8UART内核模块的实现.................................................30(2)奇偶校验器........................................................31(5)波特率发生器.......................................................334.8.3UART内核模块的实现...............................................37PARITY_RULE:PARITY:=NONE);........................................38(2)内部信号定义......................................................38(3)串行加载序列的生成方法............................................394.9UART顶层模块的实现.................................................43DATA_BIT:INTEGER:=DATA_BIT;........................................45PARITY_RULE:PARITY:=PARITY_RULE;...................................45TOTAL_BIT:INTEGER:=TOTAL_BIT.......................................455.2.1信号监测器模块的仿真.............................................485.2.2波特率时钟模块的仿真.............................................485.2.3移位寄存器模块的仿真.............................................495.2.4奇偶校验器模块的仿真.............................................495.2.5总线选择器模块的仿真.............................................495.2.6计数器模块的仿真.................................................495.2.7顶层模块的仿真...................................................505.3FPGA验证...........................................................51基于VHDL的UART设计51绪论21世纪人类将全面进入信息化社会,对微电子信息技术和微电子VLSI基础技术将不断提出更高的发展要求,微