Class Memory<E extends Struct<?>,​A extends Address>

  • All Implemented Interfaces:
    Buffer<E,​A>

    public abstract class Memory<E extends Struct<?>,​A extends Address>
    extends java.lang.Object
    implements Buffer<E,​A>
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      class  Memory.Proxy
      Proxy class is used to simplify code of assignment expressions.
    • Constructor Summary

      Constructors 
      Constructor Description
      Memory​(Struct<E> entryCreator, Address<A> addressCreator, java.math.BigInteger byteSize)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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 setStorage​(MemoryDevice storage)  
      Memory.Proxy writeEntry​(A address)  
      void writeEntry​(A address, int lower, int upper, ru.ispras.fortress.data.types.bitvector.BitVector data)
      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 newEntry)
      Writes the entry associated w/ the given address into the buffer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Memory

        public Memory​(Struct<E> entryCreator,
                      Address<A> addressCreator,
                      java.math.BigInteger byteSize)
    • Method Detail

      • setStorage

        public final void setStorage​(MemoryDevice storage)
      • isHit

        public boolean isHit​(A address)
        Description copied from interface: Buffer
        Checks whether the given address hits the buffer.
        Specified by:
        isHit in interface Buffer<E extends Struct<?>,​A extends Address>
        Parameters:
        address - the address.
        Returns:
        true iff the address hits the buffer.
      • readEntry

        public final E readEntry​(A address)
        Description copied from interface: Buffer
        Reads the entry associated w/ the given address from the buffer.
        Specified by:
        readEntry in interface Buffer<E extends Struct<?>,​A extends Address>
        Parameters:
        address - the address.
        Returns:
        the entry associated w/ the address or null.
      • writeEntry

        public final void writeEntry​(A address,
                                     ru.ispras.fortress.data.types.bitvector.BitVector newEntry)
        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.

        Specified by:
        writeEntry in interface Buffer<E extends Struct<?>,​A extends Address>
        Parameters:
        address - the address.
        newEntry - the new entry.
      • writeEntry

        public final void writeEntry​(A address,
                                     int lower,
                                     int upper,
                                     ru.ispras.fortress.data.types.bitvector.BitVector data)
        Description copied from interface: Buffer
        Writes the data associated w/ the given address into the given field of the entry.
        Specified by:
        writeEntry in interface Buffer<E extends Struct<?>,​A extends Address>
        Parameters:
        address - the address.
        lower - the lower bit.
        upper - the upper bit.
        data - the new data.
      • writeEntry

        public final Memory.Proxy writeEntry​(A address)
      • resetState

        public void resetState()
        Description copied from interface: Buffer
        Resets the state of the buffer.
        Specified by:
        resetState in interface Buffer<E extends Struct<?>,​A extends Address>