Hi,
I am using gem5 to profile a piece of C code but I am not sure if I am on
the right track.

I need to measure the numbers of alpha instructions executed in an
experiment introduced by the following two lines C code:
{
  r = (double)rand() / (double)RAND_MAX; // line 2
  r = -log(r) / log(2.71828) / p;                   // line 3
}

The way I setup the experiment is that I wrap the two lines like this:
{
  m5_dumpreset_stats(0,0);    /* add this before region of interest */
  m5_checkpoint(0, 0);          /* add this before region of interest */
  r = (double)rand() / (double)RAND_MAX;
  r = -log(r) / log(2.71828) / p;
  m5_dumpreset_stats(0,0);     /* add this after region of interest */
 }
, and then run a simulation with a run script in simple cpu, and rerun the
simulation from the checkpoint with timing cpu. After that, I get these
parameters out of stats.txt:
("system.switch_cpus.num_conditional_control_insts"
"system.switch_cpus.num_int_insts" "system.switch_cpus.num_fp_insts"
"system.switch_cpus.num_load_insts" "system.switch_cpus.num_store_insts"),
with corresponding values is ( 2992 29902 263 6176 3159 )

Can anyone help me understand the reason of the huge number of instructions
(especially integer instructions)? Is this experiment designed/conducted
correctly at all? Thanks!


Yuchen
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to