|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthades.models.mips.mipsmemory.Cache
Implementation of the data cache, non associative, line size of 1 word, variable cache size. No write instructions
Field Summary | |
protected int |
adrMask
|
protected boolean |
burstAllowed
|
protected int |
cacheSize
|
protected boolean |
debug
|
protected int |
hits
|
protected boolean |
isolated
|
protected MipsMemory |
lowerMem
|
protected int[] |
mem
|
protected int |
misses
|
protected java.lang.String |
name
|
protected int |
nextAdr
|
protected int |
nextData
|
protected int |
readAdr
|
protected int |
readResult
|
protected boolean |
readResultPresent
|
protected int |
result
|
protected int[] |
tag
|
protected int |
tagMask
|
protected boolean[] |
valid
|
protected boolean |
waiting
|
Constructor Summary | |
Cache(ResetHandler resetHandler,
MipsMemory newLowerMem,
int newCacheSize,
java.lang.String newName,
boolean newBurstAllowed)
|
Method Summary | |
boolean |
beginCycle()
Only when there was a request and there is no result present, then lowerMem.finished will be asked |
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 |
getBurstAllowed()
|
boolean |
getHit(int adr)
Is data present at the specified address? |
boolean |
getIsolated()
|
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 result |
int |
getWordWidth()
Witdh of one word in bits |
void |
installEntryHandler(EntryHandler entryHandler)
Not needed for a cache |
void |
invalidate()
clear the cache (set all entries to invalid) |
void |
por()
Power in reset or hardware reset |
void |
read(int adr,
boolean burst)
Drive busses for read access |
int |
readMemory(int address)
Read a word from the memory |
void |
reset()
software reset |
void |
setBurstAllowed(boolean newBurstAllowed)
|
void |
setEntry(int entry,
int globalPointer)
Not needed for a cache |
void |
setIsolated(boolean newIsolated)
|
void |
setLog(boolean newDebug)
Enable or disable logging output |
void |
setName(java.lang.String newName)
Set the name of this memory |
java.lang.String |
statistics()
|
void |
write(int adr,
int data)
Drive busses for write access |
void |
writeMemory(int address,
int word)
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 |
protected int[] mem
protected int[] tag
protected boolean[] valid
protected int cacheSize
protected int adrMask
protected int tagMask
protected int nextAdr
protected int nextData
protected int result
protected MipsMemory lowerMem
protected boolean waiting
protected boolean readResultPresent
protected int readResult
protected int readAdr
protected int hits
protected int misses
protected java.lang.String name
protected boolean debug
protected boolean isolated
protected boolean burstAllowed
Constructor Detail |
public Cache(ResetHandler resetHandler, MipsMemory newLowerMem, int newCacheSize, java.lang.String newName, boolean newBurstAllowed)
Method Detail |
public void por()
por
in interface Resetable
public void reset()
reset
in interface Resetable
public void invalidate()
public boolean beginCycle()
beginCycle
in interface MipsMemory
public void endCycle()
MipsMemory
endCycle
in interface MipsMemory
public boolean finished()
MipsMemory
finished
in interface MipsMemory
public java.lang.String statistics()
public boolean getHit(int adr)
MipsMemory
getHit
in interface MipsMemory
public java.lang.String getName()
MipsMemory
getName
in interface MipsMemory
public void setName(java.lang.String newName)
MipsMemory
setName
in interface MipsMemory
public void setIsolated(boolean newIsolated)
public boolean getIsolated()
public void write(int adr, int data)
write
in interface MipsMemory
public void read(int adr, boolean burst)
read
in interface MipsMemory
public int getReadResult()
getReadResult
in interface MipsMemory
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
public void setLog(boolean newDebug)
Memory
setLog
in interface Memory
public boolean getLog()
Memory
getLog
in interface Memory
public void setBurstAllowed(boolean newBurstAllowed)
public boolean getBurstAllowed()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |