1.修改导频打桩参数,2.修改sync tracking方式为和导频相关,新增微码Sliding 3.更换TX的导频序列

This commit is contained in:
HUOHUO 2025-05-25 10:28:48 -07:00
parent 239443a582
commit c3ef82c5de
24 changed files with 66109 additions and 1087 deletions

View File

@ -30,7 +30,7 @@ void ape4_event_task(uint32_t addr, uint32_t size)
uint32_t ape_id = get_core_id(); uint32_t ape_id = get_core_id();
osp_task_info_ex mgr_task2 = osp_task_info_ex mgr_task2 =
{PHY_TASK_RECEIVER_SYNC, "Receiver_Sync", PHY_TASK_PRI_RECEIVER_SYNC, 4096, OSP_TIMER_TYPE, 0x000, 0x3FF, 50, (OSP_TASKINIT_FUNC)Receiver_Sync_Init, (OSP_TASKENTRY_FUNC)Receiver_Sync_Task}; {PHY_TASK_RECEIVER_SYNC, "Receiver_Sync", PHY_TASK_PRI_RECEIVER_SYNC, 8192, OSP_TIMER_TYPE, 0x000, 0x3FF, 50, (OSP_TASKINIT_FUNC)Receiver_Sync_Init, (OSP_TASKENTRY_FUNC)Receiver_Sync_Task};
// osp_task_info_ex mgr_task3 = // osp_task_info_ex mgr_task3 =
// {PHY_TASK_TEST, "Test_Task", PHY_TASK_PRI_TEST, 4096, OSP_TIMER_TYPE, 0x000, 0x3FF, 50, NULL, (OSP_TASKENTRY_FUNC)Test_Task}; // {PHY_TASK_TEST, "Test_Task", PHY_TASK_PRI_TEST, 4096, OSP_TIMER_TYPE, 0x000, 0x3FF, 50, NULL, (OSP_TASKENTRY_FUNC)Test_Task};
@ -64,8 +64,8 @@ void ape4_event_task_del(uint32_t addr, uint32_t size)
*/ */
void Phy_Task_Ape4_Reg() 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 = {50, "ape4_event_task1", 50, 3072, 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}; osp_task_info_ex ape4_event_task_info_del = {51, "ape4_event_task_del1", 51, 3072, OSP_EVENT_TYPE, 0, 0, 0, NULL, (OSP_TASKENTRY_FUNC)ape4_event_task_del};
@ -90,8 +90,9 @@ void phy_init()
// //初始化函数里面尽量不要输出log因为可能初始化时msg_transfer_open还未完成 // //初始化函数里面尽量不要输出log因为可能初始化时msg_transfer_open还未完成
log_level_e log_level = INFO; log_level_e log_level = INFO;
log_pool_init(); log_pool_init();
TRACE(TRACE_RECV_INIT_ADDR, 1, 2);
set_log_level(log_level); set_log_level(log_level);
TRACE(TRACE_RECV_INIT_ADDR, 1, 3);
//memset(&g_phy_cell_cfg, 0, sizeof(phy_cell_cfg_t)); //memset(&g_phy_cell_cfg, 0, sizeof(phy_cell_cfg_t));
Phy_Task_Ape4_Reg(); Phy_Task_Ape4_Reg();

View File

@ -1,6 +1,6 @@
############################ ############################
# mpu libs need to link to this APE, could be specified by user # mpu libs need to link to this APE, could be specified by user
MICRO_CODE_LIBS:=ByteCopy SyncVer MICRO_CODE_LIBS:=ByteCopy SyncVer Sliding
############################ ############################
# tool path, could be specified by user # tool path, could be specified by user
#UCP_HOME=/opt/sdk/ucp2.0_sdk/bin #UCP_HOME=/opt/sdk/ucp2.0_sdk/bin

View File

@ -31,6 +31,7 @@
//include mpu header files //include mpu header files
#include "ByteCopy.h" #include "ByteCopy.h"
#include "SyncVer.h" #include "SyncVer.h"
#include "Sliding.h"
//微码配置空间偏移结构体 //微码配置空间偏移结构体

View File

@ -18,6 +18,7 @@
#define RECEIVER_SYNC_ConfigSlidingCorrelation_CFG2_LENGTH (0x00a0) #define RECEIVER_SYNC_ConfigSlidingCorrelation_CFG2_LENGTH (0x00a0)
#define RECEIVER_SYNC_ConfigSlidingCorrelationSecond_CFG3_LENGTH (0x0080) #define RECEIVER_SYNC_ConfigSlidingCorrelationSecond_CFG3_LENGTH (0x0080)
#define RECEIVER_SYNC_ConfigSyncVer_CFG4_LENGTH (0x00a0) #define RECEIVER_SYNC_ConfigSyncVer_CFG4_LENGTH (0x00a0)
#define RECEIVER_SYNC_ConfigSliding_CFG5_LENGTH (0x0060)
//SPU查找表各字段长度定义,单位为word(4Byte) //SPU查找表各字段长度定义,单位为word(4Byte)

View File

@ -25,6 +25,7 @@ typedef struct receiver_sync_table_param_s
uint32_t ConfigSlidingCorrelation_CFG2_Offset; uint32_t ConfigSlidingCorrelation_CFG2_Offset;
uint32_t ConfigSlidingCorrelationSecond_CFG3_Offset; uint32_t ConfigSlidingCorrelationSecond_CFG3_Offset;
uint32_t ConfigSyncVer_CFG4_Offset; uint32_t ConfigSyncVer_CFG4_Offset;
uint32_t ConfigSliding_CFG5_Offset;
// 存储微码参数表的ddr基地址和长度 // 存储微码参数表的ddr基地址和长度
uint32_t receiver_sync_config0_ddr_ptr;//receiver DM0微码配置文件ddr地址 uint32_t receiver_sync_config0_ddr_ptr;//receiver DM0微码配置文件ddr地址
uint32_t receiver_sync_config0_length;//receiver DM0微码配置文件ddr长度 uint32_t receiver_sync_config0_length;//receiver DM0微码配置文件ddr长度
@ -39,7 +40,8 @@ typedef struct receiver_sync_table_param_s
// SPU LUT SM基地址和长度 // SPU LUT SM基地址和长度
uint32_t receiver_sync_pilot_ptr;//receiver DM0微码配置文件ddr地址
uint32_t receiver_sync_pilot_length;//receiver DM0微码配置文件ddr长度
}receiver_sync_table_param_t; }receiver_sync_table_param_t;

View File

