Package ru.ispras.microtesk.model.memory
Class MemoryDeviceWrapper
- java.lang.Object
-
- ru.ispras.microtesk.model.memory.MemoryDeviceWrapper
-
- All Implemented Interfaces:
MemoryDevice
public final class MemoryDeviceWrapper extends java.lang.Object implements MemoryDevice
TheMemoryDeviceWrapper
class adapts aMemory
object to theMemoryDevice
interface. This might be required to map an external (created by a plugin) object modeling a memory storage to aMemory
object.
-
-
Constructor Summary
Constructors Constructor Description MemoryDeviceWrapper(Memory memory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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, int offset, ru.ispras.fortress.data.types.bitvector.BitVector data)
Stores the specified data at 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.
-
-
-
Constructor Detail
-
MemoryDeviceWrapper
public MemoryDeviceWrapper(Memory memory)
-
-
Method Detail
-
getAddressBitSize
public int getAddressBitSize()
Description copied from interface:MemoryDevice
Returns the size of address used to perform an access to the memory device.- Specified by:
getAddressBitSize
in interfaceMemoryDevice
- Returns:
- Address size in bits.
-
getDataBitSize
public int getDataBitSize()
Description copied from interface:MemoryDevice
Returns the size of data unit that can be read or written from the memory device at once.- Specified by:
getDataBitSize
in interfaceMemoryDevice
- Returns:
- Data size in bits.
-
load
public ru.ispras.fortress.data.types.bitvector.BitVector load(ru.ispras.fortress.data.types.bitvector.BitVector address)
Description copied from interface:MemoryDevice
Loads data from the given address.- Specified by:
load
in interfaceMemoryDevice
- Parameters:
address
- Load address.- Returns:
- Data of size equal to returned by
MemoryDevice.getDataBitSize()
.
-
store
public void store(ru.ispras.fortress.data.types.bitvector.BitVector address, ru.ispras.fortress.data.types.bitvector.BitVector data)
Description copied from interface:MemoryDevice
Stores the specified data at the given address.- Specified by:
store
in interfaceMemoryDevice
- Parameters:
address
- Store address.data
- Data of size equal to returned byMemoryDevice.getDataBitSize()
.
-
store
public void store(ru.ispras.fortress.data.types.bitvector.BitVector address, int offset, ru.ispras.fortress.data.types.bitvector.BitVector data)
Description copied from interface:MemoryDevice
Stores the specified data at the given address.- Specified by:
store
in interfaceMemoryDevice
- Parameters:
address
- Store address.offset
- Data offset in bits.data
- Data of size equal toMemoryDevice.getDataBitSize()
-offset
.
-
isInitialized
public boolean isInitialized(ru.ispras.fortress.data.types.bitvector.BitVector address)
Description copied from interface:MemoryDevice
Checks whether the specified address location has been initialized.- Specified by:
isInitialized
in interfaceMemoryDevice
- Parameters:
address
- Address to be checked.- Returns:
true
is the address location is initialized orfalse
otherwise.
-
-