hades.models.mips.core
Class Decoder

java.lang.Object
  extended byhades.models.mips.core.Decoder
All Implemented Interfaces:
Resetable

public class Decoder
extends java.lang.Object
implements Resetable

The decoder is able to identify an instruction and give back the right instruction object to the caller.


Field Summary
protected  AddImmInstr addImmInstr
           
protected  AddImmUInstr addImmUInstr
           
protected  AddInstr addInstr
           
protected  AddUInstr addUInstr
           
protected  AndImmInstr andImmInstr
           
protected  AndInstr andInstr
           
protected  BaseInstr[] branchDecode
           
protected  BranchEqualInstr branchEqualInstr
           
protected  BranchGreaterEqualAndLinkInstr branchGreaterEqualAndLinkInstr
           
protected  BranchGreaterEqualInstr branchGreaterEqualInstr
           
protected  BranchGreaterInstr branchGreaterInstr
           
protected  BranchLessAndLinkInstr branchLessAndLinkInstr
           
protected  BranchLessEqualInstr branchLessEqualInstr
           
protected  BranchLessInstr branchLessInstr
           
protected  BranchNotEqualInstr branchNotEqualInstr
           
protected  BreakInstr breakInstr
           
protected  CoprocInstr coproc0Instr
           
protected  CoprocInstr coproc1Instr
           
protected  CoprocInstr coproc2Instr
           
protected  CoprocInstr coproc3Instr
           
protected  boolean debug
           
protected  DivInstr divInstr
           
protected  DivUInstr divUInstr
           
protected  IllegalInstr illegalInstr
           
protected  BaseInstr[] instrDecode
           
protected  int instrFrameNumber
           
protected  JumpAndLinkInstr jumpAndLinkInstr
           
protected  JumpInstr jumpInstr
           
protected  JumpRegAndLinkInstr jumpRegAndLinkInstr
           
protected  JumpRegInstr jumpRegInstr
           
protected  LoadByteInstr loadByteInstr
           
protected  LoadByteUInstr loadByteUInstr
           
protected  LoadHalfInstr loadHalfInstr
           
protected  LoadHalfUInstr loadHalfUInstr
           
protected  LoadUpperImmInstr loadUpperImmInstr
           
protected  LoadWordInstr loadWordInstr
           
protected  LoadWordLeftInstr loadWordLeftInstr
           
protected  LoadWordRightInstr loadWordRightInstr
           
protected  LoadWordToCoInstr loadWordToCo0Instr
           
protected  LoadWordToCoInstr loadWordToCo1Instr
           
protected  LoadWordToCoInstr loadWordToCo2Instr
           
protected  LoadWordToCoInstr loadWordToCo3Instr
           
protected  MoveFromHiInstr moveFromHiInstr
           
protected  MoveFromLoInstr moveFromLoInstr
           
protected  MoveToHiInstr moveToHiInstr
           
protected  MoveToLoInstr moveToLoInstr
           
protected  MultInstr multInstr
           
protected  MultUInstr multUInstr
           
protected  NopInstr nopInstr
           
protected  NOrInstr norInstr
           
protected static int OP_ADD
           
protected static int OP_ADDI
           
protected static int OP_ADDIU
           
protected static int OP_ADDU
           
protected static int OP_AND
           
protected static int OP_ANDI
           
protected static int OP_BCOND
           
protected static int OP_BEQ
           
protected static int OP_BGEZ
           
protected static int OP_BGEZAL
           
protected static int OP_BGTZ
           
protected static int OP_BLEZ
           
protected static int OP_BLTZ
           
protected static int OP_BLTZAL
           
protected static int OP_BNE
           
protected static int OP_BREAK
           
protected static int OP_COP0
           
protected static int OP_COP1
           
protected static int OP_COP2
           
protected static int OP_COP3
           
protected static int OP_DIV
           
protected static int OP_DIVU
           
protected static int OP_J
           
protected static int OP_JAL
           
protected static int OP_JALR
           
protected static int OP_JR
           
protected static int OP_LB
           
protected static int OP_LBU
           
protected static int OP_LH
           
