Click here to Skip to main content
15,891,688 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
We want to derive the following parameters of our CPU
experimentally:
• The number of caches
• The sizes of all caches
• The access latencies of all caches and main memory
• The cache line size

What I have tried:

sizes = [1k, 4k, 256K, ...]
foreach size in sizes
create array of `size`

start timer
for i = 0 to n // just keep accessing array
arr[(i * 16) % arr.length]++ // i * 16 supposed to modify every cache line ... see link
record/print time
Posted
Updated 7-May-18 5:54am
Comments
Patrice T 6-May-18 17:23pm    
What is the question ?

1 solution

This is virtually impossible to measure experimentally. That is because all of these things are transparent to an application, as they should be. If they aren't then the chip was not designed properly.

There are a few apps that will display this information for you, like CPU-Z, but they do not determine the info experimentally. They get the info by querying the chip and BIOS.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900