hades.models.mips.mipsmemory
Class FastAccessMemory

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

public class FastAccessMemory
extends AccessMemory

Do the same like AccessMemory - without the layers below for fast operation


Field Summary
protected  int dataResult
           
protected  EntryHandler entryHandler
           
protected  boolean entryHandlerInstalled
           
protected  int instrResult
           
static int INTERNAL_MEM_SIZE
           
protected  int[] internalMem
           
 
Fields inherited from class hades.models.mips.mipsmemory.AccessMemory
bigEndian, byteReadMask, byteWriteMask, data, dataCache, dataMask, dataShift, dcache, DCACHE_SIZE, dcacheSelection, debug, dispatcher, halfwordReadMask, halfwordWriteMask, icache, ICACHE_SIZE, icacheSelection, instr, instrCache, lastdcache, lasticache, mem, MEMORY_SIZE, mmu, partHandler, partWordByte, partWordFirst, partWordTriple, partWordWrite, physicalDataAdr, physicalInstrAdr, realDataCache, realInstrCache, stack, STACK_SIZE, tinyMemory, translateable, translation, triplebyteReadMask, triplebyteWriteMask, virtualDataAdr, virtualInstrAdr
 
Constructor Summary
FastAccessMemory(PartHandler newPartHandler)
           
 
Method Summary
 boolean beginCycle()
          Cycle
 void endCycle()
           
 int fetchInstr()
           
 int getMemorySize()
          Capacity of the memory in words
 int getReadResult()
           
 int getWordWidth()
          Witdh of one word in bits
 void installEntryHandler(EntryHandler newEntryHandler)
          setEntry() calles this EntryHandler
 void invalidateCaches()
           
 void readInstr()
          Instruction fetch, always 32 bit
 int readMemory(int address)
          Read a word from the memory
 void readWord(int adr)
          Load data
 void setEntry(int entry, int globalPointer)
          Set the entry address if memory contains a executable program
 void swapCaches()
           
 int translateAddress(int adr)
          Address translation
 int translateDataAdr(int adr)
           
 int translateInstrAdr(int adr)
           
 int translateWordAddress(int adr)
           
 void unswapCaches()
           
 void writeMemory(int address, int word)
          Write a word into the memory
 void writeWord(int adr, int value)
          Store data
 
Methods inherited from class hades.models.mips.mipsmemory.AccessMemory
getBigEndian, getLog, initCacheSelection, por, reset, setBigEndian, setLog, translateAddress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

internalMem

protected int[] internalMem

INTERNAL_MEM_SIZE

public static final int INTERNAL_MEM_SIZE
See Also:
Constant Field Values

entryHandler

protected EntryHandler entryHandler

entryHandlerInstalled

protected boolean entryHandlerInstalled

instrResult

protected int instrResult

dataResult

protected int dataResult
Constructor Detail

FastAccessMemory

public FastAccessMemory(PartHandler newPartHandler)
Method Detail

invalidateCaches

public void invalidateCaches()
Overrides:
invalidateCaches in class AccessMemory

swapCaches

public void swapCaches()
Overrides:
swapCaches in class AccessMemory

unswapCaches

public void unswapCaches()
Overrides:
unswapCaches in class AccessMemory

translateAddress

public int translateAddress(int adr)
Address translation

Overrides:
translateAddress in class AccessMemory

translateWordAddress

public int translateWordAddress(int adr)
Overrides:
translateWordAddress in class AccessMemory

translateInstrAdr

public int translateInstrAdr(int adr)
Overrides:
translateInstrAdr in class AccessMemory

translateDataAdr

public int translateDataAdr(int adr)
Overrides:
translateDataAdr in class AccessMemory

readInstr

public void readInstr()
Instruction fetch, always 32 bit

Overrides:
readInstr in class AccessMemory

fetchInstr

public int fetchInstr()
Overrides:
fetchInstr in class AccessMemory

readWord

public void readWord(int adr)
Load data

Overrides:
readWord in class AccessMemory

getReadResult

public int getReadResult()
Overrides:
getReadResult in class AccessMemory

writeWord

public void writeWord(int adr,
                      int value)
Store data

Overrides:
writeWord in class AccessMemory

beginCycle

public boolean beginCycle()
Cycle

Overrides:
beginCycle in class AccessMemory

endCycle

public void endCycle()
Overrides:
endCycle in class AccessMemory

getWordWidth

public int getWordWidth()
Witdh of one word in bits

Specified by:
getWordWidth in interface Memory
Overrides:
getWordWidth in class AccessMemory

getMemorySize

public int getMemorySize()
Capacity of the memory in words

Specified by:
getMemorySize in interface Memory
Overrides:
getMemorySize in class AccessMemory

readMemory

public int readMemory(int address)
Read a word from the memory

Specified by:
readMemory in interface Memory
Overrides:
readMemory in class AccessMemory

writeMemory

public void writeMemory(int address,
                        int word)
Write a word into the memory

Specified by:
writeMemory in interface Memory
Overrides:
writeMemory in class AccessMemory

setEntry

public void setEntry(int entry,
                     int globalPointer)
Set the entry address if memory contains a executable program

Specified by:
setEntry in interface Memory
Overrides:
setEntry in class AccessMemory

installEntryHandler

public void installEntryHandler(EntryHandler newEntryHandler)
setEntry() calles this EntryHandler

Specified by:
installEntryHandler in interface Memory
Overrides:
installEntryHandler in class AccessMemory