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.Machine;
7 import net.mograsim.machine.MainMemoryDefinition;
8 import net.mograsim.machine.ModelMemory;
10 public abstract class ModelWordAddressableMemory<M extends Machine> extends ModelMemory<M>
12 private final Pin addrPin, dataPin, rWPin;
13 private CoreWordAddressableMemory memory;
14 private MainMemoryDefinition definition;
16 public ModelWordAddressableMemory(LogicModelModifiable model, MainMemoryDefinition definition, String name)
18 super(model, 120, 150, name, "RAM", false);
19 this.definition = definition;
21 addPin(addrPin = new Pin(model, this, "A", definition.getMemoryAddressBits(), PinUsage.INPUT, getWidth(), 30));
22 addPin(dataPin = new Pin(model, this, "D", definition.getCellWidth(), PinUsage.TRISTATE, getWidth(), 50));
23 addPin(rWPin = new Pin(model, this, "RW", 1, PinUsage.INPUT, getWidth(), 70));
28 public MainMemoryDefinition getDefinition()
33 public Pin getAddressPin()
38 public Pin getDataPin()
43 public Pin getReadWritePin()
48 public void setCoreModelBinding(CoreWordAddressableMemory memory)
53 public CoreWordAddressableMemory getCoreMemory()