Line 17... |
Line 17... |
#include "dhry.h"
|
#include "dhry.h"
|
#include "spr-defs.h"
|
#include "spr-defs.h"
|
#include "common.h"
|
#include "common.h"
|
#include "support.h"
|
#include "support.h"
|
|
|
#define DLX_FREQ 200 /* in MHz */
|
|
#define PROC_6 0
|
#define PROC_6 0
|
|
|
#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
|
#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
|
#define UNALIGNED(X, Y) \
|
#define UNALIGNED(X, Y) \
|
(((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
|
(((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
|
Line 332... |
Line 331... |
|
|
|
|
|
|
User_Time = End_Time - Begin_Time;
|
User_Time = End_Time - Begin_Time;
|
|
|
printf("Timer ticks (%d - %d) =\t%d\n",End_Time,Begin_Time, User_Time);
|
printf("Timer ticks, %d/Sec, (%d - %d) =\t%d\n",TICKS_PER_SEC,
|
|
End_Time, Begin_Time, User_Time);
|
|
|
|
|
// This is in ticks, convert to mS
|
|
User_Time = User_Time * (MS_PER_SEC / TICKS_PER_SEC);
|
|
|
|
/* microseconds */
|
/* microseconds */
|
|
|
printf ("\nNumber of Runs %i", num_runs);
|
printf ("\nNumber of Runs %i", num_runs);
|
printf ("\nElapsed time %i ms\n", User_Time);
|
printf ("\nElapsed time %d.%d%ds\n",
|
|
(User_Time/TICKS_PER_SEC),
|
|
(User_Time/(TICKS_PER_SEC/10))%10,
|
|
(User_Time/( TICKS_PER_SEC/100))%10);
|
|
|
|
|
if (User_Time < MS_PER_SEC)
|
if (User_Time < (5*TICKS_PER_SEC))
|
{
|
{
|
printf ("Measured time too small to obtain meaningful results\n");
|
printf ("Measured time too small to obtain meaningful results\n");
|
printf ("Please increase number of runs\n");
|
printf ("Please increase number of runs\n");
|
printf ("\n");
|
printf ("\n");
|
}
|
}
|
else
|
else
|
{
|
{
|
printf("Processor at %d MHz\n",(IN_CLK/1000000));
|
printf("Processor at %d MHz\n",(IN_CLK/1000000));
|
|
|
// Microseconds = User_Time / Number_Of_Runs;
|
|
// Dhrystones_Per_Second = Number_Of_Runs * 1000 / User_Time;
|
// User_Time is ticks in resolution TICKS_PER_SEC, so to convert to uS
|
Dhrystones_Per_Second = (Number_Of_Runs * MS_PER_SEC) / User_Time;
|
Microseconds = (User_Time * (1000000/TICKS_PER_SEC));
|
|
|
|
Dhrystones_Per_Second = Number_Of_Runs / (User_Time/TICKS_PER_SEC);
|
|
|
printf ("Microseconds for one run through Dhrystone: ");
|
printf ("Microseconds for one run through Dhrystone: ");
|
printf ("%d ms / %d runs\n", User_Time,Number_Of_Runs);
|
printf ("( %d uS / %dk ) = %d uS\n", Microseconds,(Number_Of_Runs/1000),
|
|
Microseconds / Number_Of_Runs);
|
printf ("Dhrystones per Second: ");
|
printf ("Dhrystones per Second: ");
|
printf ("%d \n", Dhrystones_Per_Second);
|
printf ("%d \n", Dhrystones_Per_Second);
|
}
|
}
|
return 0;
|
return 0;
|
}
|
}
|