Simple Machine

Arch.Y86.Machine
Class AbstractY86CPU

java.lang.Object
  extended by java.util.Observable
      extended by Machine.AbstractCPU
          extended by Arch.Y86.Machine.AbstractY86CPU
Direct Known Subclasses:
CPU, CPU, CPU, CPU, CPU, CPU

public abstract class AbstractY86CPU
extends AbstractCPU


Nested Class Summary
protected  class AbstractY86CPU.DecodeStageState
           
protected  class AbstractY86CPU.ExecuteStageState
           
protected  class AbstractY86CPU.FetchStageState
           
protected  class AbstractY86CPU.MemoryStageState
           
protected  class AbstractY86CPU.ProcessorState
           
protected  class AbstractY86CPU.StageState
           
protected  class AbstractY86CPU.WriteBackStageState
           
 
Nested classes/interfaces inherited from class Machine.AbstractCPU
AbstractCPU.InvalidInstructionException, AbstractCPU.MachineHaltException
 
Field Summary
protected static int A_ADDL
           
protected static int A_ANDL
           
protected static int A_SUBL
           
protected static int A_XORL
           
protected static Register.ClockTransition BUBBLE
           
protected  AbstractY86CPU.DecodeStageState d
           
protected  AbstractY86CPU.ExecuteStageState e
           
protected  AbstractY86CPU.FetchStageState f
           
protected static int I_CALL
           
protected static int I_HALT
           
protected static int I_IADDL
           
protected static int I_IRMOVL
           
protected static int I_JMPI
           
protected static int I_JXX
           
protected static int I_LEAVE
           
protected static int I_MRMOVL
           
protected static int I_NOP
           
protected static int I_OPL
           
protected static int I_POPL
           
protected static int I_PUSHL
           
protected static int I_RET
           
protected static int I_RMMOVL
           
protected static int I_RRMOVL
           
protected static int J_E
           
protected static int J_G
           
protected static int J_GE
           
protected static int J_L
           
protected static int J_LE
           
protected static int J_NC
           
protected static int J_NE
           
protected  AbstractY86CPU.MemoryStageState m
           
protected static Register.ClockTransition NORMAL
           
protected  AbstractY86CPU.ProcessorState p
           
protected static int R_EBP
           
protected static int R_ESP
           
protected static int R_NONE
           
protected static Register.ClockTransition STALL
           
protected  AbstractY86CPU.WriteBackStageState w
           
 
Fields inherited from class Machine.AbstractCPU
CURRENT_INSTRUCTION_ADDRESS, isInterrupt, mem, PC, processorState, reg
 
Constructor Summary
AbstractY86CPU(java.lang.String aName, AbstractMainMemory aMem, boolean anIsPipelined)
           
 
Method Summary
protected  AbstractY86CPU.DecodeStageState createDecodeStageState()
          Called by AbstractY86CPU constructor.
protected  AbstractY86CPU.ExecuteStageState createExecuteStageState()
          Called by AbstractY86CPU constructor.
protected  AbstractY86CPU.FetchStageState createFetchStageState()
          Called by AbstractY86CPU constructor.
protected  AbstractY86CPU.MemoryStageState createMemoryStageState()
          Called by AbstractY86CPU constructor.
protected  AbstractY86CPU.ProcessorState createProcessorState()
          Called by AbstractY86CPU constructor.
protected  AbstractY86CPU.WriteBackStageState createWriteBackStageState()
          Called by AbstractY86CPU constructor.
protected  void cyclePipe()
           
protected  void cycleSeq()
           
protected abstract  void decode()
           
protected abstract  void execute()
           
protected  void fetch_SelectPC()
           
protected abstract  void fetch()
           
protected abstract  void memory()
           
protected  void nextPC()
           
protected  void pipelineHazardControl()
           
 void setPC(int aPC)
          Set PC to value
protected abstract  void writeBack()
           
 
Methods inherited from class Machine.AbstractCPU
cycle, 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
 

Field Detail

R_ESP

protected static final int R_ESP
See Also:
Constant Field Values

R_EBP

protected static final int R_EBP
See Also:
Constant Field Values

R_NONE

protected static final int R_NONE
See Also:
Constant Field Values

I_NOP

protected static final int I_NOP
See Also:
Constant Field Values

I_HALT

protected static final int I_HALT
See Also:
Constant Field Values

I_RRMOVL

protected static final int I_RRMOVL
See Also:
Constant Field Values

I_IRMOVL

protected static final int I_IRMOVL
See Also:
Constant Field Values

I_RMMOVL

protected static final int I_RMMOVL
See Also:
Constant Field Values

I_MRMOVL

protected static final int I_MRMOVL
See Also:
Constant Field Values

I_OPL

protected static final int I_OPL
See Also:
Constant Field Values

I_JXX

protected static final int I_JXX
See Also:
Constant Field Values

I_CALL

protected static final int I_CALL
See Also:
Constant Field Values

