From: Daniel Kirschten Date: Sun, 15 Sep 2019 12:27:15 +0000 (+0200) Subject: Made Memories look more like other components X-Git-Url: https://mograsim.net/gitweb/?a=commitdiff_plain;h=18751c233058925190cf9c1e6bbd1e764f68bf43;p=Mograsim.git Made Memories look more like other components --- diff --git a/net.mograsim.machine/src/net/mograsim/machine/ModelMemory.java b/net.mograsim.machine/src/net/mograsim/machine/ModelMemory.java index 41503189..04a4f551 100644 --- a/net.mograsim.machine/src/net/mograsim/machine/ModelMemory.java +++ b/net.mograsim.machine/src/net/mograsim/machine/ModelMemory.java @@ -13,20 +13,17 @@ public abstract class ModelMemory extends ModelComponent { private Renderer symbolRenderer; private Renderer outlineRenderer; - protected final int width, height; protected ModelMemory(LogicModelModifiable model, int width, int height, String name, String centerText, boolean callInit) { super(model, name, false); - this.width = width; - this.height = height; SimpleRectangularLikeParams rendererParams = new SimpleRectangularLikeParams(); rendererParams.centerText = centerText; - rendererParams.centerTextHeight = 24; - rendererParams.horizontalComponentCenter = width / 100; - rendererParams.pinLabelHeight = 17.5; - rendererParams.pinLabelMargin = 2.5; + rendererParams.centerTextHeight = 5; + rendererParams.horizontalComponentCenter = width / 2; + rendererParams.pinLabelHeight = 2.5; + rendererParams.pinLabelMargin = 0.5; this.symbolRenderer = new SimpleRectangularLikeSymbolRenderer(this, rendererParams); this.outlineRenderer = new DefaultOutlineRenderer(this); diff --git a/net.mograsim.machine/src/net/mograsim/machine/mi/components/ModelMicroInstructionMemory.java b/net.mograsim.machine/src/net/mograsim/machine/mi/components/ModelMicroInstructionMemory.java index 58dc4d06..c9af9a9f 100644 --- a/net.mograsim.machine/src/net/mograsim/machine/mi/components/ModelMicroInstructionMemory.java +++ b/net.mograsim.machine/src/net/mograsim/machine/mi/components/ModelMicroInstructionMemory.java @@ -11,13 +11,13 @@ public abstract class ModelMicroInstructionMemory extends ModelMemory private final Pin addrPin, dataPin; private CoreMicroInstructionMemory memory; private final MicroInstructionMemoryDefinition definition; - + public ModelMicroInstructionMemory(LogicModelModifiable model, MicroInstructionMemoryDefinition definition, String name) { - super(model, 200, 100, name, "MPM", false); + super(model, 120, 150, name, "MPM", false); this.definition = definition; - addPin(addrPin = new Pin(model, this, "A", definition.getMemoryAddressBits(), PinUsage.INPUT, width / 2, 0)); - addPin(dataPin = new Pin(model, this, "D", definition.getMicroInstructionDefinition().sizeInBits(), PinUsage.OUTPUT, 0, 30)); + addPin(addrPin = new Pin(model, this, "A", definition.getMemoryAddressBits(), PinUsage.INPUT, getWidth(), 30)); + addPin(dataPin = new Pin(model, this, "D", definition.getMicroInstructionDefinition().sizeInBits(), PinUsage.OUTPUT, getWidth(), 50)); init(); } @@ -26,7 +26,7 @@ public abstract class ModelMicroInstructionMemory extends ModelMemory { return definition; } - + public Pin getAddressPin() { return addrPin; @@ -41,7 +41,7 @@ public abstract class ModelMicroInstructionMemory extends ModelMemory { return memory; } - + public void setCoreModelBinding(CoreMicroInstructionMemory memory) { this.memory = memory; diff --git a/net.mograsim.machine/src/net/mograsim/machine/standard/memory/ModelWordAddressableMemory.java b/net.mograsim.machine/src/net/mograsim/machine/standard/memory/ModelWordAddressableMemory.java index edb56668..99cc78d4 100644 --- a/net.mograsim.machine/src/net/mograsim/machine/standard/memory/ModelWordAddressableMemory.java +++ b/net.mograsim.machine/src/net/mograsim/machine/standard/memory/ModelWordAddressableMemory.java @@ -14,12 +14,12 @@ public abstract class ModelWordAddressableMemory extends ModelMemory public ModelWordAddressableMemory(LogicModelModifiable model, MainMemoryDefinition definition, String name) { - super(model, 100, 300, name, "RAM", false); + super(model, 120, 150, name, "RAM", false); this.definition = definition; - addPin(addrPin = new Pin(model, this, "A", definition.getMemoryAddressBits(), PinUsage.INPUT, width, 20)); - addPin(dataPin = new Pin(model, this, "D", definition.getCellWidth(), PinUsage.TRISTATE, width, 50)); - addPin(rWPin = new Pin(model, this, "RW", 1, PinUsage.INPUT, width, 80)); + addPin(addrPin = new Pin(model, this, "A", definition.getMemoryAddressBits(), PinUsage.INPUT, getWidth(), 30)); + addPin(dataPin = new Pin(model, this, "D", definition.getCellWidth(), PinUsage.TRISTATE, getWidth(), 50)); + addPin(rWPin = new Pin(model, this, "RW", 1, PinUsage.INPUT, getWidth(), 70)); init(); }