by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *|
+|* All Rights Reserved. *|
+|* *|
+|* The material in this file is confidential and contains trade secrets of *|
+|* of VeriSilicon. This is proprietary information owned or licensed by *|
+|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *|
+|* transmitted, or used in any way for any purpose, without the express *|
+|* written permission of VeriSilicon. *|
+|* *|
+\******************************************************************************/
+
+/* VeriSilicon 2020 */
+
+/**
+* @file hal_cosim.h
+*
+*
+*
+* Description:
+* This header file exports the register IO interface realized as a direct
+* memory access inline function. You should use it for your embedded
+* implementation.\n
+* Do not include directly! Include hal_api.h instead.
+*
+*
+*/
+/*****************************************************************************/
+
+#ifndef __HAL_COSIM_H__
+#define __HAL_COSIM_H__
+
+//MEMSET, MEMCPY:
+#include "ebase/builtins.h"
+//bool, INLINE:
+#include "ebase/types.h"
+
+#include "ebase/dct_assert.h"
+#include "ebase/trace.h"
+
+#include
+//#include "i2c_drv/i2c_drv.h"
+
+//#include "altera_fpga.h"
+
+#if defined(HAL_COSIM)
+#define SIM_ERROR 2
+#define SIM_MESSAGE 3
+#define SIM_VERBINFO 4
+#define SIM_INFO 5
+//extern void sim_fprintf(int slevel, char* info_string);
+#endif
+
+#undef TRACE
+#undef TEST_ASSERT_EQUAL_INT
+#undef TEST_ASSERT
+
+#if defined(HAL_COSIM)
+
+ extern void sim_fprintf(msg_severity_t slevel, char* info_string);
+
+ #define TRACE(a,...) \
+ {\
+ char info_string[120]; \
+ sprintf(info_string, __VA_ARGS__); \
+ sim_fprintf(SVE_INFO, info_string); \
+ }
+
+ #define TEST_ASSERT_EQUAL_INT(a,b) \
+ if ((a)!=(b)) {\
+ char error_string[120];\
+ sprintf(error_string, "expected=0x%08X, received=0x%08X",(a),(b) ); \
+ sim_fprintf(SVE_ERROR, error_string); \
+ }
+
+ #define TEST_ASSERT(...) \
+ {\
+ if (__VA_ARGS__) {} else { \
+ sim_fprintf(SVE_ERROR, "TEST_ASSERT");} \
+ }
+
+
+#else
+ #define TRACE(a,...) (printf(__VA_ARGS__))
+ #define TEST_ASSERT_EQUAL_INT(a,b) if ((a)!=(b)) printf("ERROR: expected=0x%08X, received=0x%08X\n",(a),(b) )
+ #define TEST_ASSERT(...) (printf("ERROR: TEST_ASSERT"))
+#endif
+
+
+
+//#include
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+typedef struct _i2c_bus {
+ uint32_t ulSclRef; //!< Clock Divider Value
+ uint8_t aucVirtualClockDividerEnable; //!< Virtual System Clock Divider 1: divide by 8; 0: no division
+ uint8_t aucTimingMode; //!< Timing Mode 1: fast; 0: standard
+ uint8_t aucSpikeFilter; //!< Suppressed Spike Width
+ uint8_t aucIrqDisable; //!< Interrupt Mask 1: interrupt disabled; 0: interrupt enabled
+} i2c_bus_t;
+
+
+
+
+ //#include
+
+#define MRV_ALL_BASE (0x0000)
+#define VDU_ALL_BASE (0x8000)
+#define MRV2_ALL_BASE (0x10000)
+
+#define IIC1_BASE (0x800)
+#define IIC2_BASE (0x1000)
+#define IIC3_BASE (0x1800)
+
+
+#include
+
+
+#include
+#include
+#include
+#include