Switched to using logical U for mnemonic X to avoid glitches in Am2900
authorDaniel Kirschten <daniel.kirschten@gmx.de>
Fri, 15 Nov 2019 00:21:44 +0000 (01:21 +0100)
committerDaniel Kirschten <daniel.kirschten@gmx.de>
Fri, 15 Nov 2019 00:21:44 +0000 (01:21 +0100)
Wir machen den Benutzern also ein U für ein X vor.

plugins/net.mograsim.machine/src/net/mograsim/machine/mi/parameters/BooleanClassification.java
plugins/net.mograsim.machine/src/net/mograsim/machine/mi/parameters/IntegerImmediate.java
plugins/net.mograsim.machine/src/net/mograsim/machine/mi/parameters/MnemonicFamily.java

index fb94a30..f52e966 100644 (file)
@@ -2,7 +2,7 @@ package net.mograsim.machine.mi.parameters;
 
 import static net.mograsim.logic.core.types.BitVector.SINGLE_0;
 import static net.mograsim.logic.core.types.BitVector.SINGLE_1;
-import static net.mograsim.logic.core.types.BitVector.SINGLE_X;
+import static net.mograsim.logic.core.types.BitVector.SINGLE_U;
 
 import net.mograsim.machine.mi.parameters.MicroInstructionParameter.ParameterType;
 
@@ -12,7 +12,7 @@ public class BooleanClassification extends MnemonicFamily
 
        public BooleanClassification(boolean defaultValue, String trueName, String falseName)
        {
-               super(defaultValue ? trueName : falseName, new MnemonicPair("X", SINGLE_X), new MnemonicPair(trueName, SINGLE_1),
+               super(defaultValue ? trueName : falseName, new MnemonicPair("X", SINGLE_U), new MnemonicPair(trueName, SINGLE_1),
                                new MnemonicPair(falseName, SINGLE_0));
                this.trueName = trueName;
                this.falseName = falseName;
@@ -20,7 +20,7 @@ public class BooleanClassification extends MnemonicFamily
 
        public BooleanClassification(String trueName, String falseName)
        {
-               super("X", new MnemonicPair("X", SINGLE_X), new MnemonicPair(trueName, SINGLE_1), new MnemonicPair(falseName, SINGLE_0));
+               super("X", new MnemonicPair("X", SINGLE_U), new MnemonicPair(trueName, SINGLE_1), new MnemonicPair(falseName, SINGLE_0));
                this.trueName = trueName;
                this.falseName = falseName;
        }
index dea11d4..97db7e4 100644 (file)
@@ -1,6 +1,6 @@
 package net.mograsim.machine.mi.parameters;
 
-import static net.mograsim.logic.core.types.Bit.X;
+import static net.mograsim.logic.core.types.Bit.U;
 
 import java.math.BigInteger;
 
@@ -16,7 +16,7 @@ public final class IntegerImmediate implements MicroInstructionParameter
         */
        public IntegerImmediate(IntegerClassification owner, BigInteger value, int bits)
        {
-               this(owner, value == null ? BitVector.of(X, bits) : BitVector.from(value, bits));
+               this(owner, value == null ? BitVector.of(U, bits) : BitVector.from(value, bits));
        }
 
        public IntegerImmediate(IntegerClassification owner, BitVector value)
@@ -67,7 +67,7 @@ public final class IntegerImmediate implements MicroInstructionParameter
 
        public boolean isX()
        {
-               return value.equals(BitVector.of(X, value.length()));
+               return value.equals(BitVector.of(U, value.length()));
        }
 
        /**
index fbdaf76..87046c8 100644 (file)
@@ -1,6 +1,6 @@
 package net.mograsim.machine.mi.parameters;
 
-import static net.mograsim.logic.core.types.Bit.X;
+import static net.mograsim.logic.core.types.Bit.U;
 
 import java.util.Arrays;
 import java.util.LinkedList;
@@ -182,7 +182,7 @@ public class MnemonicFamily implements ParameterClassification
 
                public MnemonicFamilyBuilder addX()
                {
-                       pairs.add(new MnemonicPair("X", BitVector.of(X, bits)));
+                       pairs.add(new MnemonicPair("X", BitVector.of(U, bits)));
                        return this;
                }