WireArray(Input) is now Wire(End); all in-/outputs are now WireEnds
[Mograsim.git] / era.mi / src / era / mi / logic / components / TriStateBuffer.java
index 8a41424..0dcdb05 100644 (file)
@@ -5,48 +5,48 @@ import java.util.Collections;
 import java.util.List;\r
 \r
 import era.mi.logic.Bit;\r
-import era.mi.logic.wires.WireArray;\r
-import era.mi.logic.wires.WireArray.WireArrayEnd;\r
+import era.mi.logic.wires.Wire;\r
+import era.mi.logic.wires.Wire.WireEnd;\r
 \r
 public class TriStateBuffer extends BasicComponent\r
 {\r
-       WireArray in, enable;\r
-       WireArrayEnd outI;\r
+       WireEnd in, enable;\r
+       WireEnd out;\r
 \r
-       public TriStateBuffer(int processTime, WireArray in, WireArray out, WireArray enable)\r
+       public TriStateBuffer(int processTime, WireEnd in, WireEnd out, WireEnd enable)\r
        {\r
                super(processTime);\r
-               if (in.length != out.length)\r
+               if (in.length() != out.length())\r
                        throw new IllegalArgumentException(\r
-                                       "Tri-state output must have the same amount of bits as the input. Input: " + in.length + " Output: " + out.length);\r
-               if (enable.length != 1)\r
-                       throw new IllegalArgumentException("Tri-state enable must have exactly one bit, not " + enable.length + ".");\r
+                                       "Tri-state output must have the same amount of bits as the input. Input: " + in.length() + " Output: " + out.length());\r
+               if (enable.length() != 1)\r
+                       throw new IllegalArgumentException("Tri-state enable must have exactly one bit, not " + enable.length() + ".");\r
                this.in = in;\r
                in.addObserver(this);\r
                this.enable = enable;\r
                enable.addObserver(this);\r
-               outI = out.createInput();\r
+               this.out = out;\r
        }\r
 \r
        @Override\r
        protected void compute()\r
        {\r
                if (enable.getValue() == Bit.ONE)\r
-                       outI.feedSignals(in.getValues());\r
+                       out.feedSignals(in.getValues());\r
                else\r
-                       outI.clearSignals();\r
+                       out.clearSignals();\r
        }\r
 \r
        @Override\r
-       public List<WireArray> getAllInputs()\r
+       public List<WireEnd> getAllInputs()\r
        {\r
                return Collections.unmodifiableList(Arrays.asList(in, enable));\r
        }\r
 \r
        @Override\r
-       public List<WireArray> getAllOutputs()\r
+       public List<WireEnd> getAllOutputs()\r
        {\r
-               return Collections.unmodifiableList(Arrays.asList(outI.owner));\r
+               return Collections.unmodifiableList(Arrays.asList(out));\r
        }\r
 \r
 }\r