




下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、SystemVerilog在Verilog語言基礎(chǔ)上擴展了“接口”(interface)結(jié)構(gòu),接口給模型提供了一種新的方式,通過使用接口可以簡化大型復(fù)雜設(shè)計的建模和驗證。,接口聲明 接口與模塊端口之間的連接 接口與模塊的區(qū)別 接口的端口及其方向 接口中的任務(wù)與函數(shù) 接口方法的使用 接口中的過程塊 參數(shù)化的接口,第10章 接口,10.1 接口的概念,接口反映的是模塊與模塊之間的互連,對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模塊端口的缺點,Verilog模塊的端口提供了一種描述設(shè)計中模塊之間連接關(guān)系的方式,這種方式直觀明了,但在大型復(fù)雜設(shè)計中,有很多缺點: 在多個模塊中必須重復(fù)聲明端口 在不同模塊中有聲明不匹配的風險 設(shè)計規(guī)范中的一個改動需要修改多個模塊
12、在多個模塊中通信協(xié)議也必須重復(fù) 例如有三個模塊對一個共享存儲器進行讀寫操作,那么在這三個模塊中,讀寫操作的控制邏輯必須重復(fù)描述 限制了抽象的自頂向下的設(shè)計 用模塊端口連接時,設(shè)計的具體互連必須在設(shè)計周期的早期確定,而不能在一個不需要考慮設(shè)計細節(jié)的抽象層面上描述。,10.1.2 SystemVerilog接口優(yōu)勢,SystemVerilog增加了新的端口類型接口,接口允許許多信號合成一組由一個端口表示,只需在一個地方對組成接口的信號進行聲明,使用這些信號的模塊只需一個接口類型的端口。 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)勢,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)勢,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)勢,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)勢,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等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年食品加工行業(yè)節(jié)能減排關(guān)鍵技術(shù)深度解析報告
- 2024年自貢高新技術(shù)產(chǎn)業(yè)開發(fā)區(qū)事業(yè)單位招聘筆試真題
- 剖析西方政治制度在全球化進程中的角色試題及答案
- 西方國家的勞動力市場與政治經(jīng)濟學試題及答案
- 2025年良性前列腺增生用藥合作協(xié)議書
- 深入分析西方國家的危機應(yīng)對機制與政治體制的適應(yīng)性試題及答案
- 2025年金融科技企業(yè)估值模型構(gòu)建與投資決策報告:金融科技企業(yè)投資策略調(diào)整
- 網(wǎng)絡(luò)工程師學習方向試題及答案
- 軟考網(wǎng)絡(luò)工程師試題及答案多元分析2025年
- 法治與西方政治制度的試題及答案
- 攀成德-鐵四院-中鐵四院集團有限公司薪酬管理制度0624
- 中國礦業(yè)大學徐州建筑學外國建筑、近現(xiàn)代建筑史期末考試重點
- 元素化合物的轉(zhuǎn)化關(guān)系網(wǎng)絡(luò)圖Word版
- APQP培訓資料-實用課件
- 三坐標測量儀點檢表
- 幼兒園繪本故事:《小熊不刷牙》 課件
- 監(jiān)控錄像調(diào)取申請表
- 明朝皇帝列表
- 人教版七年級下冊歷史期中考試測試卷五
- 血栓栓塞風險評估ppt課件(PPT 12頁)
- DB42∕T 1710-2021 工程勘察鉆探封孔技術(shù)規(guī)程
評論
0/150
提交評論