From eb1fe639eefbd4179e1f8e06e7f2d20e4350f94c Mon Sep 17 00:00:00 2001 From: Luca Zulberti Date: Wed, 13 Mar 2024 09:53:07 +0100 Subject: [PATCH] Fix byte calculation in R and W forks (#331) --- src/axi_sim_mem.sv | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/axi_sim_mem.sv b/src/axi_sim_mem.sv index b8b6b12c0..79b277843 100644 --- a/src/axi_sim_mem.sv +++ b/src/axi_sim_mem.sv @@ -162,8 +162,8 @@ module axi_sim_mem #( mon_w.user = aw_queue[0].user; mon_w.beat_count = w_cnt; for (shortint unsigned - i_byte = axi_pkg::beat_lower_byte(addr, size, len, burst, StrbWidth, w_cnt); - i_byte <= axi_pkg::beat_upper_byte(addr, size, len, burst, StrbWidth, w_cnt); + i_byte = axi_pkg::beat_lower_byte(aw_queue[0].addr, size, len, burst, StrbWidth, w_cnt); + i_byte <= axi_pkg::beat_upper_byte(aw_queue[0].addr, size, len, burst, StrbWidth, w_cnt); i_byte++) begin if (axi_req_i.w.strb[i_byte]) begin automatic addr_t byte_addr = (addr / StrbWidth) * StrbWidth + i_byte; @@ -232,8 +232,8 @@ module axi_sim_mem #( r_beat.id = ar_queue[0].id; r_beat.resp = axi_pkg::RESP_OKAY; for (shortint unsigned - i_byte = axi_pkg::beat_lower_byte(addr, size, len, burst, StrbWidth, r_cnt); - i_byte <= axi_pkg::beat_upper_byte(addr, size, len, burst, StrbWidth, r_cnt); + i_byte = axi_pkg::beat_lower_byte(ar_queue[0].addr, size, len, burst, StrbWidth, r_cnt); + i_byte <= axi_pkg::beat_upper_byte(ar_queue[0].addr, size, len, burst, StrbWidth, r_cnt); i_byte++) begin automatic addr_t byte_addr = (addr / StrbWidth) * StrbWidth + i_byte; if (!mem.exists(byte_addr)) begin