EDA技术与FPGA应用设计 第三版 课件 第7章宏功能模块与IP核应用_第1页
EDA技术与FPGA应用设计 第三版 课件 第7章宏功能模块与IP核应用_第2页
EDA技术与FPGA应用设计 第三版 课件 第7章宏功能模块与IP核应用_第3页
EDA技术与FPGA应用设计 第三版 课件 第7章宏功能模块与IP核应用_第4页
EDA技术与FPGA应用设计 第三版 课件 第7章宏功能模块与IP核应用_第5页
已阅读5页,还剩22页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

LPM_RAMLPM_ROMLPM_DLLSignalTap应用本章内容:第7章宏功能模块与IP核应用LPM:参数可设置模块库,基于Altera特定器件的优化设计Altera提供的宏模块与LPM函数有:第7章宏功能模块与IP核应用第7章宏功能模块与IP核应用LPM模块定制向导:MegaWizardPlug-InManager使用步骤:

LPM定制;原理图或HDL文件中例化7.1LPM_RAM

LPM_RAM

定制

顶层文件中例化

1.打开MegaWizardPlug-InManager

2.RAM参数配置

3.初始化数据

4.完成RAM定制

5.编译

7.1.1LPM_RAM定制

7.1.1LPM_RAM定制

1.打开MegaWizardPlug-InManager

7.1.1LPM_RAM定制

2.RAM参数配置3.指定初始化数据文件(.mif)

7.1.1LPM_RAM定制

4.完成RAM定制

7.1.1LPM_RAM定制

5.编译

建立项目、编译、仿真测试

7.1.1LPM_RAM定制

【例7-1】

libraryieee;

useieee.std_logic_1164.all;

useieee.std_logic_arith.all;

useieee.std_logic_unsigned.all;

entityram_testis

port(rst:instd_logic; --复位信号,低电平有效

clk:instd_logic; --时钟信号

wen:instd_logic; --写使能信号,高电平有效

ren:instd_logic; --读使能信号,高电平有效

waddr:instd_logic_vector(4downto0); --写端口地址信息

raddr:instd_logic_vector(4downto0); --读端口地址信息

datain:instd_logic_vector(7downto0); --数据写入端口

dataout:outstd_logic_vector(7downto0)); --数据输出端口

endentity;7.1.2LPM_RAM例化

architecturebehavofram_testis

componentram_lpmis--调用单端口RAM存储器

port(clock:instd_logic;

wren:instd_logic;

data:instd_logic_vector(7downto0);

address:instd_logic_vector(4downto0);

q:outstd_logic_vector(7downto0)

);

endcomponent;

signalwren:std_logic;

signaladdr:std_logic_vector(4downto0);7.1.2LPM_RAM例化

begin

process(rst,clk,wen,ren)

begin

ifrst='0'then

wren<='0';

addr<="00000";

elsifclk'eventandclk='1'then

ifwen='1'then

wren<='1';

addr<=waddr;

elsifren='1'then

wren<='0';

addr<=raddr;

endif;

endif;

endprocess;

u0:ram_lpmportmap(clock=>clk,wren=>wren,data=>datain,address=>addr,

q=>dataout);

endbehav;7.1.2LPM_RAM例化

1.建立初始化数据文件

2.LPM_ROM定制

3.LPM_ROM例化

7.2LPM_ROM1.新建“MemoryInitializationFile”文件

2.设定数据文件容量

3.输入数据

4.保存mif文件

7.2.1建立初始化数据文件7.2.2LPM_ROM定制1.打开MegaWizardPlug-InManager

2.ROM参数配置

3.初始化数据文件指定

4.完成ROM定制

5.编译

【例7-2】

libraryieee;

useieee.std_logic_1164.all;

useieee.std_logic_arith.all;

useieee.std_logic_unsigned.all;

entityrom_testis

port(rst:instd_logic; --复位信号,低电平有效

clk:instd_logic; --时钟信号

en:instd_logic; --使能信号,高电平有效

dataout:outstd_logic_vector(7downto0)--数据输出信号

);

endentity;7.2.3LPM_ROM例化

architecturebehavofrom_testis

componentrom_lpmis

port(clock:instd_logic;

address:instd_logic_vector(4downto0);

q:outstd_logic_vector(7downto0)

);

endcomponent;

signalcnt:std_logic_vector(4downto0);7.2.3LPM_ROM例化

begin

process(rst,clk,en)

begin

ifrst='0'then

cnt<="00000";

elsifclk'eventandclk='1'then

ifen='1'then

cnt<=cnt+1;

endif;

endif;

endprocess;

u0:rom_lpmportmap(clock=>clk,address=>cnt,q=>dataout);

endbehav;7.2.3LPM_ROM例化

例基于LPM_ROM的4位乘法器设计

设计原理:硬件乘法器有多种设计方法,但相比之下,由LPM_ROM构成的乘法表方式的乘法器的运算速度最快。这里定制LPM_ROM的地址位宽为8;地址输入由时钟inclock的上升沿锁入;数据位宽也为8。最后为ROM配置乘法表数据文件。

LPM_ROM中作为乘法表的数据文件rom_data.mif如表所示。其中的地址/数据表达方式是,冒号左边写ROM地址值,冒号右边写对应此地址放置的16进制数据。如47﹕28,表示47为地址,28为该地址中的数据,这样,地址高4位和低4位可以分别看成是乘数和被乘数,输出的数据可以看成是它们的乘积。基于LPM_ROM的4位乘法器设计用LPM_ROM设计的4位乘法器原理图编辑mif文件

时钟锁相环PLL

(phase-lockedloop)

可以实现对输入时钟的分频、倍频、相移等功能,能够减少时间延迟,增加时钟信号的稳定性。7.3LPM_PLL1.LPM_PLL定制

2.LPM_PLL例化

7.3LPM_PLL1.定制LPM_DLL

2.参数配置

输入时钟频率为50MHz;PLL模块的端口信号:输入时钟信号inclk0;复位信号areset;输出时钟信号c0,输出有效信号locked。

3.设置工作模式

控制信号选择:选择时钟异步复位信号areset,输出有效信号locked

4.输出频率设置

输出时钟c0:频率为25MHz,相位偏移0,占空比50%

时钟c1配置;输出e0时钟

5.完成PLL定制

7.3.1LPM_PLL配置

libraryieee;

useieee.std_logic_1164.all;

useieee.std_logic_unsigned.all;

useieee.std_logic_arith.all;

entitypll_testis

port(rst:instd_logic; --复位信号,高电平有效

clk:instd_logic; --输入50MHz时钟

enout:outstd_logic; --时钟输出使能信号

clk1out:outstd_logic; --输出25MHz时钟

clk2out:outstd_logic; --输出100MHz时钟

clk3out:outstd_logic --输出60MHz时钟

);

endentity;7.3.2LPM_PLL例化

architecturebehavofpll_testis

componentpll_lpmis--时钟锁相环模块

port(areset:instd_logic;

in

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论