I have a general idea about it. This is what I am thinking:
First, find out the size of the L1 cache I will be using. Then create an array (number of byte is large enough to fit within L1 cache), write a program which will access every element of the array. Then create time stamp in every couple of loops.
For latency in L2 cache, I could make the array larger to reach the L2 cache.
But actually I don't know how to start. I don't have a clear idea about how large the array should be for each cache and how to write this C program with the idea above.
Could anybody help me with this C program? Any help will be appreciated!
Thanks a lot!