Skip to content

Bug fixing for axi_burst_unwrap module #369

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

Merged
merged 2 commits into from
Mar 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/axi_burst_unwrap.sv
Original file line number Diff line number Diff line change
Expand Up @@ -468,13 +468,13 @@ module axi_burst_unwrap_ax_chan #(
logic [AddrWidth-1:0] wrap_boundary;

// The total size of this burst (beat_size * burst_length)
assign container_size = ax_i.len << ax_i.size;
assign container_size = (ax_i.len + 1) << ax_i.size;
// For wrapping bursts, this returns the wrap boundary (container size is power of two according to A.3.4.1)
assign wrap_boundary = ax_i.addr & ~(AddrWidth'(container_size) - 1);

enum logic {Idle, Busy} state_d, state_q;
always_comb begin
cnt_alloc_req = 1'b0;
cnt_alloc_req = '0;
ax_d = ax_q;
state_d = state_q;
ax_o = '0;
Expand All @@ -489,18 +489,19 @@ module axi_burst_unwrap_ax_chan #(
ax_d = ax_i;
ax_d.burst = axi_pkg::BURST_INCR;
split_len = 8'd1;
// Allocate second counter only for AwChan
cnt_alloc_req = { AwChan, 1'b1 };
// Try to feed first burst through.
ax_o = ax_d;
// First (this) incr burst from addr to wrap boundary + container size
ax_o.len = (wrap_boundary + container_size - ax_i.addr) >> ax_i.size;
ax_o.len = ((wrap_boundary + container_size - ax_i.addr) >> ax_i.size) - 1;
// Next incr burst from wrap boundary to addr
ax_d.len = (ax_i.addr - wrap_boundary) >> ax_i.size;
ax_d.len = ((ax_i.addr - wrap_boundary) >> ax_i.size) - 1;
ax_d.addr = wrap_boundary;
ax_valid_o = 1'b1;
if (ax_ready_i) begin
ax_ready_o = 1'b1;
state_d = Busy;
// Allocate second counter only for AwChan
cnt_alloc_req = { AwChan, 1'b1 };
end
end else begin // No splitting required -> feed through.
ax_o = ax_i;
Expand Down