X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=plugins%2Fnet.mograsim.logic.model.am2900%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fexamples%2FModelComponentTestbench.java;h=c7e1a469683723481497edc326f910733c0783a6;hb=83a0505e2c104f18ffc6c67c25f523c72cac88a5;hp=1e654c80630a9698798edff2c4f736b39441295d;hpb=7d05144c25daa53e60fc9ed9fd503546a86567f8;p=Mograsim.git 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 1e654c80..c7e1a469 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 @@ -26,6 +26,7 @@ public class ModelComponentTestbench public static void createTestbench(LogicModelModifiable model) { Am2900Loader.setup(); +// ModelComponent comp = new StrictAm2900MachineDefinition().createNew(model).getAm2900(); ModelComponent comp = IndirectModelComponentCreator.createComponent(model, "Am2900"); List inputPinNames = new ArrayList<>(); @@ -34,6 +35,7 @@ public class ModelComponentTestbench if (p.usage == PinUsage.INPUT) inputPinNames.add(p.name); else + // TODO handle TRISTATE pins outputPinNames.add(p.name); inputPinNames.sort(Comparator.comparing(comp::getPin, Comparator.comparing(Pin::getRelY))); @@ -43,14 +45,14 @@ public class ModelComponentTestbench for (int i = 0; i < inputPinNames.size(); i++) { String pinName = inputPinNames.get(i); - ModelManualSwitch sw = new ModelManualSwitch(model, comp.getPin(pinName).logicWidth); + ModelManualSwitch sw = new ModelManualSwitch(model, comp.getPin(pinName).logicWidth, pinName); sw.moveTo(0, 20 * i); new ModelWire(model, comp.getPin(pinName), sw.getOutputPin()); } for (int i = 0; i < outputPinNames.size(); i++) { String pinName = outputPinNames.get(i); - ModelBitDisplay bd = new ModelBitDisplay(model, comp.getPin(pinName).logicWidth); + ModelBitDisplay bd = new ModelBitDisplay(model, comp.getPin(pinName).logicWidth, pinName); bd.moveTo(200, 20 * i); new ModelWire(model, comp.getPin(pinName), bd.getInputPin()); }