X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.machine%2Fsrc%2Fnet%2Fmograsim%2Fmachine%2Fmi%2Fcomponents%2FCoreMicroInstructionMemory.java;fp=net.mograsim.machine%2Fsrc%2Fnet%2Fmograsim%2Fmachine%2Fmi%2Fcomponents%2FCoreMicroInstructionMemory.java;h=eb4720995112128c18421e5252034158ba1ff6fd;hb=88e1b4382640ee4e907e06572fe6794bc925f344;hp=29793c5c3bb159958a0cfe225ea996282f162004;hpb=0e506ec1b95fb65d5cb85412b59e528f9a996038;p=Mograsim.git diff --git a/net.mograsim.machine/src/net/mograsim/machine/mi/components/CoreMicroInstructionMemory.java b/net.mograsim.machine/src/net/mograsim/machine/mi/components/CoreMicroInstructionMemory.java index 29793c5c..eb472099 100644 --- a/net.mograsim.machine/src/net/mograsim/machine/mi/components/CoreMicroInstructionMemory.java +++ b/net.mograsim.machine/src/net/mograsim/machine/mi/components/CoreMicroInstructionMemory.java @@ -13,29 +13,28 @@ import net.mograsim.machine.mi.MicroInstructionMemory; public class CoreMicroInstructionMemory extends BasicCoreComponent { - private final ReadWriteEnd data; - private final ReadEnd address, clock; - private final MicroInstructionMemory memory; - - - public CoreMicroInstructionMemory(Timeline timeline, int processTime, MicroInstructionMemory memory, ReadWriteEnd data, ReadEnd address, ReadEnd clock) + private final ReadWriteEnd data; + private final ReadEnd address; + private final MicroInstructionMemory memory; + + + public CoreMicroInstructionMemory(Timeline timeline, int processTime, MicroInstructionMemory memory, ReadWriteEnd data, ReadEnd address) { super(timeline, processTime); this.memory = memory; this.data = data; this.address = address; - this.clock = clock; } public MicroInstructionMemory getMemory() { return memory; } - + @Override public List getAllInputs() { - return List.of(address, clock); + return List.of(address); } @Override @@ -47,12 +46,9 @@ public class CoreMicroInstructionMemory extends BasicCoreComponent @Override protected TimelineEventHandler compute() { - if(clock.getValue() != Bit.ONE) - return null; - - if (!address.hasNumericValue()) + if(!address.hasNumericValue()) { - return e -> data.feedSignals(Bit.U.toVector(data.width())); + return e -> data.feedSignals(Bit.U.toVector(data.width()));//TODO don't always feed U, but decide to feed X or U. } long addressed = address.getUnsignedValue(); BitVector storedData = memory.getCell(addressed).toBitVector();