Commit d6dee0d1 authored by Eurecom's avatar Eurecom

Merge branch 'bandwidth-testing' of...

Merge branch 'bandwidth-testing' of https://gitlab.eurecom.fr/oai/openairinterface5g into bandwidth-testing
parents d64b96f3 ec4fce43
...@@ -316,6 +316,8 @@ void fh_if4p5_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp) ...@@ -316,6 +316,8 @@ void fh_if4p5_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp)
/* Input Fronthaul from south RCC/RAU */ /* Input Fronthaul from south RCC/RAU */
// Synchronous if5 from south // Synchronous if5 from south
uint64_t ts_rx[20];
void fh_if5_south_in(RU_t *ru, void fh_if5_south_in(RU_t *ru,
int *frame, int *frame,
int *tti) int *tti)
...@@ -323,9 +325,12 @@ void fh_if5_south_in(RU_t *ru, ...@@ -323,9 +325,12 @@ void fh_if5_south_in(RU_t *ru,
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms; NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
RU_proc_t *proc = &ru->proc; RU_proc_t *proc = &ru->proc;
recv_IF5(ru, &proc->timestamp_rx, *tti, IF5_RRH_GW_UL); recv_IF5(ru, &proc->timestamp_rx, *tti, IF5_RRH_GW_UL);
proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_subframe*10))&1023; if (proc->first_rx == 1) ru->ts_offset = proc->timestamp_rx;
uint32_t idx_sf = proc->timestamp_rx / fp->samples_per_subframe; proc->frame_rx = ((proc->timestamp_rx-ru->ts_offset) / (fp->samples_per_subframe*10))&1023;
proc->tti_rx = (idx_sf * fp->slots_per_subframe + (int)round((float)(proc->timestamp_rx % fp->samples_per_subframe) / fp->samples_per_slot0))%(fp->slots_per_frame); proc->tti_rx = fp->get_slot_from_timestamp(proc->timestamp_rx-ru->ts_offset,fp);
//(idx_sf * fp->slots_per_subframe + (int)round((float)(proc->timestamp_rx % fp->samples_per_subframe) / fp->samples_per_slot0))%(fp->slots_per_frame);
ts_rx[*tti] = proc->timestamp_rx;
LOG_D(PHY,"IF5 %d.%d => RX %d.%d first_rx %d\n",*frame,*tti,proc->frame_rx,proc->tti_rx,proc->first_rx);
if (proc->first_rx == 0) { if (proc->first_rx == 0) {
if (proc->tti_rx != *tti) { if (proc->tti_rx != *tti) {
...@@ -334,7 +339,7 @@ void fh_if5_south_in(RU_t *ru, ...@@ -334,7 +339,7 @@ void fh_if5_south_in(RU_t *ru,
} }
if (proc->frame_rx != *frame) { if (proc->frame_rx != *frame) {
LOG_E(PHY,"Received Timestamp doesn't correspond to the time we think it is (proc->frame_rx %d frame %d)\n",proc->frame_rx,*frame); LOG_E(PHY,"Received Timestamp doesn't correspond to the time we think it is (proc->frame_rx %d frame %d proc->tti_rx %d tti %d)\n",proc->frame_rx,*frame,proc->tti_rx,*tti);
exit_fun("Exiting"); exit_fun("Exiting");
} }
} else { } else {
...@@ -1270,22 +1275,25 @@ void *ru_thread( void *param ) { ...@@ -1270,22 +1275,25 @@ void *ru_thread( void *param ) {
exit(-1); exit(-1);
} }
} else { } else {
nr_init_frame_parms(&ru->config, fp);
nr_dump_frame_parms(fp);
fill_rf_config(ru,ru->rf_config_file);
nr_phy_init_RU(ru);
// Start IF device if any // Start IF device if any
if (ru->nr_start_if) { if (ru->nr_start_if) {
LOG_I(PHY,"Starting IF interface for RU %d\n",ru->idx); LOG_I(PHY,"Starting IF interface for RU %d\n",ru->idx);
AssertFatal(ru->nr_start_if(ru,NULL) == 0, "Could not start the IF device\n"); AssertFatal(ru->nr_start_if(ru,NULL) == 0, "Could not start the IF device\n");
if (ru->if_south == LOCAL_RF) ret = connect_rau(ru); if (ru->has_ctrl_prt > 0) {
else ret = attach_rru(ru); if (ru->if_south == LOCAL_RF) ret = connect_rau(ru);
else ret = attach_rru(ru);
AssertFatal(ret==0,"Cannot connect to remote radio\n");
}
AssertFatal(ret==0,"Cannot connect to remote radio\n");
} }
else if (ru->if_south == LOCAL_RF) { // configure RF parameters only
if (ru->if_south == LOCAL_RF) { // configure RF parameters only
nr_init_frame_parms(&ru->config, fp);
nr_dump_frame_parms(fp);
fill_rf_config(ru,ru->rf_config_file);
nr_phy_init_RU(ru);
ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg); ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg);
AssertFatal(ret==0,"Cannot connect to local radio\n"); AssertFatal(ret==0,"Cannot connect to local radio\n");
} }
...@@ -1453,6 +1461,11 @@ void *ru_thread( void *param ) { ...@@ -1453,6 +1461,11 @@ void *ru_thread( void *param ) {
return &ru_thread_status; return &ru_thread_status;
} }
int start_streaming(RU_t *ru) {
LOG_I(PHY,"Starting streaming on third-party RRU\n");
return(ru->ifdevice.thirdparty_startstreaming(&ru->ifdevice));
}
int nr_start_if(struct RU_t_s *ru, struct PHY_VARS_gNB_s *gNB) { int nr_start_if(struct RU_t_s *ru, struct PHY_VARS_gNB_s *gNB) {
return(ru->ifdevice.trx_start_func(&ru->ifdevice)); return(ru->ifdevice.trx_start_func(&ru->ifdevice));
} }
...@@ -1801,7 +1814,7 @@ void set_function_spec_param(RU_t *ru) { ...@@ -1801,7 +1814,7 @@ void set_function_spec_param(RU_t *ru) {
ru->fh_south_in = fh_if5_south_in; // synchronous IF5 reception ru->fh_south_in = fh_if5_south_in; // synchronous IF5 reception
ru->fh_south_out = fh_if5_south_out; // synchronous IF5 transmission ru->fh_south_out = fh_if5_south_out; // synchronous IF5 transmission
ru->fh_south_asynch_in = NULL; // no asynchronous UL ru->fh_south_asynch_in = NULL; // no asynchronous UL
ru->start_rf = NULL; // no local RF ru->start_rf = ru->eth_params.transp_preference == ETH_UDP_IF5_ECPRI_MODE ? start_streaming : NULL;
ru->stop_rf = NULL; ru->stop_rf = NULL;
ru->start_write_thread = NULL; ru->start_write_thread = NULL;
ru->nr_start_if = nr_start_if; // need to start if interface for IF5 ru->nr_start_if = nr_start_if; // need to start if interface for IF5
...@@ -2077,6 +2090,12 @@ void RCconfig_RU(void) ...@@ -2077,6 +2090,12 @@ void RCconfig_RU(void)
RC.ru[j]->if_south = REMOTE_IF5; RC.ru[j]->if_south = REMOTE_IF5;
RC.ru[j]->function = NGFI_RAU_IF5; RC.ru[j]->function = NGFI_RAU_IF5;
RC.ru[j]->eth_params.transp_preference = ETH_UDP_MODE; RC.ru[j]->eth_params.transp_preference = ETH_UDP_MODE;
} else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp_ecpri_if5") == 0) {
RC.ru[j]->if_south = REMOTE_IF5;
RC.ru[j]->function = NGFI_RAU_IF5;
RC.ru[j]->eth_params.transp_preference = ETH_UDP_IF5_ECPRI_MODE;
} else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp_ecpri_if5") == 0) {
RC.ru[j]->if_south = REMOTE_IF5;
} else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw") == 0) { } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw") == 0) {
RC.ru[j]->if_south = REMOTE_IF5; RC.ru[j]->if_south = REMOTE_IF5;
RC.ru[j]->function = NGFI_RAU_IF5; RC.ru[j]->function = NGFI_RAU_IF5;
......
...@@ -87,7 +87,7 @@ void set_scs_parameters (NR_DL_FRAME_PARMS *fp, int mu, int N_RB_DL) ...@@ -87,7 +87,7 @@ void set_scs_parameters (NR_DL_FRAME_PARMS *fp, int mu, int N_RB_DL)
if (fp->nr_band == 5 || fp->nr_band == 66) if (fp->nr_band == 5 || fp->nr_band == 66)
fp->ssb_type = nr_ssb_type_B; fp->ssb_type = nr_ssb_type_B;
else{ else{
if (fp->nr_band == 41 || ( fp->nr_band > 76 && fp->nr_band < 80) ) if (fp->nr_band == 41 || fp->nr_band == 38 || ( fp->nr_band > 76 && fp->nr_band < 80) )
fp->ssb_type = nr_ssb_type_C; fp->ssb_type = nr_ssb_type_C;
else else
AssertFatal(1==0,"NR Operating Band n%d not available for SS block SCS with mu=%d\n", fp->nr_band, mu); AssertFatal(1==0,"NR Operating Band n%d not available for SS block SCS with mu=%d\n", fp->nr_band, mu);
......
This diff is collapsed.
...@@ -318,7 +318,7 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts ...@@ -318,7 +318,7 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts
scs_scaling = scs_scaling>>2; scs_scaling = scs_scaling>>2;
uint32_t absolute_diff = (*scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB - scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA); uint32_t absolute_diff = (*scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB - scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA);
uint16_t sco = absolute_diff%(12*scs_scaling); uint16_t sco = absolute_diff%(12*scs_scaling);
AssertFatal(sco==0,"absoluteFrequencySSB has a subcarrier offset of %d while it should be alligned with CRBs\n",sco); AssertFatal(sco==(scs_scaling * ssb_SubcarrierOffset),"absoluteFrequencySSB has a subcarrier offset of %d while it should be %d\n",sco/scs_scaling,ssb_SubcarrierOffset);
cfg->ssb_table.ssb_offset_point_a.value = absolute_diff/(12*scs_scaling) - 10; //absoluteFrequencySSB is the central frequency of SSB which is made by 20RBs in total cfg->ssb_table.ssb_offset_point_a.value = absolute_diff/(12*scs_scaling) - 10; //absoluteFrequencySSB is the central frequency of SSB which is made by 20RBs in total
cfg->ssb_table.ssb_offset_point_a.tl.tag = NFAPI_NR_CONFIG_SSB_OFFSET_POINT_A_TAG; cfg->ssb_table.ssb_offset_point_a.tl.tag = NFAPI_NR_CONFIG_SSB_OFFSET_POINT_A_TAG;
cfg->num_tlv++; cfg->num_tlv++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment