-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issue with axil_master.read #95
Comments
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. |
thanks, fixed it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
using a simple axi-ram.v
log, axil_master.read data not match with write data
The text was updated successfully, but these errors were encountered: