b568e7e0830c7ade4a88461b227e9e84d8a00faf
[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          * Returns a human-readable description of the machine definition.
22          * 
23          * @author Daniel Kirschten
24          */
25         String getDescription();
26
27         /**
28          * Creates a new instance of the machine
29          * 
30          * @return a new object of an {@link Machine} implementation.
31          * @author Christian Femers
32          */
33         Machine createNew();
34
35         /**
36          * Returns the schema that all possible ISAs (Instruction Set Architecture) must be based on.
37          * 
38          * @return an {@link ISASchema} implementation fitting the machine
39          * @author Christian Femers
40          */
41         ISASchema getISASchema();
42
43         /**
44          * Returns a set of all {@link Register}s present in the machine that are not part of a register group.
45          * 
46          * @return all registers present in the machine.
47          * @author Christian Femers
48          */
49         List<Register> getUnsortedRegisters();
50
51         /**
52          * Returns a set of all RegisterGroups that the machine contains
53          * 
54          * @return all register groups present in the machine.
55          * @author Christian Femers
56          */
57         List<RegisterGroup> getRegisterGroups();
58
59         /**
60          * 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
61          * possibly different one used by the bus system.
62          * 
63          * @return the number of bits used by the CPU
64          * @see MainMemoryDefinition#getMemoryAddressBits()
65          * @author Christian Femers
66          */
67         int getAddressBits();
68
69         /**
70          * Returns the definition of the machines main memory.
71          * 
72          * @return the {@link MainMemoryDefinition} that defines the main memory.
73          * @author Christian Femers
74          */
75         MainMemoryDefinition getMainMemoryDefinition();
76
77         /**
78          * Returns the definition of the machines instruction memory.
79          * 
80          * @return the {@link InstructionMemoryDefinition} that defines the instruction memory.
81          */
82         MicroInstructionMemoryDefinition getMicroInstructionMemoryDefinition();
83
84 }