EDA技術(shù)與FPGA應(yīng)用設(shè)計(jì) 第三版 課件 第7章宏功能模塊與IP核應(yīng)用_第1頁(yè)
EDA技術(shù)與FPGA應(yīng)用設(shè)計(jì) 第三版 課件 第7章宏功能模塊與IP核應(yīng)用_第2頁(yè)
EDA技術(shù)與FPGA應(yīng)用設(shè)計(jì) 第三版 課件 第7章宏功能模塊與IP核應(yīng)用_第3頁(yè)
EDA技術(shù)與FPGA應(yīng)用設(shè)計(jì) 第三版 課件 第7章宏功能模塊與IP核應(yīng)用_第4頁(yè)
EDA技術(shù)與FPGA應(yīng)用設(shè)計(jì) 第三版 課件 第7章宏功能模塊與IP核應(yīng)用_第5頁(yè)
已閱讀5頁(yè),還剩22頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

LPM_RAMLPM_ROMLPM_DLLSignalTap應(yīng)用本章內(nèi)容:第7章宏功能模塊與IP核應(yīng)用LPM:參數(shù)可設(shè)置模塊庫(kù),基于Altera特定器件的優(yōu)化設(shè)計(jì)Altera提供的宏模塊與LPM函數(shù)有:第7章宏功能模塊與IP核應(yīng)用第7章宏功能模塊與IP核應(yīng)用LPM模塊定制向?qū)В篗egaWizardPlug-InManager使用步驟:

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

LPM_RAM

定制

頂層文件中例化

1.打開(kāi)MegaWizardPlug-InManager

2.RAM參數(shù)配置

3.初始化數(shù)據(jù)

4.完成RAM定制

5.編譯

7.1.1LPM_RAM定制

7.1.1LPM_RAM定制

1.打開(kāi)MegaWizardPlug-InManager

7.1.1LPM_RAM定制

2.RAM參數(shù)配置3.指定初始化數(shù)據(jù)文件(.mif)

7.1.1LPM_RAM定制

4.完成RAM定制

7.1.1LPM_RAM定制

5.編譯

建立項(xiàng)目、編譯、仿真測(cè)試

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; --復(fù)位信號(hào),低電平有效

clk:instd_logic; --時(shí)鐘信號(hào)

wen:instd_logic; --寫(xiě)使能信號(hào),高電平有效

ren:instd_logic; --讀使能信號(hào),高電平有效

waddr:instd_logic_vector(4downto0); --寫(xiě)端口地址信息

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

datain:instd_logic_vector(7downto0); --數(shù)據(jù)寫(xiě)入端口

dataout:outstd_logic_vector(7downto0)); --數(shù)據(jù)輸出端口

endentity;7.1.2LPM_RAM例化

architecturebehavofram_testis

componentram_lpmis--調(diào)用單端口RAM存儲(chǔ)器

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.建立初始化數(shù)據(jù)文件

2.LPM_ROM定制

3.LPM_ROM例化

7.2LPM_ROM1.新建“MemoryInitializationFile”文件

2.設(shè)定數(shù)據(jù)文件容量

3.輸入數(shù)據(jù)

4.保存mif文件

7.2.1建立初始化數(shù)據(jù)文件7.2.2LPM_ROM定制1.打開(kāi)MegaWizardPlug-InManager

2.ROM參數(shù)配置

3.初始化數(shù)據(jù)文件指定

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; --復(fù)位信號(hào),低電平有效

clk:instd_logic; --時(shí)鐘信號(hào)

en:instd_logic; --使能信號(hào),高電平有效

dataout:outstd_logic_vector(7downto0)--數(shù)據(jù)輸出信號(hào)

);

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位乘法器設(shè)計(jì)

設(shè)計(jì)原理:硬件乘法器有多種設(shè)計(jì)方法,但相比之下,由LPM_ROM構(gòu)成的乘法表方式的乘法器的運(yùn)算速度最快。這里定制LPM_ROM的地址位寬為8;地址輸入由時(shí)鐘inclock的上升沿鎖入;數(shù)據(jù)位寬也為8。最后為ROM配置乘法表數(shù)據(jù)文件。

LPM_ROM中作為乘法表的數(shù)據(jù)文件rom_data.mif如表所示。其中的地址/數(shù)據(jù)表達(dá)方式是,冒號(hào)左邊寫(xiě)ROM地址值,冒號(hào)右邊寫(xiě)對(duì)應(yīng)此地址放置的16進(jìn)制數(shù)據(jù)。如47﹕28,表示47為地址,28為該地址中的數(shù)據(jù),這樣,地址高4位和低4位可以分別看成是乘數(shù)和被乘數(shù),輸出的數(shù)據(jù)可以看成是它們的乘積?;贚PM_ROM的4位乘法器設(shè)計(jì)用LPM_ROM設(shè)計(jì)的4位乘法器原理圖編輯mif文件

時(shí)鐘鎖相環(huán)PLL

(phase-lockedloop)

可以實(shí)現(xiàn)對(duì)輸入時(shí)鐘的分頻、倍頻、相移等功能,能夠減少時(shí)間延遲,增加時(shí)鐘信號(hào)的穩(wěn)定性。7.3LPM_PLL1.LPM_PLL定制

2.LPM_PLL例化

7.3LPM_PLL1.定制LPM_DLL

2.參數(shù)配置

輸入時(shí)鐘頻率為50MHz;PLL模塊的端口信號(hào):輸入時(shí)鐘信號(hào)inclk0;復(fù)位信號(hào)areset;輸出時(shí)鐘信號(hào)c0,輸出有效信號(hào)locked。

3.設(shè)置工作模式

控制信號(hào)選擇:選擇時(shí)鐘異步復(fù)位信號(hào)areset,輸出有效信號(hào)locked

4.輸出頻率設(shè)置

輸出時(shí)鐘c0:頻率為25MHz,相位偏移0,占空比50%

時(shí)鐘c1配置;輸出e0時(shí)鐘

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; --復(fù)位信號(hào),高電平有效

clk:instd_logic; --輸入50MHz時(shí)鐘

enout:outstd_logic; --時(shí)鐘輸出使能信號(hào)

clk1out:outstd_logic; --輸出25MHz時(shí)鐘

clk2out:outstd_logic; --輸出100MHz時(shí)鐘

clk3out:outstd_logic --輸出60MHz時(shí)鐘

);

endentity;7.3.2LPM_PLL例化

architecturebehavofpll_testis

componentpll_lpmis--時(shí)鐘鎖相環(huán)模塊

port(areset:instd_logic;

in

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論