public final class MemoryDeviceWrapper extends java.lang.Object implements MemoryDevice
MemoryDeviceWrapper
class adapts a Memory
object to
the MemoryDevice
interface. This might be required to map an
external (created by a plugin) object modeling a memory storage to
a Memory
object.Constructor and Description |
---|
MemoryDeviceWrapper(Memory memory) |
Modifier and Type | Method and Description |
---|---|
int |
getAddressBitSize()
Returns the size of address used to perform an access to the memory device.
|
int |
getDataBitSize()
Returns the size of data unit that can be read or written from
the memory device at once.
|
boolean |
isInitialized(ru.ispras.fortress.data.types.bitvector.BitVector address)
Checks whether the specified address location has been initialized.
|
ru.ispras.fortress.data.types.bitvector.BitVector |
load(ru.ispras.fortress.data.types.bitvector.BitVector address)
Loads data from the given address.
|
void |
store(ru.ispras.fortress.data.types.bitvector.BitVector address,
ru.ispras.fortress.data.types.bitvector.BitVector data)
Stores the specified data at the given address.
|
public MemoryDeviceWrapper(Memory memory)
public int getAddressBitSize()
MemoryDevice
getAddressBitSize
in interface MemoryDevice
public int getDataBitSize()
MemoryDevice
getDataBitSize
in interface MemoryDevice
public ru.ispras.fortress.data.types.bitvector.BitVector load(ru.ispras.fortress.data.types.bitvector.BitVector address)
MemoryDevice
load
in interface MemoryDevice
address
- Load address.MemoryDevice.getDataBitSize()
.public void store(ru.ispras.fortress.data.types.bitvector.BitVector address, ru.ispras.fortress.data.types.bitvector.BitVector data)
MemoryDevice
store
in interface MemoryDevice
address
- Store address.data
- Data of size equal to returned by MemoryDevice.getDataBitSize()
.public boolean isInitialized(ru.ispras.fortress.data.types.bitvector.BitVector address)
MemoryDevice
isInitialized
in interface MemoryDevice
address
- Address to be checked.true
is the address location is initialized or false
otherwise.