xinxin.li 61a8435a6d > 1. 增加cpri模式,帧头提前2ms的功能,UCP4008-SL-EVB New Feature #926;
> 2. 系统平台lib库更新;
> 3. 增加单模模式下,双小区的删建功能;
> 4. 回归测试case:case21/case22(NR15K)/case34/case37/case68(LTE)
2023-08-18 20:30:52 +08:00

319 lines
6.7 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef __DUP_APE_COM_H__
#define __DUP_APE_COM_H__
/*error code*/
#define EQUEEMPTY 20
#define EMATCH 21
#define EINVAL 22 /*invalid argment*/
#define EREREG 23 /*re registration*/
enum hwque_status{
hwque_false,
hwque_true
};
typedef unsigned int uint32_t;
typedef unsigned short uint16_t;
typedef unsigned char uint8_t;
typedef unsigned long long uint64_t;
#define NULL ((void*)0)
#define QUE_MAX_NR 16
#define HW_QUE_NR 8
#define QUE_NR 16
#define B_128_16BLCOKS 0
#define B_256_32BLOCKS 32
#define BLOCKS_64 64
//#define QUE_NR 32
#define SHM_QUE_MAX 8
#define MAP_QUE_MAX 16
typedef enum{
CPSM_SM = 0,
JSSM_SM,
SM_NR
}ENUM_SHM;
typedef struct hw_que_reg_msg{
uint32_t hw_base_reg;
uint32_t hw_size_reg;
uint32_t hw_depth_reg;
uint32_t hw_start_addr;
int cpuid;
uint32_t ape_vector_id;
uint32_t arm_vector_id;
}hw_reg_desc_t;
typedef struct shm_desc{
hw_reg_desc_t queid[SHM_QUE_MAX];
uint32_t hw_sm_ctrl_reg;
uint32_t width_bits;
uint32_t que_depths;
}shm_obj;
typedef struct mpu_shm{
shm_obj shm_type_s[SM_NR];
int v_map_queid[MAP_QUE_MAX];
}mpu_shm_obj;
typedef struct{
unsigned int out_failed_cnt;
unsigned int in_failed_cnt;
unsigned int out_success_cnt;
unsigned int in_success_cnt;
}hwq_db_info ;
typedef struct{
hwq_db_info per_hwq[QUE_MAX_NR];
}hwq_debug_t;
/*
函数å<C2B0><C3A5>称:smart_hq_init
输入å<C2A5>æ•°: cpuid
返回类型: int
返回值: å°<C3A5>于0 表示失败
返回å€?: 0 表示æˆ<C3A6>功
函数功能ï¼? 硬件队列åˆ<C3A5>å§åŒ?
*/
extern int smart_hq_init(int cpuid);
/*
函数å<C2B0><C3A5>称:smart_get_hq_vector
输入å<C2A5>æ•°: cpuid
输入å<C2A5>数:queid
返回类型: int
è¿”åžå€¼ï¼šå°<C3A5>于等于0 表示失败
函数功能ï¼? 获å<C2B7>当å‰<C3A5>硬件队列中æ­å<C2AD>?
*/
extern int smart_get_hq_vector(int cpuid,int queid);
/***************
函数å<EFBFBD><EFBFBD>称:smart_in_que
函数å<EFBFBD>数:queid 队列ç¼å<E28093>·
函数å<EFBFBD>数:val 入队值
函数功能:硬件队列入队
函数使用注æ„<EFBFBD>ç¹1: 当å‰<C3A5>函数ä¸<C3A4>能在中æ­å¤„ç<E2809E>†å‡½æ•°ä¸­è°ƒç”¨
函数使用注æ„<EFBFBD>ç¹2: 多核生产者入队时需è¦<C3A8>加é”<C3A9>
******************/
extern int smart_in_que(int queid,uint32_t val);
/***************
函数å<EFBFBD><EFBFBD>称:smart_intr_in_que
函数å<EFBFBD>数:queid 队列ç¼å<E28093>·
函数å<EFBFBD>数:val 入队值
函数功能:硬件队列入队
函数使用注æ„<EFBFBD>ç¹1: 当å‰<C3A5>函数å<C2B0>ªèƒ½åœ¨ä¸­æ­å¤„ç<E2809E>†å‡½æ•°ä¸­è°ƒç”¨
函数使用注æ„<EFBFBD>ç¹2: 多核生产者入队时需è¦<C3A8>加é”<C3A9>
******************/
extern int smart_intr_in_que(int queid,uint32_t val);
/***************
函数å<EFBFBD><EFBFBD>称:smart_intr_out_que
函数å<EFBFBD>数:queid 队列ç¼å<E28093>·
函数å<EFBFBD>数:val 入队值
函数功能:硬件队列入队
函数使用注æ„<EFBFBD>ç¹1: 当å‰<C3A5>函数å<C2B0>ªèƒ½åœ¨ä¸­æ­å¤„ç<E2809E>†å‡½æ•°ä¸­è°ƒç”¨
******************/
extern int smart_intr_out_que(int queid,uint32_t *val);
/*
函数å<C2B0><C3A5>称:smart_que_is_full
输入å<C2A5>æ•°: queid
è¿”åžç±»åžï¼šint
返回值: 1 表示 true
返回�: 0 表示 false
说明:下ä¸?版本返åžå€¼ä¼šæ´æ”¹enum ï¼?
enum hwque_status smart_que_is_full(int queid);
è¿”åžå€¼å<C2BC>ªèƒ½é?‰æ‹© hwque_false åŒhwque_true
*/
extern int smart_que_is_full(int queid);
/*********************
函数å<EFBFBD><EFBFBD>称:smart_out_que
函数å<EFBFBD>数:queid 队列ç¼å<E28093>·
输出å<EFBFBD>数:idx 获å<C2B7>当å‰<C3A5>队列的索引值
函数功能:队列出队获å<EFBFBD>当å‰<EFBFBD>队列的索引值
函数使用注æ„<EFBFBD>ç¹1:当å‰<EFBFBD>函数ä¸<EFBFBD>能在中æ­å¤„ç<EFBFBD>†å‡½æ•°ä¸­è°ƒç”¨
*********************/
extern int smart_out_que(int queid,uint32_t *val);
/*
函数å<C2B0><C3A5>称:smart_que_is_empty
输入å<C2A5>æ•°: queid
返回类型: int
返回值: 1 表示true
è¿”åžå€¼ï¼š0 表示false
*/
extern int smart_que_is_empty(int queid);
/*
函数å<C2B0><C3A5>称:smart_get_que_info
输入å<C2A5>æ•°: queid
输出å<C2BA>æ•° *dep
输出å<C2BA>æ•°: *width
输出å<C2BA>æ•°: *used
输出å<C2BA>æ•°ï¼?*cpuid
返回类型: int
返回值: é<>?0 表示失败
返回å€?: 0 表示æˆ<C3A6>功
*/
extern int smart_get_que_info(int queid,int *dep,int *width,int *used,int *cpuid);
/*
函数å<C2B0><C3A5>称:smart_enable_q_nempty
输入å<C2A5>æ•°: queid
返回值: �
*/
extern void smart_enable_q_nempty(int queid);
/********************************
函数å<C2B0><C3A5>称:smart_disable_q_nempty
输入å<C2A5>æ•°: queid
返回值: �
函数功能:使能é<C2BD>žç©ºä¸­æ?
************************************/
extern void smart_disable_q_nempty(int queid);
/*
函数å<C2B0><C3A5>称:smart_que_bind
输入å<C2A5>æ•°: queid
输入å<C2A5>æ•°ï¼cpuid
è¿”åžç±»åžï¼šint
返回å€? ï¼? é<>?0 表示失败
返回值: 0 表示æˆ<C3A6>功
函数功能:去使能é<C2BD>žç©ºä¸­æ­
*/
extern int smart_que_bind(int cpuid,int queid);
/*
函数å<C2B0><C3A5>称:smart_hq_debug_init
输入å<C2A5>æ•°: debug_base_addr
输入å<C2A5>æ•°ï¼len_bytes
è¿”åžç±»åžï¼šint
返回å€? ï¼? é<>?0 表示失败
è¿”åžå€¼ï¼š0 表示æˆ<C3A6>功
函数功能:调试åˆ<C3A5>å§åŒæŽ¥å<C2A5>£
注æ„<C3A6>ï¼?
通过地å<C2B0>€ä¸Žï¼Œé•¿åº¦æŒ‡å®šç¸åº”çš„buf æ•°æ<C2B0>®ç©ºé—´ï¼Œå­˜æ”¾ç¸åº”的中æ­è°ƒè¯•ä¿¡æ<C2A1>¯ã€?
è¿™äºè°ƒè¯•ä¿¡æ<C2A1>¯å·²ç»<C3A7>æ ¼å¼<C3A5>åŒï¼Œåœ°å<C2B0>€ç”±ç”¨æˆ·æŒ‡å®šï¼Œlen_bytes ä¸<C3A4>能å°<C3A5>于sizeof(hwq_debug_t)
æ•°æ<C2B0>®æ ¼å¼<C3A5>åŒå†…容是 hwq_debug_t
æ•°æ<C2B0>®æ ¼å¼<C3A5> example:
typedef struct{
unsigned int out_failed_cnt;
unsigned int in_failed_cnt;
unsigned int out_success_cnt;
unsigned int in_success_cnt;
unsigned int cur_que_depth;
unsigned int bind_cpuid;
}hwq_db_info ;
typedef struct{
hwq_db_info per_hwq[HW_QUE_NR];
}hwq_debug_t;
*/
extern int smart_hq_debug_init( uint32_t debug_base_addr, uint32_t len_bytes);
/*
函数å<C2B0><C3A5>称:smart_get_inque_ok_cnt
输入å<C2A5>æ•°: queid
è¿”åžç±»åžï¼šint
返回å€? ï¼? å°<C3A5>于等于0表示失败
函数功能:获å<C2B7>当å‰<C3A5>入队æˆ<C3A6>功计æ•?
*/
extern int smart_get_inque_ok_cnt(int queid);
/*
函数å<C2B0><C3A5>称:smart_get_inque_failed_cnt
输入å<C2A5>æ•°: queid
è¿”åžç±»åžï¼šint
返回å€? ï¼? å°<C3A5>于等于0表示失败
函数功能:获å<C2B7>当å‰<C3A5>入队失败计æ•?
*/
extern int smart_get_inque_failed_cnt(int queid);
/*
函数å<C2B0><C3A5>称:smart_get_outque_ok_cnt
输入å<C2A5>æ•°: queid
è¿”åžç±»åžï¼šint
返回å€? ï¼? å°<C3A5>于等于0表示失败
函数功能:获å<C2B7>当å‰<C3A5>出队æˆ<C3A6>功计æ•?
*/
extern int smart_get_outque_ok_cnt(int queid);
/*
函数å<C2B0><C3A5>称:smart_get_outque_failed_cnt
输入å<C2A5>æ•°: queid
è¿”åžç±»åžï¼šint
返回å€? ï¼? å°<C3A5>于等于0表示失败
函数功能:获å<C2B7>当å‰<C3A5>出队失败计æ•?
*/
extern int smart_get_outque_failed_cnt(int queid);
#endif