projects
/
Mograsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added demux; added getAllInputs() and getAllOutputs() for all components
[Mograsim.git]
/
era.mi
/
src
/
era
/
mi
/
logic
/
tests
/
Connector.java
diff --git
a/era.mi/src/era/mi/logic/tests/Connector.java
b/era.mi/src/era/mi/logic/tests/Connector.java
index
d59ee8c
..
7887ff2
100644
(file)
--- a/
era.mi/src/era/mi/logic/tests/Connector.java
+++ b/
era.mi/src/era/mi/logic/tests/Connector.java
@@
-1,5
+1,6
@@
package era.mi.logic.tests;
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.WireArrayInput;
import era.mi.logic.Simulation;
import era.mi.logic.wires.WireArray;
import era.mi.logic.wires.WireArray.WireArrayInput;
@@
-15,7
+16,7
@@
public class Connector implements WireArrayObserver
public Connector(WireArray a, WireArray b)
{
if (a.length != b.length)
public Connector(WireArray a, WireArray b)
{
if (a.length != b.length)
- throw new IllegalArgumentException(
"WireArray width does not match: " + a.length + ", " + b.length
);
+ throw new IllegalArgumentException(
String.format("WireArray width does not match: %o, %o", a.length, b.length)
);
this.a = a;
this.b = b;
a.addObserver(this);
this.a = a;
this.b = b;
a.addObserver(this);
@@
-25,14
+26,14
@@
public class Connector implements WireArrayObserver
}
@Override
}
@Override
- public void update(WireArray initiator)
+ public void update(WireArray initiator
, Bit[] oldValues
)
{
Simulation.TIMELINE.addEvent((e) ->
{
if (initiator == a)
{
Simulation.TIMELINE.addEvent((e) ->
{
if (initiator == a)
- bI.feedSignals(a
.getValues
());
+ bI.feedSignals(a
I.wireValuesExcludingMe
());
else
else
- aI.feedSignals(b
.getValues
());
+ aI.feedSignals(b
I.wireValuesExcludingMe
());
}, 1);
}
}
}, 1);
}
}