您好,欢迎来到筏尚旅游网。
搜索
您的当前位置:首页利用FPGA实现数字低通滤波器

利用FPGA实现数字低通滤波器

来源:筏尚旅游网
河南科技大学毕业论文

数字低通滤波器的FPGA实现

摘 要

随着电子技术的发展,当前数字系统的设计正朝着速度快容量大体积小重量轻的方向发展而且必须直接面向用户需求,根据系统的行为和功能要求,自上至下地逐层完成相应的描述中和优化仿真与验证,直到生成器件。因此在设计数字低通滤波器我们提出了一种采用现场可编码门阵列器件(FPGA)实现线性FIR数字滤波器的设计方案,并以一个十六阶低通FIR数字滤波器电路的实现为例说明了利用Altera公司的FLEX10K系列芯片的设计过程。

本文对线性相位FIR滤波器的原理和指标进行分析,并以此为基础用VHDL语言对FPGA器件编程来实现一个16阶截止频率为1 KHZ的数字低通滤波器。硬件实现部分主要包括信号发生器,TLC9A/D转换器,FPGA器件FLEX10K,D/A转换装置TLC7528,以及模拟示波器。软件部分包括六个模块,控制模块,数据寄存模块,加法模块,计数模块,数据选择模块以及乘加模块。其核心部分是控制模块,通过对控制模块编程,使各个模块在相应的时序内实现A/D读入,转换以及数据的读出,再经数据寄存器来储存程序,经加法模块后来实现系数相同的两个采样值相加,以节省储存空间。加完后的采样值通过计数部分的片选信号与乘加模块的随机储存器部分对应系数相乘后输出,乘加模块里包括有反馈环节以及实现与前面乘加的结果进行累加的加法器,待完成8次累加后,把数据送到输出端,这时把输出结果加到D/A数模转换器上,实现把数字信号转化成模拟信号的工作。

验证过程如下:在输入端通过高频信号发生器输入一个模拟信号,经数字滤波处理后,接到示波器上,如果信号的最高频率小与滤波器的截止频率,则示波器上显示信号能顺利通过;反之,则信号不能通过。对于在FPGA中实现FIR滤波器的关键——乘加运算,给出了将乘加运算转化为查找表的算法。设计的电路通过软件进行了验证并进行了硬件仿真,结果表明:电路工作正确可靠,能满足设计要求。 关键词: FPGA , FIR滤波器, VHDL, MATLAB

第 1 页 共 59 页

河南科技大学毕业论文

DIGITAL LPF REALIZED ON FPGA

Abstract

With the development of electronic technology, present digital design of system being developed towards fast capacity heavy small light direction and must face the user's needs directly, require according to behavior and function of system, have to is it chase layer finish corresponding description neutralization optimize emulation and prove to go to the fields by oneself, until producing the device.

The principle and index of this text to linear phase place FIR are analyzed, realize with VHDL language to FPGA device programming first 16 steps close at frequency as the low coherent wave filter of figure of 1KHZ to come to based on this. The hardware realize that includes the signal generator, A/D TLC9, device FLEX10K of FPGA mainly partly, D/A TLC7528, and simulation oscillator. The part of the software includes six pieces of module, control the module, deposit the module in data, addition module, count module, datum choose the module and take advantage of and add the module. Its key part is to control the module, through being right to control module programming, make each module realize in corresponding time sequence A/D is read into, the reading of changing and data, and then stored the procedure by the data register, realized two pieces of sampled value summation with the same coefficient later by the addition module, in order to store the space sparingly. Add sampled value after through count chip selection signal of part with is it add module random accumulator some corresponding coefficient export after multiplying to take advantage of, is it add module include link of feedback and realize with result added to take

第 2 页 共 59 页

河南科技大学毕业论文

advantage of go on addition device that accumulate above to take advantage of, after finishing accumulating 8 times, send data output, at this moment output result get D/A count mould at the converter to add, realize that transforms the digital signal into the work of the analog signal.

Prove the course is as follows: Input a analog signal through the high-frequency signal generator in the input end, after the figure strains waves to deal with, receive oscillator, if the supreme frequency of the signal is little with the frequency of ending of the wave filter, then show on the oscillator the signal can be passed smoothly; On the contrary, then the signal can't be passed. The result shows: It is reliable that the circuit works correctly, can meet the designing requirement.

KEYWORDS: FPGA, FIR wave filter, VHDL, MATLAB

第 3 页 共 59 页

河南科技大学毕业论文

目 录

摘 要 ........................................ 1 ABSTRACT ..................................... 2 前 言 ........................................ 5 第1章低通滤波器概述 ........................ 6

§1.1 低通滤波器基本知识 ......................... 6 §1.1.1 低通滤波器基本原理 ...................... 6 §1.2 FIR 滤波器的FPGA实现的指导思想 ............ 9 §1.2.1 FIR 滤波器原理 ......................... 10 §1.2.2 FIR 滤波器基本网络 ..................... 10

第2章 用FPGA实现低通滤波器 ............... 14

§2.1系统硬件各部分及实现原理 ................... 14 §2.1.1系统分析 ............................... 14 §2.2 FIR低通滤波器的FPGA实现 ................. 16 §2.2.1 FIR滤波器的顶层实现 ................... 16 §2.2.2 FIR滤波器的底层实现………………………… 18

第3章 程序验证 ............................ 34

§3.1用FPGA实现的低通滤波器的验证 ............ 34

第4章 毕业设计总结和致谢 .................. 37 参考文献 ................................... 37 总 结… ..................................... 38 致 谢 ....................................... 39 附 录 ....................................... 40

第 4 页 共 59 页

河南科技大学毕业论文

前 言

数字滤波器是语音与图像处理、模式识别、雷达信号处理、频谱分析等应用中的一种基本的处理部件,它能满足滤波器对幅度和相位特性的严格要求,避免模拟滤波器所无法克服的电压漂移、温度漂移和噪声等问题。有限冲激响应(FIR)滤波器能在设计任意幅频特性的同时保证严格的线性相位特性。

目前FIR滤波器的实现方法有三种:利用单片通用数字滤波器集成电路、DSP器件和可编程逻辑器件实现。单片通用数字滤波器使用方便,但由于字长和阶数的规格较少,不能完全满足实际需要。使用DSP器件实现虽然简单,但在控制设计方面不及FPGA方便。而FPGA有着规整的内部逻辑阵列和丰富的连线资源,特别适合于数字信号处理任务,相对于串行运算为主导的通用DSP芯片来说,其并行性和可扩展性更好。但长期以来,FPGA一直被用于系统逻辑或时序控制上,很少有信号处理方面的应用,其原因主要是因为在FPGA中缺乏实现乘加运算的有效结构。现在这个问题得到了解决,使FPGA在数字信号处理方面有了长足的发展。

第 5 页 共 59 页

河南科技大学毕业论文

第一章 低通滤波器的概述

§1.1 低通滤波器基本知识

§1.1.1滤波器的原理

滤波器——一个对信号处理的系统。其功能应该让需要的信号无失真地通过,而把不需要的信号和干扰挡掉。在大多数情况下,有用信号和干扰信号是在不同的频段上,此时,把滤波器的频率特性进行精心的设计并实现就能达到这个目的。

数字系统的输出与输入的关系为y(n)=x(n)*h(n) ,又因为因果可实现系统FIR滤波器的单位冲激响应h(n)是有限长的(0≤n≤N-1),其Z变换为

N1 H(z)=h(n)zn

n0这是 z1 的(N-1)阶多项式,在有限z平面(0<∣z∣<∞)有(N-1)个零点,而位于 Z 平面原点Z=0处,则有(N-1)阶极点。线性相位条件h(n)的频率响应H(e) 为: H(e)=h(n)en0jwjwN1jwn (1-1)

jw当h(n)为实序列时,可将H(e) 表示为 H(e)=∣H(e)∣

jwjwjwej(w)=H() ej(w) (1-2)

其中∣H(e)∣是真正的幅度响应,而H()是可正可负的实函数, 有两类准确的线性相位,分别要求满足

() (1-3a)

() ( 1-3b) 其中和都是常数,表示相位是通过坐标原点  或是通过

(0)=的斜直线,二者的群时延都是常数d()。 d把 ( 1-3a ) 式和( 1-3b ) 式的关系分别代入 (1-2) 式中,并考 虑(1-2) 式,可得

第 6 页 共 59 页

河南科技大学毕业论文

H(e)=h(n)en0jwN1jwn=|H(e)|e=|H(e)|ejwjwi (1-4)

H(e)=h(n)en0jwN1jwnj() (1-5)

令 (1-4) 式等式两端实部虚部相等,可得到对 (1-3a) 式的第一类线性相位必须要求

 |H(e)|cos()=h(n)cos()

n0jwN1 |H(e)|sin()=

两式相除,可得

sin()tan=

cos()N1n0N1n0jwh(n)sin()

n0N1h(n)cos()n0n0N1h(n)sin()N1

