OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [bootloaders/] [orpmon/] [cmds/] [dhry.c] - Diff between revs 355 and 406

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 355 Rev 406
Line 47... Line 47...
#endif
#endif
}
}
 
 
/* Global Variables: */
/* Global Variables: */
 
 
Rec_Pointer     Ptr_Glob,
Rec_Pointer Ptr_Glob, Next_Ptr_Glob;
                Next_Ptr_Glob;
 
int             Int_Glob;
int             Int_Glob;
Boolean         Bool_Glob;
Boolean         Bool_Glob;
char            Ch_1_Glob,
char Ch_1_Glob, Ch_2_Glob;
                Ch_2_Glob;
 
int             Arr_1_Glob [50];
int             Arr_1_Glob [50];
int             Arr_2_Glob [50] [50];
int             Arr_2_Glob [50] [50];
 
 
 
 
  /* forward declaration necessary since Enumeration may not simply be int */
  /* forward declaration necessary since Enumeration may not simply be int */
 
 
#ifndef REG
#ifndef REG
        Boolean Reg = false;
        Boolean Reg = false;
#define REG
#define REG
Line 72... Line 69...
 
 
/* variables for time measurement: */
/* variables for time measurement: */
 
 
#define Too_Small_Time US_PER_TICK
#define Too_Small_Time US_PER_TICK
 
 
 
 
#define TIMER0 0
#define TIMER0 0
#define TIMER1 1
#define TIMER1 1
 
 
 
 
 
 
 
 
 
 
unsigned int    Begin_Time,
unsigned int    Begin_Time,
                End_Time,
    End_Time, User_Time, Microseconds, Dhrystones_Per_Second;
                User_Time,
 
                Microseconds,
 
                Dhrystones_Per_Second;
 
 
 
/* end of variables for time measurement */
/* end of variables for time measurement */
 
 
 
 
void Proc_1(REG Rec_Pointer Ptr_Val_Par);
void Proc_1(REG Rec_Pointer Ptr_Val_Par);
void Proc_2(One_Fifty      *Int_Par_Ref);
void Proc_2(One_Fifty      *Int_Par_Ref);
void Proc_3(Rec_Pointer    *Ptr_Ref_Par);
void Proc_3(Rec_Pointer    *Ptr_Ref_Par);
void Proc_4(void);
void Proc_4(void);
void Proc_5(void);
void Proc_5(void);
void Proc_6(
void Proc_6(Enumeration Enum_Val_Par, Enumeration * Enum_Ref_Par);
    Enumeration     Enum_Val_Par,
void Proc_7(One_Fifty Int_1_Par_Val,
    Enumeration    *Enum_Ref_Par);
            One_Fifty Int_2_Par_Val, One_Fifty * Int_Par_Ref);
void Proc_7(
void Proc_8(Arr_1_Dim Arr_1_Par_Ref,
    One_Fifty       Int_1_Par_Val,
            Arr_2_Dim Arr_2_Par_Ref, int Int_1_Par_Val, int Int_2_Par_Val);
    One_Fifty       Int_2_Par_Val,
Enumeration Func_1(Capital_Letter Ch_1_Par_Val, Capital_Letter Ch_2_Par_Val);
    One_Fifty      *Int_Par_Ref);
 
void Proc_8(
 
    Arr_1_Dim       Arr_1_Par_Ref,
 
    Arr_2_Dim       Arr_2_Par_Ref,
 
    int             Int_1_Par_Val,
 
    int             Int_2_Par_Val);
 
Enumeration Func_1(Capital_Letter Ch_1_Par_Val,
 
                   Capital_Letter Ch_2_Par_Val);
 
