1 package net.mograsim.machine.standard.memory;
3 import net.mograsim.logic.model.model.LogicModelModifiable;
4 import net.mograsim.logic.model.model.wires.Pin;
5 import net.mograsim.logic.model.model.wires.PinUsage;
6 import net.mograsim.machine.MainMemoryDefinition;
7 import net.mograsim.machine.ModelMemory;
9 public abstract class ModelWordAddressableMemory extends ModelMemory
11 private final Pin addrPin, dataPin, rWPin, clock;
12 private CoreWordAddressableMemory memory;
13 private MainMemoryDefinition definition;
15 public ModelWordAddressableMemory(LogicModelModifiable model, MainMemoryDefinition definition, String name)
17 super(model, 100, 300, name, "RAM", false);
18 this.definition = definition;
20 addPin(addrPin = new Pin(model, this, "A", definition.getMemoryAddressBits(), PinUsage.INPUT, width, 20));
21 addPin(dataPin = new Pin(model, this, "D", definition.getCellWidth(), PinUsage.TRISTATE, width, 50));
22 addPin(rWPin = new Pin(model, this, "RW", 1, PinUsage.INPUT, width, 80));
23 addPin(clock = new Pin(model, this, "C", 1, PinUsage.INPUT, width, 110));
28 public MainMemoryDefinition getDefinition()
33 public Pin getAddressPin()
38 public Pin getDataPin()
43 public Pin getReadWritePin()
48 public Pin getClockPin()
53 public void setCoreModelBinding(CoreWordAddressableMemory memory)
58 public CoreWordAddressableMemory getCoreMemory()