Further renaming of length to width
authorDaniel Kirschten <daniel.kirschten@gmx.de>
Mon, 26 Aug 2019 09:06:02 +0000 (11:06 +0200)
committerDaniel Kirschten <daniel.kirschten@gmx.de>
Mon, 26 Aug 2019 09:06:02 +0000 (11:06 +0200)
25 files changed:
net.mograsim.logic.core/src/net/mograsim/logic/core/components/Demux.java
net.mograsim.logic.core/src/net/mograsim/logic/core/components/ManualSwitch.java
net.mograsim.logic.core/src/net/mograsim/logic/core/components/Merger.java
net.mograsim.logic.core/src/net/mograsim/logic/core/components/Mux.java
net.mograsim.logic.core/src/net/mograsim/logic/core/types/Bit.java
net.mograsim.logic.core/src/net/mograsim/logic/core/types/BitVector.java
net.mograsim.logic.core/src/net/mograsim/logic/core/types/BitVectorFormatter.java
net.mograsim.logic.core/src/net/mograsim/logic/core/wires/Wire.java
net.mograsim.logic.core/test/net/mograsim/logic/core/types/BitVectorTest.java
net.mograsim.logic.model.am2900/components/GUIdff4.json
net.mograsim.logic.model.am2900/components/GUIdff4_invwe.json
net.mograsim.logic.model.am2900/components/GUIdlatch4.json
net.mograsim.logic.model.am2900/components/GUIram2.json
net.mograsim.logic.model.am2900/components/GUIram4.json
net.mograsim.logic.model.am2900/test/net/mograsim/logic/model/am2900/TestUtil.java
net.mograsim.logic.model.editor/components/GUIdff4.json
net.mograsim.logic.model.editor/components/GUIdff4_invwe.json
net.mograsim.logic.model.editor/components/GUIdlatch4.json
net.mograsim.logic.model.editor/components/GUIram2.json
net.mograsim.logic.model.editor/components/GUIram4.json
net.mograsim.logic.model/src/net/mograsim/logic/model/snippets/highlevelstatehandlers/standard/atomic/BitVectorSplittingAtomicHighLevelStateHandler.java
net.mograsim.machine/src/net/mograsim/machine/isa/AsmFloatOperand.java
net.mograsim.machine/src/net/mograsim/machine/isa/AsmIntegerOperand.java
net.mograsim.machine/src/net/mograsim/machine/standard/memory/WordAddressableMemory.java
net.mograsim.machine/src/net/mograsim/machine/standard/memory/WordAddressableMemoryComponent.java

index ec36b88..5cf8074 100644 (file)
@@ -24,7 +24,7 @@ public class Demux extends BasicComponent
        /**
         * Output {@link Wire}s and in must be of uniform width
         * 
-        * @param in      Must be of uniform length with all outputs.
+        * @param in      Must be of uniform width with all outputs.
         * @param select  Indexes the output array to which the input is mapped. Must have enough bits to index all outputs.
         * @param outputs One of these outputs receives the input signal, depending on the select bits
         */
index 40f0005..25445ee 100644 (file)
@@ -55,8 +55,8 @@ public class ManualSwitch extends Component implements LogicObservable
 
        public void setState(BitVector bits)
        {
-               if (bits.length() != output.width())
-                       throw new IllegalArgumentException("Incorrect bit vector length");
+               if (bits.width() != output.width())
+                       throw new IllegalArgumentException("Incorrect bit vector width");
                if (bits.equals(output.getInputValues()))
                        return;
                output.feedSignals(bits);
index 07303a2..acc05d3 100644 (file)
@@ -27,15 +27,15 @@ public class Merger extends Component implements LogicObserver
                this.out = union;
                this.beginningIndex = new int[inputs.length];
 
-               int length = 0;
+               int width = 0;
                for (int i = 0; i < inputs.length; i++)
                {
-                       beginningIndex[i] = length;
-                       length += inputs[i].width();
+                       beginningIndex[i] = width;
+                       width += inputs[i].width();
                        inputs[i].registerObserver(this);
                }
 
-               if (length != union.width())
+               if (width != union.width())
                        throw new IllegalArgumentException(
                                        "The output of merging n WireArrays into one must have width = a1.width() + a2.width() + ... + an.width().");
        }
