X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.core%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fcore%2Fcomponents%2FMerger.java;fp=net.mograsim.logic.core%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fcore%2Fcomponents%2FMerger.java;h=07303a2e04a3772ee2fbcb7037b965463afa21c0;hb=3e6ac3d7fd389191d02c1c6982fbf093421ce4f2;hp=6fa5b93c126d057850a2e8430f1c7f702c47a8fe;hpb=2e7dc40f788b00146f2d0805fecd9d23adbda363;p=Mograsim.git diff --git a/net.mograsim.logic.core/src/net/mograsim/logic/core/components/Merger.java b/net.mograsim.logic.core/src/net/mograsim/logic/core/components/Merger.java index 6fa5b93c..07303a2e 100644 --- a/net.mograsim.logic.core/src/net/mograsim/logic/core/components/Merger.java +++ b/net.mograsim.logic.core/src/net/mograsim/logic/core/components/Merger.java @@ -17,7 +17,7 @@ public class Merger extends Component implements LogicObserver /** * - * @param union The output of merging n {@link Wire}s into one. Must have length = a1.length() + a2.length() + ... + an.length(). + * @param union The output of merging n {@link Wire}s into one. Must have width = a1.width() + a2.width() + ... + an.width(). * @param inputs The inputs to be merged into the union */ public Merger(Timeline timeline, ReadWriteEnd union, ReadEnd... inputs) @@ -31,13 +31,13 @@ public class Merger extends Component implements LogicObserver for (int i = 0; i < inputs.length; i++) { beginningIndex[i] = length; - length += inputs[i].length(); + length += inputs[i].width(); inputs[i].registerObserver(this); } - if (length != union.length()) + if (length != union.width()) throw new IllegalArgumentException( - "The output of merging n WireArrays into one must have length = a1.length() + a2.length() + ... + an.length()."); + "The output of merging n WireArrays into one must have width = a1.width() + a2.width() + ... + an.width()."); } public ReadEnd getInput(int index)