因而 h(n)sin()cos(n)N1n0h(n)cos()sin()=0

h(n)sinn0 (1-6)

N1 (1-7) 2要使(1-6)式成立,必须要求满足 h(n)=h(N-1-n), 0≤n≤N (1-8) (1-8)式是FIR滤波器具有(1-3a)式的线性相位的必要且充分

条件,它要求单位冲激响应的h(n) 序列以n=(N-1)/2为偶对称中心,此时时间延时等于h(n)长度的一半,即为=(N-1)/2个抽样周期。N为偶数时,延时为整数;N为奇数时,延时为整数加半个抽样周期。不管N为奇偶,此时h(n)都应满足对n=(N-1)/2轴偶对称。

对( 1-3b)式的另一类线性相位,将 (1-5) 式作同样推导可知,必须要求

h(n)sinN1n000 (1-9)

第 7 页 共 59 页

河南科技大学毕业论文

要使(1-9)式成立,必须要求

=(N-1)/2 (1-10) 2 (1-11)

h(n)=-h(N-1-n) (1-12) (1-11)式是FIR滤波器具有( 1-3b) 式的线性相位的必要且充分条件,它要求单位冲激响应序列h(n)以n=(N-1)/1为奇对称中心,此时延时等于(N-1)/2个抽样周期,在h(n)的这种奇对称情况下,满足h(

N1N1N1)=-h(),因而h()=0。这种线性相位情况和前一222种不同之处是,除了产生线性相位外,还有±线性相位FIR滤波器频率响应的特点:

的固定相移。 2在以下的讨论中,按(1-1)式把频率响应H(e)表示成

H(e)=H()ejwjwj(w)jw (1-13)

其中H(是幅度函数,它使一个纯实数,它可以包括正值和负值,即H(=|H(e)|,()是相位函数。

已知线性相位FIR滤波器的冲激响应应该满足(1-8)和(1-11)即

h(n)=h(N-1-n)

因而系统函数可表示为

N1H (z)=h(n)zn=n0h(N1n)zn0(N1)N1n

=h(m)zn0N1(N1m)zh(m)zn0N1m

H (z)=z进一步写成

H (z)=

1(N1)1H(z)zH(z) 2(N1)H(z) (1-14)

1第 8 页 共 59 页

河南科技大学毕业论文

1N1n(N1)n=h(n)zz Z2n0N1N12N1N1n(n)22z (1-15) h(n)z2n0 =

z在这一公式中,方括号中有“”。h(n) 满足h(n)= h(N-1-n) 偶 对称;当取“—”号时h(n)=-h(N-1-n)满足奇对称 。下面仅对h(n)偶对称,N为偶数的情况讨论:

由(1-15)式可知,频率响应 H(e)=H(z)∣z=e=ejwjwj(N1N1)2N1h(n)cos2n (1-16)

n0将它与(1-13)对比,可得幅度函数

N1N1H (1-17) h(n)cos2nn0相位函数

N1 () ( 1-18)

2幅度函数H()包括正值和负值,相位函数是严格的线性相位,如图1-1所示,可以看出,FIR滤波器有准确的线性相位。说明滤波器有(N-1)/2的时延,它等于单位冲激响应h(n)的长度的一半。

()0

图1-1

第 9 页 共 59 页

河南科技大学毕业论文

§1.2 FIR滤波器的FPGA实现原理

FPGA有着规整的内部逻辑块阵列和丰富的连线资源,特别适合细粒度和高并行度结构特点的数字信号处理任务,如FIR、FFT等。本文详细讨论利用FPGA实现FIR滤波器的设计过程,并且对设计中的关键技术——查表乘加算法进行详细描述。 §1.2.1 FIR滤波器原理

FIR 网络结构的特点是没有反馈,即没有环路,其单位脉冲响应是有限长的。设单位脉冲响应h(n)长度为N,其系统函数H(z)和差分方程分别为

H(z)=b0+b1x(n-1)+ …+bN1z1N=bnzn (1-19)

n1N1i0N1Y(n)= b0x(n)+b1x(n-1) +…+bN1x(n-N-1)=bix(ni) (1-20) 式中,N是FIR滤波器的抽头数,x(n)表示第n时刻的输入样本,

bi是FIR滤波器的第i级抽头系数。

其单位脉冲响应h(n)是有限长的,按照(2-1)式的z反变换,h(n)表示为

h(n)= bn 0≤n≤N-1

0 n=其他 (1-21)

滤波器的阶数为N-1,它的长度(等于系数的个数)为N。 §1.2.2 FIR基本网络结构

以下着重对直接形式和线性相位形式的结构进行描述。 1、直接形式

设N=5(即四阶FIR滤波器),按照H(Z)或者差分方程式画出的直接结构图如图 (1-2),它可以用抽头延线实现。则可以写出

y(n)=b0x(n)+b1x(n1)b2x(n2)+b3x(n3)b4x(n-4) (1-22)

第 10 页 共 59 页

河南科技大学毕业论文

x(n)b0z1b1z1b2z1b4z1b5y(n)图 1- 四阶 FIR 滤波器直 接结 构的 信 号流 图 -2

根据此信号流图可以直接写出方程(1-20),而且不必写出联立方程了。

普通的直接型FIR滤波器结构如图1-2所示。 2、线形相位形式

FIR滤波器实质上是一个分节的延迟线,把每一节的输出加权累加,便得到滤波器的输出。对于FIR滤波器,幅度上只需满足以下两个条件之一,就能构成线性相位FIR滤波器。

h(n)=h(N-1-n) (1-23)

h(n)=-h(N-1-n) (1-24)

式(1-23)称为第一类线性相位的幅度条件(偶对称),式(1-24)称为第二类线性相位的幅度条件(奇对称)。

1)FIR滤波器的优化

在实际应用中,为了减少逻辑资源的占有量和提高系统的运行速度,对FIR滤波器需要进行优化处理。本文采用的优化主要有两种:一种是对表达式进行优化,另一种是在FPGA实现中利用特有的查找表进行优化。

a表达式的直接优化

对于线性相位因果FIR滤波器,它的系列具有中心对称特性,即h(i)=±h(N-1-i)对于偶对称,代入式(1-22)可得:

y(n)= b0x(n)+b1x(n-1) +…+bN1x(n-N-1)

=b0[x(n)+ x(n-N-1)]+b1[x(n-1)+x(n-N-2)]+… (1-25) 图1-3表示了N为偶数情况下实现上述差分方程的方框图。

显然,这种结构比直接形式所需的乘法数小50%。线性相位结构在本质上仍然是直接形式,只是缩减了乘法计算量。因此,传递函

第 11 页 共 59 页

河南科技大学毕业论文

x(n)z1z1z1b0图

z1b1z1b2y(n) 1--3 F 线 性相 位结 构( 对 称脉 冲响 应) IR 滤 波器的

数多项式的组成形式上,线性相位结构仍等于直接形式。 b 利用查找表进行设计优化

由于实现的是固定系数的FIR滤波器,所以可以用利用简化的过程(如查找表)减少设计所耗用的器件资源。

对于式子中的脉冲系数,可通过MATLAB软件进行计算,具体结果如下:

在信号处理工具箱中,MATHLAB提供了一个子程序叫做fir1,它利用了窗函数方法设计FIR滤波器,其标准格式为:

b=fir(M,wn,‘type’,window)

其中:b为待设计的滤波器系数常量,其长度为N=M-1; M为所选滤波器阶数;

Wn为滤波器给定的边缘频率(截止频率,1表示为截止频率为采样频率的二分之一),可以是标量,也可以是一个数组;

‘type’为滤波器的类型,如高通、带通、带阻,缺省时为低通;

window 为选定的窗函数类型,缺省为Hamming窗。

例如我们这次采用此函数计算的系数过程如下:

B=fir1(15,0.1) 表示用Hamming窗,设计阶数为15(长度为16),边界数字频率为0.1的低通滤波器。

结果如下:Columns 1 through 6

0.0034 0.0074 0.0188 0.0395 0.0677 0.0984 Columns 7 through 12

0.1248 0.1400 0.1400 0.1248 0.0984 0.0677

第 12 页 共 59 页

河南科技大学毕业论文

Columns 13 through 16

0.0395 0.0188 0.0074 0.0034

这里需要注意的是:下载到FPGA的程序是按照FIR滤波器的差分方程式编写的。由于从MATLAB中算出的系数h(n)的值是一组浮点数,而FPGA器件只进行定点值的计算,所以要进行浮点值到定点值的转换。假定“1”对应10000000000000000(17位,相当于乘上65536)。

用汉字窗(Hanning)进行设计,此16阶FIR数字低通滤波器特性参数经过换算如下:

h[0]=h[15]=00DE h[1]=h[14]=01E4 h[2]=h[13]=04D0 h[3]=h[12]=0A1C h[4]=h[11]=11 h[5]=h[10]= 1930 h[6]=h[9]= 1FF2 h[7]=h[8]=23E7

第 13 页 共 59 页

河南科技大学毕业论文

第二章

用FPGA实现低通滤波器

§2.1系统硬件各部分及实现原理

§2.1.1系统原理分析: 1、 系统原理框图

系统原理框图2-1所示,由波形发生器产生的模拟信号经过A/D TLC9转换为00~FF二进制数后,送入十六阶FIR低通滤波器,处理后输出8位二进制数送D/ATLC7528得到模拟电压输出,并在示波器上显示。

(1)A/D模数转换器件TLC9简介

TLC9的管脚分布如图2-2。TLC9是广泛应用的CMOS 8位A/D转换器。该芯片有一个模 拟输入端口,3态的数据串行输出接口可以方便的和微处理器或外围设备连接。TLC9仅仅使用输

入/输出时钟(I/O CLOCK)和芯片选择(/CS)信号控制数据。最大的输入输出时钟(I/O CLOCK)为1.1MHz。TLC9提供了片内系统时钟,它通常工作在4MHz且不需要外部元件。片内系统时钟使内部器件的操作于串行输入/输出端的时序并允许TLC9像许多软件和硬件所要求的那样工作。I/OCLOCK和内部系统时钟一起可以实现高速数据传送,对于TLC9为每秒40,000次的转换速度。 TLC9 工作时序图2-3:

第 14 页 共 59 页

河南科技大学毕业论文

图2-3

这里需要强调的有两点:1、TLC9是一个串行输出数字信号芯片,因而,将串行输出的信号转换成方便FPGA处理的并行信号是设计需要考虑的;2、TLC9的处理速度应该高于我们所设计的滤波器的处理速度,即在完成对一个采样信号的完整滤波周期内,TLC9需在/CS有效时完成对一个采样信号的采样、量化处理过程。因此,在设计滤波器的时候必须充分考虑硬件的系统参数。 (2) FIR滤波器部分请参看系统实现部分 (3) D/A数模转换器件TLC7528简介

TLC7528管脚如图2-4,是双路、8位数字-模拟转换器,内部具有各自单独的数据锁存器,其特性包括两DAC非常精密的一致性,数据通过公共8位输入口转送至两DAC数据锁 图2-4 TLC7528 存器的任意一个。控制输入端DACA/DACB决定哪一个DAC被装载。器件的装载周期与随机存

取存储器的写周期类似,能方便地与大多数通用微处理器总线或端口相接口。

TLC7528的工作时序如图2-5:

在系统原理图的连接过程中,我们选择B通道锁存数据,因而

第 15 页 共 59 页

河南科技大学毕业论文

将/DACA设置为1,/WR读功能管脚与FPGA的CONTROL模块中的数据输出控制管脚相连,D0~D7分别与FPGA的8位数据输出相连。

图2-5

§2.2 FIR低通滤波器的FPGA实现

§2.2.1 FIR滤波器顶层实现 1. 设计要求

此论文所要设计的芯片是DT—FIR 16 ,它的主要功能是实现低通滤波。DT—FIR 16的端口要求、功能要求、性能要求如下。

(1)端口要求

DT—FIR 16的外部端如图2-6所示。DT——FIR 16各端口的意义说明如表2—1所示。对各端口更多的说明请参见DT—FIR 16 的功能要

第 16 页 共 59 页

河南科技大学毕业论文

表2—1 DT—FIR 16端口说明

端口 Clk Reset Data_in Ad_wd Ad_rd Da_wr DACA Data_out 模式 in in in out out out out out 意义 时钟信号 全局异步复位信号 数据输入(来自采样) A/D写入模拟信号 A/D读出数字信号 D/A 读入数字信号 D/A选择B通道锁定数据 滤波后数据输出 2.功能、性能要求

DT—FIR 16 在CONTROL模块的控制下对输入的模拟信号进行数字低通滤波,此滤波器的截止频率Wn定为1K。如果用信号发生器产生的信号频率大于1K,则在输出端无法恢复波形;如果输入的信号频率小于1K,则将在示波器上有波形显示。具体说明如下:

1) 在RESET信号的控制下,实现低电平复位功能,即所有的输出均置为零。

2) 在时钟信号CLK的控制下,在DT—FIR 16 内部产生一个新的时钟信号CLK-2us,随着计数功能的启动,在不同的时间段将启动不同的模块工作,以实现不同的功能。

3) FPGA与外部器件A/D TLC9有3个接口连接,由于TLC9是串行输出数据,因此DATA_IN只赋一位变量,AD_WD主要负责TLC9接收模拟信号开始工作,AD_RD负责将经TLC9处理过的数字信号输入FPGA,以便数字滤波器对其进行处理

4) FPGA与D/A的接口是8位,因此分派了DATA OUT[7..0]的输出口,在经D/A转换后,以便在模拟示波器上显示。 3. FIR 滤波器的层次要求与功能模块

(1)FIR数字滤波器的层次结构图如图2-8所示:

其中主要有6个模块:一个时序控制模块CONTROL,一个数据寄存模块DATA_REG模块,一个加法模块ADDER,一个计数模块COUNTER,

第 17 页 共 59 页

河南科技大学毕业论文

一个数据选择模块MUL_8,一个乘加模块MULT_ADDER构成。其中数据寄存模块设计为8位二进制补码输入,负责锁存由A/D TLC9处理过的数字信号;加法模块ADDER 是对输入的x(n)进行前后两两相加,这主要是根据对称的FIR滤波器自身的特点设计的;COUNTER 为8进制记数器;MUL——8模块为8选1功能,主要作用是在此模块控制下,使系数和输入的数据一一对应相乘;乘加模块中储存着8个低通滤波器的系数,而且也包括有反馈环节以实现与前面乘加的结果进行累加,待完成8次累加后,取其高8位,输出给D/A。

FIR.GDF CONTROL DATA_REG ADDER counter MUL_8 MULT_ADDER 图2-8 FIR 滤波器的层次与功能模块

§2.2.2 FIR滤波器底层实现

1 根据上面的设计要求,将所要设计的DT—FIR 16电路划分为以下6个功能模块:

     

控制模块 数据寄存模块 加法模块 计数模块 数据选择模块 乘加模块

第 18 页 共 59 页

河南科技大学毕业论文

这些功能模块之间以及它们与外部端口之间的关系如图2-9所示。

2 各功能模块的行为级设计及其VHDL描述

按照以上对电路功能模块的划分,下面分别对这些功能模块进行行为级的设计,并用VHDL 对所设计的行为进行描述。

(1)控制模块(CONTROL)行为描述

控制模块是整个滤波器设计的核心内容。整个的工作过程是将CLK作为该模块的主时钟,然后将该时钟进行分频,经分频后得到的时钟频率作为与串口输入信号的频率同步的串行移位时钟I/O CLOCK 信号AD_RD和适合数据处理模块的累加计算的时钟信号COM_CLK。而当用不同操作频率的脉冲波形时,最方便的方法之一就是利用自由计数器来产生各种需要的频率。本电路中使用了三种不同频率的工作脉冲波形。它们分别是:系统时钟脉冲2us_clk(它是系统内部所有始终脉冲的源头,且其频率最高)、数据读入信号AD_RD、数据累加处理信号COM_CLK。

控制功能模块的VHDL程序段描述如2_2_1所示。 [2_2_1] library IEEE;

use IEEE.std_logic_11.all; use IEEE.std_logic_arith.all; use IEEE.std_logic_unsigned.all;

第 19 页 共 59 页

河南科技大学毕业论文

entity control is port (

clk: in STD_LOGIC; reset: in STD_LOGIC; ad_we:out STD_LOGIC; ad_rd: out STD_LOGIC; com_clk:out std_logic; enshift:out std_logic; encom:out std_logic; da_we:out std_logic; dacab:out std_logic; data_in:in std_logic;

data_out:out std_logic_vector(7 downto 0) ); end control;

architecture clkd_arch of control is

signal count:std_logic_vector(2 downto 0); signal counter :std_logic_vector(5 downto 0); signal counterb :std_logic_vector(5 downto 0); signal clk_2us:std_logic; signal nclk_2us:std_logic; signal rdtmp:std_logic; signal nad_rdtmp:std_logic; signal wrtmp:std_logic; signal ad_rdtmp:std_logic; signal ad_wrtmp:std_logic; signal ad_rdtmp1:std_logic; signal da_wrtmp:std_logic; signal sw:std_logic;

第 20 页 共 59 页

河南科技大学毕业论文

signal ab:std_logic_vector(0 to 7); begin

process(reset,clk) begin

if (reset='0') then count<=\"000\"; clk_2us<='0';