protected static int OP_LHU
           
protected static int OP_LUI
           
protected static int OP_LW
           
protected static int OP_LWC0
           
protected static int OP_LWC1
           
protected static int OP_LWC2
           
protected static int OP_LWC3
           
protected static int OP_LWL
           
protected static int OP_LWR
           
protected static int OP_MFHI
           
protected static int OP_MFLO
           
protected static int OP_MTHI
           
protected static int OP_MTLO
           
protected static int OP_MULT
           
protected static int OP_MULTU
           
protected static int OP_NOP
           
protected static int OP_NOR
           
protected static int OP_OR
           
protected static int OP_ORI
           
protected static int OP_SB
           
protected static int OP_SH
           
protected static int OP_SLL
           
protected static int OP_SLLV
           
protected static int OP_SLT
           
protected static int OP_SLTI
           
protected static int OP_SLTIU
           
protected static int OP_SLTU
           
protected static int OP_SPECIAL
           
protected static int OP_SRA
           
protected static int OP_SRAV
           
protected static int OP_SRL
           
protected static int OP_SRLV
           
protected static int OP_SUB
           
protected static int OP_SUBU
           
protected static int OP_SW
           
protected static int OP_SWC0
           
protected static int OP_SWC1
           
protected static int OP_SWC2
           
protected static int OP_SWC3
           
protected static int OP_SWL
           
protected static int OP_SWR
           
protected static int OP_SYSCALL
           
protected static int OP_XOR
           
protected static int OP_XORI
           
protected  OrImmInstr orImmInstr
           
protected  OrInstr orInstr
           
protected  PartHandler partHandler
           
protected  SetOnLessImmInstr setOnLessImmInstr
           
protected  SetOnLessImmUInstr setOnLessImmUInstr
           
protected  SetOnLessInstr setOnLessInstr
           
protected  SetOnLessUInstr setOnLessUInstr
           
protected  ShiftLeftLogicalInstr shiftLeftLogicalInstr
           
protected  ShiftLeftLogicalVarInstr shiftLeftLogicalVarInstr
           
protected  ShiftRightArithInstr shiftRightArithInstr
           
protected  ShiftRightArithVarInstr shiftRightArithVarInstr
           
protected  ShiftRightLogicalInstr shiftRightLogicalInstr
           
protected  ShiftRightLogicalVarInstr shiftRightLogicalVarInstr
           
protected  BaseInstr[] specialDecode
           
protected  Splitter splitter
           
protected  StoreByteInstr storeByteInstr
           
protected  StoreHalfInstr storeHalfInstr
           
protected  StoreWordFromCoInstr storeWordFromCo0Instr
           
protected  StoreWordFromCoInstr storeWordFromCo1Instr
           
protected  StoreWordFromCoInstr storeWordFromCo2Instr
           
protected  StoreWordFromCoInstr storeWordFromCo3Instr
           
protected  StoreWordInstr storeWordInstr
           
protected  StoreWordLeftInstr storeWordLeftInstr
           
protected  StoreWordRightInstr storeWordRightInstr
           
protected  SubInstr subInstr
           
protected  SubUInstr subUInstr
           
protected  SysCallInstr sysCallInstr
           
protected  XOrImmInstr xorImmInstr
           
protected  XOrInstr xorInstr
           
 
Constructor Summary
Decoder(PartHandler newPartHandler, Splitter newSplitter, int newInstrFrameNumber)
          Initialization
 
Method Summary
 BaseInstr decode()
          decode is able to return an instruction object when the splitter has splitted a valid instruction word.
 boolean getLog()
           
 BaseInstr getNopInstr()
          For initialization it is possible to get the NOP instruction object
protected  void initDecode()
           
 void por()
          Power on reset or hardware reset
 void reset()
          software reset
 void setLog(boolean newDebug)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

partHandler

protected PartHandler partHandler

instrFrameNumber

protected int instrFrameNumber

debug

protected boolean debug

instrDecode

protected BaseInstr[] instrDecode

specialDecode

protected BaseInstr[] specialDecode

branchDecode

protected BaseInstr[] branchDecode

