jmce - 1_02

jmce.sim.memory
Class PlainMemory

java.lang.Object
  extended by jmce.sim.AbstractHardware
      extended by jmce.sim.AbstractPeripheral
          extended by jmce.sim.memory.AbstractMemory
              extended by jmce.sim.memory.PlainMemory
All Implemented Interfaces:
Hardware, Memory, Peripheral
Direct Known Subclasses:
BankedMemory, FastMemory, LoadableMemory, MappedMemory, PersistentMemory, ReadOnlyMemory

public class PlainMemory
extends AbstractMemory


Field Summary
protected  int[] memory
          Array with memory data
protected  int[] tmpMemory
          Temporary array pointer for memory copy operation
 
Fields inherited from class jmce.sim.memory.AbstractMemory
size, vms
 
Fields inherited from class jmce.sim.AbstractPeripheral
cpu
 
Constructor Summary
PlainMemory()
          Default constructor
PlainMemory(java.lang.String name)
          Constructor with memory name
PlainMemory(java.lang.String name, int size)
          Constructor with memory name and memory size
 
Method Summary
protected static int[] allocMemory(int size)
          Function used by subclass to allocate memory he memory is filled with 0xff.
protected static void copyMemory(int[] source, int soffset, int[] dest, int doffset, int size)
          Function used by subclass to copy memory.
protected  int get(int a)
          Get memory.
 void reset()
          Reset the memory to initial state.
protected  void set(int a, int v)
          Set memory.
 void setSize(int newSize)
          Set the size of the memory.
 
Methods inherited from class jmce.sim.memory.AbstractMemory
addHardwareMemory, addMemory, addMemoryReadListener, addMemoryReadListener, addMemoryWriteListener, addMemoryWriteListener, clrBit, getMemory, getMemoryAt, getMemoryCount, getMemoryName, getMemoryReadListenerAt, getMemoryReadListenerAt, getMemoryReadListenerCount, getMemoryReadListenerCount, getMemoryWriteListenerAt, getMemoryWriteListenerAt, getMemoryWriteListenerCount, getMemoryWriteListenerCount, getReadOnly, getSize, isBit, mapAddress, mapMemory, removeMemoryReadListener, removeMemoryReadListener, removeMemoryWriteListener, removeMemoryWriteListener, setBit, setMemory, setMemoryName, setReadOnly, setReadOnly, setReadOnly, toString
 
Methods inherited from class jmce.sim.AbstractPeripheral
idle, registerCPU, setIdle, setLive
 
Methods inherited from class jmce.sim.AbstractHardware
addHardware, createFrame, destroy, getHardware, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareForName, getHardwareInstances, getHardwareTree, getName, getParent, init, initSwing, removeHardware, removeHardware, setHardware, setHardware, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jmce.sim.Peripheral
idle, registerCPU
 
Methods inherited from interface jmce.sim.Hardware
addHardware, destroy, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareInstances, getHardwareTree, getName, getParent, init, initSwing, removeHardware, removeHardware, setHardware, setHardware, setName
 

Field Detail

memory

protected int[] memory
Array with memory data


tmpMemory

protected int[] tmpMemory
Temporary array pointer for memory copy operation

Constructor Detail

PlainMemory

public PlainMemory()
Default constructor


PlainMemory

public PlainMemory(java.lang.String name)
Constructor with memory name


PlainMemory

public PlainMemory(java.lang.String name,
                   int size)
Constructor with memory name and memory size

Method Detail

set

protected void set(int a,
                   int v)
Description copied from class: AbstractMemory
Set memory.

Used by subclass to implement the phisical memory.

Specified by:
set in class AbstractMemory

get

protected int get(int a)
Description copied from class: AbstractMemory
Get memory.

Used by subclass to implement the phisical memory.

Specified by:
get in class AbstractMemory

reset

public void reset()
           throws SIMException
Reset the memory to initial state. Fill the memory with 0xff

Specified by:
reset in interface Hardware
Overrides:
reset in class AbstractHardware
Throws:
SIMException
Since:
1.02

setSize

public void setSize(int newSize)
Description copied from interface: Memory
Set the size of the memory.

Specified by:
setSize in interface Memory
Overrides:
setSize in class AbstractMemory

allocMemory

protected static int[] allocMemory(int size)
Function used by subclass to allocate memory he memory is filled with 0xff. So the real type of memory is confinated to this class.

Since:
1.02

copyMemory

protected static void copyMemory(int[] source,
                                 int soffset,
                                 int[] dest,
                                 int doffset,
                                 int size)
Function used by subclass to copy memory. So the real type of memory is confinated to this class.

Since:
1.02

jmce - 1_02