From 56db8f4915f09013ed26a32f4e8d9dbc605e7877 Mon Sep 17 00:00:00 2001 From: Mahesh <maheshaithal@iisc.ac.in> Date: Tue, 24 Nov 2020 18:49:41 +0530 Subject: [PATCH] RESOLVED build errors --- .../enb.band7.tm1.fr1.25PRB.usrpb210.conf | 9 - .../gnb.band78.tm1.106PRB.usrpn300.conf | 13 - .../gnb.band78.tm1.fr1.106PRB.usrpb210.conf | 9 - .../conf_files/lte-fdd-fembms-basic-sim.conf | 6 - .../if4p5_usrp210_band40_test_10mhz.xml | 3 - doc/BUILD.md | 3 - doc/RUNMODEM.md | 3 - doc/TESTING_GNB_W_COTS_UE.md | 48 --- doc/testing_gnb_w_cots_ue_resources/enb.conf | 3 - executables/main-ocp.c | 8 - executables/nr-gnb.c | 10 +- executables/nr-ru.c | 57 ---- executables/nr-softmodem.c | 4 - executables/nr-ue.c | 10 +- executables/nr-uesoftmodem.c | 137 -------- executables/nr-uesoftmodem.h | 9 - nfapi/README.md | 97 ------ nfapi/nrNFAPI.md | 35 ++ nfapi/oai_integration/nfapi_pnf.c | 18 +- nfapi/oai_integration/nfapi_vnf.c | 6 +- .../nfapi/public_inc/fapi_nr_ue_interface.h | 6 - .../nfapi/public_inc/nfapi_nr_interface_scf.h | 20 +- nfapi/open-nFAPI/nfapi/src/nfapi_p7.c | 36 +-- nfapi/open-nFAPI/pnf/src/pnf_p7.c | 10 +- openair1/PHY/CODING/crc_byte.c | 4 - openair1/PHY/CODING/nr_rate_matching.c | 4 - openair1/PHY/INIT/nr_init.c | 24 +- openair1/PHY/INIT/nr_init_ru.c | 9 - openair1/PHY/MODULATION/nr_modulation.c | 7 - openair1/PHY/MODULATION/nr_modulation.h | 3 - openair1/PHY/MODULATION/slot_fep_nr.c | 24 +- openair1/PHY/NR_REFSIG/scrambling_luts.c | 8 +- openair1/PHY/NR_TRANSPORT/nr_dci.c | 29 -- openair1/PHY/NR_TRANSPORT/nr_dci.h | 4 - openair1/PHY/NR_TRANSPORT/nr_dci_tools.c | 18 +- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 54 ---- openair1/PHY/NR_TRANSPORT/nr_prach.c | 244 -------------- .../PHY/NR_TRANSPORT/nr_transport_proto.h | 37 +-- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 304 +----------------- .../PHY/NR_TRANSPORT/nr_ulsch_demodulation.c | 192 +---------- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 153 --------- openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h | 3 - .../PHY/NR_UE_ESTIMATION/nr_ue_measurements.c | 3 - openair1/PHY/NR_UE_TRANSPORT/dci_nr.c | 42 --- .../NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 11 - openair1/PHY/NR_UE_TRANSPORT/nr_prach.c | 136 -------- .../PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c | 11 - openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c | 69 ---- openair1/SCHED_NR/fapi_nr_l1.c | 8 +- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 30 +- openair1/SIMULATION/NR_PHY/ulsim.c | 277 ---------------- openair2/LAYER2/MAC/slicing/slicing.c | 6 - openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c | 43 +++ openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h | 69 +++- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 26 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 5 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 13 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 8 +- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 11 - openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 3 +- openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 2 +- openair2/RRC/LTE/MESSAGES/asn1_msg.c | 17 - openair2/RRC/LTE/rrc_eNB.c | 2 +- targets/ARCH/ETHERNET/benetel/4g/benetel.c | 4 - .../ARCH/ETHERNET/benetel/4g/dpdk_driver.c | 7 - targets/ARCH/ETHERNET/benetel/5g/benetel.c | 8 - .../ARCH/ETHERNET/benetel/5g/dpdk_driver.c | 37 --- targets/ARCH/ETHERNET/benetel/5g/low.c | 11 - targets/ARCH/rfsimulator/simulator.c | 5 - .../CONF/rcc.band78.tm1.106PRB.nfapi.conf | 45 ++- .../GENERIC-LTE-EPC/CONF/testing_gnb.conf | 3 - .../CONF/testing_gnb_n310.conf | 3 - targets/RT/USER/lte-softmodem.c | 17 +- 74 files changed, 265 insertions(+), 2350 deletions(-) delete mode 100644 nfapi/README.md create mode 100644 nfapi/nrNFAPI.md diff --git a/ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf index cac53857bc2..19e4abdcb02 100755 --- a/ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf @@ -144,11 +144,8 @@ eNBs = discRxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5; discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0; -<<<<<<< HEAD -======= //SSB central frequency of NR secondary cell group (for ENDC NSA) nr_scg_ssb_freq = 641272; ->>>>>>> fork_develop_new } ); @@ -186,10 +183,7 @@ eNBs = ////////// MME parameters: mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; ipv6 = "192:168:30::17"; -<<<<<<< HEAD -======= port = 36412 ; ->>>>>>> fork_develop_new active = "yes"; preference = "ipv4"; } @@ -199,11 +193,8 @@ eNBs = enable_x2 = "yes"; t_reloc_prep = 1000; /* unit: millisecond */ tx2_reloc_overall = 2000; /* unit: millisecond */ -<<<<<<< HEAD -======= t_dc_prep = 1000; /* unit: millisecond */ t_dc_overall = 2000; /* unit: millisecond */ ->>>>>>> fork_develop_new NETWORK_INTERFACES : { diff --git a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf index 117b8e0a5cf..0fe2adc9054 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf @@ -74,11 +74,7 @@ gNBs = initialDLBWPk0_3 = 0; initialDLBWPmappingType_3 = 0; -<<<<<<< HEAD - #this is SS=1,L=4 -======= #this is SS=1,L=5 ->>>>>>> fork_develop_new initialDLBWPstartSymbolAndLength_3 = 57; #uplinkConfigCommon @@ -149,11 +145,6 @@ gNBs = initialULBWPmappingType_2 = 1; # this is SS=10 L=4 initialULBWPstartSymbolAndLength_2 = 52; -<<<<<<< HEAD - -======= - ->>>>>>> fork_develop_new msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; @@ -258,11 +249,7 @@ RUs = ( eNB_instances = [0]; #beamforming 1x4 matrix: bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; -<<<<<<< HEAD - sdr_addrs = "addr=192.168.10.2,second_addr=192.168.20.2"; -======= sdr_addrs = "addr=192.168.10.2,mgmt_addr=192.168.10.2,second_addr=192.168.20.2"; ->>>>>>> fork_develop_new clock_src = "external"; } ); diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf index 3637500f3fa..0d9691966be 100755 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf @@ -201,10 +201,7 @@ gNBs = ////////// MME parameters: mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; ipv6 = "192:168:30::17"; -<<<<<<< HEAD -======= port = 36412 ; ->>>>>>> fork_develop_new active = "yes"; preference = "ipv4"; } @@ -214,11 +211,8 @@ gNBs = enable_x2 = "yes"; t_reloc_prep = 1000; /* unit: millisecond */ tx2_reloc_overall = 2000; /* unit: millisecond */ -<<<<<<< HEAD -======= t_dc_prep = 1000; /* unit: millisecond */ t_dc_overall = 2000; /* unit: millisecond */ ->>>>>>> fork_develop_new target_enb_x2_ip_address = ( { ipv4 = "CI_FR1_CTL_ENB_IP_ADDR"; ipv6 = "192:168:30::17"; @@ -298,9 +292,6 @@ THREAD_STRUCT = ( rrc_log_verbosity ="medium"; }; -<<<<<<< HEAD -======= uicc: { opc = "testopc"; }; ->>>>>>> fork_develop_new diff --git a/ci-scripts/conf_files/lte-fdd-fembms-basic-sim.conf b/ci-scripts/conf_files/lte-fdd-fembms-basic-sim.conf index 0741a78b58e..458ab7cf89b 100644 --- a/ci-scripts/conf_files/lte-fdd-fembms-basic-sim.conf +++ b/ci-scripts/conf_files/lte-fdd-fembms-basic-sim.conf @@ -174,10 +174,7 @@ eNBs = ////////// MME parameters: mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; ipv6 = "192:168:30::17"; -<<<<<<< HEAD -======= port = 36412 ; ->>>>>>> fork_develop_new active = "yes"; preference = "ipv4"; } @@ -189,11 +186,8 @@ eNBs = enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ tx2_reloc_overall = 2000; /* unit: millisecond */ -<<<<<<< HEAD -======= t_dc_prep = 1000; /* unit: millisecond */ t_dc_overall = 2000; /* unit: millisecond */ ->>>>>>> fork_develop_new ////////// MCE parameters: target_mce_m2_ip_address = ( { ipv4 = "127.0.0.7"; diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml index 8e5debee5fc..9224c67fe7b 100644 --- a/ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml +++ b/ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml @@ -25,11 +25,8 @@ <htmlTabName>Test-10MHz</htmlTabName> <htmlTabIcon>tasks</htmlTabIcon> <repeatCount>2</repeatCount> -<<<<<<< HEAD -======= <TestUnstable>True</TestUnstable> <TestMinId>040612</TestMinId> ->>>>>>> fork_develop_new <TestCaseRequestedList> 030201 040101 diff --git a/doc/BUILD.md b/doc/BUILD.md index 5bbb7f7a898..ba5db55cab3 100644 --- a/doc/BUILD.md +++ b/doc/BUILD.md @@ -16,10 +16,7 @@ This page is valid on tags starting from **`2019.w09`**. # Soft Modem Build Script -<<<<<<< HEAD -======= The OAI EPC is developed in a distinct project with it's own [documentation](https://github.com/OPENAIRINTERFACE/openair-epc-fed/wiki) , it is not described here. ->>>>>>> fork_develop_new OAI softmodem sources, which aim to implement 3GPP compliant UEs, eNodeB and gNodeB can be downloaded from the Eurecom [gitlab repository](./GET_SOURCES.md). diff --git a/doc/RUNMODEM.md b/doc/RUNMODEM.md index 2191bdbfde3..3f926624330 100644 --- a/doc/RUNMODEM.md +++ b/doc/RUNMODEM.md @@ -57,8 +57,6 @@ oai supports [number of deployment](FEATURE_SET.md) model, the following are tes 2. if4p5 mode, where frequency domain samples are carried over ethernet, from the RRU which implement part of L1(FFT,IFFT,part of PRACH), to a RAU # 5G NR -<<<<<<< HEAD -======= As of February 2020, all 5G NR development is part of the develop branch (the branch develop-nr is no longer maintained). This also means that all new development will be merged into there once it passes all the CI. @@ -165,7 +163,6 @@ UE on machine 2: `sudo ./nr-uesoftmodem -C 2169080000 --CO -400000000` ->>>>>>> fork_develop_new As of February 2020, all 5G NR development is part of the develop branch (the branch develop-nr is no longer maintained). This also means that all new development will be merged into there once it passes all the CI. diff --git a/doc/TESTING_GNB_W_COTS_UE.md b/doc/TESTING_GNB_W_COTS_UE.md index f885f11bbfe..610cc5bdd47 100644 --- a/doc/TESTING_GNB_W_COTS_UE.md +++ b/doc/TESTING_GNB_W_COTS_UE.md @@ -1,23 +1,8 @@ -<<<<<<< HEAD -STATUS 2020/07/30 : under continuous improvement ; updated the configuration files links with CI approved reference files -======= STATUS 2020/10/15 : added External Resources section and links ->>>>>>> fork_develop_new ## Table of Contents ## -<<<<<<< HEAD -1. [Configuration Overview](#configuration-overview) -2. [SW Repository / Branch](#repository) -3. [Architecture Setup](#architecture-setup) -4. [Build / Install](#build-and-install) -5. [Run / Test](#run-and-test) -6. [Test case](#test-case) -7. [Log file monitoring](#log-file-monitoring) -6. [Required tools for debug](#required-tools-for-debug) -7. [Status of interoperability](#status-of-interoperability) -======= 1. [External Resources](#external-resources) 2. [Configuration Overview](#configuration-overview) 3. [SW Repository / Branch](#repository) @@ -41,7 +26,6 @@ At time of writing, the openairinterface5G Commit Tag is 2020.w39 Faraday Cages can be found here : http://www.saelig.com/MFR00066/ste2300.htm ->>>>>>> fork_develop_new ## Configuration Overview @@ -100,11 +84,7 @@ cd cmake_targets/ - **EPC** for reference: -<<<<<<< HEAD -https://github.com/OPENAIRINTERFACE/openair-epc-fed/blob/master-documentation/docs/DEPLOY_HOME.md -======= https://github.com/OPENAIRINTERFACE/openair-epc-fed/blob/master/docs/DEPLOY_HOME.md ->>>>>>> fork_develop_new @@ -238,11 +218,7 @@ The test takes typically a few seconds, max 10-15 seconds. If it takes more than - **EPC** (on EPC host): for reference: -<<<<<<< HEAD -https://github.com/OPENAIRINTERFACE/openair-epc-fed/blob/master-documentation/docs/DEPLOY_HOME.md -======= https://github.com/OPENAIRINTERFACE/openair-epc-fed/blob/master/docs/DEPLOY_HOME.md ->>>>>>> fork_develop_new @@ -258,27 +234,16 @@ Execute: - **gNB** (on the gNB host) -<<<<<<< HEAD -======= **ATTENTION** : for the gNB execution, The **-E** option is required to enable the tri-quarter sampling rate when using a B2xx serie USRP The **-E** option is **NOT supported** when using a a N300 USRP ->>>>>>> fork_develop_new Execute: ``` ~/openairinterface5g/cmake_targets/ran_build/build$ sudo ./nr-softmodem -O **YOUR_GNB_CONF_FILE** -E | tee **YOUR_LOG_FILE** ``` -<<<<<<< HEAD -**ATTENTION** : for the gNB execution, -The -E option is required to enable the tri-quarter sampling rate when using a B2xx serie USRP -The -E opton is not needed when using a a N300 USRP - - -======= ->>>>>>> fork_develop_new ## Test Case @@ -425,18 +390,6 @@ The following parts have been validated with FR1 COTS UE: PDCCH DCI format 1_1 and correponding PDSCH are decoded correctlyby the phone ACK/NACK (PUCCH format 0) are successfully received at gNB -<<<<<<< HEAD -- On going: - validation of HARQ procedures - Integration with higher layers to replace dummy data with real traffic - -- Known limitations as of May 2020: - only dummy DL traffic - no UL traffic - no end-to-end traffic possible - - -======= - **End-to end UL / DL traffic with HARQ procedures validated (ping, iperf)** - Known limitations as of September 2020: @@ -458,4 +411,3 @@ python3 obj_build_from_yaml.py py_params_template.yaml fr1.sh At the date of writing, the test comprises the deployment of the components (epc, eNB, gNB, cots ue) and the execution of 2 pings procedures (20 pings in 20sec, then 5 pings in 1sec) This automation is run for every integration branch to be merged into develop. ->>>>>>> fork_develop_new diff --git a/doc/testing_gnb_w_cots_ue_resources/enb.conf b/doc/testing_gnb_w_cots_ue_resources/enb.conf index 7a6370365df..35249aac25d 100755 --- a/doc/testing_gnb_w_cots_ue_resources/enb.conf +++ b/doc/testing_gnb_w_cots_ue_resources/enb.conf @@ -187,11 +187,8 @@ eNBs = enable_x2 = "yes"; t_reloc_prep = 1000; /* unit: millisecond */ tx2_reloc_overall = 2000; /* unit: millisecond */ -<<<<<<< HEAD -======= t_dc_prep = 1000; /* unit: millisecond */ t_dc_overall = 2000; /* unit: millisecond */ ->>>>>>> fork_develop_new NETWORK_INTERFACES : { diff --git a/executables/main-ocp.c b/executables/main-ocp.c index 0b52e67d381..a1b239b3db4 100644 --- a/executables/main-ocp.c +++ b/executables/main-ocp.c @@ -82,9 +82,6 @@ int split73; int usrp_tx_thread = 0; char * split73_config; int split73; -<<<<<<< HEAD -int usrp_tx_thread = 0; -======= AGENT_RRC_xface *agent_rrc_xface[NUM_MAX_ENB]= {0}; AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB]= {0}; void flexran_agent_slice_update(mid_t module_idP) { @@ -94,7 +91,6 @@ int proto_agent_start(mod_id_t mod_id, const cudu_params_t *p){ } void proto_agent_stop(mod_id_t mod_id){ } ->>>>>>> fork_develop_new static void *ru_thread( void *param ); void kill_RU_proc(RU_t *ru) { @@ -1098,15 +1094,11 @@ int restart_L1L2(module_id_t enb_id) { pthread_mutex_lock(&sync_mutex); sync_var = -1; pthread_mutex_unlock(&sync_mutex); -<<<<<<< HEAD - RC.ru_mask |= (1 << ru->idx); -======= /* copy the changed frame parameters to the RU */ /* TODO this should be done for all RUs associated to this eNB */ memcpy(&ru->frame_parms, &RC.eNB[enb_id][0]->frame_parms, sizeof(LTE_DL_FRAME_PARMS)); ->>>>>>> fork_develop_new /* reset the list of connected UEs in the MAC, since in this process with * loose all UEs (have to reconnect) */ init_UE_info(&RC.mac[enb_id]->UE_info); diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 82dadfd9817..392dddd677a 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -144,6 +144,8 @@ static inline int rxtx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_t struct timespec current; clock_gettime(CLOCK_MONOTONIC, ¤t); //LOG_I(PHY,"%sCurrent time %d.%d,frame_rx %d,slot_rx %d,frame_tx %d,slot_tx %d\n", __FUNCTION__, current.tv_sec,current.tv_nsec,frame_rx,slot_rx,frame_tx,slot_tx); + // if(nfapi_mode!=0) + // sf_ahead = (uint16_t) ceil((float)6/(0x01<<gNB->frame_parms.numerology_index)); sl_ahead = sf_ahead*gNB->frame_parms.slots_per_subframe; nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; @@ -261,13 +263,6 @@ clock_gettime(CLOCK_MONOTONIC, ¤t); // TODO: check if this is correct for PARALLEL_RU_L1_TRX_SPLIT // Do PRACH RU processing -<<<<<<< HEAD - int prach_id=find_nr_prach(gNB,frame_rx,slot_rx,0,SEARCH_EXIST); - if (prach_id>=0) { - L1_nr_prach_procedures(gNB,frame_rx,slot_rx,&gNB->prach_vars.list[prach_id].pdu); - gNB->prach_vars.list[prach_id].frame=-1; - } -======= L1_nr_prach_procedures(gNB,frame_rx,slot_rx); //apply the rx signal rotation here @@ -278,7 +273,6 @@ clock_gettime(CLOCK_MONOTONIC, ¤t); gNB->frame_parms.Ncp==EXTENDED?12:14, gNB->frame_parms.ofdm_symbol_size); ->>>>>>> fork_develop_new phy_procedures_gNB_uespec_RX(gNB, frame_rx, slot_rx); } diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 9d9a88df13a..73a0c8909b6 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -1189,7 +1189,6 @@ int setup_RU_buffers(RU_t *ru) { int mu = config->ssb_config.scs_common.value; int N_RB = config->carrier_config.dl_grid_size[config->ssb_config.scs_common.value].value; -<<<<<<< HEAD if (config->cell_config.frame_duplex_type.value == TDD) { int N_TA_offset = config->carrier_config.uplink_frequency.value < 6000000 ? 400 : 431; // reference samples for 25600Tc @ 30.72 Ms/s for FR1, same @ 61.44 Ms/s for FR2 @@ -1234,52 +1233,6 @@ int setup_RU_buffers(RU_t *ru) { } else ru->N_TA_offset = 0; -======= - - if (config->cell_config.frame_duplex_type.value == TDD) { - int N_TA_offset = config->carrier_config.uplink_frequency.value < 6000000 ? 400 : 431; // reference samples for 25600Tc @ 30.72 Ms/s for FR1, same @ 61.44 Ms/s for FR2 - - double factor=1; - - switch (mu) { - case 0: //15 kHz scs - AssertFatal(N_TA_offset == 400,"scs_common 15kHz only for FR1\n"); - if (N_RB <= 25) factor = .25; // 7.68 Ms/s - else if (N_RB <=50) factor = .5; // 15.36 Ms/s - else if (N_RB <=75) factor = 1.0; // 30.72 Ms/s - else if (N_RB <=100) factor = 1.0; // 30.72 Ms/s - else AssertFatal(1==0,"Too many PRBS for mu=0\n"); - break; - case 1: //30 kHz sc - AssertFatal(N_TA_offset == 400,"scs_common 30kHz only for FR1\n"); - if (N_RB <= 106) factor = 2.0; // 61.44 Ms/s - else if (N_RB <= 275) factor = 4.0; // 122.88 Ms/s - break; - case 2: //60 kHz scs - AssertFatal(1==0,"scs_common should not be 60 kHz\n"); - break; - case 3: //120 kHz scs - AssertFatal(N_TA_offset == 431,"scs_common 120kHz only for FR2\n"); - break; - case 4: //240 kHz scs - AssertFatal(1==0,"scs_common should not be 60 kHz\n"); - if (N_RB <= 32) factor = 1.0; // 61.44 Ms/s - else if (N_RB <= 66) factor = 2.0; // 122.88 Ms/s - else AssertFatal(1==0,"N_RB %d is too big for curretn FR2 implementation\n",N_RB); - break; - - if (N_RB == 100) ru->N_TA_offset = 624; - else if (N_RB == 50) ru->N_TA_offset = 624/2; - else if (N_RB == 25) ru->N_TA_offset = 624/4; - } - if (frame_parms->threequarter_fs == 1) factor = factor*.75; - ru->N_TA_offset = (int)(N_TA_offset * factor); - LOG_I(PHY,"RU %d Setting N_TA_offset to %d samples (factor %f, UL Freq %d, N_RB %d)\n",ru->idx,ru->N_TA_offset,factor, - config->carrier_config.uplink_frequency.value, N_RB); - } - else ru->N_TA_offset = 0; - ->>>>>>> fork_develop_new if (ru->openair0_cfg.mmapped_dma == 1) { // replace RX signal buffers with mmaped HW versions @@ -1670,15 +1623,6 @@ void *ru_thread( void *param ) { (void*)ru->common.rxdataF[aa], fp->symbols_per_slot*fp->ofdm_symbol_size*sizeof(int32_t)); // Do PRACH RU processing -<<<<<<< HEAD - int prach_id=find_nr_prach_ru(ru,proc->frame_rx,proc->tti_rx,SEARCH_EXIST); - if (prach_id>=0) { - rx_nr_prach_ru(ru, - ru->prach_list[prach_id].fmt, - ru->prach_list[prach_id].numRA, - ru->prach_list[prach_id].prachStartSymbol, - proc->frame_rx,proc->tti_rx); -======= int prach_id=find_nr_prach_ru(ru,proc->frame_rx,proc->tti_rx,SEARCH_EXIST); uint8_t prachStartSymbol,N_dur; @@ -1709,7 +1653,6 @@ void *ru_thread( void *param ) { prach_oc, proc->frame_rx,proc->tti_rx); } ->>>>>>> fork_develop_new free_nr_ru_prach_entry(ru,prach_id); } } diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index f699135b741..6e5a8a26d43 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -957,11 +957,7 @@ if(!IS_SOFTMODEM_NOS1) // once all RUs are ready initialize the rest of the gNBs ((dependence on final RU parameters after configuration) printf("ALL RUs ready - init gNBs\n"); if(IS_SOFTMODEM_DOFORMS) { -<<<<<<< HEAD - -======= sleep(1); ->>>>>>> fork_develop_new scopeParms_t p; p.argc=&argc; p.argv=argv; diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 799189ab9d2..a168f697f74 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -140,11 +140,6 @@ void init_nr_ue_vars(PHY_VARS_NR_UE *ue, { int nb_connected_gNB = 1, gNB_id; -<<<<<<< HEAD - - memcpy(&(ue->frame_parms), frame_parms, sizeof(NR_DL_FRAME_PARMS)); -======= ->>>>>>> fork_develop_new ue->Mod_id = UE_id; ue->mac_enabled = 1; @@ -167,12 +162,9 @@ void init_nr_ue_vars(PHY_VARS_NR_UE *ue, // intialize transport init_nr_ue_transport(ue, abstraction_flag); -<<<<<<< HEAD -======= // init N_TA offset init_N_TA_offset(ue); ->>>>>>> fork_develop_new } /*! @@ -835,7 +827,7 @@ void *UE_thread(void *arg) { } void init_NR_UE(int nb_inst, char* rrc_config_path) { - int inst; + int inst; NR_UE_MAC_INST_t *mac_inst; NR_UE_RRC_INST_t* rrc_inst; diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index a0af42c9498..12d60c09dd0 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -144,35 +144,6 @@ double rx_gain[MAX_NUM_CCs][4] = {{110,0,0,0},{20,0,0,0}}; // UE and OAI config variables -<<<<<<< HEAD -int rx_input_level_dBm; - -//static int online_log_messages=0; - - -int otg_enabled; -//int number_of_cards = 1; - -static NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]; -int16_t node_synch_ref[MAX_NUM_CCs]; - -uint32_t target_dl_mcs = 28; //maximum allowed mcs -uint32_t target_ul_mcs = 20; -uint32_t timing_advance = 0; -uint64_t num_missed_slots=0; // counter for the number of missed slots - - -int transmission_mode=1; -int numerology = 0; -int usrp_tx_thread = 0; - -/* flag set by eNB conf file to specify if the radio head is local or remote (default option is local) */ -//uint8_t local_remote_radio = BBU_LOCAL_RADIO_HEAD; -/* struct for ethernet specific parameters given in eNB conf file */ -//eth_params_t *eth_params; - -double cpuf; -======= openair0_config_t openair0_cfg[MAX_CARDS]; int16_t node_synch_ref[MAX_NUM_CCs]; int otg_enabled; @@ -187,7 +158,6 @@ int numerology = 0; int usrp_tx_thread = 0; int oaisim_flag = 0; int emulate_rf = 0; ->>>>>>> fork_develop_new char uecap_xer[1024],uecap_xer_in=0; @@ -239,40 +209,6 @@ void exit_function(const char *file, const char *function, const int line, const exit(1); } -<<<<<<< HEAD - -void reset_stats(long arg) { - //int i,j,k; - /*PHY_VARS_eNB *phy_vars_eNB = PHY_vars_eNB_g[0][0]; - - for (i=0; i<NUMBER_OF_UE_MAX; i++) { - for (k=0; k<8; k++) { //harq_processes - for (j=0; j<phy_vars_eNB->dlsch[i][0]->Mlimit; j++) { - phy_vars_eNB->UE_stats[i].dlsch_NAK[k][j]=0; - phy_vars_eNB->UE_stats[i].dlsch_ACK[k][j]=0; - phy_vars_eNB->UE_stats[i].dlsch_trials[k][j]=0; - } - - phy_vars_eNB->UE_stats[i].dlsch_l2_errors[k]=0; - phy_vars_eNB->UE_stats[i].ulsch_errors[k]=0; - phy_vars_eNB->UE_stats[i].ulsch_consecutive_errors=0; - - for (j=0; j<phy_vars_eNB->ulsch[i]->Mlimit; j++) { - phy_vars_eNB->UE_stats[i].ulsch_decoding_attempts[k][j]=0; - phy_vars_eNB->UE_stats[i].ulsch_decoding_attempts_last[k][j]=0; - phy_vars_eNB->UE_stats[i].ulsch_round_errors[k][j]=0; - phy_vars_eNB->UE_stats[i].ulsch_round_fer[k][j]=0; - } - } - - phy_vars_eNB->UE_stats[i].dlsch_sliding_cnt=0; - phy_vars_eNB->UE_stats[i].dlsch_NAK_round0=0; - phy_vars_eNB->UE_stats[i].dlsch_mcs_offset=0; - }*/ -} - -======= ->>>>>>> fork_develop_new void *l2l1_task(void *arg) { MessageDef *message_p = NULL; int result; @@ -614,74 +550,6 @@ int main( int argc, char **argv ) { mac->if_module->phy_config_request(&mac->phy_config); fapi_nr_config_request_t *nrUE_config = &UE[CC_id]->nrUE_config; -<<<<<<< HEAD - nr_init_frame_parms_ue(frame_parms[CC_id],nrUE_config,NORMAL); - - // Overwrite DL frequency (for FR2 testing) - if (downlink_frequency[0][0]!=0) { - frame_parms[CC_id]->dl_CarrierFreq = downlink_frequency[0][0]; - frame_parms[CC_id]->ul_CarrierFreq = downlink_frequency[0][0]; - } - - init_symbol_rotation(frame_parms[CC_id],frame_parms[CC_id]->dl_CarrierFreq); - init_nr_ue_vars(UE[CC_id],frame_parms[CC_id],0,abstraction_flag); - - UE[CC_id]->mac_enabled = 1; - UE[CC_id]->if_inst = nr_ue_if_module_init(0); - UE[CC_id]->UE_scan = UE_scan; - UE[CC_id]->UE_scan_carrier = UE_scan_carrier; - UE[CC_id]->UE_fo_compensation = UE_fo_compensation; - UE[CC_id]->mode = mode; - UE[CC_id]->no_timing_correction = UE_no_timing_correction; - printf("UE[%d]->mode = %d\n",CC_id,mode); - - UE[CC_id]->rx_total_gain_dB = (int)rx_gain[CC_id][0] + rx_gain_off; - UE[CC_id]->tx_power_max_dBm = tx_max_power[CC_id]; - - if (UE[CC_id]->frame_parms.frame_type == FDD) { - UE[CC_id]->N_TA_offset = 0; - } else { - int N_RB = UE[CC_id]->frame_parms.N_RB_DL; - int N_TA_offset = UE[CC_id]->frame_parms.ul_CarrierFreq < 6e9 ? 400 : 431; // reference samples for 25600Tc @ 30.72 Ms/s for FR1, same @ 61.44 Ms/s for FR2 - double factor=1; - switch (UE[CC_id]->frame_parms.numerology_index) { - case 0: //15 kHz scs - AssertFatal(N_TA_offset == 400, "scs_common 15kHz only for FR1\n"); - if (N_RB <= 25) factor = .25; // 7.68 Ms/s - else if (N_RB <=50) factor = .5; // 15.36 Ms/s - else if (N_RB <=75) factor = 1.0; // 30.72 Ms/s - else if (N_RB <=100) factor = 1.0; // 30.72 Ms/s - else AssertFatal(1==0,"Too many PRBS for mu=0\n"); - break; - case 1: //30 kHz sc - AssertFatal(N_TA_offset == 400, "scs_common 30kHz only for FR1\n"); - if (N_RB <= 106) factor = 2.0; // 61.44 Ms/s - else if (N_RB <= 275) factor = 4.0; // 122.88 Ms/s - break; - case 2: //60 kHz scs - AssertFatal(1==0,"scs_common should not be 60 kHz\n"); - break; - case 3: //120 kHz scs - AssertFatal(N_TA_offset == 431, "scs_common 120kHz only for FR2\n"); - break; - case 4: //240 kHz scs - AssertFatal(1==0,"scs_common should not be 60 kHz\n"); - if (N_RB <= 32) factor = 1.0; // 61.44 Ms/s - else if (N_RB <= 66) factor = 2.0; // 122.88 Ms/s - else AssertFatal(1==0,"N_RB %d is too big for curretn FR2 implementation\n",N_RB); - break; - - if (N_RB == 100) - UE[CC_id]->N_TA_offset = 624; - else if (N_RB == 50) - UE[CC_id]->N_TA_offset = 624/2; - else if (N_RB == 25) - UE[CC_id]->N_TA_offset = 624/4; - } - if (UE[CC_id]->frame_parms.threequarter_fs == 1) factor = factor*.75; - UE[CC_id]->N_TA_offset = (int)(N_TA_offset * factor); - LOG_I(PHY,"UE %d Setting N_TA_offset to %d samples (factor %f, UL Freq %lu, N_RB %d)\n", UE[CC_id]->Mod_id, UE[CC_id]->N_TA_offset, factor, UE[CC_id]->frame_parms.ul_CarrierFreq, N_RB); -======= nr_init_frame_parms_ue(&UE[CC_id]->frame_parms, nrUE_config, *mac->scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]); init_symbol_rotation(&UE[CC_id]->frame_parms, UE[CC_id]->frame_parms.dl_CarrierFreq); @@ -693,7 +561,6 @@ int main( int argc, char **argv ) { frame_parms[CC_id]->dl_CarrierFreq = downlink_frequency[0][0]; if (frame_parms[CC_id]->frame_type == TDD) frame_parms[CC_id]->ul_CarrierFreq = downlink_frequency[0][0]; ->>>>>>> fork_develop_new } #endif } @@ -708,10 +575,6 @@ int main( int argc, char **argv ) { if(IS_SOFTMODEM_DOFORMS) { load_softscope("nr",PHY_vars_UE_g[0][0]); } -<<<<<<< HEAD - number_of_cards = 1; -======= ->>>>>>> fork_develop_new for(int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { PHY_vars_UE_g[0][CC_id]->rf_map.card=0; diff --git a/executables/nr-uesoftmodem.h b/executables/nr-uesoftmodem.h index 10bae4a0473..b2d321ae293 100644 --- a/executables/nr-uesoftmodem.h +++ b/executables/nr-uesoftmodem.h @@ -61,17 +61,8 @@ {"nr-dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&nr_dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \ {"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \ {"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, iptr:&threequarter_fs, defintval:0, TYPE_INT, 0}, \ -<<<<<<< HEAD - {"m" , CONFIG_HLP_DLMCS, 0, uptr:&target_dl_mcs, defintval:0, TYPE_UINT, 0}, \ - {"t" , CONFIG_HLP_ULMCS, 0, uptr:&target_ul_mcs, defintval:0, TYPE_UINT, 0}, \ {"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \ {"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&vcdflag, defintval:0, TYPE_INT, 0}, \ - {"s" , CONFIG_HLP_SNR, 0, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0}, \ - {"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, iptr:&nonbiotflag, defintval:0, TYPE_INT, 0}, \ -======= - {"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \ - {"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&vcdflag, defintval:0, TYPE_INT, 0}, \ ->>>>>>> fork_develop_new {"ue-timing-correction-disable", CONFIG_HLP_DISABLETIMECORR, PARAMFLAG_BOOL, iptr:&UE_no_timing_correction, defintval:0, TYPE_INT, 0}, \ {"rrc_config_path", CONFIG_HLP_RRC_CFG_PATH,0, strptr:(char **)&rrc_config_path, defstrval:"./", TYPE_STRING, 0} \ } diff --git a/nfapi/README.md b/nfapi/README.md deleted file mode 100644 index 7d077e3187e..00000000000 --- a/nfapi/README.md +++ /dev/null @@ -1,97 +0,0 @@ -## Running using USRP -### PNF -``` -sudo <oai_codebase>/cmake_targets/ran_build/build/nr-softmodem -O <oai_codebase>/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf --pnf -``` - -### VNF -``` -sudo <oai_codebase>/cmake_targets/ran_build/build/nr-softmodem -O <oai_codebase>/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf --vnf -``` - - -## Running using RF-Simulator -### PNF -``` -sudo RFSIMULATOR=server <oai_codebase>/cmake_targets/ran_build/build/nr-softmodem -O <oai_codebase>/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf --pnf --parallel-config PARALLEL_SINGLE_THREAD --rfsim -``` -### VNF -``` -sudo <oai_codebase>/cmake_targets/ran_build/build/nr-softmodem -O <oai_codebase>/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf --vnf -``` - -# 20 July 2020 -## Plan - -### Task-A [packing] -* Modify `nfapi_p7_message_pack()` in `nfapi_p7.c` -* In the switch case, change the labels as well as the pack functions: - * `pack_dl_config_request` becomes `pack_dl_tti_request` [x] - * `pack_ul_config_request` becomes `pack_ul_tti_request` [x] - * `pack_hi_dci0_request` becomes `pack_ul_dci_request` [x] - * `pack_tx_request` becomes `pack_tx_data_request` [x] - -### Task-B [unpacking] -* Modify `nfapi_p7_message_unpack()` in `nfapi_p7.c` - * `unpack_dl_tti_request` [x] - * `unpack_ul_tti_request` [x] - * `unpack_ul_dci_request` [x] - * `unpack_tx_data_request` [x] - -* Similarly change all the `unpack` functions within the switch-case block. - -* Modify the behaviour of `check_unpack_length()` for the new `TAGS` - * this is where the unpack functions are called - * `dl_tti_request` [x] - * `ul_tti_request` [x] - * `ul_dci_request` [x] - * `tx_data_request` [x] -* `nfapi_p7_message_unpack()` is called in `pnf_handle_dl_config_request()` in pnf_p7.c, so we need to add - * `pnf_handle_dl_tti_request` [x] - * `pnf_handle_ul_tti_request` [x] - * `pnf_handle_ul_dci_request` [x] - * `pnf_handle_tx_data_request`[x] - to handle DL P7 messages at pnf -* Added allocate and deallocate functions for all P7 DL messages in `pnf_p7.c` -* Added `is_nr_p7_request_in_window()` fn in `pnf_p7.c` that is called in P7 message handle fns - -### Task-C -* Write the `ul_tti` alternative for `nfapi_vnf_p7_ul_config_req()` in `vnf_p7_interface.c` and other such functions. - * `dl_tti` is present as `nr_dl_config` [x] - * `ul_tti` [x] - * `ul_dci` [x] - * `tx_data` [x] - -* Resolve the hard-coded areas in source code. [`HIGH-PRIORITY`] [x] - -* Write the `ul_tti` equivalent for `oai_nfapi_dl_config_req` in `nfapi_vnf.c` and other such functions. - * `dl_tti` is present as `nr_dl_config` [x] - * `ul_tti` is present as `oai_nfapi_ul_tti_req()` [x] - * `ul_dci` is present as `oai_nfapi_ul_dci_req()` [x] - * `tx_data` is present as `oai_nfapi_tx_data_req()` [x] - -* Check if `nr_schedule_response()` needs to be upgraded [x] - * only a couple of `NFAPI_MODE!=VNF_MODE` checks *can be added* before calling the functions to handle PDUs - * we need to add `NFAPI_MODE!=MONOLITHIC` checks before `oai_nfapi_dl_config_req` and other such fns [x] -* Sync with the latest stable commit in `develop` branch [`LOW-PRIORITY`] - * check deviations - -### Task-D -* Write `send_mac_slot_indications()` which calls the `slot_indication` in `vnf_p7.c` file [x] -* Change the `vnf_handle_timing_info()` function that calls p7 message unpack fn and initializes the sfn and slot in `vnf_p7.c` file [x] -* Change pack and unpack functions `pack_timing_info()` and `unpack_timing_info()` [x] -* Change `nfapi_timing_info_t` structure to support P7 in NR [x] -* Change packing functions for timing info to support NR P7 procedures. [x] - - -### Testing -* Test by running VNF on a terminal and PNF in rfsim parallely -* If all works fine, move to UE testing. -* Check if the `FAPI` core functionality is not broken by running gNB in monolithic mode -* Check whether the code can support latency of 0.5 ms for oai_slot_indication - -* Testing with a UE - * Run VNF - * Run PNF in rfsim - * Run UE in rfsim -* This can be done on parallel terminals on the same machine or different machine with the appropriate configuration \ No newline at end of file diff --git a/nfapi/nrNFAPI.md b/nfapi/nrNFAPI.md new file mode 100644 index 00000000000..607673305f2 --- /dev/null +++ b/nfapi/nrNFAPI.md @@ -0,0 +1,35 @@ +# Procedure to run nFAPI in 5G NR + +## Conributed by 5G Testbed IISC +### Developers: Sudhakar B,Mahesh K,Gokul S,Aniq U.R + +## Procedure to Build gNB and UE + +The regular commands to build gNB and UE can be used +``` +sudo ./build_oai --gNB --UE + +``` +## Procedure to run NR nFAPI using RF-Simulator + +### VNF command +``` +sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf --vnf --noS1 --phy-test + +``` +### PNF command +``` +sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf --pnf --rfsim --phy-test --rfsimulator.serveraddr server + +``` +### UE command +``` +sudo RFSIMULATOR=127.0.0.1 ./nr-uesoftmodem --rfsim --phy-test --rrc_config_path . -d + +``` +## Procedure to run NR nFAPI using Hardware +Will be updated as we have not yet currently tested on hardware + +## Notes +* In order to acheive the synchronization between VNF and PNF and receive the P7 messages within the timing window the order in which we should run the modules on different terminals is UE->VNF->PNF +* Currently only downlink is functional and working as we are still working on uplink functionality diff --git a/nfapi/oai_integration/nfapi_pnf.c b/nfapi/oai_integration/nfapi_pnf.c index a7df3da5344..8a599a4b4f1 100644 --- a/nfapi/oai_integration/nfapi_pnf.c +++ b/nfapi/oai_integration/nfapi_pnf.c @@ -1333,7 +1333,7 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, struct PHY_VARS_gNB_s *gNB = RC.gNB[0]; if (proc==NULL) proc = &gNB->proc.L1_proc; - nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdu_list = req->dl_tti_pdu_list; + nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdu_list = req->dl_tti_request_body.dl_tti_pdu_list; // TODO: NR_gNB_PDCCH not defined yet (check later) #if 0 @@ -1342,25 +1342,25 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, pdcch_vars->num_dci = 0; #endif - if (req->nPDUs) + if (req->dl_tti_request_body.nPDUs) NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() TX:%d/%d RX:%d/%d; sfn:%d, slot:%d, nGroup:%u, nPDUs: %u, nUE: %u, PduIdx: %u,\n", __FUNCTION__, proc->frame_tx, proc->slot_tx, proc->frame_rx, proc->slot_rx, // TODO: change subframes to slot req->SFN, req->Slot, - req->nGroup, - req->nPDUs, - req->nUe, - req->PduIdx); + req->dl_tti_request_body.nGroup, + req->dl_tti_request_body.nPDUs, + req->dl_tti_request_body.nUe, + req->dl_tti_request_body.PduIdx); - for (int i=0; i<req->nPDUs; i++) { + for (int i=0; i<req->dl_tti_request_body.nPDUs; i++) { // TODO: enable after adding gNB PDCCH: // NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() sfn/sf:%d PDU[%d] size:%d pdcch_vars->num_dci:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), i, dl_config_pdu_list[i].pdu_size,pdcch_vars->num_dci); if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE) { nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdu=&dl_tti_pdu_list[i]; memcpy(dl_tti_pdu,&dl_tti_pdu_list[i],sizeof(nfapi_nr_dl_tti_request_pdu_t)); - //sfn=sfn+2; - handle_nfapi_nr_pdcch_pdu(gNB, sfn, slot, &dl_tti_pdu->pdcch_pdu); + int SFN=sfn+2; + handle_nfapi_nr_pdcch_pdu(gNB, SFN, slot, &dl_tti_pdu->pdcch_pdu); //dl_tti_pdu_list[i].pdcch_pdu.pdcch_pdu_rel15.numDlDci++; // ? // NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() pdcch_vars->num_dci:%d\n", __FUNCTION__, pdcch_vars->num_dci); } else if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_SSB_PDU_TYPE) { diff --git a/nfapi/oai_integration/nfapi_vnf.c b/nfapi/oai_integration/nfapi_vnf.c index 17a8dc4fcaf..51fd1e657f1 100644 --- a/nfapi/oai_integration/nfapi_vnf.c +++ b/nfapi/oai_integration/nfapi_vnf.c @@ -474,7 +474,7 @@ int wake_gNB_rxtx(PHY_VARS_gNB *gNB, uint16_t sfn, uint16_t slot) { // The last (TS_rx mod samples_per_frame) was n*samples_per_tti, // we want to generate subframe (n+N), so TS_tx = TX_rx+N*samples_per_tti, // and proc->subframe_tx = proc->subframe_rx+sf_ahead - L1_proc->timestamp_tx = proc->timestamp_rx + (slot_ahead *fp->samples_per_tti); + L1_proc->timestamp_tx = proc->timestamp_rx + (slot_ahead *fp->samples_per_subframe); L1_proc->frame_rx = proc->frame_rx; L1_proc->slot_rx = proc->slot_rx; L1_proc->frame_tx = (L1_proc->slot_rx > (19-slot_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx; @@ -1610,8 +1610,8 @@ int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_tti_request_t *dl_config_req) int retval = nfapi_vnf_p7_nr_dl_config_req(p7_config, dl_config_req); - dl_config_req->nPDUs = 0; - dl_config_req->nGroup = 0; + dl_config_req->dl_tti_request_body.nPDUs = 0; + dl_config_req->dl_tti_request_body.nGroup = 0; if (retval!=0) { diff --git a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h index 322fd607354..87a4d6f6af9 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h @@ -171,10 +171,7 @@ typedef struct { uint8_t prach_format; /// Num RA uint8_t num_ra; -<<<<<<< HEAD -======= uint8_t prach_slot; ->>>>>>> fork_develop_new uint8_t prach_start_symbol; /// 38.211 (NCS 38.211 6.3.3.1). uint16_t num_cs; @@ -184,11 +181,8 @@ typedef struct { uint8_t restricted_set; /// see TS 38.211 (6.3.3.2). uint16_t freq_msg1; -<<<<<<< HEAD -======= // When multiple SSBs per RO is configured, this indicates which one is selected in this RO -> this is used to properly compute the PRACH preamble uint8_t ssb_nb_in_ro; ->>>>>>> fork_develop_new // nfapi_nr_ul_beamforming_t beamforming; } fapi_nr_ul_config_prach_pdu; diff --git a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h index a6fe17e4413..e84c7d983bb 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h @@ -69,11 +69,7 @@ typedef enum { NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION= 0X86, NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION= 0X87, NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION= 0X88, -<<<<<<< HEAD NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION= 0X89, -======= - NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION= 0X89 ->>>>>>> fork_develop_new //RESERVED 0X8a ~ 0xff NFAPI_NR_PHY_MSG_TYPE_PNF_PARAM_REQUEST = 0x0100, NFAPI_NR_PHY_MSG_TYPE_PNF_PARAM_RESPONSE = 0x0101, @@ -1040,7 +1036,7 @@ typedef struct { } nfapi_nr_dl_tti_request_pdu_t; #define NFAPI_NR_MAX_DL_TTI_PDUS 32 -/* + typedef struct { /// Number of PDUs that are included in this message. All PDUs in the message are numbered in order. Value 0 -> 255 uint8_t nPDUs; @@ -1053,7 +1049,7 @@ typedef struct { /// This value is an index for number of PDU identified by nPDU in this message Value: 0 -> 255 uint8_t PduIdx[256][12]; } nfapi_nr_dl_tti_request_body_t; -*/ + typedef struct { nfapi_p7_message_header_t header; @@ -1077,17 +1073,7 @@ typedef struct { uint16_t SFN; /// Slot number (0-19) uint16_t Slot; - /// Number of PDUs that are included in this message. All PDUs in the message are numbered in order. Value 0 -> 255 - uint8_t nPDUs; - /// Number of UEs in the Group included in this message. Value 0 -> 255 - uint8_t nGroup; - /// List containing PDUs - nfapi_nr_dl_tti_request_pdu_t dl_tti_pdu_list[NFAPI_NR_MAX_DL_TTI_PDUS]; - //nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdu_list; - /// Number of UE in this group. For SU-MIMO, one group includes one UE only. For MU-MIMO, one group includes up to 12 UEs. Value 1 -> 12 - uint8_t nUe[256]; - /// This value is an index for number of PDU identified by nPDU in this message Value: 0 -> 255 - uint8_t PduIdx[256][12]; + nfapi_nr_dl_tti_request_body_t dl_tti_request_body; nfapi_vendor_extension_tlv_t vendor_extension; } nfapi_nr_dl_tti_request_t; diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c index 537792aebf4..f33a3b4782c 100755 --- a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c +++ b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c @@ -899,27 +899,27 @@ static uint8_t pack_dl_tti_request(void *msg, uint8_t **ppWritePackedMsg, uint8_ if (!(push16(pNfapiMsg->SFN , ppWritePackedMsg, end) && push16(pNfapiMsg->Slot , ppWritePackedMsg, end) && - push8(pNfapiMsg->nGroup , ppWritePackedMsg, end) && - push8(pNfapiMsg->nPDUs , ppWritePackedMsg, end) && - pusharray8(pNfapiMsg->nUe ,256,pNfapiMsg->nGroup, ppWritePackedMsg, end) + push8(pNfapiMsg->dl_tti_request_body.nGroup , ppWritePackedMsg, end) && + push8(pNfapiMsg->dl_tti_request_body.nPDUs , ppWritePackedMsg, end) && + pusharray8(pNfapiMsg->dl_tti_request_body.nUe ,256,pNfapiMsg->dl_tti_request_body.nGroup, ppWritePackedMsg, end) //pusharray8(pNfapiMsg->PduIdx[0] ,256,256, ppWritePackedMsg, end) )) return 0; int arr[12]; - for(int i=0;i<pNfapiMsg->nGroup;i++) + for(int i=0;i<pNfapiMsg->dl_tti_request_body.nGroup;i++) { - for(int j=0;j<pNfapiMsg->nUe[i];j++) + for(int j=0;j<pNfapiMsg->dl_tti_request_body.nUe[i];j++) { - arr[j] = pNfapiMsg->PduIdx[i][j]; + arr[j] = pNfapiMsg->dl_tti_request_body.PduIdx[i][j]; } - if(!(pusharray8(arr,12,pNfapiMsg->nUe[i],ppWritePackedMsg, end))) + if(!(pusharray8(arr,12,pNfapiMsg->dl_tti_request_body.nUe[i],ppWritePackedMsg, end))) return 0; } - for(int i=0;i<pNfapiMsg->nPDUs;i++) + for(int i=0;i<pNfapiMsg->dl_tti_request_body.nPDUs;i++) { - if(!pack_dl_tti_request_body_value(&pNfapiMsg->dl_tti_pdu_list[i],ppWritePackedMsg,end)) + if(!pack_dl_tti_request_body_value(&pNfapiMsg->dl_tti_request_body.dl_tti_pdu_list[i],ppWritePackedMsg,end)) return 0; } @@ -4555,9 +4555,9 @@ static uint8_t unpack_dl_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, vo if (!(pull16(ppReadPackedMsg,&pNfapiMsg->SFN, end) && pull16(ppReadPackedMsg, &pNfapiMsg->Slot, end) && - pull8(ppReadPackedMsg, &pNfapiMsg->nGroup, end) && - pull8(ppReadPackedMsg, &pNfapiMsg->nPDUs, end) && - pullarray8(ppReadPackedMsg,&pNfapiMsg->nUe ,256,pNfapiMsg->nGroup, end) + pull8(ppReadPackedMsg, &pNfapiMsg->dl_tti_request_body.nGroup, end) && + pull8(ppReadPackedMsg, &pNfapiMsg->dl_tti_request_body.nPDUs, end) && + pullarray8(ppReadPackedMsg,&pNfapiMsg->dl_tti_request_body.nUe ,256,pNfapiMsg->dl_tti_request_body.nGroup, end) //pusharray8(pNfapiMsg->PduIdx[0] ,256,256, ppWritePackedMsg, end) )) return 0; @@ -4566,19 +4566,19 @@ static uint8_t unpack_dl_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, vo // } int arr[12]; - for(int i=0;i<pNfapiMsg->nGroup;i++) + for(int i=0;i<pNfapiMsg->dl_tti_request_body.nGroup;i++) { - for(int j=0;j<pNfapiMsg->nUe[i];j++) + for(int j=0;j<pNfapiMsg->dl_tti_request_body.nUe[i];j++) { - arr[j] = pNfapiMsg->PduIdx[i][j]; + arr[j] = pNfapiMsg->dl_tti_request_body.PduIdx[i][j]; } - if(!(pullarray8(ppReadPackedMsg,arr,12,pNfapiMsg->nUe[i], end))) + if(!(pullarray8(ppReadPackedMsg,arr,12,pNfapiMsg->dl_tti_request_body.nUe[i], end))) return 0; } - for(int i=0;i<pNfapiMsg->nPDUs;i++) + for(int i=0;i<pNfapiMsg->dl_tti_request_body.nPDUs;i++) { - if(!unpack_dl_tti_request_body_value(ppReadPackedMsg, end, &pNfapiMsg->dl_tti_pdu_list[i])) + if(!unpack_dl_tti_request_body_value(ppReadPackedMsg, end, &pNfapiMsg->dl_tti_request_body.dl_tti_pdu_list[i])) return 0; } diff --git a/nfapi/open-nFAPI/pnf/src/pnf_p7.c b/nfapi/open-nFAPI/pnf/src/pnf_p7.c index f37c304408a..5624b52bb8e 100644 --- a/nfapi/open-nFAPI/pnf/src/pnf_p7.c +++ b/nfapi/open-nFAPI/pnf/src/pnf_p7.c @@ -1609,10 +1609,13 @@ uint8_t is_nr_p7_request_in_window(uint16_t sfn,uint16_t slot, const char* name, in_window = 1; NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is in window %d\n", current_sfn_slot_dec, name, recv_sfn_slot_dec); } + else - { + { + NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is out of window %d (delta:%d) [max:%d]\n", current_sfn_slot_dec, name, recv_sfn_slot_dec, (current_sfn_slot_dec - recv_sfn_slot_dec), timing_window); - } + + }//Need to add more cases return in_window; @@ -1677,9 +1680,6 @@ uint8_t is_p7_request_in_window(uint16_t sfnsf, const char* name, pnf_p7_t* phy) void pnf_handle_dl_tti_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7) { //NFAPI_TRACE(NFAPI_TRACE_INFO, "DL_CONFIG.req Received\n"); -struct timespec curr; - clock_gettime(CLOCK_MONOTONIC,&curr); - printf("\npnf_handle_dl_tti_request %d.%d\n",curr.tv_sec,curr.tv_nsec); nfapi_nr_dl_tti_request_t* req = allocate_nfapi_dl_tti_request(pnf_p7); if(req == NULL) diff --git a/openair1/PHY/CODING/crc_byte.c b/openair1/PHY/CODING/crc_byte.c index 8a44e314593..287cbcd1f48 100644 --- a/openair1/PHY/CODING/crc_byte.c +++ b/openair1/PHY/CODING/crc_byte.c @@ -260,11 +260,7 @@ crc6 (unsigned char * inptr, int bitlen) } if (resbit > 0) -<<<<<<< HEAD - crc = (crc << resbit) ^ (crc8Table[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))] << 24); -======= crc = (crc << resbit) ^ (crc6Table[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))] << 24); ->>>>>>> fork_develop_new return crc; } diff --git a/openair1/PHY/CODING/nr_rate_matching.c b/openair1/PHY/CODING/nr_rate_matching.c index c3c33bac717..efa5abdc900 100644 --- a/openair1/PHY/CODING/nr_rate_matching.c +++ b/openair1/PHY/CODING/nr_rate_matching.c @@ -425,11 +425,7 @@ int nr_rate_matching_ldpc(uint8_t Ilbrm, } } else { -<<<<<<< HEAD - if (E + F <= Ncb-ind) { //E+F doesn't contain all coded bits -======= if (E <= Ncb-ind) { //E+F doesn't contain all coded bits ->>>>>>> fork_develop_new memcpy((void*)(e),(void*)(w+ind),E); k=E; } diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 10894cd1250..292b8b5cc79 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -463,27 +463,19 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) { uint64_t dl_bw_khz = (12*gNB_config->carrier_config.dl_grid_size[gNB_config->ssb_config.scs_common.value].value)*(15<<gNB_config->ssb_config.scs_common.value); fp->dl_CarrierFreq = ((dl_bw_khz>>1) + gNB_config->carrier_config.dl_frequency.value)*1000 ; -<<<<<<< HEAD - - int32_t dlul_offset = 0; - lte_frame_type_t frame_type = 0; // FDD -======= ->>>>>>> fork_develop_new uint64_t ul_bw_khz = (12*gNB_config->carrier_config.ul_grid_size[gNB_config->ssb_config.scs_common.value].value)*(15<<gNB_config->ssb_config.scs_common.value); fp->ul_CarrierFreq = ((ul_bw_khz>>1) + gNB_config->carrier_config.uplink_frequency.value)*1000 ; -<<<<<<< HEAD - //printf("\n%d\t%d\t%d\n", fp->ul_CarrierFreq, fp->dl_CarrierFreq, dlul_offset ); - AssertFatal(fp->ul_CarrierFreq==(fp->dl_CarrierFreq+dlul_offset), "Disagreement in uplink frequency for band %d\n", fp->nr_band); -======= - fp->nr_band = *RC.nrmac[Mod_id]->common_channels[0].ServingCellConfigCommon->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]; + //fp->nr_band = *RC.nrmac[Mod_id]->common_channels[0].ServingCellConfigCommon->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]; + lte_frame_type_t frame_type = 0; // FDD + + get_band(fp->dl_CarrierFreq,&fp->nr_band,&dlul_offset,&frame_type); //RC.nrmac[Mod_id] cannot be accessed in NFAPI get_delta_duplex(fp->nr_band, gNB_config->ssb_config.scs_common.value, &dlul_offset); dlul_offset *= 1000; AssertFatal(fp->ul_CarrierFreq == (fp->dl_CarrierFreq + dlul_offset), "Disagreement in uplink frequency for band %d: ul_CarrierFreq = %lu Hz vs expected %lu Hz\n", fp->nr_band, fp->ul_CarrierFreq, fp->dl_CarrierFreq + dlul_offset); ->>>>>>> fork_develop_new LOG_I(PHY, "DL frequency %lu Hz, UL frequency %lu Hz: band %d, uldl offset %d Hz\n", fp->dl_CarrierFreq, fp->ul_CarrierFreq, fp->nr_band, dlul_offset); @@ -505,19 +497,12 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) { fd_occasion = 0; nfapi_nr_prach_config_t *prach_config = &gNB_config->prach_config; short_sequence = prach_config->prach_sequence_length.value; -<<<<<<< HEAD -======= // for(fd_occasion = 0; fd_occasion <= prach_config->num_prach_fd_occasions.value ; fd_occasion) { // TODO Need to handle for msg1-fdm > 1 ->>>>>>> fork_develop_new num_sequences = prach_config->num_prach_fd_occasions_list[fd_occasion].num_root_sequences.value; rootSequenceIndex = prach_config->num_prach_fd_occasions_list[fd_occasion].prach_root_sequence_index.value; compute_nr_prach_seq(short_sequence, num_sequences, rootSequenceIndex, RC.gNB[Mod_id]->X_u); -<<<<<<< HEAD - -======= // } ->>>>>>> fork_develop_new RC.gNB[Mod_id]->configured = 1; init_symbol_rotation(fp,fp->dl_CarrierFreq); @@ -525,6 +510,7 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) { LOG_I(PHY,"gNB %d configured\n",Mod_id); } + void init_nr_transport(PHY_VARS_gNB *gNB) { int i; int j; diff --git a/openair1/PHY/INIT/nr_init_ru.c b/openair1/PHY/INIT/nr_init_ru.c index ac620efc0fe..648b820f078 100644 --- a/openair1/PHY/INIT/nr_init_ru.c +++ b/openair1/PHY/INIT/nr_init_ru.c @@ -107,14 +107,6 @@ int nr_phy_init_RU(RU_t *ru) { /* number of elements of an array X is computed as sizeof(X) / sizeof(X[0]) */ // AssertFatal(ru->nb_rx <= sizeof(ru->prach_rxsigF) / sizeof(ru->prach_rxsigF[0]), // "nb_antennas_rx too large"); -<<<<<<< HEAD - ru->prach_rxsigF = (int16_t**)malloc(ru->nb_rx * sizeof(int16_t*)); - - for (i=0; i<ru->nb_rx; i++) { - // largest size for PRACH FFT is 4x98304 (16*24576) - ru->prach_rxsigF[i] = (int16_t*)malloc16_clear( 4*98304*2*sizeof(int16_t) ); - LOG_D(PHY,"[INIT] prach_vars->rxsigF[%d] = %p\n",i,ru->prach_rxsigF[i]); -======= for (j=0;j<NUMBER_OF_NR_RU_PRACH_OCCASIONS_MAX;j++) { ru->prach_rxsigF[j] = (int16_t**)malloc(ru->nb_rx * sizeof(int16_t*)); @@ -123,7 +115,6 @@ int nr_phy_init_RU(RU_t *ru) { ru->prach_rxsigF[j][i] = (int16_t*)malloc16_clear( 4*98304*2*sizeof(int16_t) ); LOG_D(PHY,"[INIT] prach_vars->rxsigF[%d] = %p\n",i,ru->prach_rxsigF[j][i]); } ->>>>>>> fork_develop_new } AssertFatal(RC.nb_nr_L1_inst <= NUMBER_OF_eNB_MAX,"gNB instances %d > %d\n", diff --git a/openair1/PHY/MODULATION/nr_modulation.c b/openair1/PHY/MODULATION/nr_modulation.c index cbb696b8aea..0a7088ba398 100644 --- a/openair1/PHY/MODULATION/nr_modulation.c +++ b/openair1/PHY/MODULATION/nr_modulation.c @@ -506,17 +506,10 @@ void init_symbol_rotation(NR_DL_FRAME_PARMS *fp,uint64_t CarrierFreq) { const int nsymb = fp->symbols_per_slot * fp->slots_per_frame/10; const double Tc=(1/480e3/4096); -<<<<<<< HEAD - const double Nu=2048*64*.5; - const double f0= (double)CarrierFreq; - const double Ncp0=16*64 + (144*64*.5); - const double Ncp1=(144*64*.5); -======= const double Nu=2048*64*(1/(float)(1<<fp->numerology_index)); const double f0= (double)CarrierFreq; const double Ncp0=16*64 + (144*64*(1/(float)(1<<fp->numerology_index))); const double Ncp1=(144*64*(1/(float)(1<<fp->numerology_index))); ->>>>>>> fork_develop_new double tl=0,poff,exp_re,exp_im; double Ncp,Ncpm1=Ncp0; diff --git a/openair1/PHY/MODULATION/nr_modulation.h b/openair1/PHY/MODULATION/nr_modulation.h index aedd3945dee..3d2be905ac4 100644 --- a/openair1/PHY/MODULATION/nr_modulation.h +++ b/openair1/PHY/MODULATION/nr_modulation.h @@ -112,13 +112,10 @@ void apply_nr_rotation(NR_DL_FRAME_PARMS *fp, void init_symbol_rotation(NR_DL_FRAME_PARMS *fp,uint64_t CarrierFreq); -<<<<<<< HEAD -======= void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms, int32_t *rxdataF, int slot, int first_symbol, int nsymb, int length); ->>>>>>> fork_develop_new #endif diff --git a/openair1/PHY/MODULATION/slot_fep_nr.c b/openair1/PHY/MODULATION/slot_fep_nr.c index 01e4c91f5c3..aa04a908f8c 100644 --- a/openair1/PHY/MODULATION/slot_fep_nr.c +++ b/openair1/PHY/MODULATION/slot_fep_nr.c @@ -417,7 +417,7 @@ int nr_slot_fep_ul(NR_DL_FRAME_PARMS *frame_parms, int sample_offset, int no_prefix) { - int32_t slot_offset, rxdata_offset; + int32_t slot_offset, rxdata_offset; unsigned int nb_prefix_samples = (no_prefix ? 0 : frame_parms->nb_prefix_samples); unsigned int nb_prefix_samples0 = (no_prefix ? 0 : frame_parms->nb_prefix_samples0); @@ -479,8 +479,6 @@ int nr_slot_fep_ul(NR_DL_FRAME_PARMS *frame_parms, memcpy1((void *)&tmp_dft_in[sample_offset-rxdata_offset], (void *) &rxdata[0], (frame_parms->ofdm_symbol_size-sample_offset+rxdata_offset)*sizeof(int)); -<<<<<<< HEAD -======= dft(dftsize,(int16_t *)&tmp_dft_in, (int16_t *)&rxdataF[symbol * frame_parms->ofdm_symbol_size], 1); @@ -497,27 +495,7 @@ int nr_slot_fep_ul(NR_DL_FRAME_PARMS *frame_parms, // clear DC carrier from OFDM symbols rxdataF[symbol * frame_parms->ofdm_symbol_size] = 0; ->>>>>>> fork_develop_new - dft(dftsize,(int16_t *)&tmp_dft_in, - (int16_t *)&rxdataF[symbol * frame_parms->ofdm_symbol_size], 1); - } - else - dft(dftsize,(int16_t *)&rxdata[rxdata_offset-sample_offset], - (int16_t *)&rxdataF[symbol * frame_parms->ofdm_symbol_size], 1); - - // clear DC carrier from OFDM symbols - rxdataF[symbol * frame_parms->ofdm_symbol_size] = 0; - - int symb_offset = (Ns%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot; - uint32_t rot2 = ((uint32_t*)frame_parms->symbol_rotation)[symbol+symb_offset]; - ((int16_t*)&rot2)[1]=-((int16_t*)&rot2)[1]; - LOG_D(PHY,"slot %d, symb_offset %d rotating by %d.%d\n",Ns,symb_offset,((int16_t*)&rot2)[0],((int16_t*)&rot2)[1]); - rotate_cpx_vector((int16_t *)&rxdataF[frame_parms->ofdm_symbol_size*symbol], - (int16_t*)&rot2, - (int16_t *)&rxdataF[frame_parms->ofdm_symbol_size*symbol], - frame_parms->ofdm_symbol_size, - 15); return(0); } diff --git a/openair1/PHY/NR_REFSIG/scrambling_luts.c b/openair1/PHY/NR_REFSIG/scrambling_luts.c index 19ecd9553a2..2a37a125390 100644 --- a/openair1/PHY/NR_REFSIG/scrambling_luts.c +++ b/openair1/PHY/NR_REFSIG/scrambling_luts.c @@ -45,19 +45,13 @@ void init_byte2m64(void) { byte2m64_im[s] = _mm_insert_pi16(byte2m64_im[s],(1-2*((s>>5)&1)),2); byte2m64_re[s] = _mm_insert_pi16(byte2m64_re[s],(1-2*((s>>6)&1)),3); byte2m64_im[s] = _mm_insert_pi16(byte2m64_im[s],(1-2*((s>>7)&1)),3); -<<<<<<< HEAD - /* - printf("init_scrambling_luts: s %x (%d) ((%d,%d),(%d,%d),(%d,%d),(%d,%d))\n", -======= LOG_T(PHY,"init_scrambling_luts: s %x (%d) ((%d,%d),(%d,%d),(%d,%d),(%d,%d))\n", ->>>>>>> fork_develop_new ((uint16_t*)&s)[0], (1-2*(s&1)), ((int16_t*)&byte2m64_re[s])[0],((int16_t*)&byte2m64_im[s])[0], ((int16_t*)&byte2m64_re[s])[1],((int16_t*)&byte2m64_im[s])[1], ((int16_t*)&byte2m64_re[s])[2],((int16_t*)&byte2m64_im[s])[2], - ((int16_t*)&byte2m64_re[s])[3],((int16_t*)&byte2m64_im[s])[3]); - */ + ((int16_t*)&byte2m64_re[s])[3],((int16_t*)&byte2m64_im[s])[3]); } } diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.c b/openair1/PHY/NR_TRANSPORT/nr_dci.c index 931cb2eeef5..70d4e3041ff 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.c @@ -71,45 +71,16 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, int16_t amp, NR_DL_FRAME_PARMS frame_parms) { -<<<<<<< HEAD - -uint8_t nr_generate_dci_top(PHY_VARS_gNB *gNB, - nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu, - nfapi_nr_dl_tti_pdcch_pdu *ul_dci_pdu, - uint32_t **gold_pdcch_dmrs, - int32_t *txdataF, - int16_t amp, - NR_DL_FRAME_PARMS frame_parms) { - -======= ->>>>>>> fork_develop_new int16_t mod_dmrs[NR_MAX_CSET_DURATION][NR_MAX_PDCCH_DMRS_LENGTH>>1] __attribute__((aligned(16))); // 3 for the max coreset duration uint16_t cset_start_sc; uint8_t cset_start_symb, cset_nsymb; int k,l,k_prime,dci_idx, dmrs_idx; -<<<<<<< HEAD - //First iteration: single DCI - - nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15=NULL; - -======= ->>>>>>> fork_develop_new // find coreset descriptor int rb_offset; int n_rb; -<<<<<<< HEAD - AssertFatal(pdcch_pdu!=NULL || ul_dci_pdu!=NULL,"At least one pointer has to be !NULL\n"); - AssertFatal(pdcch_pdu==NULL || ul_dci_pdu==NULL,"Can't handle both DL and UL DCI in same slot\n"); - - - if (pdcch_pdu) pdcch_pdu_rel15 = &pdcch_pdu->pdcch_pdu_rel15; - else if (ul_dci_pdu) pdcch_pdu_rel15 = &ul_dci_pdu->pdcch_pdu_rel15; - -======= ->>>>>>> fork_develop_new nr_fill_cce_list(gNB,0,pdcch_pdu_rel15); get_coreset_rballoc(pdcch_pdu_rel15->FreqDomainResource,&n_rb,&rb_offset); diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.h b/openair1/PHY/NR_TRANSPORT/nr_dci.h index 8dc1f58d9a4..1b57acc6f40 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.h +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.h @@ -29,11 +29,7 @@ uint16_t nr_get_dci_size(nfapi_nr_dci_format_e format, nfapi_nr_rnti_type_e rnti_type, uint16_t N_RB); -<<<<<<< HEAD -uint8_t nr_generate_dci_top(PHY_VARS_gNB *gNB, -======= void nr_generate_dci_top(PHY_VARS_gNB *gNB, ->>>>>>> fork_develop_new nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu, nfapi_nr_dl_tti_pdcch_pdu *ul_pdcch_pdu, uint32_t **gold_pdcch_dmrs, diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c b/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c index 2c2f4829233..f6e5b4db207 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c @@ -203,12 +203,6 @@ void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint8_t m, nfapi_nr_dl_tti_pdcch_pdu_r return ret; }*/ int16_t find_nr_pdcch(int frame,int slot, PHY_VARS_gNB *gNB,find_type_t type) { -<<<<<<< HEAD -// if(slot==2) -// LOG_I(PHY,"\nFRAME %d SLOT %d gNB pdcch pdu frame %d,slot %d",frame,slot,gNB->pdcch_pdu[0].frame,gNB->pdcch_pdu[0].slot); -======= - ->>>>>>> fork_develop_new uint16_t i; int16_t first_free_index=-1; @@ -236,27 +230,17 @@ void nr_fill_dci(PHY_VARS_gNB *gNB, { gNB->pdcch_pdu[i].frame=-1; } - int pdcch_id = find_nr_pdcch(frame,slot,gNB,SEARCH_EXIST_OR_FREE); - AssertFatal(pdcch_id>=0 && pdcch_id<NUMBER_OF_NR_PDCCH_MAX,"Cannot find space for PDCCH, exiting\n"); - memcpy((void*)&gNB->pdcch_pdu[pdcch_id].pdcch_pdu,(void*)pdcch_pdu,sizeof(*pdcch_pdu)); - gNB->pdcch_pdu[pdcch_id].frame = frame+2;//Hardcoded as PNF has offset of 2 frames - gNB->pdcch_pdu[pdcch_id].slot = slot; - + int pdcch_id = find_nr_pdcch(frame,slot,gNB,SEARCH_EXIST_OR_FREE); AssertFatal(pdcch_id>=0 && pdcch_id<NUMBER_OF_NR_PDCCH_MAX,"Cannot find space for PDCCH, exiting\n"); memcpy((void*)&gNB->pdcch_pdu[pdcch_id].pdcch_pdu,(void*)pdcch_pdu,sizeof(*pdcch_pdu)); gNB->pdcch_pdu[pdcch_id].frame = frame; gNB->pdcch_pdu[pdcch_id].slot = slot; -<<<<<<< HEAD - //uint64_t *dci_pdu = (uint64_t*)pdcch_pdu_rel15->dci_pdu.Payload[i]; - -======= for (int i=0;i<pdcch_pdu_rel15->numDlDci;i++) { //uint64_t *dci_pdu = (uint64_t*)pdcch_pdu_rel15->dci_pdu.Payload[i]; ->>>>>>> fork_develop_new int dlsch_id = find_nr_dlsch(pdcch_pdu_rel15->dci_pdu.RNTI[i],gNB,SEARCH_EXIST_OR_FREE); if( (dlsch_id<0) || (dlsch_id>=NUMBER_OF_NR_DLSCH_MAX) ){ LOG_E(PHY,"illegal dlsch_id found!!! rnti %04x dlsch_id %d\n",(unsigned int)pdcch_pdu_rel15->dci_pdu.RNTI[i],dlsch_id); diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index 476d2421bba..4461edb33ba 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -112,30 +112,6 @@ void nr_pdsch_codeword_scrambling_optim(uint8_t *in, uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB, int frame, int slot) { -<<<<<<< HEAD - - NR_gNB_DLSCH_t *dlsch; - uint32_t ***pdsch_dmrs = gNB->nr_gold_pdsch_dmrs[slot]; - int32_t** txdataF = gNB->common_vars.txdataF; - int16_t amp = AMP; - NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms; - int xOverhead = 0; - time_stats_t *dlsch_encoding_stats=&gNB->dlsch_encoding_stats; - time_stats_t *dlsch_scrambling_stats=&gNB->dlsch_scrambling_stats; - time_stats_t *dlsch_modulation_stats=&gNB->dlsch_modulation_stats; - time_stats_t *tinput=&gNB->tinput; - time_stats_t *tprep=&gNB->tprep; - time_stats_t *tparity=&gNB->tparity; - time_stats_t *toutput=&gNB->toutput; - time_stats_t *dlsch_rate_matching_stats=&gNB->dlsch_rate_matching_stats; - time_stats_t *dlsch_interleaving_stats=&gNB->dlsch_interleaving_stats; - time_stats_t *dlsch_segmentation_stats=&gNB->dlsch_segmentation_stats; - NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; - for (int dlsch_id=0;dlsch_id<NUMBER_OF_NR_DLSCH_MAX;dlsch_id++) { - dlsch = gNB->dlsch[dlsch_id][0]; - if (dlsch->slot_tx[slot] == 0) - continue; -======= NR_gNB_DLSCH_t *dlsch; uint32_t ***pdsch_dmrs = gNB->nr_gold_pdsch_dmrs[slot]; @@ -157,7 +133,6 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB, for (int dlsch_id=0;dlsch_id<NUMBER_OF_NR_DLSCH_MAX;dlsch_id++) { dlsch = gNB->dlsch[dlsch_id][0]; if (dlsch->slot_tx[slot] == 0) continue; ->>>>>>> fork_develop_new int harq_pid = dlsch->harq_ids[frame%2][slot]; NR_DL_gNB_HARQ_t *harq = dlsch->harq_processes[harq_pid]; @@ -259,30 +234,6 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB, rel15->nrOfLayers, nb_re, tx_layers); -<<<<<<< HEAD -#ifdef DEBUG_DLSCH - printf("Layer mapping (%d layers):\n", rel15->nrOfLayers); - for (int l=0; l<rel15->nrOfLayers; l++) - for (int i=0; i<(nb_re/rel15->nrOfLayers)>>3; i++) { - printf("layer %d, Re %d..%d : ",l,i<<3,(i<<3)+7); - for (int j=0; j<8; j++) { - printf("l%d %d\t", tx_layers[l][((i<<3)+j)<<1], tx_layers[l][(((i<<3)+j)<<1)+1]); - } - printf("\n"); - } -#endif - - /// Antenna port mapping - //to be moved to init phase potentially, for now tx_layers 1-8 are mapped on antenna ports 1000-1007 - - /// DMRS QPSK modulation - - - l0 = get_l0(rel15->dlDmrsSymbPos); - nr_modulation(pdsch_dmrs[l0][0], n_dmrs, DMRS_MOD_ORDER, mod_dmrs); // currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated - -#ifdef DEBUG_DLSCH -======= #ifdef DEBUG_DLSCH printf("Layer mapping (%d layers):\n", rel15->nrOfLayers); for (int l=0; l<rel15->nrOfLayers; l++) @@ -305,7 +256,6 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB, nr_modulation(pdsch_dmrs[l0][0], n_dmrs, DMRS_MOD_ORDER, mod_dmrs); // currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated #ifdef DEBUG_DLSCH ->>>>>>> fork_develop_new printf("DMRS modulation (single symbol %d, %d symbols, type %d):\n", l0, n_dmrs>>1, dmrs_Type); for (int i=0; i<n_dmrs>>4; i++) { for (int j=0; j<8; j++) { @@ -391,11 +341,7 @@ void dump_pdsch_stats(PHY_VARS_gNB *gNB) { for (int i=0;i<NUMBER_OF_NR_SCH_STATS_MAX;i++) if (gNB->dlsch_stats[i].rnti > 0) -<<<<<<< HEAD - LOG_D(PHY,"DLSCH RNTI %x: round_trials %d(%1.1e):%d(%1.1e):%d(%1.1e):%d, current_Qm %d, current_RI %d, total_bytes TX %d\n", -======= LOG_I(PHY,"DLSCH RNTI %x: round_trials %d(%1.1e):%d(%1.1e):%d(%1.1e):%d, current_Qm %d, current_RI %d, total_bytes TX %d\n", ->>>>>>> fork_develop_new gNB->dlsch_stats[i].rnti, gNB->dlsch_stats[i].round_trials[0], (double)gNB->dlsch_stats[i].round_trials[1]/gNB->dlsch_stats[i].round_trials[0], diff --git a/openair1/PHY/NR_TRANSPORT/nr_prach.c b/openair1/PHY/NR_TRANSPORT/nr_prach.c index 95b999b7d15..ba0705cde7d 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_prach.c +++ b/openair1/PHY/NR_TRANSPORT/nr_prach.c @@ -37,136 +37,6 @@ extern uint16_t prach_root_sequence_map_0_3[838]; extern uint16_t prach_root_sequence_map_abc[138]; extern uint16_t nr_du[838]; -<<<<<<< HEAD -extern const char *prachfmt[9]; - -void init_prach_list(PHY_VARS_gNB *gNB) { - - AssertFatal(gNB!=NULL,"gNB is null\n"); - for (int i=0; i<NUMBER_OF_NR_PRACH_MAX; i++) gNB->prach_vars.list[i].frame=-1; -} - -int16_t find_nr_prach(PHY_VARS_gNB *gNB,int frame,int slot, int numRA, find_type_t type) { - - uint16_t i; - int16_t first_free_index=-1; - - AssertFatal(gNB!=NULL,"gNB is null\n"); - for (i=0; i<NUMBER_OF_NR_PRACH_MAX; i++) { - LOG_D(PHY,"searching for PRACH in %d.%d with numRA %d: prach_index %d=> %d.%d numRA %d\n", frame,slot,numRA,i, - gNB->prach_vars.list[i].frame,gNB->prach_vars.list[i].slot,gNB->prach_vars.list[i].pdu.num_ra); - if ((gNB->prach_vars.list[i].frame == frame) && - (gNB->prach_vars.list[i].slot == slot) && - (gNB->prach_vars.list[i].pdu.num_ra == numRA)) return i; - else if ((gNB->prach_vars.list[i].frame == -1) && (first_free_index==-1)) first_free_index=i; - } - if (type == SEARCH_EXIST) return -1; - - return first_free_index; -} - -void nr_fill_prach(PHY_VARS_gNB *gNB, - int SFN, - int Slot, - nfapi_nr_prach_pdu_t *prach_pdu) { - - int prach_id = find_nr_prach(gNB,SFN,Slot,prach_pdu->num_ra,SEARCH_EXIST_OR_FREE); - AssertFatal( (prach_id>=0) && (prach_id<NUMBER_OF_NR_PRACH_MAX), - "illegal or no prach_id found!!! numRA %d prach_id %d\n",prach_pdu->num_ra,prach_id); - - gNB->prach_vars.list[prach_id].frame=SFN; - gNB->prach_vars.list[prach_id].slot=Slot; - memcpy((void*)&gNB->prach_vars.list[prach_id].pdu,(void*)prach_pdu,sizeof(*prach_pdu)); - -} - -void init_prach_ru_list(RU_t *ru) { - - AssertFatal(ru!=NULL,"ruis null\n"); - for (int i=0; i<NUMBER_OF_NR_RU_PRACH_MAX; i++) ru->prach_list[i].frame=-1; - pthread_mutex_init(&ru->prach_list_mutex,NULL); -} - -int16_t find_nr_prach_ru(RU_t *ru,int frame,int slot, find_type_t type) { - - uint16_t i; - int16_t first_free_index=-1; - - AssertFatal(ru!=NULL,"ru is null\n"); - pthread_mutex_lock(&ru->prach_list_mutex); - for (i=0; i<NUMBER_OF_NR_RU_PRACH_MAX; i++) { - LOG_D(PHY,"searching for PRACH in %d.%d : prach_index %d=> %d.%d\n", frame,slot,i, - ru->prach_list[i].frame,ru->prach_list[i].slot); - if ((ru->prach_list[i].frame == frame) && - (ru->prach_list[i].slot == slot)) { - pthread_mutex_unlock(&ru->prach_list_mutex); - return i; - } - else if ((ru->prach_list[i].frame == -1) && (first_free_index==-1)) first_free_index=i; - } - pthread_mutex_unlock(&ru->prach_list_mutex); - if (type == SEARCH_EXIST) return -1; - - return first_free_index; -} - -void nr_fill_prach_ru(RU_t *ru, - int SFN, - int Slot, - nfapi_nr_prach_pdu_t *prach_pdu) { - - int prach_id = find_nr_prach_ru(ru,SFN,Slot,SEARCH_EXIST_OR_FREE); - AssertFatal( (prach_id>=0) && (prach_id<NUMBER_OF_NR_PRACH_MAX), - "illegal or no prach_id found!!! prach_id %d\n",prach_id); - - pthread_mutex_lock(&ru->prach_list_mutex); - ru->prach_list[prach_id].frame = SFN; - ru->prach_list[prach_id].slot = Slot; - ru->prach_list[prach_id].fmt = prach_pdu->prach_format; - ru->prach_list[prach_id].numRA = prach_pdu->num_ra; - ru->prach_list[prach_id].prachStartSymbol = prach_pdu->prach_start_symbol; - pthread_mutex_unlock(&ru->prach_list_mutex); - -} - -void free_nr_ru_prach_entry(RU_t *ru, - int prach_id) { - - pthread_mutex_lock(&ru->prach_list_mutex); - ru->prach_list[prach_id].frame=-1; - pthread_mutex_unlock(&ru->prach_list_mutex); - -} - - -void rx_nr_prach_ru(RU_t *ru, - int prachFormat, - int numRA, - int prachStartSymbol, - int frame, - int slot) { - - AssertFatal(ru!=NULL,"ru is null\n"); - - int16_t **rxsigF=NULL; - NR_DL_FRAME_PARMS *fp=ru->nr_frame_parms; - int slot2=slot; - - int16_t *prach[ru->nb_rx]; - int prach_sequence_length = ru->config.prach_config.prach_sequence_length.value; - - int msg1_frequencystart = ru->config.prach_config.num_prach_fd_occasions_list[numRA].k1.value; - - rxsigF = ru->prach_rxsigF; - - AssertFatal(ru->if_south == LOCAL_RF,"we shouldn't call this if if_south != LOCAL_RF\n"); - - for (int aa=0; aa<ru->nb_rx; aa++){ - if (prach_sequence_length == 0) slot2=(slot/fp->slots_per_subframe)*fp->slots_per_subframe; - prach[aa] = (int16_t*)&ru->common.rxdata[aa][(slot2*fp->get_samples_per_slot(slot,fp))-ru->N_TA_offset]; - } - -======= extern const char *prachfmt[]; void init_prach_list(PHY_VARS_gNB *gNB) { @@ -319,7 +189,6 @@ void rx_nr_prach_ru(RU_t *ru, } ->>>>>>> fork_develop_new int dftlen=0; int mu = fp->numerology_index; int Ncp = 0; @@ -353,24 +222,6 @@ void rx_nr_prach_ru(RU_t *ru, ru->idx,frame,slot,prachfmt[prachFormat],msg1_frequencystart,prachStartSymbol); switch (prachFormat) { -<<<<<<< HEAD - case 0: //A1 - Ncp = 288/(1<<mu); - break; - - case 1: //A2 - Ncp = 576/(1<<mu); - break; - - case 2: //A3 - Ncp = 864/(1<<mu); - break; - - case 3: //B1 - Ncp = 216/(1<<mu); - break; - -======= case 4: //A1 Ncp = 288/(1<<mu); break; @@ -389,7 +240,6 @@ void rx_nr_prach_ru(RU_t *ru, /* // B2 and B3 do not exist in FAPI ->>>>>>> fork_develop_new case 4: //B2 Ncp = 360/(1<<mu); break; @@ -397,18 +247,6 @@ void rx_nr_prach_ru(RU_t *ru, case 5: //B3 Ncp = 504/(1<<mu); break; -<<<<<<< HEAD - - case 6: //B4 - Ncp = 936/(1<<mu); - break; - - case 7: //C0 - Ncp = 1240/(1<<mu); - break; - - case 8: //C2 -======= */ case 8: //B4 Ncp = 936/(1<<mu); @@ -419,7 +257,6 @@ void rx_nr_prach_ru(RU_t *ru, break; case 10: //C2 ->>>>>>> fork_develop_new Ncp = 2048/(1<<mu); break; @@ -498,37 +335,21 @@ void rx_nr_prach_ru(RU_t *ru, else if (mu==1) { dftlen=2048; dft(DFT_2048,prach2,rxsigF[aa],1); -<<<<<<< HEAD - if (prachFormat != 7) { // !=C0 - dft(DFT_2048,prach2+4096,rxsigF[aa]+4096,1); - reps++; - } - if (prachFormat == 1 || prachFormat == 2 || prachFormat == 4 || prachFormat == 5 || prachFormat == 6 || prachFormat == 8) { -======= if (prachFormat != 9/*C0*/) { dft(DFT_2048,prach2+4096,rxsigF[aa]+4096,1); reps++; } if (prachFormat == 5/*A2*/ || prachFormat == 6/*A3*/|| prachFormat == 8/*B4*/ || prachFormat == 10/*C2*/) { ->>>>>>> fork_develop_new dft(DFT_2048,prach2+4096*2,rxsigF[aa]+4096*2,1); dft(DFT_2048,prach2+4096*3,rxsigF[aa]+4096*3,1); reps+=2; } -<<<<<<< HEAD - if (prachFormat == 2 || prachFormat == 5 || prachFormat == 6) { -======= if (prachFormat == 6/*A3*/ || prachFormat == 8/*B4*/) { ->>>>>>> fork_develop_new dft(DFT_2048,prach2+4096*4,rxsigF[aa]+4096*4,1); dft(DFT_2048,prach2+4096*5,rxsigF[aa]+4096*5,1); reps+=2; } -<<<<<<< HEAD - if (prachFormat == 6) { -======= if (prachFormat == 8/*B4*/) { ->>>>>>> fork_develop_new for (int i=6;i<12;i++) dft(DFT_2048,prach2+(4096*i),rxsigF[aa]+(4096*i),1); reps+=6; } @@ -569,38 +390,22 @@ void rx_nr_prach_ru(RU_t *ru, else if (mu==1) { dftlen=1536; dft(DFT_1536,prach2,rxsigF[aa],1); -<<<<<<< HEAD - if (prachFormat != 7) { -======= if (prachFormat != 9/*C0*/) { ->>>>>>> fork_develop_new dft(DFT_1536,prach2+3072,rxsigF[aa]+3072,1); reps++; } -<<<<<<< HEAD - if (prachFormat == 1 || prachFormat == 2 || prachFormat == 4 || prachFormat == 5 || prachFormat == 6 || prachFormat == 8) { -======= if (prachFormat == 5/*A2*/ || prachFormat == 6/*A3*/|| prachFormat == 8/*B4*/ || prachFormat == 10/*C2*/) { ->>>>>>> fork_develop_new dft(DFT_1536,prach2+3072*2,rxsigF[aa]+3072*2,1); dft(DFT_1536,prach2+3072*3,rxsigF[aa]+3072*3,1); reps+=2; } -<<<<<<< HEAD - if (prachFormat == 2 || prachFormat == 5 || prachFormat == 6) { -======= if (prachFormat == 6/*A3*/ || prachFormat == 8/*B4*/) { ->>>>>>> fork_develop_new dft(DFT_1536,prach2+3072*4,rxsigF[aa]+3072*4,1); dft(DFT_1536,prach2+3072*5,rxsigF[aa]+3072*5,1); reps+=2; } -<<<<<<< HEAD - if (prachFormat == 6) { -======= if (prachFormat == 8/*B4*/) { ->>>>>>> fork_develop_new for (int i=6;i<12;i++) dft(DFT_1536,prach2+(3072*i),rxsigF[aa]+(3072*i),1); reps+=6; } @@ -645,38 +450,22 @@ void rx_nr_prach_ru(RU_t *ru, else if (mu==1) { dftlen=4096; dft(DFT_4096,prach2,rxsigF[aa],1); -<<<<<<< HEAD - if (prachFormat != 7) { //!=C0 -======= if (prachFormat != 9/*C0*/) { ->>>>>>> fork_develop_new dft(DFT_4096,prach2+8192,rxsigF[aa]+8192,1); reps++; } -<<<<<<< HEAD - if (prachFormat == 1 || prachFormat == 2 || prachFormat == 4 || prachFormat == 5 || prachFormat == 6 || prachFormat == 8) { -======= if (prachFormat == 5/*A2*/ || prachFormat == 6/*A3*/|| prachFormat == 8/*B4*/ || prachFormat == 10/*C2*/) { ->>>>>>> fork_develop_new dft(DFT_4096,prach2+8192*2,rxsigF[aa]+8192*2,1); dft(DFT_4096,prach2+8192*3,rxsigF[aa]+8192*3,1); reps+=2; } -<<<<<<< HEAD - if (prachFormat == 2 || prachFormat == 5 || prachFormat == 6) { -======= if (prachFormat == 6/*A3*/ || prachFormat == 8/*B4*/) { ->>>>>>> fork_develop_new dft(DFT_4096,prach2+8192*4,rxsigF[aa]+8192*4,1); dft(DFT_4096,prach2+8192*5,rxsigF[aa]+8192*5,1); reps+=2; } -<<<<<<< HEAD - if (prachFormat == 6) { -======= if (prachFormat == 8/*B4*/) { ->>>>>>> fork_develop_new for (int i=6;i<12;i++) dft(DFT_4096,prach2+(8192*i),rxsigF[aa]+(8192*i),1); reps+=6; } @@ -713,38 +502,22 @@ void rx_nr_prach_ru(RU_t *ru, else if (mu==1) { dftlen=3072; dft(DFT_3072,prach2,rxsigF[aa],1); -<<<<<<< HEAD - if (prachFormat != 7) { //!=C0 -======= if (prachFormat != 9/*C0*/) { ->>>>>>> fork_develop_new dft(DFT_3072,prach2+6144,rxsigF[aa]+6144,1); reps++; } -<<<<<<< HEAD - if (prachFormat == 1 || prachFormat == 2 || prachFormat == 4 || prachFormat == 5 || prachFormat == 6 || prachFormat == 8) { -======= if (prachFormat == 5/*A2*/ || prachFormat == 6/*A3*/|| prachFormat == 8/*B4*/ || prachFormat == 10/*C2*/) { ->>>>>>> fork_develop_new dft(DFT_3072,prach2+6144*2,rxsigF[aa]+6144*2,1); dft(DFT_3072,prach2+6144*3,rxsigF[aa]+6144*3,1); reps+=2; } -<<<<<<< HEAD - if (prachFormat == 2 || prachFormat == 5 || prachFormat == 6) { -======= if (prachFormat == 6/*A3*/ || prachFormat == 8/*B4*/) { ->>>>>>> fork_develop_new dft(DFT_3072,prach2+6144*4,rxsigF[aa]+6144*4,1); dft(DFT_3072,prach2+6144*5,rxsigF[aa]+6144*5,1); reps+=2; } -<<<<<<< HEAD - if (prachFormat == 6) { -======= if (prachFormat == 8/*B4*/) { ->>>>>>> fork_develop_new for (int i=6;i<12;i++) dft(DFT_3072,prach2+(6144*i),rxsigF[aa]+(6144*i),1); reps+=6; } @@ -775,10 +548,7 @@ void rx_nr_prach_ru(RU_t *ru, void rx_nr_prach(PHY_VARS_gNB *gNB, nfapi_nr_prach_pdu_t *prach_pdu, -<<<<<<< HEAD -======= int prachOccasion, ->>>>>>> fork_develop_new int frame, int subframe, uint16_t *max_preamble, @@ -827,21 +597,11 @@ void rx_nr_prach(PHY_VARS_gNB *gNB, fp = &gNB->frame_parms; nb_rx = gNB->gNB_config.carrier_config.num_rx_ant.value; -<<<<<<< HEAD - - rootSequenceIndex = cfg->num_prach_fd_occasions_list[0].prach_root_sequence_index.value; - numrootSequenceIndex = cfg->num_prach_fd_occasions_list[0].num_root_sequences.value; - NCS = prach_pdu->num_cs;//cfg->num_prach_fd_occasions_list[0].prach_zero_corr_conf.value; - int prach_sequence_length = cfg->prach_sequence_length.value; - - int msg1_frequencystart = cfg->num_prach_fd_occasions_list[0].k1.value; -======= rootSequenceIndex = cfg->num_prach_fd_occasions_list[prach_pdu->num_ra].prach_root_sequence_index.value; numrootSequenceIndex = cfg->num_prach_fd_occasions_list[prach_pdu->num_ra].num_root_sequences.value; NCS = prach_pdu->num_cs;//cfg->num_prach_fd_occasions_list[0].prach_zero_corr_conf.value; int prach_sequence_length = cfg->prach_sequence_length.value; int msg1_frequencystart = cfg->num_prach_fd_occasions_list[prach_pdu->num_ra].k1.value; ->>>>>>> fork_develop_new // int num_unused_root_sequences = cfg->num_prach_fd_occasions_list[0].num_unused_root_sequences.value; // cfg->num_prach_fd_occasions_list[0].unused_root_sequences_list @@ -850,11 +610,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB, uint8_t prach_fmt = prach_pdu->prach_format; uint16_t N_ZC = (prach_sequence_length==0)?839:139; -<<<<<<< HEAD - LOG_D(PHY,"L1 PRACH RX: rooSequenceIndex %d, numRootSeqeuences %d, NCS %d, N_ZC %d \n", rootSequenceIndex,numrootSequenceIndex,NCS,N_ZC); -======= LOG_D(PHY,"L1 PRACH RX: rooSequenceIndex %d, numRootSeqeuences %d, NCS %d, N_ZC %d, format %d \n",rootSequenceIndex,numrootSequenceIndex,NCS,N_ZC,prach_fmt); ->>>>>>> fork_develop_new prach_ifft = gNB->prach_vars.prach_ifft; prachF = gNB->prach_vars.prachF; diff --git a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h index 325cbb1ec1e..90d69ba5468 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h +++ b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h @@ -157,10 +157,10 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF, NR_gNB_PUSCH *pusch_vars, unsigned char symbol, uint8_t is_dmrs_symbol, - uint8_t is_ptrs_symbol, nfapi_nr_pusch_pdu_t *pusch_pdu, NR_DL_FRAME_PARMS *frame_parms); + void nr_ulsch_scale_channel(int32_t **ul_ch_estimates_ext, NR_DL_FRAME_PARMS *frame_parms, NR_gNB_ULSCH_t **ulsch_gNB, @@ -286,34 +286,6 @@ void nr_fill_prach(PHY_VARS_gNB *gNB, int SFN, int Slot, nfapi_nr_prach_pdu_t *prach_pdu); -<<<<<<< HEAD - -void rx_nr_prach(PHY_VARS_gNB *gNB, - nfapi_nr_prach_pdu_t *prach_pdu, - int frame, - int subframe, - uint16_t *max_preamble, - uint16_t *max_preamble_energy, - uint16_t *max_preamble_delay); - -void rx_nr_prach_ru(RU_t *ru, - int prach_fmt, - int numRA, - int prachStartSymbol, - int frame, - int subframe); - -void nr_fill_prach_ru(RU_t *ru, - int SFN, - int Slot, - nfapi_nr_prach_pdu_t *prach_pdu); - -int16_t find_nr_prach(PHY_VARS_gNB *gNB,int frame,int slot, int numRA, find_type_t type); -int16_t find_nr_prach_ru(RU_t *ru,int frame,int slot, find_type_t type); - -NR_gNB_PUCCH_t *new_gNB_pucch(void); - -======= void rx_nr_prach(PHY_VARS_gNB *gNB, nfapi_nr_prach_pdu_t *prach_pdu, @@ -342,7 +314,6 @@ int16_t find_nr_prach_ru(RU_t *ru,int frame,int slot, find_type_t type); NR_gNB_PUCCH_t *new_gNB_pucch(void); ->>>>>>> fork_develop_new void nr_fill_pucch(PHY_VARS_gNB *gNB, int frame, int slot, @@ -358,8 +329,6 @@ void init_prach_list(PHY_VARS_gNB *gNB); void init_prach_ru_list(RU_t *ru); void free_nr_ru_prach_entry(RU_t *ru, int prach_id); -<<<<<<< HEAD -======= int nr_generate_csi_rs(uint32_t **gold_csi_rs, int32_t **txdataF, int16_t amp, @@ -367,7 +336,6 @@ int nr_generate_csi_rs(uint32_t **gold_csi_rs, nfapi_nr_dl_tti_csi_rs_pdu_rel15_t csi_params); void free_nr_prach_entry(PHY_VARS_gNB *gNB, int prach_id); ->>>>>>> fork_develop_new void nr_decode_pucch1(int32_t **rxdataF, pucch_GroupHopping_t pucch_GroupHopping, @@ -394,13 +362,10 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, nfapi_nr_uci_pucch_pdu_format_0_1_t* uci_pdu, nfapi_nr_pucch_pdu_t* pucch_pdu); -<<<<<<< HEAD -======= void nr_decode_pucch2(PHY_VARS_gNB *gNB, int slot, nfapi_nr_uci_pucch_pdu_format_2_3_4_t* uci_pdu, nfapi_nr_pucch_pdu_t* pucch_pdu); ->>>>>>> fork_develop_new #endif /*__NR_TRANSPORT__H__*/ diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index ba5aae77c7d..a528eb734ce 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -283,9 +283,6 @@ void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch) static uint32_t prnt_crc_cnt = 0; #endif -<<<<<<< HEAD -uint32_t nr_ulsch_decoding(PHY_VARS_gNB *gNB, -======= void nr_processULSegment(void* arg) { ldpcDecode_t *rdata = (ldpcDecode_t*) arg; PHY_VARS_gNB *phy_vars_gNB = rdata->gNB; @@ -457,7 +454,6 @@ void nr_processULSegment(void* arg) { } uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, ->>>>>>> fork_develop_new uint8_t UE_id, short *ulsch_llr, NR_DL_FRAME_PARMS *frame_parms, @@ -480,7 +476,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, #endif - NR_gNB_ULSCH_t *ulsch = gNB->ulsch[UE_id][0]; + NR_gNB_ULSCH_t *ulsch = phy_vars_gNB->ulsch[UE_id][0]; NR_UL_gNB_HARQ_t *harq_process = ulsch->harq_processes[harq_pid]; if (!harq_process) { @@ -512,11 +508,6 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, return 1; } -<<<<<<< HEAD - // harq_process->trials[nfapi_ulsch_pdu_rel15->round]++; - -======= ->>>>>>> fork_develop_new VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_ULSCH_DECODING,1); harq_process->TBS = pusch_pdu->pusch_data.tb_size; harq_process->round = nr_rv_round_map[pusch_pdu->pusch_data.rv_index]; @@ -563,21 +554,12 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, NR_gNB_SCH_STATS_t *stats=NULL; int first_free=-1; for (int i=0;i<NUMBER_OF_NR_SCH_STATS_MAX;i++) { -<<<<<<< HEAD - if (gNB->ulsch_stats[i].rnti == 0 && first_free == -1) { - first_free = i; - stats=&gNB->ulsch_stats[i]; - } - if (gNB->ulsch_stats[i].rnti == ulsch->rnti) { - stats=&gNB->ulsch_stats[i]; -======= if (phy_vars_gNB->ulsch_stats[i].rnti == 0 && first_free == -1) { first_free = i; stats=&phy_vars_gNB->ulsch_stats[i]; } if (phy_vars_gNB->ulsch_stats[i].rnti == ulsch->rnti) { stats=&phy_vars_gNB->ulsch_stats[i]; ->>>>>>> fork_develop_new break; } } @@ -591,19 +573,11 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, stats->current_RI = n_layers; stats->total_bytes_tx += harq_process->TBS; } -<<<<<<< HEAD - // This is a new packet, so compute quantities regarding segmentation - if (A > 3824) - harq_process->B = A+24; - else - harq_process->B = A+16; -======= } if (A > 3824) harq_process->B = A+24; else harq_process->B = A+16; ->>>>>>> fork_develop_new // [hna] Perform nr_segmenation with input and output set to NULL to calculate only (B, C, K, Z, F) nr_segmentation(NULL, @@ -616,15 +590,9 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, p_decParams->BG); #ifdef DEBUG_ULSCH_DECODING -<<<<<<< HEAD - printf("ulsch decoding nr segmentation Z %d\n", harq_process->Z); - if (!frame%100) - printf("K %d C %d Z %d \n", harq_process->K, harq_process->C, harq_process->Z); -======= printf("ulsch decoding nr segmentation Z %d\n", harq_process->Z); if (!frame%100) printf("K %d C %d Z %d \n", harq_process->K, harq_process->C, harq_process->Z); ->>>>>>> fork_develop_new #endif Tbslbrm = nr_compute_tbslbrm(0,nb_rb,n_layers); @@ -656,75 +624,8 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, void (*nr_processULSegment_ptr)(void*) = &nr_processULSegment; for (r=0; r<harq_process->C; r++) { -<<<<<<< HEAD - E = nr_get_E(G, harq_process->C, Qm, n_layers, r); - - - start_meas(&gNB->ulsch_deinterleaving_stats); - - //////////////////////////////////////////////////////////////////////////////////////////// - ///////////////////////////////// nr_deinterleaving_ldpc /////////////////////////////////// - ////////////////////////////////////////////////////////////////////////////////////////// - - //////////////////////////// ulsch_llr =====> harq_process->e ////////////////////////////// - - nr_deinterleaving_ldpc(E, - Qm, - harq_process->e[r], - ulsch_llr+r_offset); - - //for (int i =0; i<16; i++) - // printf("rx output deinterleaving w[%d]= %d r_offset %d\n", i,harq_process->w[r][i], r_offset); - - stop_meas(&gNB->ulsch_deinterleaving_stats); - - - LOG_D(PHY,"HARQ_PID %d Rate Matching Segment %d (coded bits %d,unpunctured/repeated bits %d, TBS %d, mod_order %d, nb_rb %d, Nl %d, rvidx %d, round %d)...\n", - harq_pid,r, G, - Kr*3, - harq_process->TBS, - Qm, - nb_rb, - n_layers, - pusch_pdu->pusch_data.rv_index, - harq_process->round); - ////////////////////////////////////////////////////////////////////////////////////////// - - - ////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////// nr_rate_matching_ldpc_rx //////////////////////////////// - ////////////////////////////////////////////////////////////////////////////////////////// - - ///////////////////////// harq_process->e =====> harq_process->d ///////////////////////// - - start_meas(&gNB->ulsch_rate_unmatching_stats); - - Tbslbrm = nr_compute_tbslbrm(0,nb_rb,n_layers,harq_process->C); - - if (nr_rate_matching_ldpc_rx(Ilbrm, - Tbslbrm, - p_decParams->BG, - p_decParams->Z, - harq_process->d[r], - harq_process->e[r], - harq_process->C, - pusch_pdu->pusch_data.rv_index, - (harq_process->round==0)?1:0, - E, - harq_process->F, - Kr-harq_process->F-2*(p_decParams->Z))==-1) { - - stop_meas(&gNB->ulsch_rate_unmatching_stats); - - LOG_E(PHY,"ulsch_decoding.c: Problem in rate_matching\n"); - return (ulsch->max_ldpc_iterations + 1); - } else { - stop_meas(&gNB->ulsch_rate_unmatching_stats); - } -======= E = nr_get_E(G, harq_process->C, Qm, n_layers, r); ->>>>>>> fork_develop_new union ldpcReqUnion id = {.s={ulsch->rnti,frame,nr_tti_rx,0,0}}; notifiedFIFO_elt_t *req=newNotifiedFIFO_elt(sizeof(ldpcDecode_t), id.p, phy_vars_gNB->respDecode, nr_processULSegment_ptr); @@ -752,211 +653,8 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, phy_vars_gNB->nbDecode++; LOG_D(PHY,"Added a block to decode, in pipe: %d\n",phy_vars_gNB->nbDecode); r_offset += E; -<<<<<<< HEAD - -#ifdef DEBUG_ULSCH_DECODING - if (r==0) { - write_output("decoder_llr.m","decllr",ulsch_llr,G,1,0); - write_output("decoder_in.m","dec",&harq_process->d[0][0],E,1,0); - } - - printf("decoder input(segment %u) :", r); - int i; - for (i=0;i<(3*8*Kr_bytes)+12;i++) - printf("%d : %d\n",i,harq_process->d[r][i]); - printf("\n"); -#endif - - - // printf("Clearing c, %p\n",harq_process->c[r]); - memset(harq_process->c[r],0,Kr_bytes); - - // printf("done\n"); - if (harq_process->C == 1) { - if (A > 3824) - crc_type = CRC24_A; - else - crc_type = CRC16; - - length_dec = harq_process->B; - } - else { - crc_type = CRC24_B; - length_dec = (harq_process->B+24*harq_process->C)/harq_process->C; - } - - if (err_flag == 0) { - - start_meas(&gNB->ulsch_ldpc_decoding_stats); - - //LOG_E(PHY,"AbsSubframe %d.%d Start LDPC segment %d/%d A %d ",frame%1024,nr_tti_rx,r,harq_process->C-1, A); - - - memset(pv,0,2*harq_process->Z*sizeof(int16_t)); - memset((pv+K_bytes_F),127,harq_process->F*sizeof(int16_t)); - - for (i=((2*p_decParams->Z)>>3), j = 0; i < K_bytes_F; i++, j++) { - pv[i]= _mm_loadu_si128((__m128i*)(&harq_process->d[r][8*j])); - } - - AssertFatal(kc!=255,""); - j+=(harq_process->F>>3); - for (i=Kr_bytes; i < ((kc*p_decParams->Z)>>3); i++, j++) { - pv[i]= _mm_loadu_si128((__m128i*)(&harq_process->d[r][8*j])); - } - - for (i=0, j=0; j < ((kc*p_decParams->Z)>>4); i+=2, j++) { - pl[j] = _mm_packs_epi16(pv[i],pv[i+1]); - } - - ////////////////////////////////////////////////////////////////////////////////////////// - - - ////////////////////////////////////////////////////////////////////////////////////////// - ///////////////////////////////////// nrLDPC_decoder ///////////////////////////////////// - ////////////////////////////////////////////////////////////////////////////////////////// - - ////////////////////////////////// pl =====> llrProcBuf ////////////////////////////////// - - no_iteration_ldpc = nrLDPC_decoder(p_decParams, - (int8_t*)&pl[0], - llrProcBuf, - p_nrLDPC_procBuf[r], - p_procTime); - - if (check_crc((uint8_t*)llrProcBuf,length_dec,harq_process->F,crc_type)) { - #ifdef PRINT_CRC_CHECK - //if (prnt_crc_cnt % 10 == 0) - LOG_I(PHY, "Segment %d CRC OK\n",r); - #endif - ret = no_iteration_ldpc; - } else { - #ifdef PRINT_CRC_CHECK - //if (prnt_crc_cnt%10 == 0) - LOG_I(PHY, "CRC NOK\n"); - #endif - ret = ulsch->max_ldpc_iterations + 1; - } - nb_total_decod++; - - if (no_iteration_ldpc > ulsch->max_ldpc_iterations){ - nb_error_decod++; - } - - for (int m=0; m < Kr>>3; m ++) { - harq_process->c[r][m]= (uint8_t) llrProcBuf[m]; - } - -#ifdef DEBUG_ULSCH_DECODING - //printf("output decoder %d %d %d %d %d \n", harq_process->c[r][0], harq_process->c[r][1], harq_process->c[r][2],harq_process->c[r][3], harq_process->c[r][4]); - for (int k=0;k<A>>3;k++) - printf("output decoder [%d] = 0x%02x \n", k, harq_process->c[r][k]); - printf("no_iterations_ldpc %d (ret %u)\n",no_iteration_ldpc,ret); - //write_output("dec_output.m","dec0",harq_process->c[0],Kr_bytes,1,4); -#endif - - stop_meas(&gNB->ulsch_ldpc_decoding_stats); - } - - if ((err_flag == 0) && (ret >= (ulsch->max_ldpc_iterations + 1))) { - // a Code segment is in error so break; - LOG_D(PHY,"AbsSubframe %d.%d CRC failed, segment %d/%d \n",frame%1024,nr_tti_rx,r,harq_process->C-1); - err_flag = 1; - } - ////////////////////////////////////////////////////////////////////////////////////////// - } - - int32_t frame_rx_prev = frame; - int32_t tti_rx_prev = nr_tti_rx - 1; - if (tti_rx_prev < 0) { - frame_rx_prev--; - tti_rx_prev += frame_parms->slots_per_frame; - } - frame_rx_prev = frame_rx_prev%1024; - - if (err_flag == 1) { - -#ifdef gNB_DEBUG_TRACE - LOG_I(PHY,"[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d) Kr %d r %d\n", - gNB->Mod_id, frame, nr_tti_rx, harq_pid,harq_process->status, harq_process->round,harq_process->TBS,Kr,r); -#endif - - // harq_process->harq_ack.ack = 0; - // harq_process->harq_ack.harq_id = harq_pid; - // harq_process->harq_ack.send_harq_status = 1; - // harq_process->errors[harq_process->round]++; - //harq_process->round++; - - if (harq_process->round >= ulsch->Mlimit) { - harq_process->status = SCH_IDLE; - harq_process->round = 0; - harq_process->handled = 0; - ulsch->harq_mask &= ~(1 << harq_pid); - } - - // LOG_D(PHY,"[gNB %d] ULSCH: Setting NACK for nr_tti_rx %d (pid %d, pid status %d, round %d/Max %d, TBS %d)\n", - // gNB->Mod_id,nr_tti_rx,harq_pid,harq_process->status,harq_process->round,ulsch->Mlimit,harq_process->TBS); - - harq_process->handled = 1; - ret = ulsch->max_ldpc_iterations + 1; - - } else { - -#ifdef gNB_DEBUG_TRACE - LOG_I(PHY,"[gNB %d] ULSCH: Setting ACK for nr_tti_rx %d TBS %d\n", - gNB->Mod_id,nr_tti_rx,harq_process->TBS); -#endif - - harq_process->status = SCH_IDLE; - harq_process->round = 0; - // harq_process->handled = 0; - ulsch->harq_mask &= ~(1 << harq_pid); - // harq_process->harq_ack.ack = 1; - // harq_process->harq_ack.harq_id = harq_pid; - // harq_process->harq_ack.send_harq_status = 1; - - // LOG_D(PHY,"[gNB %d] ULSCH: Setting ACK for nr_tti_rx %d (pid %d, round %d, TBS %d)\n",gNB->Mod_id,nr_tti_rx,harq_pid,harq_process->round,harq_process->TBS); - - - // Reassembly of Transport block here - offset = 0; - Kr = harq_process->K; - Kr_bytes = Kr>>3; - - for (r=0; r<harq_process->C; r++) { - - memcpy(harq_process->b+offset, - harq_process->c[r], - Kr_bytes- - (harq_process->F>>3) -((harq_process->C>1)?3:0)); - - offset += (Kr_bytes - (harq_process->F>>3) - ((harq_process->C>1)?3:0)); - -#ifdef DEBUG_ULSCH_DECODING - printf("Segment %u : Kr = %u bytes\n", r, Kr_bytes); - printf("copied %d bytes to b sequence (harq_pid %d)\n", (Kr_bytes - (harq_process->F>>3)-((harq_process->C>1)?3:0)), harq_pid); - printf("b[0] = %x, c[%d] = %x\n", harq_process->b[offset], harq_process->F>>3, harq_process->c[r]); -#endif - - } - if (stats) stats->total_bytes_rx += harq_process->TBS; - } - -#ifdef DEBUG_ULSCH_DECODING - LOG_I(PHY, "Decoder output (payload) at SFN/SF: %d/%d TBS: %d\n", frame, nr_tti_rx,harq_process->TBS); - for (i = 0; i < harq_process->TBS; i++) { - //harq_process_ul_ue->a[i] = (unsigned char) rand(); - //printf("a[%d]=0x%02x\n",i,harq_process_ul_ue->a[i]); - printf("%02x ",harq_process->b[i]); - } -#endif - - ulsch->last_iteration_cnt = ret; - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_ULSCH_DECODING,0); - return(ret); -======= offset += (Kr_bytes - (harq_process->F>>3) - ((harq_process->C>1)?3:0)); ////////////////////////////////////////////////////////////////////////////////////////// } return 1; ->>>>>>> fork_develop_new } diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c index fd9acb6fd2a..de88006a618 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c @@ -226,29 +226,17 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF, NR_gNB_PUSCH *pusch_vars, unsigned char symbol, uint8_t is_dmrs_symbol, - uint8_t is_ptrs_symbol, nfapi_nr_pusch_pdu_t *pusch_pdu, NR_DL_FRAME_PARMS *frame_parms) { unsigned short start_re, re, nb_re_pusch; unsigned char aarx; -<<<<<<< HEAD - uint8_t K_ptrs = 0; - uint32_t rxF_ext_index = 0; - uint32_t ul_ch0_ext_index = 0; - uint32_t ul_ch0_index = 0; - uint32_t ul_ch0_ptrs_ext_index = 0; - uint32_t ul_ch0_ptrs_index = 0; - uint8_t k_prime; - uint16_t n=0, num_ptrs_symbols; -======= uint32_t rxF_ext_index = 0; uint32_t ul_ch0_ext_index = 0; uint32_t ul_ch0_index = 0; uint8_t k_prime; uint16_t n; ->>>>>>> fork_develop_new int16_t *rxF,*rxF_ext; int *ul_ch0,*ul_ch0_ext; uint8_t delta = 0; @@ -259,13 +247,8 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF, printf("--------------------ch_ext_index = %d-----------------------\n", symbol*NR_NB_SC_PER_RB * pusch_pdu->rb_size); #endif -<<<<<<< HEAD - - uint8_t is_dmrs_re=0,is_ptrs_re=0; -======= uint8_t is_dmrs_re; ->>>>>>> fork_develop_new start_re = (frame_parms->first_carrier_offset + (pusch_pdu->rb_start * NR_NB_SC_PER_RB))%frame_parms->ofdm_symbol_size; nb_re_pusch = NR_NB_SC_PER_RB * pusch_pdu->rb_size; #ifdef __AVX2__ @@ -273,11 +256,6 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF, #else int nb_re_pusch2 = nb_re_pusch; #endif -<<<<<<< HEAD - - num_ptrs_symbols = 0; -======= ->>>>>>> fork_develop_new for (aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) { @@ -287,26 +265,10 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF, ul_ch0 = &pusch_vars->ul_ch_estimates[aarx][pusch_vars->dmrs_symbol*frame_parms->ofdm_symbol_size]; // update channel estimates if new dmrs symbol are available ul_ch0_ext = &pusch_vars->ul_ch_estimates_ext[aarx][symbol*nb_re_pusch2]; -<<<<<<< HEAD - - ul_ch0_ptrs = &pusch_vars->ul_ch_ptrs_estimates[aarx][pusch_vars->ptrs_symbol_index*frame_parms->ofdm_symbol_size]; // update channel estimates if new dmrs symbol are available - - ul_ch0_ptrs_ext = &pusch_vars->ul_ch_ptrs_estimates_ext[aarx][symbol*nb_re_pusch]; -======= ->>>>>>> fork_develop_new n = 0; k_prime = 0; -<<<<<<< HEAD - if (is_dmrs_symbol == 0 && is_ptrs_symbol == 0) { - // - //rxF[ ((start_re + re)*2) % (frame_parms->ofdm_symbol_size*2)]); - if (start_re + nb_re_pusch < frame_parms->ofdm_symbol_size) memcpy1((void*)rxF_ext, - (void*)&rxF[start_re*2], - nb_re_pusch*sizeof(int32_t)); - else { -======= if (is_dmrs_symbol == 0) { // //rxF[ ((start_re + re)*2) % (frame_parms->ofdm_symbol_size*2)]); @@ -315,69 +277,11 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF, (void*)&rxF[start_re*2], nb_re_pusch*sizeof(int32_t)); } else { ->>>>>>> fork_develop_new int neg_length = frame_parms->ofdm_symbol_size-start_re; int pos_length = nb_re_pusch-neg_length; memcpy1((void*)rxF_ext,(void*)&rxF[start_re*2],neg_length*sizeof(int32_t)); memcpy1((void*)&rxF_ext[2*neg_length],(void*)rxF,pos_length*sizeof(int32_t)); -<<<<<<< HEAD - } - memcpy1((void*)ul_ch0_ext,(void*)ul_ch0,nb_re_pusch*sizeof(int32_t)); - } - else { - for (re = 0; re < nb_re_pusch; re++) { - - if (is_dmrs_symbol) is_dmrs_re = (re == get_dmrs_freq_idx_ul(n, k_prime, delta, pusch_pdu->dmrs_config_type)); - - if (is_ptrs_symbol) { - K_ptrs = (pusch_pdu->pusch_ptrs.ptrs_freq_density)?4:2; - is_ptrs_re = is_ptrs_subcarrier((start_re + re) % frame_parms->ofdm_symbol_size, - n_rnti, - aarx, - pusch_pdu->dmrs_config_type, - K_ptrs, - pusch_pdu->rb_size, - pusch_pdu->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset, - start_re, - frame_parms->ofdm_symbol_size); - - num_ptrs_symbols+=is_ptrs_re; - - } - -#ifdef DEBUG_RB_EXT - printf("re = %d, kprime %d, n %d, is_ptrs_symbol = %d, symbol = %d\n", re, k_prime,n,is_ptrs_symbol, symbol); -#endif - - if ( is_dmrs_re == 0 && is_ptrs_re == 0) { - - rxF_ext[rxF_ext_index] = (rxF[ ((start_re + re)*2) % (frame_parms->ofdm_symbol_size*2)]); - rxF_ext[rxF_ext_index + 1] = (rxF[(((start_re + re)*2) + 1) % (frame_parms->ofdm_symbol_size*2)]); - ul_ch0_ext[ul_ch0_ext_index] = ul_ch0[ul_ch0_index]; - ul_ch0_ptrs_ext[ul_ch0_ptrs_ext_index] = ul_ch0_ptrs[ul_ch0_ptrs_index]; - -#ifdef DEBUG_RB_EXT - printf("dmrs symb %d: rxF_ext[%d] = (%d,%d), ul_ch0_ext[%d] = (%d,%d)\n", - is_dmrs_symbol,rxF_ext_index>>1, rxF_ext[rxF_ext_index],rxF_ext[rxF_ext_index+1], - ul_ch0_ext_index, ((int16_t*)&ul_ch0_ext[ul_ch0_ext_index])[0], ((int16_t*)&ul_ch0_ext[ul_ch0_ext_index])[1]); -#endif - ul_ch0_ext_index++; - ul_ch0_ptrs_ext_index++; - rxF_ext_index +=2; - } else { - k_prime++; - k_prime&=1; - n+=(k_prime)?0:1; - } - ul_ch0_index++; - ul_ch0_ptrs_index++; - } - } // is_dmrs_symbol ==0 && is_ptrs_symbol == 0 - } - pusch_vars->ptrs_sc_per_ofdm_symbol = num_ptrs_symbols; - -======= } memcpy1((void*)ul_ch0_ext,(void*)ul_ch0,nb_re_pusch*sizeof(int32_t)); } @@ -411,8 +315,8 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF, } } } ->>>>>>> fork_develop_new } + void nr_ulsch_scale_channel(int **ul_ch_estimates_ext, NR_DL_FRAME_PARMS *frame_parms, @@ -1180,10 +1084,6 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB, { uint8_t aarx, aatx, dmrs_symbol_flag; // dmrs_symbol_flag, a flag to indicate DMRS REs in current symbol -<<<<<<< HEAD - uint8_t ptrs_symbol_flag; // a flag to indicate PTRS REs in current symbol -======= ->>>>>>> fork_develop_new uint32_t nb_re_pusch, bwp_start_subcarrier; int avgs; int avg[4]; @@ -1191,32 +1091,10 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB, nfapi_nr_pusch_pdu_t *rel15_ul = &gNB->ulsch[ulsch_id][0]->harq_processes[harq_pid]->ulsch_pdu; dmrs_symbol_flag = 0; -<<<<<<< HEAD - ptrs_symbol_flag = 0; - - gNB->pusch_vars[ulsch_id]->ptrs_sc_per_ofdm_symbol = 0; if(symbol == rel15_ul->start_symbol_index){ - gNB->pusch_vars[ulsch_id]->rxdataF_ext_offset = 0; gNB->pusch_vars[ulsch_id]->dmrs_symbol = 0; gNB->pusch_vars[ulsch_id]->cl_done = 0; - gNB->pusch_vars[ulsch_id]->ptrs_symbols = 0; - - if (rel15_ul->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) { // if there is ptrs pdu - L_ptrs = 1<<(rel15_ul->pusch_ptrs.ptrs_time_density); - - set_ptrs_symb_idx(&gNB->pusch_vars[ulsch_id]->ptrs_symbols, - rel15_ul->nr_of_symbols, - rel15_ul->start_symbol_index, - L_ptrs, - rel15_ul->ul_dmrs_symb_pos); - } -======= - - if(symbol == rel15_ul->start_symbol_index){ - gNB->pusch_vars[ulsch_id]->dmrs_symbol = 0; - gNB->pusch_vars[ulsch_id]->cl_done = 0; ->>>>>>> fork_develop_new } @@ -1245,16 +1123,6 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB, nb_re_pusch = rel15_ul->rb_size * NR_NB_SC_PER_RB; } -<<<<<<< HEAD - if (rel15_ul->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) { // if there is ptrs pdu - if(is_ptrs_symbol(symbol, gNB->pusch_vars[ulsch_id]->ptrs_symbols)) { - gNB->pusch_vars[ulsch_id]->ptrs_symbol_index = symbol; - ptrs_symbol_flag = 1; - } - } - -======= ->>>>>>> fork_develop_new //---------------------------------------------------------- //--------------------- Channel estimation --------------------- //---------------------------------------------------------- @@ -1269,13 +1137,8 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB, rel15_ul); for (aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) { -<<<<<<< HEAD - gNB->pusch_vars[ulsch_id]->ulsch_power[aarx] = signal_energy(&gNB->pusch_vars[ulsch_id]->ul_ch_estimates[aarx][symbol*frame_parms->ofdm_symbol_size], - rel15_ul->rb_size*12); -======= gNB->pusch_vars[ulsch_id]->ulsch_power[aarx] = signal_energy_nodc(&gNB->pusch_vars[ulsch_id]->ul_ch_estimates[aarx][symbol*frame_parms->ofdm_symbol_size], rel15_ul->rb_size*12); ->>>>>>> fork_develop_new if (gNB->pusch_vars[ulsch_id]->ulsch_power[aarx]==1) return (1); } @@ -1285,19 +1148,6 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB, //--------------------- RBs extraction --------------------- //---------------------------------------------------------- -<<<<<<< HEAD - if (nb_re_pusch > 0) { - - start_meas(&gNB->ulsch_rbs_extraction_stats); - nr_ulsch_extract_rbs_single(gNB->common_vars.rxdataF, - gNB->pusch_vars[ulsch_id], - symbol, - dmrs_symbol_flag, - ptrs_symbol_flag, - rel15_ul, - frame_parms); - stop_meas(&gNB->ulsch_rbs_extraction_stats); -======= gNB->pusch_vars[ulsch_id]->ul_valid_re_per_slot[symbol] = nb_re_pusch; if (nb_re_pusch > 0) { @@ -1314,7 +1164,6 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB, //---------------------------------------------------------- //--------------------- Channel Scaling -------------------- //---------------------------------------------------------- ->>>>>>> fork_develop_new nr_ulsch_scale_channel(gNB->pusch_vars[ulsch_id]->ul_ch_estimates_ext, frame_parms, @@ -1335,16 +1184,6 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB, rel15_ul->rb_size); avgs = 0; -<<<<<<< HEAD - - for (aatx=0;aatx<frame_parms->nb_antennas_tx;aatx++) - for (aarx=0;aarx<frame_parms->nb_antennas_rx;aarx++) - avgs = cmax(avgs,avg[(aatx<<1)+aarx]); - - gNB->pusch_vars[ulsch_id]->log2_maxh = (log2_approx(avgs)/2)+3; - gNB->pusch_vars[ulsch_id]->cl_done = 1; - } -======= for (aatx=0;aatx<frame_parms->nb_antennas_tx;aatx++) for (aarx=0;aarx<frame_parms->nb_antennas_rx;aarx++) @@ -1357,7 +1196,6 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB, //---------------------------------------------------------- //--------------------- Channel Compensation --------------- //---------------------------------------------------------- ->>>>>>> fork_develop_new start_meas(&gNB->ulsch_channel_compensation_stats); nr_ulsch_channel_compensation(gNB->pusch_vars[ulsch_id]->rxdataF_ext, @@ -1386,33 +1224,6 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB, nr_idft(&((uint32_t*)gNB->pusch_vars[ulsch_id]->rxdataF_ext[0])[symbol * rel15_ul->rb_size * NR_NB_SC_PER_RB], nb_re_pusch); #endif -<<<<<<< HEAD - //---------------------------------------------------------- - //-------------------- LLRs computation -------------------- - //---------------------------------------------------------- - start_meas(&gNB->ulsch_llr_stats); - AssertFatal(gNB->pusch_vars[ulsch_id]->rxdataF_ext_offset * rel15_ul->qam_mod_order+nb_re_pusch*rel15_ul->qam_mod_order < (8*((3*8*6144)+12)) , "Mysterious llr buffer size check"); -#ifdef __AVX2__ - int off = ((rel15_ul->rb_size&1) == 1)? 4:0; -#else - int off = 0; -#endif - nr_ulsch_compute_llr(&gNB->pusch_vars[ulsch_id]->rxdataF_comp[0][symbol * (off+(rel15_ul->rb_size * NR_NB_SC_PER_RB))], - gNB->pusch_vars[ulsch_id]->ul_ch_mag0, - gNB->pusch_vars[ulsch_id]->ul_ch_magb0, - &gNB->pusch_vars[ulsch_id]->llr[gNB->pusch_vars[ulsch_id]->rxdataF_ext_offset * rel15_ul->qam_mod_order], - rel15_ul->rb_size, - nb_re_pusch, - symbol, - rel15_ul->qam_mod_order); - stop_meas(&gNB->ulsch_llr_stats); - - } - - gNB->pusch_vars[ulsch_id]->rxdataF_ext_offset = gNB->pusch_vars[ulsch_id]->rxdataF_ext_offset + nb_re_pusch; - return (0); - -======= //---------------------------------------------------------- //--------------------- PTRS Processing -------------------- @@ -1463,5 +1274,4 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB, }// last symbol check } return (0); ->>>>>>> fork_develop_new } diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 9e876f321d5..6cd2fc72aef 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -67,11 +67,7 @@ int nr_find_pucch(uint16_t rnti, AssertFatal(gNB!=NULL,"gNB is null\n"); int index = -1; -<<<<<<< HEAD - for (int i=0; i<NUMBER_OF_NR_ULSCH_MAX; i++) { -======= for (int i=0; i<NUMBER_OF_NR_PUCCH_MAX; i++) { ->>>>>>> fork_develop_new AssertFatal(gNB->pucch[i]!=NULL,"gNB->pucch[%d] is null\n",i); if ((gNB->pucch[i]->active >0) && (gNB->pucch[i]->pucch_pdu.rnti==rnti) && @@ -100,10 +96,6 @@ void nr_fill_pucch(PHY_VARS_gNB *gNB, pucch->slot = slot; pucch->active = 1; memcpy((void*)&pucch->pucch_pdu, (void*)pucch_pdu, sizeof(nfapi_nr_pucch_pdu_t)); -<<<<<<< HEAD - -======= ->>>>>>> fork_develop_new } @@ -387,11 +379,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, #endif // estimate CQI for MAC (from antenna port 0 only) -<<<<<<< HEAD - int SNRtimes10 = dB_fixed_times10(signal_energy(&rxdataF[0][pucch_pdu->start_symbol_index*frame_parms->ofdm_symbol_size+re_offset],12)) - (10*gNB->measurements.n0_power_tot_dB); -======= int SNRtimes10 = dB_fixed_times10(signal_energy_nodc(&rxdataF[0][pucch_pdu->start_symbol_index*frame_parms->ofdm_symbol_size+re_offset],12)) - (10*gNB->measurements.n0_power_tot_dB); ->>>>>>> fork_develop_new int cqi; if (SNRtimes10 < -640) cqi=0; else if (SNRtimes10 > 635) cqi=255; @@ -405,15 +393,9 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, // first bit of bitmap for sr presence and second bit for acknack presence uci_pdu->pduBitmap = pucch_pdu->sr_flag | ((pucch_pdu->bit_len_harq>0)<<1); uci_pdu->pucch_format = 0; // format 0 -<<<<<<< HEAD - uci_pdu->ul_cqi = cqi; // currently not valid - uci_pdu->timing_advance = 0xffff; // currently not valid - uci_pdu->rssi = 1280 - (10*dB_fixed(32767*32767)-dB_fixed_times10(signal_energy(&rxdataF[0][pucch_pdu->start_symbol_index*frame_parms->ofdm_symbol_size+re_offset],12))); -======= uci_pdu->ul_cqi = cqi; uci_pdu->timing_advance = 0xffff; // currently not valid uci_pdu->rssi = 1280 - (10*dB_fixed(32767*32767)-dB_fixed_times10(signal_energy_nodc(&rxdataF[0][pucch_pdu->start_symbol_index*frame_parms->ofdm_symbol_size+re_offset],12))); ->>>>>>> fork_develop_new if (pucch_pdu->bit_len_harq==0) { uci_pdu->harq = NULL; uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); @@ -430,13 +412,8 @@ 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; -<<<<<<< HEAD - LOG_I(PHY, "HARQ value %d with confidence level (0 is good, 1 is bad) %d\n", - uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level); -======= LOG_D(PHY, "Slot %d HARQ value %d with confidence level (0 is good, 1 is bad) %d\n", slot,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level); ->>>>>>> fork_develop_new if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); uci_pdu->sr->sr_indication = (index>1) ? 1 : 0; @@ -450,13 +427,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; -<<<<<<< HEAD - LOG_I(PHY, "HARQ values %d and %d with confidence level (0 is good, 1 is bad) %d\n", - uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level); -======= LOG_D(PHY, "Slot %d HARQ values %d and %d with confidence level (0 is good, 1 is bad) %d\n", slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level); ->>>>>>> fork_develop_new if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); uci_pdu->sr->sr_indication = (index>3) ? 1 : 0; @@ -1116,11 +1088,6 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, int32_t **rxdataF = gNB->common_vars.rxdataF; NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms; //pucch_GroupHopping_t pucch_GroupHopping = pucch_pdu->group_hop_flag + (pucch_pdu->sequence_hop_flag<<1); -<<<<<<< HEAD - - -======= ->>>>>>> fork_develop_new AssertFatal(pucch_pdu->nr_of_symbols==1 || pucch_pdu->nr_of_symbols==2, "Illegal number of symbols for PUCCH 2 %d\n",pucch_pdu->nr_of_symbols); @@ -1149,11 +1116,8 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, int16_t rd_re_ext[Prx2][4*pucch_pdu->nr_of_symbols*pucch_pdu->prb_size] __attribute__((aligned(32))); int16_t rd_im_ext[Prx2][4*pucch_pdu->nr_of_symbols*pucch_pdu->prb_size] __attribute__((aligned(32))); int16_t *r_re_ext_p,*r_im_ext_p,*rd_re_ext_p,*rd_im_ext_p; -<<<<<<< HEAD -======= int nb_re_pucch = 12*pucch_pdu->prb_size; ->>>>>>> fork_develop_new int16_t rp[Prx2][nb_re_pucch*2],*tmp_rp; __m64 dmrs_re,dmrs_im; @@ -1191,63 +1155,6 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, rd_re_ext_p=&rd_re_ext[aa][4*prb]; rd_im_ext_p=&rd_im_ext[aa][4*prb]; -<<<<<<< HEAD - r_re_ext_p[0]=rp[aa][0]; - r_im_ext_p[0]=rp[aa][1]; - rd_re_ext_p[0]=rp[aa][2]; - rd_im_ext_p[0]=rp[aa][3]; - r_re_ext_p[1]=rp[aa][4]; - r_im_ext_p[1]=rp[aa][5]; - - r_re_ext_p[2]=rp[aa][6]; - r_im_ext_p[2]=rp[aa][7]; - rd_re_ext_p[1]=rp[aa][8]; - rd_im_ext_p[1]=rp[aa][9]; - r_re_ext_p[3]=rp[aa][10]; - r_im_ext_p[3]=rp[aa][11]; - - r_re_ext_p[4]=rp[aa][12]; - r_im_ext_p[4]=rp[aa][13]; - rd_re_ext_p[2]=rp[aa][14]; - rd_im_ext_p[2]=rp[aa][15]; - r_re_ext_p[5]=rp[aa][16]; - r_im_ext_p[5]=rp[aa][17]; - - r_re_ext_p[6]=rp[aa][18]; - r_im_ext_p[6]=rp[aa][19]; - rd_re_ext_p[3]=rp[aa][20]; - rd_im_ext_p[3]=rp[aa][21]; - r_re_ext_p[7]=rp[aa][22]; - r_im_ext_p[7]=rp[aa][23]; - - r_re_ext_p[8]=rp[aa][24]; - r_im_ext_p[8]=rp[aa][25]; - rd_re_ext_p[4]=rp[aa][26]; - rd_im_ext_p[4]=rp[aa][27]; - r_re_ext_p[9]=rp[aa][28]; - r_im_ext_p[9]=rp[aa][29]; - - r_re_ext_p[10]=rp[aa][30]; - r_im_ext_p[10]=rp[aa][31]; - rd_re_ext_p[5]=rp[aa][32]; - rd_im_ext_p[5]=rp[aa][33]; - r_re_ext_p[11]=rp[aa][34]; - r_im_ext_p[11]=rp[aa][35]; - - r_re_ext_p[12]=rp[aa][36]; - r_im_ext_p[12]=rp[aa][37]; - rd_re_ext_p[6]=rp[aa][38]; - rd_im_ext_p[6]=rp[aa][39]; - r_re_ext_p[13]=rp[aa][40]; - r_im_ext_p[13]=rp[aa][41]; - - r_re_ext_p[14]=rp[aa][42]; - r_im_ext_p[14]=rp[aa][43]; - rd_re_ext_p[7]=rp[aa][44]; - rd_im_ext_p[7]=rp[aa][45]; - r_re_ext_p[15]=rp[aa][46]; - r_im_ext_p[15]=rp[aa][47]; -======= for (int idx=0; idx<8; idx++) { r_re_ext_p[idx<<1]=rp[aa][prb*24+6*idx]; r_im_ext_p[idx<<1]=rp[aa][prb*24+1+6*idx]; @@ -1256,16 +1163,11 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, r_re_ext_p[1+(idx<<1)]=rp[aa][prb*24+4+6*idx]; r_im_ext_p[1+(idx<<1)]=rp[aa][prb*24+5+6*idx]; } ->>>>>>> fork_develop_new #ifdef DEBUG_NR_PUCCH_RX for (int i=0;i<8;i++) printf("Ant %d PRB %d dmrs[%d] -> (%d,%d)\n",aa,prb+(i>>2),i,rd_re_ext_p[i],rd_im_ext_p[i]); for (int i=0;i<16;i++) printf("Ant %d PRB %d data[%d] -> (%d,%d)\n",aa,prb+(i>>3),i,r_re_ext_p[i],r_im_ext_p[i]); #endif -<<<<<<< HEAD - rp[aa]+=48; -======= ->>>>>>> fork_develop_new } // aa } // prb @@ -1277,15 +1179,11 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, printf("slot %d, start_symbol_index %d, dmrs_scrambling_id %d\n", slot,pucch_pdu->start_symbol_index,pucch_pdu->dmrs_scrambling_id); #endif -<<<<<<< HEAD - s = lte_gold_generic(&x1, &x2, 1); -======= int reset = 1; for (int i=0; i<=(pucch_pdu->prb_start>>2); i++) { s = lte_gold_generic(&x1, &x2, reset); reset = 0; } ->>>>>>> fork_develop_new for (int group=0;group<ngroup;group++) { // each group has 8*nc_group_size elements, compute 1 complex correlation with DMRS per group @@ -1547,11 +1445,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, for (int aa=0;aa<Prx;aa++) { LOG_D(PHY,"pucch2 cw %d group %d aa %d: (%d,%d)+(%d,%d) = (%d,%d)\n",cw,group,aa, -<<<<<<< HEAD - corr32_re[group][aa],corr32_im[0][aa], -======= corr32_re[group][aa],corr32_im[group][aa], ->>>>>>> fork_develop_new ((int16_t*)(&prod_re[aa]))[0], ((int16_t*)(&prod_im[aa]))[0], corr32_re[group][aa]+((int16_t*)(&prod_re[aa]))[0], @@ -1629,26 +1523,6 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, corr_re = ( corr32_re[half_prb>>2][aa]/(2*nc_group_size*4/2)+((int16_t*)(&prod_re[aa]))[0]); corr_im = ( corr32_im[half_prb>>2][aa]/(2*nc_group_size*4/2)+((int16_t*)(&prod_im[aa]))[0]); corr_tmp += corr_re*corr_re + corr_im*corr_im; -<<<<<<< HEAD - /* - LOG_D(PHY,"pucch2 half_prb %d cw %d (%d,%d) aa %d: (%d,%d,%d,%d,%d,%d,%d,%d)x(%d,%d,%d,%d,%d,%d,%d,%d) (%d,%d)+(%d,%d) = (%d,%d) => %d\n", - half_prb,cw,cw&15,cw>>4,aa, - ((int16_t*)&pucch2_polar_4bit[cw&15])[0],((int16_t*)&pucch2_polar_4bit[cw>>4])[0], - ((int16_t*)&pucch2_polar_4bit[cw&15])[1],((int16_t*)&pucch2_polar_4bit[cw>>4])[1], - ((int16_t*)&pucch2_polar_4bit[cw&15])[2],((int16_t*)&pucch2_polar_4bit[cw>>4])[2], - ((int16_t*)&pucch2_polar_4bit[cw&15])[3],((int16_t*)&pucch2_polar_4bit[cw>>4])[3], - ((int16_t*)&rp_re[aa][half_prb])[0],((int16_t*)&rp_im[aa][half_prb])[0], - ((int16_t*)&rp_re[aa][half_prb])[1],((int16_t*)&rp_im[aa][half_prb])[1], - ((int16_t*)&rp_re[aa][half_prb])[2],((int16_t*)&rp_im[aa][half_prb])[2], - ((int16_t*)&rp_re[aa][half_prb])[3],((int16_t*)&rp_im[aa][half_prb])[3], - corr32_re[half_prb>>2][aa]/(2*nc_group_size*4/2),corr32_im[half_prb>>2][aa]/(2*nc_group_size*4/2), - ((int16_t*)(&prod_re[aa]))[0], - ((int16_t*)(&prod_im[aa]))[0], - corr_re, - corr_im, - corr_tmp); - */ -======= /* LOG_D(PHY,"pucch2 half_prb %d cw %d (%d,%d) aa %d: (%d,%d,%d,%d,%d,%d,%d,%d)x(%d,%d,%d,%d,%d,%d,%d,%d) (%d,%d)+(%d,%d) = (%d,%d) => %d\n", half_prb,cw,cw&15,cw>>4,aa, @@ -1667,7 +1541,6 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, corr_im, corr_tmp); */ ->>>>>>> fork_develop_new } corr16 = _mm_set1_epi16((int16_t)(corr_tmp>>8)); /* @@ -1721,17 +1594,11 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, } // half_prb // run polar decoder on llrs decoderState = polar_decoder_int16((int16_t*)llrs, decodedPayload, 0, currentPtr); -<<<<<<< HEAD - LOG_D(PHY,"UCI decoderState %d, payload[0] %llux\n",decoderState,(unsigned long long)decodedPayload[0]); -======= LOG_D(PHY,"UCI decoderState %d, payload[0] %llu\n",decoderState,(unsigned long long)decodedPayload[0]); ->>>>>>> fork_develop_new if (decoderState>0) decoderState=1; corr_dB = dB_fixed64(corr); LOG_D(PHY,"metric %d dB\n",corr_dB); } -<<<<<<< HEAD -======= re_offset = (12*pucch_pdu->prb_start) + (12*pucch_pdu->bwp_start) + frame_parms->first_carrier_offset; // estimate CQI for MAC (from antenna port 0 only) @@ -1741,32 +1608,20 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, else if (SNRtimes10 > 635) cqi=255; else cqi=(640+SNRtimes10)/5; ->>>>>>> fork_develop_new uci_pdu->harq.harq_bit_len = pucch_pdu->bit_len_harq; uci_pdu->pduBitmap=0; uci_pdu->rnti=pucch_pdu->rnti; uci_pdu->handle=pucch_pdu->handle; uci_pdu->pucch_format=0; -<<<<<<< HEAD - uci_pdu->ul_cqi=corr_dB; - // need to fill these field! - uci_pdu->timing_advance=31; - uci_pdu->rssi=0; -======= uci_pdu->ul_cqi=cqi; uci_pdu->timing_advance=0xffff; // currently not valid uci_pdu->rssi=1280 - (10*dB_fixed(32767*32767)-dB_fixed_times10(signal_energy_nodc(&rxdataF[0][(l2*frame_parms->ofdm_symbol_size)+re_offset],12*pucch_pdu->prb_size))); ->>>>>>> fork_develop_new if (pucch_pdu->bit_len_harq>0) { int harq_bytes=pucch_pdu->bit_len_harq>>3; if ((pucch_pdu->bit_len_harq&7) > 0) harq_bytes++; uci_pdu->pduBitmap|=1; uci_pdu->harq.harq_payload = (uint8_t*)malloc(harq_bytes); -<<<<<<< HEAD - uci_pdu->harq.harq_crc = decoderState > 0 ? 1 : 0; -======= uci_pdu->harq.harq_crc = decoderState; ->>>>>>> fork_develop_new int i=0; for (;i<harq_bytes-1;i++) { uci_pdu->harq.harq_payload[i] = decodedPayload[0] & 255; @@ -1789,26 +1644,18 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, int csi_part1_bytes=pucch_pdu->bit_len_csi_part1>>3; if ((pucch_pdu->bit_len_csi_part1&7) > 0) csi_part1_bytes++; uci_pdu->csi_part1.csi_part1_payload = (uint8_t*)malloc(csi_part1_bytes); -<<<<<<< HEAD - uci_pdu->csi_part1.csi_part1_crc = decoderState > 0 ? 1 : 0; -======= uci_pdu->csi_part1.csi_part1_crc = decoderState; ->>>>>>> fork_develop_new int i=0; for (;i<csi_part1_bytes-1;i++) { uci_pdu->csi_part1.csi_part1_payload[i] = decodedPayload[0] & 255; decodedPayload[0]>>=8; } uci_pdu->csi_part1.csi_part1_payload[i] = decodedPayload[0] & ((1<<(pucch_pdu->bit_len_csi_part1&7))-1); -<<<<<<< HEAD - decodedPayload[0] >>= pucch_pdu->bit_len_csi_part1; -======= decodedPayload[0] >>= pucch_pdu->bit_len_csi_part1; } if (pucch_pdu->bit_len_csi_part2>0) { uci_pdu->pduBitmap|=8; ->>>>>>> fork_develop_new } if (pucch_pdu->bit_len_csi_part2>0) { diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h index 8cba5d5a70a..892c6b76928 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h @@ -97,10 +97,7 @@ void phy_adjust_gain_nr(PHY_VARS_NR_UE *ue, int16_t get_nr_PL(uint8_t Mod_id, uint8_t CC_id, uint8_t gNB_index); -<<<<<<< HEAD -======= float_t get_nr_RSRP(module_id_t Mod_id,uint8_t CC_id,uint8_t gNB_index); ->>>>>>> fork_develop_new #endif diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c b/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c index 22369288e1a..1dfdfc939f6 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c @@ -77,8 +77,6 @@ int16_t get_nr_PL(uint8_t Mod_id, uint8_t CC_id, uint8_t gNB_index){ //(ue->frame_parms.pdsch_config_common.referenceSignalPower*10))/10)); } -<<<<<<< HEAD -======= uint32_t get_nr_rx_total_gain_dB (module_id_t Mod_id,uint8_t CC_id) { @@ -108,7 +106,6 @@ float_t get_nr_RSRP(module_id_t Mod_id,uint8_t CC_id,uint8_t gNB_index) } ->>>>>>> fork_develop_new void nr_ue_measurements(PHY_VARS_NR_UE *ue, unsigned int subframe_offset, unsigned char N0_symbol, diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c index e7d18096cdd..53456bb6910 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c @@ -845,10 +845,6 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, for (int i=0;i<pdcch_vars->nb_search_space;i++) { rel15 = &pdcch_vars->pdcch_config[i]; -<<<<<<< HEAD - int dci_length = rel15->dci_length; -======= ->>>>>>> fork_develop_new //int gNB_id = 0; int16_t tmp_e[16*108]; rnti_t n_rnti; @@ -856,43 +852,6 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, for (int j=0;j<rel15->number_of_candidates;j++) { int CCEind = rel15->CCE[j]; int L = rel15->L[j]; -<<<<<<< HEAD - uint64_t dci_estimation[2]= {0}; - const t_nrPolar_params *currentPtrDCI = nr_polar_params(NR_POLAR_DCI_MESSAGE_TYPE, dci_length, L, 1, &ue->polarList); - - LOG_D(PHY, "Trying DCI candidate %d of %d number of candidates, CCE %d (%d), L %d\n", j, rel15->number_of_candidates, CCEind, CCEind*9*6*2, L); - - nr_pdcch_unscrambling(&pdcch_vars->e_rx[CCEind*108], rel15->coreset.scrambling_rnti, L*108, rel15->coreset.pdcch_dmrs_scrambling_id, tmp_e); - - #ifdef DEBUG_DCI_DECODING - uint32_t * z = (uint32_t *) &pdcch_vars->e_rx[CCEind*108]; - for (int index_z = 0; index_z < 96; index_z++){ - for (int i=0; i<9; i++) { - LOG_D(PHY,"z[%d]=(%d,%d) \n", (9*index_z + i), *(int16_t *) &z[index_z + i],*(1 + (int16_t *) &z[index_z + i])); - } - } - #endif - - uint16_t crc = polar_decoder_int16(tmp_e, - dci_estimation, - 1, - currentPtrDCI); - - n_rnti = rel15->rnti; - - if (crc == n_rnti) { - LOG_D(PHY,"Decoded crc %x matches rnti %x for DCI format %d\n", crc, n_rnti, rel15->dci_format); - dci_ind->SFN = frame; - dci_ind->slot = slot; - dci_ind->dci_list[dci_ind->number_of_dcis].rnti = n_rnti; - dci_ind->dci_list[dci_ind->number_of_dcis].n_CCE = CCEind; - dci_ind->dci_list[dci_ind->number_of_dcis].dci_format = rel15->dci_format; - dci_ind->dci_list[dci_ind->number_of_dcis].payloadSize = dci_length; - memcpy((void*)dci_ind->dci_list[dci_ind->number_of_dcis].payloadBits,(void*)dci_estimation,8); - dci_ind->number_of_dcis++; - } else { - LOG_D(PHY,"Decoded crc %x does not match rnti %x for DCI format %d\n", crc, n_rnti, rel15->dci_format); -======= // Loop over possible DCI lengths for (int k = 0; k < rel15->num_dci_options; k++) { @@ -934,7 +893,6 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, } else { LOG_D(PHY,"Decoded crc %x does not match rnti %x for DCI format %d\n", crc, n_rnti, rel15->dci_format_options[k]); } ->>>>>>> fork_develop_new } } } diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index c5b8503f69e..fae97f68248 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -186,10 +186,6 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, if (dlsch0_harq && dlsch1_harq){ -<<<<<<< HEAD - //printf("status TB0 = %d, status TB1 = %d \n", dlsch[0]->harq_processes[harq_pid]->status, dlsch[1]->harq_processes[harq_pid]->status); -======= ->>>>>>> fork_develop_new LOG_D(PHY,"AbsSubframe %d.%d / Sym %d harq_pid %d, harq status %d.%d \n", frame, nr_tti_rx, symbol, harq_pid, dlsch0_harq->status, dlsch1_harq->status); if ((dlsch0_harq->status == ACTIVE) && (dlsch1_harq->status == ACTIVE)){ @@ -246,13 +242,10 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, dlsch0_harq->Qm = nr_get_Qm_dl(dlsch[0]->harq_processes[harq_pid]->mcs, dlsch[0]->harq_processes[harq_pid]->mcs_table); dlsch0_harq->R = nr_get_code_rate_dl(dlsch[0]->harq_processes[harq_pid]->mcs, dlsch[0]->harq_processes[harq_pid]->mcs_table); -<<<<<<< HEAD -======= if (dlsch0_harq->Qm == 0 || dlsch0_harq->R == 0) { LOG_W(MAC, "Invalid code rate or Mod order, likely due to unexpected DL DCI.\n"); return -1; } ->>>>>>> fork_develop_new #ifdef DEBUG_HARQ printf("[DEMOD] MIMO mode = %d\n", dlsch0_harq->mimo_mode); @@ -992,16 +985,12 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, } if (dlsch1_harq) { -<<<<<<< HEAD - switch (nr_get_Qm_dl(dlsch1_harq->mcs,dlsch1_harq->mcs_table)) { -======= uint8_t Qm = nr_get_Qm_dl(dlsch1_harq->mcs,dlsch1_harq->mcs_table); if (Qm == 0){ LOG_W(MAC, "Invalid code rate or Mod order, likely due to unexpected DL DCI.\n"); return -1; } switch (Qm) { ->>>>>>> fork_develop_new case 2 : if (rx_type==rx_standard) { nr_dlsch_qpsk_llr(frame_parms, diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_prach.c b/openair1/PHY/NR_UE_TRANSPORT/nr_prach.c index 844d3ccba75..465598d4685 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_prach.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_prach.c @@ -48,20 +48,6 @@ extern uint16_t prach_root_sequence_map_0_3[838]; extern uint16_t prach_root_sequence_map_abc[138]; extern uint16_t nr_du[838]; extern int16_t nr_ru[2*839]; -<<<<<<< HEAD -extern const char *prachfmt[9]; -extern const char *prachfmt03[4]; - -// Note: -// - prach_fmt_id is an ID used to map to the corresponding PRACH format value in prachfmt -// WIP todo: -// - take prach start symbol into account -// - idft for short sequence assumes we are transmitting starting in symbol 0 of a PRACH slot -// - Assumes that PRACH SCS is same as PUSCH SCS @ 30 kHz, take values for formats 0-2 and adjust for others below -// - Preamble index different from 0 is not detected by gNB -int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ - -======= extern const char *prachfmt[]; // Note: @@ -73,7 +59,6 @@ extern const char *prachfmt[]; // - Preamble index different from 0 is not detected by gNB int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ ->>>>>>> fork_develop_new NR_DL_FRAME_PARMS *fp=&ue->frame_parms; fapi_nr_config_request_t *nrUE_config = &ue->nrUE_config; NR_PRACH_RESOURCES_t *prach_resources = ue->prach_resources[gNB_id]; @@ -86,11 +71,7 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ int16_t Ncp = 0, amp, *prach, *prach2, *prachF, *Xu; int32_t Xu_re, Xu_im; -<<<<<<< HEAD - int prach_start, prach_sequence_length, i, prach_len, dftlen, mu, kbar, K, n_ra_prb, k; -======= int prach_start, prach_sequence_length, i, prach_len, dftlen, mu, kbar, K, n_ra_prb, k, prachStartSymbol, sample_offset_slot; ->>>>>>> fork_develop_new //int restricted_Type; prach = prach_tmp; @@ -113,11 +94,7 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ kbar = 1; K = 24; k = 12*n_ra_prb - 6*fp->N_RB_UL; -<<<<<<< HEAD - //prachStartSymbol = prach_config_pdu->prach_start_symbol -======= prachStartSymbol = prach_pdu->prach_start_symbol; ->>>>>>> fork_develop_new //restricted_Type = 0; compute_nr_prach_seq(nrUE_config->prach_config.prach_sequence_length, @@ -125,12 +102,8 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ nrUE_config->prach_config.num_prach_fd_occasions_list[fd_occasion].prach_root_sequence_index, ue->X_u); -<<<<<<< HEAD - prach_start = fp->get_samples_slot_timestamp(slot, fp, 0); -======= sample_offset_slot = (prachStartSymbol==0?0:fp->ofdm_symbol_size*prachStartSymbol+fp->nb_prefix_samples0+fp->nb_prefix_samples*(prachStartSymbol-1)); prach_start = fp->get_samples_slot_timestamp(slot, fp, 0) + sample_offset_slot; ->>>>>>> fork_develop_new // First compute physical root sequence /************************************************************************ @@ -208,22 +181,14 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ } // now generate PRACH signal -<<<<<<< HEAD - #ifdef NR_PRACH_DEBUG -======= #ifdef NR_PRACH_DEBUG ->>>>>>> fork_develop_new if (NCS>0) LOG_I(PHY, "PRACH [UE %d] generate PRACH in slot %d for RootSeqIndex %d, Preamble Index %d, PRACH Format %s, NCS %d (N_ZC %d): Preamble_offset %d, Preamble_shift %d msg1 frequency start %d\n", Mod_id, slot, rootSequenceIndex, preamble_index, -<<<<<<< HEAD - prach_sequence_length == 0 ? prachfmt03[prach_fmt_id] : prachfmt[prach_fmt_id], -======= prachfmt[prach_fmt_id], ->>>>>>> fork_develop_new NCS, N_ZC, preamble_offset, @@ -397,20 +362,6 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ } else { switch (prach_fmt_id) { -<<<<<<< HEAD - case 0: //A1 - Ncp = 288/(1<<mu); - break; - case 1: //A2 - Ncp = 576/(1<<mu); - break; - case 2: //A3 - Ncp = 864/(1<<mu); - break; - case 3: //B1 - Ncp = 216/(1<<mu); - break; -======= case 4: //A1 Ncp = 288/(1<<mu); break; @@ -424,22 +375,12 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ Ncp = 216/(1<<mu); break; /* ->>>>>>> fork_develop_new case 4: //B2 Ncp = 360/(1<<mu); break; case 5: //B3 Ncp = 504/(1<<mu); break; -<<<<<<< HEAD - case 6: //B4 - Ncp = 936/(1<<mu); - break; - case 7: //C0 - Ncp = 1240/(1<<mu); - break; - case 8: //C2 -======= */ case 8: //B4 Ncp = 936/(1<<mu); @@ -448,7 +389,6 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ Ncp = 1240/(1<<mu); break; case 10: //C2 ->>>>>>> fork_develop_new Ncp = 2048/(1<<mu); break; default: @@ -502,31 +442,19 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ prach_len = (12288*4)+Ncp; } } else { // short PRACH sequence -<<<<<<< HEAD - if (prach_fmt_id == 0 || prach_fmt_id == 3 || prach_fmt_id == 7) { -======= if (prach_fmt_id == 4 || prach_fmt_id == 7 || prach_fmt_id == 9) { ->>>>>>> fork_develop_new Ncp+=32; // This assumes we are transmitting starting in symbol 0 of a PRACH slot, 30 kHz, full sampling prach2 = prach+(Ncp<<1); idft(IDFT_2048,prachF,prach2,1); // here we have |empty | Prach2048 | -<<<<<<< HEAD - if (prach_fmt_id != 7) { -======= if (prach_fmt_id != 9) { ->>>>>>> fork_develop_new memmove(prach2+(2048<<1),prach2,(2048<<2)); prach_len = (2048*2)+Ncp; } else prach_len = (2048*1)+Ncp; memmove(prach,prach+(2048<<1),(Ncp<<2)); // here we have |Prefix | Prach2048 | Prach2048 (if ! 0xc0) | -<<<<<<< HEAD - } else if (prach_fmt_id == 1 || prach_fmt_id == 4) { // 6x2048 -======= } else if (prach_fmt_id == 5) { // 6x2048 ->>>>>>> fork_develop_new Ncp+=32; // This assumes we are transmitting starting in symbol 0 of a PRACH slot, 30 kHz, full sampling prach2 = prach+(Ncp<<1); idft(IDFT_2048,prachF,prach2,1); @@ -538,11 +466,7 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ memmove(prach,prach+(2048<<1),(Ncp<<2)); // here we have |Prefix | Prach2048 | prach_len = (2048*4)+Ncp; -<<<<<<< HEAD - } else if (prach_fmt_id == 2 || prach_fmt_id == 5) { // 6x2048 -======= } else if (prach_fmt_id == 6) { // 6x2048 ->>>>>>> fork_develop_new Ncp+=32; prach2 = prach+(Ncp<<1); idft(IDFT_2048,prachF,prach2,1); @@ -556,11 +480,7 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ memmove(prach,prach+(2048<<1),(Ncp<<2)); // here we have |Prefix | Prach2048 | prach_len = (2048*6)+Ncp; -<<<<<<< HEAD - } else if (prach_fmt_id == 6) { // 12x2048 -======= } else if (prach_fmt_id == 8) { // 12x2048 ->>>>>>> fork_develop_new Ncp+=32; // This assumes we are transmitting starting in symbol 0 of a PRACH slot, 30 kHz, full sampling prach2 = prach+(Ncp<<1); idft(IDFT_2048,prachF,prach2,1); @@ -615,20 +535,12 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ prach_len = (9216*4)+Ncp; } } else { // short sequence -<<<<<<< HEAD - if (prach_fmt_id == 0 || prach_fmt_id == 3 || prach_fmt_id == 7) { -======= if (prach_fmt_id == 4 || prach_fmt_id == 7 || prach_fmt_id == 9) { ->>>>>>> fork_develop_new Ncp+=24; // This assumes we are transmitting starting in symbol 0 of a PRACH slot, 30 kHz, full sampling prach2 = prach+(Ncp<<1); idft(IDFT_1536,prachF,prach2,1); // here we have |empty | Prach1536 | -<<<<<<< HEAD - if (prach_fmt_id != 7) { -======= if (prach_fmt_id != 9) { ->>>>>>> fork_develop_new memmove(prach2+(1536<<1),prach2,(1536<<2)); prach_len = (1536*2)+Ncp; } else prach_len = (1536*1)+Ncp; @@ -636,11 +548,7 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ memmove(prach,prach+(1536<<1),(Ncp<<2)); // here we have |Prefix | Prach1536 | Prach1536 (if ! 0xc0) | -<<<<<<< HEAD - } else if (prach_fmt_id == 1 || prach_fmt_id == 4) { // 6x1536 -======= } else if (prach_fmt_id == 5) { // 6x1536 ->>>>>>> fork_develop_new Ncp+=24; // This assumes we are transmitting starting in symbol 0 of a PRACH slot, 30 kHz, full sampling prach2 = prach+(Ncp<<1); @@ -653,11 +561,7 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ memmove(prach,prach+(1536<<1),(Ncp<<2)); // here we have |Prefix | Prach1536 | prach_len = (1536*4)+Ncp; -<<<<<<< HEAD - } else if (prach_fmt_id == 2 || prach_fmt_id == 5) { // 6x1536 -======= } else if (prach_fmt_id == 6) { // 6x1536 ->>>>>>> fork_develop_new Ncp+=24; // This assumes we are transmitting starting in symbol 0 of a PRACH slot, 30 kHz, full sampling prach2 = prach+(Ncp<<1); idft(IDFT_1536,prachF,prach2,1); @@ -671,11 +575,7 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ memmove(prach,prach+(1536<<1),(Ncp<<2)); // here we have |Prefix | Prach1536 | prach_len = (1536*6)+Ncp; -<<<<<<< HEAD - } else if (prach_fmt_id == 6) { // 12x1536 -======= } else if (prach_fmt_id == 8) { // 12x1536 ->>>>>>> fork_develop_new Ncp+=24; // This assumes we are transmitting starting in symbol 0 of a PRACH slot, 30 kHz, full sampling prach2 = prach+(Ncp<<1); idft(IDFT_1536,prachF,prach2,1); @@ -732,30 +632,18 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ prach_len = (24576*4)+Ncp; } } else { // short sequence -<<<<<<< HEAD - if (prach_fmt_id == 0 || prach_fmt_id == 3 || prach_fmt_id == 7) { -======= if (prach_fmt_id == 4 || prach_fmt_id == 7 || prach_fmt_id == 9) { ->>>>>>> fork_develop_new Ncp+=64; // This assumes we are transmitting starting in symbol 0 of a PRACH slot, 30 kHz, full sampling prach2 = prach+(Ncp<<1); idft(IDFT_4096,prachF,prach2,1); // here we have |empty | Prach4096 | -<<<<<<< HEAD - if (prach_fmt_id != 7) { -======= if (prach_fmt_id != 9) { ->>>>>>> fork_develop_new memmove(prach2+(4096<<1),prach2,(4096<<2)); prach_len = (4096*2)+Ncp; } else prach_len = (4096*1)+Ncp; memmove(prach,prach+(4096<<1),(Ncp<<2)); // here we have |Prefix | Prach4096 | Prach4096 (if ! 0xc0) | -<<<<<<< HEAD - } else if (prach_fmt_id == 1 || prach_fmt_id == 4) { // 4x4096 -======= } else if (prach_fmt_id == 5) { // 4x4096 ->>>>>>> fork_develop_new Ncp+=64; // This assumes we are transmitting starting in symbol 0 of a PRACH slot, 30 kHz, full sampling prach2 = prach+(Ncp<<1); idft(IDFT_4096,prachF,prach2,1); @@ -767,11 +655,7 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ memmove(prach,prach+(4096<<1),(Ncp<<2)); // here we have |Prefix | Prach4096 | prach_len = (4096*4)+Ncp; -<<<<<<< HEAD - } else if (prach_fmt_id == 2 || prach_fmt_id == 5) { // 6x4096 -======= } else if (prach_fmt_id == 6) { // 6x4096 ->>>>>>> fork_develop_new Ncp+=64; // This assumes we are transmitting starting in symbol 0 of a PRACH slot, 30 kHz, full sampling prach2 = prach+(Ncp<<1); idft(IDFT_4096,prachF,prach2,1); @@ -785,11 +669,7 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ memmove(prach,prach+(4096<<1),(Ncp<<2)); // here we have |Prefix | Prach4096 | prach_len = (4096*6)+Ncp; -<<<<<<< HEAD - } else if (prach_fmt_id == 6) { // 12x4096 -======= } else if (prach_fmt_id == 8) { // 12x4096 ->>>>>>> fork_develop_new Ncp+=64; // This assumes we are transmitting starting in symbol 0 of a PRACH slot, 30 kHz, full sampling prach2 = prach+(Ncp<<1); idft(IDFT_4096,prachF,prach2,1); @@ -844,30 +724,18 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ prach_len = (18432*4)+Ncp; } } else { // short sequence -<<<<<<< HEAD - if (prach_fmt_id == 0 || prach_fmt_id == 3 || prach_fmt_id == 7) { -======= if (prach_fmt_id == 4 || prach_fmt_id == 7 || prach_fmt_id == 9) { ->>>>>>> fork_develop_new Ncp+=48; // This assumes we are transmitting starting in symbol 0 of a PRACH slot, 30 kHz, full sampling prach2 = prach+(Ncp<<1); idft(IDFT_3072,prachF,prach2,1); // here we have |empty | Prach3072 | -<<<<<<< HEAD - if (prach_fmt_id != 7) { -======= if (prach_fmt_id != 9) { ->>>>>>> fork_develop_new memmove(prach2+(3072<<1),prach2,(3072<<2)); prach_len = (3072*2)+Ncp; } else prach_len = (3072*1)+Ncp; memmove(prach,prach+(3072<<1),(Ncp<<2)); // here we have |Prefix | Prach3072 | Prach3072 (if ! 0xc0) | -<<<<<<< HEAD - } else if (prach_fmt_id == 2 || prach_fmt_id == 5) { // 6x3072 -======= } else if (prach_fmt_id == 6) { // 6x3072 ->>>>>>> fork_develop_new Ncp+=48; // This assumes we are transmitting starting in symbol 0 of a PRACH slot, 30 kHz, full sampling prach2 = prach+(Ncp<<1); idft(IDFT_3072,prachF,prach2,1); @@ -881,11 +749,7 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ memmove(prach,prach+(3072<<1),(Ncp<<2)); // here we have |Prefix | Prach3072 | prach_len = (3072*6)+Ncp; -<<<<<<< HEAD - } else if (prach_fmt_id == 1 || prach_fmt_id == 4) { // 4x3072 -======= } else if (prach_fmt_id == 5) { // 4x3072 ->>>>>>> fork_develop_new Ncp+=48; // This assumes we are transmitting starting in symbol 0 of a PRACH slot, 30 kHz, full sampling prach2 = prach+(Ncp<<1); idft(IDFT_3072,prachF,prach2,1); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c index 00469e3f56b..fdd40feebaf 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c @@ -339,11 +339,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch, &harq_process->K, pz, &harq_process->F, -<<<<<<< HEAD - BG); -======= harq_process->BG); ->>>>>>> fork_develop_new VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_SEGMENTATION, VCD_FUNCTION_OUT); F = harq_process->F; @@ -406,13 +402,6 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch, nrLDPC_encoder(harq_process->c,harq_process->d,*pz,Kb,Kr,harq_process->BG,&impp); } -<<<<<<< HEAD - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_LDPC_ENCODER_OPTIM, VCD_FUNCTION_IN); - - nrLDPC_encoder(harq_process->c,harq_process->d,*pz,Kb,Kr,BG,&impp); - -======= ->>>>>>> fork_develop_new VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_LDPC_ENCODER_OPTIM, VCD_FUNCTION_OUT); //stop_meas(te_stats); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index 6274d273fe6..ea79fd467f0 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -101,32 +101,15 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, LOG_D(PHY,"nr_ue_ulsch_procedures hard_id %d %d.%d\n",harq_pid,frame,slot); uint32_t available_bits; -<<<<<<< HEAD - uint8_t mod_order, cwd_index, num_of_codewords, l; -======= uint8_t cwd_index, l; ->>>>>>> fork_develop_new uint32_t scrambled_output[NR_MAX_NB_CODEWORDS][NR_MAX_PDSCH_ENCODED_LENGTH>>5]; int16_t **tx_layers; int32_t **txdataF; int8_t Wf[2], Wt[2], l_prime[2], delta; -<<<<<<< HEAD - uint16_t rnti, n_dmrs, code_rate, number_dmrs_symbols, nb_rb, k; - uint8_t dmrs_type, nb_dmrs_re_per_rb, number_of_symbols, mcs, Nl; - int ap, start_symbol, Nid_cell, i; - int sample_offsetF, N_RE_prime, N_PRB_oh; - uint16_t ul_dmrs_symb_pos; - uint8_t L_ptrs, K_ptrs; // PTRS parameters - uint16_t beta_ptrs; // PTRS parameter related to power control - - NR_UE_ULSCH_t *ulsch_ue; - NR_UL_UE_HARQ_t *harq_process_ul_ue=NULL; -======= uint8_t nb_dmrs_re_per_rb; int ap, i; int sample_offsetF, N_RE_prime; ->>>>>>> fork_develop_new NR_DL_FRAME_PARMS *frame_parms = &UE->frame_parms; NR_UE_PUSCH *pusch_ue = UE->pusch_vars[thread_id][gNB_id]; // ptrs_UplinkConfig_t *ptrs_Uplink_Config = &UE->pusch_config.dmrs_UplinkConfig.ptrs_UplinkConfig; @@ -158,11 +141,6 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, start_sc -= frame_parms->ofdm_symbol_size; ulsch_ue->Nid_cell = Nid_cell; -<<<<<<< HEAD - - nb_dmrs_re_per_rb = ((dmrs_type == pusch_dmrs_type1) ? 6:4)*harq_process_ul_ue->pusch_pdu.num_dmrs_cdm_grps_no_data; -======= ->>>>>>> fork_develop_new get_num_re_dmrs(pusch_pdu, &nb_dmrs_re_per_rb, &number_dmrs_symbols); @@ -170,23 +148,6 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, N_RE_prime = NR_NB_SC_PER_RB*number_of_symbols - nb_dmrs_re_per_rb*number_dmrs_symbols - N_PRB_oh; harq_process_ul_ue->num_of_mod_symbols = N_RE_prime*nb_rb*num_of_codewords; -<<<<<<< HEAD - mcs = harq_process_ul_ue->pusch_pdu.mcs_index; - Nl = harq_process_ul_ue->pusch_pdu.nrOfLayers; - mod_order = nr_get_Qm_ul(mcs, 0); - code_rate = nr_get_code_rate_ul(mcs, 0); - - harq_process_ul_ue->pusch_pdu.pusch_data.tb_size = nr_compute_tbs(mod_order, - code_rate, - nb_rb, - number_of_symbols, - nb_dmrs_re_per_rb*number_dmrs_symbols, - 0, - 0, - harq_process_ul_ue->pusch_pdu.nrOfLayers); - -======= ->>>>>>> fork_develop_new /////////////////////////ULSCH coding///////////////////////// /////////// @@ -230,13 +191,8 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, /////////////////////////DMRS Modulation///////////////////////// /////////// -<<<<<<< HEAD - pusch_dmrs = UE->nr_gold_pusch_dmrs[slot]; - n_dmrs = (nb_rb*((dmrs_type == pusch_dmrs_type1) ? 6:4)*number_dmrs_symbols); -======= uint32_t ***pusch_dmrs = UE->nr_gold_pusch_dmrs[slot]; uint16_t n_dmrs = (start_rb+nb_rb)*((dmrs_type == pusch_dmrs_type1) ? 6:4); ->>>>>>> fork_develop_new int16_t mod_dmrs[n_dmrs<<1] __attribute((aligned(16))); /////////// //////////////////////////////////////////////////////////////////////// @@ -327,14 +283,6 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, get_Wt(Wt, ap, dmrs_type); get_Wf(Wf, ap, dmrs_type); delta = get_delta(ap, dmrs_type); -<<<<<<< HEAD - - - uint8_t k_prime=0; - uint8_t is_dmrs, is_ptrs, is_dmrs_symbol; - uint16_t m=0, n=0, dmrs_idx=0, ptrs_idx = 0; -======= ->>>>>>> fork_develop_new for (l=start_symbol; l<start_symbol+number_of_symbols; l++) { @@ -371,18 +319,9 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, uint8_t is_dmrs = 0; uint8_t is_ptrs = 0; -<<<<<<< HEAD - is_dmrs = 0; - is_ptrs = 0; - is_dmrs_symbol = 0; - - if((ul_dmrs_symb_pos >> l) & 0x01) { - is_dmrs_symbol = 1; -======= sample_offsetF = l*frame_parms->ofdm_symbol_size + k; if (is_dmrs_sym) { ->>>>>>> fork_develop_new if (k == ((start_sc+get_dmrs_freq_idx_ul(n, k_prime, delta, dmrs_type))%frame_parms->ofdm_symbol_size)) is_dmrs = 1; } else if (is_ptrs_sym) { @@ -421,11 +360,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, ptrs_idx++; -<<<<<<< HEAD - } else if (!is_dmrs_symbol || allowed_xlsch_re_in_dmrs_symbol(k,start_sc,harq_process_ul_ue->pusch_pdu.num_dmrs_cdm_grps_no_data,dmrs_type)) { -======= } else if (!is_dmrs_sym || allowed_xlsch_re_in_dmrs_symbol(k, start_sc, cdm_grps_no_data, dmrs_type)) { ->>>>>>> fork_develop_new ((int16_t*)txdataF[ap])[(sample_offsetF)<<1] = ((int16_t *) ulsch_ue->y)[m<<1]; ((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1] = ((int16_t *) ulsch_ue->y)[(m<<1) + 1]; @@ -452,10 +387,6 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, } } -<<<<<<< HEAD - //} -======= ->>>>>>> fork_develop_new NR_UL_UE_HARQ_t *harq_process_ulsch=NULL; harq_process_ulsch = UE->ulsch[thread_id][gNB_id][0]->harq_processes[harq_pid]; harq_process_ulsch->status = SCH_IDLE; diff --git a/openair1/SCHED_NR/fapi_nr_l1.c b/openair1/SCHED_NR/fapi_nr_l1.c index 8490ae228e4..412c1584a03 100644 --- a/openair1/SCHED_NR/fapi_nr_l1.c +++ b/openair1/SCHED_NR/fapi_nr_l1.c @@ -172,7 +172,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){ gNB->pbch_configured=0; for (int i=0;i<number_dl_pdu;i++) { - volatile nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdu = &DL_req->dl_tti_pdu_list[i]; + nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdu = &DL_req->dl_tti_request_body.dl_tti_pdu_list[i]; LOG_D(PHY,"NFAPI: dl_pdu %d : type %d\n",i,dl_tti_pdu->PDUType); switch (dl_tti_pdu->PDUType) { case NFAPI_NR_DL_TTI_SSB_PDU_TYPE: @@ -241,12 +241,12 @@ if(nfapi_mode != 2) if (nfapi_mode != 0) - { if(Sched_INFO->DL_req->nPDUs > 0) - { + { if(Sched_INFO->DL_req->dl_tti_request_body.nPDUs>0) + { Sched_INFO->DL_req->SFN = frame; Sched_INFO->DL_req->Slot = slot; oai_nfapi_nr_dl_config_req(Sched_INFO->DL_req); - } + } if (Sched_INFO->TX_req->Number_of_PDUs > 0) { oai_nfapi_tx_data_req(Sched_INFO->TX_req); diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 2d7c44c92d9..b0d765b7467 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1703,9 +1703,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gNB_id, runmode_t mode) -{ struct timespec curr_time; - clock_gettime(CLOCK_MONOTONIC,&curr_time); - //printf("Current time: %d.%d",curr_time.tv_sec,curr_time.tv_nsec); +{ int frame_rx = proc->frame_rx; int nr_tti_rx = proc->nr_tti_rx; int slot_pbch; @@ -1964,31 +1962,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, // deactivate dlsch once dlsch proc is done ue->dlsch_ra[gNB_id]->active = 0; - // #if UE_TIMING_TRACE - // start_meas(&ue->dlsch_procedures_stat[ue->current_thread_id[nr_tti_rx]]); - // #endif - - nr_ue_dlsch_procedures(ue, - proc, - eNB_id, - RA_PDSCH, - ue->dlsch_ra[eNB_id], - NULL, - &ue->dlsch_ra_errors[eNB_id], - mode); - - // #if UE_TIMING_TRACE - // stop_meas(&ue->dlsch_procedures_stat[ue->current_thread_id[nr_tti_rx]]); - #if DISABLE_LOG_X - printf("[SFN %d] Slot1: Pdsch Proc %5.2f\n", nr_tti_rx, ue->pdsch_procedures_stat[ue->current_thread_id[nr_tti_rx]].p_time/(cpuf*1000.0)); - printf("[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n", nr_tti_rx, ue->dlsch_procedures_stat[ue->current_thread_id[ nr_tti_rx]].p_time/(cpuf*1000.0)); - #else - LOG_D(PHY, "[SFN %d] Slot1: Pdsch Proc %5.2f\n", nr_tti_rx, ue->pdsch_procedures_stat[ue->current_thread_id[ nr_tti_rx]].p_time/(cpuf*1000.0)); - LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n", nr_tti_rx, ue->dlsch_procedures_stat[ue->current_thread_id[ nr_tti_rx]].p_time/(cpuf*1000.0)); - #endif - // #endif - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_RA, VCD_FUNCTION_OUT); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_RA, VCD_FUNCTION_OUT); } // do procedures for C-RNTI diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index a181bd0ccfb..0deb0be9100 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -60,12 +60,9 @@ #define inMicroS(a) (((double)(a))/(cpu_freq_GHz*1000.0)) #include "SIMULATION/LTE_PHY/common_sim.h" -<<<<<<< HEAD -======= #include <openair2/LAYER2/MAC/mac_vars.h> #include <openair2/RRC/LTE/rrc_vars.h> ->>>>>>> fork_develop_new //#define DEBUG_ULSIM LCHAN_DESC DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC; @@ -106,11 +103,6 @@ rrc_data_ind( { } -<<<<<<< HEAD -void pdcp_run (const protocol_ctxt_t *const ctxt_pP) { return;} -void nr_DRB_preconfiguration(void){} -int rrc_init_nr_global_param(void){return(0);} -======= int gtpv1u_create_s1u_tunnel( const instance_t instanceP, @@ -119,7 +111,6 @@ gtpv1u_create_s1u_tunnel( ) { return 0; } ->>>>>>> fork_develop_new int rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP( @@ -175,10 +166,7 @@ int main(int argc, char **argv) uint16_t N_RB_DL = 106, N_RB_UL = 106, mu = 1; double tx_gain=1.0; double N0=30; -<<<<<<< HEAD -======= NB_UE_INST = 1; ->>>>>>> fork_develop_new //unsigned char frame_type = 0; NR_DL_FRAME_PARMS *frame_parms; @@ -205,8 +193,6 @@ int main(int argc, char **argv) float effRate; //float eff_tp_check = 0.7; uint8_t snrRun; -<<<<<<< HEAD -======= int enable_ptrs = 0; int modify_dmrs = 0; @@ -214,7 +200,6 @@ int main(int argc, char **argv) int ptrs_arg[2] = {-1,-1};// Invalid values /* DMRS TYPE = dmrs_arg[0], Add Pos = dmrs_arg[1] */ int dmrs_arg[2] = {-1,-1};// Invalid values ->>>>>>> fork_develop_new UE_nr_rxtx_proc_t UE_proc; FILE *scg_fd=NULL; @@ -225,10 +210,7 @@ int main(int argc, char **argv) int pucch_tgt_snrx10 = 200; int ibwps=24; int ibwp_rboffset=41; -<<<<<<< HEAD -======= int params_from_file = 0; ->>>>>>> fork_develop_new if ( load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) == 0 ) { exit_fun("[NR_ULSIM] Error, configuration module init failed\n"); } @@ -236,11 +218,7 @@ int main(int argc, char **argv) //logInit(); randominit(0); -<<<<<<< HEAD - while ((c = getopt(argc, argv, "a:b:c:d:ef:g:h:i:j:kl:m:n:p:r:s:y:z:F:M:N:PR:S:L:G:H:")) != -1) { -======= while ((c = getopt(argc, argv, "a:b:c:d:ef:g:h:i:j:kl:m:n:p:r:s:y:z:F:G:H:M:N:PR:S:T:U:L:")) != -1) { ->>>>>>> fork_develop_new printf("handling optarg %c\n",c); switch (c) { @@ -418,48 +396,10 @@ int main(int argc, char **argv) } break; -<<<<<<< HEAD - - case 'M': - // SSB_positions = atoi(optarg); - break; - - case 'N': - // Nid_cell = atoi(optarg); - break; - - case 'R': - N_RB_DL = atoi(optarg); - N_RB_UL = N_RB_DL; - break; - - case 'S': - snr1 = atof(optarg); - snr1set = 1; - printf("Setting SNR1 to %f\n", snr1); - break; - - case 'P': - print_perf=1; - opp_enabled=1; - break; - - case 'L': - loglvl = atoi(optarg); - break; -======= ->>>>>>> fork_develop_new case 'G': file_offset = atoi(optarg); break; -<<<<<<< HEAD - - case 'H': - slot = atoi(optarg); - break; - -======= case 'H': slot = atoi(optarg); @@ -511,7 +451,6 @@ int main(int argc, char **argv) params_from_file = 1; break; ->>>>>>> fork_develop_new default: case 'h': printf("%s -h(elp) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -n n_frames -t Delayspread -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant -i Intefrence0 -j Interference1 -A interpolation_file -C(alibration offset dB) -N CellId\n", argv[0]); @@ -533,11 +472,7 @@ int main(int argc, char **argv) printf("-A Interpolation_filname Run with Abstraction to generate Scatter plot using interpolation polynomial in file\n"); //printf("-C Generate Calibration information for Abstraction (effective SNR adjustment to remove Pe bias w.r.t. AWGN)\n"); printf("-F Input filename (.txt format) for RX conformance testing\n"); -<<<<<<< HEAD - printf("-G raw file containing RRC configuration (generated by gNB)\n"); -======= printf("-G Offset of samples to read from file (0 default)\n"); ->>>>>>> fork_develop_new printf("-M Multiple SSB positions in burst\n"); printf("-N Nid_cell\n"); printf("-O oversampling factor (1,2,4,8,16)\n"); @@ -545,12 +480,9 @@ int main(int argc, char **argv) printf("-t Acceptable effective throughput (in percentage)\n"); printf("-S Ending SNR, runs from SNR0 to SNR1\n"); printf("-P Print ULSCH performances\n"); -<<<<<<< HEAD -======= printf("-T Enable PTRS, arguments list L_PTRS{0,1,2} K_PTRS{2,4}, e.g. -T 2 0 2 \n"); printf("-U Change DMRS Config, arguments list DMRS TYPE{0=A,1=B} DMRS AddPos{0:3}, e.g. -U 2 0 2 \n"); printf("-Q If -F used, read parameters from file\n"); ->>>>>>> fork_develop_new exit(-1); break; @@ -750,8 +682,6 @@ int main(int argc, char **argv) uint16_t pdu_bit_map = PUSCH_PDU_BITMAP_PUSCH_DATA; // | PUSCH_PDU_BITMAP_PUSCH_PTRS; uint8_t max_rounds = 4; uint8_t crc_status = 0; -<<<<<<< HEAD -======= unsigned char mod_order = nr_get_Qm_ul(Imcs, 0); uint16_t code_rate = nr_get_code_rate_ul(Imcs, 0); @@ -793,20 +723,12 @@ int main(int argc, char **argv) for (i = 1; i < TBS/8; i++) { ulsch_input_buffer[i] = (unsigned char) rand(); } ->>>>>>> fork_develop_new uint8_t ptrs_time_density = get_L_ptrs(ptrs_mcs1, ptrs_mcs2, ptrs_mcs3, Imcs, mcs_table); uint8_t ptrs_freq_density = get_K_ptrs(n_rb0, n_rb1, nb_rb); int ptrs_symbols = 0; // to calculate total PTRS RE's in a slot -<<<<<<< HEAD - if (input_fd != NULL) max_rounds=1; - - if(1<<ptrs_time_density >= nb_symb_sch) - pdu_bit_map &= ~PUSCH_PDU_BITMAP_PUSCH_PTRS; // disable PUSCH PTRS -======= double ts = 1.0/(frame_parms->subcarrier_spacing * frame_parms->ofdm_symbol_size); ->>>>>>> fork_develop_new /* -T option enable PTRS */ if(enable_ptrs) @@ -834,10 +756,7 @@ int main(int argc, char **argv) //for (int i=0;i<16;i++) printf("%f\n",gaussdouble(0.0,1.0)); snrRun = 0; int n_errs = 0; -<<<<<<< HEAD -======= int read_errors=0; ->>>>>>> fork_develop_new int slot_offset = frame_parms->get_samples_slot_timestamp(slot,frame_parms,0); int slot_length = slot_offset - frame_parms->get_samples_slot_timestamp(slot-1,frame_parms,0); @@ -847,37 +766,6 @@ int main(int argc, char **argv) // 800 samples is N_TA_OFFSET for FR1 @ 30.72 Ms/s, AssertFatal(frame_parms->subcarrier_spacing==30000,"only 30 kHz for file input for now (%d)\n",frame_parms->subcarrier_spacing); -<<<<<<< HEAD - fseek(input_fd,file_offset*((slot_length<<2)+4000+16),SEEK_SET); - fread((void*)&n_rnti,sizeof(int16_t),1,input_fd); - printf("rnti %x\n",n_rnti); - fread((void*)&nb_rb,sizeof(int16_t),1,input_fd); - printf("nb_rb %d\n",nb_rb); - int16_t dummy; - fread((void*)&start_rb,sizeof(int16_t),1,input_fd); - //fread((void*)&dummy,sizeof(int16_t),1,input_fd); - printf("rb_start %d\n",start_rb); - fread((void*)&nb_symb_sch,sizeof(int16_t),1,input_fd); - //fread((void*)&dummy,sizeof(int16_t),1,input_fd); - printf("nb_symb_sch %d\n",nb_symb_sch); - fread((void*)&start_symbol,sizeof(int16_t),1,input_fd); - printf("start_symbol %d\n",start_symbol); - fread((void*)&Imcs,sizeof(int16_t),1,input_fd); - printf("mcs %d\n",Imcs); - fread((void*)&rv_index,sizeof(int16_t),1,input_fd); - printf("rv_index %d\n",rv_index); - // fread((void*)&harq_pid,sizeof(int16_t),1,input_fd); - fread((void*)&dummy,sizeof(int16_t),1,input_fd); - printf("harq_pid %d\n",harq_pid); - fread((void*)&gNB->common_vars.rxdata[0][slot_offset-delay], - sizeof(int16_t), - slot_length<<1, - input_fd); - for (int i=0;i<16;i+=2) printf("slot_offset %d : %d,%d\n", - slot_offset, - ((int16_t*)&gNB->common_vars.rxdata[0][slot_offset])[i], - ((int16_t*)&gNB->common_vars.rxdata[0][slot_offset])[1+i]); -======= if (params_from_file) { fseek(input_fd,file_offset*((slot_length<<2)+4000+16),SEEK_SET); read_errors+=fread((void*)&n_rnti,sizeof(int16_t),1,input_fd); @@ -911,7 +799,6 @@ int main(int argc, char **argv) slot_offset, ((int16_t*)&gNB->common_vars.rxdata[0][slot_offset])[i], ((int16_t*)&gNB->common_vars.rxdata[0][slot_offset])[1+i]); ->>>>>>> fork_develop_new } for (SNR = snr0; SNR < snr1; SNR += snr_step) { @@ -922,8 +809,6 @@ int main(int argc, char **argv) int n_errors[4] = {0,0,0,0};; int round_trials[4]={0,0,0,0}; uint32_t errors_scrambling[4] = {0,0,0,0}; -<<<<<<< HEAD -======= reset_meas(&gNB->phy_proc_rx); reset_meas(&gNB->rx_pusch_stats); reset_meas(&gNB->ulsch_decoding_stats); @@ -935,7 +820,6 @@ int main(int argc, char **argv) reset_meas(&gNB->ulsch_llr_stats); reset_meas(&gNB->ulsch_channel_compensation_stats); reset_meas(&gNB->ulsch_rbs_extraction_stats); ->>>>>>> fork_develop_new clear_pusch_stats(gNB); for (trial = 0; trial < n_trials; trial++) { @@ -949,21 +833,6 @@ int main(int argc, char **argv) ulsch_ue[0]->harq_processes[harq_pid]->round = round; gNB->ulsch[0][0]->harq_processes[harq_pid]->round = round; rv_index = nr_rv_round_map[round]; -<<<<<<< HEAD - reset_meas(&gNB->phy_proc_rx); - reset_meas(&gNB->rx_pusch_stats); - reset_meas(&gNB->ulsch_decoding_stats); - reset_meas(&gNB->ulsch_deinterleaving_stats); - reset_meas(&gNB->ulsch_rate_unmatching_stats); - reset_meas(&gNB->ulsch_ldpc_decoding_stats); - reset_meas(&gNB->ulsch_unscrambling_stats); - reset_meas(&gNB->ulsch_channel_estimation_stats); - reset_meas(&gNB->ulsch_llr_stats); - reset_meas(&gNB->ulsch_mrc_stats); - reset_meas(&gNB->ulsch_channel_compensation_stats); - reset_meas(&gNB->ulsch_rbs_extraction_stats); -======= ->>>>>>> fork_develop_new UE_proc.nr_tti_tx = slot; UE_proc.frame_tx = frame; @@ -994,10 +863,7 @@ int main(int argc, char **argv) pusch_pdu->bwp_size = abwp_size; } -<<<<<<< HEAD -======= pusch_pdu->pusch_data.tb_size = TBS/8; ->>>>>>> fork_develop_new pusch_pdu->pdu_bit_map = pdu_bit_map; pusch_pdu->rnti = n_rnti; pusch_pdu->mcs_index = Imcs; @@ -1008,11 +874,7 @@ int main(int argc, char **argv) pusch_pdu->data_scrambling_id = *scc->physCellId; pusch_pdu->nrOfLayers = 1; pusch_pdu->ul_dmrs_symb_pos = l_prime_mask << start_symbol; -<<<<<<< HEAD - pusch_pdu->dmrs_config_type = 0; -======= pusch_pdu->dmrs_config_type = dmrs_config_type; ->>>>>>> fork_develop_new pusch_pdu->ul_dmrs_scrambling_id = *scc->physCellId; pusch_pdu->scid = 0; pusch_pdu->dmrs_ports = 1; @@ -1045,10 +907,6 @@ int main(int argc, char **argv) scheduled_response.slot = slot; scheduled_response.dl_config = NULL; scheduled_response.ul_config = &ul_config; -<<<<<<< HEAD - scheduled_response.tx_request = (fapi_nr_tx_request_t *) malloc(sizeof(fapi_nr_tx_request_t)); - scheduled_response.tx_request->tx_request_body = (fapi_nr_tx_request_body_t *) malloc(sizeof(fapi_nr_tx_request_body_t)); -======= scheduled_response.tx_request = &tx_req; // Config UL TX PDU @@ -1059,7 +917,6 @@ int main(int argc, char **argv) tx_req.tx_request_body[0].pdu_length = TBS/8; tx_req.tx_request_body[0].pdu_index = 0; tx_req.tx_request_body[0].pdu = &ulsch_input_buffer[0]; ->>>>>>> fork_develop_new ul_config.slot = slot; ul_config.number_pdus = 1; @@ -1075,13 +932,7 @@ int main(int argc, char **argv) ul_config.ul_config_list[0].pusch_config_pdu.dmrs_config_type = dmrs_config_type; ul_config.ul_config_list[0].pusch_config_pdu.mcs_index = Imcs; ul_config.ul_config_list[0].pusch_config_pdu.mcs_table = mcs_table; -<<<<<<< HEAD - ul_config.ul_config_list[0].pusch_config_pdu.num_dmrs_cdm_grps_no_data = 1; - ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.new_data_indicator = trial & 0x1; - ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.rv_index = rv_index; -======= ul_config.ul_config_list[0].pusch_config_pdu.num_dmrs_cdm_grps_no_data = msg3_flag == 0 ? 1 : 2; ->>>>>>> fork_develop_new ul_config.ul_config_list[0].pusch_config_pdu.nrOfLayers = precod_nbr_layers; ul_config.ul_config_list[0].pusch_config_pdu.absolute_delta_PUSCH = 0; @@ -1094,26 +945,10 @@ int main(int argc, char **argv) ul_config.ul_config_list[0].pusch_config_pdu.pusch_ptrs.ptrs_freq_density = ptrs_freq_density; ul_config.ul_config_list[0].pusch_config_pdu.pusch_ptrs.ptrs_ports_list = (nfapi_nr_ue_ptrs_ports_t *) malloc(2*sizeof(nfapi_nr_ue_ptrs_ports_t)); ul_config.ul_config_list[0].pusch_config_pdu.pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset = 0; -<<<<<<< HEAD - //there are plenty of other parameters that we don't seem to be using for now. e.g. - ul_config.ul_config_list[0].pusch_config_pdu.absolute_delta_PUSCH = 0; - - nb_re_dmrs = ((ul_config.ul_config_list[0].pusch_config_pdu.dmrs_config_type == pusch_dmrs_type1) ? 6 : 4); - - available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, number_dmrs_symbols, mod_order, 1); - TBS = nr_compute_tbs(mod_order, code_rate, nb_rb, nb_symb_sch, nb_re_dmrs * number_dmrs_symbols, 0, 0, precod_nbr_layers); - pusch_pdu->pusch_data.tb_size = TBS>>3; - ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.tb_size = TBS; - - nr_fill_ulsch(gNB,frame,slot,pusch_pdu); - - for (int i=0;i<(TBS>>3);i++) ulsch_ue[0]->harq_processes[harq_pid]->a[i]=i&0xff; -======= nr_fill_ulsch(gNB,frame,slot,pusch_pdu); for (int i=0;i<(TBS/8);i++) ulsch_ue[0]->harq_processes[harq_pid]->a[i]=i&0xff; ->>>>>>> fork_develop_new double scale = 1; if (input_fd == NULL) { @@ -1172,12 +1007,6 @@ int main(int argc, char **argv) for (ap=0; ap<frame_parms->nb_antennas_rx; ap++) { ((int16_t*) &gNB->common_vars.rxdata[ap][slot_offset])[(2*i) + (delay*2)] = (int16_t)((tx_gain*r_re[ap][i]) + (sqrt(sigma/2)*gaussdouble(0.0,1.0))); // convert to fixed point ((int16_t*) &gNB->common_vars.rxdata[ap][slot_offset])[(2*i)+1 + (delay*2)] = (int16_t)((tx_gain*r_im[ap][i]) + (sqrt(sigma/2)*gaussdouble(0.0,1.0))); -<<<<<<< HEAD - } - } - - } -======= /* Add phase noise if enabled */ if (pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) { phase_noise(ts, &((int16_t*)&gNB->common_vars.rxdata[ap][slot_offset])[(2*i)], @@ -1187,7 +1016,6 @@ int main(int argc, char **argv) } } ->>>>>>> fork_develop_new //////////////////////////////////////////////////////////// @@ -1242,114 +1070,10 @@ int main(int argc, char **argv) } if(n_trials==1) printf("end of round %d rv_index %d\n",round, rv_index); -<<<<<<< HEAD - for (i = 0; i < available_bits; i++) { - - if(((ulsch_ue[0]->g[i] == 0) && (gNB->pusch_vars[UE_id]->llr[i] <= 0)) || - ((ulsch_ue[0]->g[i] == 1) && (gNB->pusch_vars[UE_id]->llr[i] >= 0))) - { - /*if(errors_scrambling == 0) - printf("\x1B[34m" "[frame %d][trial %d]\t1st bit in error in unscrambling = %d\n" "\x1B[0m", frame, trial, i);*/ - errors_scrambling[round]++; - } - } - round++; - - } // round - -======= ->>>>>>> fork_develop_new //---------------------------------------------------------- //----------------- count and print errors ----------------- //---------------------------------------------------------- -<<<<<<< HEAD - - - if (n_trials == 1 && errors_scrambling[0] > 0) { - printf("\x1B[31m""[frame %d][trial %d]\tnumber of errors in unscrambling = %u\n" "\x1B[0m", frame, trial, errors_scrambling[0]); - } - - for (i = 0; i < TBS; i++) { - - estimated_output_bit[i] = (ulsch_gNB->harq_processes[harq_pid]->b[i/8] & (1 << (i & 7))) >> (i & 7); - test_input_bit[i] = (ulsch_ue[0]->harq_processes[harq_pid]->b[i/8] & (1 << (i & 7))) >> (i & 7); - - if (estimated_output_bit[i] != test_input_bit[i]) { - /*if(errors_decoding == 0) - printf("\x1B[34m""[frame %d][trial %d]\t1st bit in error in decoding = %d\n" "\x1B[0m", frame, trial, i);*/ - errors_decoding++; - } - } - if (n_trials == 1) { - for (int r=0;r<ulsch_ue[0]->harq_processes[harq_pid]->C;r++) - for (int i=0;i<ulsch_ue[0]->harq_processes[harq_pid]->K>>3;i++) { - /*if ((ulsch_ue[0]->harq_processes[harq_pid]->c[r][i]^ulsch_gNB->harq_processes[harq_pid]->c[r][i]) != 0) printf("************"); - printf("r %d: in[%d] %x, out[%d] %x (%x)\n",r, - i,ulsch_ue[0]->harq_processes[harq_pid]->c[r][i], - i,ulsch_gNB->harq_processes[harq_pid]->c[r][i], - ulsch_ue[0]->harq_processes[harq_pid]->c[r][i]^ulsch_gNB->harq_processes[harq_pid]->c[r][i]);*/ - } - } - if (errors_decoding > 0 && error_flag == 0) { - n_false_positive++; - if (n_trials==1) - printf("\x1B[31m""[frame %d][trial %d]\tnumber of errors in decoding = %u\n" "\x1B[0m", frame, trial, errors_decoding); - } - roundStats[snrRun] += ((float)round); - if (!crc_status) effRate += ((float)TBS)/round; - } // trial loop - - roundStats[snrRun]/=((float)n_trials); - effRate /= n_trials; - - printf("*****************************************\n"); - printf("SNR %f: n_errors (%d/%d,%d/%d,%d/%d,%d/%d) (negative CRC), false_positive %d/%d, errors_scrambling (%u/%u,%u/%u,%u/%u,%u/%u\n", SNR, n_errors[0], round_trials[0],n_errors[1], round_trials[1],n_errors[2], round_trials[2],n_errors[3], round_trials[3], n_false_positive, n_trials, errors_scrambling[0],available_bits*n_trials,errors_scrambling[1],available_bits*n_trials,errors_scrambling[2],available_bits*n_trials,errors_scrambling[3],available_bits*n_trials); - printf("\n"); - printf("SNR %f: Channel BLER (%e,%e,%e,%e), Channel BER (%e,%e,%e,%e) Avg round %.2f, Eff Rate %.4f bits/slot, Eff Throughput %.2f, TBS %u bits/slot\n", - SNR, - (double)n_errors[0]/round_trials[0], - (double)n_errors[1]/round_trials[0], - (double)n_errors[2]/round_trials[0], - (double)n_errors[3]/round_trials[0], - (double)errors_scrambling[0]/available_bits/round_trials[0], - (double)errors_scrambling[1]/available_bits/round_trials[0], - (double)errors_scrambling[2]/available_bits/round_trials[0], - (double)errors_scrambling[3]/available_bits/round_trials[0], - roundStats[snrRun],effRate,effRate/TBS*100,TBS); - - dump_pusch_stats(gNB); - - printf("*****************************************\n"); - printf("\n"); - - if (print_perf==1) { - printDistribution(&gNB->phy_proc_rx,table_rx,"Total PHY proc rx"); - printStatIndent(&gNB->rx_pusch_stats,"RX PUSCH time"); - printStatIndent2(&gNB->ulsch_channel_estimation_stats,"ULSCH channel estimation time"); - printStatIndent2(&gNB->ulsch_rbs_extraction_stats,"ULSCH rbs extraction time"); - printStatIndent2(&gNB->ulsch_channel_compensation_stats,"ULSCH channel compensation time"); - printStatIndent2(&gNB->ulsch_mrc_stats,"ULSCH mrc computation"); - printStatIndent2(&gNB->ulsch_llr_stats,"ULSCH llr computation"); - printStatIndent(&gNB->ulsch_unscrambling_stats,"ULSCH unscrambling"); - printStatIndent(&gNB->ulsch_decoding_stats,"ULSCH total decoding time"); - printStatIndent2(&gNB->ulsch_deinterleaving_stats,"ULSCH deinterleaving"); - printStatIndent2(&gNB->ulsch_rate_unmatching_stats,"ULSCH rate matching rx"); - printStatIndent2(&gNB->ulsch_ldpc_decoding_stats,"ULSCH ldpc decoding"); - printf("\n"); - } - - if(n_trials==1) - break; - - if ((float)n_errors[0]/(float)n_trials <= target_error_rate) { - printf("*************\n"); - printf("PUSCH test OK\n"); - printf("*************\n"); - break; - } - -======= if ((pusch_pdu->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) && (SNR==snr0) && (trial==0) && (round==0)) { ptrs_symbols = 0; for (int i = pusch_pdu->start_symbol_index; i < pusch_pdu->start_symbol_index + pusch_pdu->nr_of_symbols; i++){ @@ -1458,7 +1182,6 @@ int main(int argc, char **argv) break; } ->>>>>>> fork_develop_new snrRun++; n_errs = n_errors[0]; } // SNR loop diff --git a/openair2/LAYER2/MAC/slicing/slicing.c b/openair2/LAYER2/MAC/slicing/slicing.c index ab96aa351ee..48dd99afebb 100644 --- a/openair2/LAYER2/MAC/slicing/slicing.c +++ b/openair2/LAYER2/MAC/slicing/slicing.c @@ -336,11 +336,8 @@ void static_dl(module_id_t mod_id, rbgalloc_slice_mask[rbg] = rbgalloc_mask[rbg]; n_rbg_sched += rbgalloc_mask[rbg]; } -<<<<<<< HEAD -======= if (n_rbg_sched == 0) /* no free RBGs, e.g., taken by RA */ continue; ->>>>>>> fork_develop_new s->s[i]->dl_algo.run(mod_id, CC_id, @@ -450,11 +447,8 @@ void static_ul(module_id_t mod_id, } if (!last_rb_blocked) rbs[n_contig - 1].length = p->posHigh - rbs[n_contig - 1].start + 1; -<<<<<<< HEAD -======= if (n_contig == 1 && rbs[0].length == 0) /* no RBs, e.g., taken by RA */ continue; ->>>>>>> fork_develop_new s->s[i]->ul_algo.run(mod_id, CC_id, diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c index 9a5946498db..e85cc94a40c 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -2846,3 +2846,46 @@ int binomial(int n, int k) { return c; } +void get_band(uint64_t downlink_frequency, + uint16_t *current_band, + int32_t *current_offset, + lte_frame_type_t *current_type) +{ + int ind; + uint64_t center_frequency_khz; + uint64_t center_freq_diff_khz; + uint64_t dl_freq_khz = downlink_frequency/1000; + + center_freq_diff_khz = 999999999999999999; // 2^64 + *current_band = 0; + + for ( ind=0; + ind < sizeof(nr_bandtable) / sizeof(nr_bandtable[0]); + ind++) { + + LOG_I(PHY, "Scanning band %d, dl_min %"PRIu64", ul_min %"PRIu64"\n", nr_bandtable[ind].band, nr_bandtable[ind].dl_min,nr_bandtable[ind].ul_min); + + if ( nr_bandtable[ind].dl_min <= dl_freq_khz && nr_bandtable[ind].dl_max >= dl_freq_khz ) { + + center_frequency_khz = (nr_bandtable[ind].dl_max + nr_bandtable[ind].dl_min)/2; + if (abs(dl_freq_khz - center_frequency_khz) < center_freq_diff_khz){ + *current_band = nr_bandtable[ind].band; + *current_offset = (nr_bandtable[ind].ul_min - nr_bandtable[ind].dl_min)*1000; + center_freq_diff_khz = abs(dl_freq_khz - center_frequency_khz); + + if (*current_offset == 0) + *current_type = TDD; + else + *current_type = FDD; + } + } + } + + LOG_I( PHY, "DL frequency %"PRIu64": band %d, frame_type %d, UL frequency %"PRIu64"\n", + downlink_frequency, *current_band, *current_type, downlink_frequency+*current_offset); + + AssertFatal(*current_band != 0, + "Can't find EUTRA band for frequency %lu\n", downlink_frequency); +} + + diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h index a5e38bf128e..f66fbc8fd1e 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h @@ -36,6 +36,36 @@ #include "NR_CellGroupConfig.h" #include "nr_mac.h" + +// =============================================== +// SSB to RO mapping public defines and structures +// =============================================== +#define MAX_SSB_PER_RO (16) // Maximum number of SSBs that can be mapped to a single RO +#define MAX_TDM (7) // Maximum nb of PRACH occasions TDMed in a slot +#define MAX_FDM (8) // Maximum nb of PRACH occasions FDMed in a slot + +// PRACH occasion details +typedef struct prach_occasion_info { + uint8_t start_symbol; // 0 - 13 (14 symbols in a slot) + uint8_t fdm; // 0-7 (possible values of msg1-FDM: 1, 2, 4 or 8) + uint8_t slot; // 0 - 159 (maximum number of slots in a 10ms frame - @ 240kHz) + uint8_t frame; // 0 - 15 (maximum number of frames in a 160ms association pattern) + uint8_t mapped_ssb_idx[MAX_SSB_PER_RO]; // List of mapped SSBs + uint8_t nb_mapped_ssb; + uint16_t format; // RO preamble format +} prach_occasion_info_t; + +// PRACH occasion slot details +// A PRACH occasion slot is a series of PRACH occasions in time (symbols) and frequency +typedef struct prach_occasion_slot { + prach_occasion_info_t prach_occasion[MAX_TDM][MAX_FDM]; // Starting symbol of each PRACH occasions in a slot + uint8_t nb_of_prach_occasion_in_time; + uint8_t nb_of_prach_occasion_in_freq; +} prach_occasion_slot_t; + +// ======================================== + + typedef enum { NR_DL_DCI_FORMAT_1_0 = 0, NR_DL_DCI_FORMAT_1_1, @@ -60,12 +90,15 @@ typedef enum { NR_RNTI_INT, NR_RNTI_TPC_PUSCH, NR_RNTI_TPC_PUCCH, - NR_RNTI_TPC_SRS + NR_RNTI_TPC_SRS, + NR_RNTI_MCS_C, } nr_rnti_type_t; uint16_t config_bandwidth(int mu, int nb_rb, int nr_band); -void get_band(uint64_t downlink_frequency, uint16_t *current_band, int32_t *current_offset, lte_frame_type_t *current_type); +void get_frame_type(uint16_t nr_bandP, uint8_t scs_index, lte_frame_type_t *current_type); + +void get_delta_duplex(int nr_bandP, uint8_t scs_index, int32_t *delta_duplex); uint64_t from_nrarfcn(int nr_bandP, uint8_t scs_index, uint32_t dl_nrarfcn); @@ -98,7 +131,31 @@ int get_nr_prach_info_from_index(uint8_t index, uint16_t *format, uint8_t *start_symbol, uint8_t *N_t_slot, - uint8_t *N_dur); + uint8_t *N_dur, + uint16_t *RA_sfn_index, + uint8_t *N_RA_slot, + uint8_t *config_period); + +int get_nr_prach_occasion_info_from_index(uint8_t index, + uint32_t pointa, + uint8_t mu, + uint8_t unpaired, + uint16_t *format, + uint8_t *start_symbol, + uint8_t *N_t_slot, + uint8_t *N_dur, + uint8_t *N_RA_slot, + uint16_t *N_RA_sfn, + uint8_t *max_association_period); + +uint8_t get_nr_prach_duration(uint8_t prach_format); + +uint8_t get_pusch_mcs_table(long *mcs_Table, + int is_tp, + int dci_format, + int rnti_type, + int target_ss, + bool config_grant); uint8_t compute_nr_root_seq(NR_RACH_ConfigCommon_t *rach_config, uint8_t nb_preambles, @@ -108,6 +165,10 @@ int ul_ant_bits(NR_DMRS_UplinkConfig_t *NR_DMRS_UplinkConfig,long transformPreco int get_format0(uint8_t index, uint8_t unpaired); +int64_t *get_prach_config_info(uint32_t pointa, + uint8_t index, + uint8_t unpaired); + uint16_t get_NCS(uint8_t index, uint16_t format, uint8_t restricted_set_config); int get_num_dmrs(uint16_t dmrs_mask ); @@ -117,4 +178,6 @@ int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmr uint8_t get_L_ptrs(uint8_t mcs1, uint8_t mcs2, uint8_t mcs3, uint8_t I_mcs, uint8_t mcs_table); uint8_t get_K_ptrs(uint16_t nrb0, uint16_t nrb1, uint16_t N_RB); +int16_t get_N_RA_RB (int delta_f_RA_PRACH,int delta_f_PUSCH); +void get_band(uint64_t downlink_frequency, uint16_t *current_band, int32_t *current_offset, lte_frame_type_t *current_type); #endif diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 42de3ff6707..a22291092bd 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -987,19 +987,18 @@ int8_t nr_ue_decode_mib(module_id_t module_id, } } -//#ifdef DEBUG_MIB - LOG_I(MAC,"system frame number(6 MSB bits): %d\n", frame); - LOG_I(MAC,"Unused bits: %d\n", mac->mib->systemFrameNumber.bits_unused); - // LOG_I(MAC,"system frame number(with LSB): %d\n", (int)frame); - // LOG_I(MAC,"subcarrier spacing (0=15or60, 1=30or120): %d\n", (int)mac->mib->subCarrierSpacingCommon); - // LOG_I(MAC,"ssb carrier offset(with MSB): %d\n", (int)ssb_subcarrier_offset); - // LOG_I(MAC,"dmrs type A position (0=pos2,1=pos3): %d\n", (int)mac->mib->dmrs_TypeA_Position); - // LOG_I(MAC,"pdcch config sib1: %d\n", (int)mac->mib->pdcch_ConfigSIB1); - // LOG_I(MAC,"cell barred (0=barred,1=notBarred): %d\n", (int)mac->mib->cellBarred); - // LOG_I(MAC,"intra frequency reselection (0=allowed,1=notAllowed): %d\n", (int)mac->mib->intraFreqReselection); -// LOG_I(MAC,"half frame bit(extra bits): %d\n", (int)half_frame_bit); -// LOG_I(MAC,"ssb index(extra bits): %d\n", (int)ssb_index); -// //#endif +#ifdef DEBUG_MIB + LOG_I(MAC,"system frame number(6 MSB bits): %d\n", mac->mib->systemFrameNumber.buf[0]); + LOG_I(MAC,"system frame number(with LSB): %d\n", (int)frame); + LOG_I(MAC,"subcarrier spacing (0=15or60, 1=30or120): %d\n", (int)mac->mib->subCarrierSpacingCommon); + LOG_I(MAC,"ssb carrier offset(with MSB): %d\n", (int)ssb_subcarrier_offset); + LOG_I(MAC,"dmrs type A position (0=pos2,1=pos3): %d\n", (int)mac->mib->dmrs_TypeA_Position); + LOG_I(MAC,"pdcch config sib1: %d\n", (int)mac->mib->pdcch_ConfigSIB1); + LOG_I(MAC,"cell barred (0=barred,1=notBarred): %d\n", (int)mac->mib->cellBarred); + LOG_I(MAC,"intra frequency reselection (0=allowed,1=notAllowed): %d\n", (int)mac->mib->intraFreqReselection); + LOG_I(MAC,"half frame bit(extra bits): %d\n", (int)half_frame_bit); + LOG_I(MAC,"ssb index(extra bits): %d\n", (int)ssb_index); +#endif subcarrier_spacing_t scs_ssb = scs_30kHz; // default for //const uint32_t scs_index = 0; @@ -4089,7 +4088,6 @@ int nr_extract_dci_info(NR_UE_MAC_INST_t *mac, case NR_DL_DCI_FORMAT_1_0: switch(rnti_type) { case NR_RNTI_RA: - N_RB = NRRIV2BW(mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, 275); // TBR hotfix // Freq domain assignment fsize = (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) ); pos=fsize; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 5e9c1e81122..a25e525c344 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -104,8 +104,8 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB, DL_req[CC_idP].SFN = frameP; DL_req[CC_idP].Slot = slotP; - DL_req[CC_idP].nPDUs = 0; - DL_req[CC_idP].nGroup = 0; + DL_req[CC_idP].dl_tti_request_body.nPDUs = 0; + DL_req[CC_idP].dl_tti_request_body.nGroup = 0; //DL_req[CC_idP].dl_tti_request_body.transmission_power_pcfich = 6000; UL_dci_req[CC_idP].SFN = frameP; @@ -468,6 +468,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, } const uint64_t dlsch_in_slot_bitmap = (1 << 1) | (1 << 2); + //const uint64_t dlsch_in_slot_bitmap = (1 << 2); const uint64_t ulsch_in_slot_bitmap = (1 << 8); memset(RC.nrmac[module_idP]->cce_list[bwp_id][0],0,MAX_NUM_CCE*sizeof(int)); // coreset0 diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index cb940ed033e..92af24a04de 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -62,7 +62,7 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP, NR_COMMON_channels_t *cc; nfapi_nr_dl_tti_request_t *dl_tti_request; - + nfapi_nr_dl_tti_request_body_t *dl_req; nfapi_nr_dl_tti_request_pdu_t *dl_config_pdu; int mib_sdu_length; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 59cd60c402d..1acde851da2 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -67,7 +67,7 @@ int nr_generate_dlsch_pdu(module_id_t module_idP, unsigned char drx_cmd, unsigned char *ue_cont_res_id, unsigned short post_padding) { - gNB_MAC_INST *gNB = RC.nrmac[module_idP]; + gNB_MAC_INST *gNB = RC.nrmac[module_idP]; NR_MAC_SUBHEADER_FIXED *mac_pdu_ptr = (NR_MAC_SUBHEADER_FIXED *) mac_pdu; unsigned char *dlsch_buffer_ptr = sdus_payload; uint8_t last_size = 0; @@ -75,12 +75,6 @@ int nr_generate_dlsch_pdu(module_id_t module_idP, // MAC CEs uint8_t mac_header_control_elements[16], *ce_ptr; ce_ptr = &mac_header_control_elements[0]; - uint16_t UE_id = 0; //TODO need to get as a function parameter or need to invoke api to UE_id using module Id and RNTI - gNB_MAC_INST *gNB_mac = RC.nrmac[module_idP]; - NR_UE_list_t *UE_list = &gNB_mac->UE_list; - NR_UE_sched_ctrl_t *ue_sched_ctl = NULL; - //NR_CellGroupConfig_t *config = UE_list->secondaryCellGroup[UE_id]; - ue_sched_ctl = &(UE_list->UE_sched_ctrl[UE_id]); // 1) Compute MAC CE and related subheaders @@ -332,8 +326,6 @@ int nr_generate_dlsch_pdu(module_id_t module_idP, memcpy((void *) mac_pdu_ptr, (void *) dlsch_buffer_ptr, sdu_lengths[i]); dlsch_buffer_ptr += sdu_lengths[i]; mac_pdu_ptr += sdu_lengths[i]; - - mac_stats->lc_bytes_tx[sdu_lcids[i]] += sdu_lengths[i]; } // 4) Compute final offset for padding @@ -788,7 +780,8 @@ void nr_schedule_ue_spec(module_id_t module_id, LOG_D(MAC, "Configuring DL_TX in %d.%d: random data\n", frame, slot); // fill dlsch_buffer with random data for (int i = 0; i < TBS; i++) - mac_sdus[i] = (unsigned char) (lrand48()&0xff); + mac_sdus[i] = (unsigned char) (lrand48()&0xff); + sdu_lcids[0] = 0x3f; // DRB sdu_lengths[0] = TBS - ta_len - 3; header_length_total += 2 + (sdu_lengths[0] >= 128); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index e2ca3c04998..2727fe24dbf 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -95,12 +95,12 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP, dlBWP_carrier_bandwidth, NRRIV2PRBOFFSET(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth,275)); - dl_tti_pdcch_pdu = &nr_mac->DL_req[CC_id].dl_tti_pdu_list[nr_mac->DL_req[CC_id].nPDUs]; + dl_tti_pdcch_pdu = &nr_mac->DL_req[CC_id].dl_tti_request_body.dl_tti_pdu_list[nr_mac->DL_req[CC_id].dl_tti_request_body.nPDUs]; memset((void*)dl_tti_pdcch_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t)); dl_tti_pdcch_pdu->PDUType = NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE; dl_tti_pdcch_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_pdcch_pdu)); - dl_tti_pdsch_pdu = &nr_mac->DL_req[CC_id].dl_tti_pdu_list[nr_mac->DL_req[CC_id].nPDUs+1]; + dl_tti_pdsch_pdu = &nr_mac->DL_req[CC_id].dl_tti_request_body.dl_tti_pdu_list[nr_mac->DL_req[CC_id].dl_tti_request_body.nPDUs+1]; memset((void *)dl_tti_pdsch_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t)); dl_tti_pdsch_pdu->PDUType = NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE; dl_tti_pdsch_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_pdsch_pdu)); @@ -235,7 +235,7 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP, pdsch_pdu_rel15->mcsIndex[0]); */ - nr_mac->DL_req[CC_id].nPDUs+=2; + nr_mac->DL_req[CC_id].dl_tti_request_body.nPDUs+=2; TX_req = &nr_mac->TX_req[CC_id].pdu_list[nr_mac->TX_req[CC_id].Number_of_PDUs]; TX_req->PDU_length = 6; @@ -255,7 +255,7 @@ void nr_preprocessor_phytest(module_id_t module_id, sub_frame_t slot, int num_slots_per_tdd) { - if (slot != 1) + if (slot != 2) return; /* only schedule in slot 1 for now */ NR_UE_info_t *UE_info = &RC.nrmac[module_id]->UE_info; const int UE_id = 0; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index cac1687343e..1415b7556e9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -1866,17 +1866,6 @@ uint8_t nr_get_tpc(int target, uint8_t cqi, int incr) { } -uint8_t nr_get_tpc(int target, uint8_t cqi, int incr) { - // al values passed to this function are x10 - - int snrx10 = (cqi*5) - 640; - if (snrx10 > target + incr) return 0; // decrease 1dB - if (snrx10 < target - incr) return 2; // increase 1dB - if (snrx10 < target - (3*incr)) return 3; // increase 3dB - return 1; // no change -} - - void get_pdsch_to_harq_feedback(int Mod_idP, int UE_id, NR_SearchSpace__searchSpaceType_PR ss_type, diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 234fa857baa..8e00bc09027 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -428,8 +428,6 @@ typedef struct { bool active[MAX_MOBILES_PER_GNB]; rnti_t rnti[MAX_MOBILES_PER_GNB]; - rnti_t tc_rnti[MAX_MOBILES_PER_GNB]; - NR_preamble_ue preambles[MAX_MOBILES_PER_GNB]; NR_CellGroupConfig_t *secondaryCellGroup[MAX_MOBILES_PER_GNB]; /// CCE indexing int Y[MAX_MOBILES_PER_GNB][3][160]; @@ -437,6 +435,7 @@ typedef struct { int num_pdcch_cand[MAX_MOBILES_PER_GNB][MAX_NUM_CORESET]; // UE selected beam index uint8_t UE_beam_index[MAX_MOBILES_PER_GNB]; + } NR_UE_info_t; typedef void (*nr_pp_impl_dl)(module_id_t mod_id, diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index f2f9b337ebe..4e1a8ae1310 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -264,7 +264,7 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) { LOG_D(PHY,"NR_Schedule_response: SFN_SF:%d%d dl_pdus:%d\n", sched_info->frame, sched_info->slot, - sched_info->DL_req->nPDUs); + sched_info->DL_req->dl_tti_request_body.nPDUs); } } } diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c index c8e8b51c191..61bce26b2c1 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c @@ -3243,10 +3243,6 @@ uint8_t do_UECapabilityEnquiry( const protocol_ctxt_t *const ctxt_pP, /* TODO: no hardcoded values here */ -<<<<<<< HEAD - OCTET_STRING_t req_freq; - unsigned char req_freq_buf[5] = { 0x00, 0x20, 0x1a, 0x02, 0x68 }; // bands 7 & nr78 -======= nsa_band_list = (NR_FreqBandList_t *)calloc(1, sizeof(NR_FreqBandList_t)); nsa_band = (NR_FreqBandInformation_t *) calloc(1,sizeof(NR_FreqBandInformation_t)); @@ -3277,7 +3273,6 @@ uint8_t do_UECapabilityEnquiry( const protocol_ctxt_t *const ctxt_pP, ->>>>>>> fork_develop_new //unsigned char req_freq_buf[5] = { 0x00, 0x20, 0x1a, 0x08, 0x18 }; // bands 7 & nr260 //unsigned char req_freq_buf[13] = { 0x00, 0xc0, 0x18, 0x01, 0x01, 0x30, 0x4b, 0x04, 0x0e, 0x08, 0x24, 0x04, 0xd0 }; @@ -3286,11 +3281,7 @@ uint8_t do_UECapabilityEnquiry( const protocol_ctxt_t *const ctxt_pP, // }; req_freq.buf = req_freq_buf; -<<<<<<< HEAD - req_freq.size = 5; -======= req_freq.size = (enc_rval.encoded+7)/8; ->>>>>>> fork_develop_new // req_freq.size = 21; r15_10.requestedFreqBandsNR_MRDC_r15 = &req_freq; @@ -3393,9 +3384,6 @@ uint8_t do_NR_UECapabilityEnquiry( const protocol_ctxt_t *const ctxt_pP, ASN_SEQUENCE_ADD(&nsa_band_list->list, nsa_band); OCTET_STRING_t req_freq; -<<<<<<< HEAD - unsigned char req_freq_buf[5] = { 0x00, 0x20, 0x1a, 0x02, 0x68 }; // bands 7 & nr78 -======= //unsigned char req_freq_buf[5] = { 0x00, 0x20, 0x1a, 0x02, 0x68 }; // bands 7 & nr78 unsigned char req_freq_buf[100]; enc_rval = uper_encode_to_buffer(&asn_DEF_NR_FreqBandList, @@ -3404,7 +3392,6 @@ uint8_t do_NR_UECapabilityEnquiry( const protocol_ctxt_t *const ctxt_pP, req_freq_buf, 1024); ->>>>>>> fork_develop_new //unsigned char req_freq_buf[5] = { 0x00, 0x20, 0x1a, 0x08, 0x18 }; // bands 7 & nr260 //unsigned char req_freq_buf[13] = { 0x00, 0xc0, 0x18, 0x01, 0x01, 0x30, 0x4b, 0x04, 0x0e, 0x08, 0x24, 0x04, 0xd0 }; @@ -3413,11 +3400,7 @@ uint8_t do_NR_UECapabilityEnquiry( const protocol_ctxt_t *const ctxt_pP, // }; req_freq.buf = req_freq_buf; -<<<<<<< HEAD - req_freq.size = 5; -======= req_freq.size = (enc_rval.encoded+7)/8; ->>>>>>> fork_develop_new // req_freq.size = 21; r15_10.requestedFreqBandsNR_MRDC_r15 = &req_freq; diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index 61c808b2904..d629ffe6048 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -1062,7 +1062,7 @@ void release_UE_in_freeList(module_id_t mod_id) { memset(&eNB_PHY->uci_vars[i],0,sizeof(LTE_eNB_UCI)); } } - */ + /* for (i=0; i<MAX_MOBILES_PER_ENB; i++) { diff --git a/targets/ARCH/ETHERNET/benetel/4g/benetel.c b/targets/ARCH/ETHERNET/benetel/4g/benetel.c index 0ee2741e279..76855111e11 100644 --- a/targets/ARCH/ETHERNET/benetel/4g/benetel.c +++ b/targets/ARCH/ETHERNET/benetel/4g/benetel.c @@ -207,11 +207,7 @@ next: uint16_t *in; uint16_t *out; in = (uint16_t *)s->buffers.prach[*subframe]; -<<<<<<< HEAD - out = (uint16_t *)ru->prach_rxsigF[antenna]; -======= out = (uint16_t *)ru->prach_rxsigF[0][antenna]; ->>>>>>> fork_develop_new for (i = 0; i < 840*2; i++) out[i] = ntohs(in[i]); s->buffers.prach_busy[*subframe] = 0; diff --git a/targets/ARCH/ETHERNET/benetel/4g/dpdk_driver.c b/targets/ARCH/ETHERNET/benetel/4g/dpdk_driver.c index ea009089147..42953d1d4a8 100644 --- a/targets/ARCH/ETHERNET/benetel/4g/dpdk_driver.c +++ b/targets/ARCH/ETHERNET/benetel/4g/dpdk_driver.c @@ -86,16 +86,9 @@ static struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS]; static struct rte_eth_conf port_conf = { .rxmode = { .split_hdr_size = 0, -<<<<<<< HEAD - .offloads = DEV_RX_OFFLOAD_CRC_STRIP, - .offloads = DEV_RX_OFFLOAD_JUMBO_FRAME, - .split_hdr_size = 0, - .max_rx_pkt_len = 9500, -======= .offloads = DEV_RX_OFFLOAD_JUMBO_FRAME, .split_hdr_size = 0, .max_rx_pkt_len = 9500, ->>>>>>> fork_develop_new }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, diff --git a/targets/ARCH/ETHERNET/benetel/5g/benetel.c b/targets/ARCH/ETHERNET/benetel/5g/benetel.c index c3cd2964009..72ecff6b342 100644 --- a/targets/ARCH/ETHERNET/benetel/5g/benetel.c +++ b/targets/ARCH/ETHERNET/benetel/5g/benetel.c @@ -215,11 +215,7 @@ next: uint16_t *in; uint16_t *out; in = (uint16_t *)s->buffers.prach[*slot]; -<<<<<<< HEAD - out = (uint16_t *)ru->prach_rxsigF[antenna]; -======= out = (uint16_t *)ru->prach_rxsigF[0][antenna]; ->>>>>>> fork_develop_new for (i = 0; i < 839*2; i++) out[i] = ntohs(in[i]); s->buffers.prach_busy[*slot] = 0; @@ -279,10 +275,6 @@ void benetel_fh_if4p5_south_out(RU_t *ru, int slot, uint64_t timestamp) { -<<<<<<< HEAD -======= - ->>>>>>> fork_develop_new //printf("XXX benetel_fh_if4p5_south_out %d %d %ld\n", frame, slot, timestamp); benetel_eth_state_t *s = ru->ifdevice.priv; NR_DL_FRAME_PARMS *fp; diff --git a/targets/ARCH/ETHERNET/benetel/5g/dpdk_driver.c b/targets/ARCH/ETHERNET/benetel/5g/dpdk_driver.c index bab3a88828c..dd50603ec54 100644 --- a/targets/ARCH/ETHERNET/benetel/5g/dpdk_driver.c +++ b/targets/ARCH/ETHERNET/benetel/5g/dpdk_driver.c @@ -86,16 +86,9 @@ static struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS]; static struct rte_eth_conf port_conf = { .rxmode = { .split_hdr_size = 0, -<<<<<<< HEAD - .offloads = DEV_RX_OFFLOAD_CRC_STRIP, - .offloads = DEV_RX_OFFLOAD_JUMBO_FRAME, - .split_hdr_size = 0, - .max_rx_pkt_len = 9500, -======= .offloads = DEV_RX_OFFLOAD_JUMBO_FRAME, .split_hdr_size = 0, .max_rx_pkt_len = 9500, ->>>>>>> fork_develop_new }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, @@ -240,11 +233,7 @@ l2fwd_simple_forward(struct rte_mbuf *m, unsigned portid, benetel_t *bs) } // Trigger start send DL packets -<<<<<<< HEAD - if(PAYLOAD_1 == 0x13 && PAYLOAD_2 == 0xe4 && SYMBOL == 0x46 && ANT_NUM == 0x00 && SUBFRAME == 0x00 && dl_start == 0){ -======= if(PAYLOAD_1 == 0x13 && PAYLOAD_2 == 0xe4 && SYMBOL == 0x44 && ANT_NUM == 0x00 && SUBFRAME == 0x00 && dl_start == 0){ ->>>>>>> fork_develop_new printf("\nU-Plane Started\n"); printf("\n====================================================\n"); @@ -263,11 +252,7 @@ l2fwd_simple_forward(struct rte_mbuf *m, unsigned portid, benetel_t *bs) p.antenna = 0; memcpy(p.iq, IQ_ptr, 5088); store_ul(bs, &p); -<<<<<<< HEAD - //if (p.symbol==0) printf("store ul f.sl.sy %d.%d.%d\n", p.frame, p.slot, p.symbol); -======= // if (p.symbol==0) printf("store ul f.sl.sy %d.%d.%d\n", p.frame, p.slot, p.symbol); ->>>>>>> fork_develop_new } // U-PLANE UL ANT_0 PROCESSING @@ -282,11 +267,7 @@ l2fwd_simple_forward(struct rte_mbuf *m, unsigned portid, benetel_t *bs) int tx_frame = frame; int tx_subframe = subframe; int tx_slot = slot; -<<<<<<< HEAD - int tx_symbol = symbol + 8; -======= int tx_symbol = symbol + 10; ->>>>>>> fork_develop_new if (tx_symbol > 13) { tx_symbol -= 14; @@ -304,11 +285,7 @@ l2fwd_simple_forward(struct rte_mbuf *m, unsigned portid, benetel_t *bs) ANT_NUM = 0x00; // Mask the symbol bits from UL packet received and apply the shift. -<<<<<<< HEAD - SYMBOL = ((SYMBOL & 0b00111111) + 8) % 14; -======= SYMBOL = ((SYMBOL & 0b00111111) + 10) % 14; ->>>>>>> fork_develop_new ANT_NUM = 0x00; SUBFRAME = sf; @@ -329,10 +306,7 @@ l2fwd_simple_forward(struct rte_mbuf *m, unsigned portid, benetel_t *bs) memcpy(IQ_ptr, bs->buffers->dl[oai_slot] + tx_symbol * 1272*4, 1272*4); } -<<<<<<< HEAD -======= //printf("DL buffer f sf slot symbol %d %d %d %d (sf %d)\n", tx_frame, tx_subframe, tx_slot, tx_symbol, (int)sf); ->>>>>>> fork_develop_new bs->buffers->dl_busy[oai_slot] &= ~(1 << tx_symbol); unlock_dl_buffer(bs->buffers, oai_slot); @@ -345,11 +319,7 @@ l2fwd_simple_forward(struct rte_mbuf *m, unsigned portid, benetel_t *bs) { // Mask the symbol bits from UL packet received and apply the shift. -<<<<<<< HEAD - SYMBOL = ((SYMBOL & 0b00111111) + 8) % 14; -======= SYMBOL = ((SYMBOL & 0b00111111) +10) % 14; ->>>>>>> fork_develop_new ANT_NUM = 0x01; SUBFRAME = sf; @@ -378,17 +348,10 @@ l2fwd_simple_forward(struct rte_mbuf *m, unsigned portid, benetel_t *bs) else if(PAYLOAD_1 == 0x0d && PAYLOAD_2 == 0x28){ if (ANT_NUM == 0) { int subframe = SUBFRAME >> 4; -<<<<<<< HEAD - int slot = ((SUBFRAME & 0x0f) << 2) | ((SYMBOL >> 6) & 0x03); - if (subframe==9) { - //printf("store prach f.sf.sl %d.%d.%d %d\n", FRAME, subframe, slot, subframe * 2 + slot); - store_prach(bs, FRAME, slot /*subframe * 2 + slot*/, IQ_ptr); -======= //int slot = ((SUBFRAME & 0x0f) << 2) | ((SYMBOL >> 6) & 0x03); if (subframe==9) { //printf("store prach f.sf.sl %d.%d.%d %d\n", FRAME, subframe, slot, subframe * 2 + slot); store_prach(bs, FRAME, subframe * 2 + 1, IQ_ptr); ->>>>>>> fork_develop_new } } rte_pktmbuf_free(m); diff --git a/targets/ARCH/ETHERNET/benetel/5g/low.c b/targets/ARCH/ETHERNET/benetel/5g/low.c index f95f97d3133..52c9f24127c 100644 --- a/targets/ARCH/ETHERNET/benetel/5g/low.c +++ b/targets/ARCH/ETHERNET/benetel/5g/low.c @@ -27,8 +27,6 @@ void store_ul(benetel_t *bs, ul_packet_t *ul) { -<<<<<<< HEAD -======= #if 0 struct timespec t; static struct timespec old; @@ -37,20 +35,12 @@ printf("store_ul %d.%ld (%ld)\n", (int)(t.tv_sec % 60), t.tv_nsec, t.tv_nsec - o old = t; #endif ->>>>>>> fork_develop_new /* only antenna 0 for the moment */ if (ul->antenna != 0) return; if (ul->slot != bs->next_slot || ul->symbol != bs->next_symbol) { -<<<<<<< HEAD - printf("%s: fatal, expected frame.sl.symbol %d.%d.%d, got %d.%d.%d\n", - __FUNCTION__, - bs->expected_benetel_frame, bs->next_slot, bs->next_symbol, - ul->frame, ul->slot, ul->symbol); - exit(1); -======= printf("%s: error, expected frame.sl.symbol %d.%d.%d, got %d.%d.%d\n", __FUNCTION__, bs->expected_benetel_frame, bs->next_slot, bs->next_symbol, @@ -81,7 +71,6 @@ old = t; bs->expected_benetel_frame &= 255; } } ->>>>>>> fork_develop_new } lock_ul_buffer(bs->buffers, bs->next_slot); diff --git a/targets/ARCH/rfsimulator/simulator.c b/targets/ARCH/rfsimulator/simulator.c index b25ade95ace..c4760d8aee4 100644 --- a/targets/ARCH/rfsimulator/simulator.c +++ b/targets/ARCH/rfsimulator/simulator.c @@ -655,13 +655,8 @@ int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimestamp, vo for ( int i=0; i < t->tx_num_channels; i++) samplesVoid[i]=(void *)&v; -<<<<<<< HEAD - LOG_I(HW, "No samples Tx occured, so we send 1 sample to notify it: Tx:%lu, Rx:%lu\n", - t->lastWroteTS, t->nextTimestamp); -======= LOG_I(HW, "No samples Tx occured, so we send 1 sample to notify it: Tx:%lu, Rx:%lu\n", t->lastWroteTS, t->nextTimestamp); ->>>>>>> fork_develop_new rfsimulator_write_internal(t, t->nextTimestamp, samplesVoid, 1, t->tx_num_channels, 1, true); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf index 37f8b6b22d7..367c2ff5303 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf @@ -5,7 +5,7 @@ Asn1_verbosity = "none"; gNBs = ( { - ////////// Identification parameters: + ////////// Identification parameters: gNB_ID = 0xe00; cell_type = "CELL_MACRO_GNB"; @@ -33,10 +33,10 @@ gNBs = # downlinkConfigCommon #frequencyInfoDL # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP) - absoluteFrequencySSB = 633032; + absoluteFrequencySSB = 641032; dl_frequencyBand = 78; - # this is 3480 MHz - dl_absoluteFrequencyPointA = 632000; + # this is 3600 MHz + dl_absoluteFrequencyPointA = 640000; #scs-SpecificCarrierList dl_offstToCarrier = 0; # subcarrierSpacing @@ -45,8 +45,8 @@ gNBs = dl_carrierBandwidth = 106; #initialDownlinkBWP #genericParameters - # this is RBstart=0,L=50 (275*(L-1))+RBstart - initialDLBWPlocationAndBandwidth = 13475; + # this is RBstart=41,L=24 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 6366; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialDLBWPsubcarrierSpacing = 1; @@ -59,7 +59,7 @@ gNBs = #initialULBWPmappingType #0=typeA,1=typeB initialDLBWPmappingType_0 = 0; - #this is SS=2,L=3 + #this is SS=1,L=13 initialDLBWPstartSymbolAndLength_0 = 40; initialDLBWPk0_1 = 0; @@ -71,6 +71,12 @@ gNBs = initialDLBWPmappingType_2 = 0; #this is SS=1,L=12 initialDLBWPstartSymbolAndLength_2 = 54; + + initialDLBWPk0_3 = 0; + initialDLBWPmappingType_3 = 0; + #this is SS=1,L=5 + initialDLBWPstartSymbolAndLength_3 = 57; + #uplinkConfigCommon #frequencyInfoUL ul_frequencyBand = 78; @@ -83,7 +89,7 @@ gNBs = pMax = 20; #initialUplinkBWP #genericParameters - initialULBWPlocationAndBandwidth = 13475; + initialULBWPlocationAndBandwidth = 6366; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialULBWPsubcarrierSpacing = 1; @@ -105,8 +111,8 @@ gNBs = #1,2,4,8,10,20,40,80 ra_ResponseWindow = 4; #ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR -#0=oneeighth,1=onefourth,2=half,3=one,4=two,5=four,6=eight,7=sixteen - ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 3; +#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4; #oneHalf (0..15) 4,8,12,16,...60,64 ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15; #ra_ContentionResolutionTimer @@ -114,27 +120,31 @@ gNBs = ra_ContentionResolutionTimer = 7; rsrp_ThresholdSSB = 19; #prach-RootSequenceIndex_PR -#0 = 839, 1 = 139 - prach_RootSequenceIndex_PR = 1; +#1 = 839, 2 = 139 + prach_RootSequenceIndex_PR = 2; prach_RootSequenceIndex = 1; # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex # msg1_SubcarrierSpacing = 1, - # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; + initialULBWPk2_0 = 6; initialULBWPmappingType_0 = 1 # this is SS=0 L=11 initialULBWPstartSymbolAndLength_0 = 55; - - initialULBWPk2_1 = 2; + + initialULBWPk2_1 = 6; initialULBWPmappingType_1 = 1; # this is SS=0 L=12 initialULBWPstartSymbolAndLength_1 = 69; + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; @@ -148,7 +158,7 @@ gNBs = # ssb_PositionsInBurs_BitmapPR # 1=short, 2=medium, 3=long ssb_PositionsInBurst_PR = 2; - ssb_PositionsInBurst_Bitmap = 255; + ssb_PositionsInBurst_Bitmap = 1; # ssb_periodicityServingCell # 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 @@ -179,6 +189,7 @@ gNBs = ssPBCH_BlockPower = 10; } + ); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf index 4b4db271f32..fd1b62fd3dc 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf @@ -214,11 +214,8 @@ gNBs = enable_x2 = "yes"; t_reloc_prep = 1000; /* unit: millisecond */ tx2_reloc_overall = 2000; /* unit: millisecond */ -<<<<<<< HEAD -======= t_dc_prep = 1000; /* unit: millisecond */ t_dc_overall = 2000; /* unit: millisecond */ ->>>>>>> fork_develop_new target_enb_x2_ip_address = ( { ipv4 = "192.168.18.199"; ipv6 = "192:168:30::17"; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf index 0377a8693c8..6a3f008ec1a 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf @@ -212,11 +212,8 @@ gNBs = enable_x2 = "yes"; t_reloc_prep = 1000; /* unit: millisecond */ tx2_reloc_overall = 2000; /* unit: millisecond */ -<<<<<<< HEAD -======= t_dc_prep = 1000; /* unit: millisecond */ t_dc_overall = 2000; /* unit: millisecond */ ->>>>>>> fork_develop_new target_enb_x2_ip_address = ( { ipv4 = "192.168.18.199"; ipv6 = "192:168:30::17"; diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index b0966e419c4..14f82c37a4f 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -593,16 +593,17 @@ int main ( int argc, char **argv ) RC.nb_L1_inst, RC.nb_RU, get_nprocs()); } - // if (RC.nb_inst > 0) { - // /* Start the agent. If it is turned off in the configuration, it won't start */ - // for (i = 0; i < RC.nb_inst; i++) { - // flexran_agent_start(i); - // } + if (RC.nb_inst > 0) { + /* Start the agent. If it is turned off in the configuration, it won't start */ + if(NFAPI_MODE != NFAPI_MODE_PNF) + for (i = 0; i < RC.nb_inst; i++) { + flexran_agent_start(i); + } - // /* initializes PDCP and sets correct RLC Request/PDCP Indication callbacks - // * for monolithic/F1 modes */ + /* initializes PDCP and sets correct RLC Request/PDCP Indication callbacks + * for monolithic/F1 modes */ - // } + } if (RC.nb_inst > 0 && NODE_IS_CU(node_type)) { protocol_ctxt_t ctxt; -- GitLab