• 大小: 12KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-11
  • 语言: 其他
  • 标签: riscvdhrysto  

资源简介

riscv dhrystone 评估源码

资源截图

代码片段和文件信息

/*
 ****************************************************************************
 *
 *                   “DHRYSTONE“ Benchmark Program
 *                   -----------------------------
 *                                                                            
 *  Version:    C Version 2.1
 *                                                                            
 *  File:       dhry_1.c (part 2 of 3)
 *
 *  Date:       May 25 1988
 *
 *  Author:     Reinhold P. Weicker
 *
 ****************************************************************************
 */

#include “dhry.h“

#ifndef DHRY_ITERS
#define DHRY_ITERS 2000
#endif

/* Global Variables: */

Rec_Pointer     Ptr_Glob
                Next_Ptr_Glob;
int             Int_Glob;
Boolean         Bool_Glob;
char            Ch_1_Glob
                Ch_2_Glob;
int             Arr_1_Glob [50];
int             Arr_2_Glob [50] [50];

extern char     *malloc ();
Enumeration     Func_1 ();
  /* forward declaration necessary since Enumeration may not simply be int */

#ifndef REG
        Boolean Reg = false;
#define REG
        /* REG becomes defined as empty */
        /* i.e. no register variables   */
#else
        Boolean Reg = true;
#endif

/* variables for time measurement: */

#ifdef TIMES
struct tms      time_info;
extern  int     times ();
                /* see library function “times“ */
#define Too_Small_Time (2*HZ)
                /* 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
#ifdef MSC_CLOCK
extern clock_t clock();
#define Too_Small_Time (2*HZ)
#endif

long            Begin_Time
                End_Time
                User_Time;
float           Microseconds
                Dhrystones_Per_Second;

/* end of variables for time measurement */


main ()
/*****/

  /* main program corresponds to procedures        */
  /* Main and Proc_0 in the Ada version             */
{
        One_Fifty       Int_1_Loc;
  REG   One_Fifty       Int_2_Loc;
        One_Fifty       Int_3_Loc;
  REG   char            Ch_Index;
        Enumeration     Enum_Loc;
        Str_30          Str_1_Loc;
        Str_30          Str_2_Loc;
  REG   int             Run_Index;
  REG   int             Number_Of_Runs;

  /* Initializations */

  Next_Ptr_Glob = (Rec_Pointer) malloc (sizeof (Rec_Type));
  Ptr_Glob = (Rec_Pointer) malloc (sizeof (Rec_Type));

  Ptr_Glob->Ptr_Comp                    = Next_Ptr_Glob;
  Ptr_Glob->Discr                       = Ident_1;
  Ptr_Glob->variant.var_1.Enum_Comp     = Ident_3;
  Ptr_Glob->variant.var_1.Int_Comp      = 40;
  strcpy (Ptr_Glob->variant.var_1.Str_Comp 
          “DHRYSTONE PROGRAM SOME STRING“);
  strcpy (Str_1_Loc “DHRYSTONE PROGRAM 1‘ST STRING“);

  Arr_2_Glob [8][7] = 10;
        /* Was missing in published program. Without this statement    */
        /* Arr_

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      18531  2020-07-21 13:03  dhrystone\dhry.h

     文件      12065  2020-07-21 13:03  dhrystone\dhry_1.c

     文件       5273  2020-07-21 13:03  dhrystone\dhry_2.c

     文件        332  2020-07-21 13:03  dhrystone\LICENSE

     文件        556  2020-07-21 13:03  dhrystone\Makefile

     文件         76  2020-07-21 13:03  dhrystone\README.md

     文件       3113  2020-07-21 13:03  dhrystone\strcmp.S

     目录          0  2020-07-21 13:08  dhrystone

----------- ---------  ---------- -----  ----

                39946                    8


评论

共有 条评论

相关资源