硬件描述语言VHDL及其应用.ppt
《硬件描述语言VHDL及其应用.ppt》由会员分享,可在线阅读,更多相关《硬件描述语言VHDL及其应用.ppt(180页珍藏版)》请在三一办公上搜索。
1、硬件描述语言VHDL及其应用,哈工大微电子中心王 进 祥,电话:6415979-806,2023/8/21,2,一、目的,了解目前电子设计系统方法及流程了解/掌握综合与验证工具能用VHDL设计复杂功能电路,二、内容,高层次设计概述如何写优化的VHDL代码examplesSoC设计方法学设计工具使用,三、如何学习本课程,带着实际课题学习,多提问题,一起分析、讨论,2023/8/21,3,一、高层次设计概述,EDA工具发展设计方法深亚微米设计问题测试综合(可测性设计)Top-down设计流程硬件描述语言综合VHDL设计小结,2023/8/21,4,1.1 EDA工具发展,2023/8/21,5,1
2、.1 EDA工具发展(Cont.),CAD:逻辑图输入、逻辑模拟、电路模拟、版图设计和版图验证分别进行,需要对两者结果进行多次比较、修改。设计规模较小,CAE:集逻辑图输入、逻辑模拟、测试码生成、电路模拟、版图设计、版图验证等工具一体,构成一个较完整的IC设计系统,EDA:HDL取代逻辑输入,逻辑网表由综合工具自动产生,可管理性增强,易于维护和数据交换,SoC:采用深亚微米工艺生产技术,基于平台设计和IP复用技术,时序收敛性为首要目标,2023/8/21,6,自顶向下设计方法(Top-down):系统行为设计 结构设计 逻辑设计 电路设计 版图设计,1.2 设计方法,自底向上设计方法(Bott
3、om-up):系统功能划分 单元设计 功能模块设计 子系统设计 系统总成,基于平台设计方法(Platform-based):SoC设计普遍采用的方法,SoC平台和IPIntellectual Property,其它设计:嵌入式设计方法,层次式设计方法等,2023/8/21,7,1.3 深亚微米设计问题,连线延时时序模型器件模型信号完整性电磁干扰功耗设计工具,综合优化工具,布图规划工具,SDF,PDEF,SDF标准数据格式,PDEF物理设计交换格式,2023/8/21,8,1.4 测试综合,目的:集成电路的测试简单化嵌入可测试结构,加速可测性设计产品制造前就可评价设计的可测性消除冗余逻辑诊断不可
4、测的逻辑结构,内容:测试嵌入、设计规则检查、测试码生成、故障模拟/诊断和输出测试图样,测试综合包括了使测试成功的每一步骤:如加入带测试因素的电路,对逻辑综合增加约束条件以满足测试要求及对高级语言描述的可测结构的综合等都可归结为测试综合,2023/8/21,9,1.4 测试综合(Cont.),方法:Full ScanPartial ScanBISTBoundary Scan,标准/规范:IEEE 1149IEEE P1500VSIA Related Spec.,SoC可测试设计:IP可测试设计Glue Logic可测试设计测试存取结构,分类:1Pass2Pass,2023/8/21,10,1.5
5、 Top-down设计流程,PLANNING,SYNTHESIS,FLOORPLAN,P&R,EXTRACTION,LVS/DRC,TIMING,LTL,2023/8/21,11,1.6 硬件描述语言,VHDL&VerilogVHDL ObjectEntityI/O界面描述Architecture 功能定义Process 行为模块Library VHDL Object的集合Package 数据类型、子程序、子单元的集合Configuration Architecture/Parameter选择,2023/8/21,12,1.6 硬件描述语言(Cont.),VHDL中的端口:In Out Ino
6、ut Buffer,Entity,2023/8/21,13,1.7 综合,Definition:Synthesis=Translation+Optimization,HDL code gtech logic netlist,min(Speed X Area X Power),Optimization&technology Mapping,Behavioral Synthesis:Scheduling and Allocation Algorithm,2023/8/21,14,1.8 VHDL设计小结,一个完整的设计由一些子单元相互连接而成每个子单元有一个Entity和至少一个Architect
7、ure单元间数据传递是通过在Entity中描述中所声明的端口进行,通信端口的信号类型、端口宽度以及端口方向要匹配一个Architecture可包括Behavioral、Dataflow和Structure风格语句子单元(Component)在使用之前要声明,2023/8/21,15,1.8 VHDL设计小结(Cont.),RS(255,223)码译码器Top框图,2023/8/21,16,1.8 VHDL设计小结(Cont.),RS(255,223)码译码器详细模块图,2023/8/21,17,1.8 VHDL设计小结(Cont.),2023/8/21,18,1.8 VHDL设计小结(Cont
8、.),2023/8/21,19,1.8 VHDL设计小结(Cont.),component xor8 port(in1,in2:in bit8;xout:out bit8);end component;signal ctlN1m1,ctlN1,ctl254,ctl255:std_logic;signal ctlobf,synfb:std_logic;signal fbo,dout,synout,lstsfe,bout:bit8;signal cntout:rsInt;signal iffto,syndout:bit8;signal bmfo:rsbit8_vector(0 to N2-1);,
9、5,2023/8/21,20,1.8 VHDL设计小结(Cont.),begin u1:control port map(reset,clk,ctlN1m1,ctlN1,ctl254,ctl255,ctlobf,synfb,cntout);u2:syndrome port map(reset,clk,decin,synfb,syndout);u3:bmexpand port map(reset,clk,syndout,cntout,synout,lstsfe,bout);u4:bmfftbuf port map(reset,clk,ctl255,synout,lstsfe,bmfo);u5:i
10、fft port map(reset,clk,ctlN1m1,ctlN1,ctl254,bmfo,iffto);u6:fftobuf port map(reset,clk,ctlobf,iffto,fbo);u7:decbuf port map(reset,clk,decin,dout);u8:xor8 port map(fbo,dout,decout);end structural;,6,2023/8/21,21,二、如何写优化的VHDL代码,数据类型并发/顺序赋值语句小结Process语句资源共享其它,2023/8/21,22,2.1 数据类型,2023/8/21,23,2.1 数据类型(
11、Cont.),2023/8/21,24,2.1.1 赋值语句,i/signal t,s:bit;s=1;-s=t;,ii/signal c:bit_vector(0 to 3);signal d:bit_vector(3 downto 0);c=“1011”;,d=c;-ok?c(0 to 3)=d(0 to 3)ok?,d=c;-ok!c(0 to 3)=d(0 to 3)No!,2023/8/21,25,iii/signal s,t,w,m:bit;signal c:bit_vector(0 to 3);c=“1011”;c=s,c 1,1-s,2-1,3-1);-Ok,2.1.1 赋值语
12、句(Cont.),2023/8/21,26,iv/signal a_vec:bit_vector(0 to 11);a_vec=B”1100_0011_0011_1100”;a_vec a_vec=X”C33C”;a_vec=X”C3_3C”;,2.1.1 赋值语句(Cont.),2023/8/21,27,二进制B(Binary)八进制O(Octal)十六进制X(Hexadecimal),位串中的进制表示:,2.1.1 赋值语句(Cont.),2023/8/21,28,v/signal A,B,C:bit_vector(3 downto 0);C=A and B;,2.1.1 赋值语句(Con
13、t.),2023/8/21,29,vi/slice of arrayentity VHDL is port(A:in bit_vector(0 to 7);outp:out bit);end VHDL;architecture E1 of VHDL isbegin outp=A(5);end;,signal C:bit_vector(0 to 7);C(4)=1;C(0 to 3)=“1001”;,2.1.1 赋值语句(Cont.),2023/8/21,30,vii/Composite data type type date is record year:integer range 1980
14、to 2030;month:integer range 1 to 12;day:integer range 1 to 30;end record;subtype bit8 is bit_vector(7 downto 0);,2.1.1 赋值语句(Cont.),2023/8/21,31,vii/Composite data type signal weekday,today:date;weekday.year=2003;weekday.monty=2;weekday.day=14;today=weekday;,2.1.1 赋值语句(Cont.),2023/8/21,32,2.1.2 数据类型转
15、换,强类型语言:VHDL具有丰富的数据类型,不同类型的对象(信号、变量)不能直接赋值,经常转换的数据类型:std_logic,bit,std_ulogic,boolean,signed unsigned,std_logic_vector,bit_vector,数据类型转换三种方法:类型标记转换法、函数转换法和常数转换法,2023/8/21,33,类型标记转换法,std_logic and std_ulogic,std_logic_vector and signedstd_logic_vector and unsignedinteger and real等,signal a std_logic_
16、vector(0 to 7);signal b unsigned(0 to 7);b=unsigned(a);,2.1.2 数据类型转换(Cont.),2023/8/21,34,函数转换法,std_logic and bitstd_ulogic and bit,boolean and bit,std_logic_vector and bit_vectorinteger and std_logic_vector/unsigned等,signal a std_logic_vector(0 to 7);signal b integer range 0 to 255;a=to_stdlogicvect
17、or(X”AF”);b=conv_ingeter(a);,2.1.2 数据类型转换(Cont.),2023/8/21,35,type typeconv_type is array(std_ulogiclow to std_ulogichigh)of bit;constant typeconv:typeconv_type:=(0|L=0,1|H=1,others=0);signal s:std_ulogic;signal a:bit;a=typeconv(s);,常数转换法,2.1.2 数据类型转换(Cont.),2023/8/21,36,How to transform bit type to
18、 boolean type?,signal bitty:bit;signal booly:boolean;booly=(bitty=1);,Discussion,2.1.2 数据类型转换(Cont.),2023/8/21,37,2.1.3 逻辑运算与关系运算,运算符:and,or,not,xor,nand,nor=,/=,=,Discussion:What is the result of the following relational statement?,2023/8/21,38,2.1.4 算术操作,运算符:+,*,mod,/,rem,操作数类型:std_logic_vector,in
19、teger,signed,unsigned,use ieee.std_logic_unsigned.all;,2023/8/21,39,2.1.4 算术操作(Cont.),signal a,b:std_logic_vector(3 downto 0);q1=unsigned(a)+unsigned(b);q2=unsigned(a)+signed(b);q3=signed(a)+signed(b);q4=a+b;q5=(0,2023/8/21,40,2.1.5 连字符和聚集,连字符:concatenation operator聚集:aggregates,signal A,B:std_logic
20、_vector(3 downto 0);signal C:std_logic_vector(7 downto 0);signal D:std_logic;C=A,2023/8/21,41,C(7)1,6=D,5 downto 2=1,others=0);C=“00000000”;-初始化,C 0);,2.1.5 连字符和聚集(Cont.),2023/8/21,42,2.2 并发/顺序赋值语句,并发赋值语句在architecture的begin和end之间,与书写顺序无关,每一条并发语句均可用一个process语句等价,顺序赋值语句只能在process和子程序的begin和end之间,它除信号赋
21、值语句外,还有变量赋值,2023/8/21,43,2.2.1 并发赋值语句,D=A+E;A=B+C;,2023/8/21,44,2.2.1 并发赋值语句(Cont.),A=B+A;,并发赋值语句:,C=A;C=B;,组合逻辑环路!,Multi-driver,need resolved function,2023/8/21,45,2.2.2 顺序赋值语句,D=A+E;A=B+C;,2023/8/21,46,2.2.2 顺序赋值语句(Cont.),C=A;C=B;,A=B+A;,组合进程:No!时序进程:Ok!,2023/8/21,47,2.3 小结,一个设计由entity和architectur
22、e描述数据对象类型有bit,boolean,integer,std_logic等标准类型和用户自定义类型并发语句执行与书写顺序无关(order independent)VHDL是一种强类型语言(类型不能自动相互转换)元件例化语句不能在process中,if语句和for语句用于并发语句时,只能是generate语句,并发语句无变量赋值语句,2023/8/21,48,2.3 小结(Cont.),entity shift is port(reset,clk:in std_logic;din:in std_logic;dout:out std_logic);end shift;architecture
23、 str of shift is component dff port(reset,clk:in std_logic;d:in std_logic;q:out std_logic);end component;,signal tv:std_logic_vector(0 to 7);begin for I in 0 to 7 generate if I=0 generate u1:dff port map(reset,clk,din,tv(0);end generate;if I 0 and I=7 generate u2:dff port map(reset,clk,tv(I 1),tv(I)
24、;end generate;end generate;dout=tv(7);end str;,2023/8/21,49,2.4 process,描述电路功能或行为。由于综合后的电路对所有输入信号变化敏感,因此所有被读信号均应包含在敏感表中,否则,综合前的模拟结果与综合后的模拟结果不一致!,2023/8/21,50,2.4.1 syntax,process_label:process(sensitivity list)declarations;begin statements;-if,loop,case,subprogram call etcend process process_label;,
25、2023/8/21,51,2.4.1 syntax,P1:process(A,B)Begin D=A or B and C;End process P1;,P1:process(A,B,C)Begin D=A or B and C;End process P1;,2023/8/21,52,communication among process,architecture example,2023/8/21,53,2.4.3 if then else语句综合,i/.引入寄存器,entity dff is port(d:in std_logic;clk:in std_logic;q:out std_
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 硬件 描述 语言 VHDL 及其 应用

链接地址:https://www.31ppt.com/p-5806771.html