hades.models.mips.mipsmemory
Class HadesInterface

java.lang.Object
  extended byhades.models.mips.mipsmemory.HadesInterface
All Implemented Interfaces:
Memory, MipsMemory, Resetable

public class HadesInterface
extends java.lang.Object
implements Resetable, MipsMemory

Upper part of the HADES interface: State machine for memory access


Field Summary
protected  int addr23
           
protected  boolean burstWait
           
protected  boolean debug
           
protected static int DMA
           
protected static int DMAEND
           
protected static int IDLE
           
protected  IDTR3051 idt
           
protected  int lastWriteAdr
           
protected  java.lang.String name
           
protected  int nextResult
           
protected static int READADR
           
protected static int READBURSTDATA
           
protected static int READBURSTWAIT
           
protected static int READDATA
           
protected static int READWAIT
           
protected  int requestAdr
           
protected  int requestData
           
protected  boolean requestIsBurst
           
protected  boolean requestIsWrite
           
protected  boolean requestPresent
           
protected  int resultAdr
           
protected static int RESULTBUFSIZE
           
protected  boolean resultIsBurst
           
protected  int[] results
           
protected  int resultsPresent
           
protected  int size
           
protected  int state
           
protected static int WRITEADR
           
protected static int WRITEDATA
           
protected static int WRITEEND1
           
protected static int WRITEEND2
           
protected  boolean wrNearPossible
           
 
Constructor Summary
protected HadesInterface(java.lang.String newName, IDTR3051 newIdt)
           
 
Method Summary
 boolean beginCycle()
          next cycle, perform access to lower layer if needed, wait returned
 void endCycle()
          end of a cycle, all core actions are done, memory actions can complete
 boolean finished()
          request end of read or write access
 boolean getHit(int adr)
          Is data present at the specified address?
 boolean getLog()
          Get debug mode
 int getMemorySize()
          Capacity of the memory in words
 java.lang.String getName()
          get the name of this memory
 int getReadResult()
          get the result of the last read operation
protected  java.lang.String getStateString()
           
 int getWordWidth()
          Witdh of one word in bits
protected  void giveAddress(int adr)
           
 void installEntryHandler(EntryHandler entryHandler)
          setEntry() calles this EntryHandler
protected  boolean nextBurstWord()
           
 void por()
          Hardware reset or power on reset
 void read(int adr, boolean burst)
          Drive busses for read access
 int readMemory(int adr)
          Read a word from the memory
 void reset()
          Software reset, initiated by a special assembly statement or an operating system call
 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 setMemorySize(int newSize)
           
 void setName(java.lang.String newName)
          Set the name of this memory
protected  void startDMA()
           
protected  void startRead()
           
protected  void startWrite()
           
 void write(int adr, int value)
          Drive busses for write access
 void writeMemory(int adr, int value)
          Write a word into the memory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

requestPresent

protected boolean requestPresent

requestIsWrite

protected boolean requestIsWrite

requestIsBurst

protected boolean requestIsBurst

requestAdr

protected int requestAdr

requestData

protected int requestData

resultsPresent

protected int resultsPresent

nextResult

protected int nextResult

RESULTBUFSIZE

protected static final int RESULTBUFSIZE
See Also:
Constant Field Values

resultAdr

protected int resultAdr

resultIsBurst

protected boolean resultIsBurst

results

protected int[] results

burstWait

protected boolean burstWait

wrNearPossible

protected boolean wrNearPossible

lastWriteAdr

protected int lastWriteAdr

IDLE

protected static final int IDLE
See Also:
Constant Field Values

WRITEADR

protected static final int WRITEADR
See Also:
Constant Field Values

WRITEDATA

protected static final int WRITEDATA
See Also:
Constant Field Values

WRITEEND1

protected static final int WRITEEND1
See Also:
Constant Field Values

WRITEEND2

protected static final int WRITEEND2
See Also:
Constant Field Values

READADR

protected static final int READADR
See Also:
Constant Field Values

READWAIT

protected static final int READWAIT
See Also:
Constant Field Values

READDATA

protected static final int READDATA
See Also:
Constant Field Values

READBURSTWAIT

protected static final int READBURSTWAIT
See Also:
Constant Field Values

READBURSTDATA

protected static final int READBURSTDATA
See Also:
Constant Field Values

DMA

protected static final int DMA
See Also:
Constant Field Values

DMAEND

protected static final int DMAEND
See Also:
Constant Field Values

state

protected int state

addr23

protected int addr23

debug

protected boolean debug

name

protected java.lang.String name

idt

protected IDTR3051 idt

size

protected int size
Constructor Detail

HadesInterface

protected HadesInterface(java.lang.String newName,
                         IDTR3051 newIdt)
Method Detail

por

public void por()
Description copied from interface: Resetable
Hardware reset or power on reset

Specified by:
por in interface Resetable

reset

public void reset()
Description copied from interface: Resetable
Software reset, initiated by a special assembly statement or an operating system call

Specified by:
reset in interface Resetable

getStateString

protected java.lang.String getStateString()

giveAddress

protected void giveAddress(int adr)

nextBurstWord

protected boolean nextBurstWord()

startDMA

protected void startDMA()

startWrite

protected void startWrite()

startRead

protected void startRead()

beginCycle

public boolean beginCycle()
Description copied from interface: MipsMemory
next cycle, perform access to lower layer if needed, wait returned

Specified by:
beginCycle in interface MipsMemory

endCycle

public void endCycle()
Description copied from interface: MipsMemory
end of a cycle, all core actions are done, memory actions can complete

Specified by:
endCycle in interface MipsMemory

finished

public boolean finished()
Description copied from interface: MipsMemory
request end of read or write access

Specified by:
finished in interface MipsMemory

getHit

public boolean getHit(int adr)
Description copied from interface: MipsMemory
Is data present at the specified address?

Specified by:
getHit in interface MipsMemory

getName

public java.lang.String getName()
Description copied from interface: MipsMemory
get the name of this memory

Specified by:
getName in interface MipsMemory

setName

public void setName(java.lang.String newName)
Description copied from interface: MipsMemory
Set the name of this memory

Specified by:
setName in interface MipsMemory

write

public void write(int adr,
                  int value)
Description copied from interface: MipsMemory
Drive busses for write access

Specified by:
write in interface MipsMemory

read

public void read(int adr,
                 boolean burst)
Description copied from interface: MipsMemory
Drive busses for read access

Specified by:
read in interface MipsMemory

getReadResult

public int getReadResult()
Description copied from interface: MipsMemory
get the result of the last read operation

Specified by:
getReadResult in interface MipsMemory

getWordWidth

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

Specified by:
getWordWidth in interface Memory

setMemorySize

public void setMemorySize(int newSize)

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 adr)
Description copied from interface: Memory
Read a word from the memory

Specified by:
readMemory in interface Memory

writeMemory

public void writeMemory(int adr,
                        int value)
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