From 34bde60fbf53bf87aadbca540c36bc0506ecb3ef Mon Sep 17 00:00:00 2001 From: Pirmin Vogel Date: Thu, 27 Jun 2024 09:59:53 +0200 Subject: [PATCH] [flash_ctrl] Fix read buffer re-allocation for even buffers Previously, the read buffer re-allocation arbiter erroneously did not factor in the `ack_i` signal coming from the Flash macro. While the open source simulation model never really de-asserts `ack_i`, some real Flash macros may do so. As a result, `req_o` might be high for multiple clock cycles and the read buffer re-allocation may skip even read buffers. This effectively halves the number of usable read buffers which may have a negative impact on performance. The fix is easy and just involves factoring in `ack_i` to take the actual Flash macro request handshake for doing allocations. This resolves lowRISC/OpenTitan#23797. Signed-off-by: Pirmin Vogel --- hw/ip_templates/flash_ctrl/rtl/flash_phy_rd.sv | 2 +- hw/top_earlgrey/ip_autogen/flash_ctrl/rtl/flash_phy_rd.sv | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ip_templates/flash_ctrl/rtl/flash_phy_rd.sv b/hw/ip_templates/flash_ctrl/rtl/flash_phy_rd.sv index 6c386b7a65f3b..cb8e55316e252 100644 --- a/hw/ip_templates/flash_ctrl/rtl/flash_phy_rd.sv +++ b/hw/ip_templates/flash_ctrl/rtl/flash_phy_rd.sv @@ -179,7 +179,7 @@ module flash_phy_rd .idx_o(), .valid_o(), .data_o(), - .ready_i(req_o & no_match) + .ready_i(req_o & ack_i & no_match) ); // which buffer to allocate upon a new transaction diff --git a/hw/top_earlgrey/ip_autogen/flash_ctrl/rtl/flash_phy_rd.sv b/hw/top_earlgrey/ip_autogen/flash_ctrl/rtl/flash_phy_rd.sv index 6c386b7a65f3b..cb8e55316e252 100644 --- a/hw/top_earlgrey/ip_autogen/flash_ctrl/rtl/flash_phy_rd.sv +++ b/hw/top_earlgrey/ip_autogen/flash_ctrl/rtl/flash_phy_rd.sv @@ -179,7 +179,7 @@ module flash_phy_rd .idx_o(), .valid_o(), .data_o(), - .ready_i(req_o & no_match) + .ready_i(req_o & ack_i & no_match) ); // which buffer to allocate upon a new transaction