资源描述:
《EDA 技术实用教程第12章课件.ppt》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、EDA技术实用教程第12章系统仿真12.1仿真KX康芯科技仿真也称模拟(Simulation)是对电路设计的一种间接的检测方法,是利用计算机对整个硬件系统进行模拟检测,但却可以不接触具体的硬件系统。12.2VHDL源程序仿真KX康芯科技图12-1VHDL仿真流程12.2VHDL源程序仿真KX康芯科技【例12-1】LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;ENTITYand1ISPORT(aaa,bbb:INSTD_LOGIC;ccc:OUTSTD_LOGIC);ENDand1;ARCHITECTUREoneOFand1ISBEGINccc
2、<=aaaANDbbb;END;12.2VHDL源程序仿真KX康芯科技【例12-2】LIBRARYIEEE;USEIEEE.std_logic_1164.all;ENTITYTRIBUF_and1ISGENERIC(ttri:TIME:=1ns;ttxz:TIME:=1ns;ttzx:TIME:=1ns);PORT(in1:INstd_logic;oe:INstd_logic;y:OUTstd_logic);ENDTRIBUF_and1;ARCHITECTUREbehaviorOFTRIBUF_and1ISBEGINPROCESS(in1,oe)BEGINIFoe‘EVEN
3、TTHEN(接下页)KX康芯科技IFoe='0'THENy<=TRANSPORT'Z'AFTERttxz;ELSIFoe='1'THENy<=TRANSPORTin1AFTERttzx;ENDIF;ELSIFoe='1'THENy<=TRANSPORTin1AFTERttri;ELSIFoe='0'THENy<=TRANSPORT'Z'AFTERttxz;ENDIF;ENDPROCESS;ENDbehavior;LIBRARYIEEE;USEIEEE.std_logic_1164.all;USEwork.tribuf_and1;ENTITYand1ISPORT(aaa:IN
4、std_logic;bbb:INstd_logic;ccc:OUTstd_logic);ENDand1;ARCHITECTUREEPF10K10LC84_a3OFand1IS......ENDEPF10K10LC84_a3;12.3仿真激励信号的产生KX康芯科技【例12-3】LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;ENTITYADDER4ISPORT(a,b:ININTEGERRANGE0TO15;c:OUTINTEGERRANGE0TO15);ENDADDER4;ARCHITECTUREoneOFADDER4ISBEGINc<=a+b
5、;ENDone;第一种方法:12.3仿真激励信号的产生KX康芯科技【例12-4】ENTITYSIGGENISPORT(sig1:OUTINTEGERRANGE0TO15;sig2:OUTINTEGERRANGE0TO15);END;ARCHITECTURESimOFSIGGENISBEGINsig1<=10,5AFTER200ns,8AFTER400ns;sig2<=3,4AFTER100ns,6AFTER300ns;END;12.3仿真激励信号的产生KX康芯科技图12-2SIGGEN的仿真输出波形12.3仿真激励信号的产生KX康芯科技【例12-5】ENTITYBENCHI
6、SEND;ARCHITECTUREoneOFBENCHISCOMPONENTADDER4PORT(a,b:integerrange0to15;c:OUTINTEGERRANGE0TO15);ENDCOMPONENT;COMPONENTSIGGENPORT(sig1:OUTINTEGERRANGE0TO15;sig2:OUTINTEGERRANGE0TO15);ENDCOMPONENT;SIGNALa,b,c:INTEGERRANGE0TO15;BEGINU1:ADDER4PORTMAP(a,b,c);U2:SIGGENPORTMAP(sig1=>a,sig2=>b);END
7、;12.3仿真激励信号的产生KX康芯科技图12-3BENCH仿真波形图12.3仿真激励信号的产生KX康芯科技force<信号名><值>[<时间>][,<值><时间>…][-repeat<周期>]第二种方法:forcea0(强制信号的当前值为0)forceb00,110(强制信号b在时刻0的值为0,在时刻10的值为1)forceclk00,115–repeat20(clk为周期信号,周期为20forcea100,5200,8400forceb30,4100,630012.4VHDL测试基准KX康芯科技【例12-6】L