Implemented GUIAm2904MSR
[Mograsim.git] / net.mograsim.logic.model.am2900 / src / net / mograsim / logic / model / examples / GUIComponentTestbench.java
index b745891..66e3212 100644 (file)
@@ -5,7 +5,6 @@ import java.util.Comparator;
 import java.util.List;
 
 import net.mograsim.logic.model.SimpleLogicUIStandalone;
-import net.mograsim.logic.model.am2900.components.GUIram5_12;
 import net.mograsim.logic.model.model.ViewModelModifiable;
 import net.mograsim.logic.model.model.components.GUIComponent;
 import net.mograsim.logic.model.model.components.atomic.GUIBitDisplay;
@@ -14,6 +13,7 @@ import net.mograsim.logic.model.model.components.atomic.SimpleRectangularHardcod
 import net.mograsim.logic.model.model.components.atomic.SimpleRectangularHardcodedGUIComponent.Usage;
 import net.mograsim.logic.model.model.wires.GUIWire;
 import net.mograsim.logic.model.model.wires.Pin;
+import net.mograsim.logic.model.serializing.IndirectGUIComponentCreator;
 
 public class GUIComponentTestbench
 {
@@ -25,8 +25,7 @@ public class GUIComponentTestbench
        @SuppressWarnings("unused") // for GUIWires being created
        public static void createTestbench(ViewModelModifiable model)
        {
-//             GUIComponent comp = IndirectGUIComponentCreator.createComponent(model, "GUIAm2901", "Am2901");
-               GUIComponent comp = new GUIram5_12(model, "c");
+               GUIComponent comp = IndirectGUIComponentCreator.createComponent(model, "file:components/am2904/GUIAm2904MSR.json");
 
                // guess which pins are outputs and which are inputs
                // TODO this code exists four times... but it seems too "hacky" to put it in a helper class
@@ -42,7 +41,7 @@ public class GUIComponentTestbench
                                        outputPinNames.add(p.name);
                } else
                        for (Pin p : comp.getPins().values())
-                               if (p.getRelX() == 0)
+                               if (p.getRelX() < comp.getWidth())
                                        inputPinNames.add(p.name);
                                else
                                        outputPinNames.add(p.name);