Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Document Write Back] What are the events that writes data in the memory ? #35

Open
khandelwaltanuj opened this issue Oct 24, 2024 · 3 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@khandelwaltanuj
Copy link

Hi @cfuguet

Is it possible to give details of the events that causes a write acces to the memory ?
As per my understand, when a dirty is evicted, ou a read/amo operation is performed on a dirty bit, it causes a write to memory.

Are there any other cases ?

Thanks a lot

Regards
Tanuj

@khandelwaltanuj khandelwaltanuj added the documentation Improvements or additions to documentation label Oct 24, 2024
@cfuguet
Copy link
Contributor

cfuguet commented Oct 24, 2024

The cache initiates a write to the memory on any of the following conditions:

  • When replacing a cacheline on a miss (read or write) and the victim cacheline is dirty.
  • When performing an AMO or LR/SC operation on a dirty cacheline.
  • When performing a write-through write.
  • When performing an uncacheable write.
  • When performing a flush or flush-invalidate operation on a dirty cacheline.
  • When performing a read or write operation with the write-through hint on a dirty cacheline.

@khandelwaltanuj
Copy link
Author

Thanks for your reply @cfuguet

So as I understand, a load operation with a write back on a dirty line does not causes a memory write operation.

Do you think, it would be nice to have this table in the documentations please ? Even if I know it may add a lot of verification work for me :O.

Regards,
Tanuj

@cfuguet
Copy link
Contributor

cfuguet commented Oct 25, 2024

Hi @khandelwaltanuj,

Yes, a load hit with the write-back hint does not trigger a write when reading a dirty cacheline.

A load can only trigger a write in two scenarios:

  1. load, cache miss and the victim cacheline is dirty.
  2. load with the write-through hint, cache hit and the target cacheline is dirty.

César

@cfuguet cfuguet self-assigned this Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants