|
Simple Machine | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.Observable
Machine.AbstractCPU
Arch.SM213.Machine.AbstractSM213CPU
Arch.SM213.Machine.Student.CPU
public class CPU
The Simple Machine CPU. Simulate the execution of a single cycle of the Simple Machine CPU.
AbstractSM213CPU| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class Machine.AbstractCPU |
|---|
AbstractCPU.InvalidInstructionException, AbstractCPU.MachineHaltException |
| Field Summary |
|---|
| Fields inherited from class Arch.SM213.Machine.AbstractSM213CPU |
|---|
curInst, insOp0, insOp1, insOp2, insOpCode, insOpExt, insOpImm, instruction, pc, ps |
| Fields inherited from class Machine.AbstractCPU |
|---|
CURRENT_INSTRUCTION_ADDRESS, isInterrupt, mem, PC, processorState, reg |
| Constructor Summary | |
|---|---|
CPU(MainMemory aMem)
|
|
| Method Summary | |
|---|---|
protected void |
execute()
Execution Stage of CPU Cucle. |
protected void |
fetch()
Fetch Stage of CPU Cycle. |
| Methods inherited from class Arch.SM213.Machine.AbstractSM213CPU |
|---|
cycle, setPC |
| Methods inherited from class Machine.AbstractCPU |
|---|
getMainMemory, getName, getPC, getProcessorState, getRegisterFile, start, triggerInterrupt |
| Methods inherited from class java.util.Observable |
|---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CPU(MainMemory aMem)
| Method Detail |
|---|
protected void fetch()
throws AbstractMainMemory.InvalidAddressException
fetch in class AbstractSM213CPUMainMemory.InvalidAddressException - when program counter contains an invalid memory address
AbstractMainMemory.InvalidAddressExceptionfor pc, instruction, insOpCode, insOp0, insOp1, insOp2, insOpImm, insOpExt
protected void execute()
throws AbstractCPU.InvalidInstructionException,
AbstractCPU.MachineHaltException,
RegisterSet.InvalidRegisterNumberException,
AbstractMainMemory.InvalidAddressException
execute in class AbstractSM213CPUInvalidInstructionException - when instruction format is invalid
MachineHaltException - when instruction is the HALT instruction
RegisterSet.InvalidRegisterNumberException - when instruction references an invalid register (i.e, not 0-7)
MainMemory.InvalidAddressException - when instruction references an invalid memory address
AbstractCPU.InvalidInstructionException
AbstractCPU.MachineHaltException
AbstractMainMemory.InvalidAddressExceptionfor pc, instruction, insOpCode, insOp0, insOp1, insOp2, insOpImm, insOpExt,
for mem,
for reg
|
Simple Machine | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||