Open constant007 opened 8 hours ago
need a waveform dump file and the HDL
in the wave , there are only 2 read op found, and addr & data right; but mismatch with the log
module axi_lite_ram(
input wire clk,
input wire rst,
// AXI4 Master Write Address Channel
input wire [31:0] s_axi_awaddr,
input wire [2:0] s_axi_awprot,
input wire s_axi_awvalid,
output wire s_axi_awready,
// AXI4 Master Write Data Channel
input wire [31:0] s_axi_wdata,
input wire [3:0] s_axi_wstrb,
input wire s_axi_wvalid,
output wire s_axi_wready,
// AXI4 Master Write Response Channel
output wire [1:0] s_axi_bresp,
output wire s_axi_bvalid,
input wire s_axi_bready,
// AXI4 Master Read Address Channel
input wire [31:0] s_axi_araddr,
input wire [2:0] s_axi_arprot,
input wire s_axi_arvalid,
output wire s_axi_arready,
// AXI4 Master Read Data Channel
output wire [31:0] s_axi_rdata,
output wire [1:0] s_axi_rresp,
output wire s_axi_rvalid,
input wire s_axi_rready
);
// å
é¨å¯åå¨ç¨äºåå¨æ°æ®
reg [31:0] memory [0:1023];
// åå°åééå¤ç
reg write_addr_ready;
assign s_axi_awready = write_addr_ready;
// åæ°æ®ééå¤ç
reg write_data_ready;
assign s_axi_wready = write_data_ready;
// åååºééå¤ç
reg write_resp_valid;
assign s_axi_bvalid = write_resp_valid;
assign s_axi_bresp = 2'b00; // OKAYååº
// 读å°åééå¤ç
reg read_addr_ready;
assign s_axi_arready = read_addr_ready;
// 读æ°æ®ééå¤ç
reg [31:0] read_data;
reg read_data_valid;
assign s_axi_rdata = read_data;
assign s_axi_rvalid = read_data_valid;
assign s_axi_rresp = 2'b00; // OKAYååº
// åæä½é»è¾
always @(posedge clk or posedge rst) begin
if (rst) begin
write_addr_ready <= 0;
write_data_ready <= 0;
write_resp_valid <= 0;
end else begin
// åå°ååæ°æ®åæ¶æææ¶,åå
¥memory
if (s_axi_awvalid && s_axi_wvalid) begin
memory[s_axi_awaddr[11:2]] <= s_axi_wdata;
write_addr_ready <= 1;
write_data_ready <= 1;
write_resp_valid <= 1;
end else begin
write_addr_ready <= 0;
write_data_ready <= 0;
write_resp_valid <= 0;
end
end
end
// 读æä½é»è¾
always @(posedge clk or posedge rst) begin
if (rst) begin
read_addr_ready <= 0;
read_data <= 0;
read_data_valid <= 0;
end else begin
// 读å°åæææ¶,ä»memory读åæ°æ®
if (s_axi_arvalid) begin
read_data <= memory[s_axi_araddr[11:2]];
read_addr_ready <= 1;
read_data_valid <= 1;
end else begin
read_addr_ready <= 0;
read_data_valid <= 0;
end
end
end
// Dump waves
initial begin
$dumpfile("dump.vcd");
$dumpvars(1, axi_lite_ram);
end
endmodule
Your RAM is not implementing AXI correctly.
Your RAM is not implementing AXI correctly.
thanks, fixed it.
using a simple axi-ram.v
log, axil_master.read data not match with write data