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

target/riscv: Stop caching writes to DPC #952

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

MarekVCodasip
Copy link
Collaborator

@MarekVCodasip MarekVCodasip commented Nov 3, 2023

Since DPC is WARL (same rules as MEPC according to the specification), it is possible that
writes to it won't result in the exact value present. Therefore, writes to it shouldn't be cached, same as with other WARL registers.

Change-Id: Ib7a4041bc2730c3cd40d5a4db8ba52a8e8788256

Since DPC is WARL (same rules as MEPC according to
the specification), it is possible that
writes to it won't result in the exact value present.
Therefore, writes to it shouldn't be cached, same as
with other WARL registers.

Change-Id: I818c0cef9727b999b7d84b19f9f42cd706c99d69
Signed-off-by: Marek Vrbka <[email protected]>
Copy link
Collaborator

@JanMatCodasip JanMatCodasip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have already discussed and reviewed it with Marek internally.

Copy link
Collaborator

@timsifive timsifive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we can still cache it for reads, right? So for DPC it should really return !is_write.

@JanMatCodasip
Copy link
Collaborator

I believe that's right. And that's exactly what the code says on line 4980. https://github.com/riscv/riscv-openocd/pull/952/files#diff-b4aa16f9e42cb8f0934baa7c8e0ec9c70a369bef98b99b26ae2e896c8aa95d6aR4980

It is just not immediately apparent due to the diff shown being too short :-)

Copy link
Collaborator

@timsifive timsifive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for explaining, @JanMatCodasip.

@timsifive timsifive merged commit 5653f51 into riscv-collab:riscv Nov 7, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants