1 package net.mograsim.logic.model.am2900.components;
5 import net.mograsim.logic.core.timeline.Timeline;
6 import net.mograsim.logic.core.wires.CoreWire;
7 import net.mograsim.logic.core.wires.CoreWire.ReadEnd;
8 import net.mograsim.logic.core.wires.CoreWire.ReadWriteEnd;
9 import net.mograsim.logic.model.model.wires.Pin;
10 import net.mograsim.logic.model.modeladapter.CoreModelParameters;
11 import net.mograsim.logic.model.modeladapter.componentadapters.ComponentAdapter;
12 import net.mograsim.machine.standard.memory.CoreWordAddressableMemory;
14 public class ModelAm2900MainMemoryAdapter implements ComponentAdapter<ModelAm2900MainMemory>
18 public Class<ModelAm2900MainMemory> getSupportedClass()
20 return ModelAm2900MainMemory.class;
24 public void createAndLinkComponent(Timeline timeline, CoreModelParameters params, ModelAm2900MainMemory modelComponent,
25 Map<Pin, CoreWire> logicWiresPerPin)
27 ReadWriteEnd data = logicWiresPerPin.get(modelComponent.getDataPin()).createReadWriteEnd();
28 ReadEnd address = logicWiresPerPin.get(modelComponent.getAddressPin()).createReadOnlyEnd();
29 ReadEnd mode = logicWiresPerPin.get(modelComponent.getReadWritePin()).createReadOnlyEnd();
30 CoreWordAddressableMemory mem = new CoreWordAddressableMemory(timeline, 2, modelComponent.getMachine().getMainMemory(), data, mode,
32 modelComponent.setCoreModelBinding(mem);