splitter

protected Splitter splitter

OP_SPECIAL

protected static final int OP_SPECIAL
See Also:
Constant Field Values

OP_BCOND

protected static final int OP_BCOND
See Also:
Constant Field Values

OP_J

protected static final int OP_J
See Also:
Constant Field Values

OP_JAL

protected static final int OP_JAL
See Also:
Constant Field Values

OP_BEQ

protected static final int OP_BEQ
See Also:
Constant Field Values

OP_BNE

protected static final int OP_BNE
See Also:
Constant Field Values

OP_BLEZ

protected static final int OP_BLEZ
See Also:
Constant Field Values

OP_BGTZ

protected static final int OP_BGTZ
See Also:
Constant Field Values

OP_ADDI

protected static final int OP_ADDI
See Also:
Constant Field Values

OP_ADDIU

protected static final int OP_ADDIU
See Also:
Constant Field Values

OP_SLTI

protected static final int OP_SLTI
See Also:
Constant Field Values

OP_SLTIU

protected static final int OP_SLTIU
See Also:
Constant Field Values

OP_ANDI

protected static final int OP_ANDI
See Also:
Constant Field Values

OP_ORI

protected static final int OP_ORI
See Also:
Constant Field Values

OP_XORI

protected static final int OP_XORI
See Also:
Constant Field Values

OP_LUI

protected static final int OP_LUI
See Also:
Constant Field Values

OP_COP0

protected static final int OP_COP0
See Also:
Constant Field Values

OP_COP1

protected static final int OP_COP1
See Also:
Constant Field Values

OP_COP2

protected static final int OP_COP2
See Also:
Constant Field Values

OP_COP3

protected static final int OP_COP3
See Also:
Constant Field Values

OP_LB

protected static final int OP_LB
See Also:
Constant Field Values

OP_LH

protected static final int OP_LH
See Also:
Constant Field Values

OP_LWL

protected static final int OP_LWL
See Also:
Constant Field Values

OP_LW

protected static final int OP_LW
See Also:
Constant Field Values

OP_LBU

protected static final int OP_LBU
See Also:
Constant Field Values

OP_LHU

protected static final int OP_LHU
See Also:
Constant Field Values

OP_LWR

protected static final int OP_LWR
See Also:
Constant Field Values

OP_SB

protected static final int OP_SB
See Also:
Constant Field Values

OP_SH

protected static final int OP_SH
See Also:
Constant Field Values

OP_SWL

protected static final int OP_SWL
See Also:
Constant Field Values

OP_SW

protected static final int OP_SW
See Also:
Constant Field Values

OP_SWR

protected static final int OP_SWR
See Also:
Constant Field Values

OP_LWC0

protected static final int OP_LWC0
See Also:
Constant Field Values

OP_LWC1

protected static final int OP_LWC1
See Also:
Constant Field Values

OP_LWC2

protected static final int OP_LWC2
See Also:
Constant Field Values

OP_LWC3

protected static final int OP_LWC3
See Also:
Constant Field Values

OP_SWC0

protected static final int OP_SWC0
See Also:
Constant Field Values

OP_SWC1

protected static final int OP_SWC1
See Also:
Constant Field Values

OP_SWC2

protected static final int OP_SWC2
See Also:
Constant Field Values

OP_SWC3

protected static final int OP_SWC3
See Also:
Constant Field Values

OP_NOP

protected static final int OP_NOP
See Also:
Constant Field Values

OP_SLL

protected static final int OP_SLL
See Also:
Constant Field Values

OP_SRL

protected static final int OP_SRL
See Also:
Constant Field Values

OP_SRA

protected static final int OP_SRA
See Also:
Constant Field Values

OP_SLLV

protected static final int OP_SLLV
See Also:
Constant Field Values

OP_SRLV

protected static final int OP_SRLV
See Also:
Constant Field Values

OP_SRAV

protected static final int OP_SRAV
See Also:
Constant Field Values

OP_JR

protected static final int OP_JR
See Also:
Constant Field Values

OP_JALR

protected static final int OP_JALR
See Also:
Constant Field Values

OP_SYSCALL

protected static final int OP_SYSCALL
See Also:
Constant Field Values

OP_BREAK

protected static final int OP_BREAK
See Also:
Constant Field Values

OP_MFHI

protected static final int OP_MFHI
See Also:
Constant Field Values

OP_MTHI

protected static final int OP_MTHI
See Also:
Constant Field Values

OP_MFLO

protected static final int OP_MFLO
See Also:
Constant Field Values

OP_MTLO

protected static final int OP_MTLO
See Also:
Constant Field Values

OP_MULT

protected static final int OP_MULT
See Also:
Constant Field Values

OP_MULTU

protected static final int OP_MULTU
See Also:
Constant Field Values

OP_DIV

protected static final int OP_DIV
See Also:
Constant Field Values

OP_DIVU

protected static final int OP_DIVU
See Also:
Constant Field Values

OP_ADD

protected static final int OP_ADD
See Also:
Constant Field Values

OP_ADDU

protected static final int OP_ADDU
See Also:
Constant Field Values

OP_SUB

protected static final int OP_SUB
See Also:
Constant Field Values

OP_SUBU

protected static final int OP_SUBU
See Also:
Constant Field Values

OP_AND

protected static final int OP_AND
See Also:
Constant Field Values

OP_OR

protected static final int OP_OR
See Also:
Constant Field Values

OP_XOR

protected static final int OP_XOR
See Also:
Constant Field Values

OP_NOR

protected static final int OP_NOR
See Also:
Constant Field Values

OP_SLT

protected static final int OP_SLT
See Also:
Constant Field Values

OP_SLTU

protected static final int OP_SLTU
See Also:
Constant Field Values

OP_BLTZ

protected static final int OP_BLTZ
See Also:
Constant Field Values

OP_BGEZ

protected static final int OP_BGEZ
See Also:
Constant Field Values

OP_BLTZAL

protected static final int OP_BLTZAL
See Also:
Constant Field Values

OP_BGEZAL

protected static final int OP_BGEZAL
See Also:
Constant Field Values

loadWordInstr

protected LoadWordInstr loadWordInstr

loadHalfInstr

protected LoadHalfInstr loadHalfInstr

loadHalfUInstr

protected LoadHalfUInstr loadHalfUInstr

loadByteInstr

protected LoadByteInstr loadByteInstr

loadByteUInstr

protected LoadByteUInstr loadByteUInstr

storeWordInstr

protected StoreWordInstr storeWordInstr

storeHalfInstr

protected StoreHalfInstr storeHalfInstr

storeByteInstr

protected StoreByteInstr storeByteInstr

loadWordLeftInstr

protected LoadWordLeftInstr loadWordLeftInstr

loadWordRightInstr

protected LoadWordRightInstr loadWordRightInstr

storeWordLeftInstr

protected StoreWordLeftInstr storeWordLeftInstr

storeWordRightInstr

protected StoreWordRightInstr storeWordRightInstr

addImmInstr

protected AddImmInstr addImmInstr

addImmUInstr

protected AddImmUInstr addImmUInstr

setOnLessImmInstr

protected SetOnLessImmInstr setOnLessImmInstr

setOnLessImmUInstr

protected SetOnLessImmUInstr setOnLessImmUInstr

andImmInstr

protected AndImmInstr andImmInstr

orImmInstr

protected OrImmInstr orImmInstr

xorImmInstr

protected XOrImmInstr xorImmInstr

loadUpperImmInstr

protected LoadUpperImmInstr loadUpperImmInstr

addInstr

protected AddInstr addInstr

addUInstr

protected AddUInstr addUInstr

subInstr

protected SubInstr subInstr

subUInstr

protected SubUInstr subUInstr

setOnLessInstr

protected SetOnLessInstr setOnLessInstr

setOnLessUInstr

protected SetOnLessUInstr setOnLessUInstr

andInstr

protected AndInstr andInstr

orInstr

protected OrInstr orInstr

xorInstr

protected XOrInstr xorInstr

norInstr

protected NOrInstr norInstr

shiftLeftLogicalInstr

