-
Notifications
You must be signed in to change notification settings - Fork 124
Fix csr cycle unasync #630
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
Conversation
3e71dc3 to
3fede2a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmarks
| Benchmark suite | Current: f69568a | Previous: 1e5e3f8 | Ratio |
|---|---|---|---|
Dhrystone |
1318 Average DMIPS over 10 runs |
1303 Average DMIPS over 10 runs |
0.99 |
Coremark |
914.12 Average iterations/sec over 10 runs |
916.441 Average iterations/sec over 10 runs |
1.00 |
This comment was automatically generated by workflow using github-action-benchmark.
This comment was marked as resolved.
This comment was marked as resolved.
3fede2a to
1e5e3f8
Compare
jserv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enforce the rules specified in https://cbea.ms/git-commit/ carefully.
Previous commit 78836cf prevents frequently update of rv->csr_cycle by manipulate it with register. However, currently rv->csr_cycle only update after a block end or JIT clearing block map. This results csr cycle instructions cannot fetch up-to-date cycle. If started cycle and ended cycle are located in a same block, it cause the cycle count becomes zero. This commit updates rv->csr_cycle before csr cycle instruction is executed.
1e5e3f8 to
f69568a
Compare
|
Thank @Max042004 for contributing! |
Previous commit 78836cf prevents frequently update of rv->csr_cycle by manipulate it with register. However, currently rv->csr_cycle only update after a block end or JIT clearing block map. This results csr cycle instructions cannot fetch up-to-date cycle. If csr cycle instructions are located in a same block, leading to the result cycle count becomes zero.
This commit updates rv->csr_cycle everytime before csr instruction is executed.
Summary by cubic
Synchronizes cycle and instret CSR reads by updating rv->csr_cycle right before those CSRs execute, so they return the current value even within the same block. Fixes cases where these CSRs could read zero or stale counts until block end.
Written for commit f69568a. Summary will update automatically on new commits.