import net.haspamelodica.swt.helper.gcs.GeneralGC;
import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
-import net.mograsim.logic.model.model.ViewModelModifiable;
+import net.mograsim.logic.model.model.LogicModelModifiable;
import net.mograsim.logic.model.model.components.ModelComponent;
import net.mograsim.logic.model.model.components.atomic.ModelAndGate;
import net.mograsim.logic.model.model.wires.Pin;
public class ModelMemoryWA extends ModelComponent
{
private final MainMemoryDefinition definition;
- private final Pin addrPin, dataPin, rWPin;
- private WordAddressableMemoryComponent memory;
+ private final Pin addrPin, dataPin, rWPin, clock;
+ private CoreWordAddressableMemory memory;
private final static int width = 100, height = 300;
private Renderer symbolRenderer;
private Renderer outlineRenderer;
- public ModelMemoryWA(ViewModelModifiable model, MainMemoryDefinition definition, String name)
+ public ModelMemoryWA(LogicModelModifiable model, MainMemoryDefinition definition, String name)
{
- super(model, name);
+ super(model, name,false);
this.definition = definition;
CenteredTextParams renderer1Params = new CenteredTextParams();
setSize(width, height);
//TODO check the usages
- addPin(addrPin = new Pin(this, "A", definition.getMemoryAddressBits(), PinUsage.INPUT, 0, 10));
- addPin(dataPin = new Pin(this, "D", definition.getCellWidth(), PinUsage.TRISTATE, 0, 30));
- addPin(rWPin = new Pin(this, "RW", 1, PinUsage.INPUT, 0, 50));
+ addPin(addrPin = new Pin(model, this, "A", definition.getMemoryAddressBits(), PinUsage.INPUT, 0, 10));
+ addPin(dataPin = new Pin(model, this, "D", definition.getCellWidth(), PinUsage.TRISTATE, 0, 30));
+ addPin(rWPin = new Pin(model, this, "RW", 1, PinUsage.INPUT, 0, 50));
+ addPin(clock = new Pin(model, this, "C", 1, PinUsage.INPUT, 0, 70));
+
+ init();
}
public Pin getAddressPin()
{
return rWPin;
}
+
+ public Pin getClockPin()
+ {
+ return clock;
+ }
- public void setCoreModelBinding(WordAddressableMemoryComponent memory)
+ public void setCoreModelBinding(CoreWordAddressableMemory memory)
{
this.memory = memory;
}
return definition;
}
- public WordAddressableMemoryComponent getMemory()
+ public CoreWordAddressableMemory getMemory()
{
return memory;
}