Skip to content

Commit eb1fe63

Browse files
authored
Fix byte calculation in R and W forks (#331)
1 parent 3d03f24 commit eb1fe63

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/axi_sim_mem.sv

+4-4
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ module axi_sim_mem #(
162162
mon_w.user = aw_queue[0].user;
163163
mon_w.beat_count = w_cnt;
164164
for (shortint unsigned
165-
i_byte = axi_pkg::beat_lower_byte(addr, size, len, burst, StrbWidth, w_cnt);
166-
i_byte <= axi_pkg::beat_upper_byte(addr, size, len, burst, StrbWidth, w_cnt);
165+
i_byte = axi_pkg::beat_lower_byte(aw_queue[0].addr, size, len, burst, StrbWidth, w_cnt);
166+
i_byte <= axi_pkg::beat_upper_byte(aw_queue[0].addr, size, len, burst, StrbWidth, w_cnt);
167167
i_byte++) begin
168168
if (axi_req_i.w.strb[i_byte]) begin
169169
automatic addr_t byte_addr = (addr / StrbWidth) * StrbWidth + i_byte;
@@ -232,8 +232,8 @@ module axi_sim_mem #(
232232
r_beat.id = ar_queue[0].id;
233233
r_beat.resp = axi_pkg::RESP_OKAY;
234234
for (shortint unsigned
235-
i_byte = axi_pkg::beat_lower_byte(addr, size, len, burst, StrbWidth, r_cnt);
236-
i_byte <= axi_pkg::beat_upper_byte(addr, size, len, burst, StrbWidth, r_cnt);
235+
i_byte = axi_pkg::beat_lower_byte(ar_queue[0].addr, size, len, burst, StrbWidth, r_cnt);
236+
i_byte <= axi_pkg::beat_upper_byte(ar_queue[0].addr, size, len, burst, StrbWidth, r_cnt);
237237
i_byte++) begin
238238
automatic addr_t byte_addr = (addr / StrbWidth) * StrbWidth + i_byte;
239239
if (!mem.exists(byte_addr)) begin

0 commit comments

Comments
 (0)