Hi Fernando,
Thank you for your help. I will check rand(). When you said "the
disassembled code", which code do you mean?

Yuchen


On Wed, Mar 19, 2014 at 1:44 AM, Fernando Endo <[email protected]>wrote:

> Hello,
>
> I'm my opinion, you have to check what is done in the rand() function, it
> may be completely integer. Usually, one should look at the disassembled
> code to verify that gem5 stats are ok.
>
> Regards,
>
> --
> Fernando A. Endo, PhD student and researcher
>
> Université de Grenoble, UJF
> France
>
>
>
> 2014-03-12 20:22 GMT+01:00 Yuchen Hou <[email protected]>:
>
>> 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
>>
>
>
> _______________________________________________
> gem5-users mailing list
> [email protected]
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to