下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、SystemVerilog在Verilog語言基礎(chǔ)上擴(kuò)展了“接口”(interface)結(jié)構(gòu),接口給模型提供了一種新的方式,通過使用接口可以簡(jiǎn)化大型復(fù)雜設(shè)計(jì)的建模和驗(yàn)證。,接口聲明 接口與模塊端口之間的連接 接口與模塊的區(qū)別 接口的端口及其方向 接口中的任務(wù)與函數(shù) 接口方法的使用 接口中的過程塊 參數(shù)化的接口,第10章 接口,10.1 接口的概念,接口反映的是模塊與模塊之間的互連,對(duì)Verilog來說,主要通過模塊的端口表現(xiàn)。,10.1 接口的概念,module top (input wire clock, resetn, teset_mode); wire 15 : 0 data, addr
2、ess, program_addr, jump_addr; wire 7 : 0 instr, next_instr; wire 3 : 0 slave_instr; wire slave_req, slave_rdy; wire bus_req, bus_grant; wire mem_read, mem_write; write data_rdy; processor proc1 ( /main_bus ports .data(data), .address(address), .slave_instr(slave_instr), .slave_req(slave_req), .bus_g
3、rant(bus_grant), .mem_read(mem_read), .mem_write(mem_write), .bus_req(bus_req), .slave_rdy(slave_rdy), /other ports .jump_addr(jump_addr), .instr(instr), .clock(clock), .resetn(resetn), .test_mode(test_mode);,10.1 接口的概念,slave slave1 ( /main_bus ports .data(data), .address(address), .bus_req(bus_req)
4、, .slave_ready(slave_ready), .mem_read(mem_read), .mem_write(mem_write), .slave_instr(slave_instr), .slave_req(slave_req), .bus_grant(bus_grant), .data_rdy(data_rdy), / other ports .clock(clock), .resetn(resetn); dual_port_ram ram ( / main_bus ports .data(data), .data_rdy(data_rdy), .address(address
5、), .mem_read(mem_read), .mem_write(mem_write), / other ports .program_addr(program_addr), .data_b(next_instr);,10.1 接口的概念,test_generator test_gen( / main_bus ports .data(data), .address(address), .mem_read(mem_read), .mem_write(mem_write), / other ports .clock(clock), .resetn(resetn), .test_mode(tes
6、t_mode); instruction_reg ir ( .program_addr(program_addr), .instr(instr), .jump_addr(jump_addr), .next_instr(next_instr), .clock(clock), .resetn(resetn); endmodule,10.1 接口的概念,module processor ( / main_bus ports inout wire 15:0 data, output reg 15:0 address, output reg 3:0 slave_instr, output reg sla
7、ve_req, output reg bus_grant, output wire mem_read, output wire mem_write, input wire bus_req, input wire slave_rdy, / other ports output reg 15:0 jump_addr, input wire 7:0 instr, input wire clock, input wire resetn, input wire test_mode); . / module functionality code endmodule,module slave ( / mai
8、n_bus ports inout wire 15:0 data, inout wire 15:0 address, output reg bus_req, output reg slave_rdy, output wire mem_read, output wire mem_write, input wire 3:0 slave_instr, input wire slave_req, input wire bus_grant, input wire data_rdy, / other ports input wire clock, input wire resetn); . / modul
9、e functionality code endmodule,10.1 接口的概念,module dual_port_ram ( / main_bus ports inout wire 15:0 data, output wire data_rdy, input wire 15:0 address, input tri0 mem_read, input tri0 mem_write, / other ports input wire 15:0 program_addr, output reg 7:0 data_b); . / module functionality code endmodul
10、e,module test_generator ( / main_bus ports output wire 15:0 data, output reg 15:0 address, output reg mem_read, output reg mem_write, / other ports input wire clock, input wire resetn, input wire test_mode); . / module functionality code endmodule,10.1 接口的概念,module instruction_reg ( output reg 15:0
11、program_addr, output reg 7:0 instr, input wire 15:0 jump_addr, input wire 7:0 next_instr, input wire clock, input wire resetn); . / module functionality code endmodule,10.1.1 Verilog模塊端口的缺點(diǎn),Verilog模塊的端口提供了一種描述設(shè)計(jì)中模塊之間連接關(guān)系的方式,這種方式直觀明了,但在大型復(fù)雜設(shè)計(jì)中,有很多缺點(diǎn): 在多個(gè)模塊中必須重復(fù)聲明端口 在不同模塊中有聲明不匹配的風(fēng)險(xiǎn) 設(shè)計(jì)規(guī)范中的一個(gè)改動(dòng)需要修改多個(gè)模塊
12、在多個(gè)模塊中通信協(xié)議也必須重復(fù) 例如有三個(gè)模塊對(duì)一個(gè)共享存儲(chǔ)器進(jìn)行讀寫操作,那么在這三個(gè)模塊中,讀寫操作的控制邏輯必須重復(fù)描述 限制了抽象的自頂向下的設(shè)計(jì) 用模塊端口連接時(shí),設(shè)計(jì)的具體互連必須在設(shè)計(jì)周期的早期確定,而不能在一個(gè)不需要考慮設(shè)計(jì)細(xì)節(jié)的抽象層面上描述。,10.1.2 SystemVerilog接口優(yōu)勢(shì),SystemVerilog增加了新的端口類型接口,接口允許許多信號(hào)合成一組由一個(gè)端口表示,只需在一個(gè)地方對(duì)組成接口的信號(hào)進(jìn)行聲明,使用這些信號(hào)的模塊只需一個(gè)接口類型的端口。 interface main_bus; wire 15:0 data; wire 15:0 address; l
13、ogic 7:0 slave_instr; logic slave_req; logic bus_grant; logic bus_req; logic slave_rdy; logic data_rdy; logic mem_read; logic mem_write; endinterface,10.1.2 SystemVerilog接口優(yōu)勢(shì),module top (input logic clock, resetn, test_mode); logic 15:0 program_addr, jump_addr; logic 7:0 instr, next_instr; main_bus
14、bus ( ); / instance of an interface / (instance name is bus) processor proc1 ( / main_bus ports .bus(bus), / interface connection / other ports .jump_addr (jump_addr), .instr (instr), .clock(clock), .resetn(resetn), .test_mode(test_mode);,10.1.2 SystemVerilog接口優(yōu)勢(shì),slave slave1 ( / main_bus ports .bus
15、(bus), / interface connection / other ports .clock(clock), .resetn(resetn); dual_port_ram ram ( / main_bus ports .bus(bus), / interface connection / other ports .program_addr (program_addr), .data_b(next_instr);,10.1.2 SystemVerilog接口優(yōu)勢(shì),test_generator test_gen( / main_bus ports .bus(bus), / interfac
16、e connection / other ports .clock(clock), .resetn(resetn), .test_mode(test_mode); instruction_reg ir ( .program_addr (program_addr), .instr(instr), .jump_addr(jump_addr), .next_instr(next_instr), .clock(clock), .resetn(resetn); endmodule,10.1.2 SystemVerilog接口優(yōu)勢(shì),module processor ( / main_bus interfa
17、ce port main_bus bus, / interface port / other ports output logic 15:0 jump_addr, input logic 7:0 instr, input logic clock, input logic resetn, input logic test_mode); . / module functionality code endmodule module slave ( / main_bus interface port main_bus bus, / interface port / other ports input
18、logic clock, input logic resetn); . / module functionality code endmodule,module dual_port_ram ( / main_bus interface port main_bus bus, / interface port / other ports input logic 15:0 program_addr, output logic 7:0 data_b); . / module functionality code endmodule module test_generator ( / main_bus interface port main_bus bus, / interface port / other ports input logic c
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 個(gè)體化潮氣量對(duì)術(shù)后ARDS肺保護(hù)策略的實(shí)踐路徑完善
- 2026年聯(lián)想集團(tuán)面試題及答案詳解
- 2026年軟件實(shí)施工程師面試題及項(xiàng)目經(jīng)驗(yàn)含答案
- 供熱移交協(xié)議書相關(guān)費(fèi)用
- 耕地播種協(xié)議書
- 初中歷史仿生機(jī)器人運(yùn)動(dòng)控制系統(tǒng)與文化傳承研究教學(xué)研究課題報(bào)告
- 邊緣計(jì)算與網(wǎng)絡(luò)虛擬化的協(xié)同優(yōu)化-洞察及研究
- 錦綸纖維防水性能的生物降解性研究-洞察及研究
- 初中生自制望遠(yuǎn)鏡觀測(cè)實(shí)踐與天文知識(shí)普及活動(dòng)效果分析教學(xué)研究課題報(bào)告
- 茯苓皮提取物在肝臟疾病治療中的作用-洞察及研究
- 《煤礦安全規(guī)程(2025)》防治水部分解讀課件
- 2026年無人機(jī)物流配送應(yīng)急預(yù)案制定與風(fēng)險(xiǎn)防控
- 山東開放大學(xué)《勞動(dòng)合同法(本科)》形考作業(yè)1-3終考答案
- 楊輝三角的性質(zhì)與應(yīng)用課件-高二下學(xué)期數(shù)學(xué)人教A版選擇性
- 15《我們不亂扔》課件 2025-2026學(xué)年道德與法治一年級(jí)上冊(cè)統(tǒng)編版
- 發(fā)電廠項(xiàng)目管理員崗位考試試卷及答案
- CN119399202B 一種傷口評(píng)估監(jiān)測(cè)方法及設(shè)備 (浙江大學(xué)醫(yī)學(xué)院附屬第一醫(yī)院(浙江省第一醫(yī)院))
- 2025年山東省公務(wù)員公開遴選筆試試題及答案(綜合類)
- 北京市西城區(qū)2024-2025學(xué)年三年級(jí)上學(xué)期期末語文試題
- 藏文主持詞模板
- 2025年事業(yè)單位工勤技能-河南-河南防疫員三級(jí)(高級(jí)工)歷年參考題庫(kù)含答案解析
評(píng)論
0/150
提交評(píng)論