From 31e306abdc894ffd09642f875e600d1561297ac5 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 17 Sep 2021 17:10:22 +0200 Subject: [PATCH 01/28] adding logs --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 2 +- openair1/SCHED_NR/fapi_nr_l1.c | 3 ++- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 9 +++++---- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index db905039d7..2a1556f432 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -429,7 +429,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_confidence_level = no_conf ? 1 : 0; uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(1); uci_pdu->harq->harq_list[0].harq_value = index&0x01; - LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d srt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d\n", + LOG_I(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d srt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d\n", frame,slot,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); diff --git a/openair1/SCHED_NR/fapi_nr_l1.c b/openair1/SCHED_NR/fapi_nr_l1.c index b2a802ab08..ad78dbf355 100644 --- a/openair1/SCHED_NR/fapi_nr_l1.c +++ b/openair1/SCHED_NR/fapi_nr_l1.c @@ -104,7 +104,8 @@ void handle_nfapi_nr_pdcch_pdu(PHY_VARS_gNB *gNB, int frame, int slot, nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu) { - LOG_D(PHY,"Frame %d, Slot %d: DCI processing - proc:slot_tx:%d pdcch_pdu_rel15->numDlDci:%d\n",frame,slot, slot, pdcch_pdu->pdcch_pdu_rel15.numDlDci); + if(pdcch_pdu->pdcch_pdu_rel15.CoreSetType==1) + LOG_I(PHY,"Frame %d, Slot %d: DCI processing - proc:slot_tx:%d pdcch_pdu_rel15->numDlDci:%d\n",frame,slot, slot, pdcch_pdu->pdcch_pdu_rel15.numDlDci); // copy dci configuration into gNB structure // gNB->pdcch_pdu = pdcch_pdu; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index b98c8c9c7b..9b78bdf57c 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -164,10 +164,11 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, gNB->Mod_id,frame,slot,pdcch_pdu_id,ul_pdcch_pdu_id); if (pdcch_pdu_id >= 0 || ul_pdcch_pdu_id >= 0) { - LOG_D(PHY, "[gNB %d] Frame %d slot %d Calling nr_generate_dci_top (number of UL/DL DCI %d/%d)\n", - gNB->Mod_id, frame, slot, - gNB->ul_pdcch_pdu[ul_pdcch_pdu_id].pdcch_pdu.pdcch_pdu.pdcch_pdu_rel15.numDlDci, - gNB->pdcch_pdu[pdcch_pdu_id].pdcch_pdu.pdcch_pdu_rel15.numDlDci); + if(gNB->pdcch_pdu[pdcch_pdu_id].pdcch_pdu.pdcch_pdu_rel15.CoreSetType==1) + LOG_I(PHY, "[gNB %d] Frame %d slot %d Calling nr_generate_dci_top (number of UL/DL DCI %d/%d)\n", + gNB->Mod_id, frame, slot, + gNB->ul_pdcch_pdu[ul_pdcch_pdu_id].pdcch_pdu.pdcch_pdu.pdcch_pdu_rel15.numDlDci, + gNB->pdcch_pdu[pdcch_pdu_id].pdcch_pdu.pdcch_pdu_rel15.numDlDci); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_PDCCH_TX,1); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 8ae2a5d6dc..5a7e5c2260 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -1074,7 +1074,7 @@ void nr_schedule_ue_spec(module_id_t module_id, dci_payload.pdsch_to_harq_feedback_timing_indicator.val = pucch->timing_indicator; // PDSCH to HARQ TI dci_payload.antenna_ports.val = ps->dmrs_ports_id; dci_payload.dmrs_sequence_initialization.val = pdsch_pdu->SCID; - LOG_D(NR_MAC, + LOG_I(NR_MAC, "%4d.%2d DCI type 1 payload: freq_alloc %d (%d,%d,%d), " "time_alloc %d, vrb to prb %d, mcs %d tb_scaling %d ndi %d rv %d tpc %d\n", frame, From 9525beb3995b0acaa73bc1ffa67724afacabe82d Mon Sep 17 00:00:00 2001 From: Eurecom Date: Sun, 19 Sep 2021 14:46:47 +0200 Subject: [PATCH 02/28] N310 testing --- executables/nr-ru.c | 35 +++++++++++++++++++---- openair1/PHY/NR_TRANSPORT/nr_dci.c | 4 +-- openair1/PHY/TOOLS/time_meas.c | 10 +++---- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 2 +- 4 files changed, 38 insertions(+), 13 deletions(-) diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 39bd99c86e..16f1938f92 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -615,6 +615,7 @@ void rx_rf(RU_t *ru,int *frame,int *slot) { openair0_timestamp ts,old_ts; AssertFatal(*slotslots_per_frame && *slot>=0, "slot %d is illegal (%d)\n",*slot,fp->slots_per_frame); + start_meas(&ru->rx_fhaul); for (i=0; inb_rx; i++) rxp[i] = (void *)&ru->common.rxdata[i][fp->get_samples_slot_timestamp(*slot,fp,0)]; @@ -694,6 +695,8 @@ void rx_rf(RU_t *ru,int *frame,int *slot) { //exit_fun( "problem receiving samples" ); LOG_E(PHY, "problem receiving samples\n"); } + + stop_meas(&ru->rx_fhaul); } @@ -742,6 +745,9 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) { flags = 3; // end of burst } + // if this is the first TX, flags=2 => flags=2 (Start of burst), flags=1 => flags=2 (start of burst), flags=3 => flags = 4 (start and end of burst) + if (flags != 2 && proc->first_tx==1) flags += 1; + if (fp->freq_range==nr_FR2) { // the beam index is written in bits 8-10 of the flags // bit 11 enables the gpio programming @@ -763,6 +769,7 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) { flags |= beam<<8; LOG_D(HW,"slot %d, beam %d\n",slot,ru->common.beam_id[0][slot*fp->symbols_per_slot]); } + if (proc->first_tx == 1) proc->first_tx = 0; VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_WRITE_FLAGS, flags ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, frame ); @@ -780,8 +787,8 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) { siglen+sf_extension, ru->nb_tx, flags); - LOG_D(PHY,"[TXPATH] RU %d aa %d tx_rf, writing to TS %llu, frame %d, unwrapped_frame %d, slot %d, returned %d, E %f\n",ru->idx,i, - (long long unsigned int)timestamp,frame,proc->frame_tx_unwrap,slot, txs,10*log10((double)signal_energy(txp[0],siglen+sf_extension))); + LOG_D(PHY,"[TXPATH] RU %d aa %d tx_rf, writing to TS %llu, frame %d, unwrapped_frame %d, slot %d, flags %d, siglen+sf_extension %d, returned %d, E %f\n",ru->idx,i, + (long long unsigned int)timestamp,frame,proc->frame_tx_unwrap,slot, flags, siglen+sf_extension, txs,10*log10((double)signal_energy(txp[0],siglen+sf_extension))); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 ); //AssertFatal(txs == 0,"trx write function error %d\n", txs); } @@ -1164,8 +1171,7 @@ void *ru_stats_thread(void *param) { print_meas(&ru->ofdm_total_stats,"feptx_total",NULL,NULL); } - if (ru->fh_north_asynch_in) print_meas(&ru->rx_fhaul,"rx_fhaul",NULL,NULL); - + print_meas(&ru->rx_fhaul,"rx_fhaul",NULL,NULL); print_meas(&ru->tx_fhaul,"tx_fhaul",NULL,NULL); if (ru->fh_north_out) { @@ -1241,7 +1247,14 @@ void *ru_thread( void *param ) { int slot = fp->slots_per_frame-1; int frame = 1023; char threadname[40]; + int initial_wait=1; + int opp_enabled0 = opp_enabled; + nfapi_nr_config_request_scf_t *cfg = &ru->config; + + // set the timing measurements for startup phase, for RX fronthaul settling measurements, put it to configured value after + opp_enabled = 1; + // set default return value ru_thread_status = 0; // set default return value @@ -1343,6 +1356,18 @@ void *ru_thread( void *param ) { if (ru->fh_south_in) ru->fh_south_in(ru,&frame,&slot); else AssertFatal(1==0, "No fronthaul interface at south port"); + if (initial_wait == 1 && proc->frame_rx < 1000 && ru->fh_south_in == rx_rf) { + if (proc->frame_rx>0 && ((proc->frame_rx % 100) == 0) && proc->tti_rx==0) { + LOG_I(PHY,"delay processing to let RX stream settle, frame %d (trials %d)\n",proc->frame_rx,ru->rx_fhaul.trials); + print_meas(&ru->rx_fhaul,"rx_fhaul",NULL,NULL); + reset_meas(&ru->rx_fhaul); + } + continue; + } + if (proc->frame_rx>=800) { + initial_wait=0; + opp_enabled = opp_enabled0; + } 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; @@ -1701,6 +1726,7 @@ void set_function_spec_param(RU_t *ru) { switch (ru->if_south) { case LOCAL_RF: // this is an RU with integrated RF (RRU, gNB) + reset_meas(&ru->rx_fhaul); if (ru->function == NGFI_RRU_IF5) { // IF5 RRU ru->do_prach = 0; // no prach processing in RU ru->fh_north_in = NULL; // no shynchronous incoming fronthaul from north @@ -1738,7 +1764,6 @@ void set_function_spec_param(RU_t *ru) { ru->ifdevice.host_type = RRU_HOST; ru->rfdevice.host_type = RRU_HOST; ru->ifdevice.eth_params = &ru->eth_params; - reset_meas(&ru->rx_fhaul); reset_meas(&ru->tx_fhaul); reset_meas(&ru->compression); reset_meas(&ru->transport); diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.c b/openair1/PHY/NR_TRANSPORT/nr_dci.c index a48954f802..194c7c0c56 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.c @@ -213,7 +213,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, (amp * mod_dmrs[l][(dmrs_idx << 1) + 1]) >> 15; #ifdef DEBUG_PDCCH_DMRS - if (dci_pdu->RNTI!=0xFFFF) LOG_I(PHY,"PDCCH DMRS %d: l %d position %d => (%d,%d)\n",dmrs_idx,l,k,((int16_t *)txdataF)[(l*frame_parms->ofdm_symbol_size + k)<<1], + if (dci_pdu->RNTI!=0xFFFF) LOG_D(PHY,"PDCCH DMRS %d: l %d position %d => (%d,%d)\n",dmrs_idx,l,k,((int16_t *)txdataF)[(l*frame_parms->ofdm_symbol_size + k)<<1], ((int16_t *)txdataF)[((l*frame_parms->ofdm_symbol_size + k)<<1)+1]); #endif @@ -225,7 +225,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, ((int16_t *) txdataF)[((l * frame_parms->ofdm_symbol_size + k) << 1) + 1] = (amp * mod_dci[(dci_idx << 1) + 1]) >> 15; #ifdef DEBUG_DCI - printf("PDCCH: l %d position %d => (%d,%d)\n",l,k,((int16_t *)txdataF)[(l*frame_parms->ofdm_symbol_size + k)<<1], + if (dci_pdu->RNTI!=0xFFFF) LOG_D(PHY,"PDCCH: l %d position %d => (%d,%d)\n",l,k,((int16_t *)txdataF)[(l*frame_parms->ofdm_symbol_size + k)<<1], ((int16_t *)txdataF)[((l*frame_parms->ofdm_symbol_size + k)<<1)+1]); #endif diff --git a/openair1/PHY/TOOLS/time_meas.c b/openair1/PHY/TOOLS/time_meas.c index 001770c876..ea766e461a 100644 --- a/openair1/PHY/TOOLS/time_meas.c +++ b/openair1/PHY/TOOLS/time_meas.c @@ -64,8 +64,8 @@ int cpumeas(int action) } void print_meas_now(time_stats_t *ts, - const char *name, - FILE *file_name) + const char *name, + FILE *file_name) { if (opp_enabled) { //static double cpu_freq_GHz = 3.2; @@ -80,9 +80,9 @@ void print_meas_now(time_stats_t *ts, } void print_meas(time_stats_t *ts, - const char *name, - time_stats_t *total_exec_time, - time_stats_t *sf_exec_time) + const char *name, + time_stats_t *total_exec_time, + time_stats_t *sf_exec_time) { if (opp_enabled) { static int first_time = 0; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index b98c8c9c7b..72b8c4db8e 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -164,7 +164,7 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, gNB->Mod_id,frame,slot,pdcch_pdu_id,ul_pdcch_pdu_id); if (pdcch_pdu_id >= 0 || ul_pdcch_pdu_id >= 0) { - LOG_D(PHY, "[gNB %d] Frame %d slot %d Calling nr_generate_dci_top (number of UL/DL DCI %d/%d)\n", + if (slot>0) LOG_D(PHY, "[gNB %d] Frame %d slot %d Calling nr_generate_dci_top (number of UL/DL DCI %d/%d)\n", gNB->Mod_id, frame, slot, gNB->ul_pdcch_pdu[ul_pdcch_pdu_id].pdcch_pdu.pdcch_pdu.pdcch_pdu_rel15.numDlDci, gNB->pdcch_pdu[pdcch_pdu_id].pdcch_pdu.pdcch_pdu_rel15.numDlDci); From f21211c23d304b4f1a3327a7bad9126addccaaee Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Mon, 20 Sep 2021 00:24:43 +0200 Subject: [PATCH 03/28] removed logging --- executables/nr-ru.c | 21 +++++++++----------- openair1/PHY/NR_TRANSPORT/nr_dci.c | 6 +++--- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 4 +++- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 16f1938f92..13a16d4187 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -659,11 +659,11 @@ void rx_rf(RU_t *ru,int *frame,int *slot) { proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_subframe*10))&1023; proc->tti_rx = fp->get_slot_from_timestamp(proc->timestamp_rx,fp); // synchronize first reception to frame 0 subframe 0 - LOG_D(PHY,"RU %d/%d TS %llu (off %d), frame %d, slot %d.%d / %d\n", + LOG_D(PHY,"RU %d/%d TS %llu , frame %d, slot %d.%d / %d\n", ru->idx, 0, - (unsigned long long int)proc->timestamp_rx, - (int)ru->ts_offset,proc->frame_rx,proc->tti_rx,proc->tti_tx,fp->slots_per_frame); + (unsigned long long int)(proc->timestamp_rx+ru->ts_offset), + proc->frame_rx,proc->tti_rx,proc->tti_tx,fp->slots_per_frame); // dump VCD output for first RU in list if (ru == RC.ru[0]) { @@ -689,7 +689,7 @@ void rx_rf(RU_t *ru,int *frame,int *slot) { } //printf("timestamp_rx %lu, frame %d(%d), subframe %d(%d)\n",ru->timestamp_rx,proc->frame_rx,frame,proc->tti_rx,subframe); - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, proc->timestamp_rx&0xffffffff ); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, (proc->timestamp_rx+ru->ts_offset)&0xffffffff ); if (rxs != samples_per_slot) { //exit_fun( "problem receiving samples" ); @@ -745,9 +745,6 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) { flags = 3; // end of burst } - // if this is the first TX, flags=2 => flags=2 (Start of burst), flags=1 => flags=2 (start of burst), flags=3 => flags = 4 (start and end of burst) - if (flags != 2 && proc->first_tx==1) flags += 1; - if (fp->freq_range==nr_FR2) { // the beam index is written in bits 8-10 of the flags // bit 11 enables the gpio programming @@ -778,7 +775,7 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) { for (i=0; inb_tx; i++) txp[i] = (void *)&ru->common.txdata[i][fp->get_samples_slot_timestamp(slot,fp,0)-sf_extension]; - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (timestamp-ru->openair0_cfg.tx_sample_advance)&0xffffffff ); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (timestamp+ru->ts_offset-ru->openair0_cfg.tx_sample_advance)&0xffffffff ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 ); // prepare tx buffer pointers txs = ru->rfdevice.trx_write_func(&ru->rfdevice, @@ -788,7 +785,7 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) { ru->nb_tx, flags); LOG_D(PHY,"[TXPATH] RU %d aa %d tx_rf, writing to TS %llu, frame %d, unwrapped_frame %d, slot %d, flags %d, siglen+sf_extension %d, returned %d, E %f\n",ru->idx,i, - (long long unsigned int)timestamp,frame,proc->frame_tx_unwrap,slot, flags, siglen+sf_extension, txs,10*log10((double)signal_energy(txp[0],siglen+sf_extension))); + (long long unsigned int)(timestamp+ru->ts_offset-ru->openair0_cfg.tx_sample_advance-sf_extension),frame,proc->frame_tx_unwrap,slot, flags, siglen+sf_extension, txs,10*log10((double)signal_energy(txp[0],siglen+sf_extension))); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 ); //AssertFatal(txs == 0,"trx write function error %d\n", txs); } @@ -1303,7 +1300,7 @@ void *ru_thread( void *param ) { } sf_ahead = (uint16_t) ceil((float)6/(0x01<numerology_index)); - LOG_I(PHY, "Signaling main thread that RU %d is ready\n",ru->idx); + LOG_I(PHY, "Signaling main thread that RU %d is ready, sf_ahead %d\n",ru->idx,sf_ahead); pthread_mutex_lock(&RC.ru_mutex); RC.ru_mask &= ~(1<idx); pthread_cond_signal(&RC.ru_cond); @@ -1356,7 +1353,7 @@ void *ru_thread( void *param ) { if (ru->fh_south_in) ru->fh_south_in(ru,&frame,&slot); else AssertFatal(1==0, "No fronthaul interface at south port"); - if (initial_wait == 1 && proc->frame_rx < 1000 && ru->fh_south_in == rx_rf) { + if (initial_wait == 1 && proc->frame_rx < 300 && ru->fh_south_in == rx_rf) { if (proc->frame_rx>0 && ((proc->frame_rx % 100) == 0) && proc->tti_rx==0) { LOG_I(PHY,"delay processing to let RX stream settle, frame %d (trials %d)\n",proc->frame_rx,ru->rx_fhaul.trials); print_meas(&ru->rx_fhaul,"rx_fhaul",NULL,NULL); @@ -1364,7 +1361,7 @@ void *ru_thread( void *param ) { } continue; } - if (proc->frame_rx>=800) { + if (proc->frame_rx>=300) { initial_wait=0; opp_enabled = opp_enabled0; } diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.c b/openair1/PHY/NR_TRANSPORT/nr_dci.c index 194c7c0c56..b07f3eb2a8 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.c @@ -97,12 +97,12 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, cset_start_symb = pdcch_pdu_rel15->StartSymbolIndex; cset_nsymb = pdcch_pdu_rel15->DurationSymbols; dci_idx = 0; - LOG_D(PHY, "Coreset rb_offset %d, nb_rb %d BWP Start %d\n",rb_offset,n_rb,pdcch_pdu_rel15->BWPStart); - LOG_D(PHY, "Coreset starting subcarrier %d on symbol %d (%d symbols)\n", cset_start_sc, cset_start_symb, cset_nsymb); + LOG_I(PHY, "Coreset rb_offset %d, nb_rb %d BWP Start %d\n",rb_offset,n_rb,pdcch_pdu_rel15->BWPStart); + LOG_I(PHY, "Coreset starting subcarrier %d on symbol %d (%d symbols)\n", cset_start_sc, cset_start_symb, cset_nsymb); // DMRS length is per OFDM symbol uint32_t dmrs_length = n_rb*6; //2(QPSK)*3(per RB)*6(REG per CCE) uint32_t encoded_length = dci_pdu->AggregationLevel*108; //2(QPSK)*9(per RB)*6(REG per CCE) - if (dci_pdu->RNTI!=0xFFFF) LOG_D(PHY, "DL_DCI : rb_offset %d, nb_rb %d, DMRS length per symbol %d\t DCI encoded length %d (precoder_granularity %d,reg_mapping %d),Scrambling_Id %d,ScramblingRNTI %x,PayloadSizeBits %d\n", + if (1/*dci_pdu->RNTI!=0xFFFF*/) LOG_I(PHY, "DL_DCI : rb_offset %d, nb_rb %d, DMRS length per symbol %d\t DCI encoded length %d (precoder_granularity %d,reg_mapping %d),Scrambling_Id %d,ScramblingRNTI %x,PayloadSizeBits %d\n", rb_offset, n_rb,dmrs_length, encoded_length,pdcch_pdu_rel15->precoderGranularity,pdcch_pdu_rel15->CceRegMappingType, dci_pdu->ScramblingId,dci_pdu->ScramblingRNTI,dci_pdu->PayloadSizeBits); dmrs_length += rb_offset*6; // To accommodate more DMRS symbols in case of rb offset diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index 5907cedb0c..e7a3c61c51 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -416,6 +416,7 @@ static int trx_usrp_write(openair0_device *device, s->tx_md.start_of_burst = (s->tx_count==0) ? true : first_packet_state; s->tx_md.end_of_burst = last_packet_state; s->tx_md.time_spec = uhd::time_spec_t::from_ticks(timestamp, s->sample_rate); + s->tx_count++; VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_BEAM_SWITCHING_GPIO,1); @@ -555,6 +556,7 @@ void *trx_usrp_write_thread(void * arg){ s->tx_md.start_of_burst = (s->tx_count==0) ? true : first_packet; s->tx_md.end_of_burst = last_packet; s->tx_md.time_spec = uhd::time_spec_t::from_ticks(timestamp, s->sample_rate); + LOG_D(PHY,"usrp_tx_write: tx_count %llu SoB %d, EoB %d, TS %llu\n",(unsigned long long)s->tx_count,s->tx_md.start_of_burst,s->tx_md.end_of_burst,(unsigned long long)timestamp); s->tx_count++; // bit 3 enables gpio (for backward compatibility) @@ -940,7 +942,7 @@ extern "C" { LOG_I(HW, "openair0_cfg[0].sdr_addrs == '%s'\n", openair0_cfg[0].sdr_addrs); LOG_I(HW, "openair0_cfg[0].clock_source == '%d' (internal = %d, external = %d)\n", openair0_cfg[0].clock_source,internal,external); usrp_state_t *s ; - int choffset = 0; + int choffset = 1; if ( device->priv == NULL) { s=(usrp_state_t *)calloc(sizeof(usrp_state_t),1); From 9ec02b2010866f1a6ce4bfda57c88f315bb634c0 Mon Sep 17 00:00:00 2001 From: Eurecom Date: Mon, 20 Sep 2021 10:56:23 +0200 Subject: [PATCH 04/28] pucch0 threshold rule --- executables/nr-ru.c | 2 ++ openair1/PHY/NR_TRANSPORT/nr_dci.c | 6 +++--- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 6 +++--- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 13a16d4187..98140850df 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -1169,6 +1169,7 @@ void *ru_stats_thread(void *param) { } print_meas(&ru->rx_fhaul,"rx_fhaul",NULL,NULL); + print_meas(&ru->tx_fhaul,"tx_fhaul",NULL,NULL); if (ru->fh_north_out) { @@ -1365,6 +1366,7 @@ void *ru_thread( void *param ) { initial_wait=0; 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; diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.c b/openair1/PHY/NR_TRANSPORT/nr_dci.c index b07f3eb2a8..194c7c0c56 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.c @@ -97,12 +97,12 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, cset_start_symb = pdcch_pdu_rel15->StartSymbolIndex; cset_nsymb = pdcch_pdu_rel15->DurationSymbols; dci_idx = 0; - LOG_I(PHY, "Coreset rb_offset %d, nb_rb %d BWP Start %d\n",rb_offset,n_rb,pdcch_pdu_rel15->BWPStart); - LOG_I(PHY, "Coreset starting subcarrier %d on symbol %d (%d symbols)\n", cset_start_sc, cset_start_symb, cset_nsymb); + LOG_D(PHY, "Coreset rb_offset %d, nb_rb %d BWP Start %d\n",rb_offset,n_rb,pdcch_pdu_rel15->BWPStart); + LOG_D(PHY, "Coreset starting subcarrier %d on symbol %d (%d symbols)\n", cset_start_sc, cset_start_symb, cset_nsymb); // DMRS length is per OFDM symbol uint32_t dmrs_length = n_rb*6; //2(QPSK)*3(per RB)*6(REG per CCE) uint32_t encoded_length = dci_pdu->AggregationLevel*108; //2(QPSK)*9(per RB)*6(REG per CCE) - if (1/*dci_pdu->RNTI!=0xFFFF*/) LOG_I(PHY, "DL_DCI : rb_offset %d, nb_rb %d, DMRS length per symbol %d\t DCI encoded length %d (precoder_granularity %d,reg_mapping %d),Scrambling_Id %d,ScramblingRNTI %x,PayloadSizeBits %d\n", + if (dci_pdu->RNTI!=0xFFFF) LOG_D(PHY, "DL_DCI : rb_offset %d, nb_rb %d, DMRS length per symbol %d\t DCI encoded length %d (precoder_granularity %d,reg_mapping %d),Scrambling_Id %d,ScramblingRNTI %x,PayloadSizeBits %d\n", rb_offset, n_rb,dmrs_length, encoded_length,pdcch_pdu_rel15->precoderGranularity,pdcch_pdu_rel15->CceRegMappingType, dci_pdu->ScramblingId,dci_pdu->ScramblingRNTI,dci_pdu->PayloadSizeBits); dmrs_length += rb_offset*6; // To accommodate more DMRS symbols in case of rb offset diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index db905039d7..51bb5d7b21 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -399,7 +399,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_stats->pucch0_thres = gNB->pucch0_thres; /* + (10*max_n0);*/ bool no_conf=false; if (nr_sequences>1) { - if (xrtmag_dBtimes10 < uci_stats->pucch0_thres+xrtmag_next_dBtimes10) + if (xrtmag_dBtimes10 < (50+xrtmag_next_dBtimes10) || SNRtimes10 < uci_stats->pucch0_thres) no_conf=true; } gNB->bad_pucch += no_conf; @@ -429,7 +429,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_confidence_level = no_conf ? 1 : 0; uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(1); uci_pdu->harq->harq_list[0].harq_value = index&0x01; - LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d srt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d\n", + LOG_I(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d srt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d\n", frame,slot,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); @@ -446,7 +446,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2); uci_pdu->harq->harq_list[1].harq_value = index&0x01; uci_pdu->harq->harq_list[0].harq_value = (index>>1)&0x01; - LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d xrt_mag_next %d\n", + LOG_I(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d xrt_mag_next %d\n", frame,slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 8ae2a5d6dc..63ba327f96 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -899,7 +899,7 @@ void nr_schedule_ue_spec(module_id_t module_id, harq->is_waiting = true; UE_info->mac_stats[UE_id].dlsch_rounds[harq->round]++; - LOG_D(NR_MAC, + LOG_I(NR_MAC, "%4d.%2d [DLSCH/PDSCH/PUCCH] UE %d RNTI %04x DCI L %d start %3d RBs %3d startSymbol %2d nb_symbol %2d dmrspos %x MCS %2d TBS %4d HARQ PID %2d round %d RV %d NDI %d dl_data_to_ULACK %d (%d.%d) TPC %d\n", frame, slot, From 85a03cd3c14f8f213fd6ef3b90dd336b481a1029 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 20 Sep 2021 13:03:44 +0100 Subject: [PATCH 05/28] Intermediate backup commit --- .../conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf | 4 ++-- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 6 +++--- openair1/SCHED_NR/fapi_nr_l1.c | 3 +-- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 9 ++++----- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 9 +++++---- openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c | 2 +- .../CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 12 +++++++++--- 7 files changed, 25 insertions(+), 20 deletions(-) diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf index 29c6c6aa03..9866498e98 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf @@ -157,12 +157,12 @@ gNBs = restrictedSetConfig = 0, # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; + initialULBWPk2_0 = 2; initialULBWPmappingType_0 = 1 # this is SS=2 L=13 initialULBWPstartSymbolAndLength_0 = 41; - initialULBWPk2_1 = 6; + initialULBWPk2_1 = 2; initialULBWPmappingType_1 = 1; # this is SS=0 L=4 initialULBWPstartSymbolAndLength_1 = 52; diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 2a1556f432..f5c75dfc23 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -399,7 +399,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_stats->pucch0_thres = gNB->pucch0_thres; /* + (10*max_n0);*/ bool no_conf=false; if (nr_sequences>1) { - if (xrtmag_dBtimes10 < uci_stats->pucch0_thres+xrtmag_next_dBtimes10) + if (xrtmag_dBtimes10 < (50+xrtmag_next_dBtimes10) || SNRtimes10 < uci_stats->pucch0_thres) no_conf=true; } gNB->bad_pucch += no_conf; @@ -446,8 +446,8 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2); uci_pdu->harq->harq_list[1].harq_value = index&0x01; uci_pdu->harq->harq_list[0].harq_value = (index>>1)&0x01; - LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d xrt_mag_next %d\n", - frame,slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10); + LOG_I(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d\n", + frame,slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10, max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); uci_pdu->sr->sr_indication = (index>3) ? 1 : 0; diff --git a/openair1/SCHED_NR/fapi_nr_l1.c b/openair1/SCHED_NR/fapi_nr_l1.c index ad78dbf355..b2a802ab08 100644 --- a/openair1/SCHED_NR/fapi_nr_l1.c +++ b/openair1/SCHED_NR/fapi_nr_l1.c @@ -104,8 +104,7 @@ void handle_nfapi_nr_pdcch_pdu(PHY_VARS_gNB *gNB, int frame, int slot, nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu) { - if(pdcch_pdu->pdcch_pdu_rel15.CoreSetType==1) - LOG_I(PHY,"Frame %d, Slot %d: DCI processing - proc:slot_tx:%d pdcch_pdu_rel15->numDlDci:%d\n",frame,slot, slot, pdcch_pdu->pdcch_pdu_rel15.numDlDci); + LOG_D(PHY,"Frame %d, Slot %d: DCI processing - proc:slot_tx:%d pdcch_pdu_rel15->numDlDci:%d\n",frame,slot, slot, pdcch_pdu->pdcch_pdu_rel15.numDlDci); // copy dci configuration into gNB structure // gNB->pdcch_pdu = pdcch_pdu; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 9b78bdf57c..b98c8c9c7b 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -164,11 +164,10 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, gNB->Mod_id,frame,slot,pdcch_pdu_id,ul_pdcch_pdu_id); if (pdcch_pdu_id >= 0 || ul_pdcch_pdu_id >= 0) { - if(gNB->pdcch_pdu[pdcch_pdu_id].pdcch_pdu.pdcch_pdu_rel15.CoreSetType==1) - LOG_I(PHY, "[gNB %d] Frame %d slot %d Calling nr_generate_dci_top (number of UL/DL DCI %d/%d)\n", - gNB->Mod_id, frame, slot, - gNB->ul_pdcch_pdu[ul_pdcch_pdu_id].pdcch_pdu.pdcch_pdu.pdcch_pdu_rel15.numDlDci, - gNB->pdcch_pdu[pdcch_pdu_id].pdcch_pdu.pdcch_pdu_rel15.numDlDci); + LOG_D(PHY, "[gNB %d] Frame %d slot %d Calling nr_generate_dci_top (number of UL/DL DCI %d/%d)\n", + gNB->Mod_id, frame, slot, + gNB->ul_pdcch_pdu[ul_pdcch_pdu_id].pdcch_pdu.pdcch_pdu.pdcch_pdu_rel15.numDlDci, + gNB->pdcch_pdu[pdcch_pdu_id].pdcch_pdu.pdcch_pdu_rel15.numDlDci); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_PDCCH_TX,1); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 5a7e5c2260..e5820f0795 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -452,7 +452,7 @@ void nr_store_dlsch_buffer(module_id_t module_id, && !sched_ctrl->ta_apply) /* If TA should be applied, give at least one RB */ return; - LOG_I(NR_MAC, + LOG_D(NR_MAC, "[%s][%d.%d], %s%d->DLSCH, RLC status %d bytes TA %d\n", __func__, frame, @@ -899,7 +899,7 @@ void nr_schedule_ue_spec(module_id_t module_id, harq->is_waiting = true; UE_info->mac_stats[UE_id].dlsch_rounds[harq->round]++; - LOG_D(NR_MAC, + LOG_I(NR_MAC, "%4d.%2d [DLSCH/PDSCH/PUCCH] UE %d RNTI %04x DCI L %d start %3d RBs %3d startSymbol %2d nb_symbol %2d dmrspos %x MCS %2d TBS %4d HARQ PID %2d round %d RV %d NDI %d dl_data_to_ULACK %d (%d.%d) TPC %d\n", frame, slot, @@ -1076,7 +1076,7 @@ void nr_schedule_ue_spec(module_id_t module_id, dci_payload.dmrs_sequence_initialization.val = pdsch_pdu->SCID; LOG_I(NR_MAC, "%4d.%2d DCI type 1 payload: freq_alloc %d (%d,%d,%d), " - "time_alloc %d, vrb to prb %d, mcs %d tb_scaling %d ndi %d rv %d tpc %d\n", + "time_alloc %d, vrb to prb %d, mcs %d tb_scaling %d ndi %d rv %d tpc %d ti %d\n", frame, slot, dci_payload.frequency_domain_assignment.val, @@ -1089,7 +1089,8 @@ void nr_schedule_ue_spec(module_id_t module_id, dci_payload.tb_scaling, dci_payload.ndi, dci_payload.rv, - dci_payload.tpc); + dci_payload.tpc, + pucch->timing_indicator); const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats; int dci_format; diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c index b59deb440c..8bf65835dc 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c @@ -460,7 +460,7 @@ static void deliver_sdu(void *_ue, nr_rlc_entity_t *entity, char *buf, int size) exit(1); rb_found: - LOG_I(RLC, "%s:%d:%s: delivering SDU (rnti %d is_srb %d rb_id %d) size %d\n", + LOG_D(RLC, "%s:%d:%s: delivering SDU (rnti %d is_srb %d rb_id %d) size %d\n", __FILE__, __LINE__, __FUNCTION__, ue->rnti, is_srb, rb_id, size); memblock = get_free_mem_block(size, __func__); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index e58fec043b..c9bffb895b 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -231,8 +231,12 @@ MACRLCs = ( tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; ulsch_max_slots_inactivity = 10; - pusch_TargetSNRx10 = 200; + pusch_TargetSNRx10 = 150; pucch_TargetSNRx10 = 200; + + #pusch_TargetSNRx10 = 200; + #pucch_TargetSNRx10 = 150; + #ulsch_max_slots_inactivity=20; } ); @@ -240,8 +244,10 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 + pusch_proc_threads = 2; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 200; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } ); From 90e6f5dd257bc2239e40722cbb772c7ad66f0bb5 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 20 Sep 2021 13:38:02 +0100 Subject: [PATCH 06/28] Add more pucch_acknak logs --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index c17641b2fb..a92f9a65f9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1285,7 +1285,7 @@ int nr_acknack_scheduling(int mod_id, pucch->timing_indicator = i; pucch->dai_c++; // retain old resource indicator, and we are good - LOG_D(NR_MAC,"pucch_acknak : %d.%d. DAI > 0, pucch allocated for %d.%d\n",frame,slot,pucch->frame,pucch->ul_slot); + LOG_I(NR_MAC,"pucch_acknak : %d.%d. DAI > 0, pucch allocated for %d.%d timing_indicator %d\n",frame,slot,pucch->frame,pucch->ul_slot, pucch->timing_indicator); return 0; } @@ -1353,7 +1353,7 @@ int nr_acknack_scheduling(int mod_id, pucch->timing_indicator = ind_found; // index in the list of timing indicators - LOG_D(NR_MAC,"pucch_acknak 2. DAI 0 DL %d.%d, UL_ACK %d.%d (index %d)\n",frame,slot,pucch->frame,pucch->ul_slot,ind_found); + LOG_I(NR_MAC,"pucch_acknak 2. DAI 0 DL %d.%d, UL_ACK %d.%d (index %d)\n",frame,slot,pucch->frame,pucch->ul_slot,ind_found); pucch->dai_c++; pucch->resource_indicator = 0; // each UE has dedicated PUCCH resources From bfd9671626b11150a880e4855d5ebe52d9b6516e Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 20 Sep 2021 19:32:19 +0200 Subject: [PATCH 07/28] fixes in acknack scheduling --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 4 +- openair1/SCHED_NR/fapi_nr_l1.c | 3 +- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 9 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 16 ++- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 105 +++++++++++------- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 1 + 7 files changed, 84 insertions(+), 56 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 2a1556f432..34c0f6cdbf 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -446,8 +446,8 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2); uci_pdu->harq->harq_list[1].harq_value = index&0x01; uci_pdu->harq->harq_list[0].harq_value = (index>>1)&0x01; - LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d xrt_mag_next %d\n", - frame,slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10); + LOG_I(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d\n", + frame,slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); uci_pdu->sr->sr_indication = (index>3) ? 1 : 0; diff --git a/openair1/SCHED_NR/fapi_nr_l1.c b/openair1/SCHED_NR/fapi_nr_l1.c index ad78dbf355..b2a802ab08 100644 --- a/openair1/SCHED_NR/fapi_nr_l1.c +++ b/openair1/SCHED_NR/fapi_nr_l1.c @@ -104,8 +104,7 @@ void handle_nfapi_nr_pdcch_pdu(PHY_VARS_gNB *gNB, int frame, int slot, nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu) { - if(pdcch_pdu->pdcch_pdu_rel15.CoreSetType==1) - LOG_I(PHY,"Frame %d, Slot %d: DCI processing - proc:slot_tx:%d pdcch_pdu_rel15->numDlDci:%d\n",frame,slot, slot, pdcch_pdu->pdcch_pdu_rel15.numDlDci); + LOG_D(PHY,"Frame %d, Slot %d: DCI processing - proc:slot_tx:%d pdcch_pdu_rel15->numDlDci:%d\n",frame,slot, slot, pdcch_pdu->pdcch_pdu_rel15.numDlDci); // copy dci configuration into gNB structure // gNB->pdcch_pdu = pdcch_pdu; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 9b78bdf57c..e779f5eab6 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -164,11 +164,10 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, gNB->Mod_id,frame,slot,pdcch_pdu_id,ul_pdcch_pdu_id); if (pdcch_pdu_id >= 0 || ul_pdcch_pdu_id >= 0) { - if(gNB->pdcch_pdu[pdcch_pdu_id].pdcch_pdu.pdcch_pdu_rel15.CoreSetType==1) - LOG_I(PHY, "[gNB %d] Frame %d slot %d Calling nr_generate_dci_top (number of UL/DL DCI %d/%d)\n", - gNB->Mod_id, frame, slot, - gNB->ul_pdcch_pdu[ul_pdcch_pdu_id].pdcch_pdu.pdcch_pdu.pdcch_pdu_rel15.numDlDci, - gNB->pdcch_pdu[pdcch_pdu_id].pdcch_pdu.pdcch_pdu_rel15.numDlDci); + LOG_D(PHY, "[gNB %d] Frame %d slot %d Calling nr_generate_dci_top (number of UL/DL DCI %d/%d)\n", + gNB->Mod_id, frame, slot, + gNB->ul_pdcch_pdu[ul_pdcch_pdu_id].pdcch_pdu.pdcch_pdu.pdcch_pdu_rel15.numDlDci, + gNB->pdcch_pdu[pdcch_pdu_id].pdcch_pdu.pdcch_pdu_rel15.numDlDci); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_PDCCH_TX,1); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 5a7e5c2260..8ae2a5d6dc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -1074,7 +1074,7 @@ void nr_schedule_ue_spec(module_id_t module_id, dci_payload.pdsch_to_harq_feedback_timing_indicator.val = pucch->timing_indicator; // PDSCH to HARQ TI dci_payload.antenna_ports.val = ps->dmrs_ports_id; dci_payload.dmrs_sequence_initialization.val = pdsch_pdu->SCID; - LOG_I(NR_MAC, + LOG_D(NR_MAC, "%4d.%2d DCI type 1 payload: freq_alloc %d (%d,%d,%d), " "time_alloc %d, vrb to prb %d, mcs %d tb_scaling %d ndi %d rv %d tpc %d\n", frame, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index ac017f6a67..0fb06dfb4e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2090,6 +2090,7 @@ void get_pdsch_to_harq_feedback(int Mod_idP, int UE_id, int bwp_id, NR_SearchSpace__searchSpaceType_PR ss_type, + int *max_fb_time, uint8_t *pdsch_to_harq_feedback) { NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info; @@ -2127,8 +2128,11 @@ void get_pdsch_to_harq_feedback(int Mod_idP, // common search type uses DCI format 1_0 if (ss_type == NR_SearchSpace__searchSpaceType_PR_common) { - for (int i=0; i<8; i++) + for (int i=0; i<8; i++) { pdsch_to_harq_feedback[i] = i+1; + if(pdsch_to_harq_feedback[i]>*max_fb_time) + *max_fb_time = pdsch_to_harq_feedback[i]; + } } else { @@ -2150,14 +2154,20 @@ void get_pdsch_to_harq_feedback(int Mod_idP, if (ss->searchSpaceType->choice.ue_Specific->dci_Formats == NR_SearchSpace__searchSpaceType__ue_Specific__dci_Formats_formats0_0_And_1_0) { - for (int i=0; i<8; i++) + for (int i=0; i<8; i++) { pdsch_to_harq_feedback[i] = i+1; + if(pdsch_to_harq_feedback[i]>*max_fb_time) + *max_fb_time = pdsch_to_harq_feedback[i]; + } } else { AssertFatal(ubwpd!=NULL,"ubwpd shouldn't be null here\n"); if(ubwpd->pucch_Config->choice.setup->dl_DataToUL_ACK != NULL) { - for (int i=0; i<8; i++) + for (int i=0; i<8; i++) { pdsch_to_harq_feedback[i] = *ubwpd->pucch_Config->choice.setup->dl_DataToUL_ACK->list.array[i]; + if(pdsch_to_harq_feedback[i]>*max_fb_time) + *max_fb_time = pdsch_to_harq_feedback[i]; + } } else AssertFatal(0==1,"There is no allocated dl_DataToUL_ACK for pdsch to harq feedback\n"); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index c17641b2fb..3710c25af2 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1169,12 +1169,11 @@ int nr_acknack_scheduling(int mod_id, frame_t frame, sub_frame_t slot, int r_pucch, - int is_common) -{ + int is_common) { + const NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels->ServingCellConfigCommon; const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; const NR_TDD_UL_DL_Pattern_t *tdd = &scc->tdd_UL_DL_ConfigurationCommon->pattern1; - const int nr_ulmix_slots = tdd->nrofUplinkSlots + (tdd->nrofUplinkSymbols != 0); const int nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0; const int nr_slots_period = tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots; const int first_ul_slot_tdd = tdd->nrofDownlinkSlots + nr_slots_period * (slot / nr_slots_period); @@ -1195,7 +1194,7 @@ int nr_acknack_scheduling(int mod_id, * * each UE has dedicated PUCCH Format 0 resources, and we use index 0! */ NR_UE_sched_ctrl_t *sched_ctrl = &RC.nrmac[mod_id]->UE_info.UE_sched_ctrl[UE_id]; NR_sched_pucch_t *pucch = &sched_ctrl->sched_pucch[0]; - LOG_D(NR_MAC,"pucch_acknak %d.%d Trying to allocate pucch, current DAI %d\n",frame,slot,pucch->dai_c); + LOG_I(NR_MAC,"pucch_acknak %d.%d Trying to allocate pucch, current DAI %d\n",frame,slot,pucch->dai_c); pucch->r_pucch=r_pucch; AssertFatal(pucch->csi_bits == 0, "%s(): csi_bits %d in sched_pucch[0]\n", @@ -1207,11 +1206,14 @@ int nr_acknack_scheduling(int mod_id, * the same slot again */ const int f = pucch->frame; const int s = pucch->ul_slot; - LOG_D(NR_MAC,"pucch_acknak : %d.%d DAI = 2 pucch currently in %d.%d, advancing by 1 slot\n",frame,slot,f,s); + LOG_I(NR_MAC,"pucch_acknak : %d.%d DAI = 2 pucch currently in %d.%d, advancing by 1 slot\n",frame,slot,f,s); nr_fill_nfapi_pucch(mod_id, frame, slot, pucch, UE_id); memset(pucch, 0, sizeof(*pucch)); pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; - pucch->ul_slot = (s + 1) % n_slots_frame; + if((s + 1) == nr_slots_period) + pucch->ul_slot = (s + 1 + first_ul_slot_tdd) % n_slots_frame; + else + pucch->ul_slot = (s + 1) % n_slots_frame; // we assume that only two indices over the array sched_pucch exist csi_pucch = &sched_ctrl->sched_pucch[1]; // skip the CSI PUCCH if it is present and if in the next frame/slot @@ -1223,19 +1225,15 @@ int nr_acknack_scheduling(int mod_id, && !csi_pucch->simultaneous_harqcsi) { nr_fill_nfapi_pucch(mod_id, frame, slot, csi_pucch, UE_id); memset(csi_pucch, 0, sizeof(*csi_pucch)); - pucch->frame = s >= n_slots_frame - 2 ? (f + 1) % 1024 : f; - pucch->ul_slot = (s + 2) % n_slots_frame; + pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; + if((s + 1) == nr_slots_period) + pucch->ul_slot = (s + 1 + first_ul_slot_tdd) % n_slots_frame; + else + pucch->ul_slot = (s + 1) % n_slots_frame; } } LOG_D(NR_MAC,"pucch_acknak 1. DL %d.%d, UL_ACK %d.%d, DAI_C %d\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->dai_c); - /* if the UE's next PUCCH occasion is after the possible UL slots (within the - * same frame) or wrapped around to the next frame, then we assume there is - * no possible PUCCH allocation anymore */ - if ((pucch->frame == frame - && (pucch->ul_slot >= first_ul_slot_tdd + nr_ulmix_slots)) - || (pucch->frame == frame + 1)) - return -1; // this is hardcoded for now as ue specific only if we are not on the initialBWP (to be fixed to allow ue_Specific also on initialBWP NR_CellGroupConfig_t *cg = RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]; @@ -1253,15 +1251,14 @@ int nr_acknack_scheduling(int mod_id, int bwp_Id = 0; if (sched_ctrl->active_ubwp) bwp_Id = sched_ctrl->active_ubwp->bwp_Id; - get_pdsch_to_harq_feedback(mod_id, UE_id, bwp_Id, ss_type, pdsch_to_harq_feedback); - + int max_fb_time = 0; + get_pdsch_to_harq_feedback(mod_id, UE_id, bwp_Id, ss_type, &max_fb_time, pdsch_to_harq_feedback); + int max_absslot = frame*n_slots_frame + slot + max_fb_time; LOG_D(NR_MAC,"pucch_acknak 1b. DL %d.%d, UL_ACK %d.%d, DAI_C %d\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->dai_c); /* there is a HARQ. Check whether we can use it for this ACKNACK */ if (pucch->dai_c > 0) { /* this UE already has a PUCCH occasion */ - DevAssert(pucch->frame == frame); - // Find the right timing_indicator value. int i = 0; while (i < 8) { @@ -1278,48 +1275,67 @@ int nr_acknack_scheduling(int mod_id, nr_fill_nfapi_pucch(mod_id, frame, slot, pucch, UE_id); memset(pucch, 0, sizeof(*pucch)); pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; - pucch->ul_slot = (s + 1) % n_slots_frame; + if((s + 1) == nr_slots_period) + pucch->ul_slot = (s + 1 + first_ul_slot_tdd) % n_slots_frame; + else + pucch->ul_slot = (s + 1) % n_slots_frame; return nr_acknack_scheduling(mod_id, UE_id, frame, slot, r_pucch,is_common); } pucch->timing_indicator = i; pucch->dai_c++; // retain old resource indicator, and we are good - LOG_D(NR_MAC,"pucch_acknak : %d.%d. DAI > 0, pucch allocated for %d.%d\n",frame,slot,pucch->frame,pucch->ul_slot); + LOG_D(NR_MAC,"pucch_acknak : %d.%d. DAI > 0, pucch allocated for %d.%d (index %d)\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->timing_indicator); return 0; } LOG_D(NR_MAC,"pucch_acknak : %d.%d DAI = 0, looking for new pucch occasion\n",frame,slot); /* we need to find a new PUCCH occasion */ - /* if time information is outdated (e.g., last PUCCH occasion in last frame), - * set to first possible UL occasion in this frame. Note that if such UE is - * scheduled a lot and used all AckNacks, pucch->frame might have been - * wrapped around to next frame */ - if (frame != pucch->frame || pucch->ul_slot < first_ul_slot_tdd) { + /*Inizialization of timing information*/ + if (pucch->frame == 0 && pucch->ul_slot == 0) { AssertFatal(pucch->sr_flag + pucch->dai_c == 0, "expected no SR/AckNack for UE %d in %4d.%2d, but has %d/%d for %4d.%2d\n", UE_id, frame, slot, pucch->sr_flag, pucch->dai_c, pucch->frame, pucch->ul_slot); - AssertFatal(frame + 1 != pucch->frame, - "frame wrap around not handled in %s() yet\n", - __func__); pucch->frame = frame; - pucch->ul_slot = first_ul_slot_tdd; + pucch->ul_slot = first_ul_slot_tdd + (slot/nr_slots_period); } - // advance ul_slot if it is not reachable by UE - int pucch_slot,ind_found=-1; - for (int i=0;i<8;i++) { - pucch_slot = slot + pdsch_to_harq_feedback[i]; - if ((pucch_slot%nr_slots_period) >= tdd->nrofDownlinkSlots) { - pucch->ul_slot = max(pucch->ul_slot, pucch_slot); - ind_found=i; - break; + // Find the right timing_indicator value. + int ind_found = -1; + // while we are within the feedback limits and it has not been + while ((pucch->frame*n_slots_frame + pucch->ul_slot) <= max_absslot) { + if (ind_found!=-1) + break; + int i = 0; + while (i < 8) { + LOG_D(NR_MAC,"pdsch_to_harq_feedback[%d] = %d (pucch->ul_slot %d - slot %d)\n", + i,pdsch_to_harq_feedback[i],pucch->ul_slot,slot); + if (pdsch_to_harq_feedback[i] == pucch->ul_slot - slot) { + ind_found = i; + break; + } + ++i; } + // advance to the next ul slot + const int f = pucch->frame; + const int s = pucch->ul_slot; + pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; + if((s + 1) == nr_slots_period) + pucch->ul_slot = (s + 1 + first_ul_slot_tdd) % n_slots_frame; + else + pucch->ul_slot = (s + 1) % n_slots_frame; + } + if (ind_found==-1) { + LOG_W(NR_MAC, + "%4d.%2d could not find pdsch_to_harq_feedback for UE %d: earliest " + "ack slot %d\n", + frame, + slot, + UE_id, + pucch->ul_slot); + return -1; } - if (pucch->ul_slot >= n_slots_frame) pucch->frame++; - pucch->ul_slot = pucch->ul_slot % n_slots_frame; - AssertFatal(ind_found!=-1,"couldn't find a valid UL_ACK slot for PUCCH, shouldn't happen\n"); // is there already CSI in this slot? csi_pucch = &sched_ctrl->sched_pucch[1]; @@ -1340,7 +1356,10 @@ int nr_acknack_scheduling(int mod_id, const int s = pucch->ul_slot; memset(pucch, 0, sizeof(*pucch)); pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; - pucch->ul_slot = (s + 1) % n_slots_frame; + if((s + 1) == nr_slots_period) + pucch->ul_slot = (s + 1 + first_ul_slot_tdd) % n_slots_frame; + else + pucch->ul_slot = (s + 1) % n_slots_frame; return nr_acknack_scheduling(mod_id, UE_id, frame, slot, r_pucch,is_common); } // multiplexing harq and csi in a pucch @@ -1353,7 +1372,7 @@ int nr_acknack_scheduling(int mod_id, pucch->timing_indicator = ind_found; // index in the list of timing indicators - LOG_D(NR_MAC,"pucch_acknak 2. DAI 0 DL %d.%d, UL_ACK %d.%d (index %d)\n",frame,slot,pucch->frame,pucch->ul_slot,ind_found); + LOG_D(NR_MAC,"pucch_acknak 2. DAI 0 DL %d.%d, UL_ACK %d.%d (index %d)\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->timing_indicator); pucch->dai_c++; pucch->resource_indicator = 0; // each UE has dedicated PUCCH resources diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index ea5bed9ca9..321476d513 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -212,6 +212,7 @@ void get_pdsch_to_harq_feedback(int Mod_idP, int UE_id, int bwp_id, NR_SearchSpace__searchSpaceType_PR ss_type, + int *max_fb_time, uint8_t *pdsch_to_harq_feedback); void nr_configure_css_dci_initial(nfapi_nr_dl_tti_pdcch_pdu_rel15_t* pdcch_pdu, From 398d81e736ad3012d9d1afcb888d313016626195 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 21 Sep 2021 13:08:43 +0200 Subject: [PATCH 08/28] bugfix in acknack scheduling --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 3710c25af2..c60df380e3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1305,8 +1305,6 @@ int nr_acknack_scheduling(int mod_id, int ind_found = -1; // while we are within the feedback limits and it has not been while ((pucch->frame*n_slots_frame + pucch->ul_slot) <= max_absslot) { - if (ind_found!=-1) - break; int i = 0; while (i < 8) { LOG_D(NR_MAC,"pdsch_to_harq_feedback[%d] = %d (pucch->ul_slot %d - slot %d)\n", @@ -1317,6 +1315,8 @@ int nr_acknack_scheduling(int mod_id, } ++i; } + if (ind_found!=-1) + break; // advance to the next ul slot const int f = pucch->frame; const int s = pucch->ul_slot; From e5f677aa2bf21bd32961fc0009c5cd1da66c4ab5 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Tue, 21 Sep 2021 12:13:32 +0100 Subject: [PATCH 09/28] Change LOG levels --- executables/nr-ru.c | 1 - openair1/PHY/NR_TRANSPORT/pucch_rx.c | 4 ++-- openair1/PHY/TOOLS/time_meas.c | 6 +++--- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 4 ++-- openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c | 2 +- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 3 +-- 6 files changed, 9 insertions(+), 11 deletions(-) diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 98140850df..31b64e1187 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -1169,7 +1169,6 @@ void *ru_stats_thread(void *param) { } print_meas(&ru->rx_fhaul,"rx_fhaul",NULL,NULL); - print_meas(&ru->tx_fhaul,"tx_fhaul",NULL,NULL); if (ru->fh_north_out) { diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 51bb5d7b21..1e92b6ba01 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -429,7 +429,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_confidence_level = no_conf ? 1 : 0; uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(1); uci_pdu->harq->harq_list[0].harq_value = index&0x01; - LOG_I(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d srt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d\n", + LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d srt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d\n", frame,slot,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); @@ -446,7 +446,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2); uci_pdu->harq->harq_list[1].harq_value = index&0x01; uci_pdu->harq->harq_list[0].harq_value = (index>>1)&0x01; - LOG_I(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d xrt_mag_next %d\n", + LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d xrt_mag_next %d\n", frame,slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); diff --git a/openair1/PHY/TOOLS/time_meas.c b/openair1/PHY/TOOLS/time_meas.c index ea766e461a..8a15edc8f6 100644 --- a/openair1/PHY/TOOLS/time_meas.c +++ b/openair1/PHY/TOOLS/time_meas.c @@ -80,9 +80,9 @@ void print_meas_now(time_stats_t *ts, } void print_meas(time_stats_t *ts, - const char *name, - time_stats_t *total_exec_time, - time_stats_t *sf_exec_time) + const char *name, + time_stats_t *total_exec_time, + time_stats_t *sf_exec_time) { if (opp_enabled) { static int first_time = 0; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 63ba327f96..222dfb5117 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -452,7 +452,7 @@ void nr_store_dlsch_buffer(module_id_t module_id, && !sched_ctrl->ta_apply) /* If TA should be applied, give at least one RB */ return; - LOG_I(NR_MAC, + LOG_D(NR_MAC, "[%s][%d.%d], %s%d->DLSCH, RLC status %d bytes TA %d\n", __func__, frame, @@ -899,7 +899,7 @@ void nr_schedule_ue_spec(module_id_t module_id, harq->is_waiting = true; UE_info->mac_stats[UE_id].dlsch_rounds[harq->round]++; - LOG_I(NR_MAC, + LOG_D(NR_MAC, "%4d.%2d [DLSCH/PDSCH/PUCCH] UE %d RNTI %04x DCI L %d start %3d RBs %3d startSymbol %2d nb_symbol %2d dmrspos %x MCS %2d TBS %4d HARQ PID %2d round %d RV %d NDI %d dl_data_to_ULACK %d (%d.%d) TPC %d\n", frame, slot, diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c index b59deb440c..8bf65835dc 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c @@ -460,7 +460,7 @@ static void deliver_sdu(void *_ue, nr_rlc_entity_t *entity, char *buf, int size) exit(1); rb_found: - LOG_I(RLC, "%s:%d:%s: delivering SDU (rnti %d is_srb %d rb_id %d) size %d\n", + LOG_D(RLC, "%s:%d:%s: delivering SDU (rnti %d is_srb %d rb_id %d) size %d\n", __FILE__, __LINE__, __FUNCTION__, ue->rnti, is_srb, rb_id, size); memblock = get_free_mem_block(size, __func__); diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index e7a3c61c51..bffc5316e1 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -416,7 +416,6 @@ static int trx_usrp_write(openair0_device *device, s->tx_md.start_of_burst = (s->tx_count==0) ? true : first_packet_state; s->tx_md.end_of_burst = last_packet_state; s->tx_md.time_spec = uhd::time_spec_t::from_ticks(timestamp, s->sample_rate); - s->tx_count++; VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_BEAM_SWITCHING_GPIO,1); @@ -942,7 +941,7 @@ extern "C" { LOG_I(HW, "openair0_cfg[0].sdr_addrs == '%s'\n", openair0_cfg[0].sdr_addrs); LOG_I(HW, "openair0_cfg[0].clock_source == '%d' (internal = %d, external = %d)\n", openair0_cfg[0].clock_source,internal,external); usrp_state_t *s ; - int choffset = 1; + int choffset = 0; if ( device->priv == NULL) { s=(usrp_state_t *)calloc(sizeof(usrp_state_t),1); From bc936bfffd7f7be270fe86c5aaf9624e831d1127 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Tue, 21 Sep 2021 12:31:15 +0100 Subject: [PATCH 10/28] Update LOGs --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index e3ee1d9888..956a76ddbb 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -101,10 +101,9 @@ void dump_mac_stats(gNB_MAC_INST *gNB) stats->dlsch_rounds[2], stats->dlsch_rounds[3], stats->dlsch_errors, stats->pucch0_DTX, avg_rsrp, stats->num_rsrp_meas); - LOG_I(NR_MAC, "UE %d: dlsch_rounds %d/%d/%d/%d, dlsch_errors %d\n", - UE_id, - stats->dlsch_rounds[0], stats->dlsch_rounds[1], - stats->dlsch_rounds[2], stats->dlsch_rounds[3], stats->dlsch_errors); + LOG_I(NR_MAC, "UE %d: dlsch_rounds %d/%d/%d/%d, dlsch_errors %d, pucch0_DTX %d\n", + UE_id, stats->dlsch_rounds[0], stats->dlsch_rounds[1], stats->dlsch_rounds[2], stats->dlsch_rounds[3], + stats->dlsch_errors, stats->pucch0_DTX); stats->num_rsrp_meas = 0; stats->cumul_rsrp = 0 ; stroff+=sprintf(output+stroff,"UE %d: dlsch_total_bytes %d\n", UE_id, stats->dlsch_total_bytes); @@ -119,11 +118,9 @@ void dump_mac_stats(gNB_MAC_INST *gNB) UE_id, stats->ulsch_total_bytes_scheduled, stats->ulsch_total_bytes_rx); LOG_I(NR_MAC, "UE %d: dlsch_total_bytes %d\n", UE_id, stats->dlsch_total_bytes); - LOG_I(NR_MAC, "UE %d: ulsch_rounds %d/%d/%d/%d, ulsch_errors %d\n", - UE_id, - stats->ulsch_rounds[0], stats->ulsch_rounds[1], - stats->ulsch_rounds[2], stats->ulsch_rounds[3], - stats->ulsch_errors); + LOG_I(NR_MAC, "UE %d: ulsch_rounds %d/%d/%d/%d, ulsch_errors %d, ulsch_DTX %d\n", + UE_id, stats->ulsch_rounds[0], stats->ulsch_rounds[1], stats->ulsch_rounds[2], stats->ulsch_rounds[3], + stats->ulsch_errors, stats->ulsch_DTX); LOG_I(NR_MAC, "UE %d: ulsch_total_bytes (scheduled/received): %d / %d\n", UE_id, From e13ef657f3ca349ad4d50e8a6374c30ff492f008 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Tue, 21 Sep 2021 12:41:38 +0100 Subject: [PATCH 11/28] Update pucch0_dtx_threshold --- ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf | 2 +- ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf | 2 +- openair2/GNB_APP/L1_nr_paramdef.h | 2 +- .../CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 4 +++- .../CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 4 +++- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf index 29c6c6aa03..c7b3cb3e9b 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf @@ -264,7 +264,7 @@ L1s = ( tr_n_preference = "local_mac"; pusch_proc_threads = 2; prach_dtx_threshold = 120; - pucch0_dtx_threshold = 150; + pucch0_dtx_threshold = 200; } ); diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index d856f760fb..0fb544317f 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -264,7 +264,7 @@ L1s = ( tr_n_preference = "local_mac"; pusch_proc_threads = 2; prach_dtx_threshold = 120; - pucch0_dtx_threshold = 150; + pucch0_dtx_threshold = 200; } ); diff --git a/openair2/GNB_APP/L1_nr_paramdef.h b/openair2/GNB_APP/L1_nr_paramdef.h index 0306713845..13e4ce4c56 100644 --- a/openair2/GNB_APP/L1_nr_paramdef.h +++ b/openair2/GNB_APP/L1_nr_paramdef.h @@ -67,7 +67,7 @@ {CONFIG_STRING_L1_REMOTE_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PUSCH_PROC_THREADS, NULL, 0, uptr:NULL, defintval:3, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_OFDM_OFFSET_DIVISOR, NULL, 0, uptr:NULL, defuintval:8, TYPE_UINT, 0}, \ -{CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:100, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:200, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PRACH_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:150, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PUSCH_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:50, TYPE_UINT, 0} \ } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 18ba13e03f..114a760fc5 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -241,7 +241,9 @@ L1s = ( num_cc = 1; tr_n_preference = "local_mac"; pusch_proc_threads = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 200; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index e58fec043b..cb77c622e5 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -241,7 +241,9 @@ L1s = ( num_cc = 1; tr_n_preference = "local_mac"; pusch_proc_threads = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 200; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } ); From 617bf6a16c75b6783194d745f1f494ca95120602 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Tue, 21 Sep 2021 13:00:03 +0100 Subject: [PATCH 12/28] Set initial_wait=0 and opp_enabled = 0 --- executables/nr-ru.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 31b64e1187..3ae5d84fab 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -1244,13 +1244,13 @@ void *ru_thread( void *param ) { int slot = fp->slots_per_frame-1; int frame = 1023; char threadname[40]; - int initial_wait=1; + int initial_wait=0; int opp_enabled0 = opp_enabled; nfapi_nr_config_request_scf_t *cfg = &ru->config; // set the timing measurements for startup phase, for RX fronthaul settling measurements, put it to configured value after - opp_enabled = 1; + opp_enabled = 0; // set default return value ru_thread_status = 0; @@ -1364,7 +1364,7 @@ void *ru_thread( void *param ) { if (proc->frame_rx>=300) { initial_wait=0; 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; From 993974c4b48346d91379cbf412657755cc56444a Mon Sep 17 00:00:00 2001 From: rmagueta Date: Tue, 21 Sep 2021 13:04:39 +0100 Subject: [PATCH 13/28] Set pusch_TargetSNRx10 = 150 --- .../GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 2 +- .../GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 114a760fc5..c633011397 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -231,7 +231,7 @@ MACRLCs = ( tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; ulsch_max_slots_inactivity = 10; - pusch_TargetSNRx10 = 200; + pusch_TargetSNRx10 = 150; pucch_TargetSNRx10 = 200; } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index cb77c622e5..0e2e956c48 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -231,7 +231,7 @@ MACRLCs = ( tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; ulsch_max_slots_inactivity = 10; - pusch_TargetSNRx10 = 200; + pusch_TargetSNRx10 = 150; pucch_TargetSNRx10 = 200; } ); From a53b26098793ec29149c8b1d7764de74b653a02b Mon Sep 17 00:00:00 2001 From: rmagueta Date: Tue, 21 Sep 2021 13:14:23 +0100 Subject: [PATCH 14/28] Set initialULBWPstartSymbolAndLength_0 = 54 --- .../GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 2 +- .../GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index c633011397..8bcce7a910 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -139,7 +139,7 @@ gNBs = # pusch-ConfigCommon (up to 16 elements) initialULBWPk2_0 = 6; # used for UL slot initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + initialULBWPstartSymbolAndLength_0 = 54; # this is SS=1 L=12 initialULBWPk2_1 = 6; # used for mixed slot initialULBWPmappingType_1 = 1; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index 0e2e956c48..f8d006ce7f 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -139,7 +139,7 @@ gNBs = # pusch-ConfigCommon (up to 16 elements) initialULBWPk2_0 = 6; # used for UL slot initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + initialULBWPstartSymbolAndLength_0 = 54; # this is SS=1 L=12 initialULBWPk2_1 = 6; # used for mixed slot initialULBWPmappingType_1 = 1; From 06ad8f6a28364da634b6e47c28b82cfabd70a36a Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 21 Sep 2021 14:34:42 +0200 Subject: [PATCH 15/28] remove added code in msg4 retransmission --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 0ae37d752d..27037446d2 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -1771,8 +1771,6 @@ void nr_check_Msg4_Ack(module_id_t module_id, int CC_id, frame_t frame, sub_fram ra->Msg4_frame = (frame + 1) % 1024; ra->Msg4_slot = 1; ra->state = Msg4; - UE_info->active[UE_id] = false; - UE_info->Msg4_ACKed[UE_id] = false; } } } From 18d52cd129f9e7651bb099fc0c62c21aac24f9ed Mon Sep 17 00:00:00 2001 From: rmagueta Date: Tue, 21 Sep 2021 13:42:44 +0100 Subject: [PATCH 16/28] Change LOG level --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 222dfb5117..c8bbfd2bbe 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -1180,7 +1180,7 @@ void nr_schedule_ue_spec(module_id_t module_id, 0, 0); - LOG_I(NR_MAC, + LOG_D(NR_MAC, "%4d.%2d RNTI %04x: %d bytes from %s %d (ndata %d, remaining size %d)\n", frame, slot, From 40427889343ae1c258fee819437f6cd06a9a3a95 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 21 Sep 2021 14:48:25 +0200 Subject: [PATCH 17/28] log for xrtmag debug --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 0e1c58c515..0898ce9108 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -359,6 +359,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, if (temp>xrtmag) { xrtmag_next = xrtmag; xrtmag=temp; + LOG_I(PHY,"Sequence %d xrtmag %ld xrtmag_next %ld\n", i, xrtmag, xrtmag_next); maxpos=i; uci_stats->current_pucch0_stat0 = 0; int64_t temp2=0,temp3=0;; From 1ca995f97a4d13dc4f20d610fe855f1ccb169a10 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 21 Sep 2021 15:58:37 +0200 Subject: [PATCH 18/28] improve xrtmag_next --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 0898ce9108..06ce1c2668 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -370,6 +370,8 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_stats->current_pucch0_stat0= dB_fixed64(temp2); if (l==2) uci_stats->current_pucch0_stat1= dB_fixed64(temp3); } + else if (temp>xrtmag_next) + xrtmag_next = temp; } av_corr/=nr_sequences/l; From 5b976712a3777a867ae24c5474cbe4b04062de33 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 21 Sep 2021 17:02:31 +0200 Subject: [PATCH 19/28] another bugfix in acknack scheduling --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index c60df380e3..e48fa53420 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1210,7 +1210,7 @@ int nr_acknack_scheduling(int mod_id, nr_fill_nfapi_pucch(mod_id, frame, slot, pucch, UE_id); memset(pucch, 0, sizeof(*pucch)); pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; - if((s + 1) == nr_slots_period) + if(((s + 1)%nr_slots_period) == nr_slots_period) pucch->ul_slot = (s + 1 + first_ul_slot_tdd) % n_slots_frame; else pucch->ul_slot = (s + 1) % n_slots_frame; @@ -1226,7 +1226,7 @@ int nr_acknack_scheduling(int mod_id, nr_fill_nfapi_pucch(mod_id, frame, slot, csi_pucch, UE_id); memset(csi_pucch, 0, sizeof(*csi_pucch)); pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; - if((s + 1) == nr_slots_period) + if(((s + 1)%nr_slots_period) == nr_slots_period) pucch->ul_slot = (s + 1 + first_ul_slot_tdd) % n_slots_frame; else pucch->ul_slot = (s + 1) % n_slots_frame; @@ -1275,7 +1275,7 @@ int nr_acknack_scheduling(int mod_id, nr_fill_nfapi_pucch(mod_id, frame, slot, pucch, UE_id); memset(pucch, 0, sizeof(*pucch)); pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; - if((s + 1) == nr_slots_period) + if(((s + 1)%nr_slots_period) == nr_slots_period) pucch->ul_slot = (s + 1 + first_ul_slot_tdd) % n_slots_frame; else pucch->ul_slot = (s + 1) % n_slots_frame; @@ -1321,7 +1321,7 @@ int nr_acknack_scheduling(int mod_id, const int f = pucch->frame; const int s = pucch->ul_slot; pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; - if((s + 1) == nr_slots_period) + if(((s + 1)%nr_slots_period) == nr_slots_period) pucch->ul_slot = (s + 1 + first_ul_slot_tdd) % n_slots_frame; else pucch->ul_slot = (s + 1) % n_slots_frame; @@ -1356,7 +1356,7 @@ int nr_acknack_scheduling(int mod_id, const int s = pucch->ul_slot; memset(pucch, 0, sizeof(*pucch)); pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; - if((s + 1) == nr_slots_period) + if(((s + 1)%nr_slots_period) == nr_slots_period) pucch->ul_slot = (s + 1 + first_ul_slot_tdd) % n_slots_frame; else pucch->ul_slot = (s + 1) % n_slots_frame; From 730128073640ec89ab9f6978665bfa49be43277b Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 21 Sep 2021 17:29:21 +0200 Subject: [PATCH 20/28] bugfix of the bugfix --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 06ce1c2668..385041876d 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -359,7 +359,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, if (temp>xrtmag) { xrtmag_next = xrtmag; xrtmag=temp; - LOG_I(PHY,"Sequence %d xrtmag %ld xrtmag_next %ld\n", i, xrtmag, xrtmag_next); + LOG_D(PHY,"Sequence %d xrtmag %ld xrtmag_next %ld\n", i, xrtmag, xrtmag_next); maxpos=i; uci_stats->current_pucch0_stat0 = 0; int64_t temp2=0,temp3=0;; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index e48fa53420..09f3d562f9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1194,7 +1194,7 @@ int nr_acknack_scheduling(int mod_id, * * each UE has dedicated PUCCH Format 0 resources, and we use index 0! */ NR_UE_sched_ctrl_t *sched_ctrl = &RC.nrmac[mod_id]->UE_info.UE_sched_ctrl[UE_id]; NR_sched_pucch_t *pucch = &sched_ctrl->sched_pucch[0]; - LOG_I(NR_MAC,"pucch_acknak %d.%d Trying to allocate pucch, current DAI %d\n",frame,slot,pucch->dai_c); + LOG_D(NR_MAC,"pucch_acknak %d.%d Trying to allocate pucch, current DAI %d\n",frame,slot,pucch->dai_c); pucch->r_pucch=r_pucch; AssertFatal(pucch->csi_bits == 0, "%s(): csi_bits %d in sched_pucch[0]\n", @@ -1206,11 +1206,11 @@ int nr_acknack_scheduling(int mod_id, * the same slot again */ const int f = pucch->frame; const int s = pucch->ul_slot; - LOG_I(NR_MAC,"pucch_acknak : %d.%d DAI = 2 pucch currently in %d.%d, advancing by 1 slot\n",frame,slot,f,s); + LOG_D(NR_MAC,"pucch_acknak : %d.%d DAI = 2 pucch currently in %d.%d, advancing by 1 slot\n",frame,slot,f,s); nr_fill_nfapi_pucch(mod_id, frame, slot, pucch, UE_id); memset(pucch, 0, sizeof(*pucch)); pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; - if(((s + 1)%nr_slots_period) == nr_slots_period) + if(((s + 1)%nr_slots_period) == 0) pucch->ul_slot = (s + 1 + first_ul_slot_tdd) % n_slots_frame; else pucch->ul_slot = (s + 1) % n_slots_frame; @@ -1226,14 +1226,14 @@ int nr_acknack_scheduling(int mod_id, nr_fill_nfapi_pucch(mod_id, frame, slot, csi_pucch, UE_id); memset(csi_pucch, 0, sizeof(*csi_pucch)); pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; - if(((s + 1)%nr_slots_period) == nr_slots_period) + if(((s + 1)%nr_slots_period) == 0) pucch->ul_slot = (s + 1 + first_ul_slot_tdd) % n_slots_frame; else pucch->ul_slot = (s + 1) % n_slots_frame; } } - LOG_D(NR_MAC,"pucch_acknak 1. DL %d.%d, UL_ACK %d.%d, DAI_C %d\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->dai_c); + LOG_I(NR_MAC,"pucch_acknak 1. DL %d.%d, UL_ACK %d.%d, DAI_C %d\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->dai_c); // this is hardcoded for now as ue specific only if we are not on the initialBWP (to be fixed to allow ue_Specific also on initialBWP NR_CellGroupConfig_t *cg = RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]; @@ -1275,7 +1275,7 @@ int nr_acknack_scheduling(int mod_id, nr_fill_nfapi_pucch(mod_id, frame, slot, pucch, UE_id); memset(pucch, 0, sizeof(*pucch)); pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; - if(((s + 1)%nr_slots_period) == nr_slots_period) + if(((s + 1)%nr_slots_period) == 0) pucch->ul_slot = (s + 1 + first_ul_slot_tdd) % n_slots_frame; else pucch->ul_slot = (s + 1) % n_slots_frame; @@ -1285,7 +1285,7 @@ int nr_acknack_scheduling(int mod_id, pucch->timing_indicator = i; pucch->dai_c++; // retain old resource indicator, and we are good - LOG_D(NR_MAC,"pucch_acknak : %d.%d. DAI > 0, pucch allocated for %d.%d (index %d)\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->timing_indicator); + LOG_I(NR_MAC,"pucch_acknak : %d.%d. DAI > 0, pucch allocated for %d.%d (index %d)\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->timing_indicator); return 0; } @@ -1321,7 +1321,7 @@ int nr_acknack_scheduling(int mod_id, const int f = pucch->frame; const int s = pucch->ul_slot; pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; - if(((s + 1)%nr_slots_period) == nr_slots_period) + if(((s + 1)%nr_slots_period) == 0) pucch->ul_slot = (s + 1 + first_ul_slot_tdd) % n_slots_frame; else pucch->ul_slot = (s + 1) % n_slots_frame; @@ -1356,7 +1356,7 @@ int nr_acknack_scheduling(int mod_id, const int s = pucch->ul_slot; memset(pucch, 0, sizeof(*pucch)); pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; - if(((s + 1)%nr_slots_period) == nr_slots_period) + if(((s + 1)%nr_slots_period) == 0) pucch->ul_slot = (s + 1 + first_ul_slot_tdd) % n_slots_frame; else pucch->ul_slot = (s + 1) % n_slots_frame; @@ -1372,7 +1372,7 @@ int nr_acknack_scheduling(int mod_id, pucch->timing_indicator = ind_found; // index in the list of timing indicators - LOG_D(NR_MAC,"pucch_acknak 2. DAI 0 DL %d.%d, UL_ACK %d.%d (index %d)\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->timing_indicator); + LOG_I(NR_MAC,"pucch_acknak 2. DAI 0 DL %d.%d, UL_ACK %d.%d (index %d)\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->timing_indicator); pucch->dai_c++; pucch->resource_indicator = 0; // each UE has dedicated PUCCH resources From beb065d2e8b3c74db1ba4ec9719406a82791692a Mon Sep 17 00:00:00 2001 From: rmagueta Date: Tue, 21 Sep 2021 17:19:19 +0100 Subject: [PATCH 21/28] Change LOG levels --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 4 ++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 385041876d..becd9c6b83 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -432,7 +432,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_confidence_level = no_conf ? 1 : 0; uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(1); uci_pdu->harq->harq_list[0].harq_value = index&0x01; - LOG_I(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d srt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d\n", + LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d srt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d\n", frame,slot,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); @@ -449,7 +449,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2); uci_pdu->harq->harq_list[1].harq_value = index&0x01; uci_pdu->harq->harq_list[0].harq_value = (index>>1)&0x01; - LOG_I(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d\n", + LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d\n", frame,slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 74d72136b4..2d0fbcabfb 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -899,7 +899,7 @@ void nr_schedule_ue_spec(module_id_t module_id, harq->is_waiting = true; UE_info->mac_stats[UE_id].dlsch_rounds[harq->round]++; - LOG_I(NR_MAC, + LOG_D(NR_MAC, "%4d.%2d [DLSCH/PDSCH/PUCCH] UE %d RNTI %04x DCI L %d start %3d RBs %3d startSymbol %2d nb_symbol %2d dmrspos %x MCS %2d TBS %4d HARQ PID %2d round %d RV %d NDI %d dl_data_to_ULACK %d (%d.%d) TPC %d\n", frame, slot, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 09f3d562f9..31a35d0f56 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1233,7 +1233,7 @@ int nr_acknack_scheduling(int mod_id, } } - LOG_I(NR_MAC,"pucch_acknak 1. DL %d.%d, UL_ACK %d.%d, DAI_C %d\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->dai_c); + LOG_D(NR_MAC,"pucch_acknak 1. DL %d.%d, UL_ACK %d.%d, DAI_C %d\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->dai_c); // this is hardcoded for now as ue specific only if we are not on the initialBWP (to be fixed to allow ue_Specific also on initialBWP NR_CellGroupConfig_t *cg = RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]; @@ -1285,7 +1285,7 @@ int nr_acknack_scheduling(int mod_id, pucch->timing_indicator = i; pucch->dai_c++; // retain old resource indicator, and we are good - LOG_I(NR_MAC,"pucch_acknak : %d.%d. DAI > 0, pucch allocated for %d.%d (index %d)\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->timing_indicator); + LOG_D(NR_MAC,"pucch_acknak : %d.%d. DAI > 0, pucch allocated for %d.%d (index %d)\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->timing_indicator); return 0; } @@ -1372,7 +1372,7 @@ int nr_acknack_scheduling(int mod_id, pucch->timing_indicator = ind_found; // index in the list of timing indicators - LOG_I(NR_MAC,"pucch_acknak 2. DAI 0 DL %d.%d, UL_ACK %d.%d (index %d)\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->timing_indicator); + LOG_D(NR_MAC,"pucch_acknak 2. DAI 0 DL %d.%d, UL_ACK %d.%d (index %d)\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->timing_indicator); pucch->dai_c++; pucch->resource_indicator = 0; // each UE has dedicated PUCCH resources From 06cfa4e934322c0a0e67d11a953418e652102d33 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 21 Sep 2021 18:45:36 +0200 Subject: [PATCH 22/28] yet another bugfix --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 09f3d562f9..469f7bb3a1 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1177,6 +1177,7 @@ int nr_acknack_scheduling(int mod_id, const int nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0; const int nr_slots_period = tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots; const int first_ul_slot_tdd = tdd->nrofDownlinkSlots + nr_slots_period * (slot / nr_slots_period); + const int first_ul_slot_period = first_ul_slot_tdd%nr_slots_period; const int CC_id = 0; NR_sched_pucch_t *csi_pucch; @@ -1211,7 +1212,7 @@ int nr_acknack_scheduling(int mod_id, memset(pucch, 0, sizeof(*pucch)); pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; if(((s + 1)%nr_slots_period) == 0) - pucch->ul_slot = (s + 1 + first_ul_slot_tdd) % n_slots_frame; + pucch->ul_slot = (s + 1 + first_ul_slot_period) % n_slots_frame; else pucch->ul_slot = (s + 1) % n_slots_frame; // we assume that only two indices over the array sched_pucch exist @@ -1227,7 +1228,7 @@ int nr_acknack_scheduling(int mod_id, memset(csi_pucch, 0, sizeof(*csi_pucch)); pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; if(((s + 1)%nr_slots_period) == 0) - pucch->ul_slot = (s + 1 + first_ul_slot_tdd) % n_slots_frame; + pucch->ul_slot = (s + 1 + first_ul_slot_period) % n_slots_frame; else pucch->ul_slot = (s + 1) % n_slots_frame; } @@ -1276,7 +1277,7 @@ int nr_acknack_scheduling(int mod_id, memset(pucch, 0, sizeof(*pucch)); pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; if(((s + 1)%nr_slots_period) == 0) - pucch->ul_slot = (s + 1 + first_ul_slot_tdd) % n_slots_frame; + pucch->ul_slot = (s + 1 + first_ul_slot_period) % n_slots_frame; else pucch->ul_slot = (s + 1) % n_slots_frame; return nr_acknack_scheduling(mod_id, UE_id, frame, slot, r_pucch,is_common); @@ -1298,7 +1299,7 @@ int nr_acknack_scheduling(int mod_id, "expected no SR/AckNack for UE %d in %4d.%2d, but has %d/%d for %4d.%2d\n", UE_id, frame, slot, pucch->sr_flag, pucch->dai_c, pucch->frame, pucch->ul_slot); pucch->frame = frame; - pucch->ul_slot = first_ul_slot_tdd + (slot/nr_slots_period); + pucch->ul_slot = first_ul_slot_tdd; } // Find the right timing_indicator value. @@ -1322,7 +1323,7 @@ int nr_acknack_scheduling(int mod_id, const int s = pucch->ul_slot; pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; if(((s + 1)%nr_slots_period) == 0) - pucch->ul_slot = (s + 1 + first_ul_slot_tdd) % n_slots_frame; + pucch->ul_slot = (s + 1 + first_ul_slot_period) % n_slots_frame; else pucch->ul_slot = (s + 1) % n_slots_frame; } @@ -1357,7 +1358,7 @@ int nr_acknack_scheduling(int mod_id, memset(pucch, 0, sizeof(*pucch)); pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; if(((s + 1)%nr_slots_period) == 0) - pucch->ul_slot = (s + 1 + first_ul_slot_tdd) % n_slots_frame; + pucch->ul_slot = (s + 1 + first_ul_slot_period) % n_slots_frame; else pucch->ul_slot = (s + 1) % n_slots_frame; return nr_acknack_scheduling(mod_id, UE_id, frame, slot, r_pucch,is_common); From 2ef4ab6d54d991b61615d23b31a865c450c488d7 Mon Sep 17 00:00:00 2001 From: Roberto Louro Magueta Date: Tue, 21 Sep 2021 16:57:24 +0000 Subject: [PATCH 23/28] Revert "Set initialULBWPstartSymbolAndLength_0 = 54" This reverts commit a53b26098793ec29149c8b1d7764de74b653a02b --- .../GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 2 +- .../GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 8bcce7a910..c633011397 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -139,7 +139,7 @@ gNBs = # pusch-ConfigCommon (up to 16 elements) initialULBWPk2_0 = 6; # used for UL slot initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 54; # this is SS=1 L=12 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 initialULBWPk2_1 = 6; # used for mixed slot initialULBWPmappingType_1 = 1; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index f8d006ce7f..0e2e956c48 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -139,7 +139,7 @@ gNBs = # pusch-ConfigCommon (up to 16 elements) initialULBWPk2_0 = 6; # used for UL slot initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 54; # this is SS=1 L=12 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 initialULBWPk2_1 = 6; # used for mixed slot initialULBWPmappingType_1 = 1; From b2e5b2884e85359fff49657f3879be4b3dcf56a2 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Tue, 21 Sep 2021 18:19:07 +0100 Subject: [PATCH 24/28] Change LOG level --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 9c0fb0f328..49b1a8ff54 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1218,7 +1218,7 @@ void pf_ul(module_id_t module_id, UE_id, UE_info->rnti[UE_id],rbStart,min_rb,bwpSize); return; } - else LOG_I(NR_MAC,"allocating UL data for UE %d/RNTI %04x (rbStsart %d, min_rb %d, bwpSize %d\n",UE_id, UE_info->rnti[UE_id],rbStart,min_rb,bwpSize); + else LOG_D(NR_MAC,"allocating UL data for UE %d/RNTI %04x (rbStsart %d, min_rb %d, bwpSize %d\n",UE_id, UE_info->rnti[UE_id],rbStart,min_rb,bwpSize); /* Save PUSCH field */ /* we want to avoid a lengthy deduction of DMRS and other parameters in From 99f53ea942f474c88ca2d0cedb598b92b8152a46 Mon Sep 17 00:00:00 2001 From: Roberto Louro Magueta Date: Tue, 21 Sep 2021 18:15:17 +0000 Subject: [PATCH 25/28] Revert "Update pucch0_dtx_threshold" This reverts commit e13ef657f3ca349ad4d50e8a6374c30ff492f008 --- ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf | 2 +- ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf | 2 +- openair2/GNB_APP/L1_nr_paramdef.h | 2 +- .../CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 4 +--- .../CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 4 +--- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf index 26f05eeb58..9866498e98 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf @@ -264,7 +264,7 @@ L1s = ( tr_n_preference = "local_mac"; pusch_proc_threads = 2; prach_dtx_threshold = 120; - pucch0_dtx_threshold = 200; + pucch0_dtx_threshold = 150; } ); diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index 0fb544317f..d856f760fb 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -264,7 +264,7 @@ L1s = ( tr_n_preference = "local_mac"; pusch_proc_threads = 2; prach_dtx_threshold = 120; - pucch0_dtx_threshold = 200; + pucch0_dtx_threshold = 150; } ); diff --git a/openair2/GNB_APP/L1_nr_paramdef.h b/openair2/GNB_APP/L1_nr_paramdef.h index 13e4ce4c56..0306713845 100644 --- a/openair2/GNB_APP/L1_nr_paramdef.h +++ b/openair2/GNB_APP/L1_nr_paramdef.h @@ -67,7 +67,7 @@ {CONFIG_STRING_L1_REMOTE_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PUSCH_PROC_THREADS, NULL, 0, uptr:NULL, defintval:3, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_OFDM_OFFSET_DIVISOR, NULL, 0, uptr:NULL, defuintval:8, TYPE_UINT, 0}, \ -{CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:200, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:100, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PRACH_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:150, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PUSCH_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:50, TYPE_UINT, 0} \ } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index c633011397..c0d7ca93bd 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -241,9 +241,7 @@ L1s = ( num_cc = 1; tr_n_preference = "local_mac"; pusch_proc_threads = 8; - prach_dtx_threshold = 120; - pucch0_dtx_threshold = 200; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index 0e2e956c48..ad164ce6d7 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -241,9 +241,7 @@ L1s = ( num_cc = 1; tr_n_preference = "local_mac"; pusch_proc_threads = 8; - prach_dtx_threshold = 120; - pucch0_dtx_threshold = 200; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } ); From f2abff7745e288e23281d288caa34aac93fc92a8 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Tue, 21 Sep 2021 19:20:11 +0100 Subject: [PATCH 26/28] Add prach_dtx_threshold and pucch0_dtx_threshold in some conf files --- .../CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 4 +++- .../CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index c0d7ca93bd..644981173b 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -241,7 +241,9 @@ L1s = ( num_cc = 1; tr_n_preference = "local_mac"; pusch_proc_threads = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index ad164ce6d7..9c0427789d 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -241,7 +241,9 @@ L1s = ( num_cc = 1; tr_n_preference = "local_mac"; pusch_proc_threads = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } ); From 32460820f4aaaabc4b27e0e5bca30449fe8f051b Mon Sep 17 00:00:00 2001 From: rmagueta Date: Tue, 21 Sep 2021 19:43:06 +0100 Subject: [PATCH 27/28] Change 50 to 30 for no_conf condition in nr_decode_pucch0 --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index becd9c6b83..857966bbb1 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -402,7 +402,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_stats->pucch0_thres = gNB->pucch0_thres; /* + (10*max_n0);*/ bool no_conf=false; if (nr_sequences>1) { - if (xrtmag_dBtimes10 < (50+xrtmag_next_dBtimes10) || SNRtimes10 < uci_stats->pucch0_thres) + if (xrtmag_dBtimes10 < (30+xrtmag_next_dBtimes10) || SNRtimes10 < uci_stats->pucch0_thres) no_conf=true; } gNB->bad_pucch += no_conf; From 1540f9bf1a341e3c4f091bd74c018d6ae5c24c77 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Wed, 22 Sep 2021 15:25:08 +0100 Subject: [PATCH 28/28] Fix PINGs and IPERF for phy-test --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index 4f526649ab..d5272d5cfc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -323,6 +323,7 @@ void nr_preprocessor_phytest(module_id_t module_id, 0, 0); sched_ctrl->num_total_bytes += sched_ctrl->rlc_status[lcid].bytes_in_buffer; + sched_ctrl->lcid_to_schedule = lcid; sched_ctrl->maxL = dl_maxL; uint8_t nr_of_candidates;