jmce.sim.memory
Class PersistentMemory
java.lang.Object
jmce.sim.AbstractHardware
jmce.sim.AbstractPeripheral
jmce.sim.memory.AbstractMemory
jmce.sim.memory.PlainMemory
jmce.sim.memory.PersistentMemory
- All Implemented Interfaces:
- Hardware, Memory, MemoryWriteListener, Peripheral, ResetListener, TimerListener
- Direct Known Subclasses:
- AT24C16
public class PersistentMemory
- extends PlainMemory
- implements TimerListener, MemoryWriteListener, ResetListener
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.AbstractHardware |
addHardware, createFrame, destroy, getHardware, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareForName, getHardwareInstances, getHardwareTree, getName, getParent, 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.Hardware |
addHardware, destroy, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareInstances, getHardwareTree, getName, getParent, initSwing, removeHardware, removeHardware, setHardware, setHardware, setName |
PersistentMemory
public PersistentMemory()
PersistentMemory
public PersistentMemory(java.lang.String name,
java.lang.String filename,
int size)
writeMemory
public void writeMemory(Memory m,
int a,
int v,
int o)
- Description copied from interface:
MemoryWriteListener
- Called when a memory write event occours.
This method is called when a memory write operation occours
in the specified memory.
- Specified by:
writeMemory
in interface MemoryWriteListener
- Parameters:
m
- - Memory involved in the write operation.a
- - Address written.v
- - Value written.o
- - Old value of this memory location.
setFilename
public void setFilename(java.lang.String filename)
getFilename
public java.lang.String getFilename()
registerCPU
public void registerCPU(CPU cpu)
throws SIMException
- Description copied from interface:
Peripheral
- Register a parent CPU for future reference.
- Specified by:
registerCPU
in interface Peripheral
- Overrides:
registerCPU
in class AbstractPeripheral
- Throws:
SIMException
reset
public void reset(CPU cpu)
throws SIMException
- Specified by:
reset
in interface ResetListener
- Throws:
SIMException
init
public void init(Hardware parent)
throws SIMException
- Description copied from interface:
Hardware
- Initialize the hardware. This method must be called before
any use of the interface. Only set ... / get ... method are
allowed to be called before the intialization.
- Specified by:
init
in interface Hardware
- Overrides:
init
in class AbstractHardware
- Parameters:
parent
- Parent of this hardware.
- Throws:
SIMException
timerExpired
public void timerExpired()
- Timer called at regular interval. Check if the memory is
changed and than write the memory to one file if necessary.
- Specified by:
timerExpired
in interface TimerListener
filename
protected java.lang.String filename()
- Return the filename used for read/write memory.
load
protected void load()
throws SIMException
- Throws:
SIMException