X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.core%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fcore%2Fcomponents%2FTriStateBuffer.java;fp=net.mograsim.logic.core%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fcore%2Fcomponents%2FTriStateBuffer.java;h=057c49e5dbd0d953bc29cf7216f14338e2196324;hb=3e6ac3d7fd389191d02c1c6982fbf093421ce4f2;hp=ac2e422584564df1aa79303fd529aadc9ac3d0de;hpb=2e7dc40f788b00146f2d0805fecd9d23adbda363;p=Mograsim.git diff --git a/net.mograsim.logic.core/src/net/mograsim/logic/core/components/TriStateBuffer.java b/net.mograsim.logic.core/src/net/mograsim/logic/core/components/TriStateBuffer.java index ac2e4225..057c49e5 100644 --- a/net.mograsim.logic.core/src/net/mograsim/logic/core/components/TriStateBuffer.java +++ b/net.mograsim.logic.core/src/net/mograsim/logic/core/components/TriStateBuffer.java @@ -15,11 +15,11 @@ public class TriStateBuffer extends BasicComponent public TriStateBuffer(Timeline timeline, int processTime, ReadEnd in, ReadWriteEnd out, ReadEnd enable) { super(timeline, processTime); - if (in.length() != out.length()) + if (in.width() != out.width()) throw new IllegalArgumentException( - "Tri-state output must have the same amount of bits as the input. Input: " + in.length() + " Output: " + out.length()); - if (enable.length() != 1) - throw new IllegalArgumentException("Tri-state enable must have exactly one bit, not " + enable.length() + "."); + "Tri-state output must have the same amount of bits as the input. Input: " + in.width() + " Output: " + out.width()); + if (enable.width() != 1) + throw new IllegalArgumentException("Tri-state enable must have exactly one bit, not " + enable.width() + "."); this.in = in; in.registerObserver(this); this.enable = enable;