diff --git a/openair1/PHY/INIT/defs.h b/openair1/PHY/INIT/defs.h index e2f00e3f77adc79f0534c37a41bc691f69fa5c50..defeeddbc5be618445366e17da6042490d5fc1cc 100644 --- a/openair1/PHY/INIT/defs.h +++ b/openair1/PHY/INIT/defs.h @@ -372,9 +372,11 @@ void phy_config_request(PHY_Config_t *phy_config); int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf); void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms); -int nr_init_frame_parms(nfapi_config_request_t* config, - NR_DL_FRAME_PARMS *frame_parms); +int nr_init_frame_parms(nfapi_config_request_t* config, NR_DL_FRAME_PARMS *frame_parms); +void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms); +int phy_init_nr_gNB(PHY_VARS_gNB *gNB, unsigned char is_secondary_gNB, unsigned char abstraction_flag); void nr_phy_config_request(PHY_VARS_gNB *gNB); +void phy_free_nr_gNB(PHY_VARS_gNB *gNB); /** @} */ #endif diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index f0bee5db85f521492464de432b4601e896c8ed0b..571f59ad046d29130cb37fd2d95ffb7a22471d45 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -339,7 +339,8 @@ void nr_phy_config_request(PHY_VARS_gNB *gNB) //overwrite for new NR parameters gNB_config->subframe_config.numerology_index_mu.value = 1; - gNB_config->subframe_config.duplex_mode.value = 1;//FDD + gNB_config->subframe_config.duplex_mode.value = FDD; + gNB_config->rf_config.tx_antenna_ports.value = 1; gNB_config->rf_config.dl_channel_bandwidth.value = 106; gNB_config->rf_config.ul_channel_bandwidth.value = 106; gNB_config->sch_config.half_frame_index = 0; diff --git a/openair1/PHY/INIT/nr_parms.c b/openair1/PHY/INIT/nr_parms.c index 90a027884b54421d68be9ae878ee5d5e0e4e602b..c4463a13890db781ed640b7d44f23263e803085e 100644 --- a/openair1/PHY/INIT/nr_parms.c +++ b/openair1/PHY/INIT/nr_parms.c @@ -40,7 +40,7 @@ int nr_init_frame_parms(nfapi_config_request_t* config, LOG_I(PHY,"Initializing frame parms for mu %d, N_RB %d, Ncp %d\n",mu, N_RB, Ncp); #endif - if (Ncp == 1) //EXTENDED, to be modified after lte defs are properly linked + if (Ncp == EXTENDED) AssertFatal(mu == NR_MU_2,"Invalid cyclic prefix %d for numerology index %d\n", Ncp, mu); switch(mu) { @@ -63,11 +63,18 @@ int nr_init_frame_parms(nfapi_config_request_t* config, case 65: case 106: //40 MHz - frame_parms->ofdm_symbol_size = 2048; - //frame_parms->samples_per_tti = 30720; - frame_parms->first_carrier_offset = 1412; //2048 - 636 - frame_parms->nb_prefix_samples0 = 160; - frame_parms->nb_prefix_samples = 144; + if (frame_parms->threequarter_fs) { + frame_parms->ofdm_symbol_size = 1536; + frame_parms->first_carrier_offset = 900; //1536 - 636 + frame_parms->nb_prefix_samples0 = 132; + frame_parms->nb_prefix_samples = 108; + } + else { + frame_parms->ofdm_symbol_size = 2048; + frame_parms->first_carrier_offset = 1412; //2048 - 636 + frame_parms->nb_prefix_samples0 = 176; + frame_parms->nb_prefix_samples = 144; + } break; case 133: @@ -77,16 +84,14 @@ int nr_init_frame_parms(nfapi_config_request_t* config, case 217: //80 MHz if (frame_parms->threequarter_fs) { frame_parms->ofdm_symbol_size = 3072; - //frame_parms->samples_per_tti = 46080; frame_parms->first_carrier_offset = 1770; //3072 - 1302 - frame_parms->nb_prefix_samples0 = 240; + frame_parms->nb_prefix_samples0 = 264; frame_parms->nb_prefix_samples = 216; } else { frame_parms->ofdm_symbol_size = 4096; - //frame_parms->samples_per_tti = 61440; frame_parms->first_carrier_offset = 2794; //4096 - 1302 - frame_parms->nb_prefix_samples0 = 320; + frame_parms->nb_prefix_samples0 = 352; frame_parms->nb_prefix_samples = 288; } break; @@ -134,7 +139,7 @@ int nr_init_frame_parms(nfapi_config_request_t* config, AssertFatal(1==0,"Invalid numerology index %d", mu); } - frame_parms->symbols_per_slot = ((Ncp == 0)? 14 : 12); // to redefine for different slot formats + frame_parms->symbols_per_slot = ((Ncp == NORMAL)? 14 : 12); // to redefine for different slot formats frame_parms->samples_per_subframe_wCP = frame_parms->ofdm_symbol_size * frame_parms->symbols_per_slot * frame_parms->slots_per_subframe; frame_parms->samples_per_frame_wCP = 10 * frame_parms->samples_per_subframe_wCP; frame_parms->samples_per_subframe = frame_parms->samples_per_subframe_wCP + (frame_parms->nb_prefix_samples0 * frame_parms->slots_per_subframe) + diff --git a/openair1/SCHED/defs.h b/openair1/SCHED/defs.h index 3c232a82b755bc001c59f50d4de5a6433f47db3d..57943d9bc26d9117c3554251e550d94612e0bc7e 100644 --- a/openair1/SCHED/defs.h +++ b/openair1/SCHED/defs.h @@ -163,14 +163,15 @@ void phy_procedures_UE_S_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abst */ void phy_procedures_UE_S_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstraction_flag, relaying_type_t r_type); -/*! \brief Scheduling for eNB TX procedures in normal subframes. - @param phy_vars_eNB Pointer to eNB variables on which to act +/*! \brief Scheduling for eNB/gNB TX procedures in normal subframes. + @param phy_vars_eNB/phy_vars_gNB Pointer to eNB/gNB variables on which to act @param abstraction_flag Indicator of PHY abstraction - @param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying - @param phy_vars_rn pointer to the RN variables + @param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying -- LTE only + @param phy_vars_rn pointer to the RN variables --LTE only @param do_meas Do inline timing measurement */ void phy_procedures_eNB_TX(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc,relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn,int do_meas); +void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, gNB_rxtx_proc_t *proc, int do_meas); /*! \brief Scheduling for eNB RX UE-specific procedures in normal subframes. @param phy_vars_eNB Pointer to eNB variables on which to act diff --git a/targets/RT/USER/nr-gnb.c b/targets/RT/USER/nr-gnb.c index 18ec84b5e9401b8427b50319633949af27d5809a..a8f3f7406985efcccd2c8d4324153b5da8ac14b4 100644 --- a/targets/RT/USER/nr-gnb.c +++ b/targets/RT/USER/nr-gnb.c @@ -573,7 +573,8 @@ void init_gNB_proc(int inst) { PHY_VARS_gNB *gNB; gNB_proc_t *proc; gNB_rxtx_proc_t *proc_rxtx; - pthread_attr_t *attr0=NULL,*attr1=NULL,*attr_prach=NULL; + pthread_attr_t *attr0=NULL,*attr1=NULL; + //*attr_prach=NULL; LOG_I(PHY,"%s(inst:%d) RC.nb_CC[inst]:%d \n",__FUNCTION__,inst,RC.nb_CC[inst]); diff --git a/targets/RT/USER/nr-ru.c b/targets/RT/USER/nr-ru.c index 7ca19908efd8b867bc0487510a28235d35d9e452..1b5dc345266455a2ba5fa6245266ca0399cfae42 100644 --- a/targets/RT/USER/nr-ru.c +++ b/targets/RT/USER/nr-ru.c @@ -496,7 +496,7 @@ void fh_if4p5_south_asynch_in(RU_t *ru,int *frame,int *subframe) { uint16_t packet_type; uint32_t symbol_number,symbol_mask,prach_rx; - uint32_t got_prach_info=0; +// uint32_t got_prach_info=0; symbol_number = 0; symbol_mask = (1<<(fp->symbols_per_slot * fp->slots_per_subframe))-1; @@ -505,10 +505,10 @@ void fh_if4p5_south_asynch_in(RU_t *ru,int *frame,int *subframe) { do { // Blocking, we need a timeout on this !!!!!!!!!!!!!!!!!!!!!!! recv_IF4p5(ru, &proc->frame_rx, &proc->subframe_rx, &packet_type, &symbol_number); // grab first prach information for this new subframe - if (got_prach_info==0) { + /*if (got_prach_info==0) { prach_rx = is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx); got_prach_info = 1; - } + }*/ if (proc->first_rx != 0) { *frame = proc->frame_rx; *subframe = proc->subframe_rx; @@ -781,9 +781,9 @@ void tx_rf(RU_t *ru) { T(T_ENB_PHY_OUTPUT_SIGNAL, T_INT(0), T_INT(0), T_INT(proc->frame_tx), T_INT(proc->subframe_tx), T_INT(0), T_BUFFER(&ru->common.txdata[0][proc->subframe_tx * fp->samples_per_subframe], fp->samples_per_subframe * 4)); - lte_subframe_t SF_type = nr_subframe_select(cfg,proc->subframe_tx%10); - lte_subframe_t prevSF_type = nr_subframe_select(cfg,(proc->subframe_tx+9)%10); - lte_subframe_t nextSF_type = nr_subframe_select(cfg,(proc->subframe_tx+1)%10); + nr_subframe_t SF_type = nr_subframe_select(cfg,proc->subframe_tx%10); + /*nr_subframe_t prevSF_type = nr_subframe_select(cfg,(proc->subframe_tx+9)%10); + nr_subframe_t nextSF_type = nr_subframe_select(cfg,(proc->subframe_tx+1)%10);*/ int sf_extension = 0; if ((SF_type == SF_DL) || @@ -966,7 +966,7 @@ static void* ru_thread_prach( void* param ) { if (oai_exit) break; if (wait_on_condition(&proc->mutex_prach,&proc->cond_prach,&proc->instance_cnt_prach,"ru_prach_thread") < 0) break; VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_RU_PRACH_RX, 1 ); - if (ru->gNB_list[0]){ + /*if (ru->gNB_list[0]){ prach_procedures( ru->gNB_list[0] #ifdef Rel14 @@ -987,7 +987,7 @@ static void* ru_thread_prach( void* param ) { #endif ); } - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_RU_PRACH_RX, 0 ); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_RU_PRACH_RX, 0 ); */ if (release_thread(&proc->mutex_prach,&proc->instance_cnt_prach,"ru_prach_thread") < 0) break; } @@ -1441,7 +1441,7 @@ static void* ru_thread( void* param ) { proc->frame_tx,proc->subframe_tx, RC.gNB[0][0]->proc.frame_rx,RC.gNB[0][0]->proc.subframe_rx, RC.gNB[0][0]->proc.frame_tx); - +/* LOG_D(PHY,"RU thread (do_prach %d, is_prach_subframe %d), received frame %d, subframe %d\n", ru->do_prach, is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx), @@ -1449,7 +1449,7 @@ static void* ru_thread( void* param ) { if ((ru->do_prach>0) && (is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx)==1)) { wakeup_prach_ru(ru); - } + }*/ // adjust for timing offset between RU if (ru->idx!=0) proc->frame_tx = (proc->frame_tx+proc->frame_offset)&1023; @@ -1597,10 +1597,10 @@ void init_RU_proc(RU_t *ru) { int i=0; RU_proc_t *proc; - pthread_attr_t *attr_FH=NULL,*attr_prach=NULL,*attr_asynch=NULL,*attr_synch=NULL; + pthread_attr_t *attr_FH=NULL,*attr_prach=NULL,*attr_asynch=NULL;// *attr_synch=NULL; //pthread_attr_t *attr_fep=NULL; #ifdef Rel14 - pthread_attr_t *attr_prach_br=NULL; + //pthread_attr_t *attr_prach_br=NULL; #endif char name[100]; @@ -1645,7 +1645,7 @@ void init_RU_proc(RU_t *ru) { #ifndef DEADLINE_SCHEDULER attr_FH = &proc->attr_FH; attr_prach = &proc->attr_prach; - attr_synch = &proc->attr_synch; + //attr_synch = &proc->attr_synch; attr_asynch = &proc->attr_asynch_rxtx; #endif diff --git a/targets/RT/USER/nr-softmodem.c b/targets/RT/USER/nr-softmodem.c index 4f230c29100d61fd5cea12f9eccb16dc232f3ec0..4c00d9319f610deb36ae442ca1ab017e1b928e70 100644 --- a/targets/RT/USER/nr-softmodem.c +++ b/targets/RT/USER/nr-softmodem.c @@ -19,36 +19,6 @@ * contact@openairinterface.org */ -#if 0 -//Temporary main function -int main( int argc, char **argv ) -{ - nfapi_config_request_t config; - NR_DL_FRAME_PARMS* frame_parms = malloc(sizeof(NR_DL_FRAME_PARMS)); - int16_t amp; - - int16_t** txdataF = (int16_t **)malloc(2048*2*14*2*2* sizeof(int16_t)); - int16_t* d_pss = malloc(NR_PSS_LENGTH * sizeof(int16_t)); - int16_t *d_sss = malloc(NR_SSS_LENGTH * sizeof(int16_t)); - - //logInit(); - - phy_init_nr_gNB(&config); - nr_init_frame_parms(config, frame_parms); - nr_dump_frame_parms(frame_parms); - - amp = 32767; //1_Q_15 - nr_generate_pss(d_pss, txdataF, amp, 0, 0, config, frame_parms); - nr_generate_sss(d_sss, txdataF, amp, 0, 0, config, frame_parms); - - free(txdataF); - free(d_pss); - free(d_sss); - - return 0; -} -#endif - #define _GNU_SOURCE /* See feature_test_macros(7) */ #include <sched.h> @@ -215,7 +185,7 @@ int otg_enabled; //int number_of_cards = 1; -static NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]; +//static NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]; static nfapi_config_request_t *config[MAX_NUM_CCs]; uint32_t target_dl_mcs = 28; //maximum allowed mcs uint32_t target_ul_mcs = 20; @@ -910,7 +880,7 @@ int main( int argc, char **argv ) { int i; #if defined (XFORMS) - void *status; + //void *status; #endif int CC_id;