@ -20,6 +20,7 @@
*/ */
void Receiver_Sync_Init() void Receiver_Sync_Init()
{ {
TRACE(TRACE_RECV_INIT_ADDR, 6, 1);
int32_t ret; int32_t ret;
//DM0 //DM0
@ -27,6 +28,7 @@ void Receiver_Sync_Init()
g_receiver_sync_table_param.ConfigSlidingCorrelation_CFG2_Offset = g_receiver_sync_table_param.ConfigByteCopy_CFG1_Offset + RECEIVER_SYNC_ConfigByteCopy_CFG1_LENGTH; g_receiver_sync_table_param.ConfigSlidingCorrelation_CFG2_Offset = g_receiver_sync_table_param.ConfigByteCopy_CFG1_Offset + RECEIVER_SYNC_ConfigByteCopy_CFG1_LENGTH;
g_receiver_sync_table_param.ConfigSlidingCorrelationSecond_CFG3_Offset = g_receiver_sync_table_param.ConfigSlidingCorrelation_CFG2_Offset + RECEIVER_SYNC_ConfigSlidingCorrelation_CFG2_LENGTH; g_receiver_sync_table_param.ConfigSlidingCorrelationSecond_CFG3_Offset = g_receiver_sync_table_param.ConfigSlidingCorrelation_CFG2_Offset + RECEIVER_SYNC_ConfigSlidingCorrelation_CFG2_LENGTH;
g_receiver_sync_table_param.ConfigSyncVer_CFG4_Offset = g_receiver_sync_table_param.ConfigSlidingCorrelationSecond_CFG3_Offset + RECEIVER_SYNC_ConfigSlidingCorrelationSecond_CFG3_LENGTH; g_receiver_sync_table_param.ConfigSyncVer_CFG4_Offset = g_receiver_sync_table_param.ConfigSlidingCorrelationSecond_CFG3_Offset + RECEIVER_SYNC_ConfigSlidingCorrelationSecond_CFG3_LENGTH;
g_receiver_sync_table_param.ConfigSliding_CFG5_Offset = g_receiver_sync_table_param.ConfigSyncVer_CFG4_Offset + RECEIVER_SYNC_ConfigSyncVer_CFG4_LENGTH;
//DM1 //DM1
//DM2 //DM2
@ -57,11 +59,19 @@ void Receiver_Sync_Init()
ret = osp_get_cfgfile("Receiver_Sync_cfg_dm0.dat", ret = osp_get_cfgfile("Receiver_Sync_cfg_dm0.dat",
(uint32_t *)&(g_receiver_sync_table_param.receiver_sync_config0_ddr_ptr), (uint32_t *)&(g_receiver_sync_table_param.receiver_sync_config0_ddr_ptr),
(int32_t *)&(g_receiver_sync_table_param.receiver_sync_config0_length)); (int32_t *)&(g_receiver_sync_table_param.receiver_sync_config0_length));
TRACE(TRACE_RECV_INIT_ADDR, 6, 2);
if(-1 == ret) if(-1 == ret)
{ {
LOG_ERROR_S("Receiver_Sync_cfg_dm0.dat not found!\n"); LOG_ERROR_S("Receiver_Sync_cfg_dm0.dat not found!\n");
} }
ret = osp_get_cfgfile("Recv_Pilot.dat",
(uint32_t *)&(g_receiver_sync_table_param.receiver_sync_pilot_ptr),
(int32_t *)&(g_receiver_sync_table_param.receiver_sync_pilot_length));
TRACE(TRACE_RECV_INIT_ADDR, 6, 3);
if(-1 == ret)
{
LOG_ERROR_S("Recv_Pilot.dat not found!\n");
}
// ret = osp_get_cfgfile("Receiver_Sync_cfg_dm1.dat", // ret = osp_get_cfgfile("Receiver_Sync_cfg_dm1.dat",
// (uint32_t *)&(g_receiver_sync_table_param.receiver_sync_config1_ddr_ptr), // (uint32_t *)&(g_receiver_sync_table_param.receiver_sync_config1_ddr_ptr),
// (int32_t *)&(g_receiver_sync_table_param.receiver_sync_config1_length)); // (int32_t *)&(g_receiver_sync_table_param.receiver_sync_config1_length));
@ -79,6 +89,8 @@ void Receiver_Sync_Init()
STORE_EX_W(&g_receiver_sync_status_SM_ptr->sync_status, SYNC_IDLE); STORE_EX_W(&g_receiver_sync_status_SM_ptr->sync_status, SYNC_IDLE);
STORE_EX_W(&g_receiver_sync_status_SM_ptr->frame_head_offset, 0); STORE_EX_W(&g_receiver_sync_status_SM_ptr->frame_head_offset, 0);
TRACE(TRACE_RECV_INIT_ADDR, 6, 4);
g_receiver_sync_cylic_buffer.buffer_head = 0; g_receiver_sync_cylic_buffer.buffer_head = 0;
g_receiver_sync_cylic_buffer.buffer_tail = 0; g_receiver_sync_cylic_buffer.buffer_tail = 0;
g_receiver_sync_cylic_buffer.buffer_min = 0; g_receiver_sync_cylic_buffer.buffer_min = 0;
@ -164,6 +176,8 @@ else
} }
#endif #endif
transform_para_init(0, 0, 0); TRACE(TRACE_RECV_INIT_ADDR, 6, 5);
transform_para_init(0, 0, 0);
TRACE(TRACE_RECV_INIT_ADDR, 6, 6);
} }

View File

