Skip to content
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

Update picorv32.v #186

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 15 additions & 2 deletions picorv32.v
Original file line number Diff line number Diff line change
Expand Up @@ -2764,6 +2764,8 @@ module picorv32_axi_adapter (
reg ack_arvalid;
reg ack_wvalid;
reg xfer_done;

reg axi_bready;

assign mem_axi_awvalid = mem_valid && |mem_wstrb && !ack_awvalid;
assign mem_axi_awaddr = mem_addr;
Expand All @@ -2778,9 +2780,21 @@ module picorv32_axi_adapter (
assign mem_axi_wstrb = mem_wstrb;

assign mem_ready = mem_axi_bvalid || mem_axi_rvalid;
assign mem_axi_bready = mem_valid && |mem_wstrb;
//assign mem_axi_bready = mem_valid && |mem_wstrb;
assign mem_axi_rready = mem_valid && !mem_wstrb;
assign mem_rdata = mem_axi_rdata;

// control logic for AXI_BREADY
always @(posedge clk) begin : AXI_BREADY_p
axi_bready <= 1'b0;
if (mem_axi_bvalid && mem_valid && |mem_wstrb && ~axi_bready) begin
axi_bready <= 1'b1;
end else begin
axi_bready <= 1'b0;
end
end

assign mem_axi_bready = axi_bready;

always @(posedge clk) begin
if (!resetn) begin
Expand All @@ -2802,7 +2816,6 @@ module picorv32_axi_adapter (
end
endmodule


/***************************************************************
* picorv32_wb
***************************************************************/
Expand Down