index 6ef41b2..3776bde 100644 (file)
@@ -25,9 +25,9 @@ public class Mux extends BasicComponent
        private final int outputSize;
 
        /**
-        * Input {@link Wire}s and out must be of uniform length
+        * Input {@link Wire}s and out must be of uniform width
         * 
-        * @param out    Must be of uniform length with all inputs.
+        * @param out    Must be of uniform width with all inputs.
         * @param select Indexes the input array which is to be mapped to the output. Must have enough bits to index all inputs.
         * @param inputs One of these inputs is mapped to the output, depending on the select bits
         */
index da7b8c9..e627810 100644 (file)
@@ -69,9 +69,9 @@ public enum Bit implements StrictLogicType<Bit>
                return bits;
        }
 
-       public BitVector toVector(int length)
+       public BitVector toVector(int width)
        {
-               return BitVector.of(this, length);
+               return BitVector.of(this, width);
        }
 
        @Override
index e17ae6e..aed0288 100644 (file)
@@ -50,11 +50,11 @@ public final class BitVector implements StrictLogicType<BitVector>, Iterable<Bit
                return new BitVector(bits.clone());
        }
 
-       public static BitVector of(Bit bit, int length)
+       public static BitVector of(Bit bit, int width)
        {
-               if (length == 1)
+               if (width == 1)
                        return SINGLE_BIT_MAPPING[bit.ordinal()];
-               return new BitVector(bit.makeArray(length));
+               return new BitVector(bit.makeArray(width));
        }
 
        public static BitVector from(long value, int bits)
@@ -157,21 +157,21 @@ public final class BitVector implements StrictLogicType<BitVector>, Iterable<Bit
                return new BitVector(unOp(bits.clone(), Bit::not));
        }
 
-       public int length()
+       public int width()
        {
                return bits.length;
        }
 
        public BitVector concat(BitVector other)
        {
-               Bit[] newBits = Arrays.copyOf(bits, length() + other.length());
-               System.arraycopy(other.bits, 0, newBits, length(), other.length());
+               Bit[] newBits = Arrays.copyOf(bits, width() + other.width());
+               System.arraycopy(other.bits, 0, newBits, width(), other.width());
                return new BitVector(newBits);
        }
 
        public BitVector subVector(int start)
        {
-               return new BitVector(Arrays.copyOfRange(bits, start, length()));
+               return new BitVector(Arrays.copyOfRange(bits, start, width()));
        }
 
        public BitVector subVector(int start, int end)
@@ -181,8 +181,8 @@ public final class BitVector implements StrictLogicType<BitVector>, Iterable<Bit
 
        private void checkCompatibility(BitVector bv)
        {
-               if (length() != bv.length())
-                       throw new IllegalArgumentException(format("BitVector length does not match: %d and %d", length(), bv.length()));
+               if (width() != bv.width())
+                       throw new IllegalArgumentException(format("BitVector width does not match: %d and %d", width(), bv.width()));
        }
 
        static Bit[] binOp(Bit[] dest, Bit[] second, BinaryOperator<Bit> op)
@@ -227,11 +227,11 @@ public final class BitVector implements StrictLogicType<BitVector>, Iterable<Bit
                }
 
                /**
-                * Returns a new mutator of the specified length, <b>with all bits set to <code>null</code></b>. Use with care!
+                * Returns a new mutator of the specified width, <b>with all bits set to <code>null</code></b>. Use with care!
                 */
-               public static BitVectorMutator ofLength(int length)
+               public static BitVectorMutator ofWidth(int width)
                {
-                       return new BitVectorMutator(new Bit[length]);
+                       return new BitVectorMutator(new Bit[width]);
                }
 
                /**
@@ -344,17 +344,17 @@ public final class BitVector implements StrictLogicType<BitVector>, Iterable<Bit
                        return bits[bits.length - bitIndex - 1];
                }
 
-               public int length()
+               public int width()
                {
                        if (bits == null)
-                               throw new IllegalStateException("cannot obtain a length of an empty mutator");
+                               throw new IllegalStateException("cannot obtain a width of an empty mutator");
                        return bits.length;
                }
 
                private void checkCompatibility(BitVector bv)
                {
-                       if (bits != null && bits.length != bv.length())
-                               throw new IllegalArgumentException(format("BitVector length does not match: %d and %d", bits.length, bv.length()));
+                       if (bits != null && bits.length != bv.width())
+                               throw new IllegalArgumentException(format("BitVector width does not match: %d and %d", bits.length, bv.width()));
                }
        }
 
@@ -385,9 +385,9 @@ public final class BitVector implements StrictLogicType<BitVector>, Iterable<Bit
 
        /**
         * Does test for equality of values/content, shifting the other BitVector by <code>offset</code> to the right.<br>
-        * Therefore <code>offset + other.length() <= this.length()</code> needs to be true.
+        * Therefore <code>offset + other.width() <= this.wdith()</code> needs to be true.
         * 
-        * @throws ArrayIndexOutOfBoundsException if <code>offset + other.length() > this.length()</code>
+        * @throws ArrayIndexOutOfBoundsException if <code>offset + other.width() > this.width()</code>
         * 
         * @see Object#equals(Object)
         */
@@ -395,7 +395,7 @@ public final class BitVector implements StrictLogicType<BitVector>, Iterable<Bit
        {
                if (other == null)
                        return false;
-               return Arrays.equals(bits, offset, offset + other.length(), other.bits, 0, other.length());
+               return Arrays.equals(bits, offset, offset + other.width(), other.bits, 0, other.width());
        }
 
        /**
@@ -468,7 +468,7 @@ public final class BitVector implements StrictLogicType<BitVector>, Iterable<Bit
                        @Override
                        public boolean hasNext()
                        {
-                               return pos != length();
+                               return pos != width();
                        }
                };
        }
index c551fed..4996dcb 100644 (file)
@@ -28,7 +28,7 @@ public class BitVectorFormatter
        public static ColorDefinition formatAsColor(BitVector bitVector)
        {
                // TODO maybe find a color assignment for multiple-bit bit vectors?
-               if (bitVector == null || bitVector.length() != 1)
+               if (bitVector == null || bitVector.width() != 1)
                        return new ColorDefinition(BuiltInColor.COLOR_BLACK);
                switch (bitVector.getLSBit(0))
                {
index 581abb6..8b28511 100644 (file)
@@ -389,9 +389,9 @@ public class Wire
 
                public void feedSignals(BitVector newValues)
                {
-                       if (newValues.length() != width)
+                       if (newValues.width() != width)
                                throw new IllegalArgumentException(
-                                               String.format("Attempted to input %d bits instead of %d bits.", newValues.length(), width));
+                                               String.format("Attempted to input %d bits instead of %d bits.", newValues.width(), width));
                        if (!open)
                                throw new IllegalStateException("Attempted to write to closed WireArrayEnd.");
                        timeline.addEvent(e -> setValues(newValues), travelTime);
@@ -422,7 +422,7 @@ public class Wire
                        if (!inputValues.equalsWithOffset(newValues, startingBit))
                        {
                                Bit[] vals = inputValues.getBits();
-                               System.arraycopy(newValues.getBits(), 0, vals, startingBit, newValues.length());
+                               System.arraycopy(newValues.getBits(), 0, vals, startingBit, newValues.width());
                                inputValues = BitVector.of(vals);
                                Wire.this.recalculate();
                        }
@@ -544,20 +544,20 @@ public class Wire
         * Fuses the selected bits of two wires together. If the bits change in one Wire, the other is changed accordingly immediately. Warning:
         * The bits are permanently fused together.
         * 
-        * @param a      The {@link Wire} to be (partially) fused with b
-        * @param b      The {@link Wire} to be (partially) fused with a
-        * @param fromA  The first bit of {@link Wire} a to be fused
-        * @param fromB  The first bit of {@link Wire} b to be fused
-        * @param length The amount of bits to fuse
+        * @param a     The {@link Wire} to be (partially) fused with b
+        * @param b     The {@link Wire} to be (partially) fused with a
+        * @param fromA The first bit of {@link Wire} a to be fused
+        * @param fromB The first bit of {@link Wire} b to be fused
+        * @param width The amount of bits to fuse
         */