protected ShiftLeftLogicalInstr shiftLeftLogicalInstr

shiftRightLogicalInstr

protected ShiftRightLogicalInstr shiftRightLogicalInstr

shiftRightArithInstr

protected ShiftRightArithInstr shiftRightArithInstr

shiftLeftLogicalVarInstr

protected ShiftLeftLogicalVarInstr shiftLeftLogicalVarInstr

shiftRightLogicalVarInstr

protected ShiftRightLogicalVarInstr shiftRightLogicalVarInstr

shiftRightArithVarInstr

protected ShiftRightArithVarInstr shiftRightArithVarInstr

multInstr

protected MultInstr multInstr

multUInstr

protected MultUInstr multUInstr

divInstr

protected DivInstr divInstr

divUInstr

protected DivUInstr divUInstr

moveFromLoInstr

protected MoveFromLoInstr moveFromLoInstr

moveFromHiInstr

protected MoveFromHiInstr moveFromHiInstr

moveToLoInstr

protected MoveToLoInstr moveToLoInstr

moveToHiInstr

protected MoveToHiInstr moveToHiInstr

loadWordToCo0Instr

protected LoadWordToCoInstr loadWordToCo0Instr

loadWordToCo1Instr

protected LoadWordToCoInstr loadWordToCo1Instr

loadWordToCo2Instr

protected LoadWordToCoInstr loadWordToCo2Instr

loadWordToCo3Instr

protected LoadWordToCoInstr loadWordToCo3Instr

storeWordFromCo0Instr

protected StoreWordFromCoInstr storeWordFromCo0Instr

storeWordFromCo1Instr

protected StoreWordFromCoInstr storeWordFromCo1Instr

storeWordFromCo2Instr

protected StoreWordFromCoInstr storeWordFromCo2Instr

storeWordFromCo3Instr

protected StoreWordFromCoInstr storeWordFromCo3Instr

coproc0Instr

protected CoprocInstr coproc0Instr

coproc1Instr

protected CoprocInstr coproc1Instr

coproc2Instr

protected CoprocInstr coproc2Instr

coproc3Instr

protected CoprocInstr coproc3Instr

jumpInstr

protected JumpInstr jumpInstr

jumpAndLinkInstr

protected JumpAndLinkInstr jumpAndLinkInstr

jumpRegInstr

protected JumpRegInstr jumpRegInstr

jumpRegAndLinkInstr

protected JumpRegAndLinkInstr jumpRegAndLinkInstr

branchEqualInstr

protected BranchEqualInstr branchEqualInstr

branchNotEqualInstr

protected BranchNotEqualInstr branchNotEqualInstr

branchLessInstr

protected BranchLessInstr branchLessInstr

branchLessAndLinkInstr

protected BranchLessAndLinkInstr branchLessAndLinkInstr

branchLessEqualInstr

protected BranchLessEqualInstr branchLessEqualInstr

branchGreaterInstr

protected BranchGreaterInstr branchGreaterInstr

branchGreaterEqualInstr

protected BranchGreaterEqualInstr branchGreaterEqualInstr

branchGreaterEqualAndLinkInstr

protected BranchGreaterEqualAndLinkInstr branchGreaterEqualAndLinkInstr

breakInstr

protected BreakInstr breakInstr

sysCallInstr

protected SysCallInstr sysCallInstr

nopInstr

protected NopInstr nopInstr

illegalInstr

protected IllegalInstr illegalInstr
Constructor Detail

Decoder

public Decoder(PartHandler newPartHandler,
               Splitter newSplitter,
               int newInstrFrameNumber)
Initialization

Method Detail

initDecode

protected void initDecode()

por

public void por()
Power on reset or hardware reset

Specified by:
por in interface Resetable

reset

public void reset()
software reset

Specified by:
reset in interface Resetable

getNopInstr

public BaseInstr getNopInstr()
For initialization it is possible to get the NOP instruction object


decode

public BaseInstr decode()
decode is able to return an instruction object when the splitter has splitted a valid instruction word.


setLog

public void setLog(boolean newDebug)

getLog

public boolean getLog()