Set reasonable default values for Am2900 MicroInstructions
authorFabian Stemmler <stemmler@in.tum.de>
Thu, 26 Sep 2019 15:11:51 +0000 (17:11 +0200)
committerFabian Stemmler <stemmler@in.tum.de>
Thu, 26 Sep 2019 15:11:51 +0000 (17:11 +0200)
plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/Am2900MicroInstructionDefinition.java
plugins/net.mograsim.machine/src/net/mograsim/machine/mi/parameters/BooleanClassification.java

index b67e93d..280b788 100644 (file)
@@ -21,8 +21,8 @@ public class Am2900MicroInstructionDefinition implements MicroInstructionDefinit
                        .add("AQ", "AB", "ZQ", "ZB", "ZA", "DA", "DQ", "DZ").build();
        private static final MnemonicFamily am2901FuncInstructions = new MnemonicFamilyBuilder(3).addX().setXDefault()
                        .add("ADD", "SUBR", "SUBS", "OR", "AND", "NOTRS", "EXOR", "EXNOR").build();
-       private static final MnemonicFamily am2901DestInstructions = new MnemonicFamilyBuilder(3).addX().setXDefault()
-                       .add("QREG", "NOP", "RAMA", "RAMF", "RAMQD", "RAMD", "RAMQU", "RAMU").build();
+       private static final MnemonicFamily am2901DestInstructions = new MnemonicFamilyBuilder(3).addX()
+                       .add("QREG", "NOP", "RAMA", "RAMF", "RAMQD", "RAMD", "RAMQU", "RAMU").setDefault("NOP").build();
        private static final IntegerClassification register = new IntegerClassification(0, 4);
        private static final BooleanClassification registerSelect = new BooleanClassification("MR", "IR");
        private static final BooleanClassification abus = new BooleanClassification(true, "H", "AB");
@@ -60,9 +60,9 @@ public class Am2900MicroInstructionDefinition implements MicroInstructionDefinit
                                        "Load_Load_I_CandnotZ", "Load_Load_I_N", "Load_Load_I_notN")
                        .build();
        private static final BooleanClassification ccen = new BooleanClassification(true, "PS", "C");
-       private static final MnemonicFamily am2910Instructions = new MnemonicFamilyBuilder(4).addX().setXDefault()
+       private static final MnemonicFamily am2910Instructions = new MnemonicFamilyBuilder(4).addX()
                        .add("JZ", "CJS", "JMAP", "CJP", "PUSH", "JSRP", "CJV", "JRP", "RFCT", "RPCT", "CRTN", "CJPP", "LDCT", "LOOP", "CONT", "TWB")
-                       .build();
+                       .setDefault("CONT").build();
 
        private static final IntegerClassification constant_12bit = new IntegerClassification(0, 12);
        private static final IntegerClassification constant_16bit = new IntegerClassification(0, 16);
index ed53ece..e1d3e65 100644 (file)
@@ -9,8 +9,8 @@ public class BooleanClassification extends MnemonicFamily
 
        public BooleanClassification(boolean defaultValue, String trueName, String falseName)
        {
-               super(defaultValue ? trueName : falseName, new MnemonicPair(trueName, BitVector.SINGLE_1),
-                               new MnemonicPair(falseName, BitVector.SINGLE_0));
+               super(defaultValue ? trueName : falseName, new MnemonicPair("X", BitVector.SINGLE_0),
+                               new MnemonicPair(trueName, BitVector.SINGLE_1), new MnemonicPair(falseName, BitVector.SINGLE_0));
                this.trueName = trueName;
                this.falseName = falseName;
        }