-       public static void fuse(Wire a, Wire b, int fromA, int fromB, int length)
+       public static void fuse(Wire a, Wire b, int fromA, int fromB, int width)
        {
                ReadWriteEnd rA = a.createReadWriteEnd(), rB = b.createReadWriteEnd();
                rA.setWriting(false);
                rB.setWriting(false);
                rA.setValues(BitVector.of(Bit.Z, a.width));
                rB.setValues(BitVector.of(Bit.Z, b.width));
-               Fusion aF = new Fusion(rB, fromA, fromB, length), bF = new Fusion(rA, fromB, fromA, length);
+               Fusion aF = new Fusion(rB, fromA, fromB, width), bF = new Fusion(rA, fromB, fromA, width);
                rA.registerObserver(aF);
                rB.registerObserver(bF);
                aF.update(rA);
@@ -580,14 +580,14 @@ public class Wire
        private static class Fusion implements LogicObserver
        {
                private ReadWriteEnd target;
-               int fromSource, fromTarget, length;
+               int fromSource, fromTarget, width;
 
-               public Fusion(ReadWriteEnd target, int fromSource, int fromTarget, int length)
+               public Fusion(ReadWriteEnd target, int fromSource, int fromTarget, int width)
                {
                        this.target = target;
                        this.fromSource = fromSource;
                        this.fromTarget = fromTarget;
-                       this.length = length;
+                       this.width = width;
                }
 
                @Override
@@ -599,7 +599,7 @@ public class Wire
                        else
                        {
                                target.setWriting(true);
-                               BitVector targetInput = source.wireValuesExcludingMe().subVector(fromSource, fromSource + length);
+                               BitVector targetInput = source.wireValuesExcludingMe().subVector(fromSource, fromSource + width);
                                target.setValues(fromTarget, targetInput);
                        }
                }
index 11b5feb..b83a5ff 100644 (file)
@@ -128,7 +128,7 @@ class BitVectorTest
                assertEquals(SINGLE_U, SINGLE_0.join(SINGLE_U));
                assertEquals(SINGLE_X, SINGLE_X.join(SINGLE_Z));
 
-               // higher length
+               // higher width
                var result = BitVector.of(U, X, ZERO, ONE, Z).join(BitVector.of(ONE, ZERO, ZERO, ONE, Z));
                assertEquals(BitVector.of(U, X, ZERO, ONE, Z), result);
        }
@@ -146,7 +146,7 @@ class BitVectorTest
                assertEquals(SINGLE_0, SINGLE_0.and(SINGLE_U));
                assertEquals(SINGLE_X, SINGLE_X.and(SINGLE_Z));
 
-               // higher length
+               // higher width
                var result = BitVector.of(U, X, ZERO, ONE, ONE).and(BitVector.of(ONE, ONE, ZERO, ZERO, ONE));
                assertEquals(BitVector.of(U, X, ZERO, ZERO, ONE), result);
        }
@@ -164,7 +164,7 @@ class BitVectorTest
                assertEquals(SINGLE_1, SINGLE_1.or(SINGLE_U));
                assertEquals(SINGLE_X, SINGLE_X.or(SINGLE_Z));
 
-               // higher length
+               // higher width
                var result = BitVector.of(U, X, ZERO, ONE, ZERO).or(BitVector.of(ZERO, ZERO, ZERO, ONE, ONE));
                assertEquals(BitVector.of(U, X, ZERO, ONE, ONE), result);
        }
@@ -182,7 +182,7 @@ class BitVectorTest
                assertEquals(SINGLE_U, SINGLE_0.xor(SINGLE_U));
                assertEquals(SINGLE_X, SINGLE_X.xor(SINGLE_Z));
 
