版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、EDA技术实用教程第8章 系统优化和时序分析8.1 资源优化8.1.1 资源共享FPGA/CPLD资源的优化具有实用意义:(1)通过优化,可以使用规模更小的可编程逻辑芯片,从而降低系统成本。(2)对于许多可编程逻辑器件(例如某些公司的CPLD器件),由于布线资源有限,耗用资源过多而严重影响电路性能。(3)为以后的技术升级,留下更多的可编程资源,方便添加产品的功能。(4)对于多数可编程逻辑器件,资源耗用太多会使器件功耗显著上升。8.1.1 资源共享【例8-1】LIBRARY ieee;USE ieee.std_logic_1164.all;USE ieee.std_logic_unsigned.
2、all;USE ieee.std_logic_arith.all;ENTITY multmux IS PORT (A0, A1,B : IN std_logic_vector(3 downto 0); sel : IN std_logic; Result : OUT std_logic_vector(7 downto 0);END multmux;ARCHITECTURE rtl OF multmux ISBEGIN process(A0,A1,B,sel) begin if(sel = 0) then Result = A0 * B; else Result = A1 * B; end if
3、; end process;END rtl;图8-1 先乘后选择的设计方法RTL结构图8-2 先选择后乘设计方法RTL结构【例8-2】ARCHITECTURE rtl OF muxmult IS signal temp : std_logic_vector(3 downto 0);BEGIN process(A0,A1,B,sel) begin if(sel = 0) then temp = A0; else temp = A1; end if; result = temp * B; end process;END rtl;图8-3 资源共享反例8.1.2 逻辑优化【例83】LIBRARY i
4、eee;USE ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;ENTITY mult1 IS PORT(clk : in std_logic; ma : In std_logic_vector(11 downto 0); mc : out std_logic_vector(23 downto 0);END mult1;ARCHITECTURE rtl OF mult1 IS signal ta,tb : std_logic_vector(11 downto 0);BEGI
5、Nprocess(clk) begin if(clkevent and clk = 1) then ta = ma; tb = 100110111001; mc = ta * tb; end if;end process;END rtl;在此构建了一个两输入的乘法器:mc = ta * tb;【例8-4】LIBRARY ieee;USE ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;ENTITY mult2 IS PORT(clk : in std_logic; ma :
6、 In std_logic_vector(11 downto 0); mc : out std_logic_vector(23 downto 0);END mult2;ARCHITECTURE rtl OF mult2 IS signal ta : std_logic_vector(11 downto 0); constant tb : std_logic_vector(11 downto 0) := 100110111001;BEGINprocess(clk) begin if(clkevent and clk = 1) then ta=ma; mc=ta * tb; end if;end
7、process;END rtl;8.1.3 串行化【例8-5】LIBRARY ieee;USE ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;ENTITY pmultadd IS PORT(clk : in std_logic; a0,a1,a2,a3 : in std_logic_vector(7 downto 0); b0,b1,b2,b3 : in std_logic_vector(7 downto 0); yout : out std_logic_vector(1
8、5 downto 0);END pmultadd;ARCHITECTURE p_arch OF pmultadd ISBEGINprocess(clk) begin if(clkevent and clk = 1) then yout = (a0*b0)+(a1*b1)+(a2*b2)+(a3*b3); end if;end process; END p_arch;对8个16位数据进行乘法和加法运算,即yout = a0 b0 + a1 b1 + a2 b2 + a3 b3图8-4 并行并行乘法RTL结构【例8-6】LIBRARY ieee;USE ieee.std_logic_1164.al
9、l;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;ENTITY smultadd IS PORT(clk, start : in std_logic; a0,a1,a2,a3 : In std_logic_vector(7 downto 0); b0,b1,b2,b3 : In std_logic_vector(7 downto 0); yout : out std_logic_vector(15 downto 0);END smultadd;ARCHITECTURE s_arch OF smultadd IS sig
10、nal cnt : std_logic_vector(2 downto 0); signal tmpa,tmpb : std_logic_vector(7 downto 0); signal tmp, ytmp : std_logic_vector(15 downto 0); BEGINtmpa = a0 when cnt = 0 else a1 when cnt = 1 else a2 when cnt = 2 else a3 when cnt = 3 else a0;接下页tmpb = b0 when cnt = 0 else b1 when cnt = 1 else b2 when cn
11、t = 2 else b3 when cnt = 3 else b0;tmp = tmpa * tmpb;process(clk) begin if(clkevent and clk = 1) then if(start = 1) then cnt = 000; ytmp 0); elsif (cnt 4) then cnt = cnt + 1; ytmp = ytmp + tmp; elsif (cnt = 4) then yout = ytmp; end if; end if;end process;END s_arch;图8-5 串行化结构8.2 速度优化8.2.1 流水线设计显然该设计从输入到输出需经过的时间至少为Ta,就是说,时钟信号clk周期不能小于Ta。8.2.1 流水线设计图8-5使用流水线
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 电站高压试验操作工规程
- 2025-2026学年湖南省怀化市初中生物七年级期末下册高分预测素养提升题(附答案)
- PCN制程变更通知专项考试题(含详细答案)
- 事故善后及家属安抚工作方案
- 内蒙古鄂尔多斯市达拉特旗第十二中学2027届数学八年级第一学期期末统考模拟试题含解析
- 2025-2026学年湖北省恩施市初中历史八年级期末上册自测黑金考题(附答案)
- OT运维技术考核试题(含详细答案)
- OpenStack 高频面试题及详细答案(实战版)
- 危化油墨清洗剂管理员规程
- 空分装置加温解冻操作工规程
- 2025中国人寿招聘笔试参考题库及参考答案详解
- 2026中国智能渔业养殖系统市场供需格局投资发展规划分析报告
- 2026年马克思主义基本原理概论期末考试试题(含详细答案)
- 建立健全韧性家园-第37个国际减灾日主题班会
- 2.2 认识呼吸器官 课件(内嵌视频)2026-2027学年科学四年级上册教科版
- T/CASMES 357-2024新能源汽车用PTC水暖加热器
- (2026秋新版)部编版道德与法治五年级上册全册教案
- 三菱SELFJECTOR(SJ系列)分油机中文维护说明书(精简实操版)
- 2026年铜陵市铜官区社区工作者招聘考试真题(附答案)
- (2025年)输血技师考试题+参考答案
- 2026年芯片设计DFT工程师高频面试题包含详细解答
评论
0/150
提交评论