From aadd22267f96b434ab67e96c440f29c30b0cc4f4 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Fri, 2 Jan 2026 17:25:27 +1100 Subject: [PATCH] execute1: Don't increment the LOG_ADDR SPR after reading it Reading the LOG_DATA SPR is supposed to increment the log address, and reading LOG_ADDR is not supposed to, but currently this is the wrong way around. Fix it. Also add a related comment. Fixes: 8f7326a8246e ("core: Implement various SPRs which read zero and ignore writes", 2025-04-10) Signed-off-by: Paul Mackerras --- execute1.vhdl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/execute1.vhdl b/execute1.vhdl index 03f0ce3..e8355b9 100644 --- a/execute1.vhdl +++ b/execute1.vhdl @@ -1442,8 +1442,8 @@ begin if e_in.spr_select.ispmu = '0' then case e_in.spr_select.sel is when SPRSEL_LOGR => - if e_in.insn(16) = '0' then - v.se.inc_loga := '1'; + if e_in.insn(16) = '1' then + v.se.inc_loga := '1'; -- reading LOG_DATA end if; when others => end case; @@ -1525,6 +1525,7 @@ begin when SPRSEL_DEC => v.se.write_dec := '1'; when SPRSEL_LOGR => + -- must be writing LOG_ADDR; LOG_DATA is readonly v.se.write_loga := '1'; when SPRSEL_CFAR => v.se.write_cfar := '1';