- java.lang.Object
-
- ru.ispras.microtesk.mmu.model.sim.MmuMapping<E,A>
-
- Type Parameters:
E
- Entry type.A
- Address type.
- All Implemented Interfaces:
Buffer<E,A>
public abstract class MmuMapping<E extends Struct<?>,A extends Address<?>> extends java.lang.Object implements Buffer<E,A>
MmuMapping
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).
-
-
Constructor Summary
Constructors Constructor Description MmuMapping(Struct<E> entryCreator, Address<A> addressCreator, java.math.BigInteger length, int associativity, CachePolicy policy, Indexer<A> indexer, Matcher<E,A> matcher)
Constructs a memory-mapped buffer of the given length and associativity.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Mmu<A>
getMmu()
boolean
isHit(A address)
Checks whether the given address hits the buffer.E
readEntry(A address)
Reads the entry associated w/ the given address from the buffer.void
resetState()
Resets the state of the buffer.void
writeEntry(A address, int lower, int upper, ru.ispras.fortress.data.types.bitvector.BitVector newData)
Writes the data associated w/ the given address into the given field of the entry.void
writeEntry(A address, ru.ispras.fortress.data.types.bitvector.BitVector data)
Writes the entry associated w/ the given address into the buffer.
-
-
-
Constructor Detail
-
MmuMapping
public MmuMapping(Struct<E> entryCreator, Address<A> addressCreator, java.math.BigInteger length, int associativity, CachePolicy policy, Indexer<A> indexer, Matcher<E,A> matcher)
Constructs a memory-mapped buffer of the given length and associativity.- Parameters:
entryCreator
- the entry creator.addressCreator
- the address creator.length
- the number of sets in the buffer.associativity
- the number of lines in each set.policy
- the cache 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 hits the buffer.
-
readEntry
public E readEntry(A address)
Description copied from interface:Buffer
Reads the entry associated w/ the given address from the buffer.
-
writeEntry
public void writeEntry(A address, ru.ispras.fortress.data.types.bitvector.BitVector data)
Description copied from interface:Buffer
Writes the entry associated w/ the given address into the buffer.Note that an incoming entry is not necessarily of the
E
type. It may be returned from the previous- or next-level cache unit (thus, be different). It is the method's responsibility to convert the entry to the specified type.
-
writeEntry
public void writeEntry(A address, int lower, int upper, ru.ispras.fortress.data.types.bitvector.BitVector newData)
Description copied from interface:Buffer
Writes the data associated w/ the given address into the given field of the entry.
-
-