1 package net.mograsim.machine.mi.components;
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.ModelMemory;
7 import net.mograsim.machine.mi.MicroInstructionMemoryDefinition;
9 public abstract class ModelMicroInstructionMemory extends ModelMemory
11 private final Pin addrPin, dataPin, clock;
12 private CoreMicroInstructionMemory memory;
13 private final MicroInstructionMemoryDefinition definition;
15 public ModelMicroInstructionMemory(LogicModelModifiable model, MicroInstructionMemoryDefinition definition, String name)
17 super(model, 200, 100, name, "MPM", false);
18 this.definition = definition;
19 addPin(addrPin = new Pin(model, this, "A", definition.getMemoryAddressBits(), PinUsage.INPUT, width / 2, 0));
20 addPin(dataPin = new Pin(model, this, "D", definition.getMicroInstructionDefinition().sizeInBits(), PinUsage.OUTPUT, 0, 30));
21 addPin(clock = new Pin(model, this, "C", 1, PinUsage.INPUT, 0, 60));
26 public MicroInstructionMemoryDefinition getDefinition()
31 public Pin getAddressPin()
36 public Pin getDataPin()
41 public Pin getClockPin()
46 public CoreMicroInstructionMemory getCoreMemory()
51 public void setCoreModelBinding(CoreMicroInstructionMemory memory)