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

Subversion Repositories neorv32

[/] [neorv32/] [trunk/] [sw/] [example/] [coremark/] [coremark.h] - Diff between revs 2 and 38

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

Rev 2 Rev 38
Line 46... Line 46...
 
 
/* 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
        Otherwise an unsigned int.
   a double. 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;
Line 73... Line 73...
/* 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);
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 */
Line 86... Line 86...
#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,
Line 128... Line 131...
        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 */
Line 163... Line 166...
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_s16 seed1, ee_s16 seed2, ee_s16 step, ee_u16 crc);
                        ee_u8 *memblock,
 
                        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.