D
- the data type.A
- the address type.public abstract class Cache<D extends Data,A extends Address> extends java.lang.Object implements Buffer<D,A>, BufferObserver, ModelStateManager
length
- the number of sets in the cache,
associativity
- the number of lines in each set,
policyId
- the data replacement policy,
indexer
- the set indexer, and
matcher
- the line matcher.Modifier and Type | Class and Description |
---|---|
class |
Cache.Proxy
Proxy class is used to simply code of assignment expressions.
|
Constructor and Description |
---|
Cache(java.math.BigInteger length,
int associativity,
PolicyId policyId,
Indexer<A> indexer,
Matcher<D,A> matcher)
Constructs a buffer of the given length and associativity.
|
Modifier and Type | Method and Description |
---|---|
D |
getData(A address)
Returns the data associated with the given address.
|
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) |
void |
resetState() |
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.
|
Cache.Proxy |
setData(A address) |
D |
setData(A address,
D data)
Updates the data associated with the given address.
|
void |
setUseTempState(boolean value) |
java.lang.String |
toString() |
public Cache(java.math.BigInteger length, int associativity, PolicyId policyId, Indexer<A> indexer, Matcher<D,A> matcher)
length
- the number of sets in the buffer.associativity
- the number of lines in each set.indexer
- the set indexer.matcher
- the line matcher.public final boolean isHit(A address)
Buffer
public final boolean isHit(ru.ispras.fortress.data.types.bitvector.BitVector value)
BufferObserver
isHit
in interface BufferObserver
value
- Address to be checked.true
if the address causes a hit; false
otherwise.public final D getData(A address)
Buffer
public final D setData(A address, D data)
Buffer
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)
Buffer
public final Cache.Proxy setData(A address)
protected abstract A newAddress()
protected abstract D newData(ru.ispras.fortress.data.types.bitvector.BitVector value)
public java.lang.String toString()
toString
in class java.lang.Object
public void setUseTempState(boolean value)
setUseTempState
in interface ModelStateManager
public void resetState()
resetState
in interface ModelStateManager