欢迎来到天天文库
浏览记录
ID:49284837
大小:1.31 MB
页数:44页
时间:2020-02-03
《EDA第五讲优化和时序分析.ppt》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、EDA技术实用教程第五讲优化和时序分析11.1资源优化11.1.1资源共享【例11-1】LIBRARYieee;USEieee.std_logic_1164.all;USEieee.std_logic_unsigned.all;USEieee.std_logic_arith.all;ENTITYmultmuxISPORT(A0,A1,B:INstd_logic_vector(3downto0);sel:INstd_logic;Result:OUTstd_logic_vector(7downto0));ENDmultmux;ARCHITECTURErtlOFmultmuxISBEGINpr
2、ocess(A0,A1,B,sel)beginif(sel='0')thenResult<=A0*B;elseResult<=A1*B;endif;endprocess;ENDrtl;11.1资源优化11.1.1资源共享图11-1先乘后选择的设计方法RTL结构11.1资源优化11.1.1资源共享图11-2先选择后乘设计方法RTL结构11.1资源优化11.1.1资源共享【例11-2】ARCHITECTURErtlOFmuxmultISsignaltemp:std_logic_vector(3downto0);BEGINprocess(A0,A1,B,sel)beginif(sel='0')
3、thentemp<=A0;elsetemp<=A1;endif;result<=temp*B;endprocess;ENDrtl;11.1资源优化11.1.1资源共享图11-3资源共享反例11.1资源优化11.1.2逻辑优化【例11-3】LIBRARYieee;USEieee.std_logic_1164.all;useieee.std_logic_unsigned.all;useieee.std_logic_arith.all;ENTITYmult1ISPORT(clk:instd_logic;ma:Instd_logic_vector(11downto0);mc:outstd_log
4、ic_vector(23downto0));ENDmult1;ARCHITECTURErtlOFmult1ISsignalta,tb:std_logic_vector(11downto0);BEGINprocess(clk)beginif(clk'eventandclk='1')thenta<=ma;tb<="100110111001";mc<=ta*tb;endif;endprocess;ENDrtl;11.1资源优化11.1.2逻辑优化【例11-4】LIBRARYieee;USEieee.std_logic_1164.all;useieee.std_logic_unsigned.al
5、l;useieee.std_logic_arith.all;ENTITYmult2ISPORT(clk:instd_logic;ma:Instd_logic_vector(11downto0);mc:outstd_logic_vector(23downto0));ENDmult2;ARCHITECTURErtlOFmult2ISsignalta:std_logic_vector(11downto0);constanttb:std_logic_vector(11downto0):="100110111001";BEGINprocess(clk)beginif(clk'eventandclk
6、='1')thenta<=ma;mc<=ta*tb;endif;endprocess;ENDrtl;11.1资源优化11.1.3串行化【例11-5】LIBRARYieee;USEieee.std_logic_1164.all;useieee.std_logic_unsigned.all;useieee.std_logic_arith.all;ENTITYpmultaddISPORT(clk:instd_logic;a0,a1,a2,a3:instd_logic_vector(7downto0);b0,b1,b2,b3:instd_logic_vector(7downto0);yout:o
7、utstd_logic_vector(15downto0));ENDpmultadd;ARCHITECTUREp_archOFpmultaddISBEGINprocess(clk)beginif(clk'eventandclk='1')thenyout<=((a0*b0)+(a1*b1))+((a2*b2)+(a3*b3));endif;endprocess;ENDp_arch;yout=a0×b0+a1×b1+a2×b2+a3×b
此文档下载收益归作者所有