hades.models.mips.core
Class Coprocessor

java.lang.Object
  extended byhades.models.mips.core.Coprocessor
All Implemented Interfaces:
Memory, Resetable
Direct Known Subclasses:
Copro0

public class Coprocessor
extends java.lang.Object
implements Memory, Resetable

Skeleton for a coprocessor including registers and instruction execution logic


Field Summary
protected  boolean condition
           
protected  Registers coreReg
           
protected  boolean debug
           
protected  int number
           
protected  PartHandler partHandler
           
protected  int[] reg
           
 
Constructor Summary
Coprocessor(PartHandler newPartHandler, int coprocNumber)
           
 
Method Summary
 int decodeAndExecute(Registers registers, Splitter splitter)
           
 boolean getCondition()
           
 int getCoproNumber()
           
 boolean getLog()
          Get debug mode
 int getMemorySize()
          Capacity of the memory in words
 int getWordWidth()
          Witdh of one word in bits
 void installEntryHandler(EntryHandler entryHandler)
          setEntry() calles this EntryHandler
 void por()
          Power on reset or hardware reset
 int readControlRegister(int address)
           
 int readMemory(int address)
          Read a word from the memory
 int readRegister(int address)
           
 void reset()
          software reset
 void setCondition(boolean newCondition)
           
 void setEntry(int entry, int globalPointer)
          Set the entry address and the global pointer if memory contains a executable program
 void setLog(boolean newDebug)
          Enable or disable logging output
 void writeControlRegister(int address, int word)
           
 void writeMemory(int address, int word)
          Write a word into the memory
 void writeRegister(int address, int word)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

partHandler

protected PartHandler partHandler

coreReg

protected Registers coreReg

reg

protected int[] reg

condition

protected boolean condition

number

protected int number

debug

protected boolean debug
Constructor Detail

Coprocessor

public Coprocessor(PartHandler newPartHandler,
                   int coprocNumber)
Method Detail

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

getCoproNumber

public int getCoproNumber()

getWordWidth

public int getWordWidth()
Description copied from interface: Memory
Witdh of one word in bits

Specified by:
getWordWidth in interface Memory

getMemorySize

public int getMemorySize()
Description copied from interface: Memory
Capacity of the memory in words

Specified by:
getMemorySize in interface Memory

readMemory

public int readMemory(int address)
Description copied from interface: Memory
Read a word from the memory

Specified by:
readMemory in interface Memory

writeMemory

public void writeMemory(int address,
                        int word)
Description copied from interface: Memory
Write a word into the memory

Specified by:
writeMemory in interface Memory

setEntry

public void setEntry(int entry,
                     int globalPointer)
Description copied from interface: Memory
Set the entry address and the global pointer if memory contains a executable program

Specified by:
setEntry in interface Memory

installEntryHandler

public void installEntryHandler(EntryHandler entryHandler)
Description copied from interface: Memory
setEntry() calles this EntryHandler

Specified by:
installEntryHandler in interface Memory

setLog

public void setLog(boolean newDebug)
Description copied from interface: Memory
Enable or disable logging output

Specified by:
setLog in interface Memory

getLog

public boolean getLog()
Description copied from interface: Memory
Get debug mode

Specified by:
getLog in interface Memory

readRegister

public int readRegister(int address)

writeRegister

public void writeRegister(int address,
                          int word)

readControlRegister

public int readControlRegister(int address)

writeControlRegister

public void writeControlRegister(int address,
                                 int word)

getCondition

public boolean getCondition()

setCondition

public void setCondition(boolean newCondition)

decodeAndExecute

public int decodeAndExecute(Registers registers,
                            Splitter splitter)