|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthades.models.mips.mipsmemory.MemoryDispatcher
This class seperates the physical address space into 64K segments each of 64K (bytes) size. Each segment can use a different MipsMemory. This implementation allows free assignment of internal and external memory segments: Some segments can be implemented internal (with TinyMemory) and some external (with the HADES interface). All the MipsMemory calls will be dispatched to the segments memory. The Memory interface provides a way to visualize the full physical address space. Additionally this class does the memory access serialization with read and write buffers and schedules the waitstates for the core. These two functions do occur in the same class because there will be performance benefits by mixing the functionalities.
Field Summary | |
protected int |
currentAdr
|
protected MipsMemory |
currentMem
|
protected boolean |
debug
|
protected EntryHandler |
entryHandler
|
protected boolean |
entryHandlerInstalled
|
protected static int |
IDLE
|
protected boolean |
lastFinished
|
protected MipsMemory[] |
memoryVector
|
protected int |
memVecSize
|
static int |
MEMVECSTARTSIZE
|
protected int |
memVecUsed
|
protected java.lang.String |
name
|
protected int[] |
readBufAdr
|
protected boolean[] |
readBufBurst
|
protected static int |
READBUFSIZE
|
protected int |
readBufUsed
|
protected static int |
READNOWAIT
|
protected static int |
READTESTWAIT
|
protected ResetHandler |
resetHandler
|
protected int |
result
|
protected boolean |
resultPresent
|
protected MipsMemory[] |
segment
|
static int |
SEGMENTCOUNT
|
static int |
SEGMENTMASK
|
static int |
SEGMENTSHIFT
|
static int |
SEGMENTSIZE
|
protected int |
state
|
protected int[] |
writeBufAdr
|
protected int[] |
writeBufData
|
protected static int |
WRITEBUFSIZE
|
protected int |
writeBufUsed
|
protected static int |
WRITENOWAIT
|
protected static int |
WRITETESTWAIT
|
Constructor Summary | |
MemoryDispatcher(ResetHandler newResetHandler,
java.lang.String newName)
|
Method Summary | |
boolean |
beginCycle()
beginCycle has to add waitstates for delayed accesses |
void |
endCycle()
Launch read and write requests |
boolean |
finished()
request end of read or write access |
java.util.Vector |
getAllMemories()
|
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 result |
ResetHandler |
getResetHandler()
|
MipsMemory |
getSegment(int segmentnum)
|
MipsMemory |
getSegmentForPhysAddress(int adr)
|
MipsMemory |
getSegmentForVirtAddress(int adr)
|
protected java.lang.String |
getStateString()
|
int |
getWordWidth()
Witdh of one word in bits |
void |
installEntryHandler(EntryHandler newEntryHandler)
setEntry() calles this EntryHandler |
protected void |
memVecAddElement(MipsMemory memory)
|
protected java.util.Vector |
memVecClone()
|
protected boolean |
memVecContains(MipsMemory memory)
|
protected int |
memVecGetIndex(MipsMemory memory)
|
protected void |
memVecRemoveElement(MipsMemory memory)
|
void |
por()
Power on reset or hardware reset |
void |
read(int adr,
boolean burst)
Store read request. |
int |
readMemory(int address)
Read a word from the memory |
void |
reset()
software reset |
protected boolean |
searchMemory(MipsMemory mem)
|
void |
setAllSegments(MipsMemory memory)
|
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 |
setName(java.lang.String newName)
Set the name of this memory |
void |
setSegment(int segmentnum,
MipsMemory memory)
|
void |
setSegmentForPhysAddress(int adr,
MipsMemory memory)
|
void |
setSegmentForVirtAddress(int adr,
MipsMemory memory)
|
void |
write(int adr,
int data)
Store write request. |
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 ResetHandler resetHandler
protected java.lang.String name
protected EntryHandler entryHandler
protected boolean entryHandlerInstalled
protected boolean debug
public static final int SEGMENTCOUNT
public static final int SEGMENTMASK
public static final int SEGMENTSHIFT
public static final int SEGMENTSIZE
public static final int MEMVECSTARTSIZE
protected MipsMemory[] segment
protected MipsMemory[] memoryVector
protected int memVecUsed
protected int memVecSize
protected static final int IDLE
protected static final int READNOWAIT
protected static final int READTESTWAIT
protected static final int WRITENOWAIT
protected static final int WRITETESTWAIT
protected int state
protected int currentAdr
protected MipsMemory currentMem
protected int result
protected boolean resultPresent
protected boolean lastFinished
protected static final int WRITEBUFSIZE
protected int[] writeBufAdr
protected int[] writeBufData
protected int writeBufUsed
protected static final int READBUFSIZE
protected int[] readBufAdr
protected boolean[] readBufBurst
protected int readBufUsed
Constructor Detail |
public MemoryDispatcher(ResetHandler newResetHandler, java.lang.String newName)
Method Detail |
protected int memVecGetIndex(MipsMemory memory)
protected boolean memVecContains(MipsMemory memory)
protected void memVecAddElement(MipsMemory memory)
protected void memVecRemoveElement(MipsMemory memory)
protected java.util.Vector memVecClone()
protected boolean searchMemory(MipsMemory mem)
public void setSegment(int segmentnum, MipsMemory memory)
public void setSegmentForPhysAddress(int adr, MipsMemory memory)
public void setSegmentForVirtAddress(int adr, MipsMemory memory)
public MipsMemory getSegment(int segmentnum)
public MipsMemory getSegmentForPhysAddress(int adr)
public MipsMemory getSegmentForVirtAddress(int adr)
public java.util.Vector getAllMemories()
public void setAllSegments(MipsMemory memory)
public ResetHandler getResetHandler()
public void por()
por
in interface Resetable
public void reset()
reset
in interface Resetable
protected java.lang.String getStateString()
public boolean beginCycle()
beginCycle
in interface MipsMemory
public void endCycle()
endCycle
in interface MipsMemory
public boolean finished()
MipsMemory
finished
in interface MipsMemory
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 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()
Memory
getWordWidth
in interface Memory
public int getMemorySize()
Memory
getMemorySize
in interface Memory
public int readMemory(int address)
Memory
readMemory
in interface Memory
public void writeMemory(int address, int word)
Memory
writeMemory
in interface Memory
public void setEntry(int entry, int globalPointer)
Memory
setEntry
in interface Memory
public void installEntryHandler(EntryHandler newEntryHandler)
Memory
installEntryHandler
in interface Memory
public void setLog(boolean newDebug)
Memory
setLog
in interface Memory
public boolean getLog()
Memory
getLog
in interface Memory
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |