From fb4d824f6184c21d2dad26fff1f961cd38bcb9d0 Mon Sep 17 00:00:00 2001 From: Luca Zulberti Date: Tue, 6 Feb 2024 16:35:04 +0100 Subject: [PATCH] Fix byte calculation in R and W forks --- 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