hades.models.mips.mipsmemory
Class TinyBPMemory

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

public class TinyBPMemory
extends BreakPointMemory
implements Resetable, MipsMemory

Memory implementation as a simple array with no wait states. The memory is organized in words in order to serve word requests fast.


Field Summary
protected  boolean currentlyReading
           
protected  boolean debug
           
protected  boolean finished
           
protected  int memorySize
           
protected  java.lang.String name
           
protected  int nextAdr
           
protected  int nextData
           
protected  int result
           
protected  int totalWaitstates
           
protected  int waiting
           
protected  int waitstates
           
 
Fields inherited from class hades.models.mips.memory.BreakPointMemory
BP_IDLE, BP_READALL, BP_READVAL, BP_WRITEALL, BP_WRITEVAL, bpHandler, bpHandlerInstalled, mem, readBP, readVal, writeBP, writeVal
 
Constructor Summary
TinyBPMemory(ResetHandler resetHandler, int newMemorySize, int newWaitstates, java.lang.String newName)
          Waitstates are given to test memory accesses with many waitstates.
 
Method Summary
 boolean beginCycle()
          beginCycle has to do nothing because this memory doesn?t needs extra cycles for memory access
 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 result
 int getWordWidth()
          Witdh of one word in bits
 void por()
          Power on 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 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 hades.models.mips.memory.BreakPointMemory
getMemory, getReadBPMemory, getReadValMemory, getWriteBPMemory, getWriteValMemory, installBreakPointHandler, installEntryHandler, setEntry, setReadBP, setWriteBP
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface hades.models.mips.memory.Memory
installEntryHandler, setEntry
 

Field Detail

nextAdr

protected int nextAdr

nextData

protected int nextData

result

protected int result

currentlyReading

protected boolean currentlyReading

memorySize

protected int memorySize

waitstates

protected int waitstates

waiting

protected int waiting

finished

protected boolean finished

totalWaitstates

protected int totalWaitstates

name

protected java.lang.String name

debug

protected boolean debug
Constructor Detail

TinyBPMemory

public TinyBPMemory(ResetHandler resetHandler,
                    int newMemorySize,
                    int newWaitstates,
                    java.lang.String newName)
Waitstates are given to test memory accesses with many waitstates. The TinyBPMemory will delay the access as many cycles as waitstates says

Method Detail

por

public void por()
Power on reset or hardware reset

Specified by:
por in interface Resetable

reset

public void reset()
software reset

Specified by:
reset in interface Resetable

beginCycle

public boolean beginCycle()
beginCycle has to do nothing because this memory doesn?t needs extra cycles for memory access

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

statistics

public java.lang.String statistics()

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 data)
Drive busses for write access

Specified by:
write in interface MipsMemory

read

public void read(int adr,
                 boolean burst)
Drive busses for read access

Specified by:
read in interface MipsMemory

getReadResult

public int getReadResult()
get result

Specified by:
getReadResult in interface MipsMemory

getWordWidth

public int getWordWidth()
Witdh of one word in bits

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

getMemorySize

public int getMemorySize()
Capacity of the memory in words

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

readMemory

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

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

writeMemory

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

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

setLog

public void setLog(boolean newDebug)
Description copied from interface: Memory
Enable or disable logging output

Specified by:
setLog in interface Memory
Overrides:
setLog in class BreakPointMemory

getLog

public boolean getLog()
Description copied from interface: Memory
Get debug mode

Specified by:
getLog in interface Memory
Overrides:
getLog in class BreakPointMemory