X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=era.mi%2Fsrc%2Fera%2Fmi%2Flogic%2Ftests%2FConnector.java;fp=era.mi%2Fsrc%2Fera%2Fmi%2Flogic%2Ftests%2FConnector.java;h=0000000000000000000000000000000000000000;hb=c18c04011cab0040c2287608eeefc9c3cc4536c2;hp=9a8d3fc004f1088f010736778229642f447ec96c;hpb=18cf2f85ed378005aa93c8b88fe5fa055a108fad;p=Mograsim.git diff --git a/era.mi/src/era/mi/logic/tests/Connector.java b/era.mi/src/era/mi/logic/tests/Connector.java deleted file mode 100644 index 9a8d3fc0..00000000 --- a/era.mi/src/era/mi/logic/tests/Connector.java +++ /dev/null @@ -1,39 +0,0 @@ -package era.mi.logic.tests; - -import era.mi.logic.Bit; -import era.mi.logic.Simulation; -import era.mi.logic.wires.WireArray; -import era.mi.logic.wires.WireArray.WireArrayEnd; -import era.mi.logic.wires.WireArrayObserver; - -public class Connector implements WireArrayObserver -{ - private final WireArray a; -// private final WireArray b; - private final WireArrayEnd aI; - private final WireArrayEnd bI; - - public Connector(WireArray a, WireArray b) - { - if (a.length != b.length) - throw new IllegalArgumentException(String.format("WireArray width does not match: %d, %d", a.length, b.length)); - this.a = a; -// this.b = b; - a.addObserver(this); - b.addObserver(this); - aI = a.createInput(); - bI = b.createInput(); - } - - @Override - public void update(WireArray initiator, Bit[] oldValues) - { - Simulation.TIMELINE.addEvent((e) -> - { - if (initiator == a) - bI.feedSignals(aI.wireValuesExcludingMe()); - else - aI.feedSignals(bI.wireValuesExcludingMe()); - }, 1); - } -}