1 package net.mograsim.logic.model.am2900.machine;
3 import java.util.Collections;
4 import java.util.HashSet;
7 import net.mograsim.logic.model.am2900.machine.registers.NumberedRegister;
8 import net.mograsim.logic.model.am2900.machine.registers.QRegister;
9 import net.mograsim.logic.model.model.LogicModelModifiable;
10 import net.mograsim.machine.ISASchema;
11 import net.mograsim.machine.MachineDefinition;
12 import net.mograsim.machine.Register;
14 //we can't use the Singleton pattern here because a MachineDefinition needs a public parameterless constructor
15 //(used for detecting installed machines in plugin.core)
16 public class Am2900MachineDefinition implements MachineDefinition
18 public static final String AM2900_MACHINE_ID = "Am2900";
20 public static final Set<Register> allRegisters;
24 Set<Register> allRegistersModifiable = new HashSet<>();
25 allRegistersModifiable.add(QRegister.instance);
26 allRegistersModifiable.addAll(NumberedRegister.instancesCorrectOrder);
27 allRegisters = Collections.unmodifiableSet(allRegistersModifiable);
33 return AM2900_MACHINE_ID;
37 public Am2900Machine createNew()
39 return createNew(new LogicModelModifiable());
42 public Am2900Machine createNew(LogicModelModifiable model)
44 return new Am2900Machine(model, this);
48 public ISASchema getISASchema()
50 // TODO Auto-generated method stub
55 public Set<Register> getRegisters()
61 public int getAddressBits()
67 public Am2900MainMemoryDefinition getMainMemoryDefinition()
69 return Am2900MainMemoryDefinition.instance;
79 public boolean equals(Object obj)
81 return obj != null && obj instanceof Am2900MachineDefinition;
85 public Am2900MicroInstructionMemoryDefinition getMicroInstructionMemoryDefinition()
87 return Am2900MicroInstructionMemoryDefinition.instance;