Sign In

Don't have a Xilinx account yet?

  • Choose to receive important news and product information
  • Gain access to special content
  • Personalize your web experience on Xilinx.com

Create Account

Username

Password

Forgot your password?
XClose Panel
Xilinx Home
Reply
Newbie
jill11
Posts: 1
Registered: ‎07-11-2012
0

Running Dhrystone on the Zynq platform

Hi

 

I am in the process of benchmarking the ARM processor embedded within the Zynq device.  I am able to run the Dhrystone example code without issue on the board, however this example has all the sections of code related to extracting timer values commented out. 

 

I wish to print the Dhrystones per second value at the end of execution so I removed the #if 0... #endif surrounding the following blocks of code:

 

// #if 0

#ifdef TIMES

struct tms time_info;

extern clock_t times();

 

/* see library function "times" */

#define Too_Small_Time 120

 

/* Measurements should last at least about 2 seconds */

#endif

#ifdef

TIME

extern long time();

 

/* see library function "time" */

#define

Too_Small_Time 2

 

/* Measurements should last at least 2 seconds */

#endif

// #endif

 

 

(within main)

 

// #if 0

#ifdef TIMES

times (&time_info);

Begin_Time = (long) time_info.tms_utime;

#endif

#ifdef TIME

Begin_Time = time ( (long *) 0);

#endif

// #endif

 

// #if 0

#ifdef TIMES

times (&time_info);

End_Time = (long) time_info.tms_utime;

#endif

#ifdef TIME

End_Time = time ( (long *) 0);

#endif

// #endif

 

 

User_Time = End_Time - Begin_Time;

 

if(User_Time < Too_Small_Time)

{

printf ( "Measured time too small to obtain meaningful results\n");

printf ( "Please increase number of runs\n");

printf ( "\n");

}

else

{

#ifdef TIME

Microseconds = (float) User_Time * Mic_secs_Per_Second/ (float) Number_Of_Runs;

Dhrystones_Per_Second = (float) Number_Of_Runs / (float) User_Time;

#else

Microseconds = (float) User_Time * Mic_secs_Per_Second/ ((float) HZ * ((float) Number_Of_Runs));

Dhrystones_Per_Second = ((float) HZ * (float) Number_Of_Runs)/ (float) User_Time;

#endif

printf ("Microseconds for one run through Dhrystone: ");

printf ("%6.1f \n", Microseconds);

printf ("Dhrystones per Second: ");

printf ("%6.1f \n", Dhrystones_Per_Second);

printf ("\n");

}

 

Now when I build the project I encounter the error

 

Building target: dhrystone_0.elf

Invoking: ARM gcc linker

arm-xilinx-eabi-gcc -Wl,-T -Wl,../src/lscript.ld -L../../dhrystone_bsp_0/ps7_cortexa9_0/lib -o"dhrystone_0.elf" ./src/dhry_1.o ./src/dhry_2.o ./src/platform.o -Wl,--start-group,-lxil,-lgcc,-lc,--end-group

d:/xilinx_install/14.1/ise_ds/edk/gnu/arm/nt/bin/../lib/gcc/arm-xilinx-eabi/4.6.1/../../../../arm-xilinx-eabi/lib\libc.a(lib_a-timesr.o): In function `_times_r':

timesr.c:(.text+0x4): undefined reference to `_times'

collect2: ld returned 1 exit status

make: *** [dhrystone_0.elf] Error 1

 

Is there any way to resolve this so that I can run the Dhrystone example and return the Dhystones per second value?

 

Regards

Jill

Visitor
norstadt
Posts: 8
Registered: ‎10-17-2007
0

Re: Running Dhrystone on the Zynq platform

Hi Jill,

I had this problem, too and modified the code to use the XTime functions.  The attached source code yields this:

 

# of ticks = 21875017
begin: 106603, end: 21981620
ticks / microsecond: 10.417
Microseconds for one run through Dhrystone: 2100001.5 
Dhrystones per Second:                      2380950.5 

DMIPS          : 1355.1
DMIPS/Mhz      : 2.0327
Proc Frequency : 666666687 Hz

Cheers,

-Till