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