下面是tb仿真的部分
/ 初始化
ini
tial begin
pll_ref_clk = 1 ;
global_reset_n = 0 ;
local_write_req = 0 ;
local_read_req = 0 ;
local_burstbegin = 0 ;
local_address = 0 ;
local_be =16'hffff ;
local_size = 4 ;
local_wdata = 0 ;
#200
global_reset_n = 1 ;
@(posedge phy_clk )
@(posedge phy_clk )
@ (posedge local_init_done) //等待上电结束
#200
@(posedge phy_clk)
//发送一次写突发
local_write_req = 1 ;
local_address = 24'h001000 ;
local_burstbegin = 1 ;
local_wdata = 128'h33221100;
@(posedge phy_clk)
local_burstbegin = 0 ;
local_wdata = 128'h77665544;
@(posedge phy_clk)
local_wdata = 128'hbbaa9988 ;
@(posedge phy_clk)
local_wdata = 128'hffeeddcc ;
@(posedge phy_clk)
local_write_req = 0 ;
#200
@(posedge phy_clk) //发送一次读请求
local_read_req = 1 ;
local_address = 24'h001000 ;
local_burstbegin = 1 ;
@(posedge phy_clk)
local_burstbegin = 0 ;
local_read_req = 0 ;
@(posedge phy_clk)
@(posedge local_ready ) // 读突发结束
#200 $stop ;
end
always #10 pll_ref_clk = ~pll_ref_clk ;
endmodule
0