1.耗时统计单位更换为ns,first_sync结果和IDE对齐,耗时约2.5ms一次 3.删除不需要的.dat文件,新增用于recv sync debug的宏RECV_DBG_DATA_TEST 4.(遗留问题Transmitter核死)
This commit is contained in:
parent
b94a4cff53
commit
0ea3c06767
@ -7,7 +7,7 @@ __APE_DM0 uint32_t g_slot_ind_dm0[8] = {0}; //32byte
|
||||
void Slot_ind_Task()
|
||||
{
|
||||
uint16_t start_slot = TIME_SLOT();
|
||||
g_time_start[0] = TIME_US();
|
||||
g_time_start[0] = TIME_NS();
|
||||
RUN_CNT(TRACE_SLOTIND_ADDR, 0);
|
||||
|
||||
|
||||
|
@ -39,6 +39,8 @@ void ape4_event_task(uint32_t addr, uint32_t size)
|
||||
TRACE(TRACE_RECV_INIT_ADDR, 2, 1);
|
||||
|
||||
osp_task_create(&mgr_task2);
|
||||
test_case_cfgpar_pcie();
|
||||
|
||||
osp_task_create(&pcie_normal_task_info);
|
||||
TRACE(TRACE_RECV_INIT_ADDR, 3, 1);
|
||||
LOG_INFO_S("APE4 finish task create!\n");
|
||||
@ -69,8 +71,7 @@ void Phy_Task_Ape4_Reg()
|
||||
osp_task_info_ex ape4_event_task_info = {50, "ape4_event_task1", 50, 2048, OSP_EVENT_TYPE, 0, 0, 0, NULL, (OSP_TASKENTRY_FUNC)ape4_event_task};
|
||||
osp_task_info_ex ape4_event_task_info_del = {51, "ape4_event_task_del1", 51, 2048, OSP_EVENT_TYPE, 0, 0, 0, NULL, (OSP_TASKENTRY_FUNC)ape4_event_task_del};
|
||||
|
||||
//test_case_cfgpar_pcie();
|
||||
|
||||
|
||||
|
||||
osp_task_create(&ape4_event_task_info);
|
||||
osp_task_create(&ape4_event_task_info_del);
|
||||
|
@ -475,8 +475,8 @@ void test_speed_recv_msg_pcie()
|
||||
|
||||
void pcie_test_task_func(void)
|
||||
{
|
||||
return ;
|
||||
g_time_start[1] = TIME_US();
|
||||
// return ;
|
||||
g_time_start[1] = TIME_NS();
|
||||
RUN_CNT(TRACE_PCIE_ADDR, 0);
|
||||
//uint32_t clockTick = 0;
|
||||
// uint32_t clockOffset = 0;
|
||||
|
@ -62,26 +62,50 @@ void Receiver_Bit_Init()
|
||||
ret = osp_get_cfgfile("Receiver_Bit_cfg_dm0.dat",
|
||||
(uint32_t *)&(g_receiver_bit_table_param.receiver_bit_config0_ddr_ptr),
|
||||
(int32_t *)&(g_receiver_bit_table_param.receiver_bit_config0_length));
|
||||
if(-1 == ret)
|
||||
{
|
||||
LOG_ERROR_S("Receiver_Bit_cfg_dm0.dat not found!\n");
|
||||
}
|
||||
ret = osp_get_cfgfile("Receiver_Bit_cfg_dm1.dat",
|
||||
(uint32_t *)&(g_receiver_bit_table_param.receiver_bit_config1_ddr_ptr),
|
||||
(int32_t *)&(g_receiver_bit_table_param.receiver_bit_config1_length));
|
||||
if(-1 == ret)
|
||||
{
|
||||
LOG_ERROR_S("Receiver_Bit_cfg_dm1.dat not found!\n");
|
||||
}
|
||||
ret = osp_get_cfgfile("Receiver_Bit_cfg_dm2.dat",
|
||||
(uint32_t *)&(g_receiver_bit_table_param.receiver_bit_config2_ddr_ptr),
|
||||
(int32_t *)&(g_receiver_bit_table_param.receiver_bit_config2_length));
|
||||
if(-1 == ret)
|
||||
{
|
||||
LOG_ERROR_S("Receiver_Bit_cfg_dm2.dat not found!\n");
|
||||
}
|
||||
ret = osp_get_cfgfile("Receiver_Bit_cfg_dm3.dat",
|
||||
(uint32_t *)&(g_receiver_bit_table_param.receiver_bit_config3_ddr_ptr),
|
||||
(int32_t *)&(g_receiver_bit_table_param.receiver_bit_config3_length));
|
||||
if(-1 == ret)
|
||||
{
|
||||
LOG_ERROR_S("Receiver_Bit_cfg_dm3.dat not found!\n");
|
||||
}
|
||||
//10.输入测试数据
|
||||
uint32_t timedata_ptr;
|
||||
int32_t timedata_len;
|
||||
ret = osp_get_cfgfile("timedata.dat",
|
||||
(uint32_t *)&(timedata_ptr),
|
||||
(int32_t *)&(timedata_len));
|
||||
if(-1 == ret)
|
||||
{
|
||||
LOG_ERROR_S("timedata.dat not found!\n");
|
||||
}
|
||||
uint32_t gain_mmse_test_ptr;
|
||||
int32_t gain_mmse_test_len;
|
||||
ret = osp_get_cfgfile("gain_test.dat",
|
||||
(uint32_t *)&(gain_mmse_test_ptr),
|
||||
(int32_t *)&(gain_mmse_test_len));
|
||||
if(-1 == ret)
|
||||
{
|
||||
LOG_ERROR_S("gain_test.dat not found!\n");
|
||||
}
|
||||
int* param_ptr = (int *)RECEIVER_BIT_CFG_BASE;
|
||||
STORE_EX_W(param_ptr, timedata_ptr);
|
||||
STORE_EX_W((param_ptr+1), timedata_len);
|
||||
|
@ -21,7 +21,7 @@
|
||||
*/
|
||||
void Receiver_Bit_Task(void* msg_ptr, uint32_t msg_len)
|
||||
{
|
||||
g_time_start[0] = TIME_US();
|
||||
g_time_start[0] = TIME_NS();
|
||||
RUN_CNT(TRACE_RECEIVER_BIT_ADDR, 0);
|
||||
|
||||
|
||||
|
@ -38,14 +38,29 @@ void Receiver_Symb_Init()
|
||||
ret = osp_get_cfgfile("Receiver_Symb_cfg_dm0.dat",
|
||||
(uint32_t *)&(g_receiver_symb_table_param.receiver_symb_config0_ddr_ptr),
|
||||
(int32_t *)&(g_receiver_symb_table_param.receiver_symb_config0_length));
|
||||
if(-1 == ret)
|
||||
{
|
||||
LOG_ERROR_S("Receiver_Symb_cfg_dm0.dat not found!\n");
|
||||
}
|
||||
ret = osp_get_cfgfile("Receiver_Symb_cfg_dm1.dat",
|
||||
(uint32_t *)&(g_receiver_symb_table_param.receiver_symb_config1_ddr_ptr),
|
||||
(int32_t *)&(g_receiver_symb_table_param.receiver_symb_config1_length));
|
||||
|
||||
if(-1 == ret)
|
||||
{
|
||||
LOG_ERROR_S("Receiver_Symb_cfg_dm1.dat not found!\n");
|
||||
}
|
||||
ret = osp_get_cfgfile("Receiver_Symb_cfg_dm2.dat",
|
||||
(uint32_t *)&(g_receiver_symb_table_param.receiver_symb_config2_ddr_ptr),
|
||||
(int32_t *)&(g_receiver_symb_table_param.receiver_symb_config2_length));
|
||||
if(-1 == ret)
|
||||
{
|
||||
LOG_ERROR_S("Receiver_Symb_cfg_dm2.dat not found!\n");
|
||||
}
|
||||
ret = osp_get_cfgfile("Receiver_Symb_cfg_dm3.dat",
|
||||
(uint32_t *)&(g_receiver_symb_table_param.receiver_symb_config3_ddr_ptr),
|
||||
(int32_t *)&(g_receiver_symb_table_param.receiver_symb_config3_length));
|
||||
if(-1 == ret)
|
||||
{
|
||||
LOG_ERROR_S("Receiver_Symb_cfg_dm3.dat not found!\n");
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ void Receiver_Symb_Proc(
|
||||
|
||||
uint32_t cur_sfn = get_rx_nr_sfn();
|
||||
uint32_t cur_slot = get_rx_nr_slot();
|
||||
uint32_t cur_time = TIME_US();
|
||||
uint32_t cur_time = TIME_NS();
|
||||
// LOG_ERROR_S("%d %d %d %d %d %d %d 0x%08x 0x%08x %d %d\n", cur_sfn, cur_slot, cur_time, para_dm_ptr->sfn, para_dm_ptr->slot, para_dm_ptr->num_data_section,
|
||||
// para_dm_ptr->proc_id, para_dm_ptr->data_section0_ptr, para_dm_ptr->data_section1_ptr, para_dm_ptr->data_section0_length, para_dm_ptr->data_section1_length);
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
void Receiver_Symb_Task(receiver_sync2symb_t* msg_ptr, uint32_t msg_len)
|
||||
{
|
||||
uint16_t start_slot = TIME_SLOT();
|
||||
g_time_start[0] = TIME_US();
|
||||
g_time_start[0] = TIME_NS();
|
||||
RUN_CNT(TRACE_RECEIVER_SYMB_ADDR, 0);
|
||||
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
*****************************************************************/
|
||||
#include "receiver_sync_func.h"
|
||||
#include "mem_def.h"
|
||||
|
||||
|
||||
/*!
|
||||
@ -56,6 +57,11 @@ void Receiver_Sync_Init()
|
||||
ret = osp_get_cfgfile("Receiver_Sync_cfg_dm0.dat",
|
||||
(uint32_t *)&(g_receiver_sync_table_param.receiver_sync_config0_ddr_ptr),
|
||||
(int32_t *)&(g_receiver_sync_table_param.receiver_sync_config0_length));
|
||||
|
||||
if(-1 == ret)
|
||||
{
|
||||
LOG_ERROR_S("Receiver_Sync_cfg_dm0.dat not found!\n");
|
||||
}
|
||||
// ret = osp_get_cfgfile("Receiver_Sync_cfg_dm1.dat",
|
||||
// (uint32_t *)&(g_receiver_sync_table_param.receiver_sync_config1_ddr_ptr),
|
||||
// (int32_t *)&(g_receiver_sync_table_param.receiver_sync_config1_length));
|
||||
@ -70,9 +76,11 @@ void Receiver_Sync_Init()
|
||||
// LOG_ERROR_S("init %d 0x%08x %d\n", ret, g_receiver_sync_table_param.receiver_sync_config0_ddr_ptr, g_receiver_sync_table_param.receiver_sync_config0_length);
|
||||
//状态机初始化
|
||||
g_receiver_sync_status_SM_ptr = (uint32_t)RECEIVER_SYNC2SYNC_FIRST_INF_ADDR;
|
||||
|
||||
STORE_EX_W(&g_receiver_sync_status_SM_ptr->sync_status, SYNC_IDLE);
|
||||
STORE_EX_W(&g_receiver_sync_status_SM_ptr->cylic_buffer_proc_data_offset, -1);
|
||||
STORE_EX_W(&g_receiver_sync_status_SM_ptr->cylic_buffer_data_len, 0);
|
||||
STORE_EX_W(&g_receiver_sync_status_SM_ptr->frame_head_offset, 0);
|
||||
|
||||
//sync2symb buffer地址初始化
|
||||
sync2symb_data_buffer[0] = RECEIVER_SYNC2SYMB_BUFFER0_ADDR;
|
||||
@ -82,5 +90,26 @@ void Receiver_Sync_Init()
|
||||
|
||||
g_proc_id = 0;
|
||||
|
||||
|
||||
#ifdef RECV_DBG_DATA_TEST
|
||||
uint32_t dbg_addr,dbg_len;
|
||||
ret = osp_get_cfgfile("Receiver_Sync_test.dat",
|
||||
(uint32_t *)&(dbg_addr),
|
||||
(int32_t *)&(dbg_len));
|
||||
|
||||
if(-1 == ret)
|
||||
{
|
||||
LOG_ERROR_S("Receiver_Sync_test.dat not found!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR_S("INIT DBG DDR 0x%08x %d\n",dbg_addr,dbg_len);
|
||||
|
||||
ape_csu_dma_1D_G2L_ch2ch3_transfer((uint64_t)(dbg_addr),
|
||||
(uint64_t)JESD_NRFDD_RX_SLOT_EVEN_DATA_ADDR,//第一次固定搬移到dm0
|
||||
dbg_len,
|
||||
DMA_TAG_G2G,
|
||||
1);
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
@ -187,6 +187,7 @@ void Receiver_Sync_Proc(
|
||||
{
|
||||
TRACE(TRACE_RECEIVER_SYNC_ADDR, 3, 3);
|
||||
STORE_EX_W(&g_receiver_sync_status_SM_ptr->sync_status ,SYNC_FIRST_RUNING);
|
||||
__ucps2_synch(0);
|
||||
receiver_sync2first_sync_t temp_msg;
|
||||
temp_msg.sfn = cur_sfn;
|
||||
temp_msg.slot = cur_slot;
|
||||
@ -235,7 +236,7 @@ void Receiver_Fine_Sync_Proc(uint32_t sfn, uint32_t slot)
|
||||
{
|
||||
//DBG
|
||||
return ;
|
||||
g_time_start[0] = TIME_US();
|
||||
g_time_start[2] = TIME_NS();
|
||||
uint16_t dbg_time0, dbg_time1;
|
||||
RUN_CNT(TRACE_RECEIVER_SYNC_FINE_ADDR, 0);
|
||||
|
||||
@ -275,6 +276,8 @@ void Receiver_Fine_Sync_Proc(uint32_t sfn, uint32_t slot)
|
||||
ape_csu_task_lookup(DMA_TAG_G2L, 1);
|
||||
//取数方式,同步点为中心,前16,后15,相关长度1024
|
||||
frame_head_offset = LOAD_EX_W(&g_receiver_sync_status_SM_ptr->frame_head_offset);
|
||||
LOG_ERROR_S("frame_head_offset=%d\n", frame_head_offset );
|
||||
|
||||
if(16 > frame_head_offset)
|
||||
{
|
||||
//上个buffer尾
|
||||
@ -286,7 +289,7 @@ void Receiver_Fine_Sync_Proc(uint32_t sfn, uint32_t slot)
|
||||
DMA_TAG_G2L,
|
||||
0);
|
||||
|
||||
// LOG_ERROR_S("csu1:%d %d\n", (16 - frame_head_offset)<<2 , (1055 - (16 - frame_head_offset) )<<2 );
|
||||
LOG_ERROR_S("csu1:%d %d\n", (16 - frame_head_offset)<<2 , (1055 - (16 - frame_head_offset) )<<2 );
|
||||
}
|
||||
else if(61440 - (15 + 1024) < frame_head_offset)
|
||||
{
|
||||
@ -299,7 +302,7 @@ void Receiver_Fine_Sync_Proc(uint32_t sfn, uint32_t slot)
|
||||
//下个buffer头 等待保证数据被jesd_csu存入
|
||||
while(time1 - time0 < 10)
|
||||
{
|
||||
time1 = TIME_US();
|
||||
time1 = TIME_NS();
|
||||
}
|
||||
ape_csu_dma_1D_G2L_ch2ch3_transfer((uint64_t)(src_addr1),
|
||||
(uint64_t)DM_TO_CSU_ADDR(receiver_sync_temp_dm0_ptr + (61440 - (frame_head_offset -16) ) ),
|
||||
@ -307,7 +310,7 @@ void Receiver_Fine_Sync_Proc(uint32_t sfn, uint32_t slot)
|
||||
DMA_TAG_G2L,
|
||||
0);
|
||||
|
||||
// LOG_ERROR_S("csu2:%d %d\n", ((61440 - (frame_head_offset -16)) )<<2 , (1055 - (61440 - (frame_head_offset -16)) )<<2 );
|
||||
LOG_ERROR_S("csu2:%d %d\n", ((61440 - (frame_head_offset -16)) )<<2 , (1055 - (61440 - (frame_head_offset -16)) )<<2 );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -318,7 +321,7 @@ void Receiver_Fine_Sync_Proc(uint32_t sfn, uint32_t slot)
|
||||
DMA_TAG_G2L,
|
||||
0);
|
||||
|
||||
// LOG_ERROR_S("csu3:0x%08x 0x%08x\n", (src_addr0 + ((frame_head_offset -16) <<2) ) , receiver_sync_temp_dm0_ptr );
|
||||
LOG_ERROR_S("csu3:0x%08x 0x%08x\n", (src_addr0 + ((frame_head_offset -16) <<2) ) , receiver_sync_temp_dm0_ptr );
|
||||
}
|
||||
|
||||
//复制数据DM0 -> DM1
|
||||
@ -474,6 +477,6 @@ void Receiver_Fine_Sync_Proc(uint32_t sfn, uint32_t slot)
|
||||
Receiver_Sync_Memory_Free();
|
||||
|
||||
RUN_CNT(TRACE_RECEIVER_SYNC_FINE_ADDR, 1);
|
||||
TRACE_MAX(TRACE_RECEIVER_SYNC_FINE_ADDR, 2, Time_offset(0) );
|
||||
TRACE_MAX(TRACE_RECEIVER_SYNC_FINE_ADDR, 2, Time_offset(2) );
|
||||
return;
|
||||
}
|
@ -21,8 +21,7 @@
|
||||
*/
|
||||
void Receiver_Sync_Task()
|
||||
{
|
||||
uint16_t start_slot = TIME_SLOT();
|
||||
uint16_t start_us = TIME_US();
|
||||
g_time_start[0] = TIME_NS();
|
||||
uint16_t end_slot;
|
||||
uint16_t end_us;
|
||||
RUN_CNT(TRACE_RECEIVER_SYNC_ADDR, 0);
|
||||
@ -35,8 +34,8 @@ void Receiver_Sync_Task()
|
||||
TRACE(TRACE_RECEIVER_SYNC_ADDR, 3, 100);
|
||||
RUN_CNT(TRACE_RECEIVER_SYNC_ADDR, 1);
|
||||
end_slot = TIME_SLOT();
|
||||
end_us = TIME_US();
|
||||
TRACE_MAX(TRACE_RECEIVER_SYNC_ADDR, 2, TIME_DIFF(start_slot, start_us, end_slot, end_us) );
|
||||
end_us = TIME_NS();
|
||||
TRACE_MAX(TRACE_RECEIVER_SYNC_ADDR, 2, Time_offset(0) );
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -58,6 +58,10 @@ void Receiver_Sync_First_Init()
|
||||
ret = osp_get_cfgfile("Receiver_Sync_First_cfg_dm0.dat",
|
||||
(uint32_t *)&(g_receiver_sync_first_table_param.receiver_sync_first_config0_ddr_ptr),
|
||||
(int32_t *)&(g_receiver_sync_first_table_param.receiver_sync_first_config0_length));
|
||||
if(-1 == ret)
|
||||
{
|
||||
LOG_ERROR_S("Receiver_Sync_First_cfg_dm0.dat not found!\n");
|
||||
}
|
||||
// ret = osp_get_cfgfile("Receiver_Sync_First_cfg_dm1.dat",
|
||||
// (uint32_t *)&(g_receiver_sync_first_table_param.receiver_sync_config1_ddr_ptr),
|
||||
// (int32_t *)&(g_receiver_sync_first_table_param.receiver_sync_config1_length));
|
||||
|
@ -162,7 +162,7 @@ void Receiver_Sync_First_Memory_Free( )
|
||||
void Receiver_First_Sync_Proc(receiver_sync2first_sync_t* msg_ptr, uint32_t msg_len)
|
||||
{
|
||||
|
||||
g_time_start[0] = TIME_US();
|
||||
g_time_start[0] = TIME_NS();
|
||||
RUN_CNT(TRACE_RECEIVER_SYNC_FIRST_ADDR, 0);
|
||||
|
||||
const uint32_t loop_num = 1;
|
||||
@ -173,8 +173,7 @@ void Receiver_First_Sync_Proc(receiver_sync2first_sync_t* msg_ptr, uint32_t msg_
|
||||
const uint32_t sample_per_tti = 61440;//每个500us采样点数
|
||||
const uint32_t addition_sample = 1024;//额外样点
|
||||
uint32_t total_nsample = sample_per_tti + addition_sample;
|
||||
uint32_t sample_per_csu = (total_nsample >> 1);
|
||||
uint32_t nsample_per_section = total_nsample / loop_num;
|
||||
uint32_t sample_per_csu = (total_nsample >> 1);//分两次处理
|
||||
int32_t *cfg_addr;// 配置地址指针
|
||||
uint32_t maxPosition = 0;
|
||||
uint32_t maxsum;
|
||||
@ -189,6 +188,7 @@ void Receiver_First_Sync_Proc(receiver_sync2first_sync_t* msg_ptr, uint32_t msg_
|
||||
dbg_time0 = Time_offset(0);
|
||||
uint32_t src_addr0;
|
||||
uint32_t src_addr1;
|
||||
#ifndef RECV_DBG_DATA_TEST
|
||||
if( 1 == (slot & 0x01) )
|
||||
{
|
||||
src_addr0 = (uint32_t)JESD_NRFDD_RX_SLOT_EVEN_DATA_ADDR;
|
||||
@ -199,31 +199,34 @@ void Receiver_First_Sync_Proc(receiver_sync2first_sync_t* msg_ptr, uint32_t msg_
|
||||
src_addr0 = (uint32_t)JESD_NRFDD_RX_SLOT_ODD_DATA_ADDR;
|
||||
src_addr1 = (uint32_t)JESD_NRFDD_RX_SLOT_EVEN_DATA_ADDR;
|
||||
}
|
||||
#else
|
||||
src_addr0 = (uint32_t)JESD_NRFDD_RX_SLOT_EVEN_DATA_ADDR;
|
||||
src_addr1 = (uint32_t)JESD_NRFDD_RX_SLOT_ODD_DATA_ADDR;
|
||||
#endif
|
||||
|
||||
ape_csu_dma_1D_G2L_ch0ch1_transfer((uint64_t)(src_addr0),
|
||||
(uint64_t)JESD_NRFDD_RX_SLOT_SRC0_DATA_ADDR,//第一次固定搬移到dm0
|
||||
(61440)<<2,
|
||||
DMA_TAG_G2G,
|
||||
1);
|
||||
ape_csu_dma_1D_G2L_ch0ch1_transfer((uint64_t)(src_addr1),
|
||||
0);
|
||||
ape_csu_dma_1D_G2L_ch2ch3_transfer((uint64_t)(src_addr1),
|
||||
(uint64_t)JESD_NRFDD_RX_SLOT_SRC1_DATA_ADDR,//第一次固定搬移到dm0
|
||||
(2048)<<2,
|
||||
DMA_TAG_G2G,
|
||||
1);
|
||||
|
||||
TRACE(TRACE_RECEIVER_SYNC_FIRST_ADDR, 3, 2);
|
||||
src_addr0 = (uint32_t)JESD_NRFDD_RX_SLOT_SRC0_DATA_ADDR;
|
||||
src_addr1 = (uint32_t)JESD_NRFDD_RX_SLOT_SRC1_DATA_ADDR;
|
||||
|
||||
|
||||
//搬移PART1数据
|
||||
//搬移数据
|
||||
ape_csu_dma_1D_G2L_ch0ch1_transfer((uint64_t)(src_addr0),
|
||||
(uint64_t)DM_TO_CSU_ADDR(receiver_sync_first_temp_dm0_ptr),//第一次固定搬移到dm0
|
||||
(sample_per_csu + 1024)<<2,
|
||||
DMA_TAG_G2L,
|
||||
1);
|
||||
0);
|
||||
|
||||
|
||||
TRACE(TRACE_RECEIVER_SYNC_FIRST_ADDR, 3, 2);
|
||||
|
||||
|
||||
cfg_addr = (int32_t *)receiver_sync_first_config_dm0_ptr + g_receiver_sync_first_table_param.ConfigByteCopy_CFG1_Offset;
|
||||
@ -242,27 +245,17 @@ void Receiver_First_Sync_Proc(receiver_sync2first_sync_t* msg_ptr, uint32_t msg_
|
||||
MPU_ADDR(receiver_sync_first_temp_dm1_ptr),
|
||||
((sample_per_csu)<<2));
|
||||
|
||||
|
||||
WAIT_MPU_STOP;
|
||||
ape_csu_task_lookup(DMA_TAG_G2L, 1);
|
||||
|
||||
dbg_time1 = Time_offset(0);
|
||||
TRACE_MAX(TRACE_RECEIVER_SYNC_FIRST_ADDR, 4, dbg_time1-dbg_time0 );
|
||||
dbg_time0 = dbg_time1;
|
||||
TRACE(TRACE_RECEIVER_SYNC_FIRST_ADDR, 3, 3);
|
||||
SVRReg[0] = MPU_ADDR(cfg_addr);
|
||||
ByteCopyAsm(SVRReg);
|
||||
|
||||
|
||||
|
||||
//Debug:
|
||||
// LOG_ERROR_S("0x%08x 0x%08x 0x%08x 0x%08x 0x%08x\n", cfg_addr, receiver_sync_first_temp_dm0_ptr, receiver_sync_first_temp_dm1_ptr, receiver_sync_first_temp_dm2_ptr,
|
||||
// receiver_sync_first_temp_dm3_ptr);
|
||||
|
||||
WAIT_MPU_STOP;
|
||||
|
||||
dbg_time1 = Time_offset(0);
|
||||
TRACE_MAX(TRACE_RECEIVER_SYNC_FIRST_ADDR, 5, dbg_time1-dbg_time0 );
|
||||
dbg_time0 = dbg_time1;
|
||||
// dm_check(0);
|
||||
|
||||
cfg_addr = (int32_t *)receiver_sync_first_config_dm0_ptr + g_receiver_sync_first_table_param.ConfigSlidingCorrelation_CFG2_Offset;
|
||||
@ -281,19 +274,18 @@ void Receiver_First_Sync_Proc(receiver_sync2first_sync_t* msg_ptr, uint32_t msg_
|
||||
MPU_ADDR(receiver_sync_first_temp_dm2_ptr),
|
||||
MPU_ADDR(receiver_sync_first_temp_dm3_ptr));
|
||||
|
||||
|
||||
WAIT_MPU_STOP;
|
||||
TRACE(TRACE_RECEIVER_SYNC_FIRST_ADDR, 3, 4);
|
||||
SVRReg[0] = MPU_ADDR(cfg_addr);
|
||||
SlidingCorrelationAsm(SVRReg);
|
||||
|
||||
|
||||
WAIT_MPU_STOP;
|
||||
dbg_time1 = Time_offset(0);
|
||||
TRACE_MAX(TRACE_RECEIVER_SYNC_FIRST_ADDR, 6, dbg_time1-dbg_time0 );
|
||||
dbg_time0 = dbg_time1;
|
||||
TRACE(TRACE_RECEIVER_SYNC_FIRST_ADDR, 3, 5);
|
||||
//dm_check(1);
|
||||
maxPosition = receiver_sync_first_temp_dm3_ptr[0];
|
||||
maxsum = receiver_sync_first_temp_dm3_ptr[1];
|
||||
LOG_ERROR_S("1 maxPosition:%d maxsum:%d\n",maxPosition, maxsum);
|
||||
|
||||
ape_csu_dma_1D_G2L_ch0ch1_transfer((uint64_t)(src_addr0 + (sample_per_csu<<2)),
|
||||
(uint64_t)DM_TO_CSU_ADDR(receiver_sync_first_temp_dm0_ptr),//
|
||||
@ -305,14 +297,8 @@ void Receiver_First_Sync_Proc(receiver_sync2first_sync_t* msg_ptr, uint32_t msg_
|
||||
(2048)<<2,
|
||||
DMA_TAG_G2L,
|
||||
0);
|
||||
ape_csu_task_lookup(DMA_TAG_G2L, 1);
|
||||
|
||||
dbg_time1 = Time_offset(0);
|
||||
TRACE_MAX(TRACE_RECEIVER_SYNC_FIRST_ADDR, 7, dbg_time1-dbg_time0 );
|
||||
dbg_time0 = dbg_time1;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
cfg_addr = (int32_t *)receiver_sync_first_config_dm0_ptr + g_receiver_sync_first_table_param.ConfigByteCopy_CFG1_Offset;
|
||||
|
||||
@ -323,8 +309,9 @@ void Receiver_First_Sync_Proc(receiver_sync2first_sync_t* msg_ptr, uint32_t msg_
|
||||
((sample_per_csu)<<2));
|
||||
|
||||
|
||||
|
||||
|
||||
WAIT_MPU_STOP;
|
||||
ape_csu_task_lookup(DMA_TAG_G2L, 1);
|
||||
|
||||
SVRReg[0] = MPU_ADDR(cfg_addr);
|
||||
ByteCopyAsm(SVRReg);
|
||||
|
||||
@ -347,27 +334,21 @@ void Receiver_First_Sync_Proc(receiver_sync2first_sync_t* msg_ptr, uint32_t msg_
|
||||
MPU_ADDR(receiver_sync_first_temp_dm2_ptr),
|
||||
MPU_ADDR(receiver_sync_first_temp_dm3_ptr));
|
||||
WAIT_MPU_STOP;
|
||||
dbg_time1 = Time_offset(0);
|
||||
TRACE_MAX(TRACE_RECEIVER_SYNC_FIRST_ADDR, 8, dbg_time1-dbg_time0 );
|
||||
dbg_time0 = dbg_time1;
|
||||
|
||||
TRACE(TRACE_RECEIVER_SYNC_FIRST_ADDR, 3, 6);
|
||||
//dm_check(2);
|
||||
SVRReg[0] = MPU_ADDR(cfg_addr);
|
||||
SlidingCorrelationSecondAsm(SVRReg);
|
||||
WAIT_MPU_STOP;
|
||||
dbg_time1 = Time_offset(0);
|
||||
TRACE_MAX(TRACE_RECEIVER_SYNC_FIRST_ADDR, 9, dbg_time1-dbg_time0 );
|
||||
dbg_time0 = dbg_time1;
|
||||
|
||||
TRACE(TRACE_RECEIVER_SYNC_FIRST_ADDR, 3, 7);
|
||||
|
||||
LOG_ERROR_S("2 maxPosition:%d maxsum:%d\n",receiver_sync_first_temp_dm3_ptr[0], receiver_sync_first_temp_dm3_ptr[1]);
|
||||
if(maxsum < receiver_sync_first_temp_dm3_ptr[1])
|
||||
{
|
||||
maxPosition = receiver_sync_first_temp_dm3_ptr[0];
|
||||
maxsum = receiver_sync_first_temp_dm3_ptr[1];
|
||||
}
|
||||
|
||||
LOG_ERROR_S("3 maxPosition:%d maxsum:%d\n",maxPosition, maxsum);
|
||||
//dm_check(3);
|
||||
//TODO:后续需要添加门限判断条件
|
||||
uint32_t threshold = 1;
|
||||
@ -382,12 +363,14 @@ void Receiver_First_Sync_Proc(receiver_sync2first_sync_t* msg_ptr, uint32_t msg_
|
||||
if(SYNC_OK == ret)
|
||||
{
|
||||
STORE_EX_W(&g_receiver_sync_status_SM_ptr->sync_status , SYNC_TRACKING);
|
||||
__ucps2_synch(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
STORE_EX_W(&g_receiver_sync_status_SM_ptr->sync_status , SYNC_IDLE);
|
||||
STORE_EX_W(&g_receiver_sync_status_SM_ptr->cylic_buffer_proc_data_offset , -1);
|
||||
STORE_EX_W(&g_receiver_sync_status_SM_ptr->cylic_buffer_data_len, 0);
|
||||
__ucps2_synch(0);
|
||||
}
|
||||
Receiver_Sync_First_Memory_Free();
|
||||
|
||||
|
@ -4,7 +4,7 @@ void Test_Task()
|
||||
{
|
||||
|
||||
uint16_t start_slot = TIME_SLOT();
|
||||
g_time_start[0] = TIME_US();
|
||||
g_time_start[0] = TIME_NS();
|
||||
RUN_CNT(TRACE_TESTTASK_ADDR, 0);
|
||||
|
||||
uint32_t cur_sfn = get_rx_nr_sfn();
|
||||
|
@ -63,11 +63,15 @@ void Transmitter_Init()
|
||||
ret = osp_get_cfgfile("Transmitter_cfg_dm1.dat",
|
||||
(uint32_t *)&(g_transmitter_table_param.transmitter_config1_ddr_ptr),
|
||||
(int32_t *)&(g_transmitter_table_param.transmitter_config1_length));
|
||||
|
||||
if(-1 == ret)
|
||||
{
|
||||
LOG_ERROR_S("Transmitter_cfg_dm1.dat not found!\n");
|
||||
}
|
||||
//ret = osp_get_cfgfile("Transmitter_cfg_dm2.dat",
|
||||
// (uint32_t *)&(g_transmitter_table_param.transmitter_config2_ddr_ptr),
|
||||
// (int32_t *)&(g_transmitter_table_param.transmitter_config2_length));
|
||||
//ret = osp_get_cfgfile("Transmitter_cfg_dm3.dat",
|
||||
// (uint32_t *)&(g_transmitter_table_param.transmitter_config3_ddr_ptr),
|
||||
// (int32_t *)&(g_transmitter_table_param.transmitter_config3_length));
|
||||
LOG_ERROR_S("Transmitter_INIT finish\n");
|
||||
}
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "mem_def.h"
|
||||
|
||||
#include "common.h"
|
||||
#include <malloc.h>
|
||||
#include "log_interface.h"
|
||||
|
||||
#define ADDR_ALIGN(addr, val) ((((uint32_t)(addr) + (2<<(val)) - 1)>>(val))<<(val))
|
||||
@ -25,10 +24,10 @@
|
||||
*/
|
||||
void Transmitter_Task()
|
||||
{
|
||||
|
||||
//时间统计
|
||||
uint16_t start_slot = TIME_SLOT();
|
||||
g_time_start[1] = TIME_US();
|
||||
//!!!DBG
|
||||
return;
|
||||
//时间统计
|
||||
g_time_start[1] = TIME_NS();
|
||||
uint16_t time0_us, time1_us;
|
||||
uint16_t time0_slot, time1_slot;
|
||||
RUN_CNT(TRACE_TRANSMITTER_ADDR, 0);
|
||||
|
@ -12,6 +12,8 @@
|
||||
#ifndef UCP_MEM_DEF_H
|
||||
#define UCP_MEM_DEF_H
|
||||
|
||||
#define RECV_DBG_DATA_TEST
|
||||
|
||||
//!命名宏定义时需要注意UCP使用的地址
|
||||
/*********************************UCP************************************************/
|
||||
#define SM0_BASE (0x09D00000)//1M
|
||||
@ -64,13 +66,20 @@
|
||||
#define DDR_ERROR_RECORD_CNT_ADDR (0x79FF8000)
|
||||
#define DDR_STATE_RECORD_CNT_ADDR (0x79FFc000)
|
||||
|
||||
//
|
||||
//接收端数据来源选择
|
||||
|
||||
#define JESD_NRFDD_TX_SLOT_EVEN_DATA_ADDR (0x60F00000) //0x1E0000
|
||||
#define JESD_NRFDD_TX_SLOT_ODD_DATA_ADDR (0x610E0000) //0x1E0000
|
||||
|
||||
#ifndef RECV_DBG_DATA_TEST
|
||||
#define JESD_NRFDD_RX_SLOT_EVEN_DATA_ADDR (0x6BC00000) //!!!DDR_PHY_BASE 0x1E0000
|
||||
#define JESD_NRFDD_RX_SLOT_ODD_DATA_ADDR (0x6BDE0000) // 0x1E0000
|
||||
#define JESD_NRFDD_RX_SLOT_SRC0_DATA_ADDR (0x6BFC0000) // 0x1E0000 用于暂存数据供first_sync处理
|
||||
#define JESD_NRFDD_RX_SLOT_SRC1_DATA_ADDR (0x6C1A0000) // 0x1E0000 用于暂存数据供first_sync处理
|
||||
#else
|
||||
#define JESD_NRFDD_RX_SLOT_EVEN_DATA_ADDR (0x88800000) //61440*4
|
||||
#define JESD_NRFDD_RX_SLOT_ODD_DATA_ADDR (0x8883c000) //
|
||||
#endif
|
||||
#define JESD_NRFDD_RX_SLOT_SRC0_DATA_ADDR (0x6BFC0000) // 61440*4 用于暂存数据供first_sync处理
|
||||
#define JESD_NRFDD_RX_SLOT_SRC1_DATA_ADDR (0x6BFFC000) // 2048*4 用于暂存数据供first_sync处理
|
||||
|
||||
#define SOURCE_DATA_DDR_ADDR (0x84C01000)
|
||||
#define SOURCE_DATA_FLAG_DDR_ADDR (0x84C00000) // SPU READ FLAG
|
||||
|
@ -29,7 +29,7 @@
|
||||
#define RUN_CNT(base, offset) STORE_EX_W( (void*)((base) + 4*(offset)), LOAD_EX_W( (void*)((base) + 4*(offset)) ) + 1 )
|
||||
#define TIME_SLOT() (get_tx_nr_slot() )
|
||||
#define TIME_US() (uint32_t)((GET_STC_CNT()* 2097) >> 21)
|
||||
#define TIME_NS() (uint32_t)((GET_STC_CNT())
|
||||
#define TIME_NS() (uint32_t)(GET_STC_CNT())
|
||||
|
||||
#define TIME_DIFF(start_slot, start_us, end_slot, end_us) ((start_slot) <= (end_slot) )? \
|
||||
(( (end_slot) - (start_slot) ) * 500 + ( (end_us) - (start_us) )): \
|
||||
|
@ -4,8 +4,8 @@ uint32_t g_time_start[3];
|
||||
__attribute__((always_inline)) uint32_t Time_offset(uint32_t idx)
|
||||
{
|
||||
#ifndef IDE_TEST
|
||||
uint32_t cur_cycle = TIME_US();
|
||||
return (cur_cycle < g_time_start[idx]) ? (cur_cycle + (0x389aca00 - g_time_start[idx])) : (cur_cycle - g_time_start[idx]);
|
||||
uint32_t cur_cycle = TIME_NS();
|
||||
return (cur_cycle < g_time_start[idx]) ? (cur_cycle + 0x3b9aca00 - g_time_start[idx]) : (cur_cycle - g_time_start[idx]);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
|
62464
Config/Receiver_Sync_test.dat
Normal file
62464
Config/Receiver_Sync_test.dat
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user