|Home > Iris APIs > Memory API > Reading and writing through caches and buffers|
This information applies to all types of buffer, for example caches, write buffers, and temporary data buffers.
Reads through a CPU component with caches must return dirty cache data and data in write buffers,
if appropriate (programmer's view). The memory component can have its own memory
view, but with physical addresses. Reads never change any cache state, for example
they never allocate or flush.
memory_read() means peek rather than
bus read, for non-intrusive observation. Reads of any cache or buffer must return
the data that an architectural read would see. Reads usually follow the same path as
Writes through a CPU component with caches must write the data through to all caches and to main memory, regardless of any write through policy or allocation policy. The data, but not the metadata, of write buffers and any other temporary buffers containing memory data, whether for read or write, must be updated, even data that architecturally cannot be modified. Writes only update data, not tags or metadata. Writes never allocate and never update the dirty bit of lines. Clean data is updated everywhere, and is therefore inherently clean after the write. Dirty data is also updated everywhere and so might no longer be dirty, or in other words different, after the write.
Writes on any cache and buffer must update all known locations that hold this data. Writes are usually very different from architectural writes.
memory_write(address=A, data=memory_read(address=A)) has the side
effect of propagating the programmer's view value of address A into all caches,
buffers and into main memory.