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;
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));
27 public MainMemoryDefinition getDefinition()
32 public Pin getAddressPin()
37 public Pin getDataPin()
42 public Pin getReadWritePin()
47 public void setCoreModelBinding(CoreWordAddressableMemory memory)
52 public CoreWordAddressableMemory getCoreMemory()