From c3a6c5f8c614919982ef31c9e8e324525ce105b1 Mon Sep 17 00:00:00 2001 From: Alvaro Date: Fri, 22 Oct 2010 18:18:33 +0200 Subject: zpu_core_small: load memAAddr is not being initialized during IO read operations (LOAD). This might cause spurious writes to invalid addresses, and invalid values to be loaded onto the stack. This patch explicitly sets memAAddr to correct value (sp). --- zpu/hdl/zpu4/core/zpu_core_small.vhd | 1 + 1 file changed, 1 insertion(+) diff --git a/zpu/hdl/zpu4/core/zpu_core_small.vhd b/zpu/hdl/zpu4/core/zpu_core_small.vhd index f9484bb..681fb09 100644 --- a/zpu/hdl/zpu4/core/zpu_core_small.vhd +++ b/zpu/hdl/zpu4/core/zpu_core_small.vhd @@ -494,6 +494,7 @@ begin null; end case; when State_ReadIO => + memAAddr <= sp; if (in_mem_busy = '0') then state <= State_Fetch; memAWriteEnable <= '1'; -- cgit v1.1