|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthades.models.mips.mipsmemory.AccessMemory
Handle memory and cache accesses with one class which dispatches the different requests to the different MipsMemories Tasks performed by this class: - static address translation - call of dynamic address translation - decision wether and which caches should be used - modify partial word accesses to word accesses - provide Memory interface to give access to the full virtual address space
Constructor Summary | |
AccessMemory(PartHandler newPartHandler)
|
Method Summary | |
boolean |
beginCycle()
Cycle |
void |
endCycle()
|
int |
fetchInstr()
|
boolean |
getBigEndian()
|
boolean |
getLog()
Get debug mode |
int |
getMemorySize()
Capacity of the memory in words |
int |
getReadResult()
|
int |
getWordWidth()
Witdh of one word in bits |
protected void |
initCacheSelection(MipsMemory[] cacheSelection,
MipsMemory cache,
MipsMemory mem)
|
void |
installEntryHandler(EntryHandler entryHandler)
setEntry() calles this EntryHandler |
void |
invalidateCaches()
|
void |
por()
Power on reset or hardware reset |
void |
readInstr()
Instruction fetch, always 32 bit |
int |
readMemory(int address)
Read a word from the memory |
void |
readWord(int adr)
Load data |
void |
reset()
software reset |
void |
setBigEndian(boolean big)
Set endianess |
void |
setEntry(int entry,
int globalPointer)
Set the entry address if memory contains a executable program |
void |
setLog(boolean newDebug)
Enable or disable logging output |
void |
swapCaches()
|
int |
translateAddress(int adr)
|
protected int |
translateAddress(int adr,
int segment)
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected PartHandler partHandler
public InstrCache realInstrCache
public DataCache realDataCache
public Cache instrCache
public Cache dataCache
public TinyBPMemory tinyMemory
public TinyBPMemory stack
public MemoryDispatcher dispatcher
public MipsMemory mem
public MipsMemory icache
public MipsMemory dcache
public MipsMemory lasticache
public MipsMemory lastdcache
protected MemoryManagementUnit mmu
public static final int MEMORY_SIZE
public static final int ICACHE_SIZE
public static final int DCACHE_SIZE
public static final int STACK_SIZE
protected boolean bigEndian
protected int virtualInstrAdr
protected int physicalInstrAdr
protected int virtualDataAdr
protected int physicalDataAdr
protected int instr
protected int data
protected boolean[] translateable
protected int[] translation
protected MipsMemory[] icacheSelection
protected MipsMemory[] dcacheSelection
protected int[] halfwordWriteMask
protected int[] byteWriteMask
protected int[] triplebyteWriteMask
protected int[] halfwordReadMask
protected int[] byteReadMask
protected int[] triplebyteReadMask
protected boolean partWordWrite
protected boolean partWordFirst
protected boolean partWordByte
protected boolean partWordTriple
protected int dataMask
protected int dataShift
protected boolean debug
Constructor Detail |
public AccessMemory(PartHandler newPartHandler)
Method Detail |
protected void initCacheSelection(MipsMemory[] cacheSelection, MipsMemory cache, MipsMemory mem)
public void por()
por
in interface Resetable
public void reset()
reset
in interface Resetable
public void setLog(boolean newDebug)
Memory
setLog
in interface Memory
public boolean getLog()
Memory
getLog
in interface Memory
public void invalidateCaches()
public void swapCaches()
public void unswapCaches()
public void setBigEndian(boolean big)
public boolean getBigEndian()
protected int translateAddress(int adr, int segment)
public int translateAddress(int adr)
public int translateWordAddress(int adr)
public int translateInstrAdr(int adr)
public int translateDataAdr(int adr)
public void readInstr()
public int fetchInstr()
public void readWord(int adr)
public int getReadResult()
public void writeWord(int adr, int value)
public boolean beginCycle()
public void endCycle()
public int getWordWidth()
getWordWidth
in interface Memory
public int getMemorySize()
getMemorySize
in interface Memory
public int readMemory(int address)
readMemory
in interface Memory
public void writeMemory(int address, int word)
writeMemory
in interface Memory
public void setEntry(int entry, int globalPointer)
setEntry
in interface Memory
public void installEntryHandler(EntryHandler entryHandler)
installEntryHandler
in interface Memory
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |