From 0a2e033253d8c5035931245db27f5794404ce491 Mon Sep 17 00:00:00 2001 From: Francesco Mani Date: Thu, 13 Feb 2020 17:18:20 +0100 Subject: [PATCH 01/14] max ack bits in mac_proto.h --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 6 +++--- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 4f675fecc4..9d0365d5ff 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -1350,7 +1350,7 @@ void nr_update_pucch_scheduling(int Mod_idP, } else { // to be tested curr_pucch = UE_list->UE_sched_ctrl[UE_id].sched_pucch; - if (curr_pucch->dai_c<11) { // we are scheduling at most 11 harq-ack in the same pucch + if (curr_pucch->dai_cul_slot % slots_per_tdd)-(slotP % slots_per_tdd)) found = 1; @@ -1362,7 +1362,7 @@ void nr_update_pucch_scheduling(int Mod_idP, sched_pucch->timing_indicator = pdsch_to_harq_feedback[i]; } } - if (curr_pucch->dai_c==11 || found == 0) { // if current pucch is full or no timing indicator allowed + if (curr_pucch->dai_c==MAX_ACK_BITS || found == 0) { // if current pucch is full or no timing indicator allowed // look for pucch occasions in other UL of mixed slots for (k=scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots; kul_slot % slots_per_tdd)) { // skip current scheduled slot (already checked) @@ -1396,7 +1396,7 @@ void nr_update_pucch_scheduling(int Mod_idP, curr_pucch->next_sched_pucch = sched_pucch; } else { - if (curr_pucch->dai_c==11) + if (curr_pucch->dai_c==MAX_ACK_BITS) found = 0; // if pucch at index k is already full we have to find a new one in a following occasion else { // scheduling this harq-ack in current pucch sched_pucch = curr_pucch; diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index cbbac3a55a..657de416a9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -34,6 +34,8 @@ #include "nr_mac_gNB.h" #include "PHY/defs_gNB.h" +#define MAX_ACK_BITS 2 //only format 0 is available for now + void set_cset_offset(uint16_t); void mac_top_init_gNB(void); From df0bc30e28733c2f97bac3c5c96775eeec087075 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 24 Mar 2020 15:41:51 +0100 Subject: [PATCH 02/14] Make function static inline, not inline inline alone does only define a function without a corresponding declaration. static solves this problem --- executables/nr-ue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 653a97dc61..131710ee02 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -633,7 +633,7 @@ int computeSamplesShift(PHY_VARS_NR_UE *UE) { return 0; } -inline int get_firstSymSamp(uint16_t slot, NR_DL_FRAME_PARMS *fp) { +static inline int get_firstSymSamp(uint16_t slot, NR_DL_FRAME_PARMS *fp) { if (fp->numerology_index == 0) return fp->nb_prefix_samples0 + fp->ofdm_symbol_size; int num_samples = (slot%(fp->slots_per_subframe/2)) ? fp->nb_prefix_samples : fp->nb_prefix_samples0; @@ -641,7 +641,7 @@ inline int get_firstSymSamp(uint16_t slot, NR_DL_FRAME_PARMS *fp) { return num_samples; } -inline int get_readBlockSize(uint16_t slot, NR_DL_FRAME_PARMS *fp) { +static inline int get_readBlockSize(uint16_t slot, NR_DL_FRAME_PARMS *fp) { int rem_samples = fp->get_samples_per_slot(slot, fp) - get_firstSymSamp(slot, fp); int next_slot_first_symbol = 0; if (slot < (fp->slots_per_frame-1)) From 8a589f5b0886aeebdb77e794047ca9b16b857972 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 24 Mar 2020 15:54:45 +0100 Subject: [PATCH 03/14] Fix: rx_indication length is in bytes --- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 292c8106ae..d9a7ee3c69 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -297,7 +297,7 @@ void nr_fill_rx_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_ gNB->UL_INFO.rx_ind.sfn_sf = frame<<4| slot_rx; gNB->UL_INFO.rx_ind.rx_indication_body.tl.tag = NFAPI_RX_INDICATION_BODY_TAG; - gNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list->rx_indication_rel8.length = gNB->ulsch[ULSCH_id][0]->harq_processes[harq_pid]->TBS>>3; + gNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list->rx_indication_rel8.length = gNB->ulsch[ULSCH_id][0]->harq_processes[harq_pid]->TBS; pdu = &gNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list[gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus]; From 2c21e8229c2548d51f7912c2299b6c94a53c863f Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 24 Mar 2020 15:55:41 +0100 Subject: [PATCH 04/14] Fix: correctly set context before calling pdcp_run() --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 90c56c2ef5..e5840d9cd1 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -308,6 +308,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, //printf("gNB_dlsch_ulsch_scheduler frameRX %d slotRX %d frameTX %d slotTX %d\n",frame_rxP,slot_rxP,frame_txP,slot_txP); protocol_ctxt_t ctxt; + PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, NOT_A_RNTI, frame_txP, slot_txP,module_idP); int CC_id, UE_id = 0; gNB_MAC_INST *gNB = RC.nrmac[module_idP]; NR_UE_list_t *UE_list = &gNB->UE_list; @@ -351,7 +352,6 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, } //END if (UE_list->active[i]) } //END for (i = 0; i < MAX_MOBILES_PER_GNB; i++) */ - PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES,NOT_A_RNTI, frame_txP, slot_txP,module_idP); // This schedules MIB if((slot_txP == 0) && (frame_txP & 7) == 0){ From 69c16efe07986a207881b4aa1d338517ab647a91 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 24 Mar 2020 16:20:05 +0100 Subject: [PATCH 05/14] Fix: check that UE RRC config files are found --- openair2/RRC/NR_UE/rrc_UE.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index 1975bfba1a..87e899845e 100755 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -329,6 +329,11 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* rrc_config_path){ sprintf(filename,"reconfig.raw"); fd = fopen(filename,"r"); char buffer[1024]; + AssertFatal(fd, + "cannot read file %s: errno %d, %s\n", + filename, + errno, + strerror(errno)); int msg_len=fread(buffer,1,1024,fd); fclose(fd); process_nsa_message(NR_UE_rrc_inst, nr_SecondaryCellGroupConfig_r15, buffer,msg_len); @@ -337,6 +342,11 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* rrc_config_path){ else sprintf(filename,"rbconfig.raw"); fd = fopen(filename,"r"); + AssertFatal(fd, + "cannot read file %s: errno %d, %s\n", + filename, + errno, + strerror(errno)); msg_len=fread(buffer,1,1024,fd); fclose(fd); process_nsa_message(NR_UE_rrc_inst, nr_RadioBearerConfigX_r15, buffer,msg_len); From daefb67c82e35a5468733306149736955b756c7c Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 24 Mar 2020 16:26:47 +0100 Subject: [PATCH 06/14] Fix: correct check for dummy-traffic --- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index 3b6367e243..f1d4a304f9 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -194,7 +194,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, } } //Random traffic to be transmitted if there is no IP traffic available for this Tx opportunity - else if (!IS_SOFTMODEM_NOS1 || !data_existing) { + if (!IS_SOFTMODEM_NOS1 || !data_existing) { //Use zeros for the header bytes in noS1 mode, in order to make sure that the LCID is not valid //and block this traffic from being forwarded to the upper layers at the gNB uint16_t payload_offset = 5; From 8a47fa484cb30ae4c6faee4330cbdee2cfd6cd63 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 24 Mar 2020 16:32:14 +0100 Subject: [PATCH 07/14] Handle residual MAC PDU < 0 gracefully --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 5 ++++- 1 file changed, 4 insertions(+), 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 34be2246b8..ade5200627 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -222,7 +222,10 @@ void nr_process_mac_pdu( pdu_ptr += ( mac_subheader_len + mac_ce_len + mac_sdu_len ); pdu_len -= ( mac_subheader_len + mac_ce_len + mac_sdu_len ); - AssertFatal(pdu_len >= 0, "[MAC] nr_process_mac_pdu, residual mac pdu length < 0!\n"); + if (pdu_len < 0) { + LOG_E(MAC, "%s() residual mac pdu length < 0!\n", __func__); + return; + } } } From 1cb14c3d9cb4e8fa288557c04b2530a925eb952f Mon Sep 17 00:00:00 2001 From: Gabriele Perrone Date: Wed, 1 Apr 2020 13:26:26 +0200 Subject: [PATCH 08/14] Update README.md --- targets/ARCH/rfsimulator/README.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/targets/ARCH/rfsimulator/README.md b/targets/ARCH/rfsimulator/README.md index e3ce219d73..ce2a4c9616 100644 --- a/targets/ARCH/rfsimulator/README.md +++ b/targets/ARCH/rfsimulator/README.md @@ -3,6 +3,12 @@ This is an RF simulator that allows to test OAI without an RF board. It replaces As much as possible, it works like an RF board, but not in real-time: It can run faster than real-time if there is enough CPU, or slower (it is CPU-bound instead of real-time RF sampling-bound). +It can be run either in: + +- "noS1" mode: the generated IP traffic is sent and received between gNB and UE IP tunnel interfaces ("oaitun") by applications like ping and iperf +- "phy-test" mode: random UL and DL traffic is generated at every scheduling opportunity + + # build ## From [build_oai](../../../doc/BUILD.md) script @@ -84,16 +90,19 @@ make rfsimulator ### Launch gNB in one window ```bash -sudo RFSIMULATOR=server ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf --parallel-config PARALLEL_SINGLE_THREAD +sudo RFSIMULATOR=server ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf --parallel-config PARALLEL_SINGLE_THREAD --rfsim --phy-test ``` ### Launch UE in another window ```bash -sudo RFSIMULATOR=127.0.0.1 ./nr-uesoftmodem --numerology 1 -r 106 -C 3510000000 +sudo RFSIMULATOR= ./nr-uesoftmodem --rfsim --phy-test --rrc_config_path ../../../ci-scripts/rrc-files ``` +Note: +1. can be 127.0.0.1 if both gNB and nrUE executables run on the same host, OR the IP interface address of the remote host running the gNB executable, if the gNB and nrUE run on separate hosts +2. the --rrc_config_path parameter can be omitted (but not necessarily) if the gNB and nrUE run on the same host, in which case the gNB provides the nrUE with the necessary rrc configuration +3. to enable the noS1 mode --noS1 and --nokrnmod 1 options should be added to the command line -Of course, set the gNB machine IP address if the UE and the gNB are not on the same machine. In the UE, you can add `-d` option to get the softscope. From 36bf56d4108ff2cca3850a8a2d5e85711a9c3784 Mon Sep 17 00:00:00 2001 From: Gabriele Perrone Date: Wed, 1 Apr 2020 14:59:09 +0200 Subject: [PATCH 09/14] Update README.md --- targets/ARCH/rfsimulator/README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/targets/ARCH/rfsimulator/README.md b/targets/ARCH/rfsimulator/README.md index ce2a4c9616..a4b030af85 100644 --- a/targets/ARCH/rfsimulator/README.md +++ b/targets/ARCH/rfsimulator/README.md @@ -106,6 +106,24 @@ Note: In the UE, you can add `-d` option to get the softscope. +### Testing IP traffic (ping and iperf) + +``` +ping -I oaitun_enb1 10.0.1.2 (from gNB mchine) +ping -I oaitun_ue1 10.0.1.1 (from nrUE mchine) +``` + +```iperf (Downlink): +Server nrUE machine: iperf -s -i 1 -u -B 10.0.1.2 +Client gNB machine: iperf -c 10.0.1.2 -u -b 0.1M --bind 10.0.1.1 +``` + +```iperf (Uplink): +Server gNB machine: iperf -s -i 1 -u -B 10.0.1.1 +Client nrUE machine: iperf -c 10.0.1.1 -u -b 0.1M --bind 10.0.1.2 +Note: iperf tests cannot be performed only when running gNB and nrUE on separate hosts. +``` + ### Store and replay You can store emitted I/Q samples. If you set the option `saviq`, the simulator will write all the I/Q samples into this file. Then, you can replay with the executable `replay_node`. From 72d76c75856307d7b45d7bc6efa82d40ea3390cc Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Wed, 1 Apr 2020 16:52:56 +0200 Subject: [PATCH 10/14] dft-based pucch0 receiver --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 88 +++++++++++++++++++++------ openair1/PHY/TOOLS/lte_dfts.c | 4 ++ openair1/PHY/TOOLS/tools_defs.h | 2 + openair1/SIMULATION/NR_PHY/pucchsim.c | 30 ++++++--- 4 files changed, 98 insertions(+), 26 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index c1e202994b..3cd5f251af 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -17,6 +17,7 @@ #include "T.h" +#define DEBUG_NR_PUCCH_RX 1 void nr_decode_pucch0(int32_t **rxdataF, NR_DL_FRAME_PARMS *frame_parms, @@ -79,28 +80,32 @@ void nr_decode_pucch0(int32_t **rxdataF, nr_group_sequence_hopping(pucch_GroupHopping,pucch_pdu->hopping_id,n_hop,slot,&u,&v); // calculating u and v value alpha = nr_cyclic_shift_hopping(pucch_pdu->hopping_id,pucch_pdu->initial_cyclic_shift,mcs[i],l,pucch_pdu->start_symbol_index,slot); - #ifdef DEBUG_NR_PUCCH_RX - printf("\t [nr_generate_pucch0] sequence generation \tu=%d \tv=%d \talpha=%lf \t(for symbol l=%d)\n",u,v,alpha,l); - #endif +#ifdef DEBUG_NR_PUCCH_RX + printf("\t [nr_generate_pucch0] sequence generation \tu=%d \tv=%d \talpha=%lf \t(for symbol l=%d/%d,mcs %d)\n",u,v,alpha,l,l+pucch_pdu->start_symbol_index,mcs[i]); +#endif for (n=0; n<12; n++){ x_n_re[i][(12*l)+n] = (int16_t)((int16_t)(((((int32_t)(round(32767*cos(alpha*n))) * table_5_2_2_2_2_Re[u][n])>>15) - - (((int32_t)(round(32767*sin(alpha*n))) * table_5_2_2_2_2_Im[u][n])>>15)))>>15); // Re part of base sequence shifted by alpha + - (((int32_t)(round(32767*sin(alpha*n))) * table_5_2_2_2_2_Im[u][n])>>15)))); // Re part of base sequence shifted by alpha x_n_im[i][(12*l)+n] =(int16_t)((int16_t)(((((int32_t)(round(32767*cos(alpha*n))) * table_5_2_2_2_2_Im[u][n])>>15) - + (((int32_t)(round(32767*sin(alpha*n))) * table_5_2_2_2_2_Re[u][n])>>15)))>>15); // Im part of base sequence shifted by alpha - #ifdef DEBUG_NR_PUCCH_RX - printf("\t [nr_generate_pucch0] sequence generation \tu=%d \tv=%d \talpha=%lf \tx_n(l=%d,n=%d)=(%d,%d)\n", - u,v,alpha,l,n,x_n_re[(12*l)+n],x_n_im[(12*l)+n]); - #endif + + (((int32_t)(round(32767*sin(alpha*n))) * table_5_2_2_2_2_Re[u][n])>>15)))); // Im part of base sequence shifted by alpha +#ifdef DEBUG_NR_PUCCH_RX + printf("\t [nr_generate_pucch0] sequence generation \tu=%d \tv=%d \talpha=%lf \tx_n(l=%d,n=%d)=(%d,%d) %d,%d\n", + u,v,alpha,l,n,x_n_re[i][(12*l)+n],x_n_im[i][(12*l)+n], + (int32_t)(round(32767*cos(alpha*n))), + (int32_t)(round(32767*sin(alpha*n)))); +#endif } } } - int16_t r_re[24],r_im[24]; /* * Implementing TS 38.211 Subclause 6.3.2.3.2 Mapping to physical resources */ uint32_t re_offset=0; uint8_t l2; +#ifdef OLD_IMPL + int16_t r_re[24],r_im[24]; + for (l=0; lnr_of_symbols; l++) { l2 = l+pucch_pdu->start_symbol_index; @@ -122,7 +127,7 @@ void nr_decode_pucch0(int32_t **rxdataF, if (re_offset>= frame_parms->ofdm_symbol_size) re_offset-=frame_parms->ofdm_symbol_size; } - } + } double corr[nr_sequences],corr_re[nr_sequences],corr_im[nr_sequences]; memset(corr,0,nr_sequences*sizeof(double)); memset(corr_re,0,nr_sequences*sizeof(double)); @@ -144,7 +149,55 @@ void nr_decode_pucch0(int32_t **rxdataF, max_corr=corr[i]; } } +#else + int16_t *x_re = x_n_re[0],*x_im = x_n_im[0]; + int16_t xr[32] __attribute__((aligned(32))); + int16_t xrt[32] __attribute__((aligned(32))); + int32_t xrtmag=0; + int maxpos=0; + int n2=0; + uint8_t index=0; + memset((void*)xr,0,32*sizeof(int16_t)); + + for (l=0; lnr_of_symbols; l++) { + + l2 = l+pucch_pdu->start_symbol_index; + re_offset = (12*pucch_pdu->prb_start) + frame_parms->first_carrier_offset; + if (re_offset>= frame_parms->ofdm_symbol_size) + re_offset-=frame_parms->ofdm_symbol_size; + + AssertFatal(re_offset+12 < frame_parms->ofdm_symbol_size,"pucch straddles DC carrier, handle this!\n"); + + n2=0; + int16_t *r=(int16_t*)&rxdataF[0][(l2*frame_parms->ofdm_symbol_size+re_offset)]; + if (l==0) for (n=0;n<12;n++,n2+=2) { + xr[n2] =((int32_t)x_re[n]*r[n2]+(int32_t)x_im[n]*r[n2+1])>>15; + xr[n2+1]=((int32_t)x_re[n]*r[n2+1]-(int32_t)x_im[n]*r[n2])>>15; + printf("x (%d,%d), r (%d,%d), xr (%d,%d)\n", + x_re[n],x_im[n],r[n2],r[n2+1],xr[n2],xr[n2+1]); + } + else for (n=0;n<12;n++,n2+=2) { + xr[n2] +=((int32_t)x_re[n]*r[n2]+(int32_t)x_im[n]*r[n2+1])>>15; + xr[n2+1]+=((int32_t)x_re[n]*r[n2+1]-(int32_t)x_im[n]*r[n2])>>15; + } + x_re+=12; + x_im+=12; + } + idft16f(xr,xrt); + n2=0; + int32_t temp; + for (n=0;n<16;n++,n2+=2) { +#ifdef DEBUG_NR_PUCCH_RX + printf("PUCCH IDFT[%d] = (%d,%d)\n",n,xrt[n2],xrt[n2+1]); +#endif + if ((temp=(int32_t)xrt[n2]*xrt[n2]+(int32_t)xrt[n2+1]*xrt[n2+1])pdu_bit_map = pucch_pdu->sr_flag | ((pucch_pdu->bit_len_harq>0)<<1); uci_pdu->pucch_format = 0; // format 0 @@ -281,7 +334,6 @@ void nr_decode_pucch1( int32_t **rxdataF, re_offset = ((l+startingSymbolIndex)*frame_parms->ofdm_symbol_size) + (12*startingPRB) + frame_parms->first_carrier_offset; } - //txptr = &txdataF[0][re_offset]; for (int n=0; n<12; n++) { if ((n==6) && (startingPRB == (frame_parms->N_RB_DL>>1)) && ((frame_parms->N_RB_DL & 1) == 1)) { // if number RBs in bandwidth is odd and current PRB contains DC, we need to recalculate the offset when n=6 (for second half PRB) @@ -294,7 +346,7 @@ void nr_decode_pucch1( int32_t **rxdataF, #ifdef DEBUG_NR_PUCCH_RX printf("\t [nr_generate_pucch1] mapping PUCCH to RE \t amp=%d \tofdm_symbol_size=%d \tN_RB_DL=%d \tfirst_carrier_offset=%d \tz_pucch[%d]=txptr(%d)=(x_n(l=%d,n=%d)=(%d,%d))\n", amp,frame_parms->ofdm_symbol_size,frame_parms->N_RB_DL,frame_parms->first_carrier_offset,i+n,re_offset, - l,n,((int16_t *)&txdataF[0][re_offset])[0],((int16_t *)&txdataF[0][re_offset])[1]); + l,n,((int16_t *)&rxdataF[0][re_offset])[0],((int16_t *)&rxdataF[0][re_offset])[1]); #endif } @@ -305,7 +357,7 @@ void nr_decode_pucch1( int32_t **rxdataF, #ifdef DEBUG_NR_PUCCH_RX printf("\t [nr_generate_pucch1] mapping DM-RS to RE \t amp=%d \tofdm_symbol_size=%d \tN_RB_DL=%d \tfirst_carrier_offset=%d \tz_dm-rs[%d]=txptr(%d)=(x_n(l=%d,n=%d)=(%d,%d))\n", amp,frame_parms->ofdm_symbol_size,frame_parms->N_RB_DL,frame_parms->first_carrier_offset,i+n,re_offset, - l,n,((int16_t *)&txdataF[0][re_offset])[0],((int16_t *)&txdataF[0][re_offset])[1]); + l,n,((int16_t *)&rxdataF[0][re_offset])[0],((int16_t *)&rxdataF[0][re_offset])[1]); #endif // printf("l=%d\ti=%d\tre_offset=%d\treceived dmrs re=%d\tim=%d\n",l,i,re_offset,z_dmrs_re_rx[i+n],z_dmrs_im_rx[i+n]); } @@ -416,7 +468,7 @@ void nr_decode_pucch1( int32_t **rxdataF, mprime, m, n, (mprime*12*N_SF_mprime0_PUCCH_1)+(m*12)+n, table_6_3_2_4_1_2_Wi_Re[N_SF_mprime_PUCCH_1][w_index][m],y_n_re[n],table_6_3_2_4_1_2_Wi_Im[N_SF_mprime_PUCCH_1][w_index][m],y_n_im[n], table_6_3_2_4_1_2_Wi_Re[N_SF_mprime_PUCCH_1][w_index][m],y_n_im[n],table_6_3_2_4_1_2_Wi_Im[N_SF_mprime_PUCCH_1][w_index][m],y_n_re[n], - z_re[(mprime*12*N_SF_mprime0_PUCCH_1)+(m*12)+n],z_im[(mprime*12*N_SF_mprime0_PUCCH_1)+(m*12)+n]); + z_re_rx[(mprime*12*N_SF_mprime0_PUCCH_1)+(m*12)+n],z_im_rx[(mprime*12*N_SF_mprime0_PUCCH_1)+(m*12)+n]); #endif // multiplying with conjugate of low papr sequence z_re_temp = (int16_t)(((((int32_t)(r_u_v_alpha_delta_re[n])*z_re_rx[(mprime*12*N_SF_mprime0_PUCCH_1)+(m*12)+n])>>15) @@ -450,7 +502,7 @@ void nr_decode_pucch1( int32_t **rxdataF, mprime, m, n, (mprime*12*N_SF_mprime0_PUCCH_1)+(m*12)+n, table_6_3_2_4_1_2_Wi_Re[N_SF_mprime_PUCCH_1][w_index][m],r_u_v_alpha_delta_dmrs_re[n],table_6_3_2_4_1_2_Wi_Im[N_SF_mprime_PUCCH_1][w_index][m],r_u_v_alpha_delta_dmrs_im[n], table_6_3_2_4_1_2_Wi_Re[N_SF_mprime_PUCCH_1][w_index][m],r_u_v_alpha_delta_dmrs_im[n],table_6_3_2_4_1_2_Wi_Im[N_SF_mprime_PUCCH_1][w_index][m],r_u_v_alpha_delta_dmrs_re[n], - z_dmrs_re[(mprime*12*N_SF_mprime0_PUCCH_1)+(m*12)+n],z_dmrs_im[(mprime*12*N_SF_mprime0_PUCCH_1)+(m*12)+n]); + z_dmrs_re_rx[(mprime*12*N_SF_mprime0_PUCCH_1)+(m*12)+n],z_dmrs_im_rx[(mprime*12*N_SF_mprime0_PUCCH_1)+(m*12)+n]); #endif //finding channel coeffcients by dividing received dmrs with actual dmrs and storing them in z_dmrs_re_rx and z_dmrs_im_rx arrays z_dmrs_re_temp = (int16_t)(((((int32_t)(r_u_v_alpha_delta_dmrs_re[n])*z_dmrs_re_rx[(mprime*12*N_SF_mprime0_PUCCH_DMRS_1)+(m*12)+n])>>15) @@ -501,7 +553,7 @@ void nr_decode_pucch1( int32_t **rxdataF, mprime, m, n, (mprime*12*N_SF_mprime0_PUCCH_1)+(m*12)+n, table_6_3_2_4_1_2_Wi_Re[N_SF_mprime_PUCCH_1][w_index][m],y_n_re[n],table_6_3_2_4_1_2_Wi_Im[N_SF_mprime_PUCCH_1][w_index][m],y_n_im[n], table_6_3_2_4_1_2_Wi_Re[N_SF_mprime_PUCCH_1][w_index][m],y_n_im[n],table_6_3_2_4_1_2_Wi_Im[N_SF_mprime_PUCCH_1][w_index][m],y_n_re[n], - z_re[(mprime*12*N_SF_mprime0_PUCCH_1)+(m*12)+n],z_im[(mprime*12*N_SF_mprime0_PUCCH_1)+(m*12)+n]); + z_re_rx[(mprime*12*N_SF_mprime0_PUCCH_1)+(m*12)+n],z_im_rx[(mprime*12*N_SF_mprime0_PUCCH_1)+(m*12)+n]); #endif z_re_temp = (int16_t)(((((int32_t)(r_u_v_alpha_delta_re[n])*z_re_rx[(mprime*12*N_SF_mprime0_PUCCH_1)+(m*12)+n])>>15) + (((int32_t)(r_u_v_alpha_delta_im[n])*z_im_rx[(mprime*12*N_SF_mprime0_PUCCH_1)+(m*12)+n])>>15))>>1); @@ -529,7 +581,7 @@ void nr_decode_pucch1( int32_t **rxdataF, mprime, m, n, (mprime*12*N_SF_mprime0_PUCCH_1)+(m*12)+n, table_6_3_2_4_1_2_Wi_Re[N_SF_mprime_PUCCH_1][w_index][m],r_u_v_alpha_delta_dmrs_re[n],table_6_3_2_4_1_2_Wi_Im[N_SF_mprime_PUCCH_1][w_index][m],r_u_v_alpha_delta_dmrs_im[n], table_6_3_2_4_1_2_Wi_Re[N_SF_mprime_PUCCH_1][w_index][m],r_u_v_alpha_delta_dmrs_im[n],table_6_3_2_4_1_2_Wi_Im[N_SF_mprime_PUCCH_1][w_index][m],r_u_v_alpha_delta_dmrs_re[n], - z_dmrs_re[(mprime*12*N_SF_mprime0_PUCCH_1)+(m*12)+n],z_dmrs_im[(mprime*12*N_SF_mprime0_PUCCH_1)+(m*12)+n]); + z_dmrs_re_rx[(mprime*12*N_SF_mprime0_PUCCH_1)+(m*12)+n],z_dmrs_im_rx[(mprime*12*N_SF_mprime0_PUCCH_1)+(m*12)+n]); #endif //finding channel coeffcients by dividing received dmrs with actual dmrs and storing them in z_dmrs_re_rx and z_dmrs_im_rx arrays z_dmrs_re_temp = (int16_t)(((((int32_t)(r_u_v_alpha_delta_dmrs_re[n])*z_dmrs_re_rx[(mprime*12*N_SF_mprime0_PUCCH_DMRS_1)+(m*12)+n])>>15) diff --git a/openair1/PHY/TOOLS/lte_dfts.c b/openair1/PHY/TOOLS/lte_dfts.c index 2de8653ab3..4147ba6dc6 100644 --- a/openair1/PHY/TOOLS/lte_dfts.c +++ b/openair1/PHY/TOOLS/lte_dfts.c @@ -2437,6 +2437,10 @@ static inline void idft16(int16_t *x,int16_t *y) #endif } +void idft16f(int16_t *x,int16_t *y) { + idft16(x,y); +} + #if defined(__x86_64__) || defined(__i386__) #ifdef __AVX2__ // Does two 16-point IDFTS (x[0 .. 15] is 128 LSBs of input vector, x[16..31] is in 128 MSBs) diff --git a/openair1/PHY/TOOLS/tools_defs.h b/openair1/PHY/TOOLS/tools_defs.h index 4253eb28d3..8a2310378e 100644 --- a/openair1/PHY/TOOLS/tools_defs.h +++ b/openair1/PHY/TOOLS/tools_defs.h @@ -171,6 +171,8 @@ This function performs optimized fixed-point radix-2 FFT/IFFT. ); */ +void idft16f(int16_t *x,int16_t *y); + void idft1536(int16_t *sigF,int16_t *sig,int scale); void idft6144(int16_t *sigF,int16_t *sig,int scale); diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index 35e9713b27..33023eaeeb 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -454,8 +454,6 @@ int main(int argc, char **argv) for(SNR=snr0;SNR<=snr1;SNR=SNR+1){ ack_nack_errors=0; n_errors = 0; - sigma2_dB = 20*log10((double)amp/32767)-SNR; - sigma2 = pow(10,sigma2_dB/10); for (trial=0; trialpucch_config_dedicated,actual_payload,amp,nr_tti_tx,m0,nrofSymbols,startingSymbolIndex,startingPRB,startingPRB_intraSlotHopping,0,nr_bit); } - for(i=0; isamples_per_slot; i<(nr_tti_tx+1)*frame_parms->samples_per_slot; i++) { r_re[aa][i]=((double)(((int16_t *)txdata[0])[(i<<1)])/32767 + sqrt(sigma2/2)*gaussdouble(0.0,1.0)); r_im[aa][i]=((double)(((int16_t *)txdata[0])[(i<<1)+1])/32767+ sqrt(sigma2/2)*gaussdouble(0.0,1.0)); r_re[aa][i]=r_re[0][i]/(sqrt(sigma2/2)+1); @@ -481,13 +483,26 @@ int main(int argc, char **argv) ((int16_t *)txdata[aa])[(i<<1)+1] =(int16_t)round(r_im[aa][i]*32767); } if(format==0){ - nr_decode_pucch0(txdata,PUCCH_GroupHopping,n_id,&(payload_received),frame_parms,amp,nr_tti_tx,m0,nrofSymbols,startingSymbolIndex,startingPRB,nr_bit); + nfapi_nr_uci_pucch_pdu_format_0_1_t uci_pdu; + nfapi_nr_pucch_pdu_t pucch_pdu; + pucch_pdu.group_hop_flag = PUCCH_GroupHopping&1; + pucch_pdu.sequence_hop_flag = (PUCCH_GroupHopping>>1)&1; + pucch_pdu.bit_len_harq = nr_bit; + pucch_pdu.sr_flag = 0; + pucch_pdu.nr_of_symbols = nrofSymbols; + pucch_pdu.hopping_id = n_id; + pucch_pdu.initial_cyclic_shift = 0; + pucch_pdu.start_symbol_index = startingSymbolIndex; + pucch_pdu.prb_start = startingPRB; + nr_decode_pucch0(txdata,frame_parms,nr_tti_tx,&uci_pdu,&pucch_pdu); if(nr_bit==1) - ack_nack_errors+=(((actual_payload^payload_received)&2)>>1); + ack_nack_errors+=(actual_payload^uci_pdu.harq->harq_list[0].harq_value); else - ack_nack_errors+=(((actual_payload^payload_received)&2)>>1) + (((actual_payload^payload_received)&4)>>2); + ack_nack_errors+=((actual_payload^uci_pdu.harq->harq_list[0].harq_value)+((actual_payload>>1)^uci_pdu.harq->harq_list[1].harq_value)); + free(uci_pdu.harq->harq_list); } else{ + nr_decode_pucch1(txdata,PUCCH_GroupHopping,n_id,&(payload_received),frame_parms,amp,nr_tti_tx,m0,nrofSymbols,startingSymbolIndex,startingPRB,startingPRB_intraSlotHopping,timeDomainOCC,nr_bit); if(nr_bit==1) ack_nack_errors+=((actual_payload^payload_received)&1); @@ -496,8 +511,7 @@ int main(int argc, char **argv) } n_errors=((actual_payload^payload_received)&1)+(((actual_payload^payload_received)&2)>>1)+(((actual_payload^payload_received)&4)>>2)+n_errors; } - printf("Decoded payload is %ld\n",payload_received); - printf("SNR=%f, n_trials=%d, n_bit_errors=%d\n",SNR,n_trials,n_errors); + printf("SNR=%f, n_trials=%d, n_bit_errors=%d\n",SNR,n_trials,ack_nack_errors); if((float)ack_nack_errors/(float)(nr_bit*n_trials)<=target_error_rate){ printf("PUCCH test OK\n"); break; From b36d40d4a573908fefd126b65bbd432534b7f659 Mon Sep 17 00:00:00 2001 From: Gabriele Perrone Date: Fri, 3 Apr 2020 18:38:42 +0200 Subject: [PATCH 11/14] Update README.md --- targets/ARCH/rfsimulator/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/ARCH/rfsimulator/README.md b/targets/ARCH/rfsimulator/README.md index a4b030af85..421cc662bb 100644 --- a/targets/ARCH/rfsimulator/README.md +++ b/targets/ARCH/rfsimulator/README.md @@ -121,7 +121,7 @@ Client gNB machine: iperf -c 10.0.1.2 -u -b 0.1M --bind 10.0.1.1 ```iperf (Uplink): Server gNB machine: iperf -s -i 1 -u -B 10.0.1.1 Client nrUE machine: iperf -c 10.0.1.1 -u -b 0.1M --bind 10.0.1.2 -Note: iperf tests cannot be performed only when running gNB and nrUE on separate hosts. +Note: iperf tests can be performed only when running gNB and nrUE on separate hosts. ``` ### Store and replay From 1c16705355ac2450fdb282d5e10e685346ff7978 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Wed, 8 Apr 2020 00:03:44 +0200 Subject: [PATCH 12/14] pucch receiver for format 0 reworked without floating point and no generation of sequences for each decoding attempt, SR detection integrated --- cmake_targets/autotests/test_case_list.xml | 16 +++--- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 64 +++++++++++++++++----- openair1/PHY/defs_gNB.h | 17 +++--- 3 files changed, 67 insertions(+), 30 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index b3954db1fd..b7222d0330 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -1177,21 +1177,23 @@ execution - nr_pucchsim Test cases. (Test1: Format 0 ACK miss 106 PRB), - (Test2: Format 1 ACK miss 106 PRB), - (Test3: Format 1 ACK miss 273 PRB), - (Test4: Format 1 NACKtoACK 106 PRB) + nr_pucchsim Test cases. (Test1: Format 0 1-bit ACK miss 106 PRB), + (Test2: Format 0 2-bit ACK miss 106 PRB), + (Test3: Format 1 ACK miss 106 PRB), + (Test4: Format 1 ACK miss 273 PRB), + (Test5: Format 1 NACKtoACK 106 PRB) $OPENAIR_DIR/cmake_targets/build_oai --phy_simulators -c $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/targets/bin/nr_pucchsim.Rel15 - -R 106 -i 1 -P 0 -b 1 -s3 -n100 - -R 106 -i 14 -P 1 -b 1 -s-6 -n100 + -R 106 -i 1 -P 0 -b 1 -s-7 -n1000 + -R 106 -i 1 -P 0 -b 2 -s-7 -n1000 + -R 106 -i 14 -P 1 -b 1 -s-6 -n100 -R 273 -i 14 -P 1 -b 1 -s-6 -n100 -R 106 -i 14 -P 1 -b 1 -s-6 -T 0.001 -n1000 - nr_pucchsim.test1 nr_pucchsim.test2 nr_pucchsim.test3 nr_pucchsim.test4 + nr_pucchsim.test1 nr_pucchsim.test2 PUCCH test OK segmentation fault|assertion|exiting|fatal 3 diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index bb087aad0d..ee3e247cb0 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -94,7 +94,15 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, pucch_GroupHopping_t pucch_GroupHopping = pucch_pdu->group_hop_flag + (pucch_pdu->sequence_hop_flag<<1); - if(pucch_pdu->bit_len_harq==1){ + AssertFatal(pucch_pdu->bit_len_harq > 0 || pucch_pdu->sr_flag > 0, + "Either bit_len_harq (%d) or sr_flag (%d) must be > 0\n", + pucch_pdu->bit_len_harq,pucch_pdu->sr_flag); + + if(pucch_pdu->bit_len_harq==0){ + mcs=table1_mcs; + nr_sequences=1; + } + else if(pucch_pdu->bit_len_harq==1){ mcs=table1_mcs; nr_sequences=4>>(1-pucch_pdu->sr_flag); } @@ -275,6 +283,8 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, maxpos=i; } } + + uint8_t xrtmag_dB = dB_fixed(xrtmag); #ifdef DEBUG_NR_PUCCH_RX printf("PUCCH 0 : maxpos %d\n",maxpos); @@ -288,21 +298,45 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->ul_cqi = 0xff; // currently not valid uci_pdu->timing_advance = 0xffff; // currently not valid uci_pdu->rssi = 0xffff; // currently not valid - if (pucch_pdu->sr_flag) { - //currently not supported - } - else - uci_pdu->sr = NULL; - if (pucch_pdu->bit_len_harq>0) { - uci_pdu->harq = calloc(1,sizeof(*uci_pdu->harq)); - uci_pdu->harq->num_harq = pucch_pdu->bit_len_harq; - uci_pdu->harq->harq_confidence_level = 0xff; // currently not valid - uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(uci_pdu->harq->num_harq); - for (i=0; iharq->num_harq; i++) // FIXME for non present - uci_pdu->harq->harq_list[i].harq_value = (index>>i)&0x01; - } - else + + if (pucch_pdu->bit_len_harq==0) { uci_pdu->harq = NULL; + uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); + if (xrtmag_dB>(gNB->measurements.n0_subband_power_tot_dB[pucch_pdu->prb_start]+gNB->pucch0_thres)) { + uci_pdu->sr->sr_indication = 1; + uci_pdu->sr->sr_confidence_level = xrtmag_dB-(gNB->measurements.n0_subband_power_tot_dB[pucch_pdu->prb_start]+gNB->pucch0_thres); + } else { + uci_pdu->sr->sr_indication = 0; + uci_pdu->sr->sr_confidence_level = (gNB->measurements.n0_subband_power_tot_dB[pucch_pdu->prb_start]+gNB->pucch0_thres)-xrtmag_dB; + } + } + else if (pucch_pdu->bit_len_harq==1) { + uci_pdu->harq = calloc(1,sizeof(*uci_pdu->harq)); + uci_pdu->harq->num_harq = 1; + uci_pdu->harq->harq_confidence_level = xrtmag_dB-(gNB->measurements.n0_subband_power_tot_dB[pucch_pdu->prb_start]+gNB->pucch0_thres); + uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(1); + uci_pdu->harq->harq_list[0].harq_value = index&0x01; + if (pucch_pdu->sr_flag == 1) { + uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); + uci_pdu->sr->sr_indication = (index>1) ? 1 : 0; + uci_pdu->sr->sr_confidence_level = xrtmag_dB-(gNB->measurements.n0_subband_power_tot_dB[pucch_pdu->prb_start]+gNB->pucch0_thres); + } + } + else { + uci_pdu->harq = calloc(1,sizeof(*uci_pdu->harq)); + uci_pdu->harq->num_harq = 2; + uci_pdu->harq->harq_confidence_level = xrtmag_dB-(gNB->measurements.n0_subband_power_tot_dB[pucch_pdu->prb_start]+gNB->pucch0_thres); + uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2); + + uci_pdu->harq->harq_list[0].harq_value = index&0x01; + uci_pdu->harq->harq_list[1].harq_value = (index>>1)&0x01; + + if (pucch_pdu->sr_flag == 1) { + uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); + uci_pdu->sr->sr_indication = (index>3) ? 1 : 0; + uci_pdu->sr->sr_confidence_level = xrtmag_dB-(gNB->measurements.n0_subband_power_tot_dB[pucch_pdu->prb_start]+gNB->pucch0_thres); + } + } } diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index d64153414f..d39f0d4e0b 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -568,13 +568,13 @@ typedef struct { //! estimated avg noise power (dB) short n0_power_tot_dBm; //! estimated avg noise power per RB per RX ant (lin) - unsigned short n0_subband_power[MAX_NUM_RU_PER_gNB][100]; + unsigned short n0_subband_power[MAX_NUM_RU_PER_gNB][275]; //! estimated avg noise power per RB per RX ant (dB) - unsigned short n0_subband_power_dB[MAX_NUM_RU_PER_gNB][100]; + unsigned short n0_subband_power_dB[MAX_NUM_RU_PER_gNB][275]; //! estimated avg noise power per RB (dB) - short n0_subband_power_tot_dB[100]; + short n0_subband_power_tot_dB[275]; //! estimated avg noise power per RB (dBm) - short n0_subband_power_tot_dBm[100]; + short n0_subband_power_tot_dBm[275]; // gNB measurements (per user) //! estimated received spatial signal power (linear) unsigned int rx_spatial_power[NUMBER_OF_NR_DLSCH_MAX][2][2]; @@ -594,13 +594,13 @@ typedef struct { /// Wideband CQI (sum of all RX antennas, in dB) char wideband_cqi_tot[NUMBER_OF_NR_DLSCH_MAX]; /// Subband CQI per RX antenna and RB (= SINR) - int subband_cqi[NUMBER_OF_NR_DLSCH_MAX][MAX_NUM_RU_PER_gNB][100]; + int subband_cqi[NUMBER_OF_NR_DLSCH_MAX][MAX_NUM_RU_PER_gNB][275]; /// Total Subband CQI and RB (= SINR) - int subband_cqi_tot[NUMBER_OF_NR_DLSCH_MAX][100]; + int subband_cqi_tot[NUMBER_OF_NR_DLSCH_MAX][275]; /// Subband CQI in dB and RB (= SINR dB) - int subband_cqi_dB[NUMBER_OF_NR_DLSCH_MAX][MAX_NUM_RU_PER_gNB][100]; + int subband_cqi_dB[NUMBER_OF_NR_DLSCH_MAX][MAX_NUM_RU_PER_gNB][275]; /// Total Subband CQI and RB - int subband_cqi_tot_dB[NUMBER_OF_NR_DLSCH_MAX][100]; + int subband_cqi_tot_dB[NUMBER_OF_NR_DLSCH_MAX][275]; /// PRACH background noise level int prach_I0; } PHY_MEASUREMENTS_gNB; @@ -707,6 +707,7 @@ typedef struct PHY_VARS_gNB_s { /// counter to average prach energh over first 100 prach opportunities int prach_energy_counter; + int pucch0_thres; /* time_stats_t phy_proc; */ From c8ac5d56bf49d7f6edc3eb2c7c5166d5b13f921d Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Wed, 8 Apr 2020 12:47:34 +0200 Subject: [PATCH 13/14] compilation of NR executables with MAC --- openair1/SIMULATION/NR_PHY/dlsim.c | 3 ++- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 3 ++- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index ebcedbaeb0..1927f16d60 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -171,6 +171,7 @@ int main(int argc, char **argv) //int pbch_tx_ant; int N_RB_DL=106,mu=1; nfapi_nr_dl_tti_pdsch_pdu_rel15_t dlsch_config; + NR_sched_pucch pucch_sched; //unsigned char frame_type = 0; @@ -706,7 +707,7 @@ int main(int argc, char **argv) memset(RC.nrmac[0]->cce_list[1][0],0,MAX_NUM_CCE*sizeof(int)); clear_nr_nfapi_information(RC.nrmac[0], 0, frame, slot); - if (css_flag == 0) nr_schedule_uss_dlsch_phytest(0,frame,slot,&dlsch_config); + if (css_flag == 0) nr_schedule_uss_dlsch_phytest(0,frame,slot,&pucch_sched,&dlsch_config); else nr_schedule_css_dlsch_phytest(0,frame,slot); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index 304004ff8c..1665a9f612 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -541,7 +541,8 @@ void nr_schedule_uss_dlsch_phytest(module_id_t module_idP, TBS_bytes = configure_fapi_dl_pdu(module_idP, CCEIndices, - dl_req, + dl_req, + pucch_sched, dlsch_config!=NULL ? dlsch_config->mcsIndex : NULL, dlsch_config!=NULL ? &dlsch_config->rbSize : NULL, dlsch_config!=NULL ? &dlsch_config->rbStart : NULL); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 75d2385412..86dac1e11f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -123,7 +123,7 @@ typedef struct { DLSCH_PDU DLSCH_pdu[4][MAX_MOBILES_PER_GNB]; /// scheduling control info - UE_sched_ctrl_t UE_sched_ctrl[MAX_MOBILES_PER_GNB]; + NR_UE_sched_ctrl_t UE_sched_ctrl[MAX_MOBILES_PER_GNB]; int next[MAX_MOBILES_PER_GNB]; int head; int next_ul[MAX_MOBILES_PER_GNB]; From 786be88101ebd2d6ca0a57c29921a691c11411d4 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Thu, 9 Apr 2020 15:52:19 +0200 Subject: [PATCH 14/14] fixed unitary simulation issue for nr_ulsim and removed broken pucch1 tests --- cmake_targets/autotests/test_case_list.xml | 9 ++------- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 1 + 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index b7222d0330..7908772bb6 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -1178,10 +1178,7 @@ execution nr_pucchsim Test cases. (Test1: Format 0 1-bit ACK miss 106 PRB), - (Test2: Format 0 2-bit ACK miss 106 PRB), - (Test3: Format 1 ACK miss 106 PRB), - (Test4: Format 1 ACK miss 273 PRB), - (Test5: Format 1 NACKtoACK 106 PRB) + (Test2: Format 0 2-bit ACK miss 106 PRB) $OPENAIR_DIR/cmake_targets/build_oai --phy_simulators -c @@ -1190,9 +1187,7 @@ $OPENAIR_DIR/targets/bin/nr_pucchsim.Rel15 -R 106 -i 1 -P 0 -b 1 -s-7 -n1000 -R 106 -i 1 -P 0 -b 2 -s-7 -n1000 - -R 106 -i 14 -P 1 -b 1 -s-6 -n100 - -R 273 -i 14 -P 1 -b 1 -s-6 -n100 - -R 106 -i 14 -P 1 -b 1 -s-6 -T 0.001 -n1000 + nr_pucchsim.test1 nr_pucchsim.test2 PUCCH test OK segmentation fault|assertion|exiting|fatal diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 46f9a79460..76d35f7ae7 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -428,6 +428,7 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) nr_fill_rx_indication(gNB, frame_rx, slot_rx, ULSCH_id, harq_pid); // indicate SDU to MAC nr_fill_crc_indication(gNB, frame_rx, slot_rx, ULSCH_id, 0); } + break; case NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE:{ LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE\n",frame_rx,slot_rx);