elsif (clk'event and clk='1') then

if(count=\"011\")then ----4M---->8div--2us; clk_2us<=not clk_2us; count<=\"000\"; else

count<=count+1; end if; end if; end process;

nclk_2us<=not clk_2us;

process(reset,clk_2us) ---25div

begin

if (reset='0') then counter<=\"000000\"; ad_wrtmp<='1'; ad_rdtmp<='1'; da_wrtmp<='1';

elsif (clk_2us'event and clk_2us='1') then --if (counter=\"000001\")then --1

第 21 页 共 59 页

河南科技大学毕业论文

-- --else

--ad_wrtmp<='1'; --end if;

if(counter=\"000111\")then --7 ad_rdtmp<='0';

ad_wrtmp<=’0';

else

ad_rdtmp<='1'; end if;

if(counter=\"001000\")then --8 enshift<='0'; else

enshift<='1'; end if;

if(counter=\"001001\")then --9 encom<='0'; else

encom<='1'; end if;

if(counter=\"010100\")then --20 da_wrtmp<='0'; else

da_wrtmp<='1'; end if;

if (counter=\"011000\")then --24 counter<=\"000000\"; else

counter<=counter+1; end if; end if;

第 22 页 共 59 页

河南科技大学毕业论文

end process;

process(reset,nclk_2us) begin

if(reset='0')then counterb<=\"000000\"; sw<='0';

elsif (nclk_2us'event and nclk_2us='1') then if(counterb=\"001000\") then --8 sw<='1'; end if;

if(counterb=\"010000\") then --16 sw<='0'; end if;

if(counterb=\"011000\") then --24 counterb<=\"000000\"; else

counterb<=counterb+1; end if; end if; end process;

ad_rdtmp1<=clk and (not ad_rdtmp); ad_rd<=ad_rdtmp1;

com_clk<=sw and clk_2us; ad_we<=ad_wrtmp; da_we<=da_wrtmp;

process(ad_rdtmp1)-------------read the serial data

第 23 页 共 59 页

河南科技大学毕业论文

begin

--variable i:integer range 0 to 7:=0; for i in 0 to 7 loop

if(ad_rdtmp1'event and ad_rdtmp1='1') then ab(i)<=data_in; end if; end loop;

data_out<=ab-\"10000000\"; end process;

end clkd_arch;

此段程序已经通过编译,具体结果如图2-10:

图2-10

程序说明: 1)新时钟设计

这里的做法是先建立3个N位的计数器,N的大小由电路的需求而定。N的值越大,除频的次数越多,可以获得更大的频率变化。但相对的电路合成后所占的空间也越大。

a 由于外部晶振所提供的系统的时钟信号为4MHZ,所以为了得到新的频率信号,就采用了时序脉冲电路的原理。其中COUNT被定义为4

第 24 页 共 59 页

河南科技大学毕业论文

进制计数器,当它计数满4,1US-CLK就被交替的赋值0或1,因而取得了一个频率为0.5MHZ的新的系统时钟信号,脉冲宽度为2us,其值为0-1-0-1………

b 为了让整个系统有条不紊的工作,控制模块就绪产生一系列的控制信号,保证在不同的时间段不同的模块启动工作。这里定义了25进制计数器COUNTER,即在这段时间内,系统完成一次完整的模拟信号的输入,转换成数字信号后输入到FPGA,而后进行乘加计算,完成数字滤波,最后通过数模转换输出模拟信号的过程。当COUNTER计数为1时,将A/D TLC9模数转换器的片选信号ad-wd置0,这时,A/D TLC9开始工作:首先读入模拟信号,对其采样,然后进行8位分辨率的量化,产生了8位数字输入信号。当COUNTER计数为7的时候,将选中TLC9的数据输出选择信号AD-RD。当COUNTER计数到8时,把数字信号X(n)输入到FPGA的数据输入模块DATA-REG中,移位信号ENSHIFT置0有效。当COUNTER计数到9,encom置为0,其作用是将数据处理模块中的累加器清零,保证累加结果的正确性。当COUNTER为20的时候,数摸转换器件D/A TLC7528启动工作。经过滤波后的数字输出信号进入TLC7528后,模拟输出。当COUNTER计数到24时,完成一次完整的计数,须重新置0。至此,系统完成了一次完整的滤波过程。

2)如何将串行输入信号转换成并行输入?

为了利用现有的硬件设备,须将经A/D转换芯片TLC9采样和量化处理后的串行输出信号以并行输入形式锁存于DATA REG模块,主要做的工作是在CONTROL模块中设计一个新的时钟信号ad_rd,它是保证在计数器COUNTER为7时的一个系统时钟脉冲周期内(2usCLK)将8位数据全部输入到锁存器内,因此根据TLC9内部的工作频率4MHZ的要求,把原时钟信号4MHZ与 (NOT ad_rdtmp)相与得到了出现了串行移位时钟I/O CLOCK 信号ADRD。具体的将数据移入到FPGA 的过程请参看PROCESS(ad_rdtmp1)进程。

3)数据累加处理信号COM_CLK 的设计

设计这个信号的目的在于节省ROM的存储空间。Counterb为25进制的计数器,首先将中间变量SW设置为‘0’,当计数器counterb计到8时,将其置‘1’;当计数到16的时候,SW置为‘0’;而counterb

第 25 页 共 59 页

河南科技大学毕业论文

为24时,SW设置为‘1’,计数器counterb也完成一次完整计数。最后,将SW与新的系统时钟信号2usclk相与即得到了COM_CLK 。设置SW以计数8为循环的主要原因是在COUNTER为8的时候,数据处理模块开始工作。而后我们将COMCLK取反送入数据处理模块的目的在于保证数据能够完整的输入到数据处理模块。

4) 时序图

为了更清楚的看到系统在什么时间段做什么工作,图2-11说明了这个过程。

从这个时序图可以清楚的看到,在不同的时间阶段有不同的时序起作用。当复位信号RESET为0时,RESET有效,其他任何信号不起作用。该模块的输入为时钟信号CLK为4MHZ,对它进行8分频,产生了2us-clk的新时钟信号,利用新的时钟信号产生不同的控制信号。一个完整的工作周期是50us。

图2-11

(2) 数据寄存模块DATA-REG

数据输入模块的功能比较简单,就是在ENSHIFT的上升降沿将A/D的数字信号x(n)锁存至地址寄存器DATA_REG。因为此滤波器设计的为16阶,所以要将16个X锁存到此模块。由于MAXPLUS 的LPM库自带参数可调的多位锁存器LPM_DFF,因此,此模块的实现利用16个LPM_DFF连接得到,具体实现过程请参看图2-12:

第 26 页 共 59 页

河南科技大学毕业论文

图2-12

数据输入模块编译结果如图2-13:

图2-13

(3)加法模块ADDER

由于此滤波器是偶对称,所以可将对称系数值相等的采样值X(n)进行相加,即x(0)=X(0)+X(15),x(1)=X(1)+X(14)……,实现这个相加功能的是软件自带的功能块LPM-ADD,公有8个这样的系数可调的加法此模块来实现这个功能,具体连接如图2-14:

第 27 页 共 59 页

河南科技大学毕业论文

图2-14

加法模块编译结果如图2-15:

图2-15

(4) 计数模块

此模块主要功能是产生一个8进制计数器,作用是为后面的数据选择模块MUL-8和乘加模块提供控制信号。它产生的信号同时控制LPM-ROM中系数的提出及数据选择模块的输出。它是在COM_CLK控制信号的作用下产生计数数值的,具体过程请参看以下用VHDL编写的程序段[2-2-2]。

[2-2-2]

第 28 页 共 59 页

河南科技大学毕业论文

library ieee;

use ieee.std_logic_11.all; use ieee.std_logic_unsigned.all; entity counter is port(

clk,clr:in std_logic;

Q:out std_logic_vector(2 downto 0)); end counter;

architecture behav of counter is signal S:std_logic_vector(2 downto 0); begin

process(clk,clr) begin

if(clr='0')then S<=\"000\";

elsif(clk'event and clk='1')then if(S=\"111\")then S<=\"000\"; else S<=S+1; end if; end if; Q<=S; end process; end behav;

计数模块编译结果如图2-16:

第 29 页 共 59 页

河南科技大学毕业论文

图2-16

(5)数据选择模块

此模块主要功能是实现8选1的数据选择器,依次在计数器的控制下输出两两相后的X(n)[2-2-3]。

[2-2-3] library ieee;

use ieee.std_logic_11.all; entity mul_8 is port(

S:in std_logic_vector(2 downto 0); D0:in std_logic_vector(7 downto 0); D1:in std_logic_vector(7 downto 0); D2:in std_logic_vector(7 downto 0); D3:in std_logic_vector(7 downto 0); D4:in std_logic_vector(7 downto 0); D5:in std_logic_vector(7 downto 0); D6:in std_logic_vector(7 downto 0); D7:in std_logic_vector(7 downto 0); Q:out std_logic_vector(7 downto 0)); end MUL_8;

第 30 页 共 59 页

河南科技大学毕业论文

architecture behav of MUL_8 is --signal a:std_logic; begin

Q<=D0 when S=\"000\" else D1 when S=\"001\" else D2 when S=\"010\" else D3 when S=\"011\" else D4 when S=\"100\" else D5 when S=\"101\" else D6 when S=\"110\" else D7 ; end behav;

数据选择模块编译结果如图2-17:

图2-17

(6)乘加模块

此模块是由一个系数存储器LPM-ROM,一个乘法器,一个加法器,2个LPM-DFF移位寄存器构成。其作用分别是:

A LPM-ROM 中储存着低通滤波器的系数,它是事先固化到储存器中的,具体保存格式如下:

width= 8; depth= 8;

第 31 页 共 59 页

河南科技大学毕业论文

address_radix=dec; data_radix=dec; content begin 0:00DE; 1:01E4; 2:04D0; 3:0A1C; 4:11; 5:1930; 6:1FF2; 7:23E7; end;

B 乘法器是实现系数h与处理过的采样值x 对应相乘的,其结果送入累加器。

C 加法器是负责将乘法器的计算结果进行8次自加,每次计算的结果是通过反馈重新送入加法入口来实现累加的。

D 第一个移位寄存器是用来储存每次累加的结果的,而第二个是用来保存将第一个截取的高八位数据进行移位输出的。

具体的连接图请参看图2-18:

图2-18

加法模块编译结果如图2-19: 细节说明:

1)/com-clk 控制信号是在com-clk的基础上取反得来的,主要目的是保证第一个x 能够有充足的时间进入到移位寄存器,确保计算结果的准确性。

2)/encom的主要作用是对移位寄存器进行清零,保证每次的计

第 32 页 共 59 页

河南科技大学毕业论文

图2-19

算结果只与本次的滤波过程有关。

到这里为止,就完成了对DT-fir 16的功能划分,以及对每个功能模块的vhdl行为描述和符号描述。

而对整个电路的行为或者符号设计描述就是把以上这些功能模块的描述组合起来。当每个模块用vhdl 或者符号描述完后,利用MAXPLUS 的命令 CREAT DEFAULT SYMBOL ,使其生成黑盒子。最后,新建一个符号编辑窗口,把6个模块的全部调出来,加入相应的输入、输出的端口,连接即得到顶层设计结果2-20。

图2-20

第 33 页 共 59 页

河南科技大学毕业论文

第三章

程序验证

§3.1验证用FPGA实现的低通滤波器

实验目的:验证用FPGA实现的低通滤波器的正确性

实验器材:PC机 、信号发生器、下载板FLEX10K10,模拟示波器(见图3-1)

图3-1

实验过程: 1、

程序经过底层调试、编译、连接后,最终生成项目要

求的顶层文件。

2、 1)

目标器件选择与管脚锁定 选择器件

我们此次使用的目标器件是FLEX10K系列中的EPF10K10LC84-4,在

A SSIGN\\DEVICE 中选定即可。 2)

管脚锁定

在MAX+PLUS2 菜单下选择FLOORPLAN EDITOR,具体锁定的管脚分配如表3-1:

完成上述管脚锁定后,重新编译使之生效,重新编译好后,在重新进行项目校验,若正确则进行下一步。

第 34 页 共 59 页

河南科技大学毕业论文

表3-1

信号名 Clk Reset Data_in Ad_wd Ad_rd Da_wr DACA Data_out[0..3] Data_out[4..7] 3、 下载程序

管脚号 42 28 18 19 17 22 21 51~ 58~61 对应器件名称 时钟信号CP4 数据开关K1 接FPGA下载板L10 接FPGA下载板L11 接FPGA下载板L9 接FPGA下载板L13 下载板JK5 输出发光二极管L1~L4 输出发光二极管L5~L8 1) 将下载电缆一端插入LPT1(并行口),另一端插入系统板,打开系统板电源。

2) 在configure。

注意:若是在一台从未下过VHDL程序的PC机上,要安装并口驱动程序的,否则无法找到硬件。 实验结果:

1 当我们用波形发生器产生了一频率为500HZ的信号,如图3-2

MAX-PLUS2 菜单下选择

programmer,然后点击

第 35 页 共 59 页

河南科技大学毕业论文

图3-2

结果在示波器上出现了如3-3的波形图。

图3-3

2 当我们用波形发生器产生一频率为2KHZ的信号,在示波器

上无波形显示见图3-4。

第 36 页 共 59 页

河南科技大学毕业论文

图3-4

结论:低通滤波器的截止频率为1KHZ,高于1KHZ 的信号将无法通过此滤波器,即被完全滤出。而低于1KHZ的信号可顺利通过。

电路工作正确可靠,能满足设计要求。

第四章 毕业设计总结与致谢

参考文献

[1]陈怀琛编著。数字信号处理教程——MATLAB释义与实现。陕西:电子工业出版社

[2] 侯伯享,顾新.VHDL硬件描述语言与数字逻辑电路设计.西安:西安电子科技大学出版社,2004年

[3] Douglasl L.perry.VHDL,New.york:Mcgraw-Hill,1991年 [4] David R.coelho.The VHDL Handbook.boston:Vantage Analysis Systems,INC,1993年

[5] 周祖成译.电子设计硬件描述语言VHDL.北京:北京学苑出版社,1993年

[6] 朱明程,孙普译.可编程系统的VHDL设计技术.南京:东南

第 37 页 共 59 页

河南科技大学毕业论文

大学出版社,1998年

[7] 边计年,薛宏熙.用VHDL设计电子线路.北京:清华大学出版社,2000年

[8] 蒋璇,臧春华.数字系统设计与PLD应用技术.北京:电子工业出版社,2000年

[9] 曾繁,陈美金.VHDL程序设计,北京:清华大学出版社,2000年

[10] 番松,王国栋,VHDL实用教程,北京:清华大学出版社,2000年

[11] 程佩青,数字信号处理教程,北京:清华大学出版社,2000年

[12] 黄顺吉,数字信号处理及其应用,北京:国防工业出版社,1982年

[13] 邹理和.数字信号处理.北京:国防工业出版社,1985年 [14] 陈永彬.数字信号处理.南京:南京工学院出版社,1987年 [15] 何振亚,数字信号处理的理论与应用.北京:人民邮电出版社,1983

第 38 页 共 59 页

河南科技大学毕业论文

总 结

通过本次毕业设计,使我加深了对FPGA和VHDL编程方法和流程的认识,以及数字系统设计与高层次综合知识的系统的学习,使我对大学所学过的知识作了一次较为系统的回顾。

在整个设计的过程里,使我对从事技术性开发工作有了新的看法。明白了从事技术性开发工作所必须的严谨,认真工作作风的重要性,科学的确来不了半点马虎。

软件设计是一项复杂的系统工程。软件是采用工程的概念﹑原理﹑术﹑和方法来开发与维护的。由于软件的开发欠缺经验,所以在这次的设计过程中遇到了不少困难,但是也正好为我以后的工作带来了不少的工作经验。

整个毕业设计的雏形到这已经基本完成,虽然这与真正用于实际环境的软件还有很大的差距,但是这毕竟是我们跨出校门关键的一步。经过这次的毕业设计,真正尝试到理论联系实际的滋味。为我今后更快适应社会工作做了很好的铺垫。

毕业设计培养了我的自学能力和设计能力,这在我未来的工作生活中都将是一份宝贵的财富。在此基础上,我将我所学的专业知识进一步融会贯通,得以更为扎实的掌握,这会令我未来的工作做的更好!

第 39 页 共 59 页

河南科技大学毕业论文

致 谢

首先我要感谢学校的领导与老师对我的关怀与教导,特别是我的导师傅江涛老师,感谢他指导我怎样搞毕业设计,写毕业论文,对我能顺利完成我的毕业设计和论文有很大的帮助。两个多月的毕业设计,时间虽然不长,但是受益颇多。以前多年的学习,理论问题不少,但总感觉如空中楼阁,理论和实际联系不够。这两个多月来,通过具体的完成项目,很多知识得到应用,所学的得到巩固。但也遇到了很多实际问题,都是以前上课时所不曾想到的,使自己切身体会到自己的实际工作能力与导师的要求和公司对我们能力的要求还有不少差距。因此我毕业后必须始终坚持学习,不断提高自己的理论水平和处理实际问题的能力,不负母校对我四年辛勤的培育之恩,到社会上给母校争光!

在为期两个多月的毕业设计中,我们在指导老师傅江涛老师的带领和悉心指导下,进行了对“用FPGA实现低通滤波器”的开发。在本设计中,我学到了许多课本上学不到的东西。指导老师傅江涛老师对工作认真负责、一丝不苟的态度,严谨的治学态度、渊博的理论知识以及对我的谆谆教诲都令我受益匪浅。在此表达对傅老师深深的谢意。有了他们的辛勤的耕耘,有了他们对学生孜孜不倦地教导才使我顺利完成大学的学业,顺利的走向工作岗位。在此,我对他们表示诚挚的感谢!同时感谢我的合作伙伴常莉莎和王首元的密切配合。

第 40 页 共 59 页

河南科技大学毕业论文

附 录

中英文资料

The Embedded system design will soon enter

soft nuclear era

In recent years, the embedded real-time system is in personal data processing, it is widely used in each field that multimedia communication, online transaction processing, production process controlled, the traffic controlled etc., various kinds of relevant embedded products emerge one after another. The embedded system causes people's attention more and more. And since entering the 1990s, have obtained swift and more violent development in information technology

taking

technology

of

the

computer,

communication technology and software engineering as the core, Calculate on various kinds of equipment and equipment embedded, that has promoted the permeability application of the trade with systematic wide application greatly. The embedded system is described as: \"regard using as the centre, software that hardware can cut out, meet between application system and such strict comprehensive special-purpose computer systems that requires as the function, dependability, cost, volume, consumption, etc. \" Made up of embedded hardware and embedded software. The hardware is supported, the software is the soul, because the embedded system is used extensively, to imprison extensively countries all over the world, become dazzling \" star \" most one of in the information industry already nowadays.

第 41 页 共 59 页

河南科技大学毕业论文

The embedded system (Embedded Systems) regards using as the centre, is based on technology of the computer, special-purpose computer system that the hardware of the software can be cut out (can be programmed, can construct again). It is a skill-intensive integrated system of knowledge with intensive fund and highly dispersing, innovating constantly. Trials and hardships that the embedded system had already gone through decades since there were born. Before looking forward to the future, we come to roughly review history of the embedded system first. Ten year for a in fashion ten year such as ASIC, and then ten year, it is for on-the-spot golden years in programming device from 1997 to 2007 to be, It is an obvious characteristic at this stage to make standardization but use and customize, and after 2007, SoC and SIP that users can construct and can be disposed automatically again will become the mainstream of next embedded system key technology developing stage.

On pursue scientist not of our country it spread out and Japanese scientist herd \" last copies of tide \" of for \" let by circulation \" where academician publish letting not occupying (Makimoto's Wave) have summarized and predicted the rule of development of the key technology of the embedded system. Through the picture being we ugly to be it use embedded gradual progress course of system of microelectronic technological achievement to produce. The embedded systematic hardware in history is in large scale, especially the hardware design and software of many CPU fault-tolerant systems are debugged are all very complicated technological working, with the development of application demand with no limits, the miniaturization of the embedded system, require to the function, dependability,

第 42 页 共 59 页

河南科技大学毕业论文

cost and consumption more strictly even more and the pursuit to the intelligent trend of the embedded system, \" scene \" can program with can person who construct become very much important again. 1977 embedded systematic microprocessor era to 1987 one year, through realize the function very much of the board to microprocessor and little controller software programming embedded system, with development and scientific progress of times, soft programming can meet the embedded system to the demand that the function realizes very much of the board gradually already, then, this concept of hard programming has appeared. The so-called hard programming points and describes in advance good HDL language procedure writes into the chip, realize board function very much, that is to say we usually programmable logic device FPGA said. Through \" letting to circulate\law, that is to have a kind of new embedded engineering that will get fast development and popularization and application every 10 years (Lagging that the invention and popularization and application of a kind of semiconductor technology have about 10 years. Before the 2003, whom industry

emphasize

more

based

on

FPGA

hard

programmable among embedded system, in 2004, on the basis of original hardware of the embedded system, join the soft nuclear processor in FPGA, make FPGA have soft can be

programmed.

Nowadays,

embedded

system

programmable to put forward demand is soft to enter FPGA become need of era while being nuclear to soft hard pair, so the soft nuclear (Soft Core) era of entry thereupon of embedded systematic technology. For now, the utilization ratio of FPGA has already exceeded 90%, has used the

第 43 页 共 59 页

河南科技大学毕业论文

products of FPGA to appear in our daily life extensively too, for instance the PDP/LCD TV, the projector, DVD, etc. In addition, handheld device, industry, medical equipment and electronic field of automobile are all applications that FPGA can put expertise to good use either. And how to realize the high utilization ratio of FPGA becomes a focus question of the embedded system at present. For now, we can realize the high utilization ratio of FPGA from three respects. (1) Innovation of craft, through adopt 7 improve utilization ratio of FPGA and connect up success rate greatly to layer of metal layers. (2) Innovation of structure, can dispose function module and perfect through flexible inside such functions as I/O, DSP and memory, etc. raise performance constantly among FPGA. (3) EDA designs the innovation of the platform, the threshold making FPGA design study is greatly reduced have usability even more.

We need what a kind of FPGA support tool meet present embedded needs that system designed on earth? (1) And this is exactly our so-called embedded systematic EDA platform based on FPGA. Because of this kind of demand, Altium Company (lasted three years and purchased embedded software company TASKING with famous industry for this to invest more than one hundred million U.S. dollars) Developed and put out EDA platform known as Nexar 2004 in 2004. This software includes many kinds of designs to channel into the way, integrated VHDL emulation and formatting, include exempting in the use fee IP storehouse of different processor kernels and large-scaly, has integrated the design tool of embedded software. Software this introduction design to IC generalization has special meanings. It has offered EDA platform where the software

第 44 页 共 59 页

河南科技大学毕业论文

and hardware is designed in coordination, collects and designs, proves, test is it on an organic whole, support pair reject CRT is based on PCB/FPGA/SoC EDA work station to synthesize, design and offer the means of realizing for embedded system many CPU core, dispel signal integrality, EMC, encapsulation from SMD device of different manufacturers in PCB design, test, orders, in short supply etc. to perplex, promote efficiency, in addition it realize SoC that user can construct again on the basis of FPGA (list fast, life cycle is long). So, very good our demand for FPGA support tool at present of settlement of introduction of Nexar 2004. It has promoted the development of FPGA and even the whole embedded systematic designing technique to a great extent. Embedded systematic design engineer can use on the basis of SoC thought and method that IP puts in an position of the design conveniently among FPGA, carry on the product design. Through use high-level embedded department a lot of tell I on the basis of hardware engineer that PCB design originally, say in a sense, FPGA can connect up and realize an embedded system freely just like PCB, commonly used one-chip computer and standard digital logical circuit (ASSP) can with store IP storehouse among the hard disk is it substitute to come in PC (save physics chip, SMD of encapsulation) the past, obviously, it is not so very difficult as EDA tool to realize such an embedded system. So we can predict: Traditional MCU and ASSP supplier's market share will drop, the application that FPGA will be more extensive, the digital processing method will occupy the leading position of the embedded system. And constantly improved FPGA support tool, makes FPGA develop the speed and has been promoted, especially

第 45 页 共 59 页

河南科技大学毕业论文

presented embedded systematic EDA platform based on FPGA, Is it say appearance of it is it design because of FPGA embedded system become possible to make to come from meaning of popularizing. As regards present trend, embedded systematic EDA platform very important (such as Nexar), a present one designing requirement various kinds of independent software tool can have platform of the chink work in coordination in one. And it catch up with speed where hardware design of (Company hardware and software personnel than for 1:7), hardware circuit is it catch up with development speed, semiconductor of craft to design, so can say so, semiconductor through offer high-quality FPGA and system leave us embedded systematic designer construction period more application design space industry. What embedded systematic EDA platform will change is essential! We Can find out whom we face soon an embedded system design soft nuclear era too.

Looking forward to the future, SoC has already become the embedded designer's ideal, SOC technology is a new milestone of the microelectronic technical development, and has already nowadays become the development trend of super large-scale IC, has offered the unprecedented wide market and rare opportunity for development for IC industry. SOC industry developed rapidly has advanced the embedded software and hardware system to merge and imbed further again, the embedded software is its soul and core. Appearance, SOC of technology, change traditional embedded design idea of system, based on IP component storehouse

designing

technique

become

embedded

mainstream that system be designed; IP component storehouse technology is bringing up a new developing

第 46 页 共 59 页

河南科技大学毕业论文

software trade. And SoC/SIP that can be disposed automatically (SIP: Silicon In Package) will become the mainstream of the embedded system of next 10 years (from 2007 to 2017) too. Soft hard pair of programming will replace hard programming that can't adapt to the technical development progressively, become the main way in which the embedded system is designed. And arrival, SoC of times mean too hundreds and thousands of embedded system engineers can realize they dream of, the board designed by oneself changes a chip. And this is exactly meaning of SoC: System on Chip. We can say, the following 5 years a large amount of produce to enter soft hard pairs of SoC only way that era lay a solid foundation of programming for embedded system IP that prove actually.

SoC designing technique started in the middle period of 1990s, with the development of technology of the semiconductor, IC designer can integrate more and more complicated function on the single silicon chip, SoC was just produced under the general orientation that the integrated circuit (IC) transforms into integrated system (IS), The definition of SoC is varied, because it is meaningful, the range of application is wide, it is very difficult to provide the accurate definition. From the point of narrow sense, it is that the central chip of information system is integrated, integrate the systematic key part on a chip; From the point of broad sense, SoC is a little small-scale system, if the central processing unit (CPU) is a brain, then SoC is a system which includes the brain, heart, eyes and hand. Domestic and international academia is it defines to be the microprocessor SoC to inclined to generally, simulation IP nuclear, digital IP nuclear and memory (or slice is it control

第 47 页 共 59 页

河南科技大学毕业论文

interface to store) integrate at the single chip. It has independent processor and regular software of foundation, customer customized usually, or face the standardized product of the specific use. One great development trend, SoC of technology based on platform development, share IP to be nuclear to develop with the system integration achievement, reform the value chain constantly, on the basis of paying close attention to area, delaying, consumption, to the yield, dependability, EMI noise, cost, apt to shift with the sex, etc., make system grades of integrated ability fast development. SoC design accurate enter large threshold whether know-how, IP storehouse, SoC bus build up with the embedded software (including BIOS, OS) supporting most, it is nuclear and integrating design art together of customer's logic and it to need extensive multi-functional IP, in order to meet customer's product development's demands. At the same time therefore a lot of third party IP nuclear suppliers can get the fast development, their success or having unique and valuable IP cores, or IP storehouse with good reputation. IP that SoC designer has been proved through putting in a position, has not merely utilized the latest technology advantage, and has reduced development period and risk. SoC technology will lead the technical development of a new generation's embedded processor, will use for the core with the embedded system, incorporate software and hardware into an organic whole, pursue products system heavy person who contain most in system integration, can succeed in realizing multi-disciplinary cooperation and integration. SoC designing technique has offered a chance that the qualified personnel of the computer get involved in IC and design the field. Not merely

第 48 页 共 59 页

河南科技大学毕业论文

need system structure background knowledge of stronger computer in the chip design of SoC, and SoC stresses the proportion of software development, needs involvement of the professional personage of the computer, need to offer the good developing platform and embedded operating system. Therefore, both present FPGA and future customer ordering type SoC, IP storehouse is all to designing and having extremely important function embedded. In the 1990s, SoC is made up of CPU + logic +I/O port on every one basically, the important characteristic of the second generation of SoC entered after 2000 includes a lot of I/O ports that could dispose the processor. SoC of future generation is the aggregate that a processor quantity can be scaled, this kind of trend reflects in two aspects mainly: One is that the quantity of processor of each slice of chip will be increased progressively at the speed of 30% for every year, within next ten years, the quantity of processor of each slice of chip will exceed 1000, in on the other hand, chip every Taxi programmable operation ability can increase progressively at the speed of 65% for every year too. Utilize embedded systematic EDA platform study and practice many CPU

nuclear

designing

technique

and

accumulate

experience to train ES for one future such as name engineer one very much realistic at FPGA Choice.

There is the material that indicates: 58% of annual growth of the chip complexity in the world, the annual growth of and IC designed capacity is only 20%, therefore find out, the growth of the integrated circuit designed capacity in the world can not far catch up with the speed that the complexity of the chip increases, this has designed the industry and offered the rare development chance to integrated circuit.

第 49 页 共 59 页

河南科技大学毕业论文

To the transition of SoC in the face of the integrated circuit, a historical opportunity that our country realizes the industry that designs integrated circuit and crosses over is coming. So a lot of experts propose, our country should have priority to develop the industry that designs chip, especially pay attention to the development chance that SoC offers.

The embedded system had receiving the extensive concern all the time since it came out, the level of the embedded system is determining the scientific and technological level of the whole society to a great extent too. Through the whole journey in the past, the embedded system has been gone through and imitated the gradual progress course to the figure, may gradual progress situation that mould coexist progressively within future 20 years. From initial software to past hard ASIC era FPGA era in today that programming decide MPU (embedded microprocessor, DSP, one-chip computer) that programming decide, we can say embedded system design in while being quite long years, key technology its move ahead along tide of \" let circulation \" constantly, design platform perfect oneself through the progress of science and technology constantly too. With upcoming customer ordering type SoC/SIP and U-SoC, what we would enter soon is a soft hard embedded systematic era that pair can be programmed. For now, we in one hard programming design transition period to the soft hard pair of programmable embedded systems, so can say so, what we will enter soon now is the soft nuclear era that an embedded system will be designed.

Summary

Light, thin, short, little, low consumption, high

第 50 页 共 59 页

河南科技大学毕业论文

dependability are the direction in which an embedded system pursues forever, realize with semiconductor engineering and EDA platform one embedded system ten million people goal of efforts for it at one chip obviously. SoC pays most attention to the result designed together with software and hardware on the basis of IP. It may be the inevitable choice to design SoC on the basis of FPGA on embedded systematic EDA platform to ES (Embedded System) engineer of today.

嵌入式系统设计即将进入软核时代

近年来,嵌入式实时系统在个人数据处理、多媒体通信、在线事务处理、生产过程控制、交通控制等各个领域内得到了广泛的应用,各种相关的嵌入式产品纷纷涌现。嵌入式系统越来越引起人们的重视。而进入90年代以来,以计算机技术、通信技术和软件技

第 51 页 共 59 页

河南科技大学毕业论文

术为核心的信息技术取得了更加迅猛的发展,各种装备与设备上嵌入式计算与系统的广泛应用大大地推动了行业的渗透性应用。嵌入式系统被描述为:“以应用为中心、软件硬件可裁剪的、适应应用系统对功能、可靠性、成本、体积、功耗等严格综合性要求的专用计算机系统”,由嵌入式硬件和嵌入式软件两部分组成。硬件是支撑,软件是灵魂,由于嵌入式系统应用广泛,并受到世界各国的广泛关,如今已成为信息产业中最为耀眼的“明星”之一。

嵌入式系统(Embedded Systems)是以应用为中心,以计算机技术为基础,软件硬件可剪裁(可编程,可重构)的专用计算机系统。它是一个技术密集、资金密集、高度分散、不断创新的知识集成系统。嵌入式系统自其诞生以来已经经历了几十年的风风雨雨。在展望未来之前,我们先来大致回顾一下嵌入式系统的历史。1987年到1997年的十年是ASIC风行的十年,而后的十年,也就是1997年到2007年是现场可编程器件的大好时光,制造标准化但应用定制化是这个阶段的明显特征,而2007年后,用户可重构和可自动配置的SoC和SIP将成为下一个嵌入式系统核 心技术发展阶段的主流。

下图通过我国科学家许居衍院士发表的“许氏循环”以及日本科学家牧本次夫的“牧本浪潮”(Makimoto's Wave)总结和预测了嵌入式系统核心技术的发展规律。通过这张图我们不难看出应用微电子技术成果之上的嵌入式系统的演进过程。历史上的嵌入式系统硬件规模庞大,特别是多CPU 容错系统的硬件设计和软件调试都是很复杂的技术工作,随着无止境的应用需求的发展,嵌入式系统的小型化,对功能、可靠性、成本以及功耗的更严格要求以及对嵌入式系统智能化趋势的追求,“现场”可编程与可重构性变得非常重要。1977到1987年的十年是嵌入式系统微处理器时代,嵌入式系统通过对微处理器和微控制器软件编程来实现板极的功能,随着时代的发展与科学的进步,软编程已经渐渐不能适应嵌入式系统

第 52 页 共 59 页

河南科技大学毕业论文

对于板极功能实现的要求,于是,就出现了硬编程这一概念。所谓硬编程就是指将事先描述好的HDL语言程序写入到芯片内部,实现板极的功能,也就是我们通常所说的可编程逻辑器件FPGA。通过“许氏循环”,我们不难发现一个时间规律,那就是每隔10年就会有一种新的嵌入式工程技术得到快速发展和普及应用(一种半导体技术的发明与普及应用有约10年的滞后)。2003年以前,业界更多强调的是在嵌入式系统中基于FPGA的硬可编程性,2004年,在嵌入式系统原有硬件的基础上,在FPGA中加入了软核处理器,使得FPGA具有软可编程性。当今,嵌入式系统对软硬双可编程提出了需求,软核进入FPGA成为了时代的需要,因此嵌入式系统技术也随之进入了软核(Soft Core)时代。就目前而言,FPGA的利用率已经超过了90%,应用FPGA的产品也广泛出现在我们的日常生活之中,如PDP/LCD电视,投影仪,DVD等等。此外,手持设备、工业和医疗设备以及汽车电子领域也都是FPGA可以大展拳脚的应用领域。而如何实现FPGA的高利用率也就成为了目前嵌入式系统的一个焦点问题。就目前而言,可以从三个方面实现FPGA的高利用率。(1)工艺上的创新,通过采用7到10层的金属层大大提高了FPGA的利用率和布线成功率。(2)结构的创新,通过灵活的内部可配置功能模块和在FPGA中不断完善I/O、DSP和存储器等功能提高性能。(3)EDA设计平台的创新,使得FPGA设计学习的门槛大为降低,更具有可用性。

第 53 页 共 59 页

河南科技大学毕业论文

我们究竟需要一种什么样的FPGA支持工具才能适应当前嵌入式系统设计的需要呢?

(1)快速的FPGA片上系统开发(2)集成的软/硬件开发(3)各FPGA厂商并且支持多种体系结构(4)融合了元件级和系统级设计(5)易学且低价,功能齐全,元件库完备的设计系统,包括了IP内核和CPU仿真测试和debug开发平台。而这也正是我们所谓的基于FPGA的嵌入式系统EDA平台。基于这种需求,Altium公司(投资上亿美元历时三年时间并为此收购了业界著名的嵌入式软件公司TASKING)于2004年开发并推出了称之为Nexar 2004的EDA平台。该软件包含多种设计导入方式,集成了VHDL仿真和合成,包含了各种处理器内核的大型免使用费IP库,集成了嵌入式软件设计工具。该软件的推出对IC设计普遍化有着特别的意义。它提供了软硬件协同设计的EDA平台,集设计,验证,测试综合于一体,支持双屏CRT,是基于PCB/FPGA/SoC的EDA工作站,为嵌入式系统多CPU核设计提供了实现手段,消除了PCB设计中信号完整性、EMC、来自不同厂商的SMD器件的封装、测试、订货、缺货等困扰,提升了效率,此外,它基于FPGA实现用户可重构的SoC(上市速度快,生命周期长)。因此,Nexar 2004的推出很好的解决了目前我们对于FPGA支持工具的需求。它在很大程度上推动了FPGA乃至整个嵌入式系统设计技术的发展。在FPGA中嵌入式系统设计工程师可以方便地使用基于SoC设计中IP重用的思想和方法,进行产品设计。通过使用高水平的嵌入式系

原来很多基于PCB设计的硬件工程师告诉我,从某种意义上来讲,FPGA就像PCB一样,可自由布线并实现一个嵌入式系统,过去常用的单片机和标准数字逻辑电路(ASSP)可用存储在PC硬盘中的IP库来替代(节省了SMD封装的物理芯片),显然,没有EDA工具很难实现这样的嵌入式系统。

因此我们可以预见:传统的MCU和ASSP供应商市场份额将会下降,FPGA会更大规模的应用,数字处理方法将占据嵌入式系统的主导地位。而不断改进的FPGA支持工具,使FPGA开发速度得到了提升,特别是出现了基于FPGA的嵌入式系统EDA平台,从普及

第 页 共 59 页

河南科技大学毕业论文

意义上来讲,它的出现使基于FPGA设计嵌入式系统成为可能。就目前的趋势而言,嵌入式系统EDA平台非常重要(如Nexar),目前的设计要求各种的软件工具可以在一个无缝隙的平台上协同工作。而由于目前嵌入式系统软件的开发速度跟不上硬件设计的速度(公司硬软件人员比为1:7),硬件电路设计跟不上半导体工艺的发展速度,因此可以这样说,半导体工业通过提供优质的FPGA把更多的应用设计空间和系统开发时间留给了我们嵌入式系统设计者。嵌入式系统EDA平台将变的必不可少!由此也可以看出,我们即将面临的是一个嵌入式系统设计软核时代。

展望未来,SoC已经成为嵌入式设计者的理想, SOC技术是微电子技术发展的一个新的里程碑,并已成为当今超大规模IC的发展趋势,为IC产业提供前所未有的广阔市场和难得的发展机遇。迅猛发展的SOC工业再次地推进了嵌入式软件与硬件系统进一步融合嵌入,嵌入式软件是其灵魂与核心。SOC技术的出现,改变了传统嵌入式系统的设计观念,基于IP构件库的设计技术将成为嵌入式系统设计的主流;IP构件库技术正在造就一个新兴的软件行业。而可自动配置的SoC/SIP(SIP:Silicon In Package)也将成为下一个10年(2007年到2017年)嵌入式系统的主流。软硬双编程将逐步取代不能适应技术发展的硬编程,成为嵌入式系统设计的主要方式。而SoC时代的到来也就意味着成千上万的嵌入式系统工程师可以实现他们梦想,将自己设计的板子变成芯片。而这也正是SoC的含义:System on Chip。可以说,未来5年内大量产生的经过实际验证的IP是为嵌入式系统进入软硬双编程的SoC时代打下坚实的基础的必由之路。

SoC设计技术始于20世纪90年代中期,随着半导体工艺技术的发展,IC设计者能够将愈来愈复杂的功能集成到单硅片上,SoC正是在集成电路(IC)向集成系统(IS)转变的大方向下产生的。SoC的定义多种多样,由于其内涵丰富、应用范围广,很难给出准确定义。从狭义角度讲,它是信息系统核心的芯片集成,是将系统关键部件集成在一块芯片上;从广义角度讲,SoC是一个微小型系统,如果说处理器(CPU)是大脑,那么SoC就是包括大脑、

第 55 页 共 59 页

河南科技大学毕业论文

心脏、眼睛和手的系统。国内外学术界一般倾向将SoC定义为将微处理器、模拟IP核、数字IP核和存储器(或片外存储控制接口)集成在单一芯片上。它拥有的处理器以及固定基础的软件,通常是客户定制的,或是面向特定用途的标准产品。SoC技术的一大发展趋势是基于平台的开发,分享IP核开发与系统集成成果,不断重整价值链,在关注面积、延迟、功耗的基础上,向成品率、可靠性、EMI噪声、成本、易用性等转移,使系统级集成能力快速发展。SoC设计准入的最大门槛是专门技术、IP库、SoC总线架构和嵌入式软件(包括BIOS、OS)支持,需要广泛的多功能IP核和将客户逻辑与之集成在一起的设计艺术,以满足客户产品开发的需求。同时许多第三方IP核供应商由此可以得到快速发展,它们的成功要么是具有独一无二的且极具价值的IP核,要么是具有良好声誉的IP库。SoC设计者通过重用经过证明了的IP,不仅利用了最新工艺技术优势,而且减少了开发周期和风险。SoC技术将引领新一代嵌入式处理器的技术发展,以嵌入式系统应用为核心,集软、硬件于一体,并在系统集成中追求产品系统最大包容性,能成功实现多学科的协作与融合。SoC设计技术为计算机专业人才介入IC设计领域提供了一个机会。不仅在SoC芯片设计上需要较强的计算机体系结构背景知识,而且SoC突出了软件开发的比重,需要计算机专业人士的介入,需要提供良好的开发平台和嵌入式操作系统。由此可见,无论是现在的FPGA还是未来的客户订制型SoC, IP库都对嵌入式设计有着极其重要的作用。 在90年代,SoC基本上由1个片上CPU+逻辑+I/O端口组成,而进入2000年后的第二代SoC的重要特征则是包含了多个可配置处理器的I/O端口。下一代SoC就是一个处理器数量可缩放的集合体,这种趋势主要体现在两个方面:一个是每片芯片的处理器数量会以每年30%的速度递增,在下一个十年内,每片芯片的处理器数量会超过1000个,而在另一方面,芯片每面的可编程运算能力也会以每年65%的速度递增。利用嵌入式系统EDA平台在FPGA上学习和实践多CPU核设计技术和积累经验对培训千万名未来的ES工程师是一种很现实的选择。

第 56 页 共 59 页

河南科技大学毕业论文

有材料表明:世界芯片复杂度的年增长58%,而IC设计能力的年增长仅为20%,由此看出,世界集成电路设计能力的增长远远跟不上芯片复杂度增长的速度,这为集成电路设计产业提供了难得的发展机会。面对集成电路向SoC的转型,我国实现集成电路设计业跨越的一个历史机遇正在来临。因此许多专家建议,我国应优先发展芯片设计业,特别重视SoC提供的发展机会。

嵌入式系统自其问世以来就一直受到广泛的关注,嵌入式系统的水平也在很大程度上决定着全社会的科技水平。从过去一路走来,嵌入式系统经历了由模拟向数字的演进过程,在未来的20年内可能又将逐步演进为数模并存的情形。由最初软件编程主宰的MPU(嵌入式微处理器、DSP、单片机)到以往的硬编程主宰的ASIC时代直到今天的FPGA时代,可以说嵌入式系统设计在相当长岁月的同时,其核心技术沿着“许氏循环“的浪潮不断前行,设计平台也通过科技的进步不断完善自身。随着即将到来的客户订制型SoC/SIP以及U-SoC,我们即将进入的是一个软硬双可编程的嵌入式系统时代。就目前而言,我们正处于一个硬编程向软硬双可编程嵌入式系统设计的过渡时期,因此可以这么说,我们现在即将进入的是一个嵌入式系统设计的软核时代。

总结 : 轻、薄、短、小、低功耗、高可靠性是嵌入式系统永远

追求的方向,显然用半导体工程技术和EDA 平台在一个芯片上实现一个嵌入式系统是千万人为之努力的目标。SoC是基于IP重用和软硬件协同设计的产物。对于今天的ES(Embedded System)工程师来说在嵌入式系统EDA平台上基于FPGA设计SoC可能是必然的选择。

第 57 页 共 59 页

河南科技大学毕业论文

第 58 页 共 59 页

河南科技大学毕业论文

第 59 页 共 59 页

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- efsc.cn 版权所有 赣ICP备2024042792号-1

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务