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