hades.models.mips.mipsmemory
Class NullMemory

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

public class NullMemory
extends java.lang.Object
implements Resetable, MipsMemory

This MipsMemory ignores every write access and always returns 0 on read requests. Its purpose is to provide address space that is not implemented and will be ignored.


Field Summary
protected  java.lang.String name
           
protected  boolean reportAccess
           
protected  int size
           
 
Constructor Summary
NullMemory(ResetHandler resetHandler, int newSize, java.lang.String newName, boolean newReportAccess)
           
 
Method Summary
 boolean beginCycle()
          next cycle, perform access to lower layer if needed, wait returned
 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 the result of the last read operation
 int getWordWidth()
          Witdh of one word in bits
 void installEntryHandler(EntryHandler entryHandler)
          setEntry() calles this EntryHandler
 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 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 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

size

protected int size

name

protected java.lang.String name

reportAccess

protected boolean reportAccess
Constructor Detail

NullMemory

public NullMemory(ResetHandler resetHandler,
                  int newSize,
                  java.lang.String newName,
                  boolean newReportAccess)
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()
Description copied from interface: MipsMemory
next cycle, perform access to lower layer if needed, wait returned

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

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

setLog

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

Specified by:
setLog in interface Memory

getLog

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

Specified by:
getLog in interface Memory

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)
Description copied from interface: MipsMemory
Drive busses for read access

Specified by:
read in interface MipsMemory

getReadResult

public int getReadResult()
Description copied from interface: MipsMemory
get the result of the last read operation

Specified by:
getReadResult in interface MipsMemory

getWordWidth

public int getWordWidth()
Description copied from interface: Memory
Witdh of one word in bits

Specified by:
getWordWidth in interface Memory

getMemorySize

public int getMemorySize()
Description copied from interface: Memory
Capacity of the memory in words

Specified by:
getMemorySize in interface Memory

readMemory

public int readMemory(int address)
Description copied from interface: Memory
Read a word from the memory

Specified by:
readMemory in interface Memory

writeMemory

public void writeMemory(int address,
                        int word)
Description copied from interface: Memory
Write a word into the memory

Specified by:
writeMemory in interface Memory

setEntry

public void setEntry(int entry,
                     int globalPointer)
Description copied from interface: Memory
Set the entry address and the global pointer if memory contains a executable program

Specified by:
setEntry in interface Memory

installEntryHandler

public void installEntryHandler(EntryHandler entryHandler)
Description copied from interface: Memory
setEntry() calles this EntryHandler

Specified by:
installEntryHandler in interface Memory