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

bsg_cache optimization -- don't replay TL instruction if there is no TL instruction #586

Open
dpetrisko opened this issue Oct 1, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@dpetrisko
Copy link
Contributor

When bsg_cache has a miss. it fills the new data and then goes to a "recover" state, where it re-reads tag and data mems in TL. I believe this step can be omitted if v_tl_r == 0, since the memory data in that stage will be unused anyway. This has three major benefits:

  • Saves power by not rereading the RAMs
  • Saves a cycle of latency on miss
  • Saves a cycle of latency on hit-after miss
@dpetrisko dpetrisko added the enhancement New feature or request label Oct 1, 2022
@dpetrisko
Copy link
Contributor Author

dpetrisko commented Oct 1, 2022

I believe that the changes can be restricted to the bsg_cache_miss.v FSM

@tommydcjung
Copy link
Contributor

I guess the question is how often is TL empty when the cache is in miss. Probably not a common case.

@dpetrisko
Copy link
Contributor Author

I agree when using bsg_cache as an L2 with cacheline-oriented operations, but this is very common for an L1 with a random access pattern. I discovered this when analyzing the performance of a different cache and using bsg_cache as a reference

@taylor-bsg
Copy link
Contributor

Interesting idea, Dan!

@taylor-bsg taylor-bsg changed the title bsg_cache optimization opportunity bsg_cache -- don't replay TL instruction if there is no TL instruction Oct 12, 2022
@taylor-bsg taylor-bsg changed the title bsg_cache -- don't replay TL instruction if there is no TL instruction bsg_cache optimization -- don't replay TL instruction if there is no TL instruction Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants