//-------------------------------------------------------------------------------------------------------- // Module : axi_self_test_master // Type : synthesizable // Standard: Verilog 2001 (IEEE1364-2001) // Function: write increase data to AXI4 slave, // then read data and check whether they are increasing //-------------------------------------------------------------------------------------------------------- module axi_self_test_master #( parameter A_WIDTH_TEST = 26, parameter A_WIDTH = 26, parameter D_WIDTH = 16, parameter D_LEVEL = 1, parameter [7:0] WBURST_LEN = 8'd7, parameter [7:0] RBURST_LEN = 8'd7 )( input wire rstn, input wire clk, output wire awvalid, input wire awready, output reg [A_WIDTH-1:0] awaddr, output wire [ 7:0] awlen, output wire wvalid, input wire wready, output wire wlast, output wire [D_WIDTH-1:0] wdata, input wire bvalid, output wire bready, output wire arvalid, input wire arready, output reg [A_WIDTH-1:0] araddr, output wire [ 7:0] arlen, input wire rvalid, output wire rready, input wire rlast, input wire [D_WIDTH-1:0] rdata, output reg error, output reg [ 15:0] error_cnt ); initial {awaddr, araddr} = 0; initial {error, error_cnt} = 0; wire aw_end; reg awaddr_carry = 1'b0; reg [7:0] w_cnt = 8'd0; localparam [2:0] INIT = 3'd0, AW = 3'd1, W = 3'd2, B = 3'd3, AR = 3'd4, R = 3'd5; reg [2:0] stat = INIT; generate if(A_WIDTH_TEST