-               // higher length
+               // higher width
                var result = BitVector.of(U, X, ZERO, ONE, ONE).xor(BitVector.of(ONE, ZERO, ZERO, ZERO, ONE));
                assertEquals(BitVector.of(U, X, ZERO, ONE, ZERO), result);
        }
@@ -199,17 +199,17 @@ class BitVectorTest
                assertEquals(SINGLE_X, SINGLE_X.not());
                assertEquals(SINGLE_X, SINGLE_Z.not());
 
-               // higher length
+               // higher width
                var result = BitVector.of(U, X, ZERO, ONE, Z).not();
                assertEquals(BitVector.of(U, X, ONE, ZERO, X), result);
        }
 
        @Test
-       void testLength()
+       void testWidth()
        {
-               assertEquals(0, BitVector.of().length());
-               assertEquals(1, SINGLE_0.length());
-               assertEquals(3, BitVector.of(X, X, Z).length());
+               assertEquals(0, BitVector.of().width());
+               assertEquals(1, SINGLE_0.width());
+               assertEquals(3, BitVector.of(X, X, Z).width());
        }
 
        @Test
index 4064f93..72b7273 100644 (file)
@@ -689,7 +689,7 @@ mograsim version: 0.1.3
             "q3",
             "q4"
           ],
-          "vectorPartLengthes": [
+          "vectorPartWidths": [
             1,
             1,
             1,
index cb697d2..7665a99 100644 (file)
@@ -698,7 +698,7 @@ mograsim version: 0.1.3
             "q3",
             "q4"
           ],
-          "vectorPartLengthes": [
+          "vectorPartWidths": [
             1,
             1,
             1,
index 28021df..a836450 100644 (file)
@@ -368,7 +368,7 @@ mograsim version: 0.1.3
             "q3",
             "q4"
           ],
-          "vectorPartLengthes": [
+          "vectorPartWidths": [
             1,
             1,
             1,
index 31a01fb..c291980 100644 (file)
@@ -2998,7 +2998,7 @@ mograsim version: 0.1.3
             "c01.q",
             "c00.q"
           ],
-          "vectorPartLengthes": [
+          "vectorPartWidths": [
             4,
             4,
             4,
index 05bfe9d..f676b3d 100644 (file)
@@ -3490,7 +3490,7 @@ mograsim version: 0.1.3
             "c01.q",
             "c00.q"
           ],
-          "vectorPartLengthes": [
+          "vectorPartWidths": [
             16,
             16,
             16,
index 46a4b92..cd682f2 100644 (file)
@@ -92,11 +92,11 @@ public final class TestUtil
                return sb.reverse().toString();
        }
 
-       public static BitVector of(int value, int length)
+       public static BitVector of(int value, int width)
        {
-               BitVectorMutator mutator = BitVectorMutator.ofLength(length);
+               BitVectorMutator mutator = BitVectorMutator.ofWidth(width);
                int val = value;
-               for (int i = length - 1; i >= 0; i--)
+               for (int i = width - 1; i >= 0; i--)
                {
                        mutator.setMSBit(i, Bit.lastBitOf(val));
                        val >>>= 1;
index 4064f93..72b7273 100644 (file)
@@ -689,7 +689,7 @@ mograsim version: 0.1.3
             "q3",
             "q4"
           ],
-          "vectorPartLengthes": [
+          "vectorPartWidths": [
             1,
             1,
             1,
index cb697d2..7665a99 100644 (file)
@@ -698,7 +698,7 @@ mograsim version: 0.1.3
             "q3",
             "q4"
           ],
-          "vectorPartLengthes": [
+          "vectorPartWidths": [
             1,
             1,
             1,
index 28021df..a836450 100644 (file)
@@ -368,7 +368,7 @@ mograsim version: 0.1.3
             "q3",
             "q4"
           ],
-          "vectorPartLengthes": [
+          "vectorPartWidths": [
             1,
             1,
             1,
index 31a01fb..c291980 100644 (file)
@@ -2998,7 +2998,7 @@ mograsim version: 0.1.3
             "c01.q",
             "c00.q"
           ],
-          "vectorPartLengthes": [
+          "vectorPartWidths": [
             4,
             4,
             4,
index 05bfe9d..f676b3d 100644 (file)
@@ -3490,7 +3490,7 @@ mograsim version: 0.1.3
             "c01.q",
             "c00.q"
           ],
-          "vectorPartLengthes": [
+          "vectorPartWidths": [
             16,
             16,
             16,
index 0e2328a..f26c872 100644 (file)
@@ -15,8 +15,8 @@ public class BitVectorSplittingAtomicHighLevelStateHandler implements AtomicHigh
 {
        private SubmodelComponent component;
        private final List<String> vectorPartTargets;
-       private final List<Integer> vectorPartLengthes;
-       private int length;
+       private final List<Integer> vectorPartWidths;
+       private int width;
 
        public BitVectorSplittingAtomicHighLevelStateHandler(HighLevelStateHandlerContext context)
        {
@@ -28,38 +28,38 @@ public class BitVectorSplittingAtomicHighLevelStateHandler implements AtomicHigh
        {
                this.component = context.component;
                this.vectorPartTargets = new ArrayList<>();
-               this.vectorPartLengthes = new ArrayList<>();
+               this.vectorPartWidths = new ArrayList<>();
                if (params != null)
-                       setVectorParts(params.vectorPartTargets, params.vectorPartLengthes);
+                       setVectorParts(params.vectorPartTargets, params.vectorPartWidths);
        }
 
-       public void set(List<String> targets, List<Integer> lengthes)
+       public void set(List<String> targets, List<Integer> widths)
        {
-               setVectorParts(targets, lengthes);
+               setVectorParts(targets, widths);
        }
 
-       public void addVectorPart(String target, int length)
+       public void addVectorPart(String target, int width)
        {
                vectorPartTargets.add(target);
-               vectorPartLengthes.add(length);
-               this.length += length;
+               vectorPartWidths.add(width);
+               this.width += width;
        }
 
        public void clearVectorParts()
        {
                vectorPartTargets.clear();
-               vectorPartLengthes.clear();
-               length = 0;
+               vectorPartWidths.clear();
+               width = 0;
        }
 
-       private void setVectorParts(List<String> targets, List<Integer> lengthes)
+       private void setVectorParts(List<String> targets, List<Integer> widths)
        {
                clearVectorParts();
-               if (targets.size() != lengthes.size())
-                       throw new IllegalArgumentException("Targets list and lenghtes list have different sizes");
+               if (targets.size() != widths.size())
+                       throw new IllegalArgumentException("Targets list and widths list have different sizes");
                vectorPartTargets.addAll(targets);
-               vectorPartLengthes.addAll(lengthes);
-               length += lengthes.stream().mapToInt(Integer::intValue).sum();
+               vectorPartWidths.addAll(widths);
+               width += widths.stream().mapToInt(Integer::intValue).sum();
        }
 
        @Override
@@ -74,9 +74,9 @@ public class BitVectorSplittingAtomicHighLevelStateHandler implements AtomicHigh
                                vectorPart = BitVector.of((Bit) subStateUncasted);
                        else
                                vectorPart = (BitVector) subStateUncasted;
-                       if (vectorPart.length() != vectorPartLengthes.get(partIndex))
+                       if (vectorPart.width() != vectorPartWidths.get(partIndex))
                                throw new IllegalArgumentException(
-                                               "Incorrect vector part length: " + vectorPart.length() + "; expected " + vectorPartLengthes.get(partIndex));
+                                               "Incorrect vector part width: " + vectorPart.width() + "; expected " + vectorPartWidths.get(partIndex));
                        result = vectorPart.concat(result);
                }
                return result;
@@ -86,14 +86,14 @@ public class BitVectorSplittingAtomicHighLevelStateHandler implements AtomicHigh
        public void setHighLevelState(Object newState)
        {
                BitVector newStateCasted = (BitVector) newState;
-               if (newStateCasted.length() != length)
-                       throw new IllegalArgumentException("Incorrect vector length: " + newStateCasted.length() + "; expected " + length);
+               if (newStateCasted.width() != width)
+                       throw new IllegalArgumentException("Incorrect vector width: " + newStateCasted.width() + "; expected " + width);
                for (int partIndex = vectorPartTargets.size() - 1, bitIndex = 0; partIndex >= 0; partIndex--)
                {
-                       int vectorPartLength = vectorPartLengthes.get(partIndex);
-                       BitVector vectorPart = newStateCasted.subVector(bitIndex, bitIndex + vectorPartLength);
+                       int vectorPartWidth = vectorPartWidths.get(partIndex);
+                       BitVector vectorPart = newStateCasted.subVector(bitIndex, bitIndex + vectorPartWidth);
                        component.setHighLevelState(vectorPartTargets.get(partIndex), vectorPart);
-                       bitIndex += vectorPartLength;
+                       bitIndex += vectorPartWidth;
                }
        }
 
@@ -102,14 +102,14 @@ public class BitVectorSplittingAtomicHighLevelStateHandler implements AtomicHigh
        {
                BitVectorSplittingAtomicHighLevelStateHandlerParams params = new BitVectorSplittingAtomicHighLevelStateHandlerParams();
                params.vectorPartTargets = new ArrayList<>(vectorPartTargets);
-               params.vectorPartLengthes = new ArrayList<>(vectorPartLengthes);
+               params.vectorPartWidths = new ArrayList<>(vectorPartWidths);
                return params;
        }
 
        public static class BitVectorSplittingAtomicHighLevelStateHandlerParams
        {
                public List<String> vectorPartTargets;
-               public List<Integer> vectorPartLengthes;
+               public List<Integer> vectorPartWidths;
        }
 
        static
index 7a1a6eb..a15d9d5 100644 (file)
@@ -90,7 +90,7 @@ public class AsmFloatOperand implements AsmOperand
                int bitLength = raw.bitLength() - (bi.signum() - 1) / 2;
                if (bitLength > size)
                        throw new AsmNumberFormatException("Error parsing %s: bit count %d exceeds size %d", bi, bitLength, size);
-               BitVectorMutator bvm = BitVectorMutator.ofLength(size);
+               BitVectorMutator bvm = BitVectorMutator.ofWidth(size);
                for (int i = 0; i < size; i++)
                        bvm.setLSBit(i, Bit.of(raw.testBit(i)));
                return bvm.toBitVector();
index d3ac80f..70f5a43 100644 (file)
@@ -55,7 +55,7 @@ public class AsmIntegerOperand implements AsmOperand
                int bitLength = bi.bitLength() - (bi.signum() - 1) / 2;
                if (bitLength > size)
                        throw new AsmNumberFormatException("Error parsing %s: bit count %d exceeds size %d", bi, bitLength, size);
-               BitVectorMutator bvm = BitVectorMutator.ofLength(size);
+               BitVectorMutator bvm = BitVectorMutator.ofWidth(size);
                for (int i = 0; i < size; i++)
                        bvm.setLSBit(i, Bit.of(bi.testBit(i)));
                return bvm.toBitVector();
index ee40201..2e209f1 100644 (file)
@@ -112,9 +112,9 @@ public class WordAddressableMemory implements MainMemory
 
                public void setCell(int index, BitVector bits)
                {
-                       if (bits.length() != cellWidth)
+                       if (bits.width() != cellWidth)
                                throw new IllegalArgumentException(String.format(
-                                               "BitVector to be saved in memory cell has unexpected length. Expected: %d Actual: %d", cellWidth, bits.length()));
+                                               "BitVector to be saved in memory cell has unexpected width. Expected: %d Actual: %d", cellWidth, bits.width()));
                        memory[index] = bits;
                }
 
index 13bcc64..4cec2b1 100644 (file)
@@ -10,7 +10,7 @@ import net.mograsim.logic.core.wires.Wire.ReadWriteEnd;
 import net.mograsim.machine.MainMemoryDefinition;
 
 /**
- * A memory component that only allows access to words of a specific length
+ * A memory component that only allows access to words of a specific width
  */
 public class WordAddressableMemoryComponent extends BasicComponent
 {