module dv_elink_tb(); /* verilator lint_off STMTDLY */ //REGS reg clk; reg reset; reg go; reg [1:0] datamode; reg ext_access; reg ext_write; reg [1:0] ext_datamode; reg [3:0] ext_ctrlmode; reg [31:0] ext_dstaddr; reg [31:0] ext_data; reg [31:0] ext_srcaddr; reg ext_wr_wait; reg ext_rd_wait; reg init; //Forever clock always #10 clk = ~clk; //Reset initial begin #0 reset = 1'b1; // reset is active go = 1'b0; clk = 1'b0; datamode = 2'b11; #400 //clock config (fast /2) dv_elink.elink.ecfg.ecfg_clk_reg[15:0] = 16'h0113; //tx config (enable) dv_elink.elink.ecfg.ecfg_tx_reg[8:0] = 9'h001; //rx config (enable) dv_elink.elink.ecfg.ecfg_tx_reg[4:0] = 5'h01; reset = 1'b0; // at time 100 release reset #1000 go = 1'b1; #2000 datamode = 2'b10; #3000 datamode = 2'b01; #4000 datamode = 2'b00; #10000 $finish; end //Notes:The testbench connects a 64 bit master to a 32 bit slave //To make this work, we limit the addresses to 64 bit aligned always @ (posedge clk) if(reset) begin ext_access <=1'b0; //empty ext_write <=1'b1; ext_datamode[1:0] <=2'b0; ext_ctrlmode[3:0] <=4'b0; ext_data[31:0] <=32'b0; ext_dstaddr[31:0] <=32'b0; ext_srcaddr[31:0] <=32'b0; ext_rd_wait <=1'b0; ext_wr_wait <=1'b0; end else if ((go & ~ext_access) | (ext_access & ~dut_wr_wait)) begin ext_access <= 1'b1; ext_data[31:0] <= ext_data[31:0] + 32'b1; ext_dstaddr[31:0] <= ext_dstaddr[31:0] + 32'd8;//(32'b1<