OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [or1ksim/] [testsuite/] [test-code-or1k/] [dhry/] [dhry.c] - Blame information for rev 867

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 90 jeremybenn
/*
2
 ****************************************************************************
3
 *
4
 *                   "DHRYSTONE" Benchmark Program
5
 *                   -----------------------------
6
 *
7
 *  Version:    C, Version 2.1
8
 *
9
 *  File:       dhry_1.c (part 2 of 3)
10
 *
11
 *  Date:       May 25, 1988
12
 *
13
 *  Author:     Reinhold P. Weicker
14
 *
15
 ****************************************************************************
16
 */
17
#include "support.h"
18
#include "dhry.h"
19
 
20
#define NUM_RUNS (20)
21
#define DLX_FREQ 200  /* in MHz */
22
 
23
#ifndef strcpy
24
char *strcpy (char *dst0, char *src0)
25
{
26
  char *s = dst0;
27
 
28
  while ((*dst0++ = *src0++));
29
 
30
  return s;
31
}
32
#endif
33
 
34
#ifndef strcmp
35
int strcmp (const char *s1, const char *s2)
36
{
37
  while (*s1 && *s2 && *s1 == *s2) {
38
    s1++;
39
    s2++;
40
  }
41
  return (*(unsigned char *) s1) - (*(unsigned char *) s2);
42
}
43
#endif
44
 
45
#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
46
#define UNALIGNED(X, Y) \
47
  (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
48
 
49
 
50
/* Global Variables: */
51
 
52
Rec_Pointer     Ptr_Glob,
53
                Next_Ptr_Glob;
54
int             Int_Glob;
55
Boolean         Bool_Glob;
56
char            Ch_1_Glob,
57
                Ch_2_Glob;
58
int             Arr_1_Glob [50];
59
int             Arr_2_Glob [50] [50];
60
 
61
 
62
  /* forward declaration necessary since Enumeration may not simply be int */
63
 
64
#ifndef REG
65
        Boolean Reg = false;
66
#define REG
67
        /* REG becomes defined as empty */
68
        /* i.e. no register variables   */
69
#else
70
        Boolean Reg = true;
71
#endif
72
 
73
/* variables for time measurement: */
74
 
75
#define Too_Small_Time DLX_FREQ
76
 
77
 
78
 
79
 
80
 
81
 
82
unsigned int    Begin_Time,
83
                End_Time,
84
                User_Time;
85
 
86
/* end of variables for time measurement */
87
 
88
 
89
void Proc_1(REG Rec_Pointer Ptr_Val_Par);
90
void Proc_2(One_Fifty      *Int_Par_Ref);
91
void Proc_3(Rec_Pointer    *Ptr_Ref_Par);
92
void Proc_4();
93
void Proc_5();
94
void Proc_6(
95
    Enumeration     Enum_Val_Par,
96
    Enumeration    *Enum_Ref_Par);
97
void Proc_7(
98
    One_Fifty       Int_1_Par_Val,
99
    One_Fifty       Int_2_Par_Val,
100
    One_Fifty      *Int_Par_Ref);
101
void Proc_8(
102
    Arr_1_Dim       Arr_1_Par_Ref,
103
    Arr_2_Dim       Arr_2_Par_Ref,
104
    int             Int_1_Par_Val,
105
    int             Int_2_Par_Val);
106
Enumeration Func_1(Capital_Letter Ch_1_Par_Val,
107
                   Capital_Letter Ch_2_Par_Val);
108
Boolean Func_2(Str_30 Str_1_Par_Ref, Str_30 Str_2_Par_Ref);
109
Boolean Func_3(Enumeration     Enum_Par_Val);
110
 
111
int main ()
112
/*****/
113
 
114
  /* main program, corresponds to procedures        */
115
  /* Main and Proc_0 in the Ada version             */
116
{
117
        One_Fifty       Int_1_Loc;
118
  REG   One_Fifty       Int_2_Loc;
119
        One_Fifty       Int_3_Loc;
120
  REG   char            Ch_Index;
121
        Enumeration     Enum_Loc;
122
        Str_30          Str_1_Loc;
123
        Str_30          Str_2_Loc;
124
  REG   int             Run_Index;
125
  REG   int             Number_Of_Runs;
126
  Rec_Type              x, y;
127
 
128
  /* Initializations */
129
 
130
  Next_Ptr_Glob = (Rec_Pointer) &x;
131
  Ptr_Glob = (Rec_Pointer) &y;
132
 
133
  Ptr_Glob->Ptr_Comp                    = Next_Ptr_Glob;
134
  Ptr_Glob->Discr                       = Ident_1;
135
  Ptr_Glob->variant.var_1.Enum_Comp     = Ident_3;
136
  Ptr_Glob->variant.var_1.Int_Comp      = 40;
137
  strcpy (Ptr_Glob->variant.var_1.Str_Comp,
138
          "DHRYSTONE PROGRAM, SOME STRING");
139
  strcpy (Str_1_Loc, "DHRYSTONE PROGRAM, 1'ST STRING");
140
 
141
  Arr_2_Glob [8][7] = 10;
142
        /* Was missing in published program. Without this statement,    */
143
        /* Arr_2_Glob [8][7] would have an undefined value.             */
144
        /* Warning: With 16-Bit processors and Number_Of_Runs > 32000,  */
145
        /* overflow may occur for this array element.                   */
146
 
147
/* Initalize Data and Instruction Cache */
148
 
149
 
150
/*  printf ("\n");
151
  printf ("Dhrystone Benchmark, Version 2.1 (Language: C)\n");
152
  printf ("\n");
153
  if (Reg)
154
  {
155
    printf ("Program compiled with 'register' attribute\n");
156
    printf ("\n");
157
  }
158
  else
159
  {
160
    printf ("Program compiled without 'register' attribute\n");
161
    printf ("\n");
162
  }
163
  printf ("Please give the number of runs through the benchmark: ");
164
 */
165
  {
166
    int n;
167
    /* scanf ("%d", &n);
168
 */
169
    n = NUM_RUNS;
170
    Number_Of_Runs = n;
171
  }
172
  printf ("\n");
173
 
174
  printf ("Execution starts, %d runs through Dhrystone\n", Number_Of_Runs);
175
 
176
 
177
  /***************/
178
  /* Start timer */
179
  /***************/
180
 
181
/*  printf("%d", my_test2(Number_Of_Runs));*/
182
        Begin_Time = read_timer();
183
 
184
  for (Run_Index = 1; Run_Index <= Number_Of_Runs; ++Run_Index)
185
  {
186
 
187
    Proc_5();
188 458 julius
 
189 90 jeremybenn
    Proc_4();
190 458 julius
 
191 90 jeremybenn
      /* Ch_1_Glob == 'A', Ch_2_Glob == 'B', Bool_Glob == true */
192
    Int_1_Loc = 2;
193
    Int_2_Loc = 3;
194
    strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 2'ND STRING");
195
    Enum_Loc = Ident_2;
196
 
197
    Bool_Glob = ! Func_2 (Str_1_Loc, Str_2_Loc);
198 458 julius
 
199 90 jeremybenn
      /* Bool_Glob == 1 */
200
    while (Int_1_Loc < Int_2_Loc)  /* loop body executed once */
201
    {
202
      Int_3_Loc = 5 * Int_1_Loc - Int_2_Loc;
203
        /* Int_3_Loc == 7 */
204
      Proc_7 (Int_1_Loc, Int_2_Loc, &Int_3_Loc);
205
        /* Int_3_Loc == 7 */
206
      Int_1_Loc += 1;
207
    } /* while */
208 458 julius
 
209 90 jeremybenn
      /* Int_1_Loc == 3, Int_2_Loc == 3, Int_3_Loc == 7 */
210
    Proc_8 (Arr_1_Glob, Arr_2_Glob, Int_1_Loc, Int_3_Loc);
211
      /* Int_Glob == 5 */
212
 
213
    Proc_1 (Ptr_Glob);
214
 
215
    for (Ch_Index = 'A'; Ch_Index <= Ch_2_Glob; ++Ch_Index)
216
                             /* loop body executed twice */
217
    {
218
      if (Enum_Loc == Func_1 (Ch_Index, 'C'))
219
          /* then, not executed */
220
        {
221
        Proc_6 (Ident_1, &Enum_Loc);
222
        strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 3'RD STRING");
223
        Int_2_Loc = Run_Index;
224
        Int_Glob = Run_Index;
225
        }
226
    }
227
 
228
      /* Int_1_Loc == 3, Int_2_Loc == 3, Int_3_Loc == 7 */
229
    Int_2_Loc = Int_2_Loc * Int_1_Loc;
230
    Int_1_Loc = Int_2_Loc / Int_3_Loc;
231
    Int_2_Loc = 7 * (Int_2_Loc - Int_3_Loc) - Int_1_Loc;
232
      /* Int_1_Loc == 1, Int_2_Loc == 13, Int_3_Loc == 7 */
233
    Proc_2 (&Int_1_Loc);
234
 
235
      /* Int_1_Loc == 5 */
236
 
237
  } /* loop "for Run_Index" */
238
 
239
  /**************/
240
  /* Stop timer */
241
  /**************/
242
 
243
  End_Time = read_timer();
244
 
245
/*  printf ("Execution ends\n");
246
  printf ("\n");
247
  printf ("Final values of the variables used in the benchmark:\n");
248
  printf ("\n");
249
  printf ("Int_Glob:            %d\n", Int_Glob);
250
  printf ("        should be:   %d\n", 5);
251
  printf ("Bool_Glob:           %d\n", Bool_Glob);
252
  printf ("        should be:   %d\n", 1);
253
  printf ("Ch_1_Glob:           %c\n", Ch_1_Glob);
254
  printf ("        should be:   %c\n", 'A');
255
  printf ("Ch_2_Glob:           %c\n", Ch_2_Glob);
256
  printf ("        should be:   %c\n", 'B');
257
  printf ("Arr_1_Glob[8]:       %d\n", Arr_1_Glob[8]);
258
  printf ("        should be:   %d\n", 7);
259
  printf ("Arr_2_Glob[8][7]:    %d\n", Arr_2_Glob[8][7]);
260
  printf ("        should be:   Number_Of_Runs + 10\n");
261
  printf ("Ptr_Glob->\n");
262
  printf ("  Ptr_Comp:          %d\n", (int) Ptr_Glob->Ptr_Comp);
263
  printf ("        should be:   (implementation-dependent)\n");
264
  printf ("  Discr:             %d\n", Ptr_Glob->Discr);
265
  printf ("        should be:   %d\n", 0);
266
  printf ("  Enum_Comp:         %d\n", Ptr_Glob->variant.var_1.Enum_Comp);
267
  printf ("        should be:   %d\n", 2);
268
  printf ("  Int_Comp:          %d\n", Ptr_Glob->variant.var_1.Int_Comp);
269
  printf ("        should be:   %d\n", 17);
270
  printf ("  Str_Comp:          %s\n", Ptr_Glob->variant.var_1.Str_Comp);
271
  printf ("        should be:   DHRYSTONE PROGRAM, SOME STRING\n");
272
  printf ("Next_Ptr_Glob->\n");
273
  printf ("  Ptr_Comp:          %d\n", (int) Next_Ptr_Glob->Ptr_Comp);
274
  printf ("        should be:   (implementation-dependent), same as above\n");
275
  printf ("  Discr:             %d\n", Next_Ptr_Glob->Discr);
276
  printf ("        should be:   %d\n", 0);
277
  printf ("  Enum_Comp:         %d\n", Next_Ptr_Glob->variant.var_1.Enum_Comp);
278
  printf ("        should be:   %d\n", 1);
279
  printf ("  Int_Comp:          %d\n", Next_Ptr_Glob->variant.var_1.Int_Comp);
280
  printf ("        should be:   %d\n", 18);
281
  printf ("  Str_Comp:          %s\n",
282
                                Next_Ptr_Glob->variant.var_1.Str_Comp);
283
  printf ("        should be:   DHRYSTONE PROGRAM, SOME STRING\n");
284
  printf ("Int_1_Loc:           %d\n", Int_1_Loc);
285
  printf ("        should be:   %d\n", 5);
286
  printf ("Int_2_Loc:           %d\n", Int_2_Loc);
287
  printf ("        should be:   %d\n", 13);
288
  printf ("Int_3_Loc:           %d\n", Int_3_Loc);
289
  printf ("        should be:   %d\n", 7);
290
  printf ("Enum_Loc:            %d\n", Enum_Loc);
291
  printf ("        should be:   %d\n", 1);
292
  printf ("Str_1_Loc:           %s\n", Str_1_Loc);
293
  printf ("        should be:   DHRYSTONE PROGRAM, 1'ST STRING\n");
294
  printf ("Str_2_Loc:           %s\n", Str_2_Loc);
295
  printf ("        should be:   DHRYSTONE PROGRAM, 2'ND STRING\n");
296
 
297
*/
298
 
299
 
300
  User_Time = (End_Time - Begin_Time);
301
 /* microseconds */
302
 
303
  printf("Begin Time = %d us\n",Begin_Time);
304
  printf("End Time   = %d us\n",End_Time);
305
 
306
 
307
  if (User_Time < 0)
308
  {
309
    printf ("ERROR. Measured time negative\n");
310
    report (0xeeeeeeee);
311
    return  1;
312
  }
313
  else if (0 == User_Time)
314
  {
315
    printf ("Measured time too small to obtain meaningful results\n");
316
    printf ("Please increase number of runs\n");
317
    report (0xeeeeeeee);
318
    return  1;
319
  }
320
  else
321
  {
322
    unsigned int  Dhrystones_Per_Second = 1000000 * Number_Of_Runs / User_Time;
323
 
324
    printf ("Microseconds for one run through Dhrystone: ");
325
    printf ("%d us / %d runs\n", User_Time, Number_Of_Runs);
326
    printf ("Dhrystones per Second:                      ");
327
    printf ("%d \n", Dhrystones_Per_Second);
328
  }
329
 
330
  report (0xdeaddead);
331
  return 0;
332
}
333
 
334
 
335
void Proc_1(Ptr_Val_Par)
336
/******************/
337
 
338
        REG Rec_Pointer Ptr_Val_Par;
339
 /* executed once */
340
{
341
        REG Rec_Pointer Next_Record = Ptr_Val_Par->Ptr_Comp;
342
        /* == Ptr_Glob_Next */
343
        /* Local variable, initialized with Ptr_Val_Par->Ptr_Comp,    */
344
        /* corresponds to "rename" in Ada, "with" in Pascal           */
345
 
346
#if DBG
347
        report(0x20010);
348
#endif
349
 
350
        structassign(*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob);
351
        Ptr_Val_Par->variant.var_1.Int_Comp = 5;
352
        Next_Record->variant.var_1.Int_Comp
353
        = Ptr_Val_Par->variant.var_1.Int_Comp;
354
        Next_Record->Ptr_Comp = Ptr_Val_Par->Ptr_Comp;
355
        Proc_3(&Next_Record->Ptr_Comp);
356
#if DBG
357
        report(0x20011);
358
#endif
359
        /*
360
         * Ptr_Val_Par->Ptr_Comp->Ptr_Comp == Ptr_Glob->Ptr_Comp
361
         */
362
        if (Next_Record->Discr == Ident_1)
363
        /* then, executed */
364
        {
365
        Next_Record->variant.var_1.Int_Comp = 6;
366
        Proc_6(Ptr_Val_Par->variant.var_1.Enum_Comp,
367
                   &Next_Record->variant.var_1.Enum_Comp);
368
#if DBG
369
        report(0x20012);
370
#endif
371
        Next_Record->Ptr_Comp = Ptr_Glob->Ptr_Comp;
372
        Proc_7(Next_Record->variant.var_1.Int_Comp, 10,
373
                   &Next_Record->variant.var_1.Int_Comp);
374
        } else          /* not executed */
375
        structassign(*Ptr_Val_Par, *Ptr_Val_Par->Ptr_Comp);
376
#if DBG
377
        report(0x20013);
378
#endif
379
 
380
}               /* Proc_1 */
381
 
382
 
383
void
384
  Proc_2(Int_Par_Ref)
385
/******************/
386
 /* executed once */
387
 /* *Int_Par_Ref == 1, becomes 4 */
388
 
389
        One_Fifty      *Int_Par_Ref;
390
{
391
        One_Fifty       Int_Loc;
392
        Enumeration     Enum_Loc = 0;
393
 
394
#if DBG
395
        report(0x20020);
396
#endif
397
 
398
        Int_Loc = *Int_Par_Ref + 10;
399
        do              /* executed once */
400
        if (Ch_1_Glob == 'A')
401
                /* then, executed */
402
        {
403
                Int_Loc -= 1;
404
                *Int_Par_Ref = Int_Loc - Int_Glob;
405
                Enum_Loc = Ident_1;
406
        }           /* if */
407
        while (Enum_Loc != Ident_1);/* true */
408
}               /* Proc_2 */
409
 
410
 
411
void
412
  Proc_3(Ptr_Ref_Par)
413
/******************/
414
 /* executed once */
415
 /* Ptr_Ref_Par becomes Ptr_Glob */
416
 
417
        Rec_Pointer    *Ptr_Ref_Par;
418
 
419
{
420
#if DBG
421
        report(0x20030);
422
#endif
423
 
424
        if (Ptr_Glob != Null)
425
        /* then, executed */
426
        *Ptr_Ref_Par = Ptr_Glob->Ptr_Comp;
427
        Proc_7(10, Int_Glob, &Ptr_Glob->variant.var_1.Int_Comp);
428
}               /* Proc_3 */
429
 
430
 
431
void
432
  Proc_4()
433
{               /* without parameters */
434
        /*******/
435
        /* executed once */
436
        Boolean         Bool_Loc;
437
 
438
#if DBG
439
        report(0x20040);
440
#endif
441
 
442
        Bool_Loc = Ch_1_Glob == 'A';
443
        Bool_Glob = Bool_Loc | Bool_Glob;
444
        Ch_2_Glob = 'B';
445
}               /* Proc_4 */
446
 
447
 
448
void
449
  Proc_5()
450
{               /* without parameters */
451
        /*******/
452
        /* executed once */
453
#if DBG
454
        report(0x20050);
455
#endif
456
 
457
        Ch_1_Glob = 'A';
458
        Bool_Glob = false;
459
}               /* Proc_5 */
460
 
461
/* @(#)dhry_2.c 1.2 92/05/28 14:44:54, AMD */
462
/*
463
 ****************************************************************************
464
 *
465
 *                   "DHRYSTONE" Benchmark Program
466
 *                   -----------------------------
467
 *
468
 *  Version:    C, Version 2.1
469
 *
470
 *  File:       dhry_2.c (part 3 of 3)
471
 *
472
 *  Date:       May 25, 1988
473
 *
474
 *  Author:     Reinhold P. Weicker
475
 *
476
 ****************************************************************************
477
 */
478
 
479
#ifndef REG
480
#define REG
481
 /* REG becomes defined as empty */
482
 /* i.e. no register variables   */
483
#ifdef _AM29K
484
#undef REG
485
#define REG register    /* Define REG; saves room on 127-char MS-DOS cmd line */
486
#endif
487
#endif
488
 
489
 
490
void
491
  Proc_6(Enum_Val_Par, Enum_Ref_Par)
492
/*********************************/
493
 /* executed once */
494
 /* Enum_Val_Par == Ident_3, Enum_Ref_Par becomes Ident_2 */
495
 
496
    Enumeration     Enum_Val_Par;
497
    Enumeration    *Enum_Ref_Par;
498
{
499
#if PROC_6
500
#if DBG
501
        report(0x20060);
502
#endif
503
 
504
    *Enum_Ref_Par = Enum_Val_Par;
505
    if (!Func_3(Enum_Val_Par))
506
        /* then, not executed */
507
        *Enum_Ref_Par = Ident_4;
508
    switch (Enum_Val_Par) {
509
    case Ident_1:
510
        *Enum_Ref_Par = Ident_1;
511
        break;
512
    case Ident_2:
513
        if (Int_Glob > 100)
514
            /* then */
515
            *Enum_Ref_Par = Ident_1;
516
        else
517
            *Enum_Ref_Par = Ident_4;
518
        break;
519
    case Ident_3:               /* executed */
520
        *Enum_Ref_Par = Ident_2;
521
        break;
522
    case Ident_4:
523
        break;
524
    case Ident_5:
525
        *Enum_Ref_Par = Ident_3;
526
        break;
527
    }                           /* switch */
528
#endif
529
    return;
530
}                               /* Proc_6 */
531
 
532
 
533
void
534
  Proc_7(Int_1_Par_Val, Int_2_Par_Val, Int_Par_Ref)
535
/**********************************************/
536
 /* executed three times                                      */
537
 /* first call:      Int_1_Par_Val == 2, Int_2_Par_Val == 3,  */
538
 /* Int_Par_Ref becomes 7                    */
539
 /* second call:     Int_1_Par_Val == 10, Int_2_Par_Val == 5, */
540
 /* Int_Par_Ref becomes 17                   */
541
 /* third call:      Int_1_Par_Val == 6, Int_2_Par_Val == 10, */
542
 /* Int_Par_Ref becomes 18                   */
543
    One_Fifty       Int_1_Par_Val;
544
    One_Fifty       Int_2_Par_Val;
545
    One_Fifty      *Int_Par_Ref;
546
{
547
    One_Fifty       Int_Loc;
548
 
549
#if DBG
550
        report(0x20070);
551
#endif
552
 
553
    Int_Loc = Int_1_Par_Val + 2;
554
    *Int_Par_Ref = Int_2_Par_Val + Int_Loc;
555
}                               /* Proc_7 */
556
 
557
 
558
void
559
  Proc_8(Arr_1_Par_Ref, Arr_2_Par_Ref, Int_1_Par_Val, Int_2_Par_Val)
560
/*********************************************************************/
561
 /* executed once      */
562
 /* Int_Par_Val_1 == 3 */
563
 /* Int_Par_Val_2 == 7 */
564
    Arr_1_Dim       Arr_1_Par_Ref;
565
    Arr_2_Dim       Arr_2_Par_Ref;
566
    int             Int_1_Par_Val;
567
    int             Int_2_Par_Val;
568
{
569
    REG One_Fifty   Int_Index;
570
    REG One_Fifty   Int_Loc;
571
 
572
#if DBG
573
      printf("X) Int_1_Par_Val: %x\n", Int_1_Par_Val);
574
      printf("X) Int_2_Par_Val: %x\n", Int_2_Par_Val);
575
#endif
576
 
577
#if DBG
578
        report(0x20080);
579
#endif
580
 
581
    Int_Loc = Int_1_Par_Val + 5;
582
    Arr_1_Par_Ref[Int_Loc] = Int_2_Par_Val;
583
    Arr_1_Par_Ref[Int_Loc + 1] = Arr_1_Par_Ref[Int_Loc];
584
    Arr_1_Par_Ref[Int_Loc + 30] = Int_Loc;
585
    for (Int_Index = Int_Loc; Int_Index <= Int_Loc + 1; ++Int_Index)
586
        Arr_2_Par_Ref[Int_Loc][Int_Index] = Int_Loc;
587
    Arr_2_Par_Ref[Int_Loc][Int_Loc - 1] += 1;
588
    Arr_2_Par_Ref[Int_Loc + 20][Int_Loc] = Arr_1_Par_Ref[Int_Loc];
589
    Int_Glob = 5;
590
 
591
#if DBG
592
      printf("Y) Int_1_Par_Val: %x\n", Int_1_Par_Val);
593
      printf("Y) Int_2_Par_Val: %x\n", Int_2_Par_Val);
594
#endif
595
 
596
}                               /* Proc_8 */
597
 
598
 
599
Enumeration
600
  Func_1(Ch_1_Par_Val, Ch_2_Par_Val)
601
/*************************************************/
602
 /* executed three times                                         */
603
 /* first call:      Ch_1_Par_Val == 'H', Ch_2_Par_Val == 'R'    */
604
 /* second call:     Ch_1_Par_Val == 'A', Ch_2_Par_Val == 'C'    */
605
 /* third call:      Ch_1_Par_Val == 'B', Ch_2_Par_Val == 'C'    */
606
 
607
    Capital_Letter  Ch_1_Par_Val;
608
    Capital_Letter  Ch_2_Par_Val;
609
{
610
    Capital_Letter  Ch_1_Loc;
611
    Capital_Letter  Ch_2_Loc;
612
 
613
#if DBG
614
        report(0x30010);
615
#endif
616
 
617
    Ch_1_Loc = Ch_1_Par_Val;
618
    Ch_2_Loc = Ch_1_Loc;
619
    if (Ch_2_Loc != Ch_2_Par_Val)
620
        /* then, executed */
621
        return (Ident_1);
622
    else {                      /* not executed */
623
        Ch_1_Glob = Ch_1_Loc;
624
        return (Ident_2);
625
    }
626
}                               /* Func_1 */
627
 
628
 
629
Boolean
630
  Func_2(Str_1_Par_Ref, Str_2_Par_Ref)
631
/*************************************************/
632
 /* executed once */
633
 /* Str_1_Par_Ref == "DHRYSTONE PROGRAM, 1'ST STRING" */
634
 /* Str_2_Par_Ref == "DHRYSTONE PROGRAM, 2'ND STRING" */
635
 
636
    Str_30          Str_1_Par_Ref;
637
    Str_30          Str_2_Par_Ref;
638
{
639
    REG One_Thirty  Int_Loc;
640
    Capital_Letter  Ch_Loc = 0;
641
 
642
#if DBG
643
        report(0x30020);
644
#endif
645
 
646
    Int_Loc = 2;
647
    while (Int_Loc <= 2)        /* loop body executed once */
648
        if (Func_1(Str_1_Par_Ref[Int_Loc],
649
                   Str_2_Par_Ref[Int_Loc + 1]) == Ident_1)
650
            /* then, executed */
651
        {
652
            Ch_Loc = 'A';
653
            Int_Loc += 1;
654
        }                       /* if, while */
655
#if DBG
656
        report(0x30021);
657
#endif
658
 
659
    if (Ch_Loc >= 'W' && Ch_Loc < 'Z')
660
        /* then, not executed */
661
        Int_Loc = 7;
662
#if DBG
663
        report(0x30022);
664
#endif
665
    if (Ch_Loc == 'R')
666
        /* then, not executed */
667
        return (true);
668
    else {                      /* executed */
669
#if DBG
670
        report(0x30023);
671
#endif
672
        if (strcmp(Str_1_Par_Ref, Str_2_Par_Ref) > 0)
673
            /* then, not executed */
674
        {
675
            Int_Loc += 7;
676
            Int_Glob = Int_Loc;
677
            return (true);
678
        } else                  /* executed */
679
            return (false);
680
    }                           /* if Ch_Loc */
681
}                               /* Func_2 */
682
 
683
 
684
Boolean
685
  Func_3(Enum_Par_Val)
686
/***************************/
687
 /* executed once        */
688
 /* Enum_Par_Val == Ident_3 */
689
    Enumeration     Enum_Par_Val;
690
{
691
    Enumeration     Enum_Loc;
692
 
693
    Enum_Loc = Enum_Par_Val;
694
#if DBG
695
        report(0x30030);
696
#endif
697
    if (Enum_Loc == Ident_3)
698
        /* then, executed */
699
        return (true);
700
    else                        /* not executed */
701
        return (false);
702
}                               /* Func_3 */

powered by: WebSVN 2.1.0

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