From 1976f433dcebbe7f7b2e9bfc6abd4bfab24f043b Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Tue, 22 Feb 2022 16:15:29 +0100 Subject: [PATCH] changes for Panther --- openair1/PHY/LTE_TRANSPORT/if5_tools.c | 32 ++++++++++++++---- targets/ARCH/AW2SORI/oaiori.c | 45 ++++++++++++++------------ 2 files changed, 49 insertions(+), 28 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/if5_tools.c b/openair1/PHY/LTE_TRANSPORT/if5_tools.c index 9d53cafe71a..e71b1e31f6a 100644 --- a/openair1/PHY/LTE_TRANSPORT/if5_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/if5_tools.c @@ -1106,9 +1106,9 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int tti, uint8_t *seq NR_DL_FRAME_PARMS *nrfp = ru->nr_frame_parms; - int offset,siglen; + int offset,siglen,factor=1; if (nrfp) { - offset = nrfp->get_samples_slot_timestamp(tti,nrfp,0); + offset = nrfp->get_samples_slot_timestamp(tti,nrfp,0); siglen = nrfp->get_samples_per_slot(tti,nrfp); } else { @@ -1116,6 +1116,13 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int tti, uint8_t *seq siglen = spsf; } + if (ru->openair0_cfg.nr_flag==1) { + if (nrfp->N_RB_DL <= 162 && nrfp->N_RB_DL >= 106) factor = 2; + else if (nrfp->N_RB_DL < 106) factor=4; + } + else { + factor = 30720/spsf; + } for (i=0; i < ru->nb_tx; i++) txp[i] = (int32_t*)&ru->common.txdata[i][offset]; @@ -1125,7 +1132,7 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int tti, uint8_t *seq //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 1 ); clock_gettime( CLOCK_MONOTONIC, &start_comp); ru->ifdevice.trx_write_func2(&ru->ifdevice, - (proc_timestamp + packet_id*spp_eth-600)*(30720/spsf), + (proc_timestamp + packet_id*spp_eth-600)*factor, (void*)txp[aid], spp_eth, aid, @@ -1326,6 +1333,8 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int tti, uint16_t pa NR_DL_FRAME_PARMS *nrfp = ru->nr_frame_parms; int offset,siglen; + int factor=1; + int ts_offset; if (nrfp) { offset = nrfp->get_samples_slot_timestamp(tti,nrfp,0); siglen = nrfp->get_samples_per_slot(tti,nrfp); @@ -1334,6 +1343,15 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int tti, uint16_t pa offset = tti*fp->samples_per_subframe; siglen = spsf; } + if (ru->openair0_cfg.nr_flag==1) { // This check if RRU knows about NR numerologies + if (nrfp->N_RB_DL <= 162 && nrfp->N_RB_DL >= 106) factor = 2; + else if (nrfp->N_RB_DL < 106) factor=4; + ts_offset = 64; + } + else { + factor = 30720/spsf; + ts_offset = 256; + } for (i=0; i < ru->nb_rx; i++) rxp[i] = &ru->common.rxdata[i][offset]; int aid; @@ -1352,12 +1370,12 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int tti, uint16_t pa &aid); clock_gettime( CLOCK_MONOTONIC, &if_time); timeout[packet_id] = if_time.tv_nsec; - timestamp[packet_id] /= (30720/spsf); - LOG_D(PHY,"TTI %d: Received packet %d: aid %d, TS %llu, oldTS %llu, diff %lld, \n",tti,packet_id,aid,(unsigned long long)timestamp[packet_id],(unsigned long long)oldTS,(unsigned long long)(timestamp[packet_id]-timestamp[0])); + timestamp[packet_id] /= factor; // for LTE this is the sample rate reduction w.r.t 30.72, for NR 122.88 + LOG_D(PHY,"TTI %d: factor = %d Received packet %d: aid %d, TS %llu, oldTS %llu, diff %lld, \n",tti,factor,packet_id,aid,(unsigned long long)timestamp[packet_id],(unsigned long long)oldTS,(unsigned long long)(timestamp[packet_id]-timestamp[0])); if (aid==0) { if (firstTS==1) firstTS=0; - else if (oldTS + 256 != timestamp[packet_id]) { + else if (oldTS + ts_offset != timestamp[packet_id]) { LOG_I(PHY,"oldTS %llu, newTS %llu, diff %llu, timein %lu, timeout %lu\n",(long long unsigned int)oldTS,(long long unsigned int)timestamp[packet_id],(long long unsigned int)timestamp[packet_id]-oldTS,timein[packet_id],timeout[packet_id]); for (int i=0;i<=packet_id;i++) LOG_I(PHY,"packet %d TS %llu, timein %lu, timeout %lu\n",i,(long long unsigned int)timestamp[i],timein[i],timeout[i]); AssertFatal(1==0,"fronthaul problem\n"); @@ -1369,7 +1387,7 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int tti, uint16_t pa // HYPOTHESIS: first packet per subframe has lowest timestamp of subframe // should detect out of order and act accordingly .... - AssertFatal(aid==0 || aid==1,"aid %d != 0 or 1\n",aid); + AssertFatal(aid==0 || aid==1 || aid==2 || aid==3,"aid %d != 0,1,2 or 3\n",aid); LOG_D(PHY,"rxp[%d] %p, dest %p, offset %d (%llu,%llu)\n",aid,rxp[aid],rxp[aid]+(timestamp[packet_id]-timestamp[0]),(int)(timestamp[packet_id]-timestamp[0]),(long long unsigned int)timestamp[packet_id],(long long unsigned int)timestamp[0]); memcpy((void*)(rxp[aid]+(timestamp[packet_id]-timestamp[0])), (void*)temp_rx, diff --git a/targets/ARCH/AW2SORI/oaiori.c b/targets/ARCH/AW2SORI/oaiori.c index 3872b05b3b3..9cf15237cfa 100644 --- a/targets/ARCH/AW2SORI/oaiori.c +++ b/targets/ARCH/AW2SORI/oaiori.c @@ -243,7 +243,7 @@ int aw2s_startstreaming(openair0_device *device) { tx1= (openair0_cfg->tx_num_channels > 1) ? ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_TxNRFDD : ORI_ObjectType_TxNRTDD, 1, NULL) : NULL; tx2= (openair0_cfg->tx_num_channels > 2) ? ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_TxNRFDD : ORI_ObjectType_TxNRTDD, 2, NULL) : NULL; tx3= (openair0_cfg->tx_num_channels > 3) ? ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_TxNRFDD : ORI_ObjectType_TxNRTDD, 3, NULL) : NULL; - rx0= ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_RxEUtraFDD : ORI_ObjectType_RxEUtraTDD, 0, NULL); + rx0= ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_RxNRFDD : ORI_ObjectType_RxNRTDD, 0, NULL); rx1= (openair0_cfg->rx_num_channels > 1) ? ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_RxNRFDD : ORI_ObjectType_RxNRTDD, 1, NULL) : NULL; rx2= (openair0_cfg->rx_num_channels > 2) ? ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_RxNRFDD : ORI_ObjectType_RxNRTDD, 2, NULL) : NULL; rx3= (openair0_cfg->rx_num_channels > 3) ? ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_RxNRFDD : ORI_ObjectType_RxNRTDD, 3, NULL) : NULL; @@ -259,8 +259,10 @@ int aw2s_startstreaming(openair0_device *device) { (rx1 == NULL && openair0_cfg->rx_num_channels > 1) || (rx2 == NULL && openair0_cfg->rx_num_channels > 2) || (rx3 == NULL && openair0_cfg->rx_num_channels > 3) || - link == NULL) return (-1); - + link == NULL) { + printf("tx0 %p, tx1 %p, tx2 %p, tx3 %p, rx0 %p, rx1 %p, rx2 %p, rx3 %p\n",tx0,tx1,tx2,tx3,rx0,rx1,rx2,rx3); + return (-1); + } /******************************************************************* * UNLOCK Link *******************************************************************/ @@ -415,7 +417,7 @@ int aw2s_startstreaming(openair0_device *device) { (openair0_cfg->rx_num_channels > 1 && rx1->fst != ORI_FST_Operational) || tx0->fst != ORI_FST_Operational || (openair0_cfg->tx_num_channels > 1 && tx1->fst != ORI_FST_Operational)) - {} + {}*/ // test RX interface uint64_t TS; char temp_rx[1024] __attribute__((aligned(32))); @@ -604,7 +606,7 @@ int aw2s_oriinit(openair0_device *device) { result = ORI_ObjectCreation(ori, txTypeRef, txParams, txParamList, num_txparams, txParamResult, &tx0, &RE_result); if(RE_result != ORI_Result_SUCCESS) { - printf("ORI_ObjectCreation (txParams0.TxEUtra/NRFDD/TDD) failed with error: %s (%s,%s,%s,%s,%s,%s\n", ORI_Result_Print(RE_result), + printf("ORI_ObjectCreation (txParams0.TxEUtra/NR/FDD/TDD) failed with error: %s (%s,%s,%s,%s,%s,%s\n", ORI_Result_Print(RE_result), ORI_Result_Print(txParamResult[0]), ORI_Result_Print(txParamResult[1]), ORI_Result_Print(txParamResult[2]), @@ -614,7 +616,7 @@ int aw2s_oriinit(openair0_device *device) { aw2s_oricleanup(device); return -1; } - printf("ORI_ObjectCreation (txParams0.TxEUtra/NRFDD/TDD): %s\n", ORI_Result_Print(RE_result)); + printf("ORI_ObjectCreation (txParams0.TxEUtra/NR/FDD/TDD): %s\n", ORI_Result_Print(RE_result)); /* Create tx1 */ @@ -631,11 +633,11 @@ int aw2s_oriinit(openair0_device *device) { result = ORI_ObjectCreation(ori, txTypeRef, txParams, txParamList, num_txparams, txParamResult, &tx1, &RE_result); if(RE_result != ORI_Result_SUCCESS) { - printf("ORI_ObjectCreation (txParams1.TxEUtra/NRFDD/TDD) failed with error: %s\n", ORI_Result_Print(result)); + printf("ORI_ObjectCreation (txParams1.TxEUtra/NR/FDD/TDD) failed with error: %s\n", ORI_Result_Print(result)); aw2s_oricleanup(device); return -1; } - printf("ORI_ObjectCreation (txParams1.TxEUtra/NRFDD/TDD): %s\n", ORI_Result_Print(RE_result)); + printf("ORI_ObjectCreation (txParams1.TxEUtra/NR/FDD/TDD): %s\n", ORI_Result_Print(RE_result)); } if (openair0_cfg->tx_num_channels > 2) { @@ -651,11 +653,11 @@ int aw2s_oriinit(openair0_device *device) { result = ORI_ObjectCreation(ori, txTypeRef, txParams, txParamList, num_txparams, txParamResult, &tx2, &RE_result); if(RE_result != ORI_Result_SUCCESS) { - printf("ORI_ObjectCreation (txParams1.TxEUtraFDD/TDD) failed with error: %s\n", ORI_Result_Print(result)); + printf("ORI_ObjectCreation (txParams2.TxEUtra/NR/FDD/TDD) failed with error: %s\n", ORI_Result_Print(result)); aw2s_oricleanup(device); return -1; } - printf("ORI_ObjectCreation (txParams1.TxEUtraFDD/TDD): %s\n", ORI_Result_Print(RE_result)); + printf("ORI_ObjectCreation (txParams2.TxEUtra/NR/FDD/TDD): %s\n", ORI_Result_Print(RE_result)); } if (openair0_cfg->tx_num_channels == 4) { ORI_Object_s * tx3; @@ -670,7 +672,7 @@ int aw2s_oriinit(openair0_device *device) { result = ORI_ObjectCreation(ori, txTypeRef, txParams, txParamList, num_txparams, txParamResult, &tx3, &RE_result); if(RE_result != ORI_Result_SUCCESS) { - printf("ORI_ObjectCreation (txParams1.TxEUtra/NRFDD/TDD) failed with error: %s\n", ORI_Result_Print(result)); + printf("ORI_ObjectCreation (txParams3.TxEUtra/NRFDD/TDD) failed with error: %s\n", ORI_Result_Print(result)); aw2s_oricleanup(device); return -1; } @@ -688,7 +690,8 @@ int aw2s_oriinit(openair0_device *device) { (openair0_cfg->nr_flag == 0 ? ORI_ObjectType_RxEUtraTDD : ORI_ObjectType_RxNRTDD)}; ORI_ObjectParams_u rxParams; ORI_ObjectParam_e rxParamList[5] = { ORI_ObjectParam_SigPath_antPort, ORI_ObjectParam_SigPath_axcW, ORI_ObjectParam_SigPath_axcB, - ORI_ObjectParam_SigPath_chanBW, ORI_ObjectParam_SigPath_earfcn }; + ORI_ObjectParam_SigPath_chanBW, + openair0_cfg->nr_flag == 0 ? ORI_ObjectParam_SigPath_earfcn : ORI_ObjectParam_SigPath_AWS_arfcn}; ORI_Result_e rxParamResult[5]; int num_rxparams = 5; /* Create rx0 */ @@ -783,11 +786,11 @@ int aw2s_oriinit(openair0_device *device) { if(result != ORI_Result_SUCCESS) { - printf("ORI_ObjectCreation (rxParams1.RxEUtra/NR/FDD/TDD) failed with error: %s\n", ORI_Result_Print(result)); + printf("ORI_ObjectCreation (rxParams2.RxEUtra/NR/FDD/TDD) failed with error: %s\n", ORI_Result_Print(result)); aw2s_oricleanup(device); return -1; } - printf("ORI_ObjectCreation (rxParams1.RxEUtra/NR/FDD/TDD): %s\n", ORI_Result_Print(RE_result)); + printf("ORI_ObjectCreation (rxParams2.RxEUtra/NR/FDD/TDD): %s\n", ORI_Result_Print(RE_result)); } if (openair0_cfg->rx_num_channels > 3) { /* Create rx3 */ @@ -806,11 +809,11 @@ int aw2s_oriinit(openair0_device *device) { if(result != ORI_Result_SUCCESS) { - printf("ORI_ObjectCreation (rxParams1.RxEUtra/NR/FDD/TDD) failed with error: %s\n", ORI_Result_Print(result)); + printf("ORI_ObjectCreation (rxParams3.RxEUtra/NR/FDD/TDD) failed with error: %s\n", ORI_Result_Print(result)); aw2s_oricleanup(device); return -1; } - printf("ORI_ObjectCreation (rxParams1.RxEUtra/NR/FDD/TDD): %s\n", ORI_Result_Print(RE_result)); + printf("ORI_ObjectCreation (rxParams3.RxEUtra/NR/FDD/TDD): %s\n", ORI_Result_Print(RE_result)); } /* Create link */ @@ -827,14 +830,14 @@ int aw2s_oriinit(openair0_device *device) { result = ORI_ObjectParamModify(ori,link,linkParams,linkParamList,3,linkParamResult,&RE_result); if(result != ORI_Result_SUCCESS) { - printf("ORI_ObjectParamModify (linkParams) failed with error: %s\n", ORI_Result_Print(result)); + printf("ORI_ObjectParamModify (linkParams) failed with error: %s\n", ORI_Result_Print(RE_result)); aw2s_oricleanup(device); return -1; } result = ORI_ObjectStateModification(ori, link, ORI_AST_Locked, &RE_result); if(result != ORI_Result_SUCCESS) { - printf("ORI_ObjectStateModify failed with error: %s\n", ORI_Result_Print(result)); + printf("ORI_ObjectStateModify failed with error: %s\n", ORI_Result_Print(RE_result)); aw2s_oricleanup(device); return -1; } @@ -850,7 +853,7 @@ int aw2s_oriinit(openair0_device *device) { result = ORI_ObjectParamReport(ori, NULL, 0, ORI_ObjectParam_All, &RE_result); if(result != ORI_Result_SUCCESS) { - printf("ORI_ObjectParamReport failed with error: %s\n", ORI_Result_Print(result)); + printf("ORI_ObjectParamReport failed with error: %s\n", ORI_Result_Print(RE_result)); aw2s_oricleanup(device); return -1; } @@ -869,7 +872,7 @@ int aw2s_oriinit(openair0_device *device) { result = ORI_ObjectStateReport(ori, NULL, 0, ORI_StateType_All, ORI_EventDrivenReport_True, &RE_result); if(result != ORI_Result_SUCCESS) { - printf("ORI_ObjectStateReport failed with error: %s\n", ORI_Result_Print(result)); + printf("ORI_ObjectStateReport failed with error: %s\n", ORI_Result_Print(RE_result)); aw2s_oricleanup(device); return -1; } @@ -893,7 +896,7 @@ int aw2s_oriinit(openair0_device *device) { result = ORI_ObjectFaultReport(ori, NULL, 0, ORI_EventDrivenReport_True, &RE_result); if(result != ORI_Result_SUCCESS) { - printf("ORI_ObjectFaultReport failed with error: %s\n", ORI_Result_Print(result)); + printf("ORI_ObjectFaultReport failed with error: %s\n", ORI_Result_Print(RE_result)); aw2s_oricleanup(device); return -1; } -- GitLab