Merge branch 'dev_ck_v2.1_feature#1250#' into 'dev_ck_v2.1'
update feature#1250 Support hearbeat function See merge request ucp/driver/ucp4008_platform_spu!55
This commit is contained in:
commit
3cdc3e5df8
@ -17,9 +17,9 @@
|
||||
|
||||
//#include "typedef.h"
|
||||
|
||||
#define HEARTBEAT_ENABLE
|
||||
|
||||
void heart_beat_write(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
@ -15,58 +15,58 @@
|
||||
#include "typedef.h"
|
||||
#include "ucp_handshake.h"
|
||||
#include "ucp_utility.h"
|
||||
#include "ucp_heartbeat.h"
|
||||
//#include "ucp_printf.h"
|
||||
|
||||
#define HEART_BEAT_CNT_THRESHOLD 500000
|
||||
#define HEART_BEAT_CNT_THRESHOLD (500000)
|
||||
|
||||
static uint32_t gLocalHeartBeatCounter = 0;
|
||||
|
||||
static inline void init_heart_beat_cnt_local(void)
|
||||
{
|
||||
gLocalHeartBeatCounter = 0;
|
||||
return;
|
||||
gLocalHeartBeatCounter = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
static inline void inc_heart_beat_cnt_local(void)
|
||||
{
|
||||
gLocalHeartBeatCounter += 1;
|
||||
return;
|
||||
gLocalHeartBeatCounter += 1;
|
||||
return;
|
||||
}
|
||||
|
||||
static inline uint32_t get_heart_beat_cnt_local(void)
|
||||
{
|
||||
return gLocalHeartBeatCounter;
|
||||
return gLocalHeartBeatCounter;
|
||||
}
|
||||
|
||||
static inline void inc_heart_beat_cnt_sm(uint32_t core_id)
|
||||
{
|
||||
#ifdef HEARTBEAT_ENABLE
|
||||
UcpHandshake_t* pHandshake = (UcpHandshake_t *)get_handshake_info();
|
||||
//uint32_t core_id = get_core_id();
|
||||
uint32_t heartBeatShareMem = do_read_volatile(&pHandshake->heartbeat[core_id]);
|
||||
heartBeatShareMem++;
|
||||
do_write(&pHandshake->heartbeat[core_id], heartBeatShareMem);
|
||||
#endif
|
||||
return;
|
||||
UcpHandshake_t* pHandshake = (UcpHandshake_t *)get_handshake_info();
|
||||
//uint32_t core_id = get_core_id();
|
||||
uint32_t heartBeatShareMem = do_read_volatile(&pHandshake->heartbeat[core_id]);
|
||||
heartBeatShareMem++;
|
||||
do_write(&pHandshake->heartbeat[core_id], heartBeatShareMem);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
void heart_beat_write(void)
|
||||
{
|
||||
uint32_t heartBeatLocal = 0;
|
||||
uint32_t core_id = get_core_id();
|
||||
|
||||
if (core_id >= PET_RFM_SPU0_CORE_ID) {//RFM
|
||||
inc_heart_beat_cnt_local();
|
||||
heartBeatLocal = get_heart_beat_cnt_local();
|
||||
if (heartBeatLocal >= HEART_BEAT_CNT_THRESHOLD) {
|
||||
inc_heart_beat_cnt_sm(core_id);
|
||||
init_heart_beat_cnt_local();
|
||||
}
|
||||
} else{//APE
|
||||
inc_heart_beat_cnt_sm(core_id);
|
||||
}
|
||||
|
||||
return;
|
||||
uint32_t heartBeatLocal = 0;
|
||||
uint32_t core_id = get_core_id();
|
||||
|
||||
if (core_id >= PET_RFM_SPU0_CORE_ID) {//RFM
|
||||
inc_heart_beat_cnt_local();
|
||||
heartBeatLocal = get_heart_beat_cnt_local();
|
||||
if (heartBeatLocal >= HEART_BEAT_CNT_THRESHOLD) {
|
||||
inc_heart_beat_cnt_sm(core_id);
|
||||
init_heart_beat_cnt_local();
|
||||
}
|
||||
} else{//APE
|
||||
inc_heart_beat_cnt_sm(core_id);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "ecpri_queue_proc.h"
|
||||
#include "ecpri_csu.h"
|
||||
#include "lib_debug_init.h"
|
||||
|
||||
#include "ucp_heartbeat.h"
|
||||
|
||||
int32_t main(int32_t argc, char* argv[])
|
||||
{
|
||||
@ -61,6 +61,9 @@ int32_t main(int32_t argc, char* argv[])
|
||||
do_write(ECPRI_DBG_BUF_ADDR + 0x0C, 0x00);
|
||||
}
|
||||
}
|
||||
|
||||
/* update heartbeat count */
|
||||
heart_beat_write();
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -99,7 +99,7 @@ int32_t main(int32_t argc, char* argv[])
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (PROTOCOL_CPRI == get_protocol_sel())
|
||||
if (PROTOCOL_CPRI == get_protocol_sel())
|
||||
{
|
||||
check_cpri();
|
||||
|
||||
@ -115,7 +115,13 @@ int32_t main(int32_t argc, char* argv[])
|
||||
phy_queue_polling();
|
||||
|
||||
spu_log_server_proc();
|
||||
|
||||
/* check whether shell commands exist */
|
||||
spu_shell_task();
|
||||
|
||||
/* update heartbeat count */
|
||||
heart_beat_write();
|
||||
|
||||
#ifdef DDR_MONITOR
|
||||
spu_ddr_monitor();
|
||||
#endif
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "msg_transfer_queue.h"
|
||||
#include "log_client.h"
|
||||
#include "ucp_utility.h"
|
||||
#include "ucp_heartbeat.h"
|
||||
#include "spu_shell.h"
|
||||
#include "pet_rfm_spu1_oam.h"
|
||||
#include "hwque.h"
|
||||
@ -49,9 +50,10 @@ int32_t main(int32_t argc, char* argv[])
|
||||
//spu_shell_task();
|
||||
//msg_transfer_queue_recfg();
|
||||
//heart_beat_write();
|
||||
/* update heartbeat count */
|
||||
heart_beat_write();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user