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

Erroneous ICache hits impact performance counters #123

Open
Harshitha172000 opened this issue Jun 21, 2021 · 7 comments
Open

Erroneous ICache hits impact performance counters #123

Harshitha172000 opened this issue Jun 21, 2021 · 7 comments

Comments

@Harshitha172000
Copy link
Member

Icache updates the LRU access variable only if cache hits occur in the read state. There may be cache hits that occur in the state refill or invalidate. CPU gets back its requested data for these hits but the access information for such hits fails to update the LRU algorithm.

Case 1: Cache hit in refill state

image

Case 2: Cache hit in invalidate state

image

@Harshitha172000 Harshitha172000 changed the title Icache fails to update the variablecache hits to lru Icache fails to update cache hits to LRU Jun 21, 2021
@stffrdhrn
Copy link
Member

Can you show the LRU updates happening in case 1 and not happening in case 2 in the traces? How can we reproduce this?

@Harshitha172000
Copy link
Member Author

LRU is not getting correct access information in both cases. Even though there are way_hits as 10 (case 1) and 01 (case 2), this is not updated in the access variable which remains 00. This access variable is input for the lru_cache module.

Checking the following assertions would result in these errors.
https://github.com/Harshitha172000/mor1kx/blob/formal/rtl/verilog/mor1kx_icache.v#L565#L584

@stffrdhrn
Copy link
Member

I am not sure this is an issue or we should be touching this. For some reasons

  1. LRU is used for a heuristic use when refilling the cache to replace the least recently used cache way. If it's wrong it means we may discard new data, which is not going to cause failures, so I think not critical.
  2. During refill LRU should be consistent so that we always replace the same LRU cache way.
  3. During invalidate we invalidate all ways, so LRU data is not very meaningful.

@Harshitha172000
Copy link
Member Author

This issue may not be critical from the LRU perspective. All cache hits are not acknowledged to the fetch module, only refill hits and hits during the READ state are considered, so no need to update lru. But the cache_hit_o is independent of state and it's used to update the performance counter unit (PCU) in the ctrl module. This 'cache_hit_o' may wrongly update PCU when hits occur in invalidate state.

@stffrdhrn
Copy link
Member

OK, that seems like a different issue, do you want to close this issue and create a new one, or update the description of this issue to indicate the impact on performance counters?

@Harshitha172000 Harshitha172000 changed the title Icache fails to update cache hits to LRU Impact on performance counters Jul 1, 2021
@stffrdhrn
Copy link
Member

Can you change the description? "Impact on performance counters" doesn't communicate the issue well.

@Harshitha172000 Harshitha172000 changed the title Impact on performance counters Impact of erroneous cache hits on PCU Jul 4, 2021
@stffrdhrn
Copy link
Member

Impact is not a good word to start a issue description. Maybe swap it around "Erroneous ICache hits impact performance counters"

@Harshitha172000 Harshitha172000 changed the title Impact of erroneous cache hits on PCU Erroneous ICache hits impact performance counters Jul 5, 2021
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

No branches or pull requests

2 participants