From 13befb68923c540a13cfe5b5b28bf0f7ddf5c41b Mon Sep 17 00:00:00 2001 From: Daniel Kirschten Date: Tue, 12 May 2020 21:55:44 +0200 Subject: [PATCH] Renamed Am2900Simple/Strict to Am2900Teaching/Expert. The machine IDs are unchanged. --- .../plugin.xml | 4 ++-- .../AbstractAm2900MachineDefinition.java | 22 +++++++++---------- .../Am2900ExpertMachineDefinition.java | 9 ++++++++ .../model/am2900/machine/Am2900Machine.java | 2 +- .../Am2900TeachingMachineDefinition.java | 9 ++++++++ .../SimpleAm2900MachineDefinition.java | 9 -------- .../StrictAm2900MachineDefinition.java | 9 -------- .../examples/ModelComponentTestbench.java | 2 +- .../mograsim/logic/model/am2900/TestGCD.java | 4 ++-- 9 files changed, 35 insertions(+), 35 deletions(-) create mode 100644 plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/Am2900ExpertMachineDefinition.java create mode 100644 plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/Am2900TeachingMachineDefinition.java delete mode 100644 plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/SimpleAm2900MachineDefinition.java delete mode 100644 plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/StrictAm2900MachineDefinition.java diff --git a/plugins/net.mograsim.logic.model.am2900/plugin.xml b/plugins/net.mograsim.logic.model.am2900/plugin.xml index a3376d51..f679c35c 100644 --- a/plugins/net.mograsim.logic.model.am2900/plugin.xml +++ b/plugins/net.mograsim.logic.model.am2900/plugin.xml @@ -4,11 +4,11 @@ diff --git a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/AbstractAm2900MachineDefinition.java b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/AbstractAm2900MachineDefinition.java index da843922..cbc65b86 100644 --- a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/AbstractAm2900MachineDefinition.java +++ b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/AbstractAm2900MachineDefinition.java @@ -20,10 +20,10 @@ import net.mograsim.machine.registers.RegisterGroup; //(used for detecting installed machines in plugin.core) public class AbstractAm2900MachineDefinition implements MachineDefinition { - public static final String SIMPLE_AM2900_MACHINE_ID = "Am2900Simple"; - public static final String STRICT_AM2900_MACHINE_ID = "Am2900Strict"; - public static final String SIMPLE_AM2900_DESCRIPTION = "Am2900Simple\nTODO Description"; - public static final String STRICT_AM2900_DESCRIPTION = "Am2900Strict\nTODO Description"; + public static final String AM2900_TEACHING_MACHINE_ID = "Am2900Simple"; + public static final String AM2900_EXPERT_MACHINE_ID = "Am2900Strict"; + public static final String AM2900_TEACHING_DESCRIPTION = "Am2900Teaching\nTODO Description"; + public static final String AM2900_EXPERT_DESCRIPTION = "Am2900Expert\nTODO Description"; public static final List unsortedRegisters; public static final List registerGroups; @@ -42,23 +42,23 @@ public class AbstractAm2900MachineDefinition implements MachineDefinition registerGroups = Collections.unmodifiableList(registerGroupsModifiable); } - public final boolean strict; + public final boolean expert; - protected AbstractAm2900MachineDefinition(boolean strict) + protected AbstractAm2900MachineDefinition(boolean expert) { - this.strict = strict; + this.expert = expert; } @Override public String getId() { - return strict ? STRICT_AM2900_MACHINE_ID : SIMPLE_AM2900_MACHINE_ID; + return expert ? AM2900_EXPERT_MACHINE_ID : AM2900_TEACHING_MACHINE_ID; } @Override public String getDescription() { - return strict ? STRICT_AM2900_DESCRIPTION : SIMPLE_AM2900_DESCRIPTION; + return expert ? AM2900_EXPERT_DESCRIPTION : AM2900_TEACHING_DESCRIPTION; } @Override @@ -106,14 +106,14 @@ public class AbstractAm2900MachineDefinition implements MachineDefinition @Override public int hashCode() { - return strict ? 12345 : 54321; + return expert ? 12345 : 54321; } @Override public boolean equals(Object obj) { return obj != null && obj instanceof AbstractAm2900MachineDefinition - && ((AbstractAm2900MachineDefinition) obj).strict == this.strict; + && ((AbstractAm2900MachineDefinition) obj).expert == this.expert; } @Override diff --git a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/Am2900ExpertMachineDefinition.java b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/Am2900ExpertMachineDefinition.java new file mode 100644 index 00000000..b23c9685 --- /dev/null +++ b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/Am2900ExpertMachineDefinition.java @@ -0,0 +1,9 @@ +package net.mograsim.logic.model.am2900.machine; + +public class Am2900ExpertMachineDefinition extends AbstractAm2900MachineDefinition +{ + public Am2900ExpertMachineDefinition() + { + super(true); + } +} \ No newline at end of file diff --git a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/Am2900Machine.java b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/Am2900Machine.java index 33c29f06..e48134f0 100644 --- a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/Am2900Machine.java +++ b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/Am2900Machine.java @@ -89,7 +89,7 @@ public class Am2900Machine implements Machine defaultParams[19] = paramClassifications[19].parse("JZ"); MicroInstruction jzMI = MicroInstruction.create(defaultParams); am2900.setHighLevelState("muir_2.q", jzMI.toBitVector()); - Bit regsValue = machineDefinition.strict ? Bit.U : Bit.ZERO; + Bit regsValue = machineDefinition.expert ? Bit.U : Bit.ZERO; setRegistersTo(machineDefinition.getUnsortedRegisters(), regsValue); setRegisterGroupTo(machineDefinition.getRegisterGroups(), regsValue); // TODO reset latches? diff --git a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/Am2900TeachingMachineDefinition.java b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/Am2900TeachingMachineDefinition.java new file mode 100644 index 00000000..999c9372 --- /dev/null +++ b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/Am2900TeachingMachineDefinition.java @@ -0,0 +1,9 @@ +package net.mograsim.logic.model.am2900.machine; + +public class Am2900TeachingMachineDefinition extends AbstractAm2900MachineDefinition +{ + public Am2900TeachingMachineDefinition() + { + super(false); + } +} \ No newline at end of file diff --git a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/SimpleAm2900MachineDefinition.java b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/SimpleAm2900MachineDefinition.java deleted file mode 100644 index 895b1c2c..00000000 --- a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/SimpleAm2900MachineDefinition.java +++ /dev/null @@ -1,9 +0,0 @@ -package net.mograsim.logic.model.am2900.machine; - -public class SimpleAm2900MachineDefinition extends AbstractAm2900MachineDefinition -{ - public SimpleAm2900MachineDefinition() - { - super(false); - } -} \ No newline at end of file diff --git a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/StrictAm2900MachineDefinition.java b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/StrictAm2900MachineDefinition.java deleted file mode 100644 index ace5fb27..00000000 --- a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/StrictAm2900MachineDefinition.java +++ /dev/null @@ -1,9 +0,0 @@ -package net.mograsim.logic.model.am2900.machine; - -public class StrictAm2900MachineDefinition extends AbstractAm2900MachineDefinition -{ - public StrictAm2900MachineDefinition() - { - super(true); - } -} \ No newline at end of file diff --git a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/ModelComponentTestbench.java b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/ModelComponentTestbench.java index 0dbbbdde..7a009d97 100644 --- a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/ModelComponentTestbench.java +++ b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/ModelComponentTestbench.java @@ -27,7 +27,7 @@ public class ModelComponentTestbench public static void createTestbench(LogicModelModifiable model) { Am2900Loader.setup(); -// ModelComponent comp = new StrictAm2900MachineDefinition().createNew(model).getAm2900(); +// ModelComponent comp = new Am2900ExpertMachineDefinition().createNew(model).getAm2900(); ModelComponent comp = IndirectModelComponentCreator.createComponent(model, "ram5_12"); List inputPinNames = new ArrayList<>(); diff --git a/tests/net.mograsim.logic.model.am2900.tests/src/net/mograsim/logic/model/am2900/TestGCD.java b/tests/net.mograsim.logic.model.am2900.tests/src/net/mograsim/logic/model/am2900/TestGCD.java index f4335d2c..a616c114 100644 --- a/tests/net.mograsim.logic.model.am2900.tests/src/net/mograsim/logic/model/am2900/TestGCD.java +++ b/tests/net.mograsim.logic.model.am2900.tests/src/net/mograsim/logic/model/am2900/TestGCD.java @@ -22,7 +22,7 @@ import net.mograsim.logic.model.am2900.machine.Am2900Machine; import net.mograsim.logic.model.am2900.machine.Am2900MainMemoryDefinition; import net.mograsim.logic.model.am2900.machine.Am2900MicroInstructionDefinition; import net.mograsim.logic.model.am2900.machine.Am2900MicroInstructionMemoryDefinition; -import net.mograsim.logic.model.am2900.machine.StrictAm2900MachineDefinition; +import net.mograsim.logic.model.am2900.machine.Am2900ExpertMachineDefinition; import net.mograsim.logic.model.am2900.machine.registers.am2901.NumberedRegister; import net.mograsim.logic.model.preferences.DefaultRenderPreferences; import net.mograsim.machine.MainMemory; @@ -51,7 +51,7 @@ public class TestGCD public void setupMachine() throws IOException { Am2900Loader.setup(); - mach = new StrictAm2900MachineDefinition().createNew(); + mach = new Am2900ExpertMachineDefinition().createNew(); mpm = MicroInstructionMemoryParser.parseMemory(Am2900MicroInstructionMemoryDefinition.instance, TestGCD.class.getResourceAsStream("gcd.mpm")); ram = new WordAddressableMemory(Am2900MainMemoryDefinition.instance); -- 2.17.1