From 3163d767dbd691c533d3f6b15bcf6a196bfd32e0 Mon Sep 17 00:00:00 2001 From: Daniel Kirschten Date: Sun, 15 Sep 2019 18:00:16 +0200 Subject: [PATCH] Setting a memory cell no longer causes an infinite loop --- .../memory/CoreWordAddressableMemory.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/net.mograsim.machine/src/net/mograsim/machine/standard/memory/CoreWordAddressableMemory.java b/net.mograsim.machine/src/net/mograsim/machine/standard/memory/CoreWordAddressableMemory.java index 6dc5da2d..dcbd25ef 100644 --- a/net.mograsim.machine/src/net/mograsim/machine/standard/memory/CoreWordAddressableMemory.java +++ b/net.mograsim.machine/src/net/mograsim/machine/standard/memory/CoreWordAddressableMemory.java @@ -69,15 +69,15 @@ public class CoreWordAddressableMemory extends BasicCoreComponent { BitVector storedData = memory.getCell(addressed); return e -> data.feedSignals(storedData); - } else - { - BitVector transData = data.getValues(); - return e -> - { - data.clearSignals(); - memory.setCell(addressed, transData); - }; } + BitVector transData = data.getValues(); + if (transData.equals(memory.getCell(addressed))) + return null; + return e -> + { + data.clearSignals(); + memory.setCell(addressed, transData); + }; } @Override -- 2.17.1