@ -309,16 +309,16 @@ void Receiver_Fine_Sync_Proc(uint32_t sfn, uint32_t slot, uint32_t proc_type)
//取数方式同步点为中心前15后16相关长度1024 //取数方式同步点为中心前15后16相关长度1024
/* /*
| receiver_sync_temp_dm0_ptr | | receiver_sync_temp_dm0_ptr |
| | | |
| | | |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 15 | 1024 - 15 | 15 | 16 | 1024 - 16 | 16 | | 15 | 1024 - 15 | 15 | 16 | 1024 - 16 | 16 |
| | | | | | | | | | | | | |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| | | |
HEAD | | HEAD
| receiver_sync_temp_dm1_ptr |
*/ */
#define TOT_LEN (2079) #define TOT_LEN (2079)
@ -373,19 +373,19 @@ void Receiver_Fine_Sync_Proc(uint32_t sfn, uint32_t slot, uint32_t proc_type)
} }
//复制数据DM0 -> DM1 //复制数据DM0 -> DM1
cfg_addr = (int32_t *)receiver_sync_config_dm0_ptr + g_receiver_sync_table_param.ConfigByteCopy_CFG1_Offset; // cfg_addr = (int32_t *)receiver_sync_config_dm0_ptr + g_receiver_sync_table_param.ConfigByteCopy_CFG1_Offset;
ByteCopy((int)cfg_addr, // ByteCopy((int)cfg_addr,
MPU_ADDR(receiver_sync_temp_dm0_ptr+1024), // MPU_ADDR(receiver_sync_temp_dm0_ptr+1024),
MPU_ADDR(receiver_sync_temp_dm1_ptr), // MPU_ADDR(receiver_sync_temp_dm1_ptr),
(1024+15+16) << 2); // (1024+15+16) << 2);
WAIT_MPU_STOP; // WAIT_MPU_STOP;
ape_csu_task_lookup(DMA_TAG_G2L, 1); // ape_csu_task_lookup(DMA_TAG_G2L, 1);
TRACE(TRACE_RECEIVER_SYNC_FINE_ADDR, 3, 3); // TRACE(TRACE_RECEIVER_SYNC_FINE_ADDR, 3, 3);
dbg_time1 = Time_offset(2); // dbg_time1 = Time_offset(2);
TRACE_MAX(TRACE_RECEIVER_SYNC_FINE_ADDR, 5, dbg_time1-dbg_time0 ); // TRACE_MAX(TRACE_RECEIVER_SYNC_FINE_ADDR, 5, dbg_time1-dbg_time0 );
dbg_time0 = dbg_time1; // dbg_time0 = dbg_time1;
// LOG_ERROR_S("%d %d %d\n", sfn, slot , dbg_cur_time); // LOG_ERROR_S("%d %d %d\n", sfn, slot , dbg_cur_time);
// if(100 < dbg_cur_time ) // if(100 < dbg_cur_time )
// { // {
@ -398,41 +398,78 @@ void Receiver_Fine_Sync_Proc(uint32_t sfn, uint32_t slot, uint32_t proc_type)
// __ucps2_dbgbreak(); // __ucps2_dbgbreak();
// } // }
g_receiver_sync_cylic_buffer.buffer_in_sel = (g_receiver_sync_cylic_buffer.buffer_in_sel + 1) % RECEIVER_SYNC_SYNC2SYMB_NUM_BUFFER;
// SVRReg[0] = MPU_ADDR(cfg_addr);
// ByteCopyAsm(SVRReg);
// cfg_addr = (int32_t *)receiver_sync_config_dm0_ptr + g_receiver_sync_table_param.ConfigSyncVer_CFG4_Offset;
// SyncVer((int)cfg_addr,
// MPU_ADDR(receiver_sync_temp_dm0_ptr),
// MPU_ADDR(receiver_sync_temp_dm1_ptr),
// //MPU_ADDR(receiver_sync_temp_dm2_ptr),
// MPU_ADDR(receiver_sync_temp_dm3_ptr));
// WAIT_MPU_STOP;
// TRACE(TRACE_RECEIVER_SYNC_FINE_ADDR, 3, 4);
// dbg_time1 = Time_offset(2);
// TRACE_MAX(TRACE_RECEIVER_SYNC_FINE_ADDR, 6, dbg_time1-dbg_time0 );
// dbg_time0 = dbg_time1;
// SVRReg[0] = MPU_ADDR(cfg_addr);
// SyncVerAsm(SVRReg);
//搬移导频
ape_csu_task_lookup(DMA_TAG_G2L, 1);
ape_csu_dma_1D_G2L_ch0ch1_transfer((uint64_t)(g_receiver_sync_table_param.receiver_sync_pilot_ptr),
(uint64_t)DM_TO_CSU_ADDR(receiver_sync_temp_dm1_ptr),
(1024)<<2,
DMA_TAG_G2L,
0);
//相关计算
cfg_addr = (int32_t *)receiver_sync_config_dm0_ptr + g_receiver_sync_table_param.ConfigSliding_CFG5_Offset;
Sliding((int)cfg_addr,
MPU_ADDR(receiver_sync_temp_dm0_ptr + 1024),
MPU_ADDR(receiver_sync_temp_dm1_ptr),
MPU_ADDR(receiver_sync_temp_dm3_ptr));
WAIT_MPU_STOP;
ape_csu_task_lookup(DMA_TAG_G2L, 1);
//插空拷贝数据到SM提供给sync_symb数据输入来源 //插空拷贝数据到SM提供给sync_symb数据输入来源
ape_csu_dma_1D_G2L_ch0ch1_transfer((uint64_t)(src_addr0), ape_csu_dma_1D_G2L_ch0ch1_transfer((uint64_t)(src_addr0),
(uint64_t)(sync2symb_data_buffer[g_receiver_sync_cylic_buffer.buffer_in_sel]), (uint64_t)(sync2symb_data_buffer[g_receiver_sync_cylic_buffer.buffer_in_sel]),
(61440)<<2, (61440)<<2,
DMA_TAG_G2G, DMA_TAG_G2G,
0); 0);
g_receiver_sync_cylic_buffer.buffer_in_sel = (g_receiver_sync_cylic_buffer.buffer_in_sel + 1) % RECEIVER_SYNC_SYNC2SYMB_NUM_BUFFER;
SVRReg[0] = MPU_ADDR(cfg_addr);
ByteCopyAsm(SVRReg);
cfg_addr = (int32_t *)receiver_sync_config_dm0_ptr + g_receiver_sync_table_param.ConfigSyncVer_CFG4_Offset;
SyncVer((int)cfg_addr,
MPU_ADDR(receiver_sync_temp_dm0_ptr),
MPU_ADDR(receiver_sync_temp_dm1_ptr),
//MPU_ADDR(receiver_sync_temp_dm2_ptr),
MPU_ADDR(receiver_sync_temp_dm3_ptr));
WAIT_MPU_STOP;
TRACE(TRACE_RECEIVER_SYNC_FINE_ADDR, 3, 4); TRACE(TRACE_RECEIVER_SYNC_FINE_ADDR, 3, 4);
dbg_time1 = Time_offset(2); dbg_time1 = Time_offset(2);
TRACE_MAX(TRACE_RECEIVER_SYNC_FINE_ADDR, 6, dbg_time1-dbg_time0 ); TRACE_MAX(TRACE_RECEIVER_SYNC_FINE_ADDR, 6, dbg_time1-dbg_time0 );
dbg_time0 = dbg_time1; dbg_time0 = dbg_time1;
SVRReg[0] = MPU_ADDR(cfg_addr); SVRReg[0] = MPU_ADDR(cfg_addr);
SyncVerAsm(SVRReg); SlidingAsm(SVRReg);
// 得到验证后的同步位置 // 得到验证后的同步位置
WAIT_MPU_STOP; WAIT_MPU_STOP;
uint32_t maxPosition = 0; uint32_t maxPosition = 0;
uint32_t maxsum; uint32_t maxsum = 0;
maxPosition = 0xffff & receiver_sync_temp_dm3_ptr[0]; uint32_t loop_idx;
maxsum = receiver_sync_temp_dm3_ptr[1]; for(loop_idx = 0; loop_idx < 32; loop_idx++)
{
if(receiver_sync_temp_dm3_ptr[loop_idx] > maxsum)
{
maxPosition = loop_idx;
maxsum = receiver_sync_temp_dm3_ptr[loop_idx];
}
}
// maxPosition = 0xffff & receiver_sync_temp_dm3_ptr[0];
// maxsum = receiver_sync_temp_dm3_ptr[1];
LOG_ERROR_S("1 maxPosition:%d maxsum:%d\n",maxPosition, maxsum); LOG_ERROR_S("1 maxPosition:%d maxsum:%d\n",maxPosition, maxsum);
TRACE(TRACE_RECEIVER_SYNC_FINE_ADDR, 12, maxPosition); TRACE(TRACE_RECEIVER_SYNC_FINE_ADDR, 12, maxPosition);
@ -445,7 +482,7 @@ void Receiver_Fine_Sync_Proc(uint32_t sfn, uint32_t slot, uint32_t proc_type)
TRACE(TRACE_RECEIVER_SYNC_FINE_ADDR, 3, 5); TRACE(TRACE_RECEIVER_SYNC_FINE_ADDR, 3, 5);
uint32_t maxWindowSum = receiver_sync_temp_dm3_ptr[1]; uint32_t maxWindowSum = receiver_sync_temp_dm3_ptr[1];
//更新最佳位置 //更新最佳位置
int32_t bestPosition =(0xffff & receiver_sync_temp_dm3_ptr[0])-15 + frame_head_offset; int32_t bestPosition = maxPosition-15 + frame_head_offset;
// LOG_ERROR_S("bestpos %d %d %d\n", receiver_sync_temp_dm3_ptr[0], maxWindowSum, bestPosition); // LOG_ERROR_S("bestpos %d %d %d\n", receiver_sync_temp_dm3_ptr[0], maxWindowSum, bestPosition);
//更新sync2symb的buffer状态记录 //更新sync2symb的buffer状态记录

View File

@ -319,8 +319,10 @@ void Transmitter_Proc(
uint32_t TRANSMOUT_DATA_SM_addr_out = TRANSMOUT_symbol_SM_addr_out + 14*4096*4 + 4*1024; uint32_t TRANSMOUT_DATA_SM_addr_out = TRANSMOUT_symbol_SM_addr_out + 14*4096*4 + 4*1024;
//打桩固定参数 //打桩固定参数
double thita[6] = {0.435,2.784,1.864,1.211,2.546,2.011}; double thita[6] = {0.435,2.784,1.864,1.211,2.546,2.011};
double i_real[8] = {0.906870042299337, -0.936742157061748, -0.289020652644219, 0.352083608864027, -0.827816165894850, -0.426123729901221}; // double i_real[8] = {0.906870042299337, -0.936742157061748, -0.289020652644219, 0.352083608864027, -0.827816165894850, -0.426123729901221};
double i_imag[8] = {0.421410401366648, 0.350020186822565, 0.957322862123907, 0.935968553087807, 0.560999461214670, 0.904664891998729}; // double i_imag[8] = {0.421410401366648, 0.350020186822565, 0.957322862123907, 0.935968553087807, 0.560999461214670, 0.904664891998729};
double i_real[8] = {-0.3827, 0.8660, -0.7071, 0.5};
double i_imag[8] = {-0.9239, 0.5, -0.7071, 0.8660};
// double i_real[8] = {0}; // double i_real[8] = {0};
// double i_imag[8] = {0}; // double i_imag[8] = {0};

View File

@ -155,5 +155,6 @@
#define TRACE_TRANSMITTER_ADDR (TRACE_PCIE_ADDR + TRACE_GRP_LEN) // 0x88701400 #define TRACE_TRANSMITTER_ADDR (TRACE_PCIE_ADDR + TRACE_GRP_LEN) // 0x88701400
#define TRACE_TRANS_INIT_ADDR (TRACE_TRANSMITTER_ADDR + TRACE_GRP_LEN) // 0x88701600 #define TRACE_TRANS_INIT_ADDR (TRACE_TRANSMITTER_ADDR + TRACE_GRP_LEN) // 0x88701600
#define TRACE_RECEIVER_SYNC_INIT_ADDR (TRACE_TRANS_INIT_ADDR + TRACE_GRP_LEN) // 0x88701800
#endif #endif

View File

@ -4,6 +4,6 @@
/*Recv从receiver_Sync_Init.s.c打桩数据时打开此宏*/ /*Recv从receiver_Sync_Init.s.c打桩数据时打开此宏*/
//#define RECV_DBG_DATA_TEST //#define RECV_DBG_DATA_TEST
//#define TX_RX_LOOP #define TX_RX_LOOP
#endif /*_TEST_MACRO_H_*/ #endif /*_TEST_MACRO_H_*/

View File

@ -494,3 +494,99 @@
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x00000200,
0x00000207,
0x00000207,
0x00000207,
0x00000207,
0x00000207,
0x00000207,
0x00000207,
0x00000207,
0x00000207,
0x00000207,
0x00000207,
0x00000207,
0x00000207,
0x00000207,
0x00000207,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000040,
0x00000004,
0x00000000,
0x00000000,
0x00020002,
0x04000400,
0x00000000,
0x00000000,
0x003fffff,
0x0000000e,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000004,
0x00000000,
0x00000000,
0x00000000,
0xffffffff,
0x00000000,
0x00000000,
0x00000000,
0x003fffff,
0x0000000e,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000040,
0x00000000,
0x00000000,
0x00000000,
0xffffffff,
0x00000000,
0x00000000,
0x00000000,
0x003fffff,
0x0000000e,
0x00000000,
0x00000000,
0x00000400,
0x0000001f,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x01010000,
0x01010000,
0x01010000,
0x01010000,
0x01010000,
0x01010000,
0x01010000,
0x01010000,
0x01010000,
0x01010000,
0x01010000,
0x01010000,
0x01010000,
0x01010000,
0x01010000,
0x01010000,

1024
Config/Recv_Pilot.dat Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

8
MicroCode/Sliding/.mapu Normal file
View File

@ -0,0 +1,8 @@
{
"project": {
"incList": [
"../inc"
],
"libList": []
}
}

View File

@ -0,0 +1,107 @@
//ShiftMode
0x00000200,
0x00000207,
0x00000207,
0x00000207,
0x00000207,
0x00000207,
0x00000207,
0x00000207,
0x00000207,
0x00000207,
0x00000207,
0x00000207,
0x00000207,
0x00000207,
0x00000207,
0x00000207,
//InputA
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000040,
0x00000004,
0x00000000,
0x00000000,
0x00020002,
0x04000400,
0x00000000,
0x00000000,
0x003fffff,
0x0000000e,
0x00000000,
0x00000000,
//InputB
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000004,
0x00000000,
0x00000000,
0x00000000,
0xffffffff,
0x00000000,
0x00000000,
0x00000000,
0x003fffff,
0x0000000e,
0x00000000,
0x00000000,
//Maxdata
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000040,
0x00000000,
0x00000000,
0x00000000,
0xffffffff,
0x00000000,
0x00000000,
0x00000000,
0x003fffff,
0x0000000e,
0x00000000,
0x00000000,
//KI0
0x00000400,
0x0000001f,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
//Index1
0x01010000,
0x01010000,
0x01010000,
0x01010000,
0x01010000,
0x01010000,
0x01010000,
0x01010000,
0x01010000,
0x01010000,
0x01010000,
0x01010000,
0x01010000,
0x01010000,
0x01010000,
0x01010000,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
#ifndef SLIDING_H_
#define SLIDING_H_
#include "ucps2.h"
MPU_ENTRY void SlidingAsm(v16u32 src);
void Sliding(int ConfigAddr, int InAddr1, int InAddr2, int MaxAddr);
#endif /* SLIDING_H_ */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,20 @@
# set custom targets
# set toolchain home
ifeq ($(strip $(MaPU_TC_HOME)),)
MaPU_TC_HOME := /home/ide/IDE/MaPUIDE/toolchain
endif
APP: all
LIB: libtest_sync.a
libtest_sync.a: $(OBJS)
@echo 'Building target: $@'
@echo 'Invoking: GNU archiver'
ar rcs $@ $(OBJS)
@echo 'Finished building target: $@'
@echo ' '
.PHONY: LIB APP

View File

@ -0,0 +1,116 @@
.section .text.m0, "ax"
.file "SlidingAsm.m0.asm"
// DO NOT MODIFY THE CONTENT ABOVE
.global SlidingAsm
SlidingAsm:
R1:M[0]->BIU1.T0;
NOP;
NOP;
NOP;
NOP;
NOP;
BIU1:Load(T0)(A++) -> M[0](Mode0)|| SHU0:VImm(0) -> SHU0.T4(Mode0);//ShiftMode0
BIU1:Load(T0)(A++) -> M[1](Mode0);//InputA
BIU1:Load(T0)(A++) -> M[2](Mode0);//InputB
BIU1:Load(T0)(A++) -> M[3](Mode0);//Output
BIU1:Load(T0)(A++) -> M[63](Mode0);//ki
BIU1:Load(T0)(A++) -> SHU0.T0(Mode0);//Index
NOP;
NOP;
NOP;
NOP;
NOP;
NOP;
NOP;
NOP;
NOP;
NOP;
R0:M[0] -> IMA0.T0(Mode0)||R1:M[4] -> IMA0.T1(Mode0);
R0:M[0] -> IMA1.T0(Mode0)||R1:M[4] -> IMA1.T1(Mode0);
R2:M[0] -> IMA2.T0(Mode0)||R3:M[4] -> IMA2.T1(Mode0);
R3:M[0] -> IMA3.T0(Mode0)||R2:M[4] -> IMA3.T1(Mode0);
R0:M[1] -> BIU0.T0(Mode0);
R3:M[2] -> BIU3.T0(Mode0);
R2:M[3] -> BIU2.T0(Mode0);//output1
NOP;
IMA0:SetShiftMode(T0) -> SHIFTMODE0(Mode0)||IMA1:SetShiftMode(T0) -> SHIFTMODE0(Mode0)||IMA2:SetShiftMode(T0) -> SHIFTMODE0(Mode0)||IMA3:SetShiftMode(T0) -> SHIFTMODE0(Mode0);
NOP;
R5:PreConfig(M[63])(Mode0);
R5:WriteConf(Mfetch)->KI[0-3](Mode0);
R5:WriteConf(Mfetch)->KI[4-7](Mode0);
NOP;
NOP;
NOP;
NOP;
NOP;
NOP;
NOP;
NOP;
IMA0:0+0*0(ShiftMode0)(C)(B)(SSS)(T) -> IMA0.MR(Mode0);
IMA1:0+0*0(ShiftMode0)(C)(B)(SSS)(T) -> IMA1.MR(Mode0);
IMA2:0+0*0(ShiftMode0)(C)(B)(SSS)(T) -> IMA2.MR(Mode0);
IMA3:0+0*0(ShiftMode0)(C)(B)(SSS)(T) -> IMA3.MR(Mode0);
MFetch:LPTO %ComplexMult_Loop @(KI0 - 0);
BIU3:Load(T0)(A++)-> SHU0.T1(Mode0)||BIU0:Load(T0)(A++)-> IMA0.T2(Mode0);
BIU0:Load(T0)(A++)-> IMA1.T2(Mode0);
NOP;
NOP;
NOP;
NOP;
NOP;
NOP;
NOP;
NOP;
NOP;
NOP;
SHU0:Index(T4,T1,T0) -> IMA0.T1(Mode0);
SHU0:Index(T4,T1,T0) -> IMA1.T1(Mode0);
NOP;
NOP;
IMA0:MR+T1*T2(ShiftMode0)(C)(S)(SSS)(T) -> IMA0.MR(Mode0);
IMA1:MR+T1*T2(ShiftMode0)(C)(S)(SSS)(T) -> IMA1.MR(Mode0);
ComplexMult_Loop:
NOP;
NOP;
NOP;
IMA0:ReadMR(L)-> IMA2.T0(Mode0)||IMA1:ReadMR(L)-> IMA3.T0(Mode0);//real
IMA0:ReadMR(H)-> IMA0.T0(Mode0)||IMA1:ReadMR(H)-> IMA1.T0(Mode0);//imag
IMA0:ReadMR(O1)-> IMA2.T2(Mode0)||IMA1:ReadMR(O1)-> IMA3.T2(Mode0);//overflow real
IMA0:ReadMR(O2)-> IMA0.T2(Mode0)||IMA1:ReadMR(O2)-> IMA1.T2(Mode0);//overflow imag
NOP;
NOP;
IMA0:T0>>10(W)(U)->T0||IMA1:T0>>10(W)(U)->T0||IMA2:T0>>10(W)(U)->T0||IMA3:T0>>10(W)(U)->T0;
NOP;
NOP;
IMA0:T2>>16(W)(U)->T2||IMA1:T2>>16(W)(U)->T2||IMA2:T2>>16(W)(U)->T2||IMA3:T2>>16(W)(U)->T2;
IMA0:Ttmp<<22(W)(T)->IMA0.T2||IMA1:Ttmp<<22(W)(T)->IMA1.T2||IMA2:Ttmp<<22(W)(T)->IMA2.T2||IMA3:Ttmp<<22(W)(T)->IMA3.T2;
IMA0:T0+Ttmp(W)(U)->T1||IMA1:T0+Ttmp(W)(U)->T1||IMA2:T0+Ttmp(W)(U)->T1||IMA3:T0+Ttmp(W)(U)->T1;
NOP;
NOP;
NOP;
NOP;
IMA0:Abs(T1) (W) -> T1||IMA1:Abs(T1) (W) -> T1||IMA2:Abs(T1) (W) -> T1||IMA3:Abs(T1) (W) -> T1;
NOP;
NOP;
IMA2:T1->IMA0.T3||IMA3:T1->IMA1.T3;
NOP;
NOP;
IMA0:T1+T3(W)(U)->BIU2.T1;
IMA1:T1+T3(W)(U)->BIU2.T2;
NOP;
NOP;
NOP;
NOP;
NOP;
BIU2:Store(T1,T0)(Mode0)(A++);
BIU2:Store(T2,T0)(Mode0)(A++);
NOP;
NOP;
NOP;
NOP;
NOP;
NOP;
MFetch:Repeat @(10);
MFetch:MPU.STOP;

Binary file not shown.

View File

@ -0,0 +1,10 @@
#include <Sliding.h>
void Sliding(int ConfigAddr, int InAddr1, int InAddr2, int MaxAddr) {
volatile unsigned int *Para = (volatile unsigned int *)ConfigAddr;
Para[16*1+0] = InAddr1;
Para[16*1+1] = InAddr1;
Para[16*2+0] = InAddr2;
Para[16*3+0] = MaxAddr;
}

View File

@ -0,0 +1,55 @@
#ifndef REMOVE_MC_TEST
#include "ucps2.h"
//#include "SyncVer.h"
#include <Sliding.h>
#include <stdio.h>
#include <math.h>
#define DATA_SIZE 62464
#define CHUNK_SIZE 1024
#define WINDOW_SIZE 32 // 理想的窗口大小前16后15加当前位置
__DM1 int Input1[] = {
#include <Inputdata1.dat>
};
__DM2 int Input2[] = {
#include <Inputdata2.dat>
};
__DM3 int ConfigMatrix[] = {
#include "ConfigSliding.dat"
};
__DM5 int MaxData[32];//bestposition maxsum
v16u32 KI = { 2, 4, 6 };
__DM3 v16s32 SVRReg = {
0, 0, 0, 0,
0x40, 0, 0, 0,
0xff00ff, 0, 0, 0x0000,
0xffff, 0x6, 0, 0
};
int main(void) {
int a;
int is_synced = 0; // 同步状态标志
int maxPosition = 0;
int maxsum = 0;
// 初步同步:执行滑动相关性计算
if (!is_synced) {
uint32_t time0 = tick();
Sliding((int)ConfigMatrix, MPU_ADDR(Input1), MPU_ADDR(Input2), MPU_ADDR(MaxData));
SVRReg[0] = MPU_ADDR(ConfigMatrix);
SlidingAsm(SVRReg);
a = __ucps2_getStatB();
__ucps2_delay();
int a = 0;
for (int i = 0; i < 32; i++) {
printf("MaxData[%d] = %#010x\n", i, MaxData[i]);
}
}
return 0;
}
#endif