Added id to machine definition (was only set in the extension point)
[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          * 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
44          * possibly different one used by the bus system.
45          * 
46          * @return the number of bits used by the CPU
47          * @see MainMemoryDefinition#getMemoryAddressBits()
48          * @author Christian Femers
49          */
50         int getAddressBits();
51
52         /**
53          * Returns the definition of the machines main memory.
54          * 
55          * @return the {@link MainMemoryDefinition} that defines the main memory.
56          * @author Christian Femers
57          */
58         MainMemoryDefinition getMainMemoryDefinition();
59
60         /**
61          * Returns the definition of the machines instruction memory.
62          * 
63          * @return the {@link InstructionMemoryDefinition} that defines the instruction memory.
64          */
65         MicroInstructionMemoryDefinition getMicroInstructionMemoryDefinition();
66
67 }