blob: db035fa8aed57aacf80d231cfa1a586ff2e13672 [file] [log] [blame]
#ifndef __ESL_DEBUG_H__
#define __ESL_DEBUG_H__
#define ESL_SIM_TIME_FLAG (1UL<<0)
#define ESL_WALL_TIME_FLAG (1UL<<1)
#define ESL_COUNT_MCPS_FLAG (1UL<<2)
#define ESL_CUSTOM_FLAG (1UL<<3)
//For ESL Simulation
#define ESL_UART_BASE (ESL_REG_BANK + 0x7010000)
#define ESL_UART_OUT (ESL_UART_BASE+0x000)
#define ESL_UART_FLAG (ESL_UART_BASE+0x004)
#define ESL_PROF_V0T0_OUT (ESL_UART_BASE+0x008)
#define ESL_PROF_V0T0_FLAG (ESL_UART_BASE+0x00C)
#define ESL_PROF_V2T0_OUT (ESL_UART_BASE+0x208)
#define ESL_PROF_V2T0_FLAG (ESL_UART_BASE+0x20C)
#define ESL_PROF_V4T0_OUT (ESL_UART_BASE+0x408)
#define ESL_PROF_V4T0_FLAG (ESL_UART_BASE+0x40C)
#define ESL_PROF_OUT(vpe, tc) (ESL_UART_BASE | (((vpe)&0xF)<<8) | (((tc)&0xF)<<4) | 0x8)
#define ESL_PROF_FLAG(vpe, tc) (ESL_UART_BASE | (((vpe)&0xF)<<8) | (((tc)&0xF)<<4) | 0xC)
#define ESL_TCKTL_UTIL_BASE (ESL_REG_BANK + 0x1002000UL)
#define ESL_EMI_READ_LAT_REG (ESL_TCKTL_UTIL_BASE)
#if !defined(__MD97__)
#define ESL_EMI_WRITE_LAT_REG (ESL_TCKTL_UTIL_BASE+0x04)
#define ESL_EMI_STALL_EN_REG (ESL_TCKTL_UTIL_BASE+0x08)
#else
#define ESL_EMI_WRITE_LAT_REG (ESL_TCKTL_UTIL_BASE+0x08)
#define ESL_EMI_STALL_EN_REG (ESL_TCKTL_UTIL_BASE+0x10)
#endif
#if defined(__ESL_MASE_GEN97__)
#include "mase_debug.h"
#else /* __ESL_MASE_GEN97__ */
#if defined(__ESL_DBG_UTIL__) && defined(__ESL_HRT__)
#define esl_printf(flag, string_to_be_printed...) do {__esl_printf_flag(flag, string_to_be_printed);} while(0)
extern int __esl_printf_flag(kal_uint32 flag, const char *fmt, ...);
extern int __esl_profiling(kal_uint32 flag, const char *fmt, ...);
#else
#define esl_printf(...) do {;}while(0)
#endif
#endif /* __ESL_MASE_GEN97__ */
#define ESL_PLATFORM_SPEEDUP_CONFIG_CLEAR() do { \
*((volatile unsigned int*)ESL_EMI_READ_LAT_REG) = 0x30000000; \
*((volatile unsigned int*)ESL_EMI_WRITE_LAT_REG) = 0x30000000; \
*((volatile unsigned int*)ESL_EMI_STALL_EN_REG) = 0x00000000; \
MO_Sync(); \
} while(0)
#define ESL_PLATFORM_SPEEDUP_CONFIG_RESTORE() do { \
*((volatile unsigned int*)ESL_EMI_READ_LAT_REG) = 0x20000000; \
*((volatile unsigned int*)ESL_EMI_WRITE_LAT_REG) = 0x20000000; \
*((volatile unsigned int*)ESL_EMI_STALL_EN_REG) = 0x00000001; \
MO_Sync(); \
} while(0)
#endif /* __ESL_DEBUG_H__ */