A
- address type.public final class BufferStateTracker<A extends java.lang.Number>
extends java.lang.Object
BufferStateTracker
implements a simplified buffer used to imitate data replacement logic.Constructor and Description |
---|
BufferStateTracker(long sets,
long ways,
AddressView<A> addressView)
Constructs a buffer state tracker.
|
Modifier and Type | Method and Description |
---|---|
long |
getSets()
Returns the number of sets (index range).
|
long |
getWays()
Returns the number of ways (associativity).
|
void |
reset()
Resets the buffer state.
|
int |
size()
Returns the number of items stored in the buffer.
|
int |
size(int i)
Returns the number of items stored in the i-th set of the buffer.
|
A |
track(A address)
Imitates access to the buffer (updates the buffer state).
|
public BufferStateTracker(long sets, long ways, AddressView<A> addressView)
sets
- the number of sets (index range).ways
- the number of ways (associativity).addressView
- the address view.public long getSets()
public long getWays()
public void reset()
public int size()
public int size(int i)
i
- the set index.