I_RET

protected static final int I_RET
See Also:
Constant Field Values

I_PUSHL

protected static final int I_PUSHL
See Also:
Constant Field Values

I_POPL

protected static final int I_POPL
See Also:
Constant Field Values

I_IADDL

protected static final int I_IADDL
See Also:
Constant Field Values

I_LEAVE

protected static final int I_LEAVE
See Also:
Constant Field Values

I_JMPI

protected static final int I_JMPI
See Also:
Constant Field Values

A_ADDL

protected static final int A_ADDL
See Also:
Constant Field Values

A_SUBL

protected static final int A_SUBL
See Also:
Constant Field Values

A_ANDL

protected static final int A_ANDL
See Also:
Constant Field Values

A_XORL

protected static final int A_XORL
See Also:
Constant Field Values

J_NC

protected static final int J_NC
See Also:
Constant Field Values

J_LE

protected static final int J_LE
See Also:
Constant Field Values

J_L

protected static final int J_L
See Also:
Constant Field Values

J_E

protected static final int J_E
See Also:
Constant Field Values

J_NE

protected static final int J_NE
See Also:
Constant Field Values

J_GE

protected static final int J_GE
See Also:
Constant Field Values

J_G

protected static final int J_G
See Also:
Constant Field Values

p

protected AbstractY86CPU.ProcessorState p

w

protected AbstractY86CPU.WriteBackStageState w

m

protected AbstractY86CPU.MemoryStageState m

e

protected AbstractY86CPU.ExecuteStageState e

d

protected AbstractY86CPU.DecodeStageState d

f

protected AbstractY86CPU.FetchStageState f

NORMAL

protected static final Register.ClockTransition NORMAL

BUBBLE

protected static final Register.ClockTransition BUBBLE

STALL

protected static final Register.ClockTransition STALL
Constructor Detail

AbstractY86CPU

public AbstractY86CPU(java.lang.String aName,
                      AbstractMainMemory aMem,
                      boolean anIsPipelined)
Method Detail

createProcessorState

protected AbstractY86CPU.ProcessorState createProcessorState()
Called by AbstractY86CPU constructor. Override in subclass to extend this register set.


createFetchStageState

protected AbstractY86CPU.FetchStageState createFetchStageState()
Called by AbstractY86CPU constructor. Override in subclass to extend this register set.


createDecodeStageState

protected AbstractY86CPU.DecodeStageState createDecodeStageState()
Called by AbstractY86CPU constructor. Override in subclass to extend this register set.


createExecuteStageState

protected AbstractY86CPU.ExecuteStageState createExecuteStageState()
Called by AbstractY86CPU constructor. Override in subclass to extend this register set.


createMemoryStageState

protected AbstractY86CPU.MemoryStageState createMemoryStageState()
Called by AbstractY86CPU constructor. Override in subclass to extend this register set.


createWriteBackStageState

protected AbstractY86CPU.WriteBackStageState createWriteBackStageState()
Called by AbstractY86CPU constructor. Override in subclass to extend this register set.


setPC

public void setPC(int aPC)
Description copied from class: AbstractCPU
Set PC to value

Overrides:
setPC in class AbstractCPU

cycleSeq

protected void cycleSeq()
                 throws AbstractCPU.InvalidInstructionException,
                        AbstractMainMemory.InvalidAddressException,
                        AbstractCPU.MachineHaltException
Throws:
AbstractCPU.InvalidInstructionException
AbstractMainMemory.InvalidAddressException
AbstractCPU.MachineHaltException

cyclePipe

protected void cyclePipe()
                  throws AbstractCPU.InvalidInstructionException,
                         AbstractMainMemory.InvalidAddressException,
                         AbstractCPU.MachineHaltException
Throws:
AbstractCPU.InvalidInstructionException
AbstractMainMemory.InvalidAddressException
AbstractCPU.MachineHaltException

fetch

protected abstract void fetch()
                       throws AbstractCPU.InvalidInstructionException,
                              AbstractMainMemory.InvalidAddressException
Throws:
AbstractCPU.InvalidInstructionException
AbstractMainMemory.InvalidAddressException

decode

protected abstract void decode()
                        throws RegisterSet.InvalidRegisterNumberException
Throws:
RegisterSet.InvalidRegisterNumberException

execute

protected abstract void execute()

memory

protected abstract void memory()
                        throws AbstractMainMemory.InvalidAddressException
Throws:
AbstractMainMemory.InvalidAddressException

writeBack

protected abstract void writeBack()
                           throws AbstractCPU.MachineHaltException,
                                  RegisterSet.InvalidRegisterNumberException
Throws:
AbstractCPU.MachineHaltException
RegisterSet.InvalidRegisterNumberException

nextPC

protected void nextPC()

fetch_SelectPC

protected void fetch_SelectPC()

pipelineHazardControl

protected void pipelineHazardControl()

Simple Machine