Package ru.ispras.microtesk.model.memory
Interface MemoryDevice
-
- All Known Implementing Classes:
MemoryDeviceWrapper
,Mmu
public interface MemoryDevice
TheMemoryDevice
interface provides a unified access to an abstract memory device, which can be implemented as a simple data array or as a complex hierarchy of data buffers.
-
-
Method Summary
All Methods Instance Methods Abstract 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.
-
-
-
Method Detail
-
getAddressBitSize
int getAddressBitSize()
Returns the size of address used to perform an access to the memory device.- Returns:
- Address size in bits.
-
getDataBitSize
int getDataBitSize()
Returns the size of data unit that can be read or written from the memory device at once.- Returns:
- Data size in bits.
-
load
ru.ispras.fortress.data.types.bitvector.BitVector load(ru.ispras.fortress.data.types.bitvector.BitVector address)
Loads data from the given address.- Parameters:
address
- Load address.- Returns:
- Data of size equal to returned by
getDataBitSize()
.
-
store
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.- Parameters:
address
- Store address.data
- Data of size equal to returned bygetDataBitSize()
.
-
store
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.- Parameters:
address
- Store address.offset
- Data offset in bits.data
- Data of size equal togetDataBitSize()
-offset
.
-
isInitialized
boolean isInitialized(ru.ispras.fortress.data.types.bitvector.BitVector address)
Checks whether the specified address location has been initialized.- Parameters:
address
- Address to be checked.- Returns:
true
is the address location is initialized orfalse
otherwise.
-
-