Fixed a bug in Am2900; created dlatch8/80; relayouted some components
[Mograsim.git] / net.mograsim.machine / src / net / mograsim / machine / standard / memory / ModelWordAddressableMemory.java
index edb5666..986dbe5 100644 (file)
@@ -3,10 +3,11 @@ package net.mograsim.machine.standard.memory;
 import net.mograsim.logic.model.model.LogicModelModifiable;
 import net.mograsim.logic.model.model.wires.Pin;
 import net.mograsim.logic.model.model.wires.PinUsage;
+import net.mograsim.machine.Machine;
 import net.mograsim.machine.MainMemoryDefinition;
 import net.mograsim.machine.ModelMemory;
 
-public abstract class ModelWordAddressableMemory extends ModelMemory
+public abstract class ModelWordAddressableMemory<M extends Machine> extends ModelMemory<M>
 {
        private final Pin addrPin, dataPin, rWPin;
        private CoreWordAddressableMemory memory;
@@ -14,16 +15,16 @@ 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();
        }
-       
+
        public MainMemoryDefinition getDefinition()
        {
                return definition;