Boolean Func_2(Str_30 Str_1_Par_Ref, Str_30 Str_2_Par_Ref);
Boolean Func_2(Str_30 Str_1_Par_Ref, Str_30 Str_2_Par_Ref);
Boolean Func_3(Enumeration     Enum_Par_Val);
Boolean Func_3(Enumeration     Enum_Par_Val);
 
 
int dhry_main (int num_runs)
int dhry_main (int num_runs)
/*****/
/*****/
 
 
  /* main program, corresponds to procedures        */
  /* main program, corresponds to procedures        */
  /* Main and Proc_0 in the Ada version             */
  /* Main and Proc_0 in the Ada version             */
{
{
        One_Fifty       Int_1_Loc;
        One_Fifty       Int_1_Loc;
  REG   One_Fifty       Int_2_Loc;
  REG   One_Fifty       Int_2_Loc;
Line 149... Line 128...
        /* Warning: With 16-Bit processors and Number_Of_Runs > 32000,  */
        /* Warning: With 16-Bit processors and Number_Of_Runs > 32000,  */
        /* overflow may occur for this array element.                   */
        /* overflow may occur for this array element.                   */
 
 
/* Initalize Data and Instruction Cache */
/* Initalize Data and Instruction Cache */
 
 
 
 
/*  printf ("\n");
/*  printf ("\n");
  printf ("Dhrystone Benchmark, Version 2.1 (Language: C)\n");
  printf ("Dhrystone Benchmark, Version 2.1 (Language: C)\n");
  printf ("\n");
  printf ("\n");
  if (Reg)
  if (Reg)
  {
  {
Line 176... Line 154...
  }
  }
  printf ("\n");
  printf ("\n");
 
 
  printf ("Execution starts, %d runs through Dhrystone\n", Number_Of_Runs);
  printf ("Execution starts, %d runs through Dhrystone\n", Number_Of_Runs);
 
 
 
 
  /***************/
  /***************/
  /* Start timer */
  /* Start timer */
  /***************/
  /***************/
 
 
/*  printf("%d", my_test2(Number_Of_Runs));*/
/*  printf("%d", my_test2(Number_Of_Runs));*/
  //start_timer();
  //start_timer();
  Begin_Time = read_timer();
  Begin_Time = read_timer();
 
 
  for (Run_Index = 1; Run_Index <= Number_Of_Runs; ++Run_Index)
        for (Run_Index = 1; Run_Index <= Number_Of_Runs; ++Run_Index) {
  {
 
 
 
    Proc_5();
    Proc_5();
    Proc_4();
    Proc_4();
      /* Ch_1_Glob == 'A', Ch_2_Glob == 'B', Bool_Glob == true */
      /* Ch_1_Glob == 'A', Ch_2_Glob == 'B', Bool_Glob == true */
    Int_1_Loc = 2;
    Int_1_Loc = 2;
Line 198... Line 174...
    strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 2'ND STRING");
    strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 2'ND STRING");
    Enum_Loc = Ident_2;
    Enum_Loc = Ident_2;
 
 
    Bool_Glob = ! Func_2 (Str_1_Loc, Str_2_Loc);
    Bool_Glob = ! Func_2 (Str_1_Loc, Str_2_Loc);
      /* Bool_Glob == 1 */
      /* Bool_Glob == 1 */
    while (Int_1_Loc < Int_2_Loc)  /* loop body executed once */
                while (Int_1_Loc < Int_2_Loc) { /* loop body executed once */
    {
 
      Int_3_Loc = 5 * Int_1_Loc - Int_2_Loc;
      Int_3_Loc = 5 * Int_1_Loc - Int_2_Loc;
        /* Int_3_Loc == 7 */
        /* Int_3_Loc == 7 */
      Proc_7 (Int_1_Loc, Int_2_Loc, &Int_3_Loc);
      Proc_7 (Int_1_Loc, Int_2_Loc, &Int_3_Loc);
        /* Int_3_Loc == 7 */
        /* Int_3_Loc == 7 */
      Int_1_Loc += 1;
      Int_1_Loc += 1;
Line 234... Line 209...
    {
    {
      if (Enum_Loc == Func_1 (Ch_Index, 'C'))
      if (Enum_Loc == Func_1 (Ch_Index, 'C'))
          /* then, not executed */
          /* then, not executed */
        {
        {
        Proc_6 (Ident_1, &Enum_Loc);
        Proc_6 (Ident_1, &Enum_Loc);
        strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 3'RD STRING");
                                strcpy(Str_2_Loc,
 
                                       "DHRYSTONE PROGRAM, 3'RD STRING");
        Int_2_Loc = Run_Index;
        Int_2_Loc = Run_Index;
        Int_Glob = Run_Index;
        Int_Glob = Run_Index;
#if DBG
#if DBG
      printf("d) Int_1_Loc: %x\n", Int_1_Loc);
      printf("d) Int_1_Loc: %x\n", Int_1_Loc);
      printf("d) Int_2_Loc: %x\n", Int_2_Loc);
      printf("d) Int_2_Loc: %x\n", Int_2_Loc);
Line 327... Line 303...
  printf ("Str_2_Loc:           %s\n", Str_2_Loc);
  printf ("Str_2_Loc:           %s\n", Str_2_Loc);
  printf ("        should be:   DHRYSTONE PROGRAM, 2'ND STRING\n");
  printf ("        should be:   DHRYSTONE PROGRAM, 2'ND STRING\n");
 
 
*/
*/
 
 
 
 
 
 
  User_Time = End_Time - Begin_Time;
  User_Time = End_Time - Begin_Time;
 
 
  printf("Timer ticks, %d/Sec, (%d - %d) =\t%d\n",TICKS_PER_SEC,
  printf("Timer ticks, %d/Sec, (%d - %d) =\t%d\n",TICKS_PER_SEC,
         End_Time, Begin_Time, User_Time);
         End_Time, Begin_Time, User_Time);
 
 
 /* microseconds */
 /* microseconds */
 
 
  printf ("\nNumber of Runs %i", num_runs);
  printf ("\nNumber of Runs %i", num_runs);
  printf ("\nElapsed time %d.%d%ds\n",
  printf ("\nElapsed time %d.%d%ds\n",
          (User_Time/TICKS_PER_SEC),
          (User_Time/TICKS_PER_SEC),
          (User_Time/(TICKS_PER_SEC/10))%10,
               (User_Time / (TICKS_PER_SEC / 10)) % 10,
          (User_Time/( TICKS_PER_SEC/100))%10);
               (User_Time / (TICKS_PER_SEC / 100)) % 10);
 
 
 
 
  if (User_Time < (5*TICKS_PER_SEC))
        if (User_Time < (5 * TICKS_PER_SEC)) {
  {
                printf
    printf ("Measured time too small to obtain meaningful results\n");
                    ("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));
 
 
 
 
    // User_Time is ticks in resolution TICKS_PER_SEC, so to convert to uS
    // User_Time is ticks in resolution TICKS_PER_SEC, so to convert to uS
    Microseconds = (User_Time * (1000000/TICKS_PER_SEC));
    Microseconds = (User_Time * (1000000/TICKS_PER_SEC));
 
 
    Dhrystones_Per_Second = Number_Of_Runs / (User_Time/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 uS / %dk ) = %d uS\n", Microseconds,(Number_Of_Runs/1000),
                printf("( %d uS / %dk ) = %d uS\n", Microseconds,
            Microseconds / Number_Of_Runs);
                       (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;
}
}
 
 
 
 
void Proc_1(Ptr_Val_Par)
void Proc_1(Ptr_Val_Par)
/******************/
/******************/
 
 
        REG Rec_Pointer Ptr_Val_Par;
        REG Rec_Pointer Ptr_Val_Par;
 /* executed once */
 /* executed once */
{
{
        REG Rec_Pointer Next_Record = Ptr_Val_Par->Ptr_Comp;
        REG Rec_Pointer Next_Record = Ptr_Val_Par->Ptr_Comp;
        /* == Ptr_Glob_Next */
        /* == Ptr_Glob_Next */
        /* Local variable, initialized with Ptr_Val_Par->Ptr_Comp,    */
        /* Local variable, initialized with Ptr_Val_Par->Ptr_Comp,    */
        /* corresponds to "rename" in Ada, "with" in Pascal           */
        /* corresponds to "rename" in Ada, "with" in Pascal           */
 
 
 
 
        structassign(*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob);
        structassign(*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob);
        Ptr_Val_Par->variant.var_1.Int_Comp = 5;
        Ptr_Val_Par->variant.var_1.Int_Comp = 5;
        Next_Record->variant.var_1.Int_Comp
        Next_Record->variant.var_1.Int_Comp
        = Ptr_Val_Par->variant.var_1.Int_Comp;
        = Ptr_Val_Par->variant.var_1.Int_Comp;
        Next_Record->Ptr_Comp = Ptr_Val_Par->Ptr_Comp;
        Next_Record->Ptr_Comp = Ptr_Val_Par->Ptr_Comp;
Line 404... Line 372...
        } else          /* not executed */
        } else          /* not executed */
        structassign(*Ptr_Val_Par, *Ptr_Val_Par->Ptr_Comp);
        structassign(*Ptr_Val_Par, *Ptr_Val_Par->Ptr_Comp);
 
 
}               /* Proc_1 */
}               /* Proc_1 */
 
 
 
void Proc_2(Int_Par_Ref)
void
 
  Proc_2(Int_Par_Ref)
 
/******************/
/******************/
 /* executed once */
 /* executed once */
 /* *Int_Par_Ref == 1, becomes 4 */
 /* *Int_Par_Ref == 1, becomes 4 */
 
 
        One_Fifty      *Int_Par_Ref;
        One_Fifty      *Int_Par_Ref;
{
{
        One_Fifty       Int_Loc;
        One_Fifty       Int_Loc;
        Enumeration     Enum_Loc = 0;
        Enumeration     Enum_Loc = 0;
 
 
 
 
        Int_Loc = *Int_Par_Ref + 10;
        Int_Loc = *Int_Par_Ref + 10;
        do              /* executed once */
        do              /* executed once */
        if (Ch_1_Glob == 'A')
        if (Ch_1_Glob == 'A')
                /* then, executed */
                /* then, executed */
        {
        {
Line 429... Line 393...
                Enum_Loc = Ident_1;
                Enum_Loc = Ident_1;
        }           /* if */
        }           /* if */
        while (Enum_Loc != Ident_1);/* true */
        while (Enum_Loc != Ident_1);/* true */
}               /* Proc_2 */
}               /* Proc_2 */
 
 
 
void Proc_3(Ptr_Ref_Par)
void
 
  Proc_3(Ptr_Ref_Par)
 
/******************/
/******************/
 /* executed once */
 /* executed once */
 /* Ptr_Ref_Par becomes Ptr_Glob */
 /* Ptr_Ref_Par becomes Ptr_Glob */
 
 
        Rec_Pointer    *Ptr_Ref_Par;
        Rec_Pointer    *Ptr_Ref_Par;
 
 
{
{
 
 
        if (Ptr_Glob != Null)
        if (Ptr_Glob != Null)
        /* then, executed */
        /* then, executed */
        *Ptr_Ref_Par = Ptr_Glob->Ptr_Comp;
        *Ptr_Ref_Par = Ptr_Glob->Ptr_Comp;
        Proc_7(10, Int_Glob, &Ptr_Glob->variant.var_1.Int_Comp);
        Proc_7(10, Int_Glob, &Ptr_Glob->variant.var_1.Int_Comp);
}               /* Proc_3 */
}               /* Proc_3 */
 
 
 
void Proc_4()
void
 
  Proc_4()
 
{               /* without parameters */
{               /* without parameters */
        /*******/
        /*******/
        /* executed once */
        /* executed once */
        Boolean         Bool_Loc;
        Boolean         Bool_Loc;
 
 
 
 
        Bool_Loc = Ch_1_Glob == 'A';
        Bool_Loc = Ch_1_Glob == 'A';
        Bool_Glob = Bool_Loc | Bool_Glob;
        Bool_Glob = Bool_Loc | Bool_Glob;
        Ch_2_Glob = 'B';
        Ch_2_Glob = 'B';
}               /* Proc_4 */
}               /* Proc_4 */
 
 
 
void Proc_5()
void
 
  Proc_5()
 
{               /* without parameters */
{               /* without parameters */
        /*******/
        /*******/
        /* executed once */
        /* executed once */
 
 
        Ch_1_Glob = 'A';
        Ch_1_Glob = 'A';
Line 499... Line 455...
#undef REG
#undef REG
#define REG register    /* Define REG; saves room on 127-char MS-DOS cmd line */
#define REG register    /* Define REG; saves room on 127-char MS-DOS cmd line */
#endif
#endif
#endif
#endif
 
 
 
void Proc_6(Enum_Val_Par, Enum_Ref_Par)
void
 
  Proc_6(Enum_Val_Par, Enum_Ref_Par)
 
/*********************************/
/*********************************/
 /* executed once */
 /* executed once */
 /* Enum_Val_Par == Ident_3, Enum_Ref_Par becomes Ident_2 */
 /* Enum_Val_Par == Ident_3, Enum_Ref_Par becomes Ident_2 */
 
 
    Enumeration     Enum_Val_Par;
    Enumeration     Enum_Val_Par;
    Enumeration    *Enum_Ref_Par;
    Enumeration    *Enum_Ref_Par;
{
{
#if PROC_6
#if PROC_6
 
 
Line 539... Line 492...
    }                           /* switch */
    }                           /* switch */
#endif
#endif
    return;
    return;
}                               /* Proc_6 */
}                               /* Proc_6 */
 
 
void
void Proc_7(Int_1_Par_Val, Int_2_Par_Val, Int_Par_Ref)
  Proc_7(Int_1_Par_Val, Int_2_Par_Val, Int_Par_Ref)
 
/**********************************************/
/**********************************************/
 /* executed three times                                      */
 /* executed three times                                      */
 /* first call:      Int_1_Par_Val == 2, Int_2_Par_Val == 3,  */
 /* first call:      Int_1_Par_Val == 2, Int_2_Par_Val == 3,  */
 /* Int_Par_Ref becomes 7                    */
 /* Int_Par_Ref becomes 7                    */
 /* second call:     Int_1_Par_Val == 10, Int_2_Par_Val == 5, */
 /* second call:     Int_1_Par_Val == 10, Int_2_Par_Val == 5, */
Line 555... Line 507...
    One_Fifty       Int_2_Par_Val;
    One_Fifty       Int_2_Par_Val;
    One_Fifty      *Int_Par_Ref;
    One_Fifty      *Int_Par_Ref;
{
{
    One_Fifty       Int_Loc;
    One_Fifty       Int_Loc;
 
 
 
 
    Int_Loc = Int_1_Par_Val + 2;
    Int_Loc = Int_1_Par_Val + 2;
    *Int_Par_Ref = Int_2_Par_Val + Int_Loc;
    *Int_Par_Ref = Int_2_Par_Val + Int_Loc;
}                               /* Proc_7 */
}                               /* Proc_7 */
 
 
 
void Proc_8(Arr_1_Par_Ref, Arr_2_Par_Ref, Int_1_Par_Val, Int_2_Par_Val)
void
 
  Proc_8(Arr_1_Par_Ref, Arr_2_Par_Ref, Int_1_Par_Val, Int_2_Par_Val)
 
/*********************************************************************/
/*********************************************************************/
 /* executed once      */
 /* executed once      */
 /* Int_Par_Val_1 == 3 */
 /* Int_Par_Val_1 == 3 */
 /* Int_Par_Val_2 == 7 */
 /* Int_Par_Val_2 == 7 */
    Arr_1_Dim       Arr_1_Par_Ref;
    Arr_1_Dim       Arr_1_Par_Ref;
Line 580... Line 529...
#if DBG
#if DBG
      printf("X) Int_1_Par_Val: %x\n", Int_1_Par_Val);
      printf("X) Int_1_Par_Val: %x\n", Int_1_Par_Val);
      printf("X) Int_2_Par_Val: %x\n", Int_2_Par_Val);
      printf("X) Int_2_Par_Val: %x\n", Int_2_Par_Val);
#endif
#endif
 
 
 
 
    Int_Loc = Int_1_Par_Val + 5;
    Int_Loc = Int_1_Par_Val + 5;
    Arr_1_Par_Ref[Int_Loc] = Int_2_Par_Val;
    Arr_1_Par_Ref[Int_Loc] = Int_2_Par_Val;
    Arr_1_Par_Ref[Int_Loc + 1] = Arr_1_Par_Ref[Int_Loc];
    Arr_1_Par_Ref[Int_Loc + 1] = Arr_1_Par_Ref[Int_Loc];
    Arr_1_Par_Ref[Int_Loc + 30] = Int_Loc;
    Arr_1_Par_Ref[Int_Loc + 30] = Int_Loc;
    for (Int_Index = Int_Loc; Int_Index <= Int_Loc + 1; ++Int_Index)
    for (Int_Index = Int_Loc; Int_Index <= Int_Loc + 1; ++Int_Index)
Line 598... Line 546...
      printf("Y) Int_2_Par_Val: %x\n", Int_2_Par_Val);
      printf("Y) Int_2_Par_Val: %x\n", Int_2_Par_Val);
#endif
#endif
 
 
}                               /* Proc_8 */
}                               /* Proc_8 */
 
 
 
Enumeration Func_1(Ch_1_Par_Val, Ch_2_Par_Val)
Enumeration
 
  Func_1(Ch_1_Par_Val, Ch_2_Par_Val)
 
/*************************************************/
/*************************************************/
 /* executed three times                                         */
 /* executed three times                                         */
 /* first call:      Ch_1_Par_Val == 'H', Ch_2_Par_Val == 'R'    */
 /* first call:      Ch_1_Par_Val == 'H', Ch_2_Par_Val == 'R'    */
 /* second call:     Ch_1_Par_Val == 'A', Ch_2_Par_Val == 'C'    */
 /* second call:     Ch_1_Par_Val == 'A', Ch_2_Par_Val == 'C'    */
 /* third call:      Ch_1_Par_Val == 'B', Ch_2_Par_Val == 'C'    */
 /* third call:      Ch_1_Par_Val == 'B', Ch_2_Par_Val == 'C'    */
 
 
    Capital_Letter  Ch_1_Par_Val;
    Capital_Letter  Ch_1_Par_Val;
    Capital_Letter  Ch_2_Par_Val;
    Capital_Letter  Ch_2_Par_Val;
{
{
    Capital_Letter  Ch_1_Loc;
    Capital_Letter  Ch_1_Loc;
    Capital_Letter  Ch_2_Loc;
    Capital_Letter  Ch_2_Loc;
 
 
 
 
    Ch_1_Loc = Ch_1_Par_Val;
    Ch_1_Loc = Ch_1_Par_Val;
    Ch_2_Loc = Ch_1_Loc;
    Ch_2_Loc = Ch_1_Loc;
    if (Ch_2_Loc != Ch_2_Par_Val)
    if (Ch_2_Loc != Ch_2_Par_Val)
        /* then, executed */
        /* then, executed */
        return (Ident_1);
        return (Ident_1);
Line 625... Line 569...
        Ch_1_Glob = Ch_1_Loc;
        Ch_1_Glob = Ch_1_Loc;
        return (Ident_2);
        return (Ident_2);
    }
    }
}                               /* Func_1 */
}                               /* Func_1 */
 
 
 
Boolean Func_2(Str_1_Par_Ref, Str_2_Par_Ref)
Boolean
 
  Func_2(Str_1_Par_Ref, Str_2_Par_Ref)
 
/*************************************************/
/*************************************************/
 /* executed once */
 /* executed once */
 /* Str_1_Par_Ref == "DHRYSTONE PROGRAM, 1'ST STRING" */
 /* Str_1_Par_Ref == "DHRYSTONE PROGRAM, 1'ST STRING" */
 /* Str_2_Par_Ref == "DHRYSTONE PROGRAM, 2'ND STRING" */
 /* Str_2_Par_Ref == "DHRYSTONE PROGRAM, 2'ND STRING" */
 
 
    Str_30          Str_1_Par_Ref;
    Str_30          Str_1_Par_Ref;
    Str_30          Str_2_Par_Ref;
    Str_30          Str_2_Par_Ref;
{
{
    REG One_Thirty  Int_Loc;
    REG One_Thirty  Int_Loc;
    Capital_Letter  Ch_Loc = 0;
    Capital_Letter  Ch_Loc = 0;
 
 
 
 
    Int_Loc = 2;
    Int_Loc = 2;
    while (Int_Loc <= 2)        /* loop body executed once */
    while (Int_Loc <= 2)        /* loop body executed once */
        if (Func_1(Str_1_Par_Ref[Int_Loc],
        if (Func_1(Str_1_Par_Ref[Int_Loc],
                   Str_2_Par_Ref[Int_Loc + 1]) == Ident_1)
                   Str_2_Par_Ref[Int_Loc + 1]) == Ident_1)
            /* then, executed */
            /* then, executed */
        {
        {
            Ch_Loc = 'A';
            Ch_Loc = 'A';
            Int_Loc += 1;
            Int_Loc += 1;
        }                       /* if, while */
                }
 
        /* if, while */
    if (Ch_Loc >= 'W' && Ch_Loc < 'Z')
    if (Ch_Loc >= 'W' && Ch_Loc < 'Z')
        /* then, not executed */
        /* then, not executed */
        Int_Loc = 7;
        Int_Loc = 7;
    if (Ch_Loc == 'R')
    if (Ch_Loc == 'R')
        /* then, not executed */
        /* then, not executed */
Line 668... Line 608...
        } else                  /* executed */
        } else                  /* executed */
            return (false);
            return (false);
    }                           /* if Ch_Loc */
    }                           /* if Ch_Loc */
}                               /* Func_2 */
}                               /* Func_2 */
 
 
 
Boolean Func_3(Enum_Par_Val)
Boolean
 
  Func_3(Enum_Par_Val)
 
/***************************/
/***************************/
 /* executed once        */
 /* executed once        */
 /* Enum_Par_Val == Ident_3 */
 /* Enum_Par_Val == Ident_3 */
    Enumeration     Enum_Par_Val;
    Enumeration     Enum_Par_Val;
{
{
Line 688... Line 626...
        return (false);
        return (false);
}                               /* Func_3 */
}                               /* Func_3 */
 
 
int dhry_cmd (int argc, char *argv[])
int dhry_cmd (int argc, char *argv[])
{
{
  if (argc == 1) dhry_main(strtoul (argv[0], 0, 0));
        if (argc == 1)
  else if (argc == 0) dhry_main(20);
                dhry_main(strtoul(argv[0], 0, 0));
  else return -1;
        else if (argc == 0)
 
                dhry_main(20);
 
        else
 
                return -1;
  return 0;
  return 0;
}
}
 
 
void module_dhry_init (void)
void module_dhry_init (void)
{
{

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.