Memory Request signal type

The memory hierarchy communicates by sending memory requests and answers. The memory request data type is used to send those request and answer messages. The modules usually sending request are the cpu module and the cache module on a miss, and the module sending answers are the memory and the cache on a hit.

Note that a memory request signal can either be a memory request (not answered yet) or the answer of such a request.

The memory request signal is declared as the memreq class defined in the memreq.h file in the repository. FIXME: better link

Signal parameters

  • typename INSTRUCTION
    The type used to store the instruction corresponding to each message. This information is not used to deal with memory request, but is very useful for debugging purpose as it allows to point out the instruction from which the request comes from.
  • int DATASIZE
    The datasize is the maximum size in bytes of data that can be stored in a memory request. This data field is only used for memory answers.

Signal components

  • ByteArray<DATASIZE> data
    The data embedded in memory request answers.
  • INSTRUCTION instr
    The processor instruction that is responsible of the existence of this message. Only used for debugging purpose.
  • uint32_t address
    The memory address corresponding to the request or to the answer.
  • int size
    The size of the retrieved data in bytes.
  • command_t command
    The type of the memory request (READ, WRITE, ...).
  • int uid
    The unique ID of the incoming instruction.
  • sender_type_t sender_type
    The type of the sender (CPU, CACHE, MEMORY, ...).
  • message_type_t message_type
    The type of the message (Request, Answer).
  • module *sender
    A pointer to the module that has sent this message.
  • module *req_sender
    A pointer to the module that has sent the original request corresponding to this message.
  • bool cachable
    Whether or not the request address is cachable. This modify the way the request is handled by caches.

Internal types

Command type

The enum command_t provides some information about the command of the message (read, write, prefetch, \dots). The possible values are:

  • cmd_UNKNOWN
    The request command is unset. New messages are initialized to this value. Sent messages should no more be set to this value.
  • cmd_READ
    The request command is a read. Such request are issued by the \emph{cpu} and the \emph{caches} on a miss, and answered by \emph{caches} and \emph{memory}.
  • cmd_READX
    The request command is a read with intent to modify. Such request are issued by \emph{caches} on a write miss that first requires to perform a read of the corresponding cache line before writing in the line itself.
  • cmd_WRITE
    The request command is a write. Such request are issued by the \emph{cpu}, also by \emph{caches} on a write-back to memory. Such request are not answered.
  • cmd_PREFETCH
    The request command is a prefetch read. Such request are issued by the \emph{cpu}. The connected caches then perform a \emph{read} to the memory hierarchy.
  • cmd_EVICT
    This request perform an eviction of a cache line, forcing a write-back to the memory.
  • cmd_FLUSH
    This request flush a cache line, performing a write-back to the memory hierarchy if the line is \emph{dirty}.
  • cmd_BLOCK_INVALIDATE
    This request perform a block invalidate request.

Sender type

The enum sender_type_t provides some information about the sender of the message. Possible values are:

  • sender_UNKNOWN
    The sender type is unset. New messages are initialized to this value. Sent messages should no more be set to this value.
  • sender_CPU
    The message is issued by a \emph{cpu}. Such messages should be requests sent to the memory hierarchy.
  • sender_CACHE
    The message is issued by a \emph{cache}. Such messages can be a request sent to the memory hierarchy, or an answer sent back to the \emph{cpu}.
  • sender_MEM
    The message is issued by a main \emph{memory}. Such messages should be answers from the memory to a previously sent requests.

Message type

The enum message_type_t provides some information about the message type (request or answers). The possible values are:

  • type_UNKNOWN
    The message type is unset. New messages are initialized to this value. Sent messages should no more be set to this value.
  • type_REQUEST
    The message type is a request, so it contains no data, and will eventually be replyed by an answer.
  • type_ANSWER
    The message type is an answer so it contains the data answering to a previously sent request.
 
modules/cycle/interfaces/memreq/start.txt · Last modified: 2007/08/12 19:37 by girbal     Back to top
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki