Hi all,

I wrote a program that constantly writes some data into an array of
integer. I used rdtsc to record the cycle count for each memory access.
When I ran this program on my own machine, the cycle count varied.
However, when I tested it on Gem5/x86, with different cache
configurations, the cycle count showed 5 constantly. The command I
used is:


$ build/X86/gem5.opt configs/example/se.py -c ~/test --caches
--cacheline_size=16 --l1d_size="32B"

The program we test is:


#include<math.h>
#include <stdio.h>
unsigned int timestamp(){
  unsigned a, d;
  asm volatile("rdtsc" : "=a"(a), "=d"(d));
  return ((unsigned long)a) | (((unsigned long)d)<<32);
}


void main(void){

  char array[20];
  int i,j;
  unsigned int start, end;
  for (j = 0; j < 2000; ++j){
  for (i = 0; i < 20;++i){
    start = timestamp();
    array[i] = '1';
    end = timestamp();
    printf("%d\t%d\ttime in between: %d\n", j , i, end - start);
  }
  printf("\n\n");
  }

}

Since the array size is totally larger than 32B, the cycle count is
supposed to vary, right? Could anyone give me any help? Did I use the
command incorrectly? And also, could you please tell me how to run
different processes on a same file system booted by gem5? Thank you! Best,
Xiaoyu
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to