I have a general idea about this. That's what I think:
First find out the size of the L1 cache that I will use. Then create an array (the number of bytes is large enough to enter the L1 cache), write a program that will access each element of the array. Then create a time stamp in each pair of loops.
For latency in the L2 cache, I could make the array larger to access the L2 cache.
But I don’t really know where to start. I have no clear idea of how large the array should be for each cache and how to write this program in C using this idea.
Can someone help me with this program? Any help would be appreciated!
Thanks a lot!
source
share