diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 2b1c36407bd7073198d89539b103ab72b6c0bf20..da76e077414ba4e23c334c0e53955910be26cea8 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -129,7 +129,6 @@ void rx_func(void *param) { int slot_rx = info->slot_rx; int frame_tx = info->frame_tx; int slot_tx = info->slot_tx; - sl_ahead = sf_ahead*gNB->frame_parms.slots_per_subframe; nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; start_meas(&softmodem_stats_rxtx_sf); diff --git a/executables/nr-ru.c b/executables/nr-ru.c index e4fc3bc27cbddadd47927ff29c1eb8e2ae9e8261..5de1f71efd75a108aeb244c61aeeb6a30d03b152 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -99,9 +99,6 @@ int attach_rru(RU_t *ru); int connect_rau(RU_t *ru); static void NRRCconfig_RU(void); -uint16_t sf_ahead; -uint16_t slot_ahead; -uint16_t sl_ahead; extern int emulate_rf; extern int numerology; @@ -372,8 +369,8 @@ void fh_if4p5_south_in(RU_t *ru, proc->frame_rx = f; proc->timestamp_rx = (proc->frame_rx * fp->samples_per_subframe * 10) + fp->get_samples_slot_timestamp(proc->tti_rx, fp, 0); // proc->timestamp_tx = proc->timestamp_rx + (4*fp->samples_per_subframe); - proc->tti_tx = (sl+(fp->slots_per_subframe*sf_ahead))%fp->slots_per_frame; - proc->frame_tx = (sl>(fp->slots_per_frame-1-(fp->slots_per_subframe*sf_ahead))) ? (f+1)&1023 : f; + proc->tti_tx = (sl+(fp->slots_per_subframe*ru->sf_ahead))%fp->slots_per_frame; + proc->frame_tx = (sl>(fp->slots_per_frame-1-(fp->slots_per_subframe*ru->sf_ahead))) ? (f+1)&1023 : f; if (proc->first_rx == 0) { if (proc->tti_rx != *slot) { @@ -1293,8 +1290,7 @@ void *ru_thread( void *param ) { } } - sf_ahead = (uint16_t) ceil((float)6/(0x01<<fp->numerology_index)); - LOG_I(PHY, "Signaling main thread that RU %d is ready, sf_ahead %d\n",ru->idx,sf_ahead); + LOG_I(PHY, "Signaling main thread that RU %d is ready, sf_ahead %d\n",ru->idx,ru->sf_ahead); pthread_mutex_lock(&RC.ru_mutex); RC.ru_mask &= ~(1<<ru->idx); pthread_cond_signal(&RC.ru_cond); @@ -1380,9 +1376,9 @@ void *ru_thread( void *param ) { opp_enabled = opp_enabled0; } if (initial_wait == 0 && ru->rx_fhaul.trials > 1000) reset_meas(&ru->rx_fhaul); - proc->timestamp_tx = proc->timestamp_rx + (sf_ahead*fp->samples_per_subframe); - proc->frame_tx = (proc->tti_rx > (fp->slots_per_frame-1-(fp->slots_per_subframe*sf_ahead))) ? (proc->frame_rx+1)&1023 : proc->frame_rx; - proc->tti_tx = (proc->tti_rx + (fp->slots_per_subframe*sf_ahead))%fp->slots_per_frame; + proc->timestamp_tx = proc->timestamp_rx + (ru->sf_ahead*fp->samples_per_subframe); + proc->frame_tx = (proc->tti_rx > (fp->slots_per_frame-1-(fp->slots_per_subframe*ru->sf_ahead))) ? (proc->frame_rx+1)&1023 : proc->frame_rx; + proc->tti_tx = (proc->tti_rx + (fp->slots_per_subframe*ru->sf_ahead))%fp->slots_per_frame; LOG_D(PHY,"AFTER fh_south_in - SFN/SL:%d%d RU->proc[RX:%d.%d TX:%d.%d] RC.gNB[0]:[RX:%d%d TX(SFN):%d]\n", frame,slot, proc->frame_rx,proc->tti_rx, @@ -2126,6 +2122,7 @@ static void NRRCconfig_RU(void) { RC.ru[j]->if_frequency = *(RUParamList.paramarray[j][RU_IF_FREQUENCY].u64ptr); RC.ru[j]->if_freq_offset = *(RUParamList.paramarray[j][RU_IF_FREQ_OFFSET].iptr); RC.ru[j]->do_precoding = *(RUParamList.paramarray[j][RU_DO_PRECODING].iptr); + RC.ru[j]->sf_ahead = *(RUParamList.paramarray[j][RU_SF_AHEAD].iptr); RC.ru[j]->num_bands = RUParamList.paramarray[j][RU_BAND_LIST_IDX].numelt; for (i=0; i<RC.ru[j]->num_bands; i++) RC.ru[j]->band[i] = RUParamList.paramarray[j][RU_BAND_LIST_IDX].iptr[i]; RC.ru[j]->openair0_cfg.nr_flag = *(RUParamList.paramarray[j][RU_NR_FLAG].iptr); diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index 5f579196455bd3afce45f6c989211cb917b2c295..6d59137f80d5130c957b580aa372b4144fae7b27 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -764,7 +764,7 @@ int main( int argc, char **argv ) { printf("wait_gNBs()\n"); wait_gNBs(); printf("About to Init RU threads RC.nb_RU:%d\n", RC.nb_RU); - + int sl_ahead=6; if (RC.nb_RU >0) { printf("Initializing RU threads\n"); init_NR_RU(get_softmodem_params()->rf_config_file); @@ -772,7 +772,10 @@ int main( int argc, char **argv ) { for (ru_id=0; ru_id<RC.nb_RU; ru_id++) { RC.ru[ru_id]->rf_map.card=0; RC.ru[ru_id]->rf_map.chain=CC_id+chain_offset; + if (ru_id==0) sl_ahead = RC.ru[ru_id]->sf_ahead * RC.gNB[0]->frame_parms.slots_per_subframe; + else AssertFatal(RC.ru[ru_id]->sf_ahead != RC.ru[0]->sf_ahead,"RU %d has different sf_ahead %d than RU 0 %d\n",RC.ru[ru_id]->sf_ahead,RC.ru[0]->sf_ahead); } + } config_sync_var=0; @@ -789,6 +792,7 @@ int main( int argc, char **argv ) { // once all RUs are ready initialize the rest of the gNBs ((dependence on final RU parameters after configuration) printf("ALL RUs ready - init gNBs\n"); + for (int idx=0;idx<RC.nb_nr_L1_inst;idx++) RC.gNB[idx]->if_inst->sl_ahead = sl_ahead; if(IS_SOFTMODEM_DOSCOPE) { sleep(1); scopeParms_t p; diff --git a/nfapi/oai_integration/nfapi_vnf.c b/nfapi/oai_integration/nfapi_vnf.c index 44ee05940fc3aa6879867582f57fe65773b0f8d2..87fd3c8e19a6b53731988f65d00830c8d6cdcbc8 100644 --- a/nfapi/oai_integration/nfapi_vnf.c +++ b/nfapi/oai_integration/nfapi_vnf.c @@ -200,7 +200,6 @@ void install_nr_schedule_handlers(NR_IF_Module_t *if_inst); void install_schedule_handlers(IF_Module_t *if_inst); extern int single_thread_flag; extern uint16_t sf_ahead; -extern uint16_t slot_ahead; void oai_create_enb(void) { int bodge_counter=0; @@ -459,6 +458,7 @@ int wake_gNB_rxtx(PHY_VARS_gNB *gNB, uint16_t sfn, uint16_t slot) { //wait.tv_nsec = 0; // wake up TX for subframe n+sf_ahead // lock the TX mutex and make sure the thread is ready + AssertFatal(gNB->if_inst->sl_ahead==6,"gNB->if_inst->sl_ahead %d : This is hard-coded to 6 in nfapi P7!!!\n",gNB->if_inst->sl_ahead); if (pthread_mutex_timedlock(&L1_proc->mutex,&wait) != 0) { LOG_E( PHY, "[gNB] ERROR pthread_mutex_lock for gNB RXTX thread %d (IC %d)\n", L1_proc->slot_rx&1,L1_proc->instance_cnt ); exit_fun( "error locking mutex_rxtx" ); @@ -485,11 +485,11 @@ int wake_gNB_rxtx(PHY_VARS_gNB *gNB, uint16_t sfn, uint16_t slot) { // The last (TS_rx mod samples_per_frame) was n*samples_per_tti, // we want to generate subframe (n+N), so TS_tx = TX_rx+N*samples_per_tti, // and proc->subframe_tx = proc->subframe_rx+sf_ahead - L1_proc->timestamp_tx = proc->timestamp_rx + (slot_ahead *fp->samples_per_subframe); + L1_proc->timestamp_tx = proc->timestamp_rx + (gNB->if_inst->sl_ahead *fp->samples_per_subframe); L1_proc->frame_rx = proc->frame_rx; L1_proc->slot_rx = proc->slot_rx; - L1_proc->frame_tx = (L1_proc->slot_rx > (19-slot_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx; - L1_proc->slot_tx = (L1_proc->slot_rx + slot_ahead)%20; + L1_proc->frame_tx = (L1_proc->slot_rx > (19-gNB->if_inst->sl_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx; + L1_proc->slot_tx = (L1_proc->slot_rx + gNB->if_inst->sl_ahead)%20; //LOG_I(PHY, "sfn/sf:%d%d proc[rx:%d%d] rx:%d%d] About to wake rxtx thread\n\n", sfn, slot, proc->frame_rx, proc->slot_rx, L1_proc->frame_rx, L1_proc->slot_rx); //NFAPI_TRACE(NFAPI_TRACE_INFO, "\nEntering wake_gNB_rxtx sfn %d slot %d\n",L1_proc->frame_rx,L1_proc->slot_rx); diff --git a/nfapi/open-nFAPI/pnf/src/pnf_p7.c b/nfapi/open-nFAPI/pnf/src/pnf_p7.c index fb1a713e56532a60aac9f9ae6a9e3fac74cf14d7..0ce847a7355c6658f00a1171ab894a1a4bf90562 100644 --- a/nfapi/open-nFAPI/pnf/src/pnf_p7.c +++ b/nfapi/open-nFAPI/pnf/src/pnf_p7.c @@ -32,7 +32,6 @@ #define FAPI2_IP_DSCP 0 extern uint16_t sf_ahead; -extern uint16_t slot_ahead; //uint16_t sf_ahead=4; @@ -933,7 +932,7 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl // save the curren time, sfn and slot pnf_p7->slot_start_time_hr = pnf_get_current_time_hr(); - slot_ahead = 6; + int slot_ahead = 6; uint32_t sfn_slot_tx = sfnslot_add_slot(sfn, slot, slot_ahead); uint16_t sfn_tx = NFAPI_SFNSLOT2SFN(sfn_slot_tx); uint8_t slot_tx = NFAPI_SFNSLOT2SLOT(sfn_slot_tx); diff --git a/openair1/PHY/defs_RU.h b/openair1/PHY/defs_RU.h index 76dd92ef5d03d6af5284991cfb3e966fae915c22..5dfb0722db3f5e1e90efdc3c10789598b64bf2c4 100644 --- a/openair1/PHY/defs_RU.h +++ b/openair1/PHY/defs_RU.h @@ -506,6 +506,8 @@ typedef struct RU_t_s { int att_tx; /// flag to indicate precoding operation in RU int do_precoding; + /// TX processing advance in subframes + int sf_ahead; /// FAPI confiuration nfapi_nr_config_request_scf_t config; /// Frame parameters diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h index 2757e408d91e2b9b4e1cc95229d2da4102e963b6..840e1a8ab2966067366bca074d29ef3a53a1524c 100644 --- a/openair2/ENB_APP/enb_paramdef.h +++ b/openair2/ENB_APP/enb_paramdef.h @@ -99,6 +99,7 @@ typedef enum { #define CONFIG_STRING_RU_IF_FREQUENCY "if_freq" #define CONFIG_STRING_RU_IF_FREQ_OFFSET "if_offset" #define CONFIG_STRING_RU_DO_PRECODING "do_precoding" +#define CONFIG_STRING_RU_SF_AHEAD "sf_ahead" #define CONFIG_STRING_RU_NR_FLAG "nr_flag" #define CONFIG_STRING_RU_NR_SCS_FOR_RASTER "nr_scs_for_raster" @@ -131,8 +132,9 @@ typedef enum { #define RU_IF_FREQUENCY 26 #define RU_IF_FREQ_OFFSET 27 #define RU_DO_PRECODING 28 -#define RU_NR_FLAG 29 -#define RU_NR_SCS_FOR_RASTER 30 +#define RU_SF_AHEAD 29 +#define RU_NR_FLAG 30 +#define RU_NR_SCS_FOR_RASTER 31 /*-----------------------------------------------------------------------------------------------------------------------------------------*/ /* RU configuration parameters */ /* optname helpstr paramflags XXXptr defXXXval type numelt */ @@ -167,6 +169,7 @@ typedef enum { {CONFIG_STRING_RU_IF_FREQUENCY, NULL, 0, u64ptr:NULL, defuintval:0, TYPE_UINT64, 0}, \ {CONFIG_STRING_RU_IF_FREQ_OFFSET, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {CONFIG_STRING_RU_DO_PRECODING, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ + {CONFIG_STRING_RU_SF_AHEAD, NULL, 0, iptr:NULL, defintval:4, TYPE_INT, 0}, \ {CONFIG_STRING_RU_NR_FLAG, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {CONFIG_STRING_RU_NR_SCS_FOR_RASTER, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ } diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index bbec4817bdad0ed274f8f93876743a06ffd3501e..92db25178ad4e7445549545f13893f6301fa4b1c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -423,7 +423,6 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts } -extern uint16_t sl_ahead; int rrc_mac_config_req_gNB(module_id_t Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts, @@ -453,7 +452,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, * variable sl_ahead seems to not be correctly initialized, but I leave * it for information purposes here (the fix would always put 0, what * happens now, too) */ - req->SFN = i < sl_ahead; + req->SFN = i < RC.nrmac[Mod_idP]->if_inst->sl_ahead; req->Slot = i; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 0c935eea09dd04302dafd1e6907ec05bdaedb8c1..4ddffc5184e746f80f37d8409c5ec70f6ca29d21 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -400,7 +400,7 @@ void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot, uint16_t monitoring_slot_period, uint16_t monitoring_offset,uint8_t beam_index, uint8_t num_active_ssb, - int16_t *tdd_beam_association){ + int16_t *tdd_beam_association, int sl_ahead){ // preferentially we schedule the msg2 in the mixed slot or in the last dl slot // if they are allowed by search space configuration @@ -628,7 +628,8 @@ void nr_initiate_ra_proc(module_id_t module_idP, monitoring_offset, beam_index, cc->num_active_ssb, - nr_mac->tdd_beam_association); + nr_mac->tdd_beam_association, + nr_mac->if_inst->sl_ahead); ra->Msg2_frame = msg2_frame; ra->Msg2_slot = msg2_slot; diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index 57bb411dcc943c6248a66e211715ed26aecac394..46394e7c7aaf6b0ef35a3f9a4d463c7cfbd80231 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -57,8 +57,6 @@ extern int oai_nfapi_nr_srs_indication(nfapi_nr_srs_indication_t *ind); extern int oai_nfapi_nr_uci_indication(nfapi_nr_uci_indication_t *ind); extern int oai_nfapi_nr_rach_indication(nfapi_nr_rach_indication_t *ind); extern uint8_t nfapi_mode; -extern uint16_t sf_ahead; -extern uint16_t sl_ahead; void handle_nr_rach(NR_UL_IND_t *UL_info) @@ -472,14 +470,14 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) { nfapi_nr_config_request_scf_t *cfg = &mac->config[CC_id]; int spf = get_spf(cfg); gNB_dlsch_ulsch_scheduler(module_id, - (UL_info->frame+((UL_info->slot>(spf-1-sl_ahead))?1:0)) % 1024, - (UL_info->slot+sl_ahead)%spf); + (UL_info->frame+((UL_info->slot>(spf-1-ifi->sl_ahead))?1:0)) % 1024, + (UL_info->slot+ifi->sl_ahead)%spf); ifi->CC_mask = 0; sched_info->module_id = module_id; sched_info->CC_id = CC_id; - sched_info->frame = (UL_info->frame + ((UL_info->slot>(spf-1-sl_ahead)) ? 1 : 0)) % 1024; - sched_info->slot = (UL_info->slot+sl_ahead)%spf; + sched_info->frame = (UL_info->frame + ((UL_info->slot>(spf-1-ifi->sl_ahead)) ? 1 : 0)) % 1024; + sched_info->slot = (UL_info->slot+ifi->sl_ahead)%spf; sched_info->DL_req = &mac->DL_req[CC_id]; sched_info->UL_dci_req = &mac->UL_dci_req[CC_id]; diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.h b/openair2/NR_PHY_INTERFACE/NR_IF_Module.h index f857151763499653ee38e8ccf79995be93ddad83..9d543b0918481dc3109bf3ed685423b417766663 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.h +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.h @@ -115,6 +115,7 @@ typedef struct NR_IF_Module_s { uint16_t current_frame; uint8_t current_slot; pthread_mutex_t if_mutex; + int sl_ahead; } NR_IF_Module_t; /*Initial */ diff --git a/openair2/PHY_INTERFACE/IF_Module.c b/openair2/PHY_INTERFACE/IF_Module.c index fba9e1d8b6382612736973a1b6a1f96b0b29838a..68d390f0973963e98b783dcd57035d3e33d599ee 100644 --- a/openair2/PHY_INTERFACE/IF_Module.c +++ b/openair2/PHY_INTERFACE/IF_Module.c @@ -16,7 +16,7 @@ extern int oai_nfapi_cqi_indication(nfapi_cqi_indication_t *cqi_ind); extern int oai_nfapi_sr_indication(nfapi_sr_indication_t *ind); extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind); -extern uint16_t sf_ahead; +int sf_ahead=4; extern UL_RCC_IND_t UL_RCC_INFO; extern RAN_CONTEXT_t RC; diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index 0b6b0b3a757ab61da2546348aa2b392e8118efda..49f7db2867334cfb0d6c26d053e93a789958fc5f 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -112,8 +112,6 @@ extern int transmission_mode; extern int oaisim_flag; -//uint16_t sf_ahead=4; -extern uint16_t sf_ahead; #include "executables/thread-common.h" //extern PARALLEL_CONF_t get_thread_parallel_conf(void); //extern WORKER_CONF_t get_thread_worker_conf(void); @@ -466,11 +464,11 @@ void eNB_top(PHY_VARS_eNB *eNB, if (!oai_exit) { T(T_ENB_MASTER_TICK, T_INT(0), T_INT(ru_proc->frame_rx), T_INT(ru_proc->tti_rx)); - L1_proc->timestamp_tx = ru_proc->timestamp_rx + (sf_ahead*fp->samples_per_tti); + L1_proc->timestamp_tx = ru_proc->timestamp_rx + (ru->sf_ahead*fp->samples_per_tti); L1_proc->frame_rx = ru_proc->frame_rx; L1_proc->subframe_rx = ru_proc->tti_rx; - L1_proc->frame_tx = (L1_proc->subframe_rx > (9-sf_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx; - L1_proc->subframe_tx = (L1_proc->subframe_rx + sf_ahead)%10; + L1_proc->frame_tx = (L1_proc->subframe_rx > (9-ru->sf_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx; + L1_proc->subframe_tx = (L1_proc->subframe_rx + ru->sf_ahead)%10; if (rxtx(eNB,L1_proc,string) < 0) LOG_E(PHY,"eNB %d CC_id %d failed during execution\n",eNB->Mod_id,eNB->CC_id); @@ -614,11 +612,11 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB, // The last (TS_rx mod samples_per_frame) was n*samples_per_tti, // we want to generate subframe (n+sf_ahead), so TS_tx = TX_rx+sf_ahead*samples_per_tti, // and proc->subframe_tx = proc->subframe_rx+sf_ahead - L1_proc->timestamp_tx = ru_proc->timestamp_rx + (sf_ahead*fp->samples_per_tti); + L1_proc->timestamp_tx = ru_proc->timestamp_rx + (ru->sf_ahead*fp->samples_per_tti); L1_proc->frame_rx = ru_proc->frame_rx; L1_proc->subframe_rx = ru_proc->tti_rx; - L1_proc->frame_tx = (L1_proc->subframe_rx > (9-sf_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx; - L1_proc->subframe_tx = (L1_proc->subframe_rx + sf_ahead)%10; + L1_proc->frame_tx = (L1_proc->subframe_rx > (9-ru->sf_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx; + L1_proc->subframe_tx = (L1_proc->subframe_rx + ru->sf_ahead)%10; LOG_D(PHY,"wakeup_rxtx: L1_proc->subframe_rx %d, L1_proc->subframe_tx %d, RU %d\n",L1_proc->subframe_rx,L1_proc->subframe_tx,ru->idx); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_WAKEUP_RXTX_RX_RU+ru->idx, L1_proc->frame_rx); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_WAKEUP_RXTX_RX_RU+ru->idx, L1_proc->subframe_rx); diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 8ad610f1af7f8911a27e2f17b45f0e3fc4fdea9b..014e8854e2bbc90eed5e3e1e3f13e4546378e70e 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -109,7 +109,6 @@ const char ru_states[6][9] = {"RU_IDLE","RU_CONFIG","RU_READY","RU_RUN","RU_ERRO extern const char NB_functions[7][20]; extern const char NB_timing[2][20]; -extern uint16_t sf_ahead; extern const char ru_if_types[MAX_RU_IF_TYPES][20]; @@ -254,8 +253,8 @@ void fh_if4p5_south_in(RU_t *ru, // proc->timestamp_tx = proc->timestamp_rx + (4*fp->samples_per_tti); if (get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD) { - proc->tti_tx = (sf+sf_ahead)%10; - proc->frame_tx = (sf>(9-sf_ahead)) ? (f+1)&1023 : f; + proc->tti_tx = (sf+ru->sf_ahead)%10; + proc->frame_tx = (sf>(9-ru->sf_ahead)) ? (f+1)&1023 : f; } LOG_D(PHY,"Setting proc for (%d,%d)\n",sf,f); @@ -654,13 +653,13 @@ void rx_rf(RU_t *ru, if (get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD && ru->fh_north_asynch_in == NULL) { #ifdef PHY_TX_THREAD - proc->timestamp_phy_tx = proc->timestamp_rx+((sf_ahead-1)*fp->samples_per_tti); - proc->subframe_phy_tx = (proc->tti_rx+(sf_ahead-1))%10; - proc->frame_phy_tx = (proc->tti_rx>(9-(sf_ahead-1))) ? (proc->frame_rx+1)&1023 : proc->frame_rx; + proc->timestamp_phy_tx = proc->timestamp_rx+((ru->sf_ahead-1)*fp->samples_per_tti); + proc->subframe_phy_tx = (proc->tti_rx+(ru->sf_ahead-1))%10; + proc->frame_phy_tx = (proc->tti_rx>(9-(ru->sf_ahead-1))) ? (proc->frame_rx+1)&1023 : proc->frame_rx; #else - proc->timestamp_tx = proc->timestamp_rx+(sf_ahead*fp->samples_per_tti); - proc->tti_tx = (proc->tti_rx+sf_ahead)%10; - proc->frame_tx = (proc->tti_rx>(9-sf_ahead)) ? (proc->frame_rx+1)&1023 : proc->frame_rx; + proc->timestamp_tx = proc->timestamp_rx+(ru->sf_ahead*fp->samples_per_tti); + proc->tti_tx = (proc->tti_rx+ru->sf_ahead)%10; + proc->frame_tx = (proc->tti_rx>(9-ru->sf_ahead)) ? (proc->frame_rx+1)&1023 : proc->frame_rx; #endif //proc->timestamp_tx = proc->timestamp_rx+(sf_ahead*fp->samples_per_tti); //proc->subframe_tx = (proc->tti_rx+sf_ahead)%10; @@ -3072,6 +3071,7 @@ RU_t **RCconfig_RU(int nb_RU,int nb_L1_inst,PHY_VARS_eNB ***eNB,uint64_t *ru_mas ru[j]->nb_rx = *(RUParamList.paramarray[j][RU_NB_RX_IDX].uptr); ru[j]->att_tx = *(RUParamList.paramarray[j][RU_ATT_TX_IDX].uptr); ru[j]->att_rx = *(RUParamList.paramarray[j][RU_ATT_RX_IDX].uptr); + ru[j]->sf_ahead = *(RUParamList.paramarray[j][RU_SF_AHEAD_IDX].uptr); *ru_mask= (*ru_mask)|(1<<j); }// j=0..num_rus } diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 85e493f19485493bbe14cbe517337d22bbba0b1a..286d20ec09c3fb8a4eee1142aed861d836ff2ac0 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -101,7 +101,6 @@ pthread_cond_t nfapi_sync_cond; pthread_mutex_t nfapi_sync_mutex; int nfapi_sync_var=-1; //!< protected by mutex \ref nfapi_sync_mutex -uint16_t sf_ahead=4; pthread_cond_t sync_cond; pthread_mutex_t sync_mutex;