Updated Am2900Machine and -Definition; Added MachineContext
[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          * Creates a new instance of the machine
11          * 
12          * @return a new object of an {@link Machine} implementation.
13          * @author Christian Femers
14          */
15         Machine createNew();
16
17         /**
18          * Returns the schema that all possible ISAs (Instruction Set Architecture) must
19          * 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
36          * should be the number of bits used in the CPU, not a possibly different one
37          * used by the bus system.
38          * 
39          * @return the number of bits used by the CPU
40          * @see MainMemoryDefinition#getMemoryAddressBits()
41          * @author Christian Femers
42          */
43         int getAddressBits();
44
45         /**
46          * Returns the definition of the machines main memory.
47          * 
48          * @return the {@link MainMemoryDefinition} that defines the main memory.
49          * @author Christian Femers
50          */
51         MainMemoryDefinition getMainMemoryDefinition();
52         
53         /**
54          * Returns the definition of the machines instruction memory.
55          * 
56          * @return the {@link InstructionMemoryDefinition} that defines the instruction memory.
57          */
58         MicroInstructionMemoryDefinition getMicroInstructionMemoryDefinition();
59         
60 }