0

Page 74 in Computer Architecture: A Quantitative Approach, 5th edition, by Hennessy and Patterson gives the following formula to choose the set:

(Block address) MOD (Number of sets in cache)

Is Block address physical address or virtual address? I think that it should be physical address. Is my understanding right?

Jingguo Yao
  • 7,320
  • 6
  • 50
  • 63
  • 1
    Caches can be virtually or physically indexed. Either one is a valid design choice, especially for an L1 cache. – Peter Cordes Nov 26 '16 at 04:29
  • 1
    L2 and higher caches are almost always PIPT. (For L1 caches, [a common trick](http://stackoverflow.com/a/38549736/224132) is to have high few enough sets that the index bits of the address all come from the offset-within-a-page part of the address, i.e. they're translated for free so you get the speed of VIPT but the behaviour of a PIPT cache as far as homonym / synonym aliasing problems). – Peter Cordes Nov 26 '16 at 04:31
  • @PeterCordes Could you give some references about how Intel Haswell processors use addresses in its L1, L2 and L3 caches? – Jingguo Yao Nov 28 '16 at 08:24
  • 1
    [David Kanter's SnB writeup mentions L1 using VIPT](http://stackoverflow.com/a/19059970/224132). @Paul Clayton says [he's never heard of a conventional architecture using anything but PIPT for L2/L3](http://stackoverflow.com/questions/33974193/does-x86-64-cpu-use-the-same-chache-lines-for-communicate-between-2-processes-vi/33977591?noredirect=1#comment55733230_33977591), which makes sense, see the discussion in comments and updated answer. – Peter Cordes Nov 28 '16 at 08:39
  • @PeterCordes thanks a lot – Jingguo Yao Nov 29 '16 at 09:11

0 Answers0