Hello
How can I measure programicaly (not query the OS, but measure) the size and order of associativity of L1 and L2 caches (data caches)?
Assumtions about system: It has L1 and L2 cache (may be L3 too, may be cache sharing), It may have a hardware prefetch unit (just like P4+), it has a stable clocksource (tickcounter or good HPET for gettimeofday).
There are no assumtions about OS (it can be Linux, Windows, smth non-standart), and we can't use posix queries.
Language is C. And Compiler optimizations may be disabled.