Does the valid bit need to be set in ALL cache lines within a targeted set to access the target line, or just the target line's valid bit?

StackOverflow https://stackoverflow.com/questions/22209037

  •  09-06-2023
  •  | 
  •  

質問

My wording for this question might not be specific enough, but here's a little more context...

When looking for a block in cache, the controller selects the set first. Then does it, 1) Test all valid bits in selected set and "return" a cache miss if any valid bits are not set to 1 or 2) Find the line with a matching tag bit and THEN check the valid bit for just that line.

I understand everything else relating to this process. I'm just a little confused on what comes first, finding the line or testing valid bit(s). Thanks in advance!

役に立ちましたか?

解決

An implementation could either 1) find the right line then check if it's valid or 2) find all valid lines and see if the right line is among them, or 3) find all valid lines and the right line in parallel and see if the two results intersect. There may even be other approaches, like considering the valid bit to be an extra bit in the tag and searching for that augmented tag... The end result would be the same, and the specific choice the implementers made isn't generally documented in publicly available documentation, but may be available in design documentation, if they can be persuaded to reveal it.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top