Implemented some infrastructure for MPROMs
[Mograsim.git] / plugins / net.mograsim.machine / src / net / mograsim / machine / MachineDefinition.java
1 package net.mograsim.machine;
2
3 import java.util.List;
4
5 import net.mograsim.machine.mi.MPROMDefinition;
6 import net.mograsim.machine.mi.MicroInstructionMemoryDefinition;
7 import net.mograsim.machine.registers.Register;
8 import net.mograsim.machine.registers.RegisterGroup;
9
10 public interface MachineDefinition
11 {
12         /**
13          * This returns the MachineDefinitions ID. This must be consistent and coherent with the id in the extension point (Eclipse plugin xml)
14          * providing the definition.
15          * 
16          * @return a human readable, unique id representing the specified machine.
17          * @author Christian Femers
18          */
19         String getId();
20
21         /**
22          * Returns a human-readable description of the machine definition.
23          * 
24          * @author Daniel Kirschten
25          */
26         String getDescription();
27
28         /**
29          * Creates a new instance of the machine
30          * 
31          * @return a new object of an {@link Machine} implementation.
32          * @author Christian Femers
33          */
34         Machine createNew();
35
36         /**
37          * Returns the schema that all possible ISAs (Instruction Set Architecture) must be based on.
38          * 
39          * @return an {@link ISASchema} implementation fitting the machine
40          * @author Christian Femers
41          */
42         ISASchema getISASchema();
43
44         /**
45          * Returns a set of all {@link Register}s present in the machine that are not part of a register group.
46          * 
47          * @return all registers present in the machine.
48          * @author Christian Femers
49          */
50         List<Register> getUnsortedRegisters();
51
52         /**
53          * Returns a set of all RegisterGroups that the machine contains
54          * 
55          * @return all register groups present in the machine.
56          * @author Christian Femers
57          */
58         List<RegisterGroup> getRegisterGroups();
59
60         /**
61          * The number of bits used by the machine to address main memory. Note that this should be the number of bits used in the CPU, not a
62          * possibly different one used by the bus system.
63          * 
64          * @return the number of bits used by the CPU
65          * @see MainMemoryDefinition#getMemoryAddressBits()
66          * @author Christian Femers
67          */
68         int getAddressBits();
69
70         /**
71          * Returns the definition of the machines main memory.
72          * 
73          * @return the {@link MainMemoryDefinition} that defines the main memory.
74          * @author Christian Femers
75          */
76         MainMemoryDefinition getMainMemoryDefinition();
77
78         /**
79          * Returns the definition of the machines instruction memory.
80          * 
81          * @return the {@link InstructionMemoryDefinition} that defines the instruction memory.
82          */
83         MicroInstructionMemoryDefinition getMicroInstructionMemoryDefinition();
84
85         /**
86          * Returns the definition of the machines instruction memory.
87          * 
88          * @return the {@link InstructionMemoryDefinition} that defines the instruction memory.
89          * 
90          * @author Daniel Kirschten
91          */
92         MPROMDefinition getMPROMDefinition();
93
94 }