/*****************************************************************************
 * IDMA_Throughput_Test_Core1.h
 *****************************************************************************/

#ifndef __IDMA_THROUGHPUT_TEST_CORE1_H__
#define __IDMA_THROUGHPUT_TEST_CORE1_H__


/* Add your custom header content here */
/*=============  INCLUDES  =============*/
#include <services/pwr/adi_pwr.h>
#include <xtensa/idma.h>
#include <stdio.h>
#include "adi_initialize.h"
#include <sys/platform.h>
#include "math.h"
#include "time.h"
#include "stdlib.h"
/*=============  DEFINES   =============*/
/* Enable macro to display debug information */
#define ENABLE_DEBUG_INFO

/* Memory Copy time out value */
#define MEMCOPY_TIME_OUT_VAL        (0x7FFFFFFu)



/* Maximum number of descriptors */
#define MAX_DESCRIPTORS 32

/* Maximum transfer size in bytes */
#define MAX_MEMCOPY_BUF_SIZE	16400

/* IF (Debug info enabled) */
#if defined(ENABLE_DEBUG_INFO)
#define DBG_MSG                     printf
#else
#define DBG_MSG(...)
#endif

#define CLK_SPEED 1000.0
//sclk speed = 1000
/* Maximum number of test combinations */
#define MAX_TEST_COMBINATIONS 1000

/* Change the test parameter input file name here if required */
#define TEST_PARAM_INPUT_FILE "testparam.dat"


typedef enum
{
	SUCCESS = 0,
	FAILURE
} TEST_RES;

/* Enumeration for different type of memories */
typedef enum MEMTYPE
{
	L1MEM,
	L2MEM,
	L3MEM
} MEMTYPE;

typedef struct TEST_PARAM
{
	int32_t 				TestIndex;			/* Test index */
	MEMTYPE  				eIntMem;			/* Internal memory type (L1/L2/L3) or direct address */
	MEMTYPE 				eExtMem;			/* External memory type (L1/L2/L3) or direct address */
	uint32_t				BuffCount;			/* Buffer count in 32 bit words */
	uint32_t                Blocksize;          /* Burst length*/
} TEST_PARAM;

typedef struct FAILURE_INFO
{
	uint32_t	TestIndex;
	TEST_RES	ErrorCode;
}FAILURE_INFO;

typedef struct TEST_INFO
{
	TEST_PARAM 		*pTestParamList;
	uint32_t 		FailCount;
	FAILURE_INFO	FailedTestInfo[MAX_TEST_COMBINATIONS];
}TEST_INFO;



#endif /* __IDMA_THROUGHPUT_TEST_CORE1_H__ */
