- java.lang.Object
-
- ru.ispras.microtesk.mmu.model.sim.MmuMapping<D,A>
-
- Type Parameters:
D
- Data type.A
- Address type.
- All Implemented Interfaces:
Buffer<D,A>
,BufferObserver
public abstract class MmuMapping<D extends Data,A extends Address & Data> extends java.lang.Object implements Buffer<D,A>, BufferObserver
TheMmuMapping
class describes a buffer mapped to memory. An access to such a buffer causes a access to memory by virtual address using MMU (address translation, caches, physical memory).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description D
getData(A address)
Returns the data associated with the given address.protected abstract int
getDataBitSize()
protected abstract Mmu<A>
getMmu()
boolean
isHit(A address)
Checks whether the given address causes a hit.boolean
isHit(ru.ispras.fortress.data.types.bitvector.BitVector value)
Checks whether the given address causes a hit.protected abstract A
newAddress()
protected abstract D
newData(ru.ispras.fortress.data.types.bitvector.BitVector value)
ru.ispras.fortress.util.Pair<ru.ispras.fortress.data.types.bitvector.BitVector,ru.ispras.fortress.data.types.bitvector.BitVector>
seeData(ru.ispras.fortress.data.types.bitvector.BitVector index, ru.ispras.fortress.data.types.bitvector.BitVector way)
Returns data and associated address without changing the state.D
setData(A address, D data)
Updates the data associated with the given address.
-
-
-
Constructor Detail
-
MmuMapping
public MmuMapping(java.math.BigInteger length, int associativity, PolicyId policyId, Indexer<A> indexer, Matcher<D,A> matcher)
Constructs a memory-mapped buffer of the given length and associativity.- Parameters:
length
- the number of sets in the buffer.associativity
- the number of lines in each set.policyId
- the data replacement policy.indexer
- the set indexer.matcher
- the line matcher.
-
-
Method Detail
-
isHit
public boolean isHit(A address)
Description copied from interface:Buffer
Checks whether the given address causes a hit.
-
isHit
public boolean isHit(ru.ispras.fortress.data.types.bitvector.BitVector value)
Description copied from interface:BufferObserver
Checks whether the given address causes a hit.- Specified by:
isHit
in interfaceBufferObserver
- Parameters:
value
- Address to be checked.- Returns:
true
if the address causes a hit;false
otherwise.
-
getData
public D getData(A address)
Description copied from interface:Buffer
Returns the data associated with the given address.
-
setData
public D setData(A address, D data)
Description copied from interface:Buffer
Updates the data associated with the given address.
-
seeData
public ru.ispras.fortress.util.Pair<ru.ispras.fortress.data.types.bitvector.BitVector,ru.ispras.fortress.data.types.bitvector.BitVector> seeData(ru.ispras.fortress.data.types.bitvector.BitVector index, ru.ispras.fortress.data.types.bitvector.BitVector way)
Description copied from interface:Buffer
Returns data and associated address without changing the state.
-
newAddress
protected abstract A newAddress()
-
newData
protected abstract D newData(ru.ispras.fortress.data.types.bitvector.BitVector value)
-
getDataBitSize
protected abstract int getDataBitSize()
-
-