0ac06ea77b1b658c2c3e4967739bd3eda57a0896
[Mograsim.git] /
1 package net.mograsim.logic.model.am2900.machine;
2
3 import java.util.Objects;
4 import java.util.Set;
5
6 import net.mograsim.machine.ISASchema;
7 import net.mograsim.machine.Machine;
8 import net.mograsim.machine.MachineDefinition;
9 import net.mograsim.machine.MachineRegistry;
10 import net.mograsim.machine.MainMemoryDefinition;
11 import net.mograsim.machine.Register;
12 import net.mograsim.machine.mi.MicroInstructionMemoryDefinition;
13
14 public class Am2900MachineDefinition implements MachineDefinition
15 {
16         private MainMemoryDefinition memoryDefinition = new Am2900MainMemoryDefinition();
17         private MicroInstructionMemoryDefinition microInstMemoryDefinition = new Am2900MicroInstructionMemoryDefinition();
18         private final static Am2900MachineDefinition instance = new Am2900MachineDefinition();
19
20         public static Am2900MachineDefinition getInstance()
21         {
22                 return Objects.requireNonNullElseGet((Am2900MachineDefinition) MachineRegistry.getinstalledMachines().get("Am2900"),
23                                 () -> instance);
24         }
25
26         @Override
27         public Machine createNew()
28         {
29                 return new Am2900Machine(this);
30         }
31
32         @Override
33         public ISASchema getISASchema()
34         {
35                 // TODO Auto-generated method stub
36                 return null;
37         }
38
39         @Override
40         public Set<Register> getRegisters()
41         {
42                 // TODO Auto-generated method stub
43                 return null;
44         }
45
46         @Override
47         public int getAddressBits()
48         {
49                 return 16;
50         }
51
52         @Override
53         public MainMemoryDefinition getMainMemoryDefinition()
54         {
55                 return memoryDefinition;
56         }
57
58         @Override
59         public MicroInstructionMemoryDefinition getMicroInstructionMemoryDefinition()
60         {
61                 return microInstMemoryDefinition;
62         }
63 }