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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [core/] [sim/] [rtl_sim/] [src-c/] [coremark_v1.0/] [coremark.h] - Diff between revs 145 and 211

Only display areas with differences | Details | Blame | View Log

Rev 145 Rev 211
/*
/*
Author : Shay Gal-On, EEMBC
Author : Shay Gal-On, EEMBC
 
 
This file is part of  EEMBC(R) and CoreMark(TM), which are Copyright (C) 2009
This file is part of  EEMBC(R) and CoreMark(TM), which are Copyright (C) 2009
All rights reserved.
All rights reserved.
 
 
EEMBC CoreMark Software is a product of EEMBC and is provided under the terms of the
EEMBC CoreMark Software is a product of EEMBC and is provided under the terms of the
CoreMark License that is distributed with the official EEMBC COREMARK Software release.
CoreMark License that is distributed with the official EEMBC COREMARK Software release.
If you received this EEMBC CoreMark Software without the accompanying CoreMark License,
If you received this EEMBC CoreMark Software without the accompanying CoreMark License,
you must discontinue use and download the official release from www.coremark.org.
you must discontinue use and download the official release from www.coremark.org.
 
 
Also, if you are publicly displaying scores generated from the EEMBC CoreMark software,
Also, if you are publicly displaying scores generated from the EEMBC CoreMark software,
make sure that you are in compliance with Run and Reporting rules specified in the accompanying readme.txt file.
make sure that you are in compliance with Run and Reporting rules specified in the accompanying readme.txt file.
 
 
EEMBC
EEMBC
4354 Town Center Blvd. Suite 114-200
4354 Town Center Blvd. Suite 114-200
El Dorado Hills, CA, 95762
El Dorado Hills, CA, 95762
*/
*/
/* Topic: Description
/* Topic: Description
        This file contains  declarations of the various benchmark functions.
        This file contains  declarations of the various benchmark functions.
*/
*/
 
 
/* Configuration: TOTAL_DATA_SIZE
/* Configuration: TOTAL_DATA_SIZE
        Define total size for data algorithms will operate on
        Define total size for data algorithms will operate on
*/
*/
#ifndef TOTAL_DATA_SIZE 
#ifndef TOTAL_DATA_SIZE
#define TOTAL_DATA_SIZE 2*1000
#define TOTAL_DATA_SIZE 2*1000
#endif
#endif
 
 
#define SEED_ARG 0
#define SEED_ARG 0
#define SEED_FUNC 1
#define SEED_FUNC 1
#define SEED_VOLATILE 2
#define SEED_VOLATILE 2
 
 
#define MEM_STATIC 0
#define MEM_STATIC 0
#define MEM_MALLOC 1
#define MEM_MALLOC 1
#define MEM_STACK 2
#define MEM_STACK 2
 
 
#include "core_portme.h"
#include "core_portme.h"
 
 
#if HAS_STDIO
#if HAS_STDIO
#include <stdio.h>
#include <stdio.h>
#endif
#endif
#if HAS_PRINTF
#if HAS_PRINTF
#define ee_printf printf
#define ee_printf cprintf
#endif
#endif
 
 
/* Actual benchmark execution in iterate */
/* Actual benchmark execution in iterate */
void *iterate(void *pres);
void *iterate(void *pres);
 
 
/* Typedef: secs_ret
/* Typedef: secs_ret
        For machines that have floating point support, get number of seconds as a double.
        For machines that have floating point support, get number of seconds as a double.
        Otherwise an unsigned int.
        Otherwise an unsigned int.
*/
*/
#if HAS_FLOAT
#if HAS_FLOAT
typedef double secs_ret;
typedef double secs_ret;
#else
#else
typedef ee_u32 secs_ret;
typedef ee_u32 secs_ret;
#endif
#endif
 
 
#if MAIN_HAS_NORETURN
#if MAIN_HAS_NORETURN
#define MAIN_RETURN_VAL 
#define MAIN_RETURN_VAL
#define MAIN_RETURN_TYPE void
#define MAIN_RETURN_TYPE void
#else
#else
#define MAIN_RETURN_VAL 0
#define MAIN_RETURN_VAL 0
#define MAIN_RETURN_TYPE int
#define MAIN_RETURN_TYPE int
#endif 
#endif
 
 
void start_time(void);
void start_time(void);
void stop_time(void);
void stop_time(void);
CORE_TICKS get_time(void);
CORE_TICKS get_time(void);
secs_ret time_in_secs(CORE_TICKS ticks);
secs_ret time_in_secs(CORE_TICKS ticks);
 
 
/* Misc useful functions */
/* Misc useful functions */
ee_u16 crcu8(ee_u8 data, ee_u16 crc);
ee_u16 crcu8(ee_u8 data, ee_u16 crc);
ee_u16 crc16(ee_s16 newval, ee_u16 crc);
ee_u16 crc16(ee_s16 newval, ee_u16 crc);
ee_u16 crcu16(ee_u16 newval, ee_u16 crc);
ee_u16 crcu16(ee_u16 newval, ee_u16 crc);
ee_u16 crcu32(ee_u32 newval, ee_u16 crc);
ee_u16 crcu32(ee_u32 newval, ee_u16 crc);
ee_u8 check_data_types();
ee_u8 check_data_types();
void *portable_malloc(ee_size_t size);
void *portable_malloc(ee_size_t size);
void portable_free(void *p);
void portable_free(void *p);
ee_s32 parseval(char *valstring);
ee_s32 parseval(char *valstring);
 
 
/* Algorithm IDS */
/* Algorithm IDS */
#define ID_LIST         (1<<0)
#define ID_LIST         (1<<0)
#define ID_MATRIX       (1<<1)
#define ID_MATRIX       (1<<1)
#define ID_STATE        (1<<2)
#define ID_STATE        (1<<2)
#define ALL_ALGORITHMS_MASK (ID_LIST|ID_MATRIX|ID_STATE)
#define ALL_ALGORITHMS_MASK (ID_LIST|ID_MATRIX|ID_STATE)
#define NUM_ALGORITHMS 3
#define NUM_ALGORITHMS 3
 
 
/* list data structures */
/* list data structures */
typedef struct list_data_s {
typedef struct list_data_s {
        ee_s16 data16;
        ee_s16 data16;
        ee_s16 idx;
        ee_s16 idx;
} list_data;
} list_data;
 
 
typedef struct list_head_s {
typedef struct list_head_s {
        struct list_head_s *next;
        struct list_head_s *next;
        struct list_data_s *info;
        struct list_data_s *info;
} list_head;
} list_head;
 
 
 
 
/*matrix benchmark related stuff */
/*matrix benchmark related stuff */
#define MATDAT_INT 1
#define MATDAT_INT 1
#if MATDAT_INT
#if MATDAT_INT
typedef ee_s16 MATDAT;
typedef ee_s16 MATDAT;
typedef ee_s32 MATRES;
typedef ee_s32 MATRES;
#else
#else
typedef ee_f16 MATDAT;
typedef ee_f16 MATDAT;
typedef ee_f32 MATRES;
typedef ee_f32 MATRES;
#endif
#endif
 
 
typedef struct MAT_PARAMS_S {
typedef struct MAT_PARAMS_S {
        int N;
        int N;
        MATDAT *A;
        MATDAT *A;
        MATDAT *B;
        MATDAT *B;
        MATRES *C;
        MATRES *C;
} mat_params;
} mat_params;
 
 
/* state machine related stuff */
/* state machine related stuff */
/* List of all the possible states for the FSM */
/* List of all the possible states for the FSM */
typedef enum CORE_STATE {
typedef enum CORE_STATE {
        CORE_START=0,
        CORE_START=0,
        CORE_INVALID,
        CORE_INVALID,
        CORE_S1,
        CORE_S1,
        CORE_S2,
        CORE_S2,
        CORE_INT,
        CORE_INT,
        CORE_FLOAT,
        CORE_FLOAT,
        CORE_EXPONENT,
        CORE_EXPONENT,
        CORE_SCIENTIFIC,
        CORE_SCIENTIFIC,
        NUM_CORE_STATES
        NUM_CORE_STATES
} core_state_e ;
} core_state_e ;
 
 
 
 
/* Helper structure to hold results */
/* Helper structure to hold results */
typedef struct RESULTS_S {
typedef struct RESULTS_S {
        /* inputs */
        /* inputs */
        ee_s16  seed1;          /* Initializing seed */
        ee_s16  seed1;          /* Initializing seed */
        ee_s16  seed2;          /* Initializing seed */
        ee_s16  seed2;          /* Initializing seed */
        ee_s16  seed3;          /* Initializing seed */
        ee_s16  seed3;          /* Initializing seed */
        void    *memblock[4];   /* Pointer to safe memory location */
        void    *memblock[4];   /* Pointer to safe memory location */
        ee_u32  size;           /* Size of the data */
        ee_u32  size;           /* Size of the data */
        ee_u32 iterations;              /* Number of iterations to execute */
        ee_u32 iterations;              /* Number of iterations to execute */
        ee_u32  execs;          /* Bitmask of operations to execute */
        ee_u32  execs;          /* Bitmask of operations to execute */
        struct list_head_s *list;
        struct list_head_s *list;
        mat_params mat;
        mat_params mat;
        /* outputs */
        /* outputs */
        ee_u16  crc;
        ee_u16  crc;
        ee_u16  crclist;
        ee_u16  crclist;
        ee_u16  crcmatrix;
        ee_u16  crcmatrix;
        ee_u16  crcstate;
        ee_u16  crcstate;
        ee_s16  err;
        ee_s16  err;
        /* ultithread specific */
        /* ultithread specific */
        core_portable port;
        core_portable port;
} core_results;
} core_results;
 
 
/* Multicore execution handling */
/* Multicore execution handling */
#if (MULTITHREAD>1)
#if (MULTITHREAD>1)
ee_u8 core_start_parallel(core_results *res);
ee_u8 core_start_parallel(core_results *res);
ee_u8 core_stop_parallel(core_results *res);
ee_u8 core_stop_parallel(core_results *res);
#endif
#endif
 
 
/* list benchmark functions */
/* list benchmark functions */
list_head *core_list_init(ee_u32 blksize, list_head *memblock, ee_s16 seed);
list_head *core_list_init(ee_u32 blksize, list_head *memblock, ee_s16 seed);
ee_u16 core_bench_list(core_results *res, ee_s16 finder_idx);
ee_u16 core_bench_list(core_results *res, ee_s16 finder_idx);
 
 
/* state benchmark functions */
/* state benchmark functions */
void core_init_state(ee_u32 size, ee_s16 seed, ee_u8 *p);
void core_init_state(ee_u32 size, ee_s16 seed, ee_u8 *p);
ee_u16 core_bench_state(ee_u32 blksize, ee_u8 *memblock,
ee_u16 core_bench_state(ee_u32 blksize, ee_u8 *memblock,
                ee_s16 seed1, ee_s16 seed2, ee_s16 step, ee_u16 crc);
                ee_s16 seed1, ee_s16 seed2, ee_s16 step, ee_u16 crc);
 
 
/* matrix benchmark functions */
/* matrix benchmark functions */
ee_u32 core_init_matrix(ee_u32 blksize, void *memblk, ee_s32 seed, mat_params *p);
ee_u32 core_init_matrix(ee_u32 blksize, void *memblk, ee_s32 seed, mat_params *p);
ee_u16 core_bench_matrix(mat_params *p, ee_s16 seed, ee_u16 crc);
ee_u16 core_bench_matrix(mat_params *p, ee_s16 seed, ee_u16 crc);
 
 
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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