02cf375709d0ed9f68b8b29d8c890803b42b4f7e
[Mograsim.git] / 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         /**
11          * Creates a new instance of the machine
12          * 
13          * @return a new object of an {@link Machine} implementation.
14          * @author Christian Femers
15          */
16         Machine createNew();
17
18         /**
19          * Returns the schema that all possible ISAs (Instruction Set Architecture) must be based on.
20          * 
21          * @return an {@link ISASchema} implementation fitting the machine
22          * @author Christian Femers
23          */
24         ISASchema getISASchema();
25
26         /**
27          * Returns a set of all {@link Register}s present in the machine.
28          * 
29          * @return all registers present in the machine.
30          * @author Christian Femers
31          */
32         Set<Register> getRegisters();
33
34         /**
35          * 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
36          * possibly different one used by the bus system.
37          * 
38          * @return the number of bits used by the CPU
39          * @see MainMemoryDefinition#getMemoryAddressBits()
40          * @author Christian Femers
41          */
42         int getAddressBits();
43
44         /**
45          * Returns the definition of the machines main memory.
46          * 
47          * @return the {@link MainMemoryDefinition} that defines the main memory.
48          * @author Christian Femers
49          */
50         MainMemoryDefinition getMainMemoryDefinition();
51
52         /**
53          * Returns the definition of the machines instruction memory.
54          * 
55          * @return the {@link InstructionMemoryDefinition} that defines the instruction memory.
56          */
57         MicroInstructionMemoryDefinition getMicroInstructionMemoryDefinition();
58
59 }