X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.machine%2Fsrc%2Fnet%2Fmograsim%2Fmachine%2Fstandard%2Fmemory%2FModelMemoryWA.java;h=218c655455f663b0c9f2462140365b4f1288f34d;hb=939f37fb65d2057c3f370214cc2eebd3e9989f69;hp=8da1dbb28a68c5574e3f0923f7f8529b7eeffc82;hpb=93b398d6271a538a2a4c9f4de07a3b4a8a2a7fd4;p=Mograsim.git diff --git a/net.mograsim.machine/src/net/mograsim/machine/standard/memory/ModelMemoryWA.java b/net.mograsim.machine/src/net/mograsim/machine/standard/memory/ModelMemoryWA.java index 8da1dbb2..218c6554 100644 --- a/net.mograsim.machine/src/net/mograsim/machine/standard/memory/ModelMemoryWA.java +++ b/net.mograsim.machine/src/net/mograsim/machine/standard/memory/ModelMemoryWA.java @@ -2,12 +2,12 @@ package net.mograsim.machine.standard.memory; import net.haspamelodica.swt.helper.gcs.GeneralGC; import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle; -import net.mograsim.logic.model.model.ViewModelModifiable; +import net.mograsim.logic.model.model.LogicModelModifiable; import net.mograsim.logic.model.model.components.ModelComponent; import net.mograsim.logic.model.model.components.atomic.ModelAndGate; import net.mograsim.logic.model.model.wires.Pin; import net.mograsim.logic.model.model.wires.PinUsage; -import net.mograsim.logic.model.modeladapter.ViewLogicModelAdapter; +import net.mograsim.logic.model.modeladapter.LogicCoreAdapter; import net.mograsim.logic.model.serializing.IdentifyParams; import net.mograsim.logic.model.serializing.IndirectModelComponentCreator; import net.mograsim.logic.model.snippets.Renderer; @@ -20,15 +20,15 @@ import net.mograsim.machine.MainMemoryDefinition; public class ModelMemoryWA extends ModelComponent { private final MainMemoryDefinition definition; - private final Pin addrPin, dataPin, rWPin; - private WordAddressableMemoryComponent memory; + private final Pin addrPin, dataPin, rWPin, clock; + private CoreWordAddressableMemory memory; private final static int width = 100, height = 300; private Renderer symbolRenderer; private Renderer outlineRenderer; - public ModelMemoryWA(ViewModelModifiable model, MainMemoryDefinition definition, String name) + public ModelMemoryWA(LogicModelModifiable model, MainMemoryDefinition definition, String name) { - super(model, name); + super(model, name,false); this.definition = definition; CenteredTextParams renderer1Params = new CenteredTextParams(); @@ -39,9 +39,12 @@ public class ModelMemoryWA extends ModelComponent setSize(width, height); //TODO check the usages - addPin(addrPin = new Pin(this, "A", definition.getMemoryAddressBits(), PinUsage.INPUT, 0, 10)); - addPin(dataPin = new Pin(this, "D", definition.getCellWidth(), PinUsage.TRISTATE, 0, 30)); - addPin(rWPin = new Pin(this, "RW", 1, PinUsage.INPUT, 0, 50)); + addPin(addrPin = new Pin(model, this, "A", definition.getMemoryAddressBits(), PinUsage.INPUT, 0, 10)); + addPin(dataPin = new Pin(model, this, "D", definition.getCellWidth(), PinUsage.TRISTATE, 0, 30)); + addPin(rWPin = new Pin(model, this, "RW", 1, PinUsage.INPUT, 0, 50)); + addPin(clock = new Pin(model, this, "C", 1, PinUsage.INPUT, 0, 70)); + + init(); } public Pin getAddressPin() @@ -58,8 +61,13 @@ public class ModelMemoryWA extends ModelComponent { return rWPin; } + + public Pin getClockPin() + { + return clock; + } - public void setLogicModelBinding(WordAddressableMemoryComponent memory) + public void setCoreModelBinding(CoreWordAddressableMemory memory) { this.memory = memory; } @@ -69,7 +77,7 @@ public class ModelMemoryWA extends ModelComponent return definition; } - public WordAddressableMemoryComponent getMemory() + public CoreWordAddressableMemory getMemory() { return memory; } @@ -100,7 +108,7 @@ public class ModelMemoryWA extends ModelComponent static { - ViewLogicModelAdapter.addComponentAdapter(new WordAddressableMemoryAdapter()); + LogicCoreAdapter.addComponentAdapter(new WordAddressableMemoryAdapter()); IndirectModelComponentCreator.setComponentSupplier(ModelAndGate.class.getCanonicalName(), (m, p, n) -> { ModelMemoryWAParams params = JsonHandler.fromJsonTree(p, ModelMemoryWAParams.class);