dioscuri.module.cpu32
Class LazyMemory

java.lang.Object
  extended by dioscuri.module.cpu32.Memory
      extended by dioscuri.module.cpu32.AbstractMemory
          extended by dioscuri.module.cpu32.LazyMemory
All Implemented Interfaces:
ByteArray
Direct Known Subclasses:
LazyCodeBlockMemory

public class LazyMemory
extends AbstractMemory

Author:
Bram Lohman, Bart Kiers

Constructor Summary
LazyMemory(byte[] data)
           
LazyMemory(int size)
           
LazyMemory(int size, Clock clk)
           
 
Method Summary
 void clear()
           
 void copyContentsFrom(int address, byte[] buf, int off, int len)
           
 void copyContentsInto(int address, byte[] buf, int off, int len)
           
 CodeBlock decodeCodeBlockAt(Processor cpu, int offset)
           
 int execute(Processor cpu, int offset)
           
 byte getByte(int offset)
           
 int getDoubleWord(int offset)
           
 long getSize()
           
 short getWord(int offset)
           
 boolean isAllocated()
           
 boolean isCacheable()
           
 void setByte(int offset, byte data)
           
 void setDoubleWord(int offset, int data)
           
 void setWord(int offset, short data)
           
 java.lang.String toString()
           
 
Methods inherited from class dioscuri.module.cpu32.AbstractMemory
clear, clearArray, clearArray, getDoubleWord, getDoubleWordInBytes, getLowerDoubleQuadWord, getQuadWord, getQuadWordInBytes, getUpperDoubleQuadWord, getWord, getWordInBytes, setDoubleWordInBytes, setLowerDoubleQuadWord, setQuadWord, setQuadWordInBytes, setUpperDoubleQuadWord, setWordInBytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LazyMemory

public LazyMemory(int size)
Parameters:
size -

LazyMemory

public LazyMemory(int size,
                  Clock clk)
Parameters:
size -
clk -

LazyMemory

public LazyMemory(byte[] data)
Parameters:
data -
Method Detail

isCacheable

public boolean isCacheable()
Returns:
-

copyContentsInto

public void copyContentsInto(int address,
                             byte[] buf,
                             int off,
                             int len)
Specified by:
copyContentsInto in interface ByteArray
Overrides:
copyContentsInto in class AbstractMemory
Parameters:
address -
buf -
off -
len -

copyContentsFrom

public void copyContentsFrom(int address,
                             byte[] buf,
                             int off,
                             int len)
Overrides:
copyContentsFrom in class AbstractMemory
Parameters:
address -
buf -
off -
len -

getSize

public long getSize()
Specified by:
getSize in interface ByteArray
Specified by:
getSize in class AbstractMemory
Returns:
-

isAllocated

public boolean isAllocated()
Overrides:
isAllocated in class Memory
Returns:
-

getByte

public byte getByte(int offset)
Specified by:
getByte in interface ByteArray
Specified by:
getByte in class AbstractMemory
Parameters:
offset -
Returns:
-

setByte

public void setByte(int offset,
                    byte data)
Specified by:
setByte in interface ByteArray
Specified by:
setByte in class AbstractMemory
Parameters:
offset -
data -

getWord

public short getWord(int offset)
Overrides:
getWord in class AbstractMemory
Parameters:
offset -
Returns:
-

getDoubleWord

public int getDoubleWord(int offset)
Overrides:
getDoubleWord in class AbstractMemory
Parameters:
offset -
Returns:
-

setWord

public void setWord(int offset,
                    short data)
Overrides:
setWord in class AbstractMemory
Parameters:
offset -
data -

setDoubleWord

public void setDoubleWord(int offset,
                          int data)
Overrides:
setDoubleWord in class AbstractMemory
Parameters:
offset -
data -

clear

public void clear()
Specified by:
clear in interface ByteArray
Overrides:
clear in class AbstractMemory

execute

public int execute(Processor cpu,
                   int offset)
Specified by:
execute in class Memory
Parameters:
cpu -
offset -
Returns:
-

decodeCodeBlockAt

public CodeBlock decodeCodeBlockAt(Processor cpu,
                                   int offset)
Specified by:
decodeCodeBlockAt in class Memory
Parameters:
cpu -
offset -
Returns:
-

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object