diff --git a/README.md b/README.md
index 7651aea5c9..62f8576e81 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
# OpenAirInterface License #
OpenAirInterface is under OpenAirInterface Software Alliance license.
diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml
index 16dfd1e377..bdca76379d 100644
--- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml
+++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml
@@ -113,8 +113,8 @@
Iperf
- iperf (DL/20Mbps/UDP)(60 sec)(single-ue profile)
- -u -b 20M -t 60
+ iperf (DL/60Mbps/UDP)(60 sec)(single-ue profile)
+ -u -b 60M -t 60
DL
nrmodule2_quectel
5
diff --git a/ci-scripts/xml_files/fr1_nsa_quectel.xml b/ci-scripts/xml_files/fr1_nsa_quectel.xml
index 6c11a66d91..2d0ff53525 100644
--- a/ci-scripts/xml_files/fr1_nsa_quectel.xml
+++ b/ci-scripts/xml_files/fr1_nsa_quectel.xml
@@ -110,8 +110,8 @@
Iperf
- iperf (DL/20Mbps/UDP)(60 sec)(single-ue profile)
- -u -b 20M -t 60
+ iperf (DL/60Mbps/UDP)(60 sec)(single-ue profile)
+ -u -b 60M -t 60
DL
idefix
3
diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt
index 8ad515625d..864048edd1 100644
--- a/cmake_targets/CMakeLists.txt
+++ b/cmake_targets/CMakeLists.txt
@@ -315,10 +315,9 @@ add_definitions("-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAV
set(commonOpts "-pipe -Wno-packed-bitfield-compat -fPIC -Wall -fno-strict-aliasing -rdynamic")
set(CMAKE_C_FLAGS
- "${CMAKE_C_FLAGS} ${C_FLAGS_PROCESSOR} ${commonOpts} -std=gnu99 -funroll-loops")
+ "${CMAKE_C_FLAGS} ${C_FLAGS_PROCESSOR} ${commonOpts} -std=gnu99 -funroll-loops -march=native")
set(CMAKE_CXX_FLAGS
- "${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} ${commonOpts} -std=c++11")
-
+ "${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} ${commonOpts} -std=c++11 -march=native")
if (SANITIZE_ADDRESS)
@@ -979,8 +978,6 @@ Message("CPU_Affinity flag is ${CPU_AFFINITY}")
# ???!!! TO BE DOCUMENTED OPTIONS !!!???
##############################################################
-add_boolean_option(NO_RRM True "DO WE HAVE A RADIO RESSOURCE MANAGER: NO")
-
add_boolean_option(OAI_NW_DRIVER_TYPE_ETHERNET False "????")
add_boolean_option(DEADLINE_SCHEDULER False "Use the Linux scheduler SCHED_DEADLINE: kernel >= 3.14")
add_boolean_option(CPU_AFFINITY False "Enable CPU Affinity of threads (only valid without deadline scheduler). It is enabled only with >2 CPUs")
@@ -1041,7 +1038,6 @@ add_boolean_option(JUMBO_FRAME True "ENABLE LARGE SDU in ACCESS STR
##########################
# RLC LAYER OPTIONS
##########################
-add_boolean_option(OPENAIR2 True "Access Stratum layer 2 built in executable")
add_boolean_option(TRACE_RLC_PAYLOAD False "Fatal assert in this case")
add_boolean_option(RLC_STOP_ON_LOST_PDU False "Fatal assert in this case")
@@ -1069,8 +1065,6 @@ add_boolean_option(TRACE_RLC_UM_TX_STATUS False "TRACE for RLC UM, TO BE CHANGE
##########################
# PDCP LAYER OPTIONS
##########################
-#add_boolean_option(PDCP_USE_NETLINK False "For eNB, PDCP communicate with a NETLINK socket if connected to network driver, else could use a RT-FIFO")
-#add_boolean_option(PDCP_USE_NETLINK_QUEUES False "When PDCP_USE_NETLINK is true, incoming IP packets are stored in queues")
#add_boolean_option(LINK_ENB_PDCP_TO_IP_DRIVER False "For eNB, PDCP communicate with a IP driver")
#add_boolean_option(LINK_ENB_PDCP_TO_GTPV1U True "For eNB, PDCP communicate with GTP-U protocol (eNB<->S-GW)")
add_definitions(-DNEW_GTPU=1)
diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper
index c5cc9d054d..06f32183b7 100755
--- a/cmake_targets/tools/build_helper
+++ b/cmake_targets/tools/build_helper
@@ -117,6 +117,9 @@ check_supported_distribution() {
"rhel8.2") return 0 ;;
"rhel8.3") return 0 ;;
"rhel8.4") return 0 ;;
+ "rhel8.5") return 0 ;;
+ "rhel8.6") return 0 ;;
+ "rhel8.7") return 0 ;;
"centos7") return 0 ;;
esac
return 1
diff --git a/common/utils/LOG/log_extern.h b/common/utils/LOG/log_extern.h
index f6205889dc..23f9217d7e 100644
--- a/common/utils/LOG/log_extern.h
+++ b/common/utils/LOG/log_extern.h
@@ -19,7 +19,7 @@
* contact@openairinterface.org
*/
-#include"log.h"
+#include "log.h"
extern log_t *g_log;
diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c
index 0a532c346b..67cf882e63 100644
--- a/common/utils/nr/nr_common.c
+++ b/common/utils/nr/nr_common.c
@@ -65,8 +65,8 @@ nr_bandentry_t nr_bandtable[] = {
{41, 2496000, 2690000, 2496000, 2690000, 3, 499200, 15},
{41, 2496000, 2690000, 2496000, 2690000, 6, 499200, 30},
{47, 5855000, 5925000, 5855000, 5925000, 1, 790334, 15},
- //{48, 3550000, 3700000, 3550000, 3700000, 1, 636667, 15},
- //{48, 3550000, 3700000, 3550000, 3700000, 2, 636668, 30},
+ {48, 3550000, 3700000, 3550000, 3700000, 1, 636667, 15},
+ {48, 3550000, 3700000, 3550000, 3700000, 2, 636668, 30},
{50, 1432000, 1517000, 1432000, 1517000, 20, 286400, 100},
{51, 1427000, 1432000, 1427000, 1432000, 20, 285400, 100},
{53, 2483500, 2495000, 2483500, 2495000, 20, 496700, 100},
@@ -90,14 +90,15 @@ nr_bandentry_t nr_bandtable[] = {
{84, 1920000, 1980000, 000, 000, 20, 384000, 100},
{86, 1710000, 1785000, 000, 000, 20, 342000, 100},
{89, 824000, 849000, 000, 000, 20, 342000, 100},
- {90, 2496000, 2690000, 2496000, 2690000, 3, 499200, 15},
- {90, 2496000, 2690000, 2496000, 2690000, 6, 499200, 30},
+ {90, 2496000, 2690000, 2496000, 2690000, 3, 499200, 15},
+ {90, 2496000, 2690000, 2496000, 2690000, 6, 499200, 30},
{90, 2496000, 2690000, 2496000, 2690000, 20, 499200, 100},
{91, 832000, 862000, 1427000, 1432000, 20, 285400, 100},
{92, 832000, 862000, 1432000, 1517000, 20, 286400, 100},
{93, 880000, 915000, 1427000, 1432000, 20, 285400, 100},
{94, 880000, 915000, 1432000, 1517000, 20, 286400, 100},
{95, 2010000, 2025000, 000, 000, 20, 402000, 100},
+ {96, 5925000, 7125000, 5925000, 7125000, 1, 795000, 15},
{257,26500020,29500000,26500020,29500000, 1,2054166, 60},
{257,26500080,29500000,26500080,29500000, 2,2054167, 120},
{258,24250080,27500000,24250080,27500000, 1,2016667, 60},
@@ -437,9 +438,16 @@ int get_nr_table_idx(int nr_bandP, uint8_t scs_index) {
AssertFatal(nr_bandP <= nr_bandtable[nr_bandtable_size-1].band, "NR band %d exceeds NR bands table maximum limit %d\n", nr_bandP, nr_bandtable[nr_bandtable_size-1].band);
for (i = 0; i < nr_bandtable_size && nr_bandtable[i].band != nr_bandP; i++);
- // selection of correct Deltaf raster according to SCS
- if ((nr_bandtable[i].deltaf_raster != 100) && (nr_bandtable[i].deltaf_raster != scs_khz))
+ // In frequency bands with two deltaFRaster,
+ // the higher deltaFRaster applies to channels using only the SCS that is equal to or larger than the higher deltaFRaster
+ // and SSB SCS is equal to the higher deltaFRaster.
+ while(((i+1)
@@ -268,13 +264,13 @@ void rx_func(void *param) {
// Call the scheduler
start_meas(&gNB->ul_indication_stats);
- pthread_mutex_lock(&gNB->UL_INFO_mutex);
+// pthread_mutex_lock(&gNB->UL_INFO_mutex);
gNB->UL_INFO.frame = frame_rx;
gNB->UL_INFO.slot = slot_rx;
gNB->UL_INFO.module_id = gNB->Mod_id;
gNB->UL_INFO.CC_id = gNB->CC_id;
gNB->if_inst->NR_UL_indication(&gNB->UL_INFO);
- pthread_mutex_unlock(&gNB->UL_INFO_mutex);
+// pthread_mutex_unlock(&gNB->UL_INFO_mutex);
stop_meas(&gNB->ul_indication_stats);
if (tx_slot_type == NR_DOWNLINK_SLOT || tx_slot_type == NR_MIXED_SLOT) {
@@ -342,7 +338,7 @@ static void *process_stats_thread(void *param) {
reset_meas(&gNB->ul_indication_stats);
reset_meas(&gNB->rx_pusch_stats);
reset_meas(&gNB->ulsch_decoding_stats);
-
+ reset_meas(&gNB->schedule_response_stats);
wait_sync("process_stats_thread");
while(!oai_exit)
@@ -353,6 +349,7 @@ static void *process_stats_thread(void *param) {
print_meas(&gNB->dlsch_encoding_stats, "DLSCH encoding", NULL, NULL);
print_meas(&gNB->phy_proc_rx, "L1 Rx processing", NULL, NULL);
print_meas(&gNB->ul_indication_stats, "UL Indication", NULL, NULL);
+ print_meas(&gNB->schedule_response_stats,"Schedule Response",NULL,NULL);
print_meas(&gNB->rx_pusch_stats, "PUSCH inner-receiver", NULL, NULL);
print_meas(&gNB->ulsch_decoding_stats, "PUSCH decoding", NULL, NULL);
}
@@ -387,15 +384,15 @@ void init_gNB_Tpool(int inst) {
LOG_I(PHY,"Number of threads requested in config file: %d, Number of threads available on this machine: %d\n",gNB->pusch_proc_threads,numCPU);
int threadCnt = min(numCPU, gNB->pusch_proc_threads);
if (threadCnt < 2) LOG_E(PHY,"Number of threads for gNB should be more than 1. Allocated only %d\n",threadCnt);
- char ul_pool[80];
- sprintf(ul_pool,"-1");
+ char pool[80];
+ sprintf(pool,"-1");
int s_offset = 0;
for (int icpu=1; icputhreadPool, false);
+ if (getenv("noThreads")) strcpy(pool, "n");
+ initTpool(pool, gNB->threadPool, false);
// ULSCH decoder result FIFO
gNB->respDecode = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
initNotifiedFIFO(gNB->respDecode);
diff --git a/executables/nr-ru.c b/executables/nr-ru.c
index 336b7bec12..c90750d39a 100644
--- a/executables/nr-ru.c
+++ b/executables/nr-ru.c
@@ -70,10 +70,6 @@ static int DEFBFW[] = {0x00007fff};
#include "GNB_APP/gnb_paramdef.h"
#include "common/config/config_userapi.h"
-#ifndef OPENAIR2
- #include "UTIL/OTG/otg_extern.h"
-#endif
-
#include "s1ap_eNB.h"
#include "SIMULATION/ETH_TRANSPORT/proto.h"
#include
diff --git a/executables/nr-softmodem-common.h b/executables/nr-softmodem-common.h
index 5b6d21d177..c02155326b 100644
--- a/executables/nr-softmodem-common.h
+++ b/executables/nr-softmodem-common.h
@@ -30,12 +30,8 @@
#include "PHY/types.h"
#include
-#if defined(ENABLE_USE_MME)
#include "s1ap_eNB.h"
-#ifdef PDCP_USE_NETLINK
#include "SIMULATION/ETH_TRANSPORT/proto.h"
-#endif
-#endif
/* help strings definition for command line options, used in CMDLINE_XXX_DESC macros and printed when -h option is used */
#define CONFIG_HLP_RFCFGF "Configuration file for front-end (e.g. LMS7002M)\n"
diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c
index 1ccd49aef9..04fdef8679 100644
--- a/executables/nr-softmodem.c
+++ b/executables/nr-softmodem.c
@@ -66,10 +66,6 @@ unsigned short config_frames[4] = {2,9,11,13};
//#include "PHY/TOOLS/time_meas.h"
-#ifndef OPENAIR2
- #include "UTIL/OTG/otg_vars.h"
-#endif
-
#include "intertask_interface.h"
#include "PHY/INIT/phy_init.h"
@@ -676,15 +672,10 @@ int main( int argc, char **argv ) {
// initialize mscgen log after ITTI
MSC_INIT(MSC_E_UTRAN, ADDED_QUEUES_MAX+TASK_MAX);
init_opt();
-#ifdef PDCP_USE_NETLINK
-
- if(!IS_SOFTMODEM_NOS1)
- netlink_init();
-
-#if defined(PDCP_USE_NETLINK_QUEUES)
- pdcp_netlink_init();
-#endif
-#endif
+ if(PDCP_USE_NETLINK)
+ if(!IS_SOFTMODEM_NOS1)
+ netlink_init();
+
#ifndef PACKAGE_VERSION
# define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL"
#endif
diff --git a/executables/nr-ue.c b/executables/nr-ue.c
index 1d415e1230..77fc7d171b 100644
--- a/executables/nr-ue.c
+++ b/executables/nr-ue.c
@@ -19,6 +19,7 @@
* contact@openairinterface.org
*/
+#include
#include "executables/nr-uesoftmodem.h"
#include "PHY/phy_extern_nr_ue.h"
#include "PHY/INIT/phy_init.h"
@@ -87,11 +88,7 @@
*
*/
-#ifndef NO_RAT_NR
- #define DURATION_RX_TO_TX (NR_UE_CAPABILITY_SLOT_RX_TO_TX) /* for NR this will certainly depends to such UE capability which is not yet defined */
-#else
- #define DURATION_RX_TO_TX (6) /* For LTE, this duration is fixed to 4 and it is linked to LTE standard for both modes FDD/TDD */
-#endif
+
#define RX_JOB_ID 0x1010
#define TX_JOB_ID 100
@@ -463,13 +460,18 @@ int computeSamplesShift(PHY_VARS_NR_UE *UE) {
// compute TO compensation that should be applied for this frame
if ( UE->rx_offset < UE->frame_parms.samples_per_frame/2 &&
UE->rx_offset > 0 ) {
- //LOG_I(PHY,"!!!adjusting -1 samples!!!\n");
+ LOG_I(PHY,"!!!adjusting -1 samples!!! rx_offset == %d\n", UE->rx_offset);
+ UE->rx_offset = 0; // reset so that it is not applied falsely in case of SSB being only in every second frame
+ UE->max_pos_fil = 0; // reset IIR filter when sample shift is applied
return -1 ;
}
if ( UE->rx_offset > UE->frame_parms.samples_per_frame/2 &&
UE->rx_offset < UE->frame_parms.samples_per_frame ) {
- //LOG_I(PHY,"!!!adjusting +1 samples!!!\n");
+ int rx_offset = UE->rx_offset - UE->frame_parms.samples_per_frame;
+ LOG_I(PHY,"!!!adjusting +1 samples!!! rx_offset == %d\n", rx_offset);
+ UE->rx_offset = 0; // reset so that it is not applied falsely in case of SSB being only in every second frame
+ UE->max_pos_fil = 0; // reset IIR filter when sample shift is applied
return 1;
}
diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c
index 3a6a795bb0..8bc8e2404d 100644
--- a/executables/nr-uesoftmodem.c
+++ b/executables/nr-uesoftmodem.c
@@ -63,10 +63,6 @@ unsigned short config_frames[4] = {2,9,11,13};
#include "enb_config.h"
//#include "PHY/TOOLS/time_meas.h"
-#ifndef OPENAIR2
- #include "UTIL/OTG/otg_vars.h"
-#endif
-
#include "intertask_interface.h"
#include "PHY/INIT/phy_init.h"
diff --git a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_constants.h b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_constants.h
index 8e6bf9a802..e144ce9447 100644
--- a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_constants.h
+++ b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_constants.h
@@ -10,7 +10,7 @@
#define FAPI_NR_MAX_RA_OCCASION_PER_CSIRS 64
// Constants Defined in 38.213
#define FAPI_NR_MAX_CORESET_PER_BWP 3
-#define FAPI_NR_MAX_SS_PER_CORESET 10
+#define FAPI_NR_MAX_SS 10
/// RX_IND
diff --git a/openair1/PHY/CODING/crc.h b/openair1/PHY/CODING/crc.h
new file mode 100644
index 0000000000..c31366765f
--- /dev/null
+++ b/openair1/PHY/CODING/crc.h
@@ -0,0 +1,541 @@
+/*******************************************************************************
+ Copyright (c) 2009-2018, Intel Corporation
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of Intel Corporation nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+/**
+ * Header file for module with CRC computation methods
+ *
+ * PCLMULQDQ implementation is based on work by:
+ * Erdinc Ozturk
+ * Vinodh Gopal
+ * James Guilford
+ *
+ * "Fast CRC Computation for Generic Polynomials Using PCLMULQDQ Instruction"
+ * URL: http://download.intel.com/design/intarch/papers/323102.pdf
+ */
+
+#ifndef __CRC_H__
+#define __CRC_H__
+
+#include
+
+#include "crcext.h"
+#include "types.h"
+
+/**
+ * PCLMULQDQ CRC computation context structure
+ */
+struct crc_pclmulqdq_ctx {
+ /**
+ * K1 = reminder X^128 / P(X) : 0-63
+ * K2 = reminder X^192 / P(X) : 64-127
+ */
+ uint64_t k1;
+ uint64_t k2;
+
+ /**
+ * K3 = reminder X^64 / P(X) : 0-63
+ * q = quotient X^64 / P(X) : 64-127
+ */
+ uint64_t k3;
+ uint64_t q;
+
+ /**
+ * p = polynomial / P(X) : 0-63
+ * res = reserved : 64-127
+ */
+ uint64_t p;
+ uint64_t res;
+};
+
+/**
+ * Functions and prototypes
+ */
+
+/**
+ * @brief Initializes look-up-table (LUT) for given 8 bit polynomial
+ *
+ * @param poly CRC polynomial
+ * @param lut pointer to look-up-table to be initialized
+ */
+void crc8_init_lut(const uint8_t poly, uint8_t *lut);
+
+/**
+ * @brief Calculates 8 bit CRC using LUT method.
+ *
+ * @param crc CRC initial value
+ * @param data pointer to data block to calculate CRC for
+ * @param data_len size of data block
+ * @param lut 256x8bits look-up-table pointer
+ *
+ * @return New CRC value
+ */
+__forceinline
+uint8_t crc8_calc_lut(const uint8_t *data,
+ uint32_t data_len,
+ uint8_t crc,
+ const uint8_t *lut)
+{
+ if (unlikely(data == NULL || lut == NULL))
+ return crc;
+
+ while (data_len--)
+ crc = lut[*data++ ^ crc];
+
+ return crc;
+}
+
+/**
+ * @brief Initializes look-up-table (LUT) for given 16 bit polynomial
+ *
+ * @param poly CRC polynomial
+ * @param lut pointer to 256x16bits look-up-table to be initialized
+ */
+void crc16_init_lut(const uint16_t poly, uint16_t *lut);
+
+/**
+ * @brief Calculates 16 bit CRC using LUT method.
+ *
+ * @param crc CRC initial value
+ * @param data pointer to data block to calculate CRC for
+ * @param data_len size of data block
+ * @param lut 256x16bits look-up-table pointer
+ *
+ * @return New CRC value
+ */
+__forceinline
+uint16_t crc16_calc_lut(const uint8_t *data,
+ uint32_t data_len,
+ uint16_t crc,
+ const uint16_t *lut)
+{
+ if (unlikely(data == NULL || lut == NULL))
+ return crc;
+
+ while (data_len--)
+ crc = lut[(crc >> 8) ^ *data++] ^ (crc << 8);
+
+ return crc;
+}
+
+/**
+ * @brief Initializes look-up-table (LUT) for given 32 bit polynomial
+ *
+ * @param poly CRC polynomial
+ * @param lut pointer to 256x32bits look-up-table to be initialized
+ */
+void crc32_init_lut(const uint32_t poly, uint32_t *lut);
+
+/**
+ * @brief Calculates 32 bit CRC using LUT method.
+ *
+ * @param crc CRC initial value
+ * @param data pointer to data block to calculate CRC for
+ * @param data_len size of data block
+ * @param lut 256x32bits look-up-table pointer
+ *
+ * @return New CRC value
+ */
+__forceinline
+uint32_t crc32_calc_lut(const uint8_t *data,
+ uint32_t data_len,
+ uint32_t crc,
+ const uint32_t *lut)
+{
+ if (unlikely(data == NULL || lut == NULL))
+ return crc;
+
+ while (data_len--)
+ crc = lut[(crc >> 24) ^ *data++] ^ (crc << 8);
+
+ return crc;
+}
+
+/**
+ * @brief Initializes look up tables for slice-By-2 method.
+ *
+ * @param poly CRC polynomial
+ * @param slice1 slice-by-2 look-up-table 1
+ * @param slice2 slice-by-2 look-up-table 2
+ *
+ * @return New CRC value
+ */
+void crc16_init_slice2(const uint16_t poly,
+ uint16_t *slice1,
+ uint16_t *slice2);
+
+/**
+ * @brief Calculates 16 bit CRC using Slice-By-2 method.
+ *
+ * @param crc CRC initial value
+ * @param data pointer to data block to calculate CRC for
+ * @param data_len size of data block
+ * @param slice1 256x16bits slice look-up-table 1
+ * @param slice2 256x16bits slice look-up-table 2
+ *
+ * @return New CRC value
+ */
+__forceinline
+uint16_t crc16_calc_slice2(const uint8_t *data,
+ uint32_t data_len,
+ uint16_t crc,
+ const uint16_t *slice1,
+ const uint16_t *slice2)
+{
+ uint_fast32_t i;
+
+ if (unlikely(data == NULL))
+ return crc;
+
+ if (unlikely(slice1 == NULL || slice2 == NULL))
+ return crc;
+
+ crc = bswap2(crc);
+ for (i = (data_len & (~1)), data += (data_len & (~1)); i != 0;
+ i -= sizeof(uint16_t)) {
+ crc ^= (*((const uint16_t *)(data - i)));
+ crc = slice2[(uint8_t)crc] ^ slice1[(uint8_t)(crc >> 8)];
+ }
+ crc = bswap2(crc);
+ if (data_len & 1)
+ crc = (crc << 8) ^ bswap2(slice1[(crc >> 8) ^ *data]);
+
+ return crc;
+}
+
+/**
+ * @brief Initializes look up tables for slice-By-4 method.
+ *
+ * @param poly CRC polynomial
+ * @param slice1 256x32bits slice look-up-table 1
+ * @param slice2 256x32bits slice look-up-table 2
+ * @param slice3 256x32bits slice look-up-table 3
+ * @param slice4 256x32bits slice look-up-table 4
+ *
+ * @return New CRC value
+ */
+void crc32_init_slice4(const uint32_t poly,
+ uint32_t *slice1, uint32_t *slice2,
+ uint32_t *slice3, uint32_t *slice4);
+
+/**
+ * @brief Calculates 32 bit CRC using Slice-By-4 method.
+ *
+ * @param data pointer to data block to calculate CRC for
+ * @param data_len size of data block
+ * @param crc CRC initial value
+ * @param slice1 256x32bits slice look-up-table 1
+ * @param slice2 256x32bits slice look-up-table 2
+ * @param slice3 256x32bits slice look-up-table 3
+ * @param slice4 256x32bits slice look-up-table 4
+ *
+ * @return New CRC value
+ */
+__forceinline
+uint32_t crc32_calc_slice4(const uint8_t *data,
+ uint32_t data_len, uint32_t crc,
+ const uint32_t *slice1, const uint32_t *slice2,
+ const uint32_t *slice3, const uint32_t *slice4)
+{
+ uint_fast32_t i;
+
+ if (unlikely(data == NULL))
+ return crc;
+
+ if (unlikely(slice1 == NULL || slice2 == NULL ||
+ slice3 == NULL || slice4 == NULL))
+ return crc;
+
+ crc = bswap4(crc);
+ for (i = data_len & (~3), data += (data_len & (~3)); i != 0;
+ i -= sizeof(uint32_t)) {
+ crc ^= (*((const uint32_t *)(data - i)));
+ crc = slice4[(uint8_t)(crc)] ^
+ slice3[(uint8_t)(crc >> 8)] ^
+ slice2[(uint8_t)(crc >> 16)] ^
+ slice1[(uint8_t)(crc >> 24)];
+ }
+ crc = bswap4(crc);
+ for (i = data_len & 3, data += (data_len & 3); i != 0; i--)
+ crc = (crc << 8) ^
+ bswap4(slice1[(crc >> 24) ^ *(data - i)]);
+
+ return crc;
+}
+
+/**
+ * @brief Performs one folding round
+ *
+ * Logically function operates as follows:
+ * DATA = READ_NEXT_16BYTES();
+ * F1 = LSB8(FOLD)
+ * F2 = MSB8(FOLD)
+ * T1 = CLMUL( F1, K1 )
+ * T2 = CLMUL( F2, K2 )
+ * FOLD = XOR( T1, T2, DATA )
+ *
+ * @param data_block 16 byte data block
+ * @param k1_k2 k1 and k2 constanst enclosed in XMM register
+ * @param fold running 16 byte folded data
+ *
+ * @return New 16 byte folded data
+ */
+__forceinline
+__m128i crc32_folding_round(const __m128i data_block,
+ const __m128i k1_k2,
+ const __m128i fold)
+{
+ __m128i tmp = _mm_clmulepi64_si128(fold, k1_k2, 0x11);
+
+ return _mm_xor_si128(_mm_clmulepi64_si128(fold, k1_k2, 0x00),
+ _mm_xor_si128(data_block, tmp));
+}
+
+/**
+ * @brief Performs Barret's reduction from 128 bits to 64 bits
+ *
+ * @param data128 128 bits data to be reduced
+ * @param k3_q k3 and Q constants enclosed in XMM register
+ *
+ * @return data reduced to 64 bits
+ */
+__forceinline
+__m128i crc32_reduce_128_to_64(__m128i data128, const __m128i k3_q)
+{
+ __m128i tmp;
+
+ tmp = _mm_xor_si128(_mm_clmulepi64_si128(data128, k3_q, 0x01 /* k3 */),
+ data128);
+
+ data128 = _mm_xor_si128(_mm_clmulepi64_si128(tmp, k3_q, 0x01 /* k3 */),
+ data128);
+
+ return _mm_srli_si128(_mm_slli_si128(data128, 8), 8);
+}
+
+/**
+ * @brief Performs Barret's reduction from 64 bits to 32 bits
+ *
+ * @param data64 64 bits data to be reduced
+ * @param k3_q k3 and Q constants enclosed in XMM register
+ * @param p_res P constant enclosed in XMM register
+ *
+ * @return data reduced to 32 bits
+ */
+__forceinline
+uint32_t
+crc32_reduce_64_to_32(__m128i fold, const __m128i k3_q, const __m128i p_res)
+{
+ __m128i temp;
+
+ temp = _mm_clmulepi64_si128(_mm_srli_si128(fold, 4),
+ k3_q, 0x10 /* Q */);
+ temp = _mm_srli_si128(_mm_xor_si128(temp, fold), 4);
+ temp = _mm_clmulepi64_si128(temp, p_res, 0 /* P */);
+ return _mm_extract_epi32(_mm_xor_si128(temp, fold), 0);
+}
+
+/**
+ * @brief Calculates 32 bit CRC for given \a data block by applying folding and
+ * reduction methods.
+ *
+ * Algorithm operates on 32 bit CRCs so polynomials and initial values may
+ * need to be promoted to 32 bits where required.
+ *
+ * @param crc initial CRC value (32 bit value)
+ * @param data pointer to data block
+ * @param data_len length of \a data block in bytes
+ * @param params pointer to PCLMULQDQ CRC calculation context
+ *
+ * @return CRC for given \a data block (32 bits wide).
+ */
+__forceinline
+uint32_t
+crc32_calc_pclmulqdq(const uint8_t *data,
+ uint32_t data_len, uint32_t crc,
+ const struct crc_pclmulqdq_ctx *params)
+{
+ __m128i temp, fold, k, swap;
+ uint32_t n;
+
+ if (unlikely(data == NULL || data_len == 0 || params == NULL))
+ return crc;
+
+#ifdef __KERNEL__
+ /**
+ * Preserve FPU context
+ */
+ kernel_fpu_begin();
+#endif
+
+ /**
+ * Add 4 bytes to data block size
+ * This is to secure the following:
+ * CRC32 = M(X)^32 mod P(X)
+ * M(X) - message to compute CRC on
+ * P(X) - CRC polynomial
+ */
+ data_len += 4;
+
+ /**
+ * Load first 16 data bytes in \a fold and
+ * set \a swap BE<->LE 16 byte conversion variable
+ */
+ fold = _mm_loadu_si128((__m128i *)data);
+ swap = crc_xmm_be_le_swap128;
+
+ /**
+ * -------------------------------------------------
+ * Folding all data into single 16 byte data block
+ * Assumes: \a fold holds first 16 bytes of data
+ */
+
+ if (unlikely(data_len <= 16)) {
+ /**
+ * Data block fits into 16 byte block
+ * - adjust data block
+ * - 4 least significant bytes need to be zero
+ */
+ fold = _mm_shuffle_epi8(fold, swap);
+ fold = _mm_slli_si128(xmm_shift_right(fold, 20 - data_len), 4);
+
+ /**
+ * Apply CRC init value
+ */
+ temp = _mm_insert_epi32(_mm_setzero_si128(), bswap4(crc), 0);
+ temp = xmm_shift_left(temp, data_len - 4);
+ fold = _mm_xor_si128(fold, temp);
+ } else {
+ /**
+ * There are 2x16 data blocks or more
+ */
+ __m128i next_data;
+
+ /**
+ * n = number of bytes required to align \a data_len
+ * to multiple of 16
+ */
+ n = ((~data_len) + 1) & 15;
+
+ /**
+ * Apply CRC initial value and
+ * get \a fold to BE format
+ */
+ fold = _mm_xor_si128(fold,
+ _mm_insert_epi32(_mm_setzero_si128(),
+ crc, 0));
+ fold = _mm_shuffle_epi8(fold, swap);
+
+ /**
+ * Load next 16 bytes of data and
+ * adjust \a fold & \a next_data as follows:
+ *
+ * CONCAT(fold,next_data) >> (n*8)
+ */
+ next_data = _mm_loadu_si128((__m128i *)&data[16]);
+ next_data = _mm_shuffle_epi8(next_data, swap);
+ next_data = _mm_or_si128(xmm_shift_right(next_data, n),
+ xmm_shift_left(fold, 16 - n));
+ fold = xmm_shift_right(fold, n);
+
+ if (unlikely(data_len <= 32))
+ /**
+ * In such unlikely case clear 4 least significant bytes
+ */
+ next_data =
+ _mm_slli_si128(_mm_srli_si128(next_data, 4), 4);
+
+ /**
+ * Do the initial folding round on 2 first 16 byte chunks
+ */
+ k = _mm_load_si128((__m128i *)(¶ms->k1));
+ fold = crc32_folding_round(next_data, k, fold);
+
+ if (likely(data_len > 32)) {
+ /**
+ * \a data_block needs to be at least 48 bytes long
+ * in order to get here
+ */
+ __m128i new_data;
+
+ /**
+ * Main folding loop
+ * - n is adjusted to point to next 16 data block
+ * to read
+ * (16+16) = 2x16; represents 2 first data blocks
+ * processed above
+ * (- n) is the number of zero bytes padded to
+ * the message in order to align it to 16 bytes
+ * - the last 16 bytes is processed separately
+ */
+ for (n = 16 + 16 - n; n < (data_len - 16); n += 16) {
+ new_data = _mm_loadu_si128((__m128i *)&data[n]);
+ new_data = _mm_shuffle_epi8(new_data, swap);
+ fold = crc32_folding_round(new_data, k, fold);
+ }
+
+ /**
+ * The last folding round works always on 12 bytes
+ * (12 bytes of data and 4 zero bytes)
+ * Read from offset -4 is to avoid one
+ * shift right operation.
+ */
+ new_data = _mm_loadu_si128((__m128i *)&data[n - 4]);
+ new_data = _mm_shuffle_epi8(new_data, swap);
+ new_data = _mm_slli_si128(new_data, 4);
+ fold = crc32_folding_round(new_data, k, fold);
+ } /* if (data_len > 32) */
+ }
+
+ /**
+ * -------------------------------------------------
+ * Reduction 128 -> 32
+ * Assumes: \a fold holds 128bit folded data
+ */
+
+ /**
+ * REDUCTION 128 -> 64
+ */
+ k = _mm_load_si128((__m128i *)(¶ms->k3));
+ fold = crc32_reduce_128_to_64(fold, k);
+
+ /**
+ * REDUCTION 64 -> 32
+ */
+ n = crc32_reduce_64_to_32(fold, k,
+ _mm_load_si128((__m128i *)(¶ms->p)));
+
+#ifdef __KERNEL__
+ /**
+ * - restore FPU context
+ */
+ kernel_fpu_end();
+#endif
+
+ return n;
+}
+
+#endif /* __CRC_H__ */
diff --git a/openair1/PHY/CODING/crc_byte.c b/openair1/PHY/CODING/crc_byte.c
index 287cbcd1f4..987f692a32 100644
--- a/openair1/PHY/CODING/crc_byte.c
+++ b/openair1/PHY/CODING/crc_byte.c
@@ -30,10 +30,14 @@
Modified in June, 2001, to include the length non multiple of 8
*/
+#define USE_INTEL_CRC 1
#include "coding_defs.h"
#include "assertions.h"
-
+#ifdef USE_INTEL_CRC
+#include "crc_intel.h"
+#include "crc.h"
+#endif
/*ref 36-212 v8.6.0 , pp 8-9 */
/* the highest degree is set by default */
@@ -94,6 +98,28 @@ static unsigned short crc11Table[256];
static unsigned char crc8Table[256];
static unsigned char crc6Table[256];
+#ifdef USE_INTEL_CRC
+static DECLARE_ALIGNED(struct crc_pclmulqdq_ctx lte_crc24a_pclmulqdq, 16) = {
+ 0x64e4d700, /**< k1 */
+ 0x2c8c9d00, /**< k2 */
+ 0xd9fe8c00, /**< k3 */
+ 0xf845fe24, /**< q */
+ 0x864cfb00, /**< p */
+ 0ULL /**< res */
+};
+__m128i crc_xmm_be_le_swap128;
+
+DECLARE_ALIGNED(const uint8_t crc_xmm_shift_tab[48], 16) = {
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
+};
+
+#endif
+
void crcTableInit (void)
{
unsigned char c = 0;
@@ -108,14 +134,20 @@ void crcTableInit (void)
crc8Table[c] = (unsigned char) (crcbit (&c, 1, poly8) >> 24);
crc6Table[c] = (unsigned char) (crcbit (&c, 1, poly6) >> 24);
} while (++c);
+#ifdef USE_INTEL_CRC
+ crc_xmm_be_le_swap128 = _mm_setr_epi32(0x0c0d0e0f, 0x08090a0b,
+ 0x04050607, 0x00010203);
+
+#endif
}
/*********************************************************
-Byte by byte implementations,
+Byte by byte LUT implementations,
assuming initial byte is 0 padded (in MSB) if necessary
-
+can use SIMD optimized Intel CRC for LTE/NR 24a/24b variants
*********************************************************/
+
unsigned int crc24a (unsigned char * inptr,
int bitlen)
{
@@ -124,7 +156,7 @@ unsigned int crc24a (unsigned char * inptr,
unsigned int crc = 0;
octetlen = bitlen / 8; /* Change in octets */
resbit = (bitlen % 8);
-
+#ifndef USE_INTEL_CRC
while (octetlen-- > 0) {
// printf("crc24a: in %x => crc %x\n",crc,*inptr);
crc = (crc << 8) ^ crc24aTable[(*inptr++) ^ (crc >> 24)];
@@ -132,18 +164,32 @@ unsigned int crc24a (unsigned char * inptr,
if (resbit > 0)
crc = (crc << resbit) ^ crc24aTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))];
-
return crc;
+#else
+ return crc32_calc_pclmulqdq(inptr, octetlen, 0,
+ <e_crc24a_pclmulqdq);
+#endif
+
}
+#ifdef USE_INTEL_CRC
+static DECLARE_ALIGNED(struct crc_pclmulqdq_ctx lte_crc24b_pclmulqdq, 16) = {
+ 0x80140500, /**< k1 */
+ 0x42000100, /**< k2 */
+ 0x90042100, /**< k3 */
+ 0xffff83ff, /**< q */
+ 0x80006300, /**< p */
+ 0ULL /**< res */
+};
+#endif
unsigned int crc24b (unsigned char * inptr,
- int bitlen)
+ int bitlen)
{
int octetlen, resbit;
unsigned int crc = 0;
octetlen = bitlen / 8; /* Change in octets */
resbit = (bitlen % 8);
-
+#ifndef USE_INTEL_CRC
while (octetlen-- > 0) {
// printf("crc24b: in %x => crc %x (%x)\n",crc,*inptr,crc24bTable[(*inptr) ^ (crc >> 24)]);
crc = (crc << 8) ^ crc24bTable[(*inptr++) ^ (crc >> 24)];
@@ -153,6 +199,10 @@ unsigned int crc24b (unsigned char * inptr,
crc = (crc << resbit) ^ crc24bTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))];
return crc;
+#else
+ return crc32_calc_pclmulqdq(inptr, octetlen, 0,
+ <e_crc24b_pclmulqdq);
+#endif
}
unsigned int crc24c (unsigned char * inptr,
diff --git a/openair1/PHY/CODING/crc_intel.h b/openair1/PHY/CODING/crc_intel.h
new file mode 100644
index 0000000000..c31366765f
--- /dev/null
+++ b/openair1/PHY/CODING/crc_intel.h
@@ -0,0 +1,541 @@
+/*******************************************************************************
+ Copyright (c) 2009-2018, Intel Corporation
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of Intel Corporation nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+/**
+ * Header file for module with CRC computation methods
+ *
+ * PCLMULQDQ implementation is based on work by:
+ * Erdinc Ozturk
+ * Vinodh Gopal
+ * James Guilford
+ *
+ * "Fast CRC Computation for Generic Polynomials Using PCLMULQDQ Instruction"
+ * URL: http://download.intel.com/design/intarch/papers/323102.pdf
+ */
+
+#ifndef __CRC_H__
+#define __CRC_H__
+
+#include
+
+#include "crcext.h"
+#include "types.h"
+
+/**
+ * PCLMULQDQ CRC computation context structure
+ */
+struct crc_pclmulqdq_ctx {
+ /**
+ * K1 = reminder X^128 / P(X) : 0-63
+ * K2 = reminder X^192 / P(X) : 64-127
+ */
+ uint64_t k1;
+ uint64_t k2;
+
+ /**
+ * K3 = reminder X^64 / P(X) : 0-63
+ * q = quotient X^64 / P(X) : 64-127
+ */
+ uint64_t k3;
+ uint64_t q;
+
+ /**
+ * p = polynomial / P(X) : 0-63
+ * res = reserved : 64-127
+ */
+ uint64_t p;
+ uint64_t res;
+};
+
+/**
+ * Functions and prototypes
+ */
+
+/**
+ * @brief Initializes look-up-table (LUT) for given 8 bit polynomial
+ *
+ * @param poly CRC polynomial
+ * @param lut pointer to look-up-table to be initialized
+ */
+void crc8_init_lut(const uint8_t poly, uint8_t *lut);
+
+/**
+ * @brief Calculates 8 bit CRC using LUT method.
+ *
+ * @param crc CRC initial value
+ * @param data pointer to data block to calculate CRC for
+ * @param data_len size of data block
+ * @param lut 256x8bits look-up-table pointer
+ *
+ * @return New CRC value
+ */
+__forceinline
+uint8_t crc8_calc_lut(const uint8_t *data,
+ uint32_t data_len,
+ uint8_t crc,
+ const uint8_t *lut)
+{
+ if (unlikely(data == NULL || lut == NULL))
+ return crc;
+
+ while (data_len--)
+ crc = lut[*data++ ^ crc];
+
+ return crc;
+}
+
+/**
+ * @brief Initializes look-up-table (LUT) for given 16 bit polynomial
+ *
+ * @param poly CRC polynomial
+ * @param lut pointer to 256x16bits look-up-table to be initialized
+ */
+void crc16_init_lut(const uint16_t poly, uint16_t *lut);
+
+/**
+ * @brief Calculates 16 bit CRC using LUT method.
+ *
+ * @param crc CRC initial value
+ * @param data pointer to data block to calculate CRC for
+ * @param data_len size of data block
+ * @param lut 256x16bits look-up-table pointer
+ *
+ * @return New CRC value
+ */
+__forceinline
+uint16_t crc16_calc_lut(const uint8_t *data,
+ uint32_t data_len,
+ uint16_t crc,
+ const uint16_t *lut)
+{
+ if (unlikely(data == NULL || lut == NULL))
+ return crc;
+
+ while (data_len--)
+ crc = lut[(crc >> 8) ^ *data++] ^ (crc << 8);
+
+ return crc;
+}
+
+/**
+ * @brief Initializes look-up-table (LUT) for given 32 bit polynomial
+ *
+ * @param poly CRC polynomial
+ * @param lut pointer to 256x32bits look-up-table to be initialized
+ */
+void crc32_init_lut(const uint32_t poly, uint32_t *lut);
+
+/**
+ * @brief Calculates 32 bit CRC using LUT method.
+ *
+ * @param crc CRC initial value
+ * @param data pointer to data block to calculate CRC for
+ * @param data_len size of data block
+ * @param lut 256x32bits look-up-table pointer
+ *
+ * @return New CRC value
+ */
+__forceinline
+uint32_t crc32_calc_lut(const uint8_t *data,
+ uint32_t data_len,
+ uint32_t crc,
+ const uint32_t *lut)
+{
+ if (unlikely(data == NULL || lut == NULL))
+ return crc;
+
+ while (data_len--)
+ crc = lut[(crc >> 24) ^ *data++] ^ (crc << 8);
+
+ return crc;
+}
+
+/**
+ * @brief Initializes look up tables for slice-By-2 method.
+ *
+ * @param poly CRC polynomial
+ * @param slice1 slice-by-2 look-up-table 1
+ * @param slice2 slice-by-2 look-up-table 2
+ *
+ * @return New CRC value
+ */
+void crc16_init_slice2(const uint16_t poly,
+ uint16_t *slice1,
+ uint16_t *slice2);
+
+/**
+ * @brief Calculates 16 bit CRC using Slice-By-2 method.
+ *
+ * @param crc CRC initial value
+ * @param data pointer to data block to calculate CRC for
+ * @param data_len size of data block
+ * @param slice1 256x16bits slice look-up-table 1
+ * @param slice2 256x16bits slice look-up-table 2
+ *
+ * @return New CRC value
+ */
+__forceinline
+uint16_t crc16_calc_slice2(const uint8_t *data,
+ uint32_t data_len,
+ uint16_t crc,
+ const uint16_t *slice1,
+ const uint16_t *slice2)
+{
+ uint_fast32_t i;
+
+ if (unlikely(data == NULL))
+ return crc;
+
+ if (unlikely(slice1 == NULL || slice2 == NULL))
+ return crc;
+
+ crc = bswap2(crc);
+ for (i = (data_len & (~1)), data += (data_len & (~1)); i != 0;
+ i -= sizeof(uint16_t)) {
+ crc ^= (*((const uint16_t *)(data - i)));
+ crc = slice2[(uint8_t)crc] ^ slice1[(uint8_t)(crc >> 8)];
+ }
+ crc = bswap2(crc);
+ if (data_len & 1)
+ crc = (crc << 8) ^ bswap2(slice1[(crc >> 8) ^ *data]);
+
+ return crc;
+}
+
+/**
+ * @brief Initializes look up tables for slice-By-4 method.
+ *
+ * @param poly CRC polynomial
+ * @param slice1 256x32bits slice look-up-table 1
+ * @param slice2 256x32bits slice look-up-table 2
+ * @param slice3 256x32bits slice look-up-table 3
+ * @param slice4 256x32bits slice look-up-table 4
+ *
+ * @return New CRC value
+ */
+void crc32_init_slice4(const uint32_t poly,
+ uint32_t *slice1, uint32_t *slice2,
+ uint32_t *slice3, uint32_t *slice4);
+
+/**
+ * @brief Calculates 32 bit CRC using Slice-By-4 method.
+ *
+ * @param data pointer to data block to calculate CRC for
+ * @param data_len size of data block
+ * @param crc CRC initial value
+ * @param slice1 256x32bits slice look-up-table 1
+ * @param slice2 256x32bits slice look-up-table 2
+ * @param slice3 256x32bits slice look-up-table 3
+ * @param slice4 256x32bits slice look-up-table 4
+ *
+ * @return New CRC value
+ */
+__forceinline
+uint32_t crc32_calc_slice4(const uint8_t *data,
+ uint32_t data_len, uint32_t crc,
+ const uint32_t *slice1, const uint32_t *slice2,
+ const uint32_t *slice3, const uint32_t *slice4)
+{
+ uint_fast32_t i;
+
+ if (unlikely(data == NULL))
+ return crc;
+
+ if (unlikely(slice1 == NULL || slice2 == NULL ||
+ slice3 == NULL || slice4 == NULL))
+ return crc;
+
+ crc = bswap4(crc);
+ for (i = data_len & (~3), data += (data_len & (~3)); i != 0;
+ i -= sizeof(uint32_t)) {
+ crc ^= (*((const uint32_t *)(data - i)));
+ crc = slice4[(uint8_t)(crc)] ^
+ slice3[(uint8_t)(crc >> 8)] ^
+ slice2[(uint8_t)(crc >> 16)] ^
+ slice1[(uint8_t)(crc >> 24)];
+ }
+ crc = bswap4(crc);
+ for (i = data_len & 3, data += (data_len & 3); i != 0; i--)
+ crc = (crc << 8) ^
+ bswap4(slice1[(crc >> 24) ^ *(data - i)]);
+
+ return crc;
+}
+
+/**
+ * @brief Performs one folding round
+ *
+ * Logically function operates as follows:
+ * DATA = READ_NEXT_16BYTES();
+ * F1 = LSB8(FOLD)
+ * F2 = MSB8(FOLD)
+ * T1 = CLMUL( F1, K1 )
+ * T2 = CLMUL( F2, K2 )
+ * FOLD = XOR( T1, T2, DATA )
+ *
+ * @param data_block 16 byte data block
+ * @param k1_k2 k1 and k2 constanst enclosed in XMM register
+ * @param fold running 16 byte folded data
+ *
+ * @return New 16 byte folded data
+ */
+__forceinline
+__m128i crc32_folding_round(const __m128i data_block,
+ const __m128i k1_k2,
+ const __m128i fold)
+{
+ __m128i tmp = _mm_clmulepi64_si128(fold, k1_k2, 0x11);
+
+ return _mm_xor_si128(_mm_clmulepi64_si128(fold, k1_k2, 0x00),
+ _mm_xor_si128(data_block, tmp));
+}
+
+/**
+ * @brief Performs Barret's reduction from 128 bits to 64 bits
+ *
+ * @param data128 128 bits data to be reduced
+ * @param k3_q k3 and Q constants enclosed in XMM register
+ *
+ * @return data reduced to 64 bits
+ */
+__forceinline
+__m128i crc32_reduce_128_to_64(__m128i data128, const __m128i k3_q)
+{
+ __m128i tmp;
+
+ tmp = _mm_xor_si128(_mm_clmulepi64_si128(data128, k3_q, 0x01 /* k3 */),
+ data128);
+
+ data128 = _mm_xor_si128(_mm_clmulepi64_si128(tmp, k3_q, 0x01 /* k3 */),
+ data128);
+
+ return _mm_srli_si128(_mm_slli_si128(data128, 8), 8);
+}
+
+/**
+ * @brief Performs Barret's reduction from 64 bits to 32 bits
+ *
+ * @param data64 64 bits data to be reduced
+ * @param k3_q k3 and Q constants enclosed in XMM register
+ * @param p_res P constant enclosed in XMM register
+ *
+ * @return data reduced to 32 bits
+ */
+__forceinline
+uint32_t
+crc32_reduce_64_to_32(__m128i fold, const __m128i k3_q, const __m128i p_res)
+{
+ __m128i temp;
+
+ temp = _mm_clmulepi64_si128(_mm_srli_si128(fold, 4),
+ k3_q, 0x10 /* Q */);
+ temp = _mm_srli_si128(_mm_xor_si128(temp, fold), 4);
+ temp = _mm_clmulepi64_si128(temp, p_res, 0 /* P */);
+ return _mm_extract_epi32(_mm_xor_si128(temp, fold), 0);
+}
+
+/**
+ * @brief Calculates 32 bit CRC for given \a data block by applying folding and
+ * reduction methods.
+ *
+ * Algorithm operates on 32 bit CRCs so polynomials and initial values may
+ * need to be promoted to 32 bits where required.
+ *
+ * @param crc initial CRC value (32 bit value)
+ * @param data pointer to data block
+ * @param data_len length of \a data block in bytes
+ * @param params pointer to PCLMULQDQ CRC calculation context
+ *
+ * @return CRC for given \a data block (32 bits wide).
+ */
+__forceinline
+uint32_t
+crc32_calc_pclmulqdq(const uint8_t *data,
+ uint32_t data_len, uint32_t crc,
+ const struct crc_pclmulqdq_ctx *params)
+{
+ __m128i temp, fold, k, swap;
+ uint32_t n;
+
+ if (unlikely(data == NULL || data_len == 0 || params == NULL))
+ return crc;
+
+#ifdef __KERNEL__
+ /**
+ * Preserve FPU context
+ */
+ kernel_fpu_begin();
+#endif
+
+ /**
+ * Add 4 bytes to data block size
+ * This is to secure the following:
+ * CRC32 = M(X)^32 mod P(X)
+ * M(X) - message to compute CRC on
+ * P(X) - CRC polynomial
+ */
+ data_len += 4;
+
+ /**
+ * Load first 16 data bytes in \a fold and
+ * set \a swap BE<->LE 16 byte conversion variable
+ */
+ fold = _mm_loadu_si128((__m128i *)data);
+ swap = crc_xmm_be_le_swap128;
+
+ /**
+ * -------------------------------------------------
+ * Folding all data into single 16 byte data block
+ * Assumes: \a fold holds first 16 bytes of data
+ */
+
+ if (unlikely(data_len <= 16)) {
+ /**
+ * Data block fits into 16 byte block
+ * - adjust data block
+ * - 4 least significant bytes need to be zero
+ */
+ fold = _mm_shuffle_epi8(fold, swap);
+ fold = _mm_slli_si128(xmm_shift_right(fold, 20 - data_len), 4);
+
+ /**
+ * Apply CRC init value
+ */
+ temp = _mm_insert_epi32(_mm_setzero_si128(), bswap4(crc), 0);
+ temp = xmm_shift_left(temp, data_len - 4);
+ fold = _mm_xor_si128(fold, temp);
+ } else {
+ /**
+ * There are 2x16 data blocks or more
+ */
+ __m128i next_data;
+
+ /**
+ * n = number of bytes required to align \a data_len
+ * to multiple of 16
+ */
+ n = ((~data_len) + 1) & 15;
+
+ /**
+ * Apply CRC initial value and
+ * get \a fold to BE format
+ */
+ fold = _mm_xor_si128(fold,
+ _mm_insert_epi32(_mm_setzero_si128(),
+ crc, 0));
+ fold = _mm_shuffle_epi8(fold, swap);
+
+ /**
+ * Load next 16 bytes of data and
+ * adjust \a fold & \a next_data as follows:
+ *
+ * CONCAT(fold,next_data) >> (n*8)
+ */
+ next_data = _mm_loadu_si128((__m128i *)&data[16]);
+ next_data = _mm_shuffle_epi8(next_data, swap);
+ next_data = _mm_or_si128(xmm_shift_right(next_data, n),
+ xmm_shift_left(fold, 16 - n));
+ fold = xmm_shift_right(fold, n);
+
+ if (unlikely(data_len <= 32))
+ /**
+ * In such unlikely case clear 4 least significant bytes
+ */
+ next_data =
+ _mm_slli_si128(_mm_srli_si128(next_data, 4), 4);
+
+ /**
+ * Do the initial folding round on 2 first 16 byte chunks
+ */
+ k = _mm_load_si128((__m128i *)(¶ms->k1));
+ fold = crc32_folding_round(next_data, k, fold);
+
+ if (likely(data_len > 32)) {
+ /**
+ * \a data_block needs to be at least 48 bytes long
+ * in order to get here
+ */
+ __m128i new_data;
+
+ /**
+ * Main folding loop
+ * - n is adjusted to point to next 16 data block
+ * to read
+ * (16+16) = 2x16; represents 2 first data blocks
+ * processed above
+ * (- n) is the number of zero bytes padded to
+ * the message in order to align it to 16 bytes
+ * - the last 16 bytes is processed separately
+ */
+ for (n = 16 + 16 - n; n < (data_len - 16); n += 16) {
+ new_data = _mm_loadu_si128((__m128i *)&data[n]);
+ new_data = _mm_shuffle_epi8(new_data, swap);
+ fold = crc32_folding_round(new_data, k, fold);
+ }
+
+ /**
+ * The last folding round works always on 12 bytes
+ * (12 bytes of data and 4 zero bytes)
+ * Read from offset -4 is to avoid one
+ * shift right operation.
+ */
+ new_data = _mm_loadu_si128((__m128i *)&data[n - 4]);
+ new_data = _mm_shuffle_epi8(new_data, swap);
+ new_data = _mm_slli_si128(new_data, 4);
+ fold = crc32_folding_round(new_data, k, fold);
+ } /* if (data_len > 32) */
+ }
+
+ /**
+ * -------------------------------------------------
+ * Reduction 128 -> 32
+ * Assumes: \a fold holds 128bit folded data
+ */
+
+ /**
+ * REDUCTION 128 -> 64
+ */
+ k = _mm_load_si128((__m128i *)(¶ms->k3));
+ fold = crc32_reduce_128_to_64(fold, k);
+
+ /**
+ * REDUCTION 64 -> 32
+ */
+ n = crc32_reduce_64_to_32(fold, k,
+ _mm_load_si128((__m128i *)(¶ms->p)));
+
+#ifdef __KERNEL__
+ /**
+ * - restore FPU context
+ */
+ kernel_fpu_end();
+#endif
+
+ return n;
+}
+
+#endif /* __CRC_H__ */
diff --git a/openair1/PHY/CODING/crcext.h b/openair1/PHY/CODING/crcext.h
new file mode 100644
index 0000000000..f441f25e50
--- /dev/null
+++ b/openair1/PHY/CODING/crcext.h
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ Copyright (c) 2009-2018, Intel Corporation
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of Intel Corporation nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+/**
+ * Header file with CRC external definitions
+ *
+ */
+
+#ifndef __CRCEXT_H__
+#define __CRCEXT_H__
+
+#include
+#include "types.h"
+/**
+ * Flag indicating availability of PCLMULQDQ instruction
+ * Only valid after running CRCInit() function.
+ */
+extern int pclmulqdq_available;
+
+/**
+ * Flag indicating availability of PCLMULQDQ instruction
+ * Only valid after running CRCInit() function.
+ */
+extern __m128i crc_xmm_be_le_swap128;
+extern const uint8_t crc_xmm_shift_tab[48];
+
+/**
+ * @brief Shifts right 128 bit register by specified number of bytes
+ *
+ * @param reg 128 bit value
+ * @param num number of bytes to shift right \a reg by (0-16)
+ *
+ * @return \a reg >> (\a num * 8)
+ */
+__forceinline
+__m128i xmm_shift_right(__m128i reg, const unsigned int num)
+{
+ const __m128i *p = (const __m128i *)(crc_xmm_shift_tab + 16 + num);
+
+ return _mm_shuffle_epi8(reg, _mm_loadu_si128(p));
+}
+
+/**
+ * @brief Shifts left 128 bit register by specified number of bytes
+ *
+ * @param reg 128 bit value
+ * @param num number of bytes to shift left \a reg by (0-16)
+ *
+ * @return \a reg << (\a num * 8)
+ */
+__forceinline
+__m128i xmm_shift_left(__m128i reg, const unsigned int num)
+{
+ const __m128i *p = (const __m128i *)(crc_xmm_shift_tab + 16 - num);
+
+ return _mm_shuffle_epi8(reg, _mm_loadu_si128(p));
+}
+
+/**
+ * @brief Initializes CRC module.
+ * @note It is mandatory to run it before using any of CRC API's.
+ */
+extern void CRCInit(void);
+
+#endif /* __CRCEXT_H__ */
diff --git a/openair1/PHY/CODING/defs_NB_IoT.h b/openair1/PHY/CODING/defs_NB_IoT.h
index 2a6bee7924..d33ae1c440 100644
--- a/openair1/PHY/CODING/defs_NB_IoT.h
+++ b/openair1/PHY/CODING/defs_NB_IoT.h
@@ -30,14 +30,6 @@
#include // for uint8/16/32_t
-/* check if this ifndef is required for NB-IoT ?!
-//#ifndef NO_OPENAIR1
-//#include "PHY/defs_NB_IoT.h"
-//#else
-//#include "PHY/TOOLS/time_meas.h"
-//#endif
-*/
-
#define CRC24_A_NB_IoT 0
#define CRC24_B_NB_IoT 1
#define CRC16_NB_IoT 2
diff --git a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_init_mem.h b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_init_mem.h
index 3292c0debe..f08549130e 100644
--- a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_init_mem.h
+++ b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_init_mem.h
@@ -34,7 +34,6 @@
#include
#include "nrLDPC_types.h"
-#ifndef malloc32_clear
/**
\brief Allocates 32 byte aligned memory and initializes to zero
\param size Input size in bytes
@@ -46,7 +45,6 @@ static inline void* malloc32_clear(size_t size)
memset(ptr, 0, size);
return ptr;
}
-#endif
/**
\brief Allocates and initializes the internal decoder processing buffers
diff --git a/openair1/PHY/CODING/nrLDPC_defs.h b/openair1/PHY/CODING/nrLDPC_defs.h
index 321ecaab7d..67248d971c 100644
--- a/openair1/PHY/CODING/nrLDPC_defs.h
+++ b/openair1/PHY/CODING/nrLDPC_defs.h
@@ -22,6 +22,7 @@
// encoder interface
#ifndef __NRLDPC_DEFS__H__
#define __NRLDPC_DEFS__H__
+#include
#include "openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_types.h"
/**
\brief LDPC encoder
@@ -36,13 +37,27 @@
\param 9-12 time_stats_t *tinput,*tprep, *tparity,*toutput
*/
typedef struct {
- int n_segments; // optim8seg
+ unsigned int n_segments; // optim8seg
unsigned int macro_num; // optim8segmulti
unsigned char gen_code; //orig
time_stats_t *tinput;
time_stats_t *tprep;
time_stats_t *tparity;
time_stats_t *toutput;
+ int Kr;
+ uint32_t Kb;
+ uint32_t *Zc;
+ void *harq;
+ /// Encoder BG
+ uint8_t BG;
+ /// Interleaver outputs
+ unsigned char *output;
+ /// Number of bits in "small" code segments
+ uint32_t K;
+ /// Number of "Filler" bits
+ uint32_t F;
+ /// LDPC-code outputs
+ uint8_t *d[MAX_NUM_NR_DLSCH_SEGMENTS];
}encoder_implemparams_t;
#define INIT0_LDPCIMPLEMPARAMS {0,0,0,NULL,NULL,NULL,NULL}
typedef void(*nrLDPC_initcallfunc_t)(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_out);
diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c
index 738fd49b7d..2286846695 100644
--- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c
+++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c
@@ -73,9 +73,18 @@
-static inline void encode_parity_check_part_optim(uint8_t *c,uint8_t *d, short BG,short Zc,short Kb)
+static void encode_parity_check_part_optim(uint8_t *cc,uint8_t *d, short BG,short Zc,short Kb, int simd_size, int ncols)
{
-
+ unsigned char c[2*22*Zc*simd_size] __attribute__((aligned(32))); //double size matrix of c
+
+ for (int i1=0; i1 < ncols; i1++) {
+ memcpy(&c[2*i1*Zc], &cc[i1*Zc], Zc*sizeof(unsigned char));
+ memcpy(&c[(2*i1+1)*Zc], &cc[i1*Zc], Zc*sizeof(unsigned char));
+ }
+ for (int i1=1;i1176) || (BG==2 && Zc>64)) {
// extend matrix
if(impp->tprep != NULL) start_meas(impp->tprep);
- for (i1=0; i1 < ncols; i1++)
- {
- memcpy(&c_extension[2*i1*Zc], &c[i1*Zc], Zc*sizeof(unsigned char));
- memcpy(&c_extension[(2*i1+1)*Zc], &c[i1*Zc], Zc*sizeof(unsigned char));
- }
- for (i1=1;i1tprep != NULL) stop_meas(impp->tprep);
//parity check part
if(impp->tparity != NULL) start_meas(impp->tparity);
- encode_parity_check_part_optim(c_extension, d, BG, Zc, Kb);
+ encode_parity_check_part_optim(c, d, BG, Zc, Kb,simd_size, ncols);
if(impp->tparity != NULL) stop_meas(impp->tparity);
}
else {
diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c
index a974e86e27..460ee80a21 100644
--- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c
+++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c
@@ -102,7 +102,6 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc
unsigned char c[22*Zc] __attribute__((aligned(32))); //padded input, unpacked, max size
unsigned char d[46*Zc] __attribute__((aligned(32))); //coded parity part output, unpacked, max size
- unsigned char c_extension[2*22*Zc*simd_size] __attribute__((aligned(32))); //double size matrix of c
// calculate number of punctured bits
no_punctured_columns=(int)((nrows-2)*Zc+block_length-block_length*rate)/Zc;
@@ -151,24 +150,10 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc
if ((BG==1 && Zc>176) || (BG==2 && Zc>64)) {
// extend matrix
if(impp->tprep != NULL) start_meas(impp->tprep);
- for (i1=0; i1 < ncols; i1++)
- {
- memcpy(&c_extension[2*i1*Zc], &c[i1*Zc], Zc*sizeof(unsigned char));
- memcpy(&c_extension[(2*i1+1)*Zc], &c[i1*Zc], Zc*sizeof(unsigned char));
- }
- for (i1=1;i1tprep != NULL) stop_meas(impp->tprep);
//parity check part
if(impp->tparity != NULL) start_meas(impp->tparity);
- encode_parity_check_part_optim(c_extension, d, BG, Zc, Kb);
+ encode_parity_check_part_optim(c, d, BG, Zc, Kb, simd_size, ncols);
if(impp->tparity != NULL) stop_meas(impp->tparity);
}
else {
diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c
index b21f875b32..57643a1bd8 100644
--- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c
+++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c
@@ -38,18 +38,19 @@
#include "common/utils/LOG/log.h"
#include "PHY/TOOLS/time_meas.h"
#include "openair1/PHY/CODING/nrLDPC_defs.h"
-
//#define DEBUG_LDPC
#include "ldpc_encode_parity_check.c"
#include "ldpc_generate_coefficient.c"
-int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc,int Kb,short block_length, short BG, encoder_implemparams_t *impp)
+int nrLDPC_encod(unsigned char **input,unsigned char **output,int Zc,int Kb,short block_length, short BG, encoder_implemparams_t *impp)
{
+ //set_log(PHY, 4);
+
- short nrows=0,ncols=0;
- int i,i1,j,rate=3;
+ int nrows=0,ncols=0;
+ int rate=3;
int no_punctured_columns,removed_bit;
//Table of possible lifting sizes
char temp;
@@ -95,8 +96,8 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc
}
#ifdef DEBUG_LDPC
- LOG_D(PHY,"ldpc_encoder_optim_8seg: BG %d, Zc %d, Kb %d, block_length %d, segments %d\n",BG,Zc,Kb,block_length,n_segments);
- LOG_D(PHY,"ldpc_encoder_optim_8seg: PDU (seg 0) %x %x %x %x\n",test_input[0][0],test_input[0][1],test_input[0][2],test_input[0][3]);
+ LOG_D(PHY,"ldpc_encoder_optim_8seg: BG %d, Zc %d, Kb %d, block_length %d, segments %d\n",BG,Zc,Kb,block_length,impp->n_segments);
+ LOG_D(PHY,"ldpc_encoder_optim_8seg: PDU (seg 0) %x %x %x %x\n",input[0][0],input[0][1],input[0][2],input[0][3]);
#endif
AssertFatal(Zc>0,"no valid Zc found for block length %d\n",block_length);
@@ -104,10 +105,8 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc
if ((Zc&31) > 0) simd_size = 16;
else simd_size = 32;
- unsigned char c[22*Zc] __attribute__((aligned(32))); //padded input, unpacked, max size
- unsigned char d[46*Zc] __attribute__((aligned(32))); //coded parity part output, unpacked, max size
-
- unsigned char c_extension[2*22*Zc*simd_size] __attribute__((aligned(32))); //double size matrix of c
+ unsigned char cc[22*Zc] __attribute__((aligned(32))); //padded input, unpacked, max size
+ unsigned char dd[46*Zc] __attribute__((aligned(32))); //coded parity part output, unpacked, max size
// calculate number of punctured bits
no_punctured_columns=(int)((nrows-2)*Zc+block_length-block_length*rate)/Zc;
@@ -115,8 +114,8 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc
//printf("%d\n",no_punctured_columns);
//printf("%d\n",removed_bit);
// unpack input
- memset(c,0,sizeof(unsigned char) * ncols * Zc);
- memset(d,0,sizeof(unsigned char) * nrows * Zc);
+ memset(cc,0,sizeof(unsigned char) * ncols * Zc);
+ memset(dd,0,sizeof(unsigned char) * nrows * Zc);
if(impp->tinput != NULL) start_meas(impp->tinput);
#if 0
@@ -124,29 +123,29 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc
//for (j=0; j>(i&7);
+ temp = (input[j][i/8]&(1<<(i&7)))>>(i&7);
//printf("c(%d,%d)=%d\n",j,i,temp);
c[i] |= (temp << (j-macro_segment));
}
}
#else
#ifdef __AVX2__
- for (i=0; i>5; i++) {
- c256 = _mm256_and_si256(_mm256_cmpeq_epi8(_mm256_andnot_si256(_mm256_shuffle_epi8(_mm256_set1_epi32(((uint32_t*)test_input[macro_segment])[i]), shufmask),andmask),zero256),masks[0]);
+ for (int i=0; i>5; i++) {
+ c256 = _mm256_and_si256(_mm256_cmpeq_epi8(_mm256_andnot_si256(_mm256_shuffle_epi8(_mm256_set1_epi32(((uint32_t*)input[macro_segment])[i]), shufmask),andmask),zero256),masks[0]);
//for (j=1; j>5)<<5;i>5)<<5;i>(i&7)))>>(7-(i&7));
+ temp = (input[j][i/8]&(128>>(i&7)))>>(7-(i&7));
//printf("c(%d,%d)=%d\n",j,i,temp);
- c[i] |= (temp << (j-macro_segment));
+ cc[i] |= (temp << (j-macro_segment));
}
}
#else
@@ -159,28 +158,14 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc
if ((BG==1 && Zc>176) || (BG==2 && Zc>64)) {
// extend matrix
if(impp->tprep != NULL) start_meas(impp->tprep);
- for (i1=0; i1 < ncols; i1++)
- {
- memcpy(&c_extension[2*i1*Zc], &c[i1*Zc], Zc*sizeof(unsigned char));
- memcpy(&c_extension[(2*i1+1)*Zc], &c[i1*Zc], Zc*sizeof(unsigned char));
- }
- for (i1=1;i1tprep != NULL) stop_meas(impp->tprep);
//parity check part
if(impp->tparity != NULL) start_meas(impp->tparity);
- encode_parity_check_part_optim(c_extension, d, BG, Zc, Kb);
+ encode_parity_check_part_optim(cc, dd, BG, Zc, Kb, simd_size, ncols);
if(impp->tparity != NULL) stop_meas(impp->tparity);
}
else {
- if (encode_parity_check_part_orig(c, d, BG, Zc, Kb, block_length)!=0) {
+ if (encode_parity_check_part_orig(cc, dd, BG, Zc, Kb, block_length)!=0) {
printf("Problem with encoder\n");
return(-1);
}
@@ -188,8 +173,8 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc
if(impp->toutput != NULL) start_meas(impp->toutput);
// information part and puncture columns
/*
- memcpy(&channel_input[0], &c[2*Zc], (block_length-2*Zc)*sizeof(unsigned char));
- memcpy(&channel_input[block_length-2*Zc], &d[0], ((nrows-no_punctured_columns) * Zc-removed_bit)*sizeof(unsigned char));
+ memcpy(&output[0], &c[2*Zc], (block_length-2*Zc)*sizeof(unsigned char));
+ memcpy(&output[block_length-2*Zc], &d[0], ((nrows-no_punctured_columns) * Zc-removed_bit)*sizeof(unsigned char));
*/
#ifdef __AVX2__
if ((((2*Zc)&31) == 0) && (((block_length-(2*Zc))&31) == 0)) {
@@ -197,34 +182,34 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc
//AssertFatal(((block_length-(2*Zc))&31) == 0,"block_length-(2*Zc) needs to be a multiple of 32 for now\n");
uint32_t l1 = (block_length-(2*Zc))>>5;
uint32_t l2 = ((nrows-no_punctured_columns) * Zc-removed_bit)>>5;
- __m256i *c256p = (__m256i *)&c[2*Zc];
- __m256i *d256p = (__m256i *)&d[0];
+ __m256i *c256p = (__m256i *)&cc[2*Zc];
+ __m256i *d256p = (__m256i *)&dd[0];
// if (((block_length-(2*Zc))&31)>0) l1++;
- for (i=0;i0) l2++;
- for (i1=0;i1>(j-macro_segment))&1;
- for (i=0;i<((nrows-no_punctured_columns) * Zc-removed_bit);i++)
+ for (int j=macro_segment; j < macro_segment_end; j++)
+ output[j][i] = (cc[2*Zc+i]>>(j-macro_segment))&1;
+ for (int i=0;i<((nrows-no_punctured_columns) * Zc-removed_bit);i++)
//for (j=0; j>(j-macro_segment))&1;
+ for (int j=macro_segment; j < macro_segment_end; j++)
+ output[j][block_length-2*Zc+i] = (dd[i]>>(j-macro_segment))&1;
}
#else
diff --git a/openair1/PHY/CODING/types.h b/openair1/PHY/CODING/types.h
new file mode 100644
index 0000000000..2bc7739e36
--- /dev/null
+++ b/openair1/PHY/CODING/types.h
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ Copyright (c) 2009-2018, Intel Corporation
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of Intel Corporation nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+/* Common data types, macros and functions used across the CRC library */
+
+#ifndef CRC_TYPES_H_
+#define CRC_TYPES_H_
+
+#ifdef __KERNEL__
+#include
+#include
+typedef uint32_t uint_fast32_t;
+typedef uint16_t uint_fast16_t;
+typedef uint8_t uint_fast8_t;
+#else
+#include
+#include
+#endif
+
+/* Declare variable at address aligned to a boundary */
+#define DECLARE_ALIGNED(_declaration, _boundary) \
+ _declaration __attribute__((aligned(_boundary)))
+
+/* Macro to make function to be always inlined */
+#ifndef DEBUG
+#define __forceinline \
+ static inline __attribute__((always_inline))
+#else
+#define __forceinline \
+ static
+#endif
+
+/* Likely & unliekly hints for the compiler */
+#define likely(x) __builtin_expect(!!(x), 1)
+#define unlikely(x) __builtin_expect(!!(x), 0)
+
+/* Macro to get dimension of an array */
+#ifndef DIM
+#define DIM(x) (sizeof(x)/sizeof(x[0]))
+#endif
+
+/**
+ * Common functions
+ */
+
+/**
+ * @brief Swaps bytes in 16 bit word
+ *
+ * @param val 16 bit data value
+ *
+ * @return byte swapped value
+ */
+__forceinline uint16_t bswap2(const uint16_t val)
+{
+ return (uint16_t) ((val >> 8) | (val << 8));
+}
+
+/**
+ * @brief Swaps bytes in 32 bit word
+ * ABCD -> DCBA
+ *
+ * @param val 32 bit data value
+ *
+ * @return byte swapped value
+ */
+__forceinline uint32_t bswap4(const uint32_t val)
+{
+ return ((val >> 24) | /**< A*/
+ ((val & 0xff0000) >> 8) | /**< B*/
+ ((val & 0xff00) << 8) | /**< C*/
+ (val << 24)); /**< D*/
+}
+
+#endif /* CRC_TYPES_H_ */
diff --git a/openair1/PHY/INIT/nr_parms.c b/openair1/PHY/INIT/nr_parms.c
index 0920da667d..42d4a30e3b 100644
--- a/openair1/PHY/INIT/nr_parms.c
+++ b/openair1/PHY/INIT/nr_parms.c
@@ -27,6 +27,58 @@
uint32_t nr_subcarrier_spacing[MAX_NUM_SUBCARRIER_SPACING] = {15e3, 30e3, 60e3, 120e3, 240e3};
uint16_t nr_slots_per_subframe[MAX_NUM_SUBCARRIER_SPACING] = {1, 2, 4, 8, 16};
+// Table 5.4.3.3-1 38-101
+int nr_ssb_table[48][3] = {
+ {1, 15, nr_ssb_type_A},
+ {2, 15, nr_ssb_type_A},
+ {3, 15, nr_ssb_type_A},
+ {5, 15, nr_ssb_type_A},
+ {5, 30, nr_ssb_type_B},
+ {7, 15, nr_ssb_type_A},
+ {8, 15, nr_ssb_type_A},
+ {12, 15, nr_ssb_type_A},
+ {14, 15, nr_ssb_type_A},
+ {18, 15, nr_ssb_type_A},
+ {20, 15, nr_ssb_type_A},
+ {25, 15, nr_ssb_type_A},
+ {26, 15, nr_ssb_type_A},
+ {28, 15, nr_ssb_type_A},
+ {29, 15, nr_ssb_type_A},
+ {30, 15, nr_ssb_type_A},
+ {34, 15, nr_ssb_type_A},
+ {34, 30, nr_ssb_type_C},
+ {38, 15, nr_ssb_type_A},
+ {38, 30, nr_ssb_type_C},
+ {39, 15, nr_ssb_type_A},
+ {39, 30, nr_ssb_type_C},
+ {40, 30, nr_ssb_type_C},
+ {41, 15, nr_ssb_type_A},
+ {41, 30, nr_ssb_type_C},
+ {46, 30, nr_ssb_type_C},
+ {48, 30, nr_ssb_type_C},
+ {50, 30, nr_ssb_type_C},
+ {51, 15, nr_ssb_type_A},
+ {53, 15, nr_ssb_type_A},
+ {65, 15, nr_ssb_type_A},
+ {66, 15, nr_ssb_type_A},
+ {66, 30, nr_ssb_type_B},
+ {70, 15, nr_ssb_type_A},
+ {71, 15, nr_ssb_type_A},
+ {74, 15, nr_ssb_type_A},
+ {75, 15, nr_ssb_type_A},
+ {76, 15, nr_ssb_type_A},
+ {77, 30, nr_ssb_type_C},
+ {78, 30, nr_ssb_type_C},
+ {79, 30, nr_ssb_type_C},
+ {90, 15, nr_ssb_type_A},
+ {90, 30, nr_ssb_type_C},
+ {91, 15, nr_ssb_type_A},
+ {92, 15, nr_ssb_type_A},
+ {93, 15, nr_ssb_type_A},
+ {94, 15, nr_ssb_type_A},
+ {96, 30, nr_ssb_type_C}
+};
+
void set_Lmax(NR_DL_FRAME_PARMS *fp) {
// definition of Lmax according to ts 38.213 section 4.1
@@ -85,27 +137,28 @@ int nr_get_ssb_start_symbol(NR_DL_FRAME_PARMS *fp,uint8_t i_ssb) {
void set_scs_parameters (NR_DL_FRAME_PARMS *fp, int mu, int N_RB_DL)
{
+ int idx = 0;
switch(mu) {
-
case NR_MU_0: //15kHz scs
fp->subcarrier_spacing = nr_subcarrier_spacing[NR_MU_0];
fp->slots_per_subframe = nr_slots_per_subframe[NR_MU_0];
fp->ssb_type = nr_ssb_type_A;
+ while(nr_ssb_table[idx][0]!=fp->nr_band)
+ idx++;
+ AssertFatal(nr_ssb_table[idx][1]==15,"SCS %d not applicable to band %d\n",
+ fp->subcarrier_spacing,fp->nr_band);
break;
case NR_MU_1: //30kHz scs
fp->subcarrier_spacing = nr_subcarrier_spacing[NR_MU_1];
fp->slots_per_subframe = nr_slots_per_subframe[NR_MU_1];
-
- // selection of SS block pattern according to TS 38101-1 Table 5.4.3.3-1 for SCS 30kHz
- if (fp->nr_band == 5 || fp->nr_band == 66)
- fp->ssb_type = nr_ssb_type_B;
- else{
- if (fp->nr_band == 41 || fp->nr_band == 38 || ( fp->nr_band > 76 && fp->nr_band < 80) )
- fp->ssb_type = nr_ssb_type_C;
- else
- AssertFatal(1==0,"NR Operating Band n%d not available for SS block SCS with mu=%d\n", fp->nr_band, mu);
+ while(nr_ssb_table[idx][0]!=fp->nr_band ||
+ nr_ssb_table[idx][1]!=30) {
+ AssertFatal(nr_ssb_table[idx][0]<=fp->nr_band,"SCS %d not applicable to band %d\n",
+ fp->subcarrier_spacing,fp->nr_band);
+ idx++;
}
+ fp->ssb_type = nr_ssb_table[idx][2];
break;
case NR_MU_2: //60kHz scs
diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c
index 1913afab2d..99f37c1323 100644
--- a/openair1/PHY/LTE_TRANSPORT/dci.c
+++ b/openair1/PHY/LTE_TRANSPORT/dci.c
@@ -50,8 +50,6 @@
//#define DEBUG_DCI_DECODING 1
//#define DEBUG_PHY
-//#undef ALL_AGGREGATION
-
//extern uint16_t phich_reg[MAX_NUM_PHICH_GROUPS][3];
//extern uint16_t pcfich_reg[4];
diff --git a/openair1/PHY/LTE_TRANSPORT/dci_NB_IoT.h b/openair1/PHY/LTE_TRANSPORT/dci_NB_IoT.h
index 60720e13b7..512316f565 100644
--- a/openair1/PHY/LTE_TRANSPORT/dci_NB_IoT.h
+++ b/openair1/PHY/LTE_TRANSPORT/dci_NB_IoT.h
@@ -32,11 +32,8 @@
#ifndef __DCI_NB_IOT_H__
#define __DCI_NB_IOT_H__
-//#ifndef USER_MODE
-//#include "PHY/types.h"
-//#else
#include
-//#endif
+
typedef enum
{
diff --git a/openair1/PHY/LTE_TRANSPORT/print_stats.c b/openair1/PHY/LTE_TRANSPORT/print_stats.c
index 031c97e50d..44f57f4304 100644
--- a/openair1/PHY/LTE_TRANSPORT/print_stats.c
+++ b/openair1/PHY/LTE_TRANSPORT/print_stats.c
@@ -36,10 +36,8 @@
#include "PHY/extern.h"
#include "SCHED/extern.h"
-#ifdef OPENAIR2
#include "openair2/LAYER2/MAC/proto.h"
#include "openair2/RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
-#endif
extern int mac_get_rrc_status(uint8_t Mod_id,uint8_t eNB_flag,uint8_t index);
@@ -434,10 +432,8 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char *buffer, int length
break;
}
-#ifdef OPENAIR2
RRC_status = mac_UE_get_rrc_status(ue->Mod_id, 0);
len += sprintf(&buffer[len],"[UE PROC] RRC status = %d\n",RRC_status);
-#endif
len += sprintf(&buffer[len], "[UE PROC] Transmission Mode %d \n",ue->transmission_mode[eNB]);
len += sprintf(&buffer[len], "[UE PROC] PBCH err conseq %d, PBCH error total %d, PBCH FER %d\n",
ue->pbch_vars[eNB]->pdu_errors_conseq,
diff --git a/openair1/PHY/LTE_TRANSPORT/uci_NB_IoT.h b/openair1/PHY/LTE_TRANSPORT/uci_NB_IoT.h
index 6f2dd0f989..c16be6a308 100644
--- a/openair1/PHY/LTE_TRANSPORT/uci_NB_IoT.h
+++ b/openair1/PHY/LTE_TRANSPORT/uci_NB_IoT.h
@@ -321,4 +321,4 @@ HLC_subband_cqi_mcs_CBA_20MHz_NB_IoT;
#define MAX_ACK_PAYLOAD_NB_IoT 18
#define MAX_RI_PAYLOAD_NB_IoT 6
-#endif
\ No newline at end of file
+#endif
diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dci_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/dci_ue.c
index 3c7e3f986b..0d8c3c9960 100644
--- a/openair1/PHY/LTE_UE_TRANSPORT/dci_ue.c
+++ b/openair1/PHY/LTE_UE_TRANSPORT/dci_ue.c
@@ -50,9 +50,6 @@
//#define DEBUG_DCI_DECODING 1
//#define DEBUG_PHY
-//#undef ALL_AGGREGATION
-
-
uint16_t extract_crc(uint8_t *dci,uint8_t dci_len)
{
@@ -2802,7 +2799,6 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
if (dci_cnt>old_dci_cnt)
return(dci_cnt);
- //#ifdef ALL_AGGREGATION
// Now check UE_SPEC format 1 search spaces at aggregation 8
old_dci_cnt=dci_cnt;
dci_decoding_procedure0(pdcch_vars,0,mode,subframe,
@@ -2836,7 +2832,6 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
if (dci_cnt>old_dci_cnt)
return(dci_cnt);
- //#endif //ALL_AGGREGATION
} else if (tmode == 3) {
@@ -2946,7 +2941,6 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
if (dci_cnt>old_dci_cnt)
return(dci_cnt);
- //#ifdef ALL_AGGREGATION
// Now check UE_SPEC format 2_2A search spaces at aggregation 8
LOG_D(PHY," Now check UE_SPEC format 2_2A search spaces at aggregation 8 dci length: %d[bits] %d[bytes]\n",format2A_size_bits,format2A_size_bytes);
old_dci_cnt=dci_cnt;
@@ -3082,7 +3076,6 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
if (dci_cnt>old_dci_cnt)
return(dci_cnt);
- //#ifdef ALL_AGGREGATION
// Now check UE_SPEC format 2_2A search spaces at aggregation 8
old_dci_cnt=dci_cnt;
dci_decoding_procedure0(pdcch_vars,0,mode,
@@ -3214,7 +3207,6 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
if (dci_cnt>old_dci_cnt)
return(dci_cnt);
- //#ifdef ALL_AGGREGATION
// Now check UE_SPEC format 1E_2A_M10PRB search spaces at aggregation 8
old_dci_cnt=dci_cnt;
@@ -3249,7 +3241,6 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
if (dci_cnt>old_dci_cnt)
return(dci_cnt);
- //#endif //ALL_AGGREGATION
}
diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c
index 9906b945d8..91de5386ae 100644
--- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c
+++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c
@@ -51,7 +51,6 @@
#include
#include "linear_preprocessing_rec.h"
-#define NOCYGWIN_STATIC
//#define DEBUG_MMSE
diff --git a/openair1/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c b/openair1/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c
index b08fe30248..7ec3e7bfb6 100644
--- a/openair1/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c
+++ b/openair1/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c
@@ -42,7 +42,6 @@
//#define DEBUG_ULSCH_MODULATION
-#ifndef OFDMA_ULSCH
void dft_lte(int32_t *z,int32_t *d, int32_t Msc_PUSCH, uint8_t Nsymb)
{
@@ -371,7 +370,6 @@ void dft_lte(int32_t *z,int32_t *d, int32_t Msc_PUSCH, uint8_t Nsymb)
// printf("\n");
}
-#endif
void ulsch_modulation(int32_t **txdataF,
short amp,
uint32_t frame,
@@ -690,57 +688,10 @@ void ulsch_modulation(int32_t **txdataF,
// Transform Precoding
-#ifdef OFDMA_ULSCH
-
- for (i=0; iz[i] = ulsch->d[i];
- }
-
-#else
dft_lte(ulsch->z,ulsch->d,Msc_PUSCH,ulsch->Nsymb_pusch);
-#endif
DevAssert(txdataF);
-#ifdef OFDMA_ULSCH
- re_offset0 = frame_parms->first_carrier_offset + (ulsch->harq_processes[harq_pid]->first_rb*12);
-
- if (re_offset0>frame_parms->ofdm_symbol_size) {
- re_offset0 -= frame_parms->ofdm_symbol_size;
- // re_offset0++;
- }
-
- // printf("re_offset0 %d\n",re_offset0);
-
-
- for (j=0,l=0; l<(nsymb-ulsch->srs_active); l++) {
- re_offset = re_offset0;
- symbol_offset = (int)frame_parms->ofdm_symbol_size*(l+(subframe*nsymb));
-#ifdef DEBUG_ULSCH_MODULATION
- printf("symbol %d (subframe %d): symbol_offset %d\n",l,subframe,symbol_offset);
-#endif
- txptr = &txdataF[0][symbol_offset];
-
- if (((frame_parms->Ncp == 0) && ((l==3) || (l==10)))||
- ((frame_parms->Ncp == 1) && ((l==2) || (l==8)))) {
- }
- // Skip reference symbols
- else {
-
- // printf("copying %d REs\n",Msc_PUSCH);
- for (i=0; iz[j],((int16_t*)&ulsch->z[j])[0],((int16_t*)&ulsch->z[j])[1]);
-#endif
- txptr[re_offset++] = ulsch->z[j];
-
- if (re_offset==frame_parms->ofdm_symbol_size)
- re_offset = 0;
- }
- }
- }
-
-# else // OFDMA_ULSCH = 0
re_offset0 = frame_parms->first_carrier_offset + (ulsch->harq_processes[harq_pid]->first_rb*12);
if (re_offset0>frame_parms->ofdm_symbol_size) {
@@ -777,8 +728,5 @@ void ulsch_modulation(int32_t **txdataF,
}
}
-#endif
- VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_MODULATION, VCD_FUNCTION_OUT);
-
}
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c
index d75f97aa53..2c5c6d6d4a 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c
@@ -180,9 +180,12 @@ uint8_t nr_generate_pdsch(processingData_L1tx_t *msgTx,
/// CRC, coding, interleaving and rate matching
AssertFatal(harq->pdu!=NULL,"harq->pdu is null\n");
+ unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS] __attribute__((aligned(32)));
+ bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS);
start_meas(dlsch_encoding_stats);
nr_dlsch_encoding(gNB,
- harq->pdu, frame, slot, dlsch, frame_parms,tinput,tprep,tparity,toutput,
+ harq->pdu, frame, slot, dlsch, frame_parms, output,
+ tinput,tprep,tparity,toutput,
dlsch_rate_matching_stats,
dlsch_interleaving_stats,
dlsch_segmentation_stats);
@@ -197,7 +200,7 @@ uint8_t nr_generate_pdsch(processingData_L1tx_t *msgTx,
printf("\nEncoded payload:\n");
for (int i=0; i>3; i++) {
for (int j=0; j<8; j++)
- printf("%d", harq->f[(i<<3)+j]);
+ printf("%d", output[(i<<3)+j]);
printf("\t");
}
printf("\n");
@@ -210,7 +213,7 @@ uint8_t nr_generate_pdsch(processingData_L1tx_t *msgTx,
for (int q=0; qNrOfCodewords; q++)
memset((void*)scrambled_output[q], 0, (encoded_length>>5)*sizeof(uint32_t));
for (int q=0; qNrOfCodewords; q++)
- nr_pdsch_codeword_scrambling_optim(harq->f,
+ nr_pdsch_codeword_scrambling_optim(output,
encoded_length,
q,
rel15->dataScramblingId,
@@ -247,7 +250,7 @@ uint8_t nr_generate_pdsch(processingData_L1tx_t *msgTx,
}
#endif
-
+ start_meas(&gNB->dlsch_layer_mapping_stats);
/// Layer mapping
nr_layer_mapping(mod_symbs,
rel15->nrOfLayers,
@@ -265,6 +268,7 @@ uint8_t nr_generate_pdsch(processingData_L1tx_t *msgTx,
}
#endif
+ stop_meas(&gNB->dlsch_layer_mapping_stats);
/// Resource mapping
// Non interleaved VRB to PRB mapping
@@ -278,7 +282,7 @@ uint8_t nr_generate_pdsch(processingData_L1tx_t *msgTx,
printf("PDSCH resource mapping started (start SC %d\tstart symbol %d\tN_PRB %d\tnb_re %d,nb_layers %d)\n",
start_sc, rel15->StartSymbolIndex, rel15->rbSize, nb_re,rel15->nrOfLayers);
#endif
-
+ start_meas(&gNB->dlsch_resource_mapping_stats);
for (int ap=0; apnrOfLayers; ap++) {
// DMRS params for this ap
@@ -320,20 +324,13 @@ uint8_t nr_generate_pdsch(processingData_L1tx_t *msgTx,
dmrs_idx = (rel15->rbStart+rel15->BWPStart)*4;
}
}
- }
-
- // Update l_prime in the case of double DMRS config
- if ((dmrs_symbol_map & (1 << l))){ //DMRS time occasion
if (l==(l_overline+1)) //take into account the double DMRS symbols
l_prime = 1;
else if (l>(l_overline+1)) {//new DMRS pair
l_overline = l;
l_prime = 0;
}
- }
-
- /// DMRS QPSK modulation
- if (rel15->dlDmrsSymbPos & (1 << l)) {
+ /// DMRS QPSK modulation
nr_modulation(pdsch_dmrs[l][0], n_dmrs*2, DMRS_MOD_ORDER, mod_dmrs); // currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated
#ifdef DEBUG_DLSCH
@@ -358,69 +355,137 @@ uint8_t nr_generate_pdsch(processingData_L1tx_t *msgTx,
}
}
uint16_t k = start_sc;
- // Loop Over SCs:
- for (int i=0; irbSize*NR_NB_SC_PER_RB; i++) {
- /* check if cuurent RE is PTRS RE*/
- is_ptrs_re=0;
- /* check for PTRS symbol and set flag for PTRS RE */
- if(ptrs_symbol){
- is_ptrs_re = is_ptrs_subcarrier(k,
- rel15->rnti,
- ap,
- rel15->dmrsConfigType,
- rel15->PTRSFreqDensity,
- rel15->rbSize,
- rel15->PTRSReOffset,
- start_sc,
- frame_parms->ofdm_symbol_size);
- }
+ if (ptrs_symbol || dmrs_symbol_map & (1 << l)) {
- /* Map DMRS Symbol */
- if ( ( dmrs_symbol_map & (1 << l) ) && (k == ((start_sc+get_dmrs_freq_idx(n, k_prime, delta, dmrs_Type))%(frame_parms->ofdm_symbol_size)))) {
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15;
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15;
+ // Loop Over SCs:
+ for (int i=0; irbSize*NR_NB_SC_PER_RB; i++) {
+ /* check if cuurent RE is PTRS RE*/
+ is_ptrs_re = 0;
+ if (ptrs_symbol)
+ is_ptrs_re = is_ptrs_subcarrier(k,
+ rel15->rnti,
+ ap,
+ rel15->dmrsConfigType,
+ rel15->PTRSFreqDensity,
+ rel15->rbSize,
+ rel15->PTRSReOffset,
+ start_sc,
+ frame_parms->ofdm_symbol_size);
+ /* Map DMRS Symbol */
+ if ( (dmrs_symbol_map & (1 << l)) &&
+ (k == ((start_sc+get_dmrs_freq_idx(n, k_prime, delta, dmrs_Type))%(frame_parms->ofdm_symbol_size)))) {
+ txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15;
+ txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15;
#ifdef DEBUG_DLSCH_MAPPING
- printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n",
- dmrs_idx, l, k, k_prime, n, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)],
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]);
+ printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n",
+ dmrs_idx, l, k, k_prime, n, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)],
+ txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]);
#endif
- dmrs_idx++;
- k_prime++;
- k_prime&=1;
- n+=(k_prime)?0:1;
- }
- /* Map PTRS Symbol */
- else if(is_ptrs_re){
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[ptrs_idx<<1]) >> 15;
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[(ptrs_idx<<1) + 1])>> 15;
+ dmrs_idx++;
+ k_prime++;
+ k_prime&=1;
+ n+=(k_prime)?0:1;
+ }
+ else if(is_ptrs_re){
+ txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[ptrs_idx<<1]) >> 15;
+ txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[(ptrs_idx<<1) + 1])>> 15;
#ifdef DEBUG_DLSCH_MAPPING
- printf("ptrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n",
- ptrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)],
- ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]);
+ printf("ptrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n",
+ ptrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)],
+ ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]);
#endif
- ptrs_idx++;
- }
+ ptrs_idx++;
+ }
/* Map DATA Symbol */
- else if( (!(dmrs_symbol_map & (1 << l))) || allowed_xlsch_re_in_dmrs_symbol(k,start_sc,frame_parms->ofdm_symbol_size,rel15->numDmrsCdmGrpsNoData,dmrs_Type)) {
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (amp * tx_layers[ap][m<<1]) >> 15;
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15;
+ else if( allowed_xlsch_re_in_dmrs_symbol(k,start_sc,frame_parms->ofdm_symbol_size,rel15->numDmrsCdmGrpsNoData,dmrs_Type)) {
+ txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (amp * tx_layers[ap][m<<1]) >> 15;
+ txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15;
#ifdef DEBUG_DLSCH_MAPPING
- printf("m %d\t l %d \t k %d \t txdataF: %d %d\n",
- m, l, k, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)],
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]);
+ printf("m %d\t l %d \t k %d \t txdataF: %d %d\n",
+ m, l, k, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)],
+ txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]);
#endif
- m++;
+ m++;
+ }
+ /* mute RE */
+ else {
+ txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0;
+ txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0;
+ }
+ if (++k >= frame_parms->ofdm_symbol_size)
+ k -= frame_parms->ofdm_symbol_size;
+ } //RE loop
+ }
+ else { // no PTRS or DMRS in this symbol
+ // Loop Over SCs:
+ int upper_limit=rel15->rbSize*NR_NB_SC_PER_RB;
+ int remaining_re = 0;
+ if (start_sc + upper_limit > frame_parms->ofdm_symbol_size) {
+ remaining_re = upper_limit + start_sc - frame_parms->ofdm_symbol_size;
+ upper_limit = frame_parms->ofdm_symbol_size - start_sc;
+ }
+ if (0/*(frame_parms->N_RB_DL&1)==0*/) {
+ __m128i *txF=(__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc+txdataF_offset)<<1)];
+
+ __m128i *txl = (__m128i*)&tx_layers[ap][m<<1];
+ __m128i amp128=_mm_set1_epi16(amp);
+ for (int i=0; i<(upper_limit>>2); i++) {
+ txF[i] = _mm_mulhrs_epi16(amp128,txl[i]);
+ } //RE loop, first part
+ m+=upper_limit;
+ if (remaining_re > 0) {
+ txF = (__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+txdataF_offset)<<1)];
+ txl = (__m128i*)&tx_layers[ap][m<<1];
+ for (int i=0; i<(remaining_re>>2); i++) {
+ txF[i] = _mm_mulhrs_epi16(amp128,txl[i]);
+ }
+ }
}
- /* mute RE */
else {
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0;
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0;
- }
- if (++k >= frame_parms->ofdm_symbol_size)
- k -= frame_parms->ofdm_symbol_size;
- } //RE loop
+ __m64 *txF=(__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc+txdataF_offset)<<1)];
+
+ __m64 *txl = (__m64*)&tx_layers[ap][m<<1];
+ __m64 amp64=_mm_set1_pi16(amp);
+ for (int i=0; i<(upper_limit>>1); i++) {
+
+ txF[i] = _mm_mulhrs_pi16(amp64,txl[i]);
+#ifdef DEBUG_DLSCH_MAPPING
+ if ((i&1) > 0)
+ printf("m %d\t l %d \t k %d \t txdataF: %d %d\n",
+ m, l, start_sc+(i>>1), txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1) + (2*txdataF_offset)],
+ txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1) + 1 + (2*txdataF_offset)]);
+#endif
+ /* handle this, mute RE */
+ /*else {
+ txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0;
+ txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0;
+ }*/
+ } //RE loop, first part
+ m+=upper_limit;
+ if (remaining_re > 0) {
+ txF = (__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+txdataF_offset)<<1)];
+ txl = (__m64*)&tx_layers[ap][m<<1];
+ for (int i=0; i<(remaining_re>>1); i++) {
+ txF[i] = _mm_mulhrs_pi16(amp64,txl[i]);
+#ifdef DEBUG_DLSCH_MAPPING
+ if ((i&1) > 0)
+ printf("m %d\t l %d \t k %d \t txdataF: %d %d\n",
+ m, l, i>>1, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) + (2*txdataF_offset)],
+ txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) + 1 + (2*txdataF_offset)]);
+#endif
+ /* handle this, mute RE */
+ /*else {
+ txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0;
+ txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0;
+ }*/
+ } //RE loop, second part
+ } //
+ m+=remaining_re;
+ } // N_RB_DL even
+ } // no DMRS/PTRS in symbol
} // symbol loop
}// layer loop
+ stop_meas(&gNB->dlsch_resource_mapping_stats);
///Layer Precoding and Antenna port mapping
// tx_layers 1-8 are mapped on antenna ports 1000-1007
@@ -429,7 +494,9 @@ uint8_t nr_generate_pdsch(processingData_L1tx_t *msgTx,
// pmi = prgs_list[rbidx/prg_size].pm_idx, rbidx =0,...,rbSize-1
// The Precoding matrix:
// The Codebook Type I and Type II are not supported yet.
- // We adopt the precoding matrices of PUSCH for 4 layers.
+ // We`adopt the precoding matrices of PUSCH for 4 layers.
+ start_meas(&gNB->dlsch_precoding_stats);
+
for (int ap=0; apnb_antennas_tx; ap++) {
for (int l=rel15->StartSymbolIndex; lStartSymbolIndex+rel15->NrOfSymbols; l++) {
@@ -504,6 +571,7 @@ uint8_t nr_generate_pdsch(processingData_L1tx_t *msgTx,
} // symbol loop
}// port loop
+ stop_meas(&gNB->dlsch_precoding_stats);
dlsch->slot_tx[slot]=0;
// TODO: handle precoding
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.h b/openair1/PHY/NR_TRANSPORT/nr_dlsch.h
index 4b6ecfe412..64b7ecd025 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.h
+++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.h
@@ -85,6 +85,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
uint8_t slot,
NR_gNB_DLSCH_t *dlsch,
NR_DL_FRAME_PARMS* frame_parms,
+ unsigned char * output,
time_stats_t *tinput,
time_stats_t *tprep,
time_stats_t *tparity,
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
index acb59b0e40..0165a4062e 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
@@ -50,70 +50,47 @@
//#define DEBUG_DLSCH_FREE 1
-void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB)
-{
+void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB) {
int r;
-
NR_gNB_DLSCH_t *dlsch = *dlschptr;
-
uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated
- if (dlsch) {
+ if (dlsch) {
if (N_RB != 273) {
a_segments = a_segments*N_RB;
a_segments = a_segments/273 +1;
}
-
+
#ifdef DEBUG_DLSCH_FREE
LOG_D(PHY,"Freeing dlsch %p\n",dlsch);
#endif
NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process;
+
if (harq->b) {
free16(harq->b, a_segments * 1056);
harq->b = NULL;
#ifdef DEBUG_DLSCH_FREE
LOG_D(PHY, "Freeing harq->b (%p)\n", harq->b);
#endif
-
- if (harq->e) {
- free16(harq->e, 14 * N_RB * 12 * 8);
- harq->e = NULL;
+ }
+
#ifdef DEBUG_DLSCH_FREE
- printf("Freeing dlsch process %d e (%p)\n", i, harq->e);
+ LOG_D(PHY, "Freeing dlsch process %d c (%p)\n", i, harq->c);
#endif
- }
-
- if (harq->f) {
- free16(harq->f, 14 * N_RB * 12 * 8);
- harq->f = NULL;
+
+ for (r = 0; r < a_segments; r++) {
#ifdef DEBUG_DLSCH_FREE
- printf("Freeing dlsch process %d f (%p)\n", i, harq->f);
+ LOG_D(PHY, "Freeing dlsch process %d c[%d] (%p)\n", i, r, harq->c[r]);
#endif
- }
-
-#ifdef DEBUG_DLSCH_FREE
- LOG_D(PHY, "Freeing dlsch process %d c (%p)\n", i, harq->c);
-#endif
-
- for (r = 0; r < a_segments; r++) {
-#ifdef DEBUG_DLSCH_FREE
- LOG_D(PHY, "Freeing dlsch process %d c[%d] (%p)\n", i, r, harq->c[r]);
-#endif
-
- if (harq->c[r]) {
- free16(harq->c[r], 1056);
- harq->c[r] = NULL;
- }
- if (harq->d[r]) {
- free16(harq->d[r], 3 * 8448);
- harq->d[r] = NULL;
- }
+
+ if (harq->c[r]) {
+ free16(harq->c[r], 1056);
+ harq->c[r] = NULL;
}
}
+ free16(dlsch, sizeof(NR_gNB_DLSCH_t));
+ *dlschptr = NULL;
}
-
- free16(dlsch, sizeof(NR_gNB_DLSCH_t));
- *dlschptr = NULL;
}
NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
@@ -121,8 +98,7 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
unsigned char Mdlharq,
uint32_t Nsoft,
uint8_t abstraction_flag,
- uint16_t N_RB)
-{
+ uint16_t N_RB) {
unsigned char i,r,aa,layer;
int re;
uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated
@@ -133,10 +109,8 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
}
uint16_t dlsch_bytes = a_segments*1056; // allocated bytes per segment
-
NR_gNB_DLSCH_t *dlsch = malloc16(sizeof(NR_gNB_DLSCH_t));
AssertFatal(dlsch, "cannot allocate dlsch\n");
-
bzero(dlsch,sizeof(NR_gNB_DLSCH_t));
dlsch->Kmimo = Kmimo;
dlsch->Mdlharq = Mdlharq;
@@ -144,11 +118,12 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
dlsch->Nsoft = Nsoft;
for (layer=0; layerue_spec_bf_weights[layer] = (int32_t**)malloc16(64*sizeof(int32_t*));
+ dlsch->ue_spec_bf_weights[layer] = (int32_t **)malloc16(64*sizeof(int32_t *));
for (aa=0; aa<64; aa++) {
dlsch->ue_spec_bf_weights[layer][aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
- for (re=0;reue_spec_bf_weights[layer][aa][re] = 0x00007fff;
}
}
@@ -160,7 +135,8 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
for (int q=0; qmod_symbs[q] = (int32_t *)malloc16(NR_MAX_PDSCH_ENCODED_LENGTH*sizeof(int32_t));
- dlsch->calib_dl_ch_estimates = (int32_t**)malloc16(64*sizeof(int32_t*));
+ dlsch->calib_dl_ch_estimates = (int32_t **)malloc16(64*sizeof(int32_t *));
+
for (aa=0; aa<64; aa++) {
dlsch->calib_dl_ch_estimates[aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
}
@@ -172,7 +148,6 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process;
bzero(harq, sizeof(NR_DL_gNB_HARQ_t));
-
harq->b = malloc16(dlsch_bytes);
AssertFatal(harq->b, "cannot allocate memory for harq->b\n");
harq->pdu = malloc16(dlsch_bytes);
@@ -188,71 +163,33 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
// In section 5.3.2 in 38.212, the for loop is up to N + 2*Zc (maximum size of N is 66*Zc, therefore 68*Zc)
harq->c[r] = malloc16(8448);
AssertFatal(harq->c[r], "cannot allocate harq->c[%d]\n", r);
- harq->d[r] = malloc16(68 * 384);
- AssertFatal(harq->d[r], "cannot allocate harq->d[%d]\n", r); // max size for coded output
bzero(harq->c[r], 8448);
- bzero(harq->d[r], (3 * 8448));
}
- harq->e = malloc16(N_RB * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS);
- AssertFatal(harq->e, "cannot allocate harq->e\n");
- bzero(harq->e, N_RB * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS);
- harq->f = malloc16(N_RB * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS);
- AssertFatal(harq->f, "cannot allocate harq->f\n");
- bzero(harq->f, N_RB * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS);
-
return(dlsch);
}
-void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch)
-{
-
- unsigned char Mdlharq;
- unsigned char i,j,r;
-
+void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch) {
AssertFatal(dlsch!=NULL,"dlsch is null\n");
- Mdlharq = dlsch->Mdlharq;
+ unsigned char Mdlharq = dlsch->Mdlharq;
dlsch->rnti = 0;
dlsch->active = 0;
- NR_DL_gNB_HARQ_t *harq=&dlsch->harq_process;
-
- for (i=0; i<10; i++) {
+ for (int i=0; i<10; i++) {
dlsch->harq_ids[0][i] = Mdlharq;
dlsch->harq_ids[1][i] = Mdlharq;
}
- for (i=0; id[r])
- harq->d[r][j] = NR_NULL;
- }
}
-int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
- unsigned char *a,
- int frame,
- uint8_t slot,
- NR_gNB_DLSCH_t *dlsch,
- NR_DL_FRAME_PARMS* frame_parms,
- time_stats_t *tinput,time_stats_t *tprep,time_stats_t *tparity,time_stats_t *toutput,
- time_stats_t *dlsch_rate_matching_stats,time_stats_t *dlsch_interleaving_stats,
- time_stats_t *dlsch_segmentation_stats)
-{
-
- unsigned int G;
- unsigned int crc=1;
- NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process;
+void ldpc8blocks( void *p) {
+ encoder_implemparams_t *impp=(encoder_implemparams_t *) p;
+ NR_DL_gNB_HARQ_t *harq = (NR_DL_gNB_HARQ_t *)impp->harq;
+ uint16_t Kr= impp->K;
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &harq->pdsch_pdu.pdsch_pdu_rel15;
+ uint8_t mod_order = rel15->qamModOrder[0];
uint16_t nb_rb = rel15->rbSize;
uint8_t nb_symb_sch = rel15->NrOfSymbols;
- uint32_t A, Kb, F=0;
- uint32_t *Zc = &dlsch->harq_process.Z;
- uint8_t mod_order = rel15->qamModOrder[0];
- uint16_t Kr=0,r;
- uint32_t r_offset=0;
- uint32_t E;
- uint8_t Ilbrm = 1;
- uint32_t Tbslbrm = 950984; //max tbs
+ uint16_t length_dmrs = get_num_dmrs(rel15->dlDmrsSymbPos);
+ uint32_t A = rel15->TBSize[0]<<3;
uint8_t nb_re_dmrs;
if (rel15->dmrsConfigType==NFAPI_NR_DMRS_TYPE1)
@@ -260,24 +197,113 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
else
nb_re_dmrs = 4*rel15->numDmrsCdmGrpsNoData;
- uint16_t length_dmrs = get_num_dmrs(rel15->dlDmrsSymbPos);
- uint16_t R=rel15->targetCodeRate[0];
+ unsigned int G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs,mod_order,rel15->nrOfLayers);
+ LOG_D(PHY,"dlsch coding A %d Kr %d G %d (nb_rb %d, nb_symb_sch %d, nb_re_dmrs %d, length_dmrs %d, mod_order %d)\n",
+ A,impp->K,G, nb_rb,nb_symb_sch,nb_re_dmrs,length_dmrs,(int)mod_order);
+ // nrLDPC_encoder output is in "d"
+ // let's make this interface happy!
+ uint8_t tmp[8][68 * 384]__attribute__((aligned(32)));
+ for (int rr=impp->macro_num*8, i=0; rr < impp->n_segments && rr < (impp->macro_num+1)*8; rr++,i++ )
+ impp->d[rr]=tmp[i];
+ nrLDPC_encoder(harq->c,impp->d,*impp->Zc, impp->Kb,Kr,impp->BG,impp);
+ // Compute where to place in output buffer that is concatenation of all segments
+ uint32_t r_offset=0;
+ for (int i=0; i < impp->macro_num*8; i++ )
+ r_offset+=nr_get_E(G, impp->n_segments, mod_order, rel15->nrOfLayers, i);
+ for (int rr=impp->macro_num*8; rr < impp->n_segments && rr < (impp->macro_num+1)*8; rr++ ) {
+ if (impp->F>0) {
+ // writing into positions d[r][k-2Zc] as in clause 5.3.2 step 2) in 38.212
+ memset(&impp->d[rr][Kr-impp->F-2*(*impp->Zc)], impp->F, NR_NULL);
+ }
+
+#ifdef DEBUG_DLSCH_CODING
+ LOG_D(PHY,"rvidx in encoding = %d\n", rel15->rvIndex[0]);
+#endif
+ uint32_t E = nr_get_E(G, impp->n_segments, mod_order, rel15->nrOfLayers, rr);
+ //#ifdef DEBUG_DLSCH_CODING
+ LOG_D(NR_PHY,"Rate Matching, Code segment %d/%d (coded bits (G) %u, E %d, Filler bits %d, Filler offset %d mod_order %d, nb_rb %d)...\n",
+ rr,
+ impp->n_segments,
+ G,
+ E,
+ impp->F,
+ Kr-impp->F-2*(*impp->Zc),
+ mod_order,nb_rb);
+ // for tbslbrm calculation according to 5.4.2.1 of 38.212
+ uint8_t Nl = 4;
+
+ if (rel15->nrOfLayers < Nl)
+ Nl = rel15->nrOfLayers;
+
+ uint32_t Tbslbrm = nr_compute_tbslbrm(rel15->mcsTable[0],nb_rb,Nl);
+ uint8_t Ilbrm = 1;
+
+ uint8_t e[E];
+ bzero (e, E);
+ nr_rate_matching_ldpc(Ilbrm,
+ Tbslbrm,
+ impp->BG,
+ *impp->Zc,
+ impp->d[rr],
+ e,
+ impp->n_segments,
+ impp->F,
+ Kr-impp->F-2*(*impp->Zc),
+ rel15->rvIndex[0],
+ E);
+#ifdef DEBUG_DLSCH_CODING
+
+ for (int i =0; i<16; i++)
+ printf("output ratematching e[%d]= %d r_offset %u\n", i,e[i], r_offset);
+
+#endif
+ nr_interleaving_ldpc(E,
+ mod_order,
+ e,
+ impp->output+r_offset);
+#ifdef DEBUG_DLSCH_CODING
+
+ for (int i =0; i<16; i++)
+ printf("output interleaving f[%d]= %d r_offset %u\n", i,impp->output[i+r_offset], r_offset);
+
+
+#endif
+ r_offset += E;
+ }
+}
+
+int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
+ unsigned char *a,
+ int frame,
+ uint8_t slot,
+ NR_gNB_DLSCH_t *dlsch,
+ NR_DL_FRAME_PARMS *frame_parms,
+ unsigned char * output,
+ time_stats_t *tinput,time_stats_t *tprep,time_stats_t *tparity,time_stats_t *toutput,
+ time_stats_t *dlsch_rate_matching_stats,time_stats_t *dlsch_interleaving_stats,
+ time_stats_t *dlsch_segmentation_stats) {
+ encoder_implemparams_t impp;
+ impp.output=output;
+ unsigned int crc=1;
+ NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process;
+ nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &harq->pdsch_pdu.pdsch_pdu_rel15;
+ impp.Zc = &dlsch->harq_process.Z;
float Coderate = 0.0;
- uint8_t Nl = 4;
-
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ENCODING, VCD_FUNCTION_IN);
+ uint32_t A = rel15->TBSize[0]<<3;
- A = rel15->TBSize[0]<<3;
if ( dlsch->rnti != SI_RNTI )
- trace_NRpdu(DIRECTION_DOWNLINK, a, rel15->TBSize[0], 0, WS_C_RNTI, dlsch->rnti, frame, slot,0, 0);
+ trace_NRpdu(DIRECTION_DOWNLINK, a, rel15->TBSize[0], 0, WS_C_RNTI, dlsch->rnti, frame, slot,0, 0);
NR_gNB_SCH_STATS_t *stats=NULL;
int first_free=-1;
- for (int i=0;idlsch_stats[i].rnti == 0 && first_free == -1) {
first_free = i;
stats=&gNB->dlsch_stats[i];
}
+
if (gNB->dlsch_stats[i].rnti == dlsch->rnti) {
stats=&gNB->dlsch_stats[i];
break;
@@ -290,179 +316,94 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
stats->current_RI = rel15->nrOfLayers;
stats->current_Qm = rel15->qamModOrder[0];
}
- G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs,mod_order,rel15->nrOfLayers);
-
- LOG_D(PHY,"dlsch coding A %d G %d (nb_rb %d, nb_symb_sch %d, nb_re_dmrs %d, length_dmrs %d, mod_order %d)\n",
- A,G, nb_rb,nb_symb_sch,nb_re_dmrs,length_dmrs,(int)mod_order);
if (A > 3824) {
// Add 24-bit crc (polynomial A) to payload
crc = crc24a(a,A)>>8;
- a[A>>3] = ((uint8_t*)&crc)[2];
- a[1+(A>>3)] = ((uint8_t*)&crc)[1];
- a[2+(A>>3)] = ((uint8_t*)&crc)[0];
+ a[A>>3] = ((uint8_t *)&crc)[2];
+ a[1+(A>>3)] = ((uint8_t *)&crc)[1];
+ a[2+(A>>3)] = ((uint8_t *)&crc)[0];
//printf("CRC %x (A %d)\n",crc,A);
//printf("a0 %d a1 %d a2 %d\n", a[A>>3], a[1+(A>>3)], a[2+(A>>3)]);
-
harq->B = A+24;
// harq->b = a;
-
AssertFatal((A / 8) + 4 <= MAX_NR_DLSCH_PAYLOAD_BYTES,
"A %d is too big (A/8+4 = %d > %d)\n",
A,
(A / 8) + 4,
MAX_NR_DLSCH_PAYLOAD_BYTES);
-
memcpy(harq->b, a, (A / 8) + 4); // why is this +4 if the CRC is only 3 bytes?
- }
- else {
+ } else {
// Add 16-bit crc (polynomial A) to payload
crc = crc16(a,A)>>16;
- a[A>>3] = ((uint8_t*)&crc)[1];
- a[1+(A>>3)] = ((uint8_t*)&crc)[0];
+ a[A>>3] = ((uint8_t *)&crc)[1];
+ a[1+(A>>3)] = ((uint8_t *)&crc)[0];
//printf("CRC %x (A %d)\n",crc,A);
//printf("a0 %d a1 %d \n", a[A>>3], a[1+(A>>3)]);
-
harq->B = A+16;
// harq->b = a;
-
AssertFatal((A / 8) + 3 <= MAX_NR_DLSCH_PAYLOAD_BYTES,
"A %d is too big (A/8+3 = %d > %d)\n",
A,
(A / 8) + 3,
MAX_NR_DLSCH_PAYLOAD_BYTES);
-
memcpy(harq->b, a, (A / 8) + 3); // using 3 bytes to mimic the case of 24 bit crc
}
- if (R<1000)
- Coderate = (float) R /(float) 1024;
+
+ if (rel15->targetCodeRate[0]<1000)
+ Coderate = (float)rel15->targetCodeRate[0] /(float) 1024;
else // to scale for mcs 20 and 26 in table 5.1.3.1-2 which are decimal and input 2* in nr_tbs_tools
- Coderate = (float) R /(float) 2048;
+ Coderate = (float)rel15->targetCodeRate[0] /(float) 2048;
if ((A <=292) || ((A<=3824) && (Coderate <= 0.6667)) || Coderate <= 0.25)
- harq->BG = 2;
+ impp.BG = 2;
else
- harq->BG = 1;
+ impp.BG = 1;
start_meas(dlsch_segmentation_stats);
- Kb = nr_segmentation(harq->b, harq->c, harq->B, &harq->C, &harq->K, Zc, &harq->F, harq->BG);
+ impp.Kb = nr_segmentation(harq->b, harq->c, harq->B, &impp.n_segments, &impp.K, impp.Zc, &impp.F, impp.BG);
stop_meas(dlsch_segmentation_stats);
- F = harq->F;
- Kr = harq->K;
-#ifdef DEBUG_DLSCH_CODING
- uint16_t Kr_bytes;
- Kr_bytes = Kr>>3;
-#endif
-
- //printf("segment Z %d k %d Kr %d BG %d C %d\n", *Zc,harq->K,Kr,BG,harq->C);
-
- for (r=0; rC; r++) {
+ for (int r=0; rd[r][0];
//channel_input[r] = &harq->d[r][0];
#ifdef DEBUG_DLSCH_CODING
- LOG_D(PHY,"Encoder: B %d F %d \n",harq->B, harq->F);
- LOG_D(PHY,"start ldpc encoder segment %d/%d\n",r,harq->C);
+ LOG_D(PHY,"Encoder: B %d F %d \n",harq->B, impp.F);
+ LOG_D(PHY,"start ldpc encoder segment %d/%d\n",r,impp.n_segments);
LOG_D(PHY,"input %d %d %d %d %d \n", harq->c[r][0], harq->c[r][1], harq->c[r][2],harq->c[r][3], harq->c[r][4]);
- for (int cnt =0 ; cnt < 22*(*Zc)/8; cnt ++){
+
+ for (int cnt =0 ; cnt < 22*(*impp.Zc)/8; cnt ++) {
LOG_D(PHY,"%d ", harq->c[r][cnt]);
}
- LOG_D(PHY,"\n");
+ LOG_D(PHY,"\n");
#endif
//ldpc_encoder_orig((unsigned char*)harq->c[r],harq->d[r],*Zc,Kb,Kr,BG,0);
//ldpc_encoder_optim((unsigned char*)harq->c[r],(unsigned char*)&harq->d[r][0],*Zc,Kb,Kr,BG,NULL,NULL,NULL,NULL);
}
- encoder_implemparams_t impp;
- impp.n_segments=harq->C;
+
impp.tprep = tprep;
impp.tinput = tinput;
impp.tparity = tparity;
impp.toutput = toutput;
- for(int j=0;j<(harq->C/8+1);j++) {
- impp.macro_num=j;
- nrLDPC_encoder(harq->c,harq->d,*Zc,Kb,Kr,harq->BG,&impp);
+ impp.harq=harq;
+ notifiedFIFO_t nf;
+ initNotifiedFIFO(&nf);
+ int nbJobs=0;
+ for(int j=0; j<(impp.n_segments/8+((impp.n_segments&7)==0 ? 0 : 1)); j++) {
+ notifiedFIFO_elt_t *req=newNotifiedFIFO_elt(sizeof(impp), j, &nf, ldpc8blocks);
+ encoder_implemparams_t* perJobImpp=(encoder_implemparams_t*)NotifiedFifoData(req);
+ *perJobImpp=impp;
+ perJobImpp->macro_num=j;
+ pushTpool(gNB->threadPool,req);
+ nbJobs++;
}
-
-#ifdef DEBUG_DLSCH_CODING
- write_output("enc_input0.m","enc_in0",&harq->c[0][0],Kr_bytes,1,4);
- write_output("enc_output0.m","enc0",&harq->d[0][0],(3*8*Kr_bytes)+12,1,4);
-#endif
-
- F = harq->F;
-
- Kr = harq->K;
- for (r=0; rC; r++) {
-
- if (F>0) {
- for (int k=(Kr-F-2*(*Zc)); kd[r][k] = NR_NULL;
- //if (k<(Kr-F+8))
- //printf("r %d filler bits [%d] = %d \n", r,k, harq->d[r][k]);
- }
- }
-
-#ifdef DEBUG_DLSCH_CODING
- LOG_D(PHY,"rvidx in encoding = %d\n", rel15->rvIndex[0]);
-#endif
-
- E = nr_get_E(G, harq->C, mod_order, rel15->nrOfLayers, r);
-
- //#ifdef DEBUG_DLSCH_CODING
- LOG_D(NR_PHY,"Rate Matching, Code segment %d/%d (coded bits (G) %u, E %d, Filler bits %d, Filler offset %d mod_order %d, nb_rb %d)...\n",
- r,
- harq->C,
- G,
- E,
- F,
- Kr-F-2*(*Zc),
- mod_order,nb_rb);
-
- // for tbslbrm calculation according to 5.4.2.1 of 38.212
- if (rel15->nrOfLayers < Nl)
- Nl = rel15->nrOfLayers;
-
- Tbslbrm = nr_compute_tbslbrm(rel15->mcsTable[0],nb_rb,Nl);
-
- start_meas(dlsch_rate_matching_stats);
- nr_rate_matching_ldpc(Ilbrm,
- Tbslbrm,
- harq->BG,
- *Zc,
- harq->d[r],
- harq->e+r_offset,
- harq->C,
- F,
- Kr-F-2*(*Zc),
- rel15->rvIndex[0],
- E);
- stop_meas(dlsch_rate_matching_stats);
-#ifdef DEBUG_DLSCH_CODING
- for (int i =0; i<16; i++)
- printf("output ratematching e[%d]= %d r_offset %u\n", i,harq->e[i+r_offset], r_offset);
-#endif
-
- start_meas(dlsch_interleaving_stats);
- nr_interleaving_ldpc(E,
- mod_order,
- harq->e+r_offset,
- harq->f+r_offset);
- stop_meas(dlsch_interleaving_stats);
-
-#ifdef DEBUG_DLSCH_CODING
- for (int i =0; i<16; i++)
- printf("output interleaving f[%d]= %d r_offset %u\n", i,harq->f[i+r_offset], r_offset);
-
- if (r==harq->C-1)
- write_output("enc_output.m","enc",harq->f,G,1,4);
-#endif
-
- r_offset += E;
+ while(nbJobs) {
+ notifiedFIFO_elt_t *req=pullTpool(&nf, gNB->threadPool);
+ delNotifiedFIFO_elt(req);
+ nbJobs--;
}
-
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ENCODING, VCD_FUNCTION_OUT);
-
return 0;
}
diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c
index cdc6825d4c..1a844aaaf1 100644
--- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c
+++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c
@@ -206,7 +206,9 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
nr_sequences=8>>(1-pucch_pdu->sr_flag);
}
- LOG_D(PHY,"pucch0: nr_symbols %d, start_symbol %d, prb_start %d, second_hop_prb %d, group_hop_flag %d, sequence_hop_flag %d, O_ACK %d, O_SR %d, mcs %d initial_cyclic_shift %d\n",pucch_pdu->nr_of_symbols,pucch_pdu->start_symbol_index,pucch_pdu->prb_start,pucch_pdu->second_hop_prb,pucch_pdu->group_hop_flag,pucch_pdu->sequence_hop_flag,pucch_pdu->bit_len_harq,pucch_pdu->sr_flag,mcs[0],pucch_pdu->initial_cyclic_shift);
+ LOG_D(PHY,"pucch0: nr_symbols %d, start_symbol %d, prb_start %d, second_hop_prb %d, group_hop_flag %d, sequence_hop_flag %d, O_ACK %d, O_SR %d, mcs %d initial_cyclic_shift %d\n",
+ pucch_pdu->nr_of_symbols,pucch_pdu->start_symbol_index,pucch_pdu->prb_start,pucch_pdu->second_hop_prb,pucch_pdu->group_hop_flag,pucch_pdu->sequence_hop_flag,pucch_pdu->bit_len_harq,
+ pucch_pdu->sr_flag,mcs[0],pucch_pdu->initial_cyclic_shift);
int cs_ind = get_pucch0_cs_lut_index(gNB,pucch_pdu);
/*
@@ -324,7 +326,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
LOG_D(PHY,"PUCCH IDFT[%d/%d] = (%d,%d)=>%f\n",
mcs[i],seq_index,corr_re[0][0],corr_im[0][0],
10*log10((double)corr_re[0][0]*corr_re[0][0] + (double)corr_im[0][0]*corr_im[0][0]));
- if (pucch_pdu->nr_of_symbols==2)
+ if (pucch_pdu->nr_of_symbols==2)
LOG_D(PHY,"PUCCH 2nd symbol IDFT[%d/%d] = (%d,%d)=>%f\n",
mcs[i],seq_index,corr_re[0][1],corr_im[0][1],
10*log10((double)corr_re[0][1]*corr_re[0][1] + (double)corr_im[0][1]*corr_im[0][1]));
@@ -428,8 +430,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;
- LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n",
- frame,slot,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,10*log10((double)sigenergy),gNB->ulsch_stats[0].sync_pos);
+ LOG_D(NR_PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d SR_flag %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n",
+ frame,slot,uci_pdu->harq->harq_list[0].harq_value,pucch_pdu->sr_flag,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,10*log10((double)sigenergy),gNB->ulsch_stats[0].sync_pos);
if (pucch_pdu->sr_flag == 1) {
uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr));
uci_pdu->sr->sr_indication = (index>1) ? 1 : 0;
@@ -445,8 +447,8 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2);
uci_pdu->harq->harq_list[1].harq_value = index&0x01;
uci_pdu->harq->harq_list[0].harq_value = (index>>1)&0x01;
- LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n",
- frame,slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,gNB->ulsch_stats[0].sync_pos);
+ LOG_D(NR_PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d SR_flag %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n",
+ frame,slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,pucch_pdu->sr_flag,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,gNB->ulsch_stats[0].sync_pos);
if (pucch_pdu->sr_flag == 1) {
uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr));
uci_pdu->sr->sr_indication = (index>3) ? 1 : 0;
diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c
index 3908febae9..19d4bf5079 100644
--- a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c
+++ b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c
@@ -42,7 +42,6 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
short coef)
{
- static int max_pos_fil = 0;
static int count_max_pos_ok = 0;
static int first_time = 1;
int max_val = 0, max_pos = 0;
@@ -55,13 +54,14 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
LOG_D(PHY,"AbsSubframe %d: rx_offset (before) = %d\n",subframe,ue->rx_offset);
- // we only use channel estimates from tx antenna 0 here
- for (int i = 0; i < frame_parms->nb_prefix_samples; i++) {
+ // search for maximum position within the cyclic prefix
+ for (int i = -frame_parms->nb_prefix_samples/2; i < frame_parms->nb_prefix_samples/2; i++) {
int temp = 0;
+ int j = (i < 0) ? (i + frame_parms->ofdm_symbol_size) : i;
for (int aa = 0; aa < frame_parms->nb_antennas_rx; aa++) {
- int Re = ((int16_t*)ue->pbch_vars[gNB_id]->dl_ch_estimates_time[aa])[(i<<1)];
- int Im = ((int16_t*)ue->pbch_vars[gNB_id]->dl_ch_estimates_time[aa])[1+(i<<1)];
+ int Re = ((int16_t*)ue->pbch_vars[gNB_id]->dl_ch_estimates_time[aa])[(j<<1)];
+ int Im = ((int16_t*)ue->pbch_vars[gNB_id]->dl_ch_estimates_time[aa])[1+(j<<1)];
temp += (Re*Re/2) + (Im*Im/2);
}
@@ -71,19 +71,16 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
}
}
- if (max_pos > frame_parms->ofdm_symbol_size/2)
- max_pos = max_pos - frame_parms->ofdm_symbol_size;
-
// filter position to reduce jitter
if (clear == 1)
- max_pos_fil = max_pos;
+ ue->max_pos_fil = max_pos;
else
- max_pos_fil = ((max_pos_fil * coef) + (max_pos * ncoef)) >> 15;
+ ue->max_pos_fil = ((ue->max_pos_fil * coef) + (max_pos * ncoef)) >> 15;
// do not filter to have proactive timing adjustment
- //max_pos_fil = max_pos;
+ //ue->max_pos_fil = max_pos;
- int diff = max_pos_fil - sync_pos;
+ int diff = ue->max_pos_fil - sync_pos;
if (frame_parms->freq_range==nr_FR2)
sync_offset = 2;
@@ -131,7 +128,7 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
ue->rx_offset,
clear,
max_pos,
- max_pos_fil,
+ ue->max_pos_fil,
max_val,
sync_pos);
#endif //DEBUG_PHY
diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
index 8097b9b3ea..30eae2d30f 100644
--- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
+++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
@@ -485,8 +485,8 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
#ifdef DEBUG_PDCCH
- printf("PDCCH Channel Estimation : ThreadId %d, gNB_id %d ch_offset %d, OFDM size %d, Ncp=%d, Ns=%d, k=%d symbol %d\n",proc->thread_id, gNB_id,ch_offset,ue->frame_parms.ofdm_symbol_size,
- ue->frame_parms.Ncp,Ns,k, symbol);
+ printf("PDCCH Channel Estimation : ThreadId %d, gNB_id %d ch_offset %d, OFDM size %d, Ncp=%d, Ns=%d, symbol %d\n",
+ proc->thread_id, gNB_id,ch_offset,ue->frame_parms.ofdm_symbol_size,ue->frame_parms.Ncp,Ns,symbol);
#endif
fl = filt16a_l1;
diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
index 3afe27310f..84c9627c8a 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
@@ -30,11 +30,9 @@
* \warning
*/
-#ifdef USER_MODE
- #include
- #include
- #include
-#endif
+#include
+#include
+#include
#include "executables/softmodem-common.h"
@@ -61,7 +59,6 @@ char nr_dci_format_string[8][30] = {
//#define DEBUG_DCI_DECODING 1
//#define NR_LTE_PDCCH_DCI_SWITCH
-#define NR_PDCCH_DCI_RUN // activates new nr functions
//#define NR_PDCCH_DCI_DEBUG // activates NR_PDCCH_DCI_DEBUG logs
#ifdef NR_PDCCH_DCI_DEBUG
#define LOG_DNL(a, ...) printf("\n\t\t<-NR_PDCCH_DCI_DEBUG (%s)-> " a, __func__, ##__VA_ARGS__ )
@@ -81,7 +78,6 @@ char nr_dci_format_string[8][30] = {
#define LOG_I(A,B...) printf(B)
#endif
-#ifdef NR_PDCCH_DCI_RUN
//static const int16_t conjugate[8]__attribute__((aligned(32))) = {-1,1,-1,1,-1,1,-1,1};
@@ -90,6 +86,7 @@ char nr_dci_format_string[8][30] = {
void nr_pdcch_demapping_deinterleaving(uint32_t *llr,
uint32_t *z,
uint8_t coreset_time_dur,
+ uint8_t start_symbol,
uint32_t coreset_nbr_rb,
uint8_t reg_bundle_size_L,
uint8_t coreset_interleaver_size_R,
@@ -186,7 +183,7 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr,
int rb = 0;
for (int c_id = 0; c_id < number_of_candidates; c_id++ ) {
- for (int symbol_idx = 0; symbol_idx < coreset_time_dur; symbol_idx++) {
+ for (int symbol_idx = start_symbol; symbol_idx < start_symbol+coreset_time_dur; symbol_idx++) {
for (int cce_count = CCE[c_id/coreset_time_dur]+c_id%coreset_time_dur; cce_count < CCE[c_id/coreset_time_dur]+c_id%coreset_time_dur+L[c_id]; cce_count += coreset_time_dur) {
for (int reg_in_cce_idx = 0; reg_in_cce_idx < NR_NB_REG_PER_CCE; reg_in_cce_idx++) {
@@ -209,9 +206,6 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr,
}
}
-#endif
-
-#ifdef NR_PDCCH_DCI_RUN
int32_t nr_pdcch_llr(NR_DL_FRAME_PARMS *frame_parms, int32_t **rxdataF_comp,
int16_t *pdcch_llr, uint8_t symbol,uint32_t coreset_nbr_rb) {
int16_t *rxF = (int16_t *) &rxdataF_comp[0][(symbol * coreset_nbr_rb * 12)];
@@ -242,7 +236,6 @@ int32_t nr_pdcch_llr(NR_DL_FRAME_PARMS *frame_parms, int32_t **rxdataF_comp,
return (0);
}
-#endif
#if 0
@@ -283,9 +276,10 @@ int32_t pdcch_llr(NR_DL_FRAME_PARMS *frame_parms,
//compute average channel_level on each (TX,RX) antenna pair
void nr_pdcch_channel_level(int32_t **dl_ch_estimates_ext,
- NR_DL_FRAME_PARMS *frame_parms,
- int32_t *avg,
- uint8_t nb_rb) {
+ NR_DL_FRAME_PARMS *frame_parms,
+ int32_t *avg,
+ int symbol,
+ uint8_t nb_rb) {
int16_t rb;
uint8_t aarx;
#if defined(__x86_64__) || defined(__i386__)
@@ -300,9 +294,9 @@ void nr_pdcch_channel_level(int32_t **dl_ch_estimates_ext,
//clear average level
#if defined(__x86_64__) || defined(__i386__)
avg128P = _mm_setzero_si128();
- dl_ch128=(__m128i *)&dl_ch_estimates_ext[aarx][0];
+ dl_ch128=(__m128i *)&dl_ch_estimates_ext[aarx][symbol*nb_rb*12];
#elif defined(__arm__)
- dl_ch128=(int16x8_t *)&dl_ch_estimates_ext[aarx][0];
+ dl_ch128=(int16x8_t *)&dl_ch_estimates_ext[aarx][symbol*nb_rb*12];
#endif
for (rb=0; rb<(nb_rb*3)>>2; rb++) {
@@ -328,7 +322,7 @@ void nr_pdcch_channel_level(int32_t **dl_ch_estimates_ext,
((int32_t *)&avg128P)[1] +
((int32_t *)&avg128P)[2] +
((int32_t *)&avg128P)[3])/(nb_rb*9);
- // printf("Channel level : %d\n",avg[(aatx<<1)+aarx]);
+ LOG_DDD("Channel level : %d\n",avg[aarx]);
}
#if defined(__x86_64__) || defined(__i386__)
@@ -346,7 +340,6 @@ void nr_pdcch_channel_level(int32_t **dl_ch_estimates_ext,
-#ifdef NR_PDCCH_DCI_RUN
// This function will extract the mapped DM-RS PDCCH REs as per 38.211 Section 7.4.1.3.2 (Mapping to physical resources)
void nr_pdcch_extract_rbs_single(int32_t **rxdataF,
int32_t **dl_ch_estimates,
@@ -385,7 +378,7 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF,
#endif
for (aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
- dl_ch0 = &dl_ch_estimates[aarx][0];
+ dl_ch0 = &dl_ch_estimates[aarx][frame_parms->ofdm_symbol_size*symbol];
LOG_DDD("dl_ch0 = &dl_ch_estimates[aarx = (%d)][0]\n",aarx);
dl_ch0_ext = &dl_ch_estimates_ext[aarx][symbol * (coreset_nbr_rb * NBR_RE_PER_RB_WITH_DMRS)];
@@ -542,9 +535,6 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF,
}
}
-#endif
-
-
#define print_shorts(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7])
void nr_pdcch_channel_compensation(int32_t **rxdataF_ext,
@@ -639,9 +629,9 @@ void nr_pdcch_channel_compensation(int32_t **rxdataF_ext,
for (int i=0; i<12 ; i++)
LOG_DDD("rxdataF128[%d]=(%d,%d) X dlch[%d]=(%d,%d) rxdataF_comp128[%d]=(%d,%d)\n",
- (rb*12)+i, ((short *)rxdataF128)[i<<1],((short *)rxdataF128)[1+(i<<1)],
- (rb*12)+i, ((short *)dl_ch128)[i<<1],((short *)dl_ch128)[1+(i<<1)],
- (rb*12)+i, ((short *)rxdataF_comp128)[i<<1],((short *)rxdataF_comp128)[1+(i<<1)]);
+ (rb*12)+i, ((short *)rxdataF128)[i<<1],((short *)rxdataF128)[1+(i<<1)],
+ (rb*12)+i, ((short *)dl_ch128)[i<<1],((short *)dl_ch128)[1+(i<<1)],
+ (rb*12)+i, ((short *)rxdataF_comp128)[i<<1],((short *)rxdataF_comp128)[1+(i<<1)]);
dl_ch128+=3;
rxdataF128+=3;
@@ -694,24 +684,6 @@ void nr_pdcch_detection_mrc(NR_DL_FRAME_PARMS *frame_parms,
#endif
}
-#if 0
-void pdcch_siso(NR_DL_FRAME_PARMS *frame_parms,
- int32_t **rxdataF_comp,
- uint8_t l) {
- uint8_t rb,re,jj,ii;
- jj=0;
- ii=0;
-
- for (rb=0; rbN_RB_DL; rb++) {
- for (re=0; re<12; re++) {
- rxdataF_comp[0][jj++] = rxdataF_comp[0][ii];
- ii++;
- }
- }
-}
-#endif
-
-#ifdef NR_PDCCH_DCI_RUN
int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc,
fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15) {
@@ -748,6 +720,7 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue,
nr_pdcch_channel_level(pdcch_vars->dl_ch_estimates_ext,
frame_parms,
avgP,
+ s,
n_rb);
avgs = 0;
@@ -802,6 +775,7 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue,
nr_pdcch_demapping_deinterleaving((uint32_t *) pdcch_vars->llr,
(uint32_t *) pdcch_vars->e_rx,
rel15->coreset.duration,
+ rel15->coreset.StartSymbolIndex,
n_rb,
rel15->coreset.RegBundleSize,
rel15->coreset.InterleaverSize,
@@ -824,36 +798,7 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue,
return (0);
}
-#endif
-#if 0
-void nr_pdcch_scrambling(NR_DL_FRAME_PARMS *frame_parms,
- uint8_t nr_slot_rx,
- uint8_t *e,
- uint32_t length) {
- int i;
- uint8_t reset;
- uint32_t x1, x2, s=0;
- reset = 1;
- // x1 is set in lte_gold_generic
- x2 = (nr_slot_rx<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.8.2
-
- for (i=0; i>(i&0x1f))&1));
- if (e[i] != 2) // element is 2
- e[i] = (e[i]&1) ^ ((s>>(i&0x1f))&1);
- }
-}
-#endif
-
-
-#ifdef NR_PDCCH_DCI_RUN
void nr_pdcch_unscrambling(int16_t *z,
uint16_t scrambling_RNTI,
@@ -883,10 +828,7 @@ void nr_pdcch_unscrambling(int16_t *z,
}
}
-#endif
-
-#ifdef NR_PDCCH_DCI_RUN
/* This function compares the received DCI bits with
* re-encoded DCI bits and returns the number of mismatched bits
*/
@@ -946,7 +888,8 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
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, length %d, format %s\n", j, rel15->number_of_candidates, CCEind, CCEind*9*6*2, L, dci_length,nr_dci_format_string[rel15->dci_format_options[k]]);
+ LOG_D(PHY, "Trying DCI candidate %d of %d number of candidates, CCE %d (%d), L %d, length %d, format %s\n",
+ j, rel15->number_of_candidates, CCEind, CCEind*9*6*2, L, dci_length,nr_dci_format_string[rel15->dci_format_options[k]]);
nr_pdcch_unscrambling(&pdcch_vars->e_rx[CCEind*108], rel15->coreset.scrambling_rnti, L*108, rel15->coreset.pdcch_dmrs_scrambling_id, tmp_e);
@@ -997,846 +940,4 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
return(dci_ind->number_of_dcis);
}
-/*
-void nr_dci_decoding_procedure0(int s,
- int p,
- int coreset_time_dur,
- uint16_t coreset_nbr_rb,
- NR_UE_PDCCH **pdcch_vars,
- int do_common,
- uint8_t nr_slot_rx,
- NR_DCI_ALLOC_t *dci_alloc,
- int16_t eNB_id,
- uint8_t current_thread_id,
- NR_DL_FRAME_PARMS *frame_parms,
- //uint8_t mi,
- uint16_t crc_scrambled_values[TOTAL_NBR_SCRAMBLED_VALUES],
- uint8_t L,
- NR_UE_SEARCHSPACE_CSS_DCI_FORMAT_t format_css,
- NR_UE_SEARCHSPACE_USS_DCI_FORMAT_t format_uss,
- uint8_t sizeof_bits,
- uint8_t sizeof_bytes,
- uint8_t *dci_cnt,
- crc_scrambled_t *crc_scrambled,
- format_found_t *format_found,
- uint16_t pdcch_DMRS_scrambling_id,
- uint32_t *CCEmap0,
- uint32_t *CCEmap1,
- uint32_t *CCEmap2) {
- uint32_t crc, CCEind, nCCE[3];
- uint32_t *CCEmap = NULL, CCEmap_mask = 0;
- uint8_t L2 = (1 << L);
- unsigned int Yk, nb_candidates = 0, i, m;
- unsigned int CCEmap_cand;
- uint32_t decoderState=0;
- // A[p], p is the current active CORESET
- uint16_t A[3]= {39827,39829,39839};
- //Table 10.1-2: Maximum number of PDCCH candidates per slot and per serving cell as a function of the subcarrier spacing value 2^mu*15 KHz, mu {0,1,2,3}
- uint8_t m_max_slot_pdcch_Table10_1_2 [4] = {44,36,22,20};
- //Table 10.1-3: Maximum number of non-overlapped CCEs per slot and per serving cell as a function of the subcarrier spacing value 2^mu*15 KHz, mu {0,1,2,3}
- //uint8_t cce_max_slot_pdcch_Table10_1_3 [4] = {56,56,48,32};
- int coreset_nbr_cce_per_symbol=0;
- LOG_DDD("format_found is %d \n", *format_found);
- //if (mode == NO_DCI) {
- // #ifdef NR_PDCCH_DCI_DEBUG
- // LOG_DDD("skip DCI decoding: expect no DCIs at nr_slot_rx %d in current searchSpace\n", nr_slot_rx);
- // #endif
- // return;
- //}
- LOG_DDD("frequencyDomainResources=%lx, duration=%d\n",
- pdcch_vars[eNB_id]->coreset[p].frequencyDomainResources, pdcch_vars[eNB_id]->coreset[p].duration);
- // nCCE = get_nCCE(pdcch_vars[eNB_id]->num_pdcch_symbols, frame_parms, mi);
- for (int i = 0; i < 45; i++) {
- // this loop counts each bit of the bit map coreset_freq_dom, and increments nbr_RB_coreset for each bit set to '1'
- if (((pdcch_vars[eNB_id]->coreset[p].frequencyDomainResources & 0x1FFFFFFFFFFF) >> i) & 0x1) coreset_nbr_cce_per_symbol++;
- }
-
- nCCE[p] = pdcch_vars[eNB_id]->coreset[p].duration*coreset_nbr_cce_per_symbol; // 1 CCE = 6 RB
- // p is the current CORESET we are currently monitoring (among the 3 possible CORESETs in a BWP)
- // the number of CCE in the current CORESET is:
- // the number of symbols in the CORESET (pdcch_vars[eNB_id]->coreset[p].duration)
- // multiplied by the number of bits set to '1' in the frequencyDomainResources bitmap
- // (1 bit set to '1' corresponds to 6 RB and 1 CCE = 6 RB)
- LOG_DDD("nCCE[%d]=%d\n",p,nCCE[p]);
-
- // if (nCCE > get_nCCE(3, frame_parms, 1)) {
- //LOG_D(PHY,
- //"skip DCI decoding: nCCE=%d > get_nCCE(3,frame_parms,1)=%d\n",
- //nCCE, get_nCCE(3, frame_parms, 1));
- //return;
- // }
-
-// if (nCCE < L2) {
-// LOG_D(PHY, "skip DCI decoding: nCCE=%d < L2=%d\n", nCCE, L2);
-// return;
-// }
-
-// if (mode == NO_DCI) {
-// LOG_D(PHY, "skip DCI decoding: expect no DCIs at nr_slot_rx %d\n",
-// nr_slot_rx);
-// return;
-// }
-
- if (do_common == 1) {
- Yk = 0;
-
- if (pdcch_vars[eNB_id]->searchSpace[s].searchSpaceType.common_dci_formats == cformat2_0) {
- // for dci_format_2_0, the nb_candidates is obtained from a different variable
- switch (L2) {
- case 1:
- nb_candidates = pdcch_vars[eNB_id]->searchSpace[s].searchSpaceType.sfi_nrofCandidates_aggrlevel1;
- break;
-
- case 2:
- nb_candidates = pdcch_vars[eNB_id]->searchSpace[s].searchSpaceType.sfi_nrofCandidates_aggrlevel2;
- break;
-
- case 4:
- nb_candidates = pdcch_vars[eNB_id]->searchSpace[s].searchSpaceType.sfi_nrofCandidates_aggrlevel4;
- break;
-
- case 8:
- nb_candidates = pdcch_vars[eNB_id]->searchSpace[s].searchSpaceType.sfi_nrofCandidates_aggrlevel8;
- break;
-
- case 16:
- nb_candidates = pdcch_vars[eNB_id]->searchSpace[s].searchSpaceType.sfi_nrofCandidates_aggrlevel16;
- break;
-
- default:
- break;
- }
- } else if (pdcch_vars[eNB_id]->searchSpace[s].searchSpaceType.common_dci_formats == cformat2_3) {
- // for dci_format_2_3, the nb_candidates is obtained from a different variable
- nb_candidates = pdcch_vars[eNB_id]->searchSpace[s].searchSpaceType.srs_nrofCandidates;
- } else {
- nb_candidates = (L2 == 4) ? 4 : ((L2 == 8)? 2 : 1); // according to Table 10.1-1 (38.213 section 10.1)
- LOG_DDD("we are in common searchSpace and nb_candidates=%u for L2=%d\n", nb_candidates, L2);
- }
- } else {
- switch (L2) {
- case 1:
- nb_candidates = pdcch_vars[eNB_id]->searchSpace[s].nrofCandidates_aggrlevel1;
- break;
-
- case 2:
- nb_candidates = pdcch_vars[eNB_id]->searchSpace[s].nrofCandidates_aggrlevel2;
- break;
-
- case 4:
- nb_candidates = pdcch_vars[eNB_id]->searchSpace[s].nrofCandidates_aggrlevel4;
- break;
-
- case 8:
- nb_candidates = pdcch_vars[eNB_id]->searchSpace[s].nrofCandidates_aggrlevel8;
- break;
-
- case 16:
- nb_candidates = pdcch_vars[eNB_id]->searchSpace[s].nrofCandidates_aggrlevel16;
- break;
-
- default:
- break;
- }
-
- // Find first available in ue specific search space
- // according to procedure in Section 10.1 of 38.213
- // compute Yk
- Yk = (unsigned int) pdcch_vars[eNB_id]->crnti;
-
- for (i = 0; i <= nr_slot_rx; i++)
- Yk = (Yk * A[p%3]) % 65537;
- }
-
- LOG_DDD("L2(%d) | nCCE[%d](%d) | Yk(%u) | nb_candidates(%u)\n", L2, p, nCCE[p], Yk, nb_candidates);
- // for (CCEind=0;
- // CCEind nCCE[p])
- // nb_candidates = nCCE[p] / L2;
- // In the next code line there is maybe a bug. The spec is not comparing Table 10.1-2 with nb_candidates, but with total number of candidates for all s and all p
- int m_p_s_L_max = (m_max_slot_pdcch_Table10_1_2[1]<=nb_candidates ? m_max_slot_pdcch_Table10_1_2[1] : nb_candidates);
-
- if (L==4) m_p_s_L_max=1; // Table 10.1-2 is not defined for L=4
-
- if(0 <= L && L < 4) LOG_DDD("m_max_slot_pdcch_Table10_1_2(%d)=%d\n",L,m_max_slot_pdcch_Table10_1_2[L]);
-
- for (m = 0; m < nb_candidates; m++) {
- int n_ci = 0;
-
- if (nCCE[p] < L2) return;
-
- LOG_DDD("debug1(%d)=nCCE[p]/L2 | nCCE[%d](%d) | L2(%d)\n",nCCE[p] / L2,p,nCCE[p],L2);
- LOG_DDD("debug2(%d)=L2*m_p_s_L_max | L2(%d) | m_p_s_L_max(%d)\n",L2*m_p_s_L_max,L2,m_p_s_L_max);
- CCEind = (((Yk + (uint16_t)(floor((m*nCCE[p])/(L2*m_p_s_L_max))) + n_ci) % (uint16_t)(floor(nCCE[p] / L2))) * L2);
- LOG_DDD("CCEind(%u) = (((Yk(%u) + ((m(%u)*nCCE[p](%u))/(L2(%d)*m_p_s_L_max(%d)))) %% (nCCE[p] / L2)) * L2)\n",
- CCEind,Yk,m,nCCE[p],L2,m_p_s_L_max);
- LOG_DDD("n_candidate(m)=%u | CCEind=%u |",m,CCEind);
-
- if (CCEind < 32)
- CCEmap = CCEmap0;
- else if (CCEind < 64)
- CCEmap = CCEmap1;
- else if (CCEind < 96)
- CCEmap = CCEmap2;
- else AssertFatal(1==0,"Illegal CCEind %u (Yk %u, m %u, nCCE %u, L2 %u\n", CCEind, Yk, m, nCCE[p], L2);
-
- switch (L2) {
- case 1:
- CCEmap_mask = (1 << (CCEind & 0x1f));
- break;
-
- case 2:
- CCEmap_mask = (3 << (CCEind & 0x1f));
- break;
-
- case 4:
- CCEmap_mask = (0xf << (CCEind & 0x1f));
- break;
-
- case 8:
- CCEmap_mask = (0xff << (CCEind & 0x1f));
- break;
-
- case 16:
- CCEmap_mask = (0xfff << (CCEind & 0x1f));
- break;
-
- default:
- LOG_E(PHY, "Illegal L2 value %d\n", L2);
- //mac_xface->macphy_exit("Illegal L2\n");
- return; // not reached
- }
-
- CCEmap_cand = (*CCEmap) & CCEmap_mask;
- // CCE is not allocated yet
- LOG_DDD("CCEmap_cand=%u \n",CCEmap_cand);
-
- if (CCEmap_cand == 0) {
-#ifdef DEBUG_DCI_DECODING
-
- if (do_common == 1)
- LOG_I(PHY,"[DCI search nPdcch %d - common] Attempting candidate %d Aggregation Level %d DCI length %d at CCE %d/%d (CCEmap %x,CCEmap_cand %x)\n",
- pdcch_vars[eNB_id]->num_pdcch_symbols,m,L2,sizeof_bits,CCEind,nCCE,*CCEmap,CCEmap_mask);
- else
- LOG_I(PHY,"[DCI search nPdcch %d - ue spec] Attempting candidate %d Aggregation Level %d DCI length %d at CCE %d/%d (CCEmap %x,CCEmap_cand %x) format %d\n",
- pdcch_vars[eNB_id]->num_pdcch_symbols,m,L2,sizeof_bits,CCEind,nCCE,*CCEmap,CCEmap_mask,format_uss);
-
-#endif
- LOG_DDD("... we enter function dci_decoding(sizeof_bits=%d L=%d) -----\n",sizeof_bits,L);
- LOG_DDD("... we have to replace this part of the code by polar decoding\n");
- // for (int m=0; m < (nCCE[p]*6*9*2); m++)
- LOG_DDD("(polar decoding)-> polar intput (with coreset_time_dur=%d, coreset_nbr_rb=%d, p=%d, CCEind=%u): \n",
- coreset_time_dur,coreset_nbr_rb,p,CCEind);
-
- //int reg_p=0,reg_e=0;
- //for (int m=0; m < (L2*6); m++){
- //reg_p = (((int)floor(m/coreset_time_dur))+((m%coreset_time_dur)*(L2*6/coreset_time_dur)))*9*2;
- //reg_e = m*9*2;
- //for (int i=0; i<9*2; i++){
- //polar_input[reg_p+i] = (pdcch_vars[eNB_id]->e_rx[((CCEind*9*6*2) + reg_e + i)]>0) ? (1.0):(-1.0);
- //polar_input[reg_e+i] = (pdcch_vars[eNB_id]->e_rx[((CCEind*9*6*2) + reg_e + i)]>0) ? (1/sqrt(2)):((-1)/sqrt(2));
- //printf("\t m=%d \tpolar_input[%d]=%lf <-> e_rx[%d]=%d\n",m,reg_e+i,polar_input[reg_e+i],
- // ((CCEind*9*6*2) + reg_e + i),pdcch_vars[eNB_id]->e_rx[((CCEind*9*6*2) + reg_e + i)]);
- //printf("\t m=%d \tpolar_input[%d]=%lf <-> e_rx[%d]=%d\n",m,reg_p+i,polar_input[reg_p+i],
- // ((CCEind*9*6*2) + reg_e + i),pdcch_vars[eNB_id]->e_rx[((CCEind*9*6*2) + reg_e + i)]);
- //}
- //}
-
- //#ifdef NR_PDCCH_DCI_DEBUG
- //printf("\n");
- //int j=0;
- //uint32_t polar_hex[27] = {0};
- //for (int i=0; ie_rx[CCEind*9*6*2],
- dci_estimation,
- 1,
- currentPtrDCI);
- crc = decoderState;
- //crc = (crc16(&dci_decoded_output[current_thread_id][0], sizeof_bits) >> 16) ^ extract_crc(&dci_decoded_output[current_thread_id][0], sizeof_bits);
- LOG_DDD("... we end function dci_decoding() with crc=%x\n",crc);
- LOG_DDD("... we have to replace this part of the code by polar decoding\n");
-#ifdef DEBUG_DCI_DECODING
- LOG_DDD("(nr_dci_decoding_procedure0: crc =>%d\n",crc);
-#endif //uint16_t tc_rnti, uint16_t int_rnti, uint16_t sfi_rnti, uint16_t tpc_pusch_rnti, uint16_t tpc_pucch_rnti, uint16_t tpc_srs__rnti
- LOG_DDD("format_found=%d\n",*format_found);
- LOG_DDD("crc_scrambled=%d\n",*crc_scrambled);
-
- if (crc == crc_scrambled_values[_C_RNTI_]) {
- *crc_scrambled =_c_rnti;
- *format_found=1;
- }
-
- if (crc == crc_scrambled_values[_CS_RNTI_]) {
- *crc_scrambled =_cs_rnti;
- *format_found=1;
- }
-
- if (crc == crc_scrambled_values[_NEW_RNTI_]) {
- *crc_scrambled =_new_rnti;
- *format_found=1;
- }
-
- if (crc == crc_scrambled_values[_TC_RNTI_]) {
- *crc_scrambled =_tc_rnti;
- *format_found=_format_1_0_found;
- }
-
- if (crc == crc_scrambled_values[_P_RNTI_]) {
- *crc_scrambled =_p_rnti;
- *format_found=_format_1_0_found;
- }
-
- if (crc == crc_scrambled_values[_SI_RNTI_]) {
- *crc_scrambled =_si_rnti;
- *format_found=_format_1_0_found;
- }
-
- if (crc == crc_scrambled_values[_RA_RNTI_]) {
- *crc_scrambled =_ra_rnti;
- *format_found=_format_1_0_found;
- }
-
- if (crc == crc_scrambled_values[_SP_CSI_RNTI_]) {
- *crc_scrambled =_sp_csi_rnti;
- *format_found=_format_0_1_found;
- }
-
- if (crc == crc_scrambled_values[_SFI_RNTI_]) {
- *crc_scrambled =_sfi_rnti;
- *format_found=_format_2_0_found;
- }
-
- if (crc == crc_scrambled_values[_INT_RNTI_]) {
- *crc_scrambled =_int_rnti;
- *format_found=_format_2_1_found;
- }
-
- if (crc == crc_scrambled_values[_TPC_PUSCH_RNTI_]) {
- *crc_scrambled =_tpc_pusch_rnti;
- *format_found=_format_2_2_found;
- }
-
- if (crc == crc_scrambled_values[_TPC_PUCCH_RNTI_]) {
- *crc_scrambled =_tpc_pucch_rnti;
- *format_found=_format_2_2_found;
- }
-
- if (crc == crc_scrambled_values[_TPC_SRS_RNTI_]) {
- *crc_scrambled =_tpc_srs_rnti;
- *format_found=_format_2_3_found;
- }
-
-
- LOG_DDD("format_found=%d\n",*format_found);
- LOG_DDD("crc_scrambled=%d\n",*crc_scrambled);
-
- if (*format_found!=255) {
- dci_alloc[*dci_cnt].dci_length = sizeof_bits;
- dci_alloc[*dci_cnt].rnti = crc;
- dci_alloc[*dci_cnt].L = L;
- dci_alloc[*dci_cnt].firstCCE = CCEind;
- memcpy(&dci_alloc[*dci_cnt].dci_pdu[0],dci_estimation,8);
-
- LOG_DDD("rnti matches -> DCI FOUND !!! crc =>0x%x, sizeof_bits %d, sizeof_bytes %d \n",
- dci_alloc[*dci_cnt].rnti, dci_alloc[*dci_cnt].dci_length, sizeof_bytes);
- LOG_DDD("dci_cnt %d (format_css %d crc_scrambled %d) L %d, firstCCE %d pdu[0] 0x%lx pdu[1] 0x%lx \n",
- *dci_cnt, format_css,*crc_scrambled,dci_alloc[*dci_cnt].L, dci_alloc[*dci_cnt].firstCCE,dci_alloc[*dci_cnt].dci_pdu[0],dci_alloc[*dci_cnt].dci_pdu[1]);
- if ((format_css == cformat0_0_and_1_0) || (format_uss == uformat0_0_and_1_0)) {
- if ((*crc_scrambled == _p_rnti) || (*crc_scrambled == _si_rnti) || (*crc_scrambled == _ra_rnti)) {
- dci_alloc[*dci_cnt].format = format1_0;
- *dci_cnt = *dci_cnt + 1;
- *format_found=_format_1_0_found;
- // LOG_DDD("a format1_0=%d and dci_cnt=%d\n",*format_found,*dci_cnt);
- } else {
- if ((dci_estimation[0]&1) == 0) {
- dci_alloc[*dci_cnt].format = format0_0;
- *dci_cnt = *dci_cnt + 1;
- *format_found=_format_0_0_found;
- // LOG_DDD("b format0_0=%d and dci_cnt=%d\n",*format_found,*dci_cnt);
- }
-
- if ((dci_estimation[0]&1) == 1) {
- dci_alloc[*dci_cnt].format = format1_0;
- *dci_cnt = *dci_cnt + 1;
- *format_found=_format_1_0_found;
- // LOG_DDD("c format1_0=%d and dci_cnt=%d\n",*format_found,*dci_cnt);
- }
- }
- }
-
- if (format_css == cformat2_0) {
- dci_alloc[*dci_cnt].format = format2_0;
- *dci_cnt = *dci_cnt + 1;
- *format_found=_format_2_0_found;
- }
-
- if (format_css == cformat2_1) {
- dci_alloc[*dci_cnt].format = format2_1;
- *dci_cnt = *dci_cnt + 1;
- *format_found=_format_2_1_found;
- }
-
- if (format_css == cformat2_2) {
- dci_alloc[*dci_cnt].format = format2_2;
- *dci_cnt = *dci_cnt + 1;
- *format_found=_format_2_2_found;
- }
-
- if (format_css == cformat2_3) {
- dci_alloc[*dci_cnt].format = format2_3;
- *dci_cnt = *dci_cnt + 1;
- *format_found=_format_2_3_found;
- }
-
- if (format_uss == uformat0_1_and_1_1) {
- if ((dci_estimation[0]&1) == 0) {
- dci_alloc[*dci_cnt].format = format0_1;
- *dci_cnt = *dci_cnt + 1;
- *format_found=_format_0_1_found;
- }
-
- if ((dci_estimation[0]&1) == 1) {
- dci_alloc[*dci_cnt].format = format1_1;
- *dci_cnt = *dci_cnt + 1;
- *format_found=_format_1_1_found;
- }
- }
-
- // store first nCCE of group for PUCCH transmission of ACK/NAK
- pdcch_vars[eNB_id]->nCCE[nr_slot_rx] = CCEind;
-
- // if (crc == si_rnti) {
- // dci_alloc[*dci_cnt].format = format_si;
- // *dci_cnt = *dci_cnt + 1;
- // } else if (crc == p_rnti) {
- // dci_alloc[*dci_cnt].format = format_p;
- // *dci_cnt = *dci_cnt + 1;
- // } else if (crc == ra_rnti) {
- // dci_alloc[*dci_cnt].format = format_ra;
- // // store first nCCE of group for PUCCH transmission of ACK/NAK
- // pdcch_vars[eNB_id]->nCCE[nr_slot_rx] = CCEind;
- // *dci_cnt = *dci_cnt + 1;
- // } else if (crc == pdcch_vars[eNB_id]->crnti) {
-
- // if ((mode & UL_DCI) && (format_c == format0)
- // && ((dci_decoded_output[current_thread_id][0] & 0x80)
- // == 0)) { // check if pdu is format 0 or 1A
- // if (*format0_found == 0) {
- // dci_alloc[*dci_cnt].format = format0;
- // *format0_found = 1;
- // *dci_cnt = *dci_cnt + 1;
- // pdcch_vars[eNB_id]->nCCE[nr_slot_rx] = CCEind;
- // }
- // } else if (format_c == format0) { // this is a format 1A DCI
- // dci_alloc[*dci_cnt].format = format1A;
- // *dci_cnt = *dci_cnt + 1;
- // pdcch_vars[eNB_id]->nCCE[nr_slot_rx] = CCEind;
- // } else {
- // // store first nCCE of group for PUCCH transmission of ACK/NAK
- // if (*format_c_found == 0) {
- // dci_alloc[*dci_cnt].format = format_c;
- // *dci_cnt = *dci_cnt + 1;
- // *format_c_found = 1;
- // pdcch_vars[eNB_id]->nCCE[nr_slot_rx] = CCEind;
- // }
- // }
- // }
- //LOG_I(PHY,"DCI decoding CRNTI [format: %d, nCCE[nr_slot_rx: %d]: %d ], AggregationLevel %d \n",format_c, nr_slot_rx, pdcch_vars[eNB_id]->nCCE[nr_slot_rx],L2);
- // memcpy(&dci_alloc[*dci_cnt].dci_pdu[0],dci_decoded_output,sizeof_bytes);
- switch (1 << L) {
- case 1:
- *CCEmap |= (1 << (CCEind & 0x1f));
- break;
-
- case 2:
- *CCEmap |= (1 << (CCEind & 0x1f));
- break;
-
- case 4:
- *CCEmap |= (1 << (CCEind & 0x1f));
- break;
-
- case 8:
- *CCEmap |= (1 << (CCEind & 0x1f));
- break;
-
- case 16:
- *CCEmap |= (1 << (CCEind & 0x1f));
- break;
- }
-
-#ifdef DEBUG_DCI_DECODING
- LOG_I(PHY,"[DCI search] Found DCI %d rnti %x Aggregation %d length %d format %d in CCE %d (CCEmap %x) candidate %d / %d \n",
- *dci_cnt,crc,1<pdcch_vars[ue->current_thread_id[nr_slot_rx]];
- NR_UE_PDCCH *pdcch_vars2 = ue->pdcch_vars[ue->current_thread_id[nr_slot_rx]][eNB_id];
- uint16_t pdcch_DMRS_scrambling_id = pdcch_vars2->coreset[p].pdcchDMRSScramblingID;
- uint64_t coreset_freq_dom = pdcch_vars2->coreset[p].frequencyDomainResources;
- int coreset_time_dur = pdcch_vars2->coreset[p].duration;
- uint16_t coreset_nbr_rb=0;
-
- for (int i = 0; i < 45; i++) {
- // this loop counts each bit of the bit map coreset_freq_dom, and increments nbr_RB_coreset for each bit set to '1'
- if (((coreset_freq_dom & 0x1FFFFFFFFFFF) >> i) & 0x1) coreset_nbr_rb++;
- }
-
- coreset_nbr_rb = 6 * coreset_nbr_rb;
- // coreset_time_dur,coreset_nbr_rb,
- NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
- //uint8_t mi;// = get_mi(&ue->frame_parms, nr_slot_rx);
- //uint8_t tmode = ue->transmission_mode[eNB_id];
- //uint8_t frame_type = frame_parms->frame_type;
- uint8_t format_0_0_1_0_size_bits = 0, format_0_0_1_0_size_bytes = 0; //FIXME
- uint8_t format_0_1_1_1_size_bits = 0, format_0_1_1_1_size_bytes = 0; //FIXME
- uint8_t format_2_0_size_bits = 0, format_2_0_size_bytes = 0; //FIXME
- uint8_t format_2_1_size_bits = 0, format_2_1_size_bytes = 0; //FIXME
- uint8_t format_2_2_size_bits = 0, format_2_2_size_bytes = 0; //FIXME
- uint8_t format_2_3_size_bits = 0, format_2_3_size_bytes = 0; //FIXME
- /*
- *
- * The implementation of this function will depend on the information given by the searchSpace IE
- *
- * In LTE the UE has no knowledge about:
- * - the type of search (common or ue-specific)
- * - the DCI format it is going to be decoded when performing the PDCCH monitoring
- * So the blind decoding has to be done for common and ue-specific searchSpaces for each aggregation level and for each dci format
- *
- * In NR the UE has a knowledge about the search Space type and the DCI format it is going to be decoded,
- * so in the blind decoding we can call the function nr_dci_decoding_procedure0 with the searchSpace type and the dci format parameter
- * We will call this function as many times as aggregation levels indicated in searchSpace
- * Implementation according to 38.213 v15.1.0 Section 10.
- *
- */
- NR_UE_SEARCHSPACE_CSS_DCI_FORMAT_t css_dci_format = pdcch_vars2->searchSpace[s].searchSpaceType.common_dci_formats; //FIXME!!!
- NR_UE_SEARCHSPACE_USS_DCI_FORMAT_t uss_dci_format = pdcch_vars2->searchSpace[s].searchSpaceType.ue_specific_dci_formats; //FIXME!!!
- // The following initialization is only for test purposes. To be removed
- // NR_UE_SEARCHSPACE_CSS_DCI_FORMAT_t
- css_dci_format = cformat0_0_and_1_0;
- //NR_UE_SEARCHSPACE_USS_DCI_FORMAT_t
- uss_dci_format = uformat0_0_and_1_0;
- /*
- * Possible overlap between RE for SS/PBCH blocks (described in section 10, 38.213) has not been implemented yet
- * This can be implemented by setting variable 'mode = NO_DCI' when overlap occurs
- */
- //dci_detect_mode_t mode = 3; //dci_detect_mode_select(&ue->frame_parms, nr_slot_rx);
- LOG_DD("searSpaceType=%d\n",do_common);
- LOG_DD("%s_dci_format=%d\n",do_common?"uss":"css",css_dci_format);
-
-
- // A set of PDCCH candidates for a UE to monitor is defined in terms of PDCCH search spaces
- if (do_common==0) { // COMMON SearchSpaceType assigned to current SearchSpace/CORESET
- // Type0-PDCCH common search space for a DCI format with CRC scrambled by a SI-RNTI
- // number of consecutive resource blocks and a number of consecutive symbols for
- // the control resource set of the Type0-PDCCH common search space from
- // the four most significant bits of RMSI-PDCCH-Config as described in Tables 13-1 through 13-10
- // and determines PDCCH monitoring occasions
- // from the four least significant bits of RMSI-PDCCH-Config,
- // included in MasterInformationBlock, as described in Tables 13-11 through 13-15
- // Type0A-PDCCH common search space for a DCI format with CRC scrambled by a SI-RNTI
- // Type1-PDCCH common search space for a DCI format with CRC scrambled by a RA-RNTI, or a TC-RNTI, or a C-RNTI
- // Type2-PDCCH common search space for a DCI format with CRC scrambled by a P-RNTI
- if (css_dci_format == cformat0_0_and_1_0) {
- // 38.213 v15.1.0 Table 10.1-1: CCE aggregation levels and maximum number of PDCCH candidates per CCE
- // aggregation level for Type0/Type0A/Type2-PDCCH common search space
- // CCE Aggregation Level Number of Candidates
- // 4 4
- // 8 2
- // 16 1
- // FIXME
- // We shall consider Table 10.1-1 to calculate the blind decoding only for Type0/Type0A/Type2-PDCCH
- // Shall we consider the nrofCandidates in SearSpace IE that considers Aggregation Levels 1,2,4,8,16? Our implementation considers Table 10.1-1
- // blind decoding (Type0-PDCCH,Type0A-PDCCH,Type1-PDCCH,Type2-PDCCH)
- // for format0_0 => we are NOT implementing format0_0 for common search spaces. FIXME!
- // for format0_0 and format1_0, first we calculate dci pdu size
- format_0_0_1_0_size_bits = nr_dci_format_size(ue,eNB_id,nr_slot_rx,p,_c_rnti,n_RB_ULBWP,n_RB_DLBWP,dci_fields_sizes,0);
- format_0_0_1_0_size_bytes = (format_0_0_1_0_size_bits%8 == 0) ? (uint8_t)floor(format_0_0_1_0_size_bits/8) : (uint8_t)(floor(format_0_0_1_0_size_bits/8) + 1);
- LOG_DD("calculating dci format size for common searchSpaces with format css_dci_format=%d, format_0_0_1_0_size_bits=%d, format_0_0_1_0_size_bytes=%d\n",
- css_dci_format,format_0_0_1_0_size_bits,format_0_0_1_0_size_bytes);
-
- for (int aggregationLevel = 0; aggregationLevel<5 ; aggregationLevel++) { // We fix aggregationLevel to 3 for testing=> nbr of CCE=8
- //for (int aggregationLevel = 2; aggregationLevel<5 ; aggregationLevel++) {
- // for aggregation level aggregationLevel. The number of candidates (for L2= 2^aggregationLevel) will be calculated in function nr_dci_decoding_procedure0
- LOG_DD("common searchSpaces with format css_dci_format=%d and aggregation_level=%d\n",
- css_dci_format,(1<current_thread_id[nr_slot_rx], frame_parms,
- crc_scrambled_values, aggregationLevel,
- cformat0_0_and_1_0, uformat0_0_and_1_0,
- format_0_0_1_0_size_bits, format_0_0_1_0_size_bytes, &dci_cnt,
- &crc_scrambled_, &format_found_, pdcch_DMRS_scrambling_id,&CCEmap0, &CCEmap1, &CCEmap2);
-
- if (dci_cnt != old_dci_cnt) {
- // we will exit the loop as we have found the DCI
- aggregationLevel = 5;
- format_0_0_1_0_size_bits = nr_dci_format_size(ue,eNB_id,nr_slot_rx,p,crc_scrambled_,n_RB_ULBWP,n_RB_DLBWP,dci_fields_sizes,
- 0); // after decoding dci successfully we recalculate dci pdu size with correct crc scrambled to get the right field sizes
- old_dci_cnt = dci_cnt;
-
- for (int i=0; icurrent_thread_id[nr_slot_rx], frame_parms,
- crc_scrambled_values, aggregationLevelSFI,
- cformat2_0, uformat0_0_and_1_0,
- format_2_0_size_bits, format_2_0_size_bytes, &dci_cnt,
- &crc_scrambled_, &format_found_,pdcch_DMRS_scrambling_id, &CCEmap0, &CCEmap1, &CCEmap2);
-
- if (dci_cnt != old_dci_cnt) {
- // we will exit the loop as we have found the DCI
- aggregationLevelSFI = 5;
- old_dci_cnt = dci_cnt;
-
- for (int i=0; icurrent_thread_id[nr_slot_rx], frame_parms,
- crc_scrambled_values, aggregationLevel,
- cformat2_1, uformat0_0_and_1_0,
- format_2_1_size_bits, format_2_1_size_bytes, &dci_cnt,
- &crc_scrambled_, &format_found_,pdcch_DMRS_scrambling_id, &CCEmap0, &CCEmap1, &CCEmap2);
-
- if (dci_cnt != old_dci_cnt) {
- // we will exit the loop as we have found the DCI
- aggregationLevel = 5;
- old_dci_cnt = dci_cnt;
-
- for (int i=0; icurrent_thread_id[nr_slot_rx], frame_parms,
- crc_scrambled_values, aggregationLevel,
- cformat2_2, uformat0_0_and_1_0,
- format_2_2_size_bits, format_2_2_size_bytes, &dci_cnt,
- &crc_scrambled_, &format_found_,pdcch_DMRS_scrambling_id, &CCEmap0, &CCEmap1, &CCEmap2);
-
- if (dci_cnt != old_dci_cnt) {
- // we will exit the loop as we have found the DCI
- aggregationLevel = 5;
- old_dci_cnt = dci_cnt;
-
- for (int i=0; icurrent_thread_id[nr_slot_rx], frame_parms,
- crc_scrambled_values, aggregationLevel,
- cformat2_3, uformat0_0_and_1_0,
- format_2_3_size_bits, format_2_3_size_bytes, &dci_cnt,
- &crc_scrambled_, &format_found_,pdcch_DMRS_scrambling_id, &CCEmap0, &CCEmap1, &CCEmap2);
-
- if (dci_cnt != old_dci_cnt) {
- // we will exit the loop as we have found the DCI
- aggregationLevel = 5;
- old_dci_cnt = dci_cnt;
-
- for (int i=0; i nbr of CCE=8
- //for (int aggregationLevel = 2; aggregationLevel<5 ; aggregationLevel++) {
- // for aggregation level aggregationLevel. The number of candidates (for L2= 2^aggregationLevel) will be calculated in function nr_dci_decoding_procedure0
- LOG_DD("common searchSpaces with format css_dci_format=%d and aggregation_level=%d\n",
- css_dci_format,(1<current_thread_id[nr_slot_rx], frame_parms,
- crc_scrambled_values, aggregationLevel,
- cformat0_0_and_1_0, uformat0_0_and_1_0,
- format_0_0_1_0_size_bits, format_0_0_1_0_size_bytes, &dci_cnt,
- &crc_scrambled_, &format_found_,pdcch_DMRS_scrambling_id, &CCEmap0, &CCEmap1, &CCEmap2);
-
- if (dci_cnt != old_dci_cnt) {
- // we will exit the loop as we have found the DCI
- aggregationLevel = 5;
- old_dci_cnt = dci_cnt;
-
- for (int i=0; i nbr of CCE=8
- //for (int aggregationLevel = 2; aggregationLevel<5 ; aggregationLevel++) {
- // for aggregation level aggregationLevel. The number of candidates (for L2= 2^aggregationLevel) will be calculated in function nr_dci_decoding_procedure0
- LOG_DD("common searchSpaces with format css_dci_format=%d and aggregation_level=%d\n",
- css_dci_format,(1<current_thread_id[nr_slot_rx], frame_parms,
- crc_scrambled_values, aggregationLevel,
- cformat0_0_and_1_0, uformat0_1_and_1_1,
- format_0_1_1_1_size_bits, format_0_1_1_1_size_bytes, &dci_cnt,
- &crc_scrambled_, &format_found_,pdcch_DMRS_scrambling_id, &CCEmap0, &CCEmap1, &CCEmap2);
-
- if (dci_cnt != old_dci_cnt) {
- // we will exit the loop as we have found the DCI
- aggregationLevel = 5;
- old_dci_cnt = dci_cnt;
-
- for (int i=0; i
-#endif
-
-
#define MAX_DCI_SIZE_BITS 45
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
index 031c08a72d..0894ae9166 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
@@ -43,12 +43,6 @@
#include "PHY/NR_REFSIG/dmrs_nr.h"
#include "common/utils/nr/nr_common.h"
-#ifndef USER_MODE
-#define NOCYGWIN_STATIC static
-#else
-#define NOCYGWIN_STATIC
-#endif
-
/* dynamic shift for LLR computation for TM3/4
* set as command line argument, see lte-softmodem.c
* default value: 0
@@ -389,7 +383,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
printf("[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n",
frame,nr_slot_rx,slot,symbol,type,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
#else
- LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n",
+ LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n",
frame,nr_slot_rx,slot,symbol,type,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
#endif
@@ -411,7 +405,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
#if DISABLE_LOG_X
printf("[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
#else
- LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
+ LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
#endif
start_meas(&ue->generic_stat_bis[proc->thread_id][slot]);
if (first_symbol_flag==1) {
@@ -472,7 +466,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
#if DISABLE_LOG_X
printf("[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
#else
- LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
+ LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
#endif
start_meas(&ue->generic_stat_bis[proc->thread_id][slot]);
@@ -524,7 +518,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
#if DISABLE_LOG_X
printf("[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
#else
- LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
+ LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
#endif
start_meas(&ue->generic_stat_bis[proc->thread_id][slot]);
@@ -583,7 +577,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
#if DISABLE_LOG_X
printf("[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
#else
- LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
+ LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
#endif
start_meas(&ue->generic_stat_bis[proc->thread_id][slot]);
/* Store the valid DL RE's */
@@ -666,7 +660,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
#if DISABLE_LOG_X
printf("[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
#else
- LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
+ LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
#endif
// Please keep it: useful for debugging
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
index ffe21b1f6d..767edf9cc6 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
@@ -485,9 +485,9 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
for(int n_ss = 0; n_ssnb_search_space; n_ss++) {
uint8_t nb_symb_pdcch = pdcch_vars->pdcch_config[n_ss].coreset.duration;
+ int start_symb = pdcch_vars->pdcch_config[n_ss].coreset.StartSymbolIndex;
get_coreset_rballoc(pdcch_vars->pdcch_config[n_ss].coreset.frequency_domain_resource,&coreset_nb_rb,&coreset_start_rb);
-
- for (uint16_t l=0; lnr_of_symbols,pucch_pdu->start_symbol_index,pucch_pdu->prb_start,pucch_pdu->second_hop_prb,pucch_pdu->group_hop_flag,pucch_pdu->sequence_hop_flag,pucch_pdu->mcs);
-
+ LOG_D(PHY,"pucch0: slot %d nr_symbols %d, start_symbol %d, prb_start %d, second_hop_prb %d, group_hop_flag %d, sequence_hop_flag %d, mcs %d\n",
+ nr_slot_tx,pucch_pdu->nr_of_symbols,pucch_pdu->start_symbol_index,pucch_pdu->prb_start,pucch_pdu->second_hop_prb,pucch_pdu->group_hop_flag,pucch_pdu->sequence_hop_flag,pucch_pdu->mcs);
#ifdef DEBUG_NR_PUCCH_TX
printf("\t [nr_generate_pucch0] sequence generation: variable initialization for test\n");
diff --git a/openair1/PHY/TOOLS/lte_enb_scope.c b/openair1/PHY/TOOLS/lte_enb_scope.c
index 220df5b54a..bed507feee 100644
--- a/openair1/PHY/TOOLS/lte_enb_scope.c
+++ b/openair1/PHY/TOOLS/lte_enb_scope.c
@@ -69,18 +69,12 @@ void reset_stats(FL_OBJECT *button, long arg) {
static void *scope_thread_eNB(void *arg) {
-# ifdef ENABLE_XFORMS_WRITE_STATS
- FILE *eNB_stats;
-# endif
struct sched_param sched_param;
int UE_id, CC_id;
int ue_cnt=0;
sched_param.sched_priority = sched_get_priority_min(SCHED_FIFO)+1;
sched_setscheduler(0, SCHED_FIFO,&sched_param);
printf("Scope thread has priority %d\n",sched_param.sched_priority);
-# ifdef ENABLE_XFORMS_WRITE_STATS
- eNB_stats = fopen("eNB_stats.txt", "w");
-#endif
while (!oai_exit) {
ue_cnt=0;
@@ -99,16 +93,6 @@ static void *scope_thread_eNB(void *arg) {
usleep(100*1000);
}
- // printf("%s",stats_buffer);
-# ifdef ENABLE_XFORMS_WRITE_STATS
-
- if (eNB_stats) {
- rewind (eNB_stats);
- fwrite (stats_buffer, 1, len, eNB_stats);
- fclose (eNB_stats);
- }
-
-# endif
pthread_exit((void *)arg);
}
diff --git a/openair1/PHY/TOOLS/lte_ue_scope.c b/openair1/PHY/TOOLS/lte_ue_scope.c
index 20d88ebdab..00560f2d74 100644
--- a/openair1/PHY/TOOLS/lte_ue_scope.c
+++ b/openair1/PHY/TOOLS/lte_ue_scope.c
@@ -72,16 +72,10 @@ void reset_stats(FL_OBJECT *button, long arg) {
static void *scope_thread_UE(void *arg) {
char stats_buffer[16384];
-# ifdef ENABLE_XFORMS_WRITE_STATS
- FILE *UE_stats, *eNB_stats;
-# endif
struct sched_param sched_param;
sched_param.sched_priority = sched_get_priority_min(SCHED_FIFO)+1;
sched_setscheduler(0, SCHED_FIFO,&sched_param);
printf("Scope thread has priority %d\n",sched_param.sched_priority);
-# ifdef ENABLE_XFORMS_WRITE_STATS
- UE_stats = fopen("UE_stats.txt", "w");
-#endif
while (!oai_exit) {
// dump_ue_stats (PHY_vars_UE_g[0][0], &PHY_vars_UE_g[0][0]->proc.proc_rxtx[0],stats_buffer, 0, mode,rx_input_level_dBm);
@@ -94,16 +88,6 @@ static void *scope_thread_UE(void *arg) {
0,7);
// printf("%s",stats_buffer);
}
-
-# ifdef ENABLE_XFORMS_WRITE_STATS
-
- if (UE_stats) {
- rewind (UE_stats);
- fwrite (stats_buffer, 1, len, UE_stats);
- fclose (UE_stats);
- }
-
-# endif
pthread_exit((void *)arg);
}
diff --git a/openair1/PHY/TOOLS/nr_phy_scope.c b/openair1/PHY/TOOLS/nr_phy_scope.c
index fc1fa4c297..3440e4f28c 100644
--- a/openair1/PHY/TOOLS/nr_phy_scope.c
+++ b/openair1/PHY/TOOLS/nr_phy_scope.c
@@ -517,9 +517,6 @@ void phy_scope_gNB(OAI_phy_scope_t *form,
}
static void *scope_thread_gNB(void *arg) {
scopeData_t *p=(scopeData_t *) arg;
- //# ifdef ENABLE_XFORMS_WRITE_STATS
- // FILE *gNB_stats = fopen("gNB_stats.txt", "w");
- //#endif
size_t stksize=0;
pthread_attr_t atr;
pthread_attr_init(&atr);
diff --git a/openair1/PHY/TOOLS/time_meas.h b/openair1/PHY/TOOLS/time_meas.h
index f78ea55530..bf6999de70 100644
--- a/openair1/PHY/TOOLS/time_meas.h
+++ b/openair1/PHY/TOOLS/time_meas.h
@@ -128,6 +128,7 @@ static inline void start_meas(time_stats_t *ts) {
} else {
ts->in = rdtsc_oai();
}
+ if ((ts->trials&16383)<10) ts->max=0;
}
}
diff --git a/openair1/PHY/defs_L1_NB_IoT.h b/openair1/PHY/defs_L1_NB_IoT.h
index cc3ec94a95..a4552c8c27 100644
--- a/openair1/PHY/defs_L1_NB_IoT.h
+++ b/openair1/PHY/defs_L1_NB_IoT.h
@@ -48,7 +48,6 @@
#ifdef MEX
#define msg mexPrintf
#else
- #ifdef OPENAIR2
#if ENABLE_RAL
#include "collection/hashtable/hashtable.h"
#include "COMMON/ral_messages_types.h"
@@ -56,9 +55,6 @@
#endif
#include "common/utils/LOG/log.h"
#define msg(aRGS...) LOG_D(PHY, ##aRGS)
- #else
- #define msg printf
- #endif
#endif
//use msg in the real-time thread context
#define msg_nrt printf
@@ -196,19 +192,6 @@ typedef struct {
NB_IoT_UE_DLSCH_t *dlsch_rn_MCH[10];
} PHY_VARS_RN_NB_IoT;
-/*
-#ifdef OCP_FRAMEWORK
-#include
-#else
-//typedef enum {normal_txrx=0,rx_calib_ue=1,rx_calib_ue_med=2,rx_calib_ue_byp=3,debug_prach=4,no_L2_connect=5,calib_prach_tx=6,rx_dump_frame=7,loop_through_memory=8} runmode_t;
-*/
-// enum transmission_access_mode {
-// NO_ACCESS=0,
-// POSTPONED_ACCESS,
-// CANCELED_ACCESS,
-// UNKNOWN_ACCESS,
-// SCHEDULED_ACCESS,
-// CBA_ACCESS};
typedef enum {
eNodeB_3GPP_NB_IoT=0, // classical eNodeB function
diff --git a/openair1/PHY/defs_UE.h b/openair1/PHY/defs_UE.h
index e17b752e7b..2d2697a4b7 100644
--- a/openair1/PHY/defs_UE.h
+++ b/openair1/PHY/defs_UE.h
@@ -87,7 +87,6 @@
#define LOG_W(x, ...) mexPrintf(__VA_ARGS__)
#define LOG_M(x, ...) mexPrintf(__VA_ARGS__)
#else
- #ifdef OPENAIR2
#if ENABLE_RAL
#include "collection/hashtable/hashtable.h"
#include "COMMON/ral_messages_types.h"
@@ -95,9 +94,6 @@
#endif
#include "common/utils/LOG/log.h"
#define msg(aRGS...) LOG_D(PHY, ##aRGS)
- #else
- #define msg printf
- #endif
#endif
diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h
index 11b5112a6c..1db4f6328a 100644
--- a/openair1/PHY/defs_gNB.h
+++ b/openair1/PHY/defs_gNB.h
@@ -96,20 +96,6 @@ typedef struct {
uint32_t subframe;
/// MIMO mode for this DLSCH
MIMO_mode_t mimo_mode;
- /// Concatenated sequences
- uint8_t *e;
- /// LDPC-code outputs
- uint8_t *d[MAX_NUM_NR_DLSCH_SEGMENTS];
- /// Interleaver outputs
- uint8_t *f;
- /// Number of code segments
- uint32_t C;
- /// Number of bits in "small" code segments
- uint32_t K;
- /// Number of "Filler" bits
- uint32_t F;
- /// Encoder BG
- uint8_t BG;
/// LDPC lifting size
uint32_t Z;
} NR_DL_gNB_HARQ_t;
@@ -868,6 +854,9 @@ typedef struct PHY_VARS_gNB_s {
time_stats_t dlsch_encoding_stats;
time_stats_t dlsch_modulation_stats;
time_stats_t dlsch_scrambling_stats;
+ time_stats_t dlsch_resource_mapping_stats;
+ time_stats_t dlsch_layer_mapping_stats;
+ time_stats_t dlsch_precoding_stats;
time_stats_t tinput;
time_stats_t tprep;
time_stats_t tparity;
@@ -879,6 +868,7 @@ typedef struct PHY_VARS_gNB_s {
time_stats_t rx_pusch_stats;
time_stats_t ul_indication_stats;
+ time_stats_t schedule_response_stats;
time_stats_t ulsch_decoding_stats;
time_stats_t ulsch_rate_unmatching_stats;
time_stats_t ulsch_ldpc_decoding_stats;
diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h
index 8ce18aa667..027e73ea4a 100644
--- a/openair1/PHY/defs_nr_UE.h
+++ b/openair1/PHY/defs_nr_UE.h
@@ -51,16 +51,12 @@
#ifdef MEX
#define msg mexPrintf
#else
- #ifdef OPENAIR2
#if ENABLE_RAL
#include "common/utils/hashtable/hashtable.h"
#include "COMMON/ral_messages_types.h"
#include "UTIL/queue.h"
#endif
#define msg(aRGS...) LOG_D(PHY, ##aRGS)
- #else
- #define msg printf
- #endif
#endif
//use msg in the real-time thread context
#define msg_nrt printf
@@ -638,7 +634,7 @@ typedef struct {
uint8_t dciFormat;
uint8_t agregationLevel;
int nb_search_space;
- fapi_nr_dl_config_dci_dl_pdu_rel15_t pdcch_config[FAPI_NR_MAX_SS_PER_CORESET];
+ fapi_nr_dl_config_dci_dl_pdu_rel15_t pdcch_config[FAPI_NR_MAX_SS];
// frame and slot for sib1 in initial sync
uint16_t sfn;
uint16_t slot;
@@ -921,9 +917,10 @@ typedef struct {
uint8_t init_sync_frame;
/// temporary offset during cell search prior to MIB decoding
int ssb_offset;
- uint16_t symbol_offset; // offset in terms of symbols for detected ssb in sync
- int rx_offset; /// Timing offset
+ uint16_t symbol_offset; /// offset in terms of symbols for detected ssb in sync
+ int rx_offset; /// Timing offset
int rx_offset_diff; /// Timing adjustment for ofdm symbol0 on HW USRP
+ int max_pos_fil; /// Timing offset IIR filter
int time_sync_cell;
/// Timing Advance updates variables
diff --git a/openair1/PHY/phy_extern.h b/openair1/PHY/phy_extern.h
index d5fea5aec6..1ce042d086 100644
--- a/openair1/PHY/phy_extern.h
+++ b/openair1/PHY/phy_extern.h
@@ -55,12 +55,6 @@ extern char mode_string[4][20];
extern unsigned char NB_RU;
-#ifndef OPENAIR2
-extern unsigned char NB_eNB_INST;
-extern uint16_t NB_UE_INST;
-extern unsigned char NB_RN_INST;
-#endif
-
extern int flag_LA;
extern double sinr_bler_map[MCS_COUNT][2][MCS_TABLE_LENGTH_MAX];
extern double sinr_bler_map_up[MCS_COUNT][2][16];
diff --git a/openair1/PHY/phy_extern_nr_ue.h b/openair1/PHY/phy_extern_nr_ue.h
index f1704a7902..66d554f245 100644
--- a/openair1/PHY/phy_extern_nr_ue.h
+++ b/openair1/PHY/phy_extern_nr_ue.h
@@ -63,12 +63,6 @@ extern char mode_string[4][20];
extern unsigned char NB_RU;
-#ifndef OPENAIR2
-extern unsigned char NB_eNB_INST;
-extern uint16_t NB_UE_INST;
-extern unsigned char NB_RN_INST;
-#endif
-
extern int flag_LA;
extern double sinr_bler_map[MCS_COUNT][2][MCS_TABLE_LENGTH_MAX];
extern double sinr_bler_map_up[MCS_COUNT][2][16];
diff --git a/openair1/PHY/phy_extern_ue.h b/openair1/PHY/phy_extern_ue.h
index 9f227806fd..cff03e375d 100644
--- a/openair1/PHY/phy_extern_ue.h
+++ b/openair1/PHY/phy_extern_ue.h
@@ -53,12 +53,6 @@ extern int flagMag;
extern char mode_string[4][20];
-#ifndef OPENAIR2
-extern unsigned char NB_eNB_INST;
-extern uint16_t NB_UE_INST;
-extern unsigned char NB_RN_INST;
-#endif
-
extern int flag_LA;
extern double sinr_bler_map[MCS_COUNT][2][MCS_TABLE_LENGTH_MAX];
extern double sinr_bler_map_up[MCS_COUNT][2][16];
diff --git a/openair1/PHY/phy_vars.h b/openair1/PHY/phy_vars.h
index 9edb7031b9..5879784827 100644
--- a/openair1/PHY/phy_vars.h
+++ b/openair1/PHY/phy_vars.h
@@ -55,13 +55,6 @@ const short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
unsigned char NB_RU=0;
-#ifndef OPENAIR2
-//unsigned char NB_eNB_INST=0;
-//uint16_t NB_UE_INST=0;
-//unsigned char NB_RN_INST=0;
-//unsigned char NB_INST=0;
-#endif
-
int number_of_cards;
diff --git a/openair1/PHY/phy_vars_nr_ue.h b/openair1/PHY/phy_vars_nr_ue.h
index baa64561f0..cfdfbeb49d 100644
--- a/openair1/PHY/phy_vars_nr_ue.h
+++ b/openair1/PHY/phy_vars_nr_ue.h
@@ -57,13 +57,6 @@ const short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
unsigned char NB_RU=0;
-#ifndef OPENAIR2
-unsigned char NB_eNB_INST=0;
-uint16_t NB_UE_INST=0;
-unsigned char NB_RN_INST=0;
-unsigned char NB_INST=0;
-#endif
-
int number_of_cards;
diff --git a/openair1/PHY/phy_vars_ue.h b/openair1/PHY/phy_vars_ue.h
index 469a5c4754..ca35ab6629 100644
--- a/openair1/PHY/phy_vars_ue.h
+++ b/openair1/PHY/phy_vars_ue.h
@@ -47,14 +47,6 @@ const short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
#include "SIMULATION/ETH_TRANSPORT/vars.h"
-#ifndef OPENAIR2
- unsigned char NB_eNB_INST=0;
- uint16_t NB_UE_INST=0;
- unsigned char NB_RN_INST=0;
- unsigned char NB_INST=0;
-#endif
-
-
int number_of_cards;
diff --git a/openair1/PHY/types_NB_IoT.h b/openair1/PHY/types_NB_IoT.h
index 6735092583..e41129169c 100644
--- a/openair1/PHY/types_NB_IoT.h
+++ b/openair1/PHY/types_NB_IoT.h
@@ -22,11 +22,6 @@
#ifndef __openair_TYPES_NB_IOT_H__
#define __openair_TYPES_NB_IOT_H__
-#ifdef USER_MODE
#include
-#else
-#include
-#endif
-
#endif /*__openair_TYPES_NB_IOT_H__ */
diff --git a/openair1/SCHED_NR/fapi_nr_l1.c b/openair1/SCHED_NR/fapi_nr_l1.c
index 8f315ba214..f9d90d9204 100644
--- a/openair1/SCHED_NR/fapi_nr_l1.c
+++ b/openair1/SCHED_NR/fapi_nr_l1.c
@@ -148,7 +148,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
AssertFatal(RC.gNB[Mod_id]!=NULL,"RC.gNB[%d] is null\n",Mod_id);
gNB = RC.gNB[Mod_id];
-
+ start_meas(&gNB->schedule_response_stats);
notifiedFIFO_elt_t *res;
res = pullTpool(gNB->resp_L1_tx, gNB->threadPool);
processingData_L1tx_t *msgTx = (processingData_L1tx_t *)NotifiedFifoData(res);
@@ -248,5 +248,5 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
oai_nfapi_tx_data_req(TX_req);
}
-
+ stop_meas(&gNB->schedule_response_stats);
}
diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c
index 63cf6f2f2d..270123aeda 100644
--- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c
+++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c
@@ -401,10 +401,8 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id, uint8_t harq_pid, uint8_t crc_flag, int dtx_flag) {
- pthread_mutex_lock(&gNB->UL_INFO_mutex);
+ //pthread_mutex_lock(&gNB->UL_INFO_mutex);
- int timing_advance_update, cqi;
- int sync_pos;
NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id][0];
NR_UL_gNB_HARQ_t *harq_process = ulsch->harq_processes[harq_pid];
NR_gNB_SCH_STATS_t *stats=get_ulsch_stats(gNB,ulsch);
@@ -412,19 +410,20 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id,
nfapi_nr_pusch_pdu_t *pusch_pdu = &harq_process->ulsch_pdu;
// pdu->data = gNB->ulsch[ULSCH_id+1][0]->harq_processes[harq_pid]->b;
- sync_pos = nr_est_timing_advance_pusch(gNB, ULSCH_id); // estimate timing advance for MAC
+ int sync_pos = nr_est_timing_advance_pusch(gNB, ULSCH_id); // estimate timing advance for MAC
// scale the 16 factor in N_TA calculation in 38.213 section 4.2 according to the used FFT size
uint16_t bw_scaling = 16 * gNB->frame_parms.ofdm_symbol_size / 2048;
- int sync_pos_rounded;
+
// do some integer rounding to improve TA accuracy
+ int sync_pos_rounded;
if (sync_pos > 0)
sync_pos_rounded = sync_pos + (bw_scaling / 2) - 1;
else
- sync_pos_rounded = sync_pos - (bw_scaling / 2) - 1;
+ sync_pos_rounded = sync_pos - (bw_scaling / 2) + 1;
if (stats) stats->sync_pos = sync_pos;
- timing_advance_update = sync_pos_rounded / bw_scaling;
+ int timing_advance_update = sync_pos_rounded / bw_scaling;
// put timing advance command in 0..63 range
timing_advance_update += 31;
@@ -449,6 +448,7 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id,
LOG_D(PHY, "Estimated SNR for PUSCH is = %f dB (ulsch_power %f, noise %f)\n", SNRtimes10/10.0,dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_power_tot)/10.0,dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_noise_power_tot)/10.0);
+ int cqi;
if (SNRtimes10 < -640) cqi=0;
else if (SNRtimes10 > 635) cqi=255;
else cqi=(640+SNRtimes10)/5;
@@ -526,7 +526,7 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id,
gNB->UL_INFO.rx_ind.number_of_pdus++;
- pthread_mutex_unlock(&gNB->UL_INFO_mutex);
+// pthread_mutex_unlock(&gNB->UL_INFO_mutex);
}
// Function to fill UL RB mask to be used for N0 measurements
diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.h b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.h
index 9b7b87a18c..f00ce14b56 100755
--- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.h
+++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.h
@@ -44,4 +44,4 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response);
int8_t nr_ue_phy_config_request(nr_phy_config_t *phy_config);
-#endif
\ No newline at end of file
+#endif
diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
index c9d8222e4c..5ad7343d3d 100644
--- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
+++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
@@ -779,7 +779,8 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int gNB_
uint16_t s1 = dlsch0_harq->nb_symbols;
bool is_SI = dlsch0->rnti_type == _SI_RNTI_;
- LOG_D(PHY,"[UE %d] PDSCH type %d active in nr_slot_rx %d, harq_pid %d (%d), rb_start %d, nb_rb %d, symbol_start %d, nb_symbols %d, DMRS mask %x\n",ue->Mod_id,pdsch,nr_slot_rx,harq_pid,dlsch0_harq->status,pdsch_start_rb,pdsch_nb_rb,s0,s1,dlsch0_harq->dlDmrsSymbPos);
+ LOG_D(PHY,"[UE %d] PDSCH type %d active in nr_slot_rx %d, harq_pid %d (%d), rb_start %d, nb_rb %d, symbol_start %d, nb_symbols %d, DMRS mask %x\n",
+ ue->Mod_id,pdsch,nr_slot_rx,harq_pid,dlsch0_harq->status,pdsch_start_rb,pdsch_nb_rb,s0,s1,dlsch0_harq->dlDmrsSymbPos);
for (m = s0; m < (s0 +s1); m++) {
if (dlsch0_harq->dlDmrsSymbPos & (1 << m)) {
@@ -854,11 +855,7 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int gNB_
} else AssertFatal(1==0,"Not RA_PDSCH, SI_PDSCH or PDSCH\n");
stop_meas(&ue->dlsch_llr_stats_parallelization[proc->thread_id][slot]);
-#if PHYSIM
- printf("[AbsSFN %d.%d] LLR Computation Symbol %d %5.2f \n",frame_rx,nr_slot_rx,m,ue->dlsch_llr_stats_parallelization[proc->thread_id][slot].p_time/(cpuf*1000.0));
-#else
LOG_D(PHY, "[AbsSFN %d.%d] LLR Computation Symbol %d %5.2f \n",frame_rx,nr_slot_rx,m,ue->dlsch_llr_stats_parallelization[proc->thread_id][slot].p_time/(cpuf*1000.0));
-#endif
if(first_symbol_flag) {
proc->first_symbol_available = 1;
@@ -1052,17 +1049,10 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]);
-#if PHYSIM
- printf(" --> Unscrambling for CW0 %5.3f\n",
- (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0));
- printf("AbsSubframe %d.%d --> LDPC Decoding for CW0 %5.3f\n",
- frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0));
-#else
- LOG_I(PHY, " --> Unscrambling for CW0 %5.3f\n",
+ LOG_D(PHY, " --> Unscrambling for CW0 %5.3f\n",
(ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0));
- LOG_I(PHY, "AbsSubframe %d.%d --> LDPC Decoding for CW0 %5.3f\n",
+ LOG_D(PHY, "AbsSubframe %d.%d --> LDPC Decoding for CW0 %5.3f\n",
frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0));
-#endif
if(is_cw1_active) {
// start ldpc decode for CW 1
@@ -1128,17 +1118,10 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]);
-#if PHYSIM
- printf(" --> Unscrambling for CW1 %5.3f\n",
- (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0));
- printf("AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n",
- frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0));
-#else
LOG_D(PHY, " --> Unscrambling for CW1 %5.3f\n",
(ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0));
LOG_D(PHY, "AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n",
frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0));
-#endif
LOG_D(PHY,"AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n",
@@ -1449,11 +1432,7 @@ void *UE_thread_slot1_dl_processing(void *arg) {
stop_meas(&ue->ue_front_end_per_slot_stat[proc->thread_id][1]);
-#if PHYSIM
- printf("[AbsSFN %d.%d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",frame_rx,nr_slot_rx,ue->ue_front_end_per_slot_stat[proc->thread_id][1].p_time/(cpuf*1000.0));
-#else
LOG_D(PHY, "[AbsSFN %d.%d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",frame_rx,nr_slot_rx,ue->ue_front_end_per_slot_stat[proc->thread_id][1].p_time/(cpuf*1000.0));
-#endif
//wait until pdcch is decoded
@@ -1543,11 +1522,7 @@ void *UE_thread_slot1_dl_processing(void *arg) {
//printf("Set available LLR slot1 to 1 AbsSubframe %d.%d \n",frame_rx,nr_slot_rx);
stop_meas(&ue->pdsch_procedures_per_slot_stat[proc->thread_id][1]);
-#if PHYSIM
- printf("[AbsSFN %d.%d] Slot1: LLR Computation %5.2f \n",frame_rx,nr_slot_rx,ue->pdsch_procedures_per_slot_stat[proc->thread_id][1].p_time/(cpuf*1000.0));
-#else
LOG_D(PHY, "[AbsSFN %d.%d] Slot1: LLR Computation %5.2f \n",frame_rx,nr_slot_rx,ue->pdsch_procedures_per_slot_stat[proc->thread_id][1].p_time/(cpuf*1000.0));
-#endif
if (pthread_mutex_lock(&proc->mutex_slot1_dl_processing) != 0) {
LOG_E( PHY, "[SCHED][UE] error locking mutex for UE RXTX\n" );
@@ -1744,8 +1719,8 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
for (uint16_t l=0; lfirst_carrier_offset, pdcch_vars->pdcch_config[n_ss].BWPStart, coreset_start_rb);
+ LOG_D(PHY, "pdcch_channel_estimation: first_carrier_offset %d, BWPStart %d, coreset_start_rb %d, coreset_nb_rb %d\n",
+ fp->first_carrier_offset, pdcch_vars->pdcch_config[n_ss].BWPStart, coreset_start_rb, coreset_nb_rb);
if (coreset_nb_rb > 0)
nr_pdcch_channel_estimation(ue,
@@ -1917,13 +1892,8 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
dlsch_parallel);
stop_meas(&ue->dlsch_procedures_stat[proc->thread_id]);
-#if PHYSIM
- printf("[SFN %d] Slot1: Pdsch Proc %5.2f\n",nr_slot_rx,ue->pdsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0));
- printf("[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",nr_slot_rx,ue->dlsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0));
-#else
LOG_D(PHY, "[SFN %d] Slot1: Pdsch Proc %5.2f\n",nr_slot_rx,ue->pdsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0));
LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",nr_slot_rx,ue->dlsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0));
-#endif
@@ -2000,9 +1970,6 @@ if (nr_slot_rx==9) {
}
stop_meas(&ue->generic_stat);
-#if PHYSIM
-printf("after tubo until end of Rx %5.2f \n",ue->generic_stat.p_time/(cpuf*1000.0));
-#endif
#ifdef EMOS
phy_procedures_emos_UE_RX(ue,slot,gNB_id);
@@ -2012,11 +1979,7 @@ phy_procedures_emos_UE_RX(ue,slot,gNB_id);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT);
stop_meas(&ue->phy_proc_rx[proc->thread_id]);
-#if PHYSIM
-printf("------FULL RX PROC [SFN %d]: %5.2f ------\n",nr_slot_rx,ue->phy_proc_rx[proc->thread_id].p_time/(cpuf*1000.0));
-#else
LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",nr_slot_rx,ue->phy_proc_rx[proc->thread_id].p_time/(cpuf*1000.0));
-#endif
//#endif //pdsch
diff --git a/openair1/SIMULATION/LTE_PHY/gpib_send.c b/openair1/SIMULATION/LTE_PHY/gpib_send.c
index a8ae48cdfa..06ce60da0f 100644
--- a/openair1/SIMULATION/LTE_PHY/gpib_send.c
+++ b/openair1/SIMULATION/LTE_PHY/gpib_send.c
@@ -19,10 +19,10 @@
* contact@openairinterface.org
*/
-#include
-#include
-#include
-#include"gpib_send.h"
+#include
+#include
+#include
+#include "gpib_send.h"
void gpib_send(unsigned int gpib_board, unsigned int gpib_device, char *command_string )
{
unsigned short addlist[2] = {gpib_device, NOADDR};
diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c
index a0e0183fd1..b304327138 100644
--- a/openair1/SIMULATION/NR_PHY/dlschsim.c
+++ b/openair1/SIMULATION/NR_PHY/dlschsim.c
@@ -68,6 +68,7 @@ uint16_t n_rnti = 0x1234;
openair0_config_t openair0_cfg[MAX_CARDS];
void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq) {}
+void processSlotTX(void *arg) {}
int main(int argc, char **argv)
{
@@ -116,8 +117,10 @@ int main(int argc, char **argv)
uint8_t Imcs = 9;
uint8_t mcs_table = 0;
double DS_TDL = .03;
- cpuf = get_cpu_freq_GHz();
+ cpuf = get_cpu_freq_GHz();
+ char gNBthreads[128]="n";
+
if (load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY) == 0) {
exit_fun("[NR_DLSCHSIM] Error, configuration module init failed\n");
}
@@ -426,9 +429,22 @@ int main(int argc, char **argv)
UE->dlsch_SI[0] = new_nr_ue_dlsch(1, 1, Nsoft, 5, N_RB_DL, 0);
UE->dlsch_ra[0] = new_nr_ue_dlsch(1, 1, Nsoft, 5, N_RB_DL, 0);
unsigned char harq_pid = 0; //dlsch->harq_ids[subframe];
- processingData_L1tx_t msgDataTx;
- init_DLSCH_struct(gNB, &msgDataTx);
- NR_gNB_DLSCH_t *dlsch = msgDataTx.dlsch[0][0];
+
+ gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t));
+ initTpool(gNBthreads, gNB->threadPool, true);
+ gNB->resp_L1_tx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
+ initNotifiedFIFO(gNB->resp_L1_tx);
+ // we create 2 threads for L1 tx processing
+ notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->resp_L1_tx,processSlotTX);
+ processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx);
+ init_DLSCH_struct(gNB, msgDataTx);
+ msgDataTx->slot = slot;
+ msgDataTx->frame = frame;
+ memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t));
+ reset_meas(&msgDataTx->phy_proc_tx);
+ gNB->phy_proc_tx_0 = &msgDataTx->phy_proc_tx;
+ pushTpool(gNB->threadPool,msgL1Tx);
+ NR_gNB_DLSCH_t *dlsch = msgDataTx->dlsch[0][0];
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &dlsch->harq_process.pdsch_pdu.pdsch_pdu_rel15;
//time_stats_t *rm_stats, *te_stats, *i_stats;
uint8_t is_crnti = 0, llr8_flag = 0;
@@ -501,10 +517,13 @@ int main(int argc, char **argv)
/*for (int i=0; i0x%08x\n",crc24c(test_input, 32));
// generate signal
+ unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS] __attribute__((aligned(32)));
+ bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS);
if (input_fd == NULL) {
- nr_dlsch_encoding(gNB, test_input, frame, slot, dlsch, frame_parms,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+ nr_dlsch_encoding(gNB, test_input, frame, slot, dlsch, frame_parms,output,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
}
for (SNR = snr0; SNR < snr1; SNR += snr_step) {
@@ -521,11 +540,12 @@ int main(int argc, char **argv)
//if (i<16)
// printf("encoder output f[%d] = %d\n",i,dlsch->harq_processes[0]->f[i]);
+ /*
if (dlsch->harq_process.f[i] == 0)
modulated_input[i] = 1.0; ///sqrt(2); //QPSK
else
modulated_input[i] = -1.0; ///sqrt(2);
-
+ */
//if (i<16) printf("modulated_input[%d] = %d\n",i,modulated_input[i]);
//SNR =10;
SNR_lin = pow(10, SNR / 10.0);
@@ -548,9 +568,10 @@ int main(int argc, char **argv)
channel_output_uncoded[i] = 1; //QPSK demod
else
channel_output_uncoded[i] = 0;
-
+ /*
if (channel_output_uncoded[i] != dlsch->harq_process.f[i])
errors_bit_uncoded = errors_bit_uncoded + 1;
+ */
}
//if (errors_bit_uncoded>10)
@@ -636,7 +657,7 @@ int main(int argc, char **argv)
for (i = 0; i < 2; i++) {
printf("gNB %d\n", i);
- free_gNB_dlsch(&(msgDataTx.dlsch[0][i]),N_RB_DL);
+ free_gNB_dlsch(&(msgDataTx->dlsch[0][i]),N_RB_DL);
printf("UE %d\n", i);
free_nr_ue_dlsch(&(UE->dlsch[0][0][i]),N_RB_DL);
}
diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c
index 16c6c94bbe..55eac0a377 100644
--- a/openair1/SIMULATION/NR_PHY/dlsim.c
+++ b/openair1/SIMULATION/NR_PHY/dlsim.c
@@ -371,6 +371,7 @@ int main(int argc, char **argv)
uint8_t n_tx=1,n_rx=1;
uint8_t round;
uint8_t num_rounds = 4;
+ char gNBthreads[128]="n";
channel_desc_t *gNB2UE;
//uint32_t nsymb,tx_lev,tx_lev1 = 0,tx_lev2 = 0;
@@ -432,9 +433,7 @@ int main(int argc, char **argv)
FILE *scg_fd=NULL;
-
- while ((c = getopt (argc, argv, "f:hA:pf:g:in:s:S:t:x:y:z:M:N:F:GR:dPIL:Ea:b:D:e:m:w:T:U:q")) != -1) {
-
+ while ((c = getopt (argc, argv, "f:hA:pf:g:in:s:S:t:x:y:z:M:N:F:GR:dPIL:Ea:b:d:e:m:w:T:U:qX:")) != -1) {
switch (c) {
case 'f':
scg_fd = fopen(optarg,"r");
@@ -637,7 +636,12 @@ int main(int argc, char **argv)
dmrs_arg[i] = atoi(argv[optind++]);
}
break;
-
+
+ case 'X':
+ strncpy(gNBthreads, optarg, sizeof(gNBthreads));
+ gNBthreads[sizeof(gNBthreads)-1]=0;
+ break;
+
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",
@@ -673,7 +677,8 @@ int main(int argc, char **argv)
printf("-U Change DMRS Config, arguments list DMRS TYPE{0=A,1=B} DMRS AddPos{0:2} DMRS ConfType{1:2}, e.g. -U 3 0 2 1 \n");
printf("-P Print DLSCH performances\n");
printf("-w Write txdata to binary file (one frame)\n");
- printf("-D number of dlsch threads, 0: no dlsch parallelization\n");
+ printf("-d number of dlsch threads, 0: no dlsch parallelization\n");
+ printf("-X gNB thread pool configuration, n => no threads");
exit (-1);
break;
}
@@ -829,6 +834,14 @@ int main(int argc, char **argv)
fs = 61.44e6;
bw = 40e6;
}
+ else if (mu == 1 && N_RB_DL == 133) {
+ fs = 61.44e6;
+ bw = 50e6;
+ }
+ else if (mu == 1 && N_RB_DL == 162) {
+ fs = 61.44e6;
+ bw = 60e6;
+ }
else if (mu == 3 && N_RB_DL == 66) {
fs = 122.88e6;
bw = 100e6;
@@ -968,8 +981,7 @@ int main(int argc, char **argv)
snrRun = 0;
gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t));
- char tp_param[] = "n";
- initTpool(tp_param, gNB->threadPool, true);
+ initTpool(gNBthreads, gNB->threadPool, true);
gNB->resp_L1_tx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
initNotifiedFIFO(gNB->resp_L1_tx);
// we create 2 threads for L1 tx processing
@@ -1223,8 +1235,8 @@ int main(int argc, char **argv)
UE->dlsch[UE_proc.thread_id][0][0]->max_ldpc_iterations+1)
n_errors++;
- NR_UE_PDSCH **pdsch_vars = UE->pdsch_vars[UE_proc.thread_id];
- int16_t *UE_llr = pdsch_vars[0]->llr[0];
+ //NR_UE_PDSCH **pdsch_vars = UE->pdsch_vars[UE_proc.thread_id];
+ //int16_t *UE_llr = pdsch_vars[0]->llr[0];
TBS = UE_harq_process->TBS;//rel15->TBSize[0];
uint16_t length_dmrs = get_num_dmrs(rel15->dlDmrsSymbPos);
@@ -1239,6 +1251,7 @@ int main(int argc, char **argv)
printf("[DLSIM][PTRS] Available bits are: %5u, removed PTRS bits are: %5u \n",available_bits, (ptrsSymbPerSlot * ptrsRePerSymb *rel15->nrOfLayers* 2) );
}
+ /*
for (i = 0; i < available_bits; i++) {
if(((gNB_dlsch->harq_process.f[i] == 0) && (UE_llr[i] <= 0)) ||
@@ -1252,6 +1265,7 @@ int main(int argc, char **argv)
}
}
+ */
for (i = 0; i < TBS; i++) {
estimated_output_bit[i] = (UE_harq_process->b[i/8] & (1 << (i & 7))) >> (i & 7);
@@ -1295,11 +1309,9 @@ int main(int argc, char **argv)
printf("\n");
if (print_perf==1) {
- printf("\ngNB TX function statistics (per %d us slot, NPRB %d, mcs %d, TBS %d, Kr %d (Zc %d))\n",
+ printf("\ngNB TX function statistics (per %d us slot, NPRB %d, mcs %d, TBS %d)\n",
1000>>*scc->ssbSubcarrierSpacing, g_rbSize, g_mcsIndex,
- msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3,
- msgDataTx->dlsch[0][0]->harq_process.K,
- msgDataTx->dlsch[0][0]->harq_process.K/((msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3)>3824?22:10));
+ msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3);
printDistribution(gNB->phy_proc_tx_0,table_tx,"PHY proc tx");
printStatIndent2(&gNB->dlsch_encoding_stats,"DLSCH encoding time");
printStatIndent3(&gNB->dlsch_segmentation_stats,"DLSCH segmentation time");
@@ -1311,6 +1323,9 @@ int main(int argc, char **argv)
printStatIndent3(&gNB->dlsch_interleaving_stats, "DLSCH Interleaving time");
printStatIndent2(&gNB->dlsch_modulation_stats,"DLSCH modulation time");
printStatIndent2(&gNB->dlsch_scrambling_stats, "DLSCH scrambling time");
+ printStatIndent2(&gNB->dlsch_layer_mapping_stats, "DLSCH Layer Mapping time");
+ printStatIndent2(&gNB->dlsch_resource_mapping_stats, "DLSCH Resource Mapping time");
+ printStatIndent2(&gNB->dlsch_precoding_stats,"DLSCH Layer Precoding time");
printf("\nUE RX function statistics (per %d us slot)\n",1000>>*scc->ssbSubcarrierSpacing);
diff --git a/openair2/COMMON/mac_rrc_primitives.h b/openair2/COMMON/mac_rrc_primitives.h
index 5a45f2f196..d258bb872a 100644
--- a/openair2/COMMON/mac_rrc_primitives.h
+++ b/openair2/COMMON/mac_rrc_primitives.h
@@ -22,9 +22,7 @@
#ifndef __MAC_RRC_PRIMITIVES_H__
#define __MAC_RRC_PRIMITIVES_H__
-#ifndef OPENAIR2_IN
- #include "LAYER2/RLC/rlc.h"
-#endif
+#include "LAYER2/RLC/rlc.h"
#include "COMMON/platform_types.h"
#include "COMMON/platform_constants.h"
#include "openair2/RRC/LTE/rrc_defs.h"
@@ -306,8 +304,6 @@ typedef struct {
-#ifndef OPENAIR2_IN
-
typedef struct { //RRC_INTERFACE_FUNCTIONS
unsigned int Frame_index;
unsigned short UE_index[NB_MODULES_MAX][NB_SIG_CNX_UE];
@@ -375,10 +371,6 @@ typedef struct {
} MAC_RLC_XFACE;
-#endif
-
-
-
//#define IDLE 0
#define NEED_RADIO_CONFIG 3
#define RADIO_CONFIG_TX 2
diff --git a/openair2/COMMON/platform_constants.h b/openair2/COMMON/platform_constants.h
index c56a31711a..355f56f9c9 100644
--- a/openair2/COMMON/platform_constants.h
+++ b/openair2/COMMON/platform_constants.h
@@ -77,7 +77,7 @@
#else
#define MAX_MOBILES_PER_ENB 4
#define MAX_MOBILES_PER_ENB_NB_IoT 4
- #define MAX_MOBILES_PER_GNB 2//16
+ #define MAX_MOBILES_PER_GNB 4//16
#define MAX_eNB 2
#define MAX_gNB 2
#endif
diff --git a/openair2/COMMON/rrm_config_structs.h b/openair2/COMMON/rrm_config_structs.h
deleted file mode 100644
index 9d060d102d..0000000000
--- a/openair2/COMMON/rrm_config_structs.h
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The OpenAirInterface Software Alliance licenses this file to You under
- * the OAI Public License, Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.openairinterface.org/?page_id=698
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *-------------------------------------------------------------------------------
- * For more information about the OpenAirInterface (OAI) Software Alliance:
- * contact@openairinterface.org
- */
-
-/*
- rrm_config_structs.h
- -------------------
- AUTHOR : Linus GASSER modified by Lionel GAUTHIER Raymond KNOPP
- COMPANY : EURECOM
- EMAIL : linus.gasser@epfl.ch
- EMAIL : lionel.gauthier@eurecom.fr
- EMAIL : raymond.knopp@eurecom.fr
-
-
-
- ***************************************************************************/
-#ifdef OLD_RRC_CELLULAR
-# ifndef __RRM_CONFIG_STRUCTS_H__
-# define __RRM_CONFIG_STRUCTS_H__
-
-# include "platform_types.h"
-# include "platform_constants.h"
-# include "rrm_constants.h"
-# include "rlc.h"
-
-typedef volatile struct {
- uint32_t e_r;
- int timer_poll;
- int timer_poll_prohibit;
- int timer_discard;
- int timer_poll_periodic;
- int timer_status_prohibit;
- int timer_status_periodic;
- int timer_rst;
- int timer_mrw;
- int missing_pdu_indicator;
- uint32_t pdu_size;
- // int in_sequence_delivery; // not implemented
- uint8_t max_rst;
- uint8_t max_dat;
- uint16_t poll_pdu;
- uint16_t poll_sdu;
- uint8_t poll_window;
- uint32_t tx_window_size;
- uint32_t rx_window_size;
- uint8_t max_mrw;
- uint8_t last_transmission_pdu_poll_trigger;
- uint8_t last_retransmission_pdu_poll_trigger;
- enum RLC_SDU_DISCARD_MODE sdu_discard_mode;
- uint32_t send_mrw;
-} AM;
-
-typedef volatile struct {
- uint32_t e_r;
- uint32_t timer_discard;
- uint32_t sdu_discard_mode;
- uint32_t segmentation_indication;
- uint32_t delivery_of_erroneous_sdu;
-} TM;
-
-typedef volatile struct {
- uint32_t e_r;
- uint32_t timer_discard;
- uint32_t sdu_discard_mode;
-} UM;
-
-typedef volatile struct {
- uint8_t logch_identity;
- uint8_t mac_logch_priority;
-} MAP_INFO;
-
-typedef volatile struct {
- uint32_t rlc_mode;
- AM am;
- TM tm;
- UM um;
-} RLC_INFO;
-
-typedef volatile struct {
- int header_compression_algorithm;
-} PDCP_INFO;
-
-
-
-
-typedef volatile struct {
- rb_type_t rb_type;
- RLC_INFO rlc_info;
- PDCP_INFO pdcp_info;
- uint16_t rb_id;
- // Added for OPENAIR MAC
- //LCHAN_DESC Lchan_desc;
-
-} RADIOBEARER;
-
-
-typedef volatile struct {
- int TIMER300;
- int TIMER302;
- int TIMER305;
- int TIMER307;
- int TIMER308;
- int TIMER312;
- int TIMER313;
- int TIMER314;
- int TIMER315;
-} L3TIMERS_;
-
-typedef volatile struct {
- int COUNTERN300;
- int COUNTERN302;
- int COUNTERN308;
- int COUNTERN312;
- int COUNTERN313;
-} L3COUNTERS_;
-
-
-typedef volatile struct {
- int MaxNumRemote;
- L3TIMERS_ Timers;
- L3COUNTERS_ Counters;
-} L3_;
-
-
-typedef volatile struct {
- uint8_t rrm_action; // ACTION_NULL,ADD,REMOVE,MODIFY
- uint8_t rrm_element; // rb,trch,cctrch
- uint8_t rrm_element_index; // rb/trch/cctrch index
-} RRM_COMMAND_MT;
-
-typedef volatile struct {
- uint8_t rrm_action; // ACTION_NULL,ADD,REMOVE,MODIFY
- uint8_t mobile;
- uint8_t rrm_element; // rb,trch,cctrch
- uint8_t rrm_element_index; // rb/trch/cctrch index
-} RRM_COMMAND_RG;
-
-
-typedef volatile struct {
- uint8_t nb_commands;
- RRM_COMMAND_RG rrm_commands[JRRM_MAX_COMMANDS_PER_TRANSACTION];
-
-
- RADIOBEARER bearer[MAX_RB_RG];
- L3_ L3;
-
-} RG_CONFIG;
-
-typedef volatile struct {
- uint8_t nb_commands;
- RRM_COMMAND_MT rrm_commands[JRRM_MAX_COMMANDS_PER_TRANSACTION];
-
- RADIOBEARER bearer[MAX_RB_MOBILE];
- L3_ L3;
-
-} MT_CONFIG;
-
-# ifdef NODE_RG
-typedef volatile struct {
- RG_CONFIG rg_config;
- MT_CONFIG mt_config[MAX_MOBILES_PER_RG];
-} RRM_VARS;
-
-# else
-/* NODE_RG */
-typedef volatile struct {
- MT_CONFIG mt_config[MAX_MANAGED_RG_PER_MOBILE];
-
-
-
-} RRM_VARS;
-# endif
-/* NODE_RG */
-//typedef MT_CONFIG MAIN_MOBILE ;
-//typedef RG_CONFIG MAIN_RADIO_GATEWAY;
-
-# endif
-#endif
diff --git a/openair2/GNB_APP/MACRLC_nr_paramdef.h b/openair2/GNB_APP/MACRLC_nr_paramdef.h
index 7858cd6c32..b17fced7b7 100644
--- a/openair2/GNB_APP/MACRLC_nr_paramdef.h
+++ b/openair2/GNB_APP/MACRLC_nr_paramdef.h
@@ -60,6 +60,11 @@
#define CONFIG_STRING_MACRLC_PUCCHTARGETSNRX10 "pucch_TargetSNRx10"
#define CONFIG_STRING_MACRLC_PUCCHFAILURETHRES "pucch_FailureThres"
#define CONFIG_STRING_MACRLC_PUSCHFAILURETHRES "pusch_FailureThres"
+#define CONFIG_STRING_MACRLC_DL_BLER_TARGET_UPPER "dl_bler_target_upper"
+#define CONFIG_STRING_MACRLC_DL_BLER_TARGET_LOWER "dl_bler_target_lower"
+#define CONFIG_STRING_MACRLC_DL_RD2_BLER_THRESHOLD "dl_rd2_bler_threshold"
+#define CONFIG_STRING_MACRLC_DL_MAX_MCS "dl_max_mcs"
+
/*-------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* MacRLC configuration parameters */
@@ -88,6 +93,10 @@
{CONFIG_STRING_MACRLC_PUCCHTARGETSNRX10, NULL, 0, iptr:NULL, defintval:150, TYPE_INT, 0}, \
{CONFIG_STRING_MACRLC_PUCCHFAILURETHRES, NULL, 0, iptr:NULL, defintval:10, TYPE_INT, 0}, \
{CONFIG_STRING_MACRLC_PUSCHFAILURETHRES, NULL, 0, iptr:NULL, defintval:10, TYPE_INT, 0}, \
+{CONFIG_STRING_MACRLC_DL_BLER_TARGET_UPPER, "Upper threshold of BLER to decrease DL MCS", 0, dblptr:NULL, defdblval:0.15, TYPE_DOUBLE, 0}, \
+{CONFIG_STRING_MACRLC_DL_BLER_TARGET_LOWER, "Lower threshold of BLER to increase DL MCS", 0, dblptr:NULL, defdblval:0.05, TYPE_DOUBLE, 0}, \
+{CONFIG_STRING_MACRLC_DL_RD2_BLER_THRESHOLD, "Threshold of RD2/RETX2 BLER to decrease DL MCS", 0, dblptr:NULL, defdblval:0.01, TYPE_DOUBLE, 0}, \
+{CONFIG_STRING_MACRLC_DL_MAX_MCS, "Maximum DL MCS that should be used", 0, u8ptr:NULL, defintval:28, TYPE_UINT8, 0}, \
}
#define MACRLC_CC_IDX 0
#define MACRLC_TRANSPORT_N_PREFERENCE_IDX 1
@@ -111,5 +120,10 @@
#define MACRLC_PUCCHTARGETSNRX10_IDX 19
#define MACRLC_PUCCHFAILURETHRES_IDX 20
#define MACRLC_PUSCHFAILURETHRES_IDX 21
+#define MACRLC_DL_BLER_TARGET_UPPER_IDX 22
+#define MACRLC_DL_BLER_TARGET_LOWER_IDX 23
+#define MACRLC_DL_RD2_BLER_THRESHOLD_IDX 24
+#define MACRLC_DL_MAX_MCS_IDX 25
+
/*---------------------------------------------------------------------------------------------------------------------------------------------------------*/
#endif
diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c
index 08255fe422..e4762ee3ee 100644
--- a/openair2/GNB_APP/gnb_config.c
+++ b/openair2/GNB_APP/gnb_config.c
@@ -755,6 +755,10 @@ void RCconfig_nr_macrlc() {
AssertFatal(1==0,"MACRLC %d: %s unknown southbound midhaul\n",j,*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_S_PREFERENCE_IDX].strptr));
}
RC.nrmac[j]->ulsch_max_frame_inactivity = *(MacRLC_ParamList.paramarray[j][MACRLC_ULSCH_MAX_FRAME_INACTIVITY].uptr);
+ RC.nrmac[j]->dl_bler_target_upper = *(MacRLC_ParamList.paramarray[j][MACRLC_DL_BLER_TARGET_UPPER_IDX].dblptr);
+ RC.nrmac[j]->dl_bler_target_lower = *(MacRLC_ParamList.paramarray[j][MACRLC_DL_BLER_TARGET_LOWER_IDX].dblptr);
+ RC.nrmac[j]->dl_rd2_bler_threshold = *(MacRLC_ParamList.paramarray[j][MACRLC_DL_RD2_BLER_THRESHOLD_IDX].dblptr);
+ RC.nrmac[j]->dl_max_mcs = *(MacRLC_ParamList.paramarray[j][MACRLC_DL_MAX_MCS_IDX].u8ptr);
RC.nrmac[j]->num_ulprbbl = num_prbbl;
LOG_I(NR_MAC,"Blacklisted PRBS %d\n",num_prbbl);
memcpy(RC.nrmac[j]->ulprbbl,prbbl,275*sizeof(prbbl[0]));
diff --git a/openair2/GNB_APP/gnb_config.h b/openair2/GNB_APP/gnb_config.h
index 46102e4488..013997f439 100644
--- a/openair2/GNB_APP/gnb_config.h
+++ b/openair2/GNB_APP/gnb_config.h
@@ -42,10 +42,7 @@
#include "ngap_messages_types.h"
#include "f1ap_messages_types.h"
-#ifdef CMAKER
#include "rrc_messages_types.h"
-#endif
-
#include "intertask_interface.h"
#include "RRC/NR/nr_rrc_defs.h"
diff --git a/openair2/LAYER2/MAC/defs_NB_IoT.h b/openair2/LAYER2/MAC/defs_NB_IoT.h
index 78524e104d..d4945f0182 100644
--- a/openair2/LAYER2/MAC/defs_NB_IoT.h
+++ b/openair2/LAYER2/MAC/defs_NB_IoT.h
@@ -9,11 +9,9 @@
*/
#ifndef __LAYER2_MAC_DEFS_NB_IOT_H__
#define __LAYER2_MAC_DEFS_NB_IOT_H__
-#ifdef USER_MODE
#include
#include
#include
-#endif
//#include "COMMON/openair_defs.h"
#include "COMMON/platform_constants.h"
#include "COMMON/mac_rrc_primitives.h"
diff --git a/openair2/LAYER2/MAC/mac_vars.h b/openair2/LAYER2/MAC/mac_vars.h
index bd25bd6047..3b51820171 100644
--- a/openair2/LAYER2/MAC/mac_vars.h
+++ b/openair2/LAYER2/MAC/mac_vars.h
@@ -105,13 +105,11 @@ eNB_ULSCH_INFO eNB_ulsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][MAX_MOBILES_PER_EN
eNB_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][MAX_MOBILES_PER_ENB]; // eNBxUE = 8x8
-#ifdef OPENAIR2
unsigned char NB_eNB_INST = 0;
uint16_t NB_UE_INST = 0;
uint16_t NB_THREAD_INST = 0;
unsigned char NB_RN_INST = 0;
unsigned char NB_INST = 0;
-#endif
DCI0_5MHz_TDD_1_6_t UL_alloc_pdu;
diff --git a/openair2/LAYER2/MAC/ue_procedures.c b/openair2/LAYER2/MAC/ue_procedures.c
index 9ae8f82a00..21d349ea52 100644
--- a/openair2/LAYER2/MAC/ue_procedures.c
+++ b/openair2/LAYER2/MAC/ue_procedures.c
@@ -77,13 +77,6 @@ static int mbms_mch_i=0;
//static int num_msi_per_CSA[28];
-/*
- *
-#ifndef USER_MODE
-#define msg debug_msg
-#endif
- */
-
mapping BSR_names[] = {
{"NONE", 0},
{"SHORT BSR", 1},
@@ -1251,65 +1244,6 @@ int ue_query_mch_fembms(module_id_t module_idP, uint8_t CC_id, uint32_t frameP,
}
-
-
-#ifdef OLD
- // Acount for sf_allocable in CSA
- int num_sf_alloc = 0;
-
- for (l = 0; l < 8; l++) {
- if (UE_mac_inst[module_idP].commonSF_Alloc_r9_mbsfn_SubframeConfig[l] == NULL)
- continue;
-
- if (UE_mac_inst[module_idP].commonSF_Alloc_r9_mbsfn_SubframeConfig[l]->subframeAllocation.present != LTE_MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame)
- continue;
-
- uint32_t common_mbsfn_SubframeConfig = UE_mac_inst[module_idP].commonSF_Alloc_r9_mbsfn_SubframeConfig[l]->subframeAllocation.choice.oneFrame.buf[0];
-
-
- for (j = 0; j < 6; j++)
- num_sf_alloc += ((common_mbsfn_SubframeConfig & (0x80 >> j)) == (0x80 >> j));
- //num_sf_alloc=1;
- }
-
- num_sf_alloc = 10;
-
- num_non_mbsfn_SubframeConfig = (UE_mac_inst[module_idP].non_mbsfn_SubframeConfig->subframeAllocation_r14.buf[0]<<1 | UE_mac_inst[module_idP].non_mbsfn_SubframeConfig->subframeAllocation_r14.buf[0]>>7);
- int ones=0;
- for(j=0; j < 16; j++){
- if(num_non_mbsfn_SubframeConfig & 1)
- ones++;
- num_non_mbsfn_SubframeConfig>>=1;
- }
-
- for (l = 0; l < 28; l++) {
- if (UE_mac_inst[module_idP].pmch_stop_mtch[l] >= 1/*num_sf_alloc*/) {
- if (UE_mac_inst[module_idP].pmch_stop_mtch[l] != 2047) {
- if (UE_mac_inst[module_idP].pmch_Config[UE_mac_inst[module_idP].msi_pmch] != NULL){
- mtch_mcs = UE_mac_inst[module_idP].pmch_Config[UE_mac_inst[module_idP].msi_pmch]->dataMCS_r9;
- //int common_mbsfn_alloc_offset = UE_mac_inst[module_idP].commonSF_Alloc_r9_mbsfn_SubframeConfig[0]->radioframeAllocationOffset;
- long common_mbsfn_period = 1 << UE_mac_inst[module_idP].commonSF_Alloc_r9_mbsfn_SubframeConfig[0]->radioframeAllocationPeriod;
- long commonSF_AllocPeriod = 4 << UE_mac_inst[module_idP].commonSF_AllocPeriod_r9;
- if(UE_mac_inst[module_idP].common_num_sf_alloc >= UE_mac_inst[module_idP].pmch_stop_mtch[l]){
- //LOG_E(MAC,"Attemp to UE_mac_inst[module_idP].common_num_sf_alloc %d\n",UE_mac_inst[module_idP].common_num_sf_alloc);
-
- mtch_mcs = -1;
- }/*else
- OG_W(MAC,"Attemp to UE_mac_inst[module_idP].common_num_sf_alloc %d\n",UE_mac_inst[module_idP].common_num_sf_alloc);*/
- LOG_D(MAC,"Attemp to UE_mac_inst[module_idP].common_num_sf_alloc %d num_sf_alloc %d commonSF_AllocPeriod %ld, common_mbsfn_period %ld num_non_mbsfn_SubframeConfig %x ones %d\n",UE_mac_inst[module_idP].common_num_sf_alloc,num_sf_alloc, commonSF_AllocPeriod,common_mbsfn_period,num_non_mbsfn_SubframeConfig,ones);
- UE_mac_inst[module_idP].common_num_sf_alloc++;
- UE_mac_inst[module_idP].common_num_sf_alloc = UE_mac_inst[module_idP].common_num_sf_alloc % (num_sf_alloc * commonSF_AllocPeriod / common_mbsfn_period-(1+ones)*(commonSF_AllocPeriod/4)); //TODO
- }
- else
- mtch_mcs = -1;
-
- mch_lcid = (uint8_t)l;
- break;
- }
- }
- }
-#endif
-
{
// Acount for sf_allocable in Common SF Allocation
int num_sf_alloc = 0;
@@ -1869,49 +1803,7 @@ int ue_query_mch(module_id_t module_idP, uint8_t CC_id, uint32_t frameP, uint32_
//}
}
-#ifdef OLD
- // Acount for sf_allocable in CSA
- int num_sf_alloc = 0;
- for (l = 0; l < 8; l++) {
- if (UE_mac_inst[module_idP].commonSF_Alloc_r9_mbsfn_SubframeConfig[l] == NULL)
- continue;
-
- if (UE_mac_inst[module_idP].commonSF_Alloc_r9_mbsfn_SubframeConfig[l]->subframeAllocation.present != LTE_MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame)
- continue;
-
- uint32_t common_mbsfn_SubframeConfig = UE_mac_inst[module_idP].commonSF_Alloc_r9_mbsfn_SubframeConfig[l]->subframeAllocation.choice.oneFrame.buf[0];
-
- for (j = 0; j < 6; j++)
- num_sf_alloc += ((common_mbsfn_SubframeConfig & (0x80 >> j)) == (0x80 >> j));
- //num_sf_alloc=1;
- }
-
- for (l = 0; l < 28; l++) {
- if (UE_mac_inst[module_idP].pmch_stop_mtch[l] >= 1/*num_sf_alloc*/) {
- if (UE_mac_inst[module_idP].pmch_stop_mtch[l] != 2047) {
- if (UE_mac_inst[module_idP].pmch_Config[UE_mac_inst[module_idP].msi_pmch] != NULL){
- mtch_mcs = UE_mac_inst[module_idP].pmch_Config[UE_mac_inst[module_idP].msi_pmch]->dataMCS_r9;
- long common_mbsfn_period = 1 << UE_mac_inst[module_idP].commonSF_Alloc_r9_mbsfn_SubframeConfig[0]->radioframeAllocationPeriod;
- long commonSF_AllocPeriod = 4 << UE_mac_inst[module_idP].commonSF_AllocPeriod_r9;
- if(UE_mac_inst[module_idP].common_num_sf_alloc >= UE_mac_inst[module_idP].pmch_stop_mtch[l]){
- //LOG_E(MAC,"Attemp to UE_mac_inst[module_idP].common_num_sf_alloc %d\n",UE_mac_inst[module_idP].common_num_sf_alloc);
-
- mtch_mcs = -1;
- }/*else
- LOG_W(MAC,"Attemp to UE_mac_inst[module_idP].common_num_sf_alloc %d\n",UE_mac_inst[module_idP].common_num_sf_alloc);*/
- UE_mac_inst[module_idP].common_num_sf_alloc++;
- UE_mac_inst[module_idP].common_num_sf_alloc = UE_mac_inst[module_idP].common_num_sf_alloc % (num_sf_alloc * commonSF_AllocPeriod / common_mbsfn_period);
- }
- else
- mtch_mcs = -1;
-
- mch_lcid = (uint8_t)l;
- break;
- }
- }
- }
-#endif
{
// Acount for sf_allocable in Common SF Allocation
diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c
index cef13b87fb..4408a96eef 100644
--- a/openair2/LAYER2/NR_MAC_UE/config_ue.c
+++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c
@@ -573,7 +573,7 @@ void config_control_ue(NR_UE_MAC_INST_t *mac){
struct NR_PDCCH_Config__searchSpacesToAddModList *searchSpacesToAddModList = pdcch_Config->choice.setup->searchSpacesToAddModList;
AssertFatal(searchSpacesToAddModList != NULL, "searchSpacesToAddModList is null\n");
AssertFatal(searchSpacesToAddModList->list.count > 0, "list of UE specifically configured Search Spaces is empty\n");
- AssertFatal(searchSpacesToAddModList->list.count < FAPI_NR_MAX_SS_PER_CORESET, "too many searchpaces per coreset %d\n", searchSpacesToAddModList->list.count);
+ AssertFatal(searchSpacesToAddModList->list.count < FAPI_NR_MAX_SS, "too many searchpaces per coreset %d\n", searchSpacesToAddModList->list.count);
struct NR_UplinkConfig__uplinkBWP_ToAddModList *uplinkBWP_ToAddModList = scd->uplinkConfig->uplinkBWP_ToAddModList;
if (ul_bwp_id > 0) {
@@ -597,7 +597,7 @@ void config_control_ue(NR_UE_MAC_INST_t *mac){
AssertFatal(*ss->controlResourceSetId == mac->coreset[dl_bwp_id][coreset_id - 1]->controlResourceSetId, "ss->controlResourceSetId is unknown\n");
AssertFatal(ss->monitoringSymbolsWithinSlot != NULL, "NR_SearchSpace->monitoringSymbolsWithinSlot is null\n");
AssertFatal(ss->monitoringSymbolsWithinSlot->buf != NULL, "NR_SearchSpace->monitoringSymbolsWithinSlot->buf is null\n");
- mac->SSpace[dl_bwp_id][0][ss_id] = ss;
+ mac->SSpace[dl_bwp_id][ss_id] = ss;
}
// Check available CSSs in the commonSearchSpaceList (list of additional common search spaces)
@@ -610,7 +610,7 @@ void config_control_ue(NR_UE_MAC_INST_t *mac){
AssertFatal(css->searchSpaceType != NULL, "css->searchSpaceType is null\n");
AssertFatal(css->monitoringSymbolsWithinSlot != NULL, "css->monitoringSymbolsWithinSlot is null\n");
AssertFatal(css->monitoringSymbolsWithinSlot->buf != NULL, "css->monitoringSymbolsWithinSlot->buf is null\n");
- mac->SSpace[dl_bwp_id][0][ss_id] = css;
+ mac->SSpace[dl_bwp_id][ss_id] = css;
ss_id++;
}
}
diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h
index d076f2c59e..edfd37c3a0 100644
--- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h
+++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h
@@ -367,7 +367,7 @@ typedef struct {
NR_BWP_Downlink_t *DLbwp[MAX_NUM_BWP];
NR_BWP_Uplink_t *ULbwp[MAX_NUM_BWP];
NR_ControlResourceSet_t *coreset[MAX_NUM_BWP][FAPI_NR_MAX_CORESET_PER_BWP];
- NR_SearchSpace_t *SSpace[MAX_NUM_BWP][FAPI_NR_MAX_CORESET_PER_BWP][FAPI_NR_MAX_SS_PER_CORESET];
+ NR_SearchSpace_t *SSpace[MAX_NUM_BWP][FAPI_NR_MAX_SS];
lte_frame_type_t frame_type;
diff --git a/openair2/LAYER2/NR_MAC_UE/nr_l1_helpers.h b/openair2/LAYER2/NR_MAC_UE/nr_l1_helpers.h
deleted file mode 100755
index 8b3f00af43..0000000000
--- a/openair2/LAYER2/NR_MAC_UE/nr_l1_helpers.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The OpenAirInterface Software Alliance licenses this file to You under
- * the OAI Public License, Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.openairinterface.org/?page_id=698
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *-------------------------------------------------------------------------------
- * For more information about the OpenAirInterface (OAI) Software Alliance:
- * contact@openairinterface.org
- */
-
-/** \brief Function to compute configured maximum output power according to clause 6.2.4 of 3GPP TS 38.101-1 version 16.5.0 Release 16
- @param Mod_id Module id of UE
-*/
-long nr_get_Pcmax(module_id_t mod_id);
-/** @}*/
diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c
index 2abcb60e91..ad82161fb9 100644
--- a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c
+++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c
@@ -76,7 +76,6 @@ void fill_dci_search_candidates(NR_SearchSpace_t *ss,fapi_nr_dl_config_dci_dl_pd
void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15, fapi_nr_dl_config_request_t *dl_config, int rnti_type, int ss_id){
uint16_t monitoringSymbolsWithinSlot = 0;
- uint8_t coreset_id = 1;
int sps = 0;
AssertFatal(mac->scc == NULL || mac->scc_SIB == NULL, "both scc and scc_SIB cannot be non-null\n");
@@ -97,11 +96,23 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t
NR_SearchSpace_t *ss;
NR_ControlResourceSet_t *coreset;
if(ss_id>=0) {
- ss = mac->SSpace[bwp_id][coreset_id - 1][ss_id];
+ if (rnti_type == NR_RNTI_TC || rnti_type == NR_RNTI_RA) {
+ ss = mac->ra.ss;
+ AssertFatal(mac->ra.ss->searchSpaceId == ss_id,"Search Space id %d does not correspond to the one in ra->ss %ld for RA procedures\n",
+ ss_id,mac->ra.ss->searchSpaceId);
+ }
+ else
+ ss = mac->SSpace[bwp_id][ss_id];
+ }
+ else
+ ss = mac->search_space_zero;
+
+ uint8_t coreset_id = *ss->controlResourceSetId;
+
+ if(coreset_id>0) {
coreset = mac->coreset[bwp_id][coreset_id - 1];
rel15->coreset.CoreSetType = NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG;
} else {
- ss = mac->search_space_zero;
coreset = mac->coreset0;
if(rnti_type == NR_RNTI_SI) {
rel15->coreset.CoreSetType = NFAPI_NR_CSET_CONFIG_MIB_SIB1;
@@ -255,7 +266,7 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
RA_config_t *ra = &mac->ra;
int ss_id;
- uint8_t bwp_id = (mac->cg) ? mac->DL_BWP_Id : 0, coreset_id = (mac->cg) ? 1 : 0;
+ uint8_t bwp_id = (mac->cg) ? mac->DL_BWP_Id : 0;
//NR_ServingCellConfig_t *scd = mac->scg->spCellConfig->spCellConfigDedicated;
NR_BWP_DownlinkDedicated_t *bwpd = (bwp_id>0) ? mac->DLbwp[bwp_id-1]->bwp_Dedicated : mac->cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP;
NR_BWP_DownlinkCommon_t *bwp_Common = (bwp_id>0) ? mac->DLbwp[bwp_id-1]->bwp_Common : &mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP;
@@ -264,9 +275,9 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
// loop over all available SS for CORESET ID 1
if (bwpd) {
- for (ss_id = 0; ss_id < FAPI_NR_MAX_SS_PER_CORESET && mac->SSpace[bwp_id][coreset_id - 1][ss_id] != NULL; ss_id++){
+ for (ss_id = 0; ss_id < FAPI_NR_MAX_SS && mac->SSpace[bwp_id][ss_id] != NULL; ss_id++){
LOG_D(NR_MAC, "[DCI_CONFIG] ss_id %d\n",ss_id);
- NR_SearchSpace_t *ss = mac->SSpace[bwp_id][coreset_id - 1][ss_id];
+ NR_SearchSpace_t *ss = mac->SSpace[bwp_id][ss_id];
fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15 = &dl_config->dl_config_list[dl_config->number_pdus].dci_config_pdu.dci_config_rel15;
NR_SetupRelease_PDCCH_ConfigCommon_t *pdcch_ConfigCommon = bwp_Common->pdcch_ConfigCommon;
struct NR_PhysicalCellGroupConfig *phy_cgc = mac->cg->physicalCellGroupConfig;
diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
index f813efad92..cfa8b88f32 100644
--- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
+++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
@@ -919,7 +919,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
rel15->dci_format_options[0] = NR_DL_DCI_FORMAT_1_0;
if (mac->ra.ra_state == WAIT_CONTENTION_RESOLUTION)
rel15->dci_format_options[1] = NR_UL_DCI_FORMAT_0_0; // msg3 retransmission
- config_dci_pdu(mac, rel15, dl_config, mac->ra.ra_state == WAIT_RAR ? NR_RNTI_RA : NR_RNTI_TC , -1);
+ config_dci_pdu(mac, rel15, dl_config, mac->ra.ra_state == WAIT_RAR ? NR_RNTI_RA : NR_RNTI_TC , mac->ra.ss->searchSpaceId);
fill_dci_search_candidates(mac->ra.ss, rel15);
dl_config->number_pdus = 1;
LOG_D(MAC,"mac->cg %p: Calling fill_scheduled_response rnti %x, type0_pdcch, num_pdus %d\n",mac->cg,rel15->rnti,dl_config->number_pdus);
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c
index b62f8e0282..ebe4758e27 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c
@@ -393,7 +393,9 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
nr_schedule_ulsch(module_idP, frame, slot);
// This schedules the DCI for Downlink and PDSCH
- nr_schedule_ue_spec(module_idP, frame, slot);
+ start_meas(&gNB->schedule_dlsch);
+ nr_schedule_ue_spec(module_idP, frame, slot);
+ stop_meas(&gNB->schedule_dlsch);
nr_schedule_pucch(module_idP, frame, slot);
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c
index f35de9e28b..df25b085e6 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c
@@ -60,22 +60,21 @@ uint16_t get_ssboffset_pointa(NR_ServingCellConfigCommon_t *scc,const long band)
int ratio;
switch (*scc->ssbSubcarrierSpacing) {
case NR_SubcarrierSpacing_kHz15:
- AssertFatal(band <= 79,
+ AssertFatal(band <= 95,
"Band %ld is not possible for SSB with 15 kHz SCS\n",
band);
- if (band < 77) // below 3GHz
- ratio = 3; // NRARFCN step is 5 kHz
- else
- ratio = 1; // NRARFCN step is 15 kHz
+ // no band available above 3GHz using 15kHz
+ ratio = 3; // NRARFCN step is 5 kHz
break;
case NR_SubcarrierSpacing_kHz30:
- AssertFatal(band <= 79,
- "Band %ld is not possible for SSB with 15 kHz SCS\n",
+ AssertFatal(band <= 96,
+ "Band %ld is not possible for SSB with 30 kHz SCS\n",
band);
- if (band < 77) // below 3GHz
- ratio = 6; // NRARFCN step is 5 kHz
+ if (band == 46 || band == 48 || band == 77 ||
+ band == 78 || band == 79 || band == 96) // above 3GHz
+ ratio = 2; // NRARFCN step is 15 kHz
else
- ratio = 2; // NRARFCN step is 15 kHz
+ ratio = 6; // NRARFCN step is 5 kHz
break;
case NR_SubcarrierSpacing_kHz120:
AssertFatal(band >= 257,
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
index c40a665d4a..3b411de674 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
@@ -382,6 +382,73 @@ int nr_write_ce_dlsch_pdu(module_id_t module_idP,
return offset;
}
+#define BLER_UPDATE_FRAME 10
+#define BLER_FILTER 0.9f
+int get_mcs_from_bler(module_id_t mod_id, int CC_id, frame_t frame, sub_frame_t slot, int UE_id)
+{
+ gNB_MAC_INST *nrmac = RC.nrmac[mod_id];
+ const NR_ServingCellConfigCommon_t *scc = nrmac->common_channels[CC_id].ServingCellConfigCommon;
+ const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
+
+ NR_DL_bler_stats_t *bler_stats = &nrmac->UE_info.UE_sched_ctrl[UE_id].dl_bler_stats;
+ /* first call: everything is zero. Initialize to sensible default */
+ if (bler_stats->last_frame_slot == 0 && bler_stats->mcs == 0) {
+ bler_stats->last_frame_slot = frame * n + slot;
+ bler_stats->mcs = 9;
+ bler_stats->bler = (nrmac->dl_bler_target_lower + nrmac->dl_bler_target_upper) / 2;
+ bler_stats->rd2_bler = nrmac->dl_rd2_bler_threshold;
+ }
+ const int now = frame * n + slot;
+ int diff = now - bler_stats->last_frame_slot;
+ if (diff < 0) // wrap around
+ diff += 1024 * n;
+
+ const uint8_t old_mcs = bler_stats->mcs;
+ const NR_mac_stats_t *stats = &nrmac->UE_info.mac_stats[UE_id];
+ const int dret3x = stats->dlsch_rounds[3] - bler_stats->dlsch_rounds[3];
+ if (0/*dret3x > 0*/) {
+ /* if there is a third retransmission, decrease MCS for stabilization and
+ * restart averaging window to stabilize transmission */
+ bler_stats->last_frame_slot = now;
+ bler_stats->mcs = max(9, bler_stats->mcs - 1);
+ memcpy(bler_stats->dlsch_rounds, stats->dlsch_rounds, sizeof(stats->dlsch_rounds));
+ LOG_D(MAC, "%4d.%2d: %d retx in 3rd round, setting MCS to %d and restarting window\n", frame, slot, dret3x, bler_stats->mcs);
+ return bler_stats->mcs;
+ }
+ if (diff < BLER_UPDATE_FRAME * n)
+ return old_mcs; // no update
+
+ // last update is longer than x frames ago
+ const int dtx = stats->dlsch_rounds[0] - bler_stats->dlsch_rounds[0];
+ const int dretx = stats->dlsch_rounds[1] - bler_stats->dlsch_rounds[1];
+ const int dretx2 = stats->dlsch_rounds[2] - bler_stats->dlsch_rounds[2];
+ const float bler_window = dtx > 0 ? (float) dretx / dtx : bler_stats->bler;
+ const float rd2_bler_wnd = dtx > 0 ? (float) dretx2 / dtx : bler_stats->rd2_bler;
+ bler_stats->bler = BLER_FILTER * bler_stats->bler + (1 - BLER_FILTER) * bler_window;
+ bler_stats->rd2_bler = BLER_FILTER / 4 * bler_stats->rd2_bler + (1 - BLER_FILTER / 4) * rd2_bler_wnd;
+
+ int new_mcs = old_mcs;
+ /* first ensure that number of 2nd retx is below threshold. If this is the
+ * case, use 1st retx to adjust faster */
+ /*
+ if (bler_stats->rd2_bler > nrmac->dl_rd2_bler_threshold && old_mcs > 6) {
+ new_mcs -= 2;
+ } else if (bler_stats->rd2_bler < nrmac->dl_rd2_bler_threshold) {*/
+ if (bler_stats->bler < nrmac->dl_bler_target_lower && old_mcs < nrmac->dl_max_mcs && dtx > 9)
+ new_mcs += 1;
+ else if (bler_stats->bler > nrmac->dl_bler_target_upper && old_mcs > 6)
+ new_mcs -= 1;
+ // else we are within threshold boundaries
+ /*}*/
+
+ bler_stats->last_frame_slot = now;
+ bler_stats->mcs = new_mcs;
+ memcpy(bler_stats->dlsch_rounds, stats->dlsch_rounds, sizeof(stats->dlsch_rounds));
+ LOG_D(MAC, "%4d.%2d MCS %d -> %d (dtx %d, dretx %d, BLER wnd %.3f avg %.6f, dretx2 %d, RD2 BLER wnd %.3f avg %.6f)\n",
+ frame, slot, old_mcs, new_mcs, dtx, dretx, bler_window, bler_stats->bler, dretx2, rd2_bler_wnd, bler_stats->rd2_bler);
+ return new_mcs;
+}
+
void nr_store_dlsch_buffer(module_id_t module_id,
frame_t frame,
sub_frame_t slot) {
@@ -446,7 +513,7 @@ void nr_store_dlsch_buffer(module_id_t module_id,
if (sched_ctrl->num_total_bytes == 0
&& !sched_ctrl->ta_apply) /* If TA should be applied, give at least one RB */
- return;
+ continue;
LOG_D(NR_MAC,
"[%s][%d.%d], %s%d->DLSCH, RLC status %d bytes TA %d\n",
@@ -630,8 +697,8 @@ void pf_dl(module_id_t module_id,
continue;
/* Calculate coeff */
- sched_pdsch->mcs = 9;
ps->nrOfLayers = 1;
+ sched_pdsch->mcs = get_mcs_from_bler(module_id, /* CC_id = */ 0, frame, slot, UE_id);
uint32_t tbs = pf_tbs[ps->mcsTableIdx][sched_pdsch->mcs];
coeff_ue[UE_id] = (float) tbs / thr_ue[UE_id];
LOG_D(NR_MAC,"b %d, thr_ue[%d] %f, tbs %d, coeff_ue[%d] %f\n",
@@ -1155,6 +1222,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
// const int lcid = DL_SCH_LCID_DTCH;
const int lcid = sched_ctrl->lcid_to_schedule;
int dlsch_total_bytes = 0;
+ start_meas(&gNB_mac->rlc_data_req);
if (sched_ctrl->num_total_bytes > 0) {
tbs_size_t len = 0;
while (size > 3) {
@@ -1168,6 +1236,8 @@ void nr_schedule_ue_spec(module_id_t module_id,
/* limit requested number of bytes to what preprocessor specified, or
* such that TBS is full */
const rlc_buffer_occupancy_t ndata = min(sched_ctrl->rlc_status[lcid].bytes_in_buffer, size);
+
+
len = mac_rlc_data_req(module_id,
rnti,
module_id,
@@ -1180,6 +1250,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
0,
0);
+
LOG_D(NR_MAC,
"%4d.%2d RNTI %04x: %d bytes from %s %d (ndata %d, remaining size %d)\n",
frame,
@@ -1228,6 +1299,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
buf += size;
dlsch_total_bytes += size;
}
+ stop_meas(&gNB_mac->rlc_data_req);
// Add padding header and zero rest out if there is space left
if (size > 0) {
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
index 7387bfe698..40cf265e57 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
@@ -1946,7 +1946,7 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG
add_nr_list(&UE_info->list, UE_id);
memset(&UE_info->mac_stats[UE_id], 0, sizeof(NR_mac_stats_t));
set_Y(UE_info->Y[UE_id], rntiP);
- if (CellGroup && CellGroup->spCellConfig && CellGroup->spCellConfig && CellGroup->spCellConfig->spCellConfigDedicated)
+ if (CellGroup && CellGroup->spCellConfig && CellGroup->spCellConfig->spCellConfigDedicated)
compute_csi_bitlen (CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup, UE_info, UE_id, mod_idP);
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
memset(sched_ctrl, 0, sizeof(*sched_ctrl));
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
index 6a4ccc0d65..83427641ef 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
@@ -1109,7 +1109,7 @@ void handle_nr_uci_pucch_0_1(module_id_t mod_id,
// tpc (power control) only if we received AckNack or positive SR. For a
// negative SR, the UE won't have sent anything, and the SNR is not valid
- if (((uci_01->pduBitmap >> 1) & 0x1) || sched_ctrl->SR) {
+ if (((uci_01->pduBitmap >> 1) & 0x1) ) {
if ((uci_01->harq) && (uci_01->harq->harq_confidence_level==0)) sched_ctrl->tpc1 = nr_get_tpc(RC.nrmac[mod_id]->pucch_target_snrx10, uci_01->ul_cqi, 30);
else sched_ctrl->tpc1 = 3;
sched_ctrl->pucch_snrx10 = uci_01->ul_cqi * 5 - 640;
@@ -1334,7 +1334,7 @@ int nr_acknack_scheduling(int mod_id,
pucch->ul_slot = (s + 1) % n_slots_frame;
}
if (ind_found==-1) {
- LOG_W(NR_MAC,
+ LOG_D(NR_MAC,
"%4d.%2d could not find pdsch_to_harq_feedback for UE %d: earliest "
"ack slot %d\n",
frame,
@@ -1404,7 +1404,6 @@ int nr_acknack_scheduling(int mod_id,
/* verify that at that slot and symbol, resources are free. We only do this
* for initialCyclicShift 0 (we assume it always has that one), so other
* initialCyclicShifts can overlap with ICS 0!*/
-
if (pucch_Config) {
const NR_PUCCH_Resource_t *resource = pucch_Config->resourceToAddModList->list.array[pucch->resource_indicator];
DevAssert(resource->format.present == NR_PUCCH_Resource__format_PR_format0);
@@ -1453,11 +1452,8 @@ void nr_sr_reporting(int Mod_idP, frame_t SFN, sub_frame_t slot)
RC.nrmac[Mod_idP]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup) {
pucch_Config = RC.nrmac[Mod_idP]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup;
}
-
else continue;
- if (!pucch_Config->schedulingRequestResourceToAddModList)
- continue;
-
+ if (!pucch_Config->schedulingRequestResourceToAddModList) continue;
AssertFatal(pucch_Config->schedulingRequestResourceToAddModList->list.count>0,"NO SR configuration available");
for (int SR_resource_id =0; SR_resource_id < pucch_Config->schedulingRequestResourceToAddModList->list.count;SR_resource_id++) {
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
index 9a6fa32b5f..2d117a3131 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
@@ -869,7 +869,7 @@ bool nr_UE_is_to_be_scheduled(module_id_t mod_id, int CC_id, int UE_id, frame_t
* (2) there is a scheduling request
* (3) or we did not schedule it in more than 10 frames */
const bool has_data = sched_ctrl->estimated_ul_buffer > sched_ctrl->sched_ul_bytes;
- const bool high_inactivity = diff >= nrmac->ulsch_max_frame_inactivity * n;
+ const bool high_inactivity = diff >= (nrmac->ulsch_max_frame_inactivity>0 ? (nrmac->ulsch_max_frame_inactivity * n) : (n/2));
LOG_D(NR_MAC,
"%4d.%2d UL inactivity %d slots has_data %d SR %d\n",
frame,
diff --git a/openair2/LAYER2/NR_MAC_gNB/main.c b/openair2/LAYER2/NR_MAC_gNB/main.c
index 6e13e4bcc6..0ea94523d5 100644
--- a/openair2/LAYER2/NR_MAC_gNB/main.c
+++ b/openair2/LAYER2/NR_MAC_gNB/main.c
@@ -64,7 +64,7 @@ void *nrmac_stats_thread(void *arg) {
fseek(fd,0,SEEK_SET);
}
fclose(fd);
- return (void *)0;
+ return NULL;
}
void clear_mac_stats(gNB_MAC_INST *gNB) {
@@ -81,22 +81,28 @@ void dump_mac_stats(gNB_MAC_INST *gNB, char *output, int strlen)
for (int UE_id = UE_info->list.head; UE_id >= 0; UE_id = UE_info->list.next[UE_id]) {
- stroff+=sprintf(output+stroff,"UE ID %d RNTI %04x (%d/%d) PH %d dB PCMAX %d dBm\n",
+ const NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
+ NR_mac_stats_t *stats = &UE_info->mac_stats[UE_id];
+ const int avg_rsrp = stats->num_rsrp_meas > 0 ? stats->cumul_rsrp / stats->num_rsrp_meas : 0;
+ stroff+=sprintf(output+stroff,"UE ID %d RNTI %04x (%d/%d) PH %d dB PCMAX %d dBm, average RSRP %d (%d meas)\n",
UE_id,
UE_info->rnti[UE_id],
num++,
UE_info->num_UEs,
- UE_info->UE_sched_ctrl[UE_id].ph,
- UE_info->UE_sched_ctrl[UE_id].pcmax);
+ sched_ctrl->ph,
+ sched_ctrl->pcmax,
+ avg_rsrp,
+ stats->num_rsrp_meas);
- NR_mac_stats_t *stats = &UE_info->mac_stats[UE_id];
- const int avg_rsrp = stats->num_rsrp_meas > 0 ? stats->cumul_rsrp / stats->num_rsrp_meas : 0;
- stroff+=sprintf(output+stroff,"UE %d: dlsch_rounds %d/%d/%d/%d, dlsch_errors %d, pucch0_DTX %d average RSRP %d (%d meas)\n",
+ stroff+=sprintf(output+stroff,"UE %d: dlsch_rounds %d/%d/%d/%d, dlsch_errors %d, pucch0_DTX %d, BLER %.5f MCS %d\n",
UE_id,
stats->dlsch_rounds[0], stats->dlsch_rounds[1],
- stats->dlsch_rounds[2], stats->dlsch_rounds[3], stats->dlsch_errors,
+ stats->dlsch_rounds[2], stats->dlsch_rounds[3],
+ stats->dlsch_errors,
stats->pucch0_DTX,
- avg_rsrp, stats->num_rsrp_meas);
+ sched_ctrl->dl_bler_stats.bler,
+ sched_ctrl->dl_bler_stats.mcs);
+
stats->num_rsrp_meas = 0;
stats->cumul_rsrp = 0 ;
stroff+=sprintf(output+stroff,"UE %d: dlsch_total_bytes %d\n", UE_id, stats->dlsch_total_bytes);
@@ -122,6 +128,8 @@ void dump_mac_stats(gNB_MAC_INST *gNB, char *output, int strlen)
}
}
print_meas(&gNB->eNB_scheduler, "DL & UL scheduling timing stats", NULL, NULL);
+ print_meas(&gNB->schedule_dlsch,"dlsch scheduler",NULL,NULL);
+ print_meas(&gNB->rlc_data_req, "rlc_data_req",NULL,NULL);
}
diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
index 699b92a831..007573c4c3 100644
--- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
+++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
@@ -422,6 +422,13 @@ typedef struct NR_UE_harq {
//! fixme : need to enhace for the multiple TB CQI report
+typedef struct NR_DL_bler_stats {
+ frame_t last_frame_slot;
+ float bler;
+ float rd2_bler;
+ uint8_t mcs;
+ int dlsch_rounds[8];
+} NR_DL_bler_stats_t;
//
/*! As per spec 38.214 section 5.2.1.4.2
@@ -565,6 +572,9 @@ typedef struct {
/// per-LC status data
mac_rlc_status_resp_t rlc_status[MAX_NUM_LCID];
+ /// Estimation of HARQ from BLER
+ NR_DL_bler_stats_t dl_bler_stats;
+
int lcid_mask;
int lcid_to_schedule;
uint16_t ta_frame;
@@ -726,6 +736,8 @@ typedef struct gNB_MAC_INST_s {
time_stats_t schedule_dlsch_preprocessor;
/// processing time of eNB DLSCH scheduler
time_stats_t schedule_dlsch; // include rlc_data_req + MAC header + preprocessor
+ /// processing time of rlc_data_req
+ time_stats_t rlc_data_req;
/// processing time of eNB MCH scheduler
time_stats_t schedule_mch;
/// processing time of eNB ULSCH reception
@@ -763,6 +775,10 @@ typedef struct gNB_MAC_INST_s {
NR_Type0_PDCCH_CSS_config_t type0_PDCCH_CSS_config[64];
bool first_MIB;
+ double dl_bler_target_upper;
+ double dl_bler_target_lower;
+ double dl_rd2_bler_threshold;
+ uint8_t dl_max_mcs;
} gNB_MAC_INST;
#endif /*__LAYER2_NR_MAC_GNB_H__ */
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.h b/openair2/LAYER2/PDCP_v10.1.0/pdcp.h
index 3ffedf4b7c..7f4640ede1 100644
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.h
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.h
@@ -69,9 +69,7 @@ typedef struct {
} pdcp_params_t;
-#ifndef PDCP_USE_NETLINK
- #define PDCP_USE_NETLINK ( get_pdcp_optmask() & PDCP_USE_NETLINK_BIT)
-#endif
+#define PDCP_USE_NETLINK ( get_pdcp_optmask() & PDCP_USE_NETLINK_BIT)
#define LINK_ENB_PDCP_TO_IP_DRIVER ( get_pdcp_optmask() & LINK_ENB_PDCP_TO_IP_DRIVER_BIT)
#define LINK_ENB_PDCP_TO_GTPV1U ( get_pdcp_optmask() & LINK_ENB_PDCP_TO_GTPV1U_BIT)
#define UE_NAS_USE_TUN ( get_pdcp_optmask() & UE_NAS_USE_TUN_BIT)
@@ -513,7 +511,6 @@ typedef struct {
#define REORDERING_WINDOW_SN_7BIT 64
#define REORDERING_WINDOW_SN_12BIT 2048
-extern signed int pdcp_2_nas_irq;
extern pdcp_stats_t UE_pdcp_stats[MAX_MOBILES_PER_ENB];
extern pdcp_stats_t eNB_pdcp_stats[NUMBER_OF_eNB_MAX];
diff --git a/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm_init.h b/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm_init.h
index c6ab681819..57e2116a72 100644
--- a/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm_init.h
+++ b/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm_init.h
@@ -37,7 +37,6 @@
//-----------------------------------------------------------------------------
# include "rlc_tm_entity.h"
# include "mem_block.h"
-//# include "rrm_config_structs.h"
# include "rlc_tm_structs.h"
//# include "rlc.h"
# include "platform_types.h"
diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.c
index 940740943e..05c3423f76 100644
--- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.c
+++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.c
@@ -27,7 +27,6 @@
#include "rlc_um.h"
#include "rlc_primitives.h"
#include "list.h"
-#include "rrm_config_structs.h"
#include "LAYER2/MAC/mac_extern.h"
#include "common/utils/LOG/log.h"
diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_very_simple_test.h b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_very_simple_test.h
index 598518f1c8..b762a4fdb4 100644
--- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_very_simple_test.h
+++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_very_simple_test.h
@@ -33,7 +33,6 @@
//-----------------------------------------------------------------------------
# include "rlc_um_entity.h"
# include "mem_block.h"
-# include "rrm_config_structs.h"
# include "rlc_um_structs.h"
# include "rlc_um_constants.h"
//-----------------------------------------------------------------------------
diff --git a/openair2/LAYER2/openair2_proc.c b/openair2/LAYER2/openair2_proc.c
index 3d2c06f489..7ffdc75195 100644
--- a/openair2/LAYER2/openair2_proc.c
+++ b/openair2/LAYER2/openair2_proc.c
@@ -362,264 +362,5 @@ int dump_eNB_l2_stats(char *buffer, int length) {
return len + 1 /* SR: for trailing \0 */;
}
-#ifdef PROC
-int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length) {
- int len = 0,fg,Overhead, Sign;
- unsigned int i,j,k,kk;
- unsigned int Mod_id = 0,CH_index;
- unsigned int tx_pdcp_sdu;
- unsigned int tx_pdcp_sdu_discarded;
- unsigned int tx_retransmit_pdu_unblock;
- unsigned int tx_retransmit_pdu_by_status;
- unsigned int tx_retransmit_pdu;
- unsigned int tx_data_pdu;
- unsigned int tx_control_pdu;
- unsigned int rx_sdu;
- unsigned int rx_error_pdu;
- unsigned int rx_data_pdu;
- unsigned int rx_data_pdu_out_of_window;
- unsigned int rx_control_pdu;
- // if (mac_xface->is_cluster_head == 0) {
- for (k=0; kIs_cluster_head[k] == 0) {
-#ifndef PHY_EMUL_ONE_MACHINE
- Mod_id=k-NB_CH_INST;
- len+=sprintf(&buffer[len],"UE TTI: %d\n",Mac_rlc_xface->frame);
-
- for (CH_index = 0; CH_index>5,
- UE_mac_inst[Mod_id].Dcch_lchan[CH_index].Lchan_info.NB_RX,
- UE_mac_inst[Mod_id].Dcch_lchan[CH_index].Lchan_info.NB_RX_ERRORS);
-
- for(i=1; i>5,
- Pdcp_stats_rx[k][CH_index][i],
- Pdcp_stats_rx_rate[k][CH_index][i],
- (10*Pdcp_stats_rx_rate[k][CH_index][i])>>5,
- Sign*(10*Overhead)>>5);
- int status = rlc_stat_req (k,
- UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.Lchan_id.Index,
- &tx_pdcp_sdu,
- &tx_pdcp_sdu_discarded,
- &tx_retransmit_pdu_unblock,
- &tx_retransmit_pdu_by_status,
- &tx_retransmit_pdu,
- &tx_data_pdu,
- &tx_control_pdu,
- &rx_sdu,
- &rx_error_pdu,
- &rx_data_pdu,
- &rx_data_pdu_out_of_window,
- &rx_control_pdu) ;
-
- if (status == RLC_OP_STATUS_OK) {
- len+=sprintf(&buffer[len],"RLC LCHAN %d, NB_SDU_TO_TX = %u\tNB_SDU_DISC %u\tNB_RX_SDU %u\n",
- UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.Lchan_id.Index,
- tx_pdcp_sdu,
- tx_pdcp_sdu_discarded,
- rx_sdu);
- len+=sprintf(&buffer[len],"RLC LCHAN %d, NB_TB_TX_DATA = %u\tNB_TB_TX_CONTROL %u\tNB_TX_TB_RETRANS %u",
- UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.Lchan_id.Index,
- tx_data_pdu,
- tx_control_pdu,
- tx_retransmit_pdu);
- len+=sprintf(&buffer[len],"\tRLC LCHAN %d, NB_TX_TB_RETRANS_BY_STATUS = %u\tNB_TX_TB_RETRANS_PADD %u\n",
- UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.Lchan_id.Index,
- tx_retransmit_pdu_by_status,
- tx_retransmit_pdu_unblock);
- len+=sprintf(&buffer[len],"RLC LCHAN %d, NB_RX_DATA = %u\tNB_RX_TB_OUT_WIN %u\tNB_RX_TB_CORRUPT %u\n",
- UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.Lchan_id.Index,
- rx_data_pdu,
- rx_data_pdu_out_of_window,
- rx_error_pdu);
- }
-
- len+=sprintf(&buffer[len],"[MAC]: LCHAN %d, NB_TX_MAC = %d (%d bits/TTI, %d kbits/s), NB_RX_MAC = %d (%d errors)\n",
- UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.Lchan_id.Index,
- UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.NB_TX,
- UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.output_rate,
- (10*UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.output_rate)>>5,
- UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.NB_RX,
- UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.NB_RX_ERRORS);
- len+=sprintf(&buffer[len]," TX per TB: ");
-
- for(kk=0; kkIs_cluster_head[k] ==1) {
- Mod_id=k;
- len+=sprintf(&buffer[len],
- "------------------------------------------------------------------- TTI: %d------------------------------------------------------------------\n",
- Mac_rlc_xface->frame);
-
- for(i=1; i<=NB_CNX_CH; i++) {
- if (CH_mac_inst[Mod_id].Dcch_lchan[i].Active==1) {
- len+=sprintf(&buffer[len],"\nMR index %u: DL SINR (feedback) %d dB, CQI: %s\n\n",
- i,//CH_rrc_inst[Mod_id].Info.UE_info[i].L2_id[0],
- CH_mac_inst[Mod_id].Def_meas[i].Wideband_sinr,
- print_cqi(CH_mac_inst[Mod_id].Def_meas[i].cqi));
- len+=sprintf(&buffer[len],
- "[MAC] LCHAN %d (DCCH), NB_TX_MAC= %d (%d bits/TTI, %d kbits/s), NB_RX_MAC= %d (errors %d, sacch errors %d, sach errors %d, sach_missing %d)\n\n",
- CH_mac_inst[Mod_id].Dcch_lchan[i].Lchan_info.Lchan_id.Index,
- CH_mac_inst[Mod_id].Dcch_lchan[i].Lchan_info.NB_TX,
- CH_mac_inst[Mod_id].Dcch_lchan[i].Lchan_info.output_rate,
- (10*CH_mac_inst[Mod_id].Dcch_lchan[i].Lchan_info.output_rate)>>5,
- CH_mac_inst[Mod_id].Dcch_lchan[i].Lchan_info.NB_RX,
- CH_mac_inst[Mod_id].Dcch_lchan[i].Lchan_info.NB_RX_ERRORS,
- CH_mac_inst[Mod_id].Dcch_lchan[i].Lchan_info.NB_RX_SACCH_ERRORS,
- CH_mac_inst[Mod_id].Dcch_lchan[i].Lchan_info.NB_RX_SACH_ERRORS,
- CH_mac_inst[Mod_id].Dcch_lchan[i].Lchan_info.NB_RX_SACH_MISSING);
-
- for(j=0; j>5,
- Pdcp_stats_rx[k][i][j],
- Pdcp_stats_rx_rate[k][i][j],
- (10*Pdcp_stats_rx_rate[k][i][j])>>5,
- Sign*(10*Overhead)>>5);
- int status = rlc_stat_req (k,
- CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.Lchan_id.Index,
- &tx_pdcp_sdu,
- &tx_pdcp_sdu_discarded,
- &tx_retransmit_pdu_unblock,
- &tx_retransmit_pdu_by_status,
- &tx_retransmit_pdu,
- &tx_data_pdu,
- &tx_control_pdu,
- &rx_sdu,
- &rx_error_pdu,
- &rx_data_pdu,
- &rx_data_pdu_out_of_window,
- &rx_control_pdu) ;
- /*
- if (status == RLC_OP_STATUS_OK) {
- len+=sprintf(&buffer[len],"\t[RLC] LCHAN %d, NB_SDU_TO_TX = %d\tNB_SDU_DISC %d\tNB_RX_SDU %d\n",
- CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.Lchan_id.Index,
- tx_pdcp_sdu,
- tx_pdcp_sdu_discarded,
- rx_sdu);
- len+=sprintf(&buffer[len],"\t[RLC] LCHAN %d, NB_TB_TX_DATA = %d\tNB_TB_TX_CONTROL %d\tNB_TX_TB_RETRANS %\n",
- CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.Lchan_id.Index,
- tx_data_pdu,
- tx_control_pdu,
- tx_retransmit_pdu);
- len+=sprintf(&buffer[len],"\t[RLC] LCHAN %d, NB_TX_TB_RETRANS_BY_STATUS = %d\tNB_TX_TB_RETRANS_PADD %d\n",
- CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.Lchan_id.Index,
- tx_retransmit_pdu_by_status,
- tx_retransmit_pdu_unblock);
- len+=sprintf(&buffer[len],"\t[RLC] LCHAN %d, NB_RX_DATA = %d\tNB_RX_TB_OUT_WIN %d\tNB_RX_TB_CORRUPT %d\n",
- CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.Lchan_id.Index,
- rx_data_pdu,
- rx_data_pdu_out_of_window,
- rx_error_pdu);
- }
- */
- len+=sprintf(&buffer[len],
- "[MAC]LCHAN %d (CNX %u,RAB %u), NB_TX_MAC= %d (%d bits/TTI, %d kbit/s), NB_RX_MAC= %d (errors %d, sacch_errors %d, sach_errors %d, sach_missing %d)\n",
- CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.Lchan_id.Index,
- i,j,
- CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.NB_TX,
- CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.output_rate,
- (10*CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.output_rate)>>5,
- CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.NB_RX,
- CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.NB_RX_ERRORS,
- CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.NB_RX_SACCH_ERRORS,
- CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.NB_RX_SACH_ERRORS,
- CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.NB_RX_SACH_MISSING);
- len+=sprintf(&buffer[len],"[MAC][SCHEDULER] TX Arrival Rate %d, TX Service Rate %d, RX Arrival rate %d, RX Service rate %d, NB_BW_REQ_RX %d\n\n",
- CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.Arrival_rate,
- CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.Tx_rate,
- CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.Req_rate,
- CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.Rx_rate,
- CH_mac_inst[Mod_id].Dtch_lchan[j][i].Lchan_info.NB_BW_REQ_RX);
- /*
- len+=sprintf(&buffer[len]," TX per TB: ");
- for(kk=0;kklen);
#endif
-#else
- bytes_wrote = rtf_put(NAS2PDCP_FIFO, &pdcph, NAS_PDCPH_SIZE);
-#ifdef NAS_DEBUG_SEND
- printk("[NAS] Wrote %d bytes (header for %d byte skb) to PDCP fifo\n",
- bytes_wrote,skb->len);
-#endif
-#endif //PDCP_USE_NETLINK
if (bytes_wrote != NAS_PDCPH_SIZE) {
printk("NAS_COMMON_QOS_SEND: problem while writing PDCP's header (bytes wrote = %d )\n",bytes_wrote);
printk("rb_id %ld, Wrote %d, Header Size %lu\n", pdcph.rb_id , bytes_wrote, NAS_PDCPH_SIZE);
-#ifndef PDCP_USE_NETLINK
- rtf_reset(NAS2PDCP_FIFO);
-#endif //PDCP_USE_NETLINK
return;
}
-#ifdef PDCP_USE_NETLINK
bytes_wrote += nas_netlink_send((char *)skb->data,skb->len);
-#else
- bytes_wrote += rtf_put(NAS2PDCP_FIFO, skb->data, skb->len);
-#endif //PDCP_USE_NETLINK
if (bytes_wrote != skb->len+NAS_PDCPH_SIZE) {
printk("NAS_COMMON_QOS_SEND: Inst %d, RB_ID %ld: problem while writing PDCP's data, bytes_wrote = %d, Data_len %d, PDCPH_SIZE %lu\n",
@@ -427,9 +410,6 @@ void nas_COMMON_QOS_send(struct sk_buff *skb, struct cx_entity *cx, struct class
bytes_wrote,
skb->len,
NAS_PDCPH_SIZE); // congestion
-#ifndef PDCP_USE_NETLINK
- rtf_reset(NAS2PDCP_FIFO);
-#endif //PDCP_USE_NETLINK
return;
}
@@ -449,69 +429,6 @@ void nas_COMMON_QOS_send(struct sk_buff *skb, struct cx_entity *cx, struct class
#endif
}
-#ifndef PDCP_USE_NETLINK
-//---------------------------------------------------------------------------
-void nas_COMMON_QOS_receive()
-{
- //---------------------------------------------------------------------------
- uint8_t sapi;
- struct pdcp_data_ind_header_s pdcph;
- unsigned char data_buffer[2048];
- struct classifier_entity *rclass;
- struct nas_priv *priv;
- int bytes_read;
-
- // Start debug information
-#ifdef NAS_DEBUG_RECEIVE
- printk("NAS_COMMON_QOS_RECEIVE - begin \n");
-#endif
-
- // End debug information
-
- bytes_read = rtf_get(PDCP2PDCP_USE_RT_FIFO,&pdcph, NAS_PDCPH_SIZE);
-
- while (bytes_read>0) {
- if (bytes_read != NAS_PDCPH_SIZE) {
- printk("NAS_COMMON_QOS_RECEIVE: problem while reading PDCP header\n");
- return;
- }
-
- priv=netdev_priv(nasdev[pdcph.inst]);
- rclass = nas_COMMON_search_class_for_rb(pdcph.rb_id,priv);
-
- bytes_read+= rtf_get(PDCP2PDCP_USE_RT_FIFO,
- data_buffer,
- pdcph.data_size);
-
-#ifdef NAS_DEBUG_RECEIVE
- printk("NAS_COMMON_QOS_RECEIVE - Got header for RB %d, Inst %d \n",
- pdcph.rb_id,
- pdcph.inst);
-#endif
-
- if (rclass) {
-#ifdef NAS_DEBUG_RECEIVE
- printk("[NAS][COMMON] Found corresponding connection in classifier for RAB\n");
-#endif //NAS_DEBUG_RECEIVE
-
- nas_COMMON_receive(pdcph.data_size,
- (void *)data_buffer,
- pdcph.inst,
- rclass,
- pdcph.rb_id);
- }
-
- bytes_read = rtf_get(PDCP2PDCP_USE_RT_FIFO, &pdcph, NAS_PDCPH_SIZE);
- }
-
-
-
-#ifdef NAS_DEBUG_RECEIVE
- printk("NAS_COMMON_QOS_RECEIVE - end \n");
-#endif
-}
-
-#else
void nas_COMMON_QOS_receive(struct nlmsghdr *nlh)
{
@@ -542,7 +459,6 @@ void nas_COMMON_QOS_receive(struct nlmsghdr *nlh)
}
}
-#endif //PDCP_USE_NETLINK
//---------------------------------------------------------------------------
struct cx_entity *nas_COMMON_search_cx(nasLocalConnectionRef_t lcr,struct nas_priv *priv)
diff --git a/openair2/NETWORK_DRIVER/MESH/device.c b/openair2/NETWORK_DRIVER/MESH/device.c
index 47c68466bd..f63408259c 100644
--- a/openair2/NETWORK_DRIVER/MESH/device.c
+++ b/openair2/NETWORK_DRIVER/MESH/device.c
@@ -53,10 +53,8 @@
struct net_device *nasdev[NB_INSTANCES_MAX];
-#ifdef PDCP_USE_NETLINK
extern void nas_netlink_release(void);
extern int nas_netlink_init(void);
-#endif
//int bytes_wrote;
//int bytes_read;
@@ -82,38 +80,6 @@ int find_inst(struct net_device *dev)
//---------------------------------------------------------------------------
-#ifndef PDCP_USE_NETLINK
-//void interrupt(void){
-void *nas_interrupt(void)
-{
- //---------------------------------------------------------------------------
- uint8_t cxi;
-
- // struct nas_priv *priv=netdev_priv(dev_id);
- // unsigned int flags;
-
- // priv->lock = SPIN_LOCK_UNLOCKED;
-
-#ifdef DEBUG_INTERRUPT
- printk("INTERRUPT - begin\n");
-#endif
- // spin_lock_irqsave(&priv->lock,flags);
- cxi=0;
- // mesh_GC_receive();
- // mesh_DC_receive(naspriv->cx+cxi);
-#ifndef PDCP_USE_NETLINK
- nas_COMMON_QOS_receive();
-#endif
- // spin_unlock_irqrestore(&priv->lock,flags);
-#ifdef DEBUG_INTERRUPT
- printk("INTERRUPT: end\n");
-#endif
- // return 0;
- return NULL;
-}
-#endif //NETLINK
-
-//---------------------------------------------------------------------------
// Called by ifconfig when the device is activated by ifconfig
int nas_open(struct net_device *dev)
{
@@ -121,15 +87,6 @@ int nas_open(struct net_device *dev)
printk("OPEN: begin\n");
// MOD_INC_USE_COUNT;
// Address has already been set at init
-#ifndef PDCP_USE_NETLINK
-
- if (pdcp_2_nas_irq==-EBUSY) {
- printk("OPEN: irq failure\n");
- return -EBUSY;
- }
-
-#endif //PDCP_USE_NETLINK
-
/*
netif_start_queue(dev);
//
@@ -449,16 +406,6 @@ int init_module (void)
printk("Starting NASMESH, number of IMEI paramters %d, IMEI %X%X\n",m_arg,nas_IMEI[0],nas_IMEI[1]);
-#ifndef PDCP_USE_NETLINK
-
- if (pdcp_2_nas_irq == -EBUSY || pdcp_2_nas_irq == -EINVAL) {
- printk("[NAS][INIT] No interrupt resource available\n");
- return -EBUSY;
- } else
- printk("[NAS][INIT]: Interrupt %d\n", pdcp_2_nas_irq);
-
-#endif //NETLINK
-
for (inst=0; instirq, NULL);
- // End IRQ linux
-
- }
-
-#else // NETLINK
-
-
-
-#endif //NETLINK
-
for (inst=0; instlength);
#endif
++cx->retry;
-#ifdef PDCP_USE_NETLINK
-#else
- // bytes_wrote = rtf_put(cx->sap[NAS_DC_INPUT_SAPI], p, p->length);
-#endif
cx->countimer=gpriv->timer_establishment;
if (bytes_wrote==p->length) {
@@ -353,11 +349,6 @@ int nas_mesh_DC_send_cx_release_request(struct cx_entity *cx,
p->length = NAS_TL_SIZE + sizeof(struct NASConnReleaseReq);
p->nasUEDCPrimitive.conn_release_req.localConnectionRef = cx->lcr;
p->nasUEDCPrimitive.conn_release_req.releaseCause = NAS_CX_RELEASE_UNDEF_CAUSE;
-#ifdef PDCP_USE_NETLINK
-
-#else
- // bytes_wrote = rtf_put(cx->sap[NAS_DC_INPUT_SAPI], p, p->length);
-#endif
if (bytes_wrote==p->length) {
cx->state=NAS_IDLE;
@@ -441,22 +432,12 @@ void nas_mesh_DC_send_sig_data_request(struct sk_buff *skb,
p->nasUEDCPrimitive.data_transfer_req.localConnectionRef = cx->lcr;
p->nasUEDCPrimitive.data_transfer_req.priority = 3; // TBD
p->nasUEDCPrimitive.data_transfer_req.nasDataLength = (skb->len)+1; //adds category character
-#ifdef PDCP_USE_NETLINK
-#else
- // bytes_wrote = rtf_put(cx->sap[NAS_DC_INPUT_SAPI], p, p->length);
-#endif
if (bytes_wrote!=p->length) {
printk("NAS_MESH_DC_SEND_SIG: Header sent failure in DC-FIFO\n");
return;
}
-#ifdef PDCP_USE_NETLINK
-#else
- // bytes_wrote += rtf_put(cx->sap[NAS_DC_INPUT_SAPI], &data_type, 1);
- // bytes_wrote += rtf_put(cx->sap[NAS_DC_INPUT_SAPI], skb->data, skb->len);
-#endif
-
if (bytes_wrote != p->length + skb->len + 1) {
printk("NAS_MESH_DC_SEND_SIG: Data sent failure in DC-FIFO\n");
return;
@@ -511,22 +492,12 @@ void nas_mesh_DC_send_peer_sig_data_request(struct cx_entity *cx, uint8_t sig_ca
p->nasUEDCPrimitive.data_transfer_req.localConnectionRef = cx->lcr;
p->nasUEDCPrimitive.data_transfer_req.priority = 3; // TBD
p->nasUEDCPrimitive.data_transfer_req.nasDataLength = (nas_length)+1; //adds category character
-#ifdef PDCP_USE_NETLINK
-#else
- // bytes_wrote = rtf_put(cx->sap[NAS_DC_INPUT_SAPI], p, p->length);
-#endif
if (bytes_wrote!=p->length) {
printk("NAS_MESH_DC_PEER_SEND_SIG: Header sent failure in DC-FIFO\n");
return;
}
-#ifdef PDCP_USE_NETLINK
-#else
- // bytes_wrote += rtf_put(cx->sap[NAS_DC_INPUT_SAPI], &data_type, 1);
- // bytes_wrote += rtf_put(cx->sap[NAS_DC_INPUT_SAPI], (char *)nas_data, nas_length);
-#endif
-
if (bytes_wrote != p->length + nas_length + 1) {
printk("NAS_MESH_DC_PEER_SEND_SIG: Data sent failure in DC-FIFO\n");
return;
@@ -665,9 +636,6 @@ void nas_mesh_DC_decode_sig_data_ind(struct cx_entity *cx, struct nas_ue_dc_elem
}
// End debug information
-#ifndef PDCP_USE_NETLINK
- // nas_COMMON_receive(p->length, p->nasUEDCPrimitive.data_transfer_ind.nasDataLength, cx->sap[NAS_DC_OUTPUT_SAPI]);
-#endif
#ifdef NAS_DEBUG_DC
printk("NAS_MESH_DC_RECEIVE: DATA_TRANSFER_IND reception\n");
printk(" Local Connection reference %u\n",p->nasUEDCPrimitive.data_transfer_ind.localConnectionRef);
@@ -842,20 +810,12 @@ int nas_mesh_DC_receive(struct cx_entity *cx,struct nas_priv *gpriv)
}
// End debug information
-#ifdef PDCP_USE_NETLINK
-#else
- // bytes_read = rtf_get(cx->sap[NAS_DC_OUTPUT_SAPI] , gpriv->rbuffer, NAS_TL_SIZE);
-#endif
if (bytes_read>0) {
struct nas_ue_dc_element *p;
p= (struct nas_ue_dc_element *)(gpriv->rbuffer);
//get the rest of the primitive
-#ifdef PDCP_USE_NETLINK
-#else
- // bytes_read += rtf_get(cx->sap[NAS_DC_OUTPUT_SAPI], (uint8_t *)p+NAS_TL_SIZE, p->length-NAS_TL_SIZE);
-#endif
if (bytes_read!=p->length) {
printk("NAS_MESH_DC_RECEIVE: Problem while reading primitive header\n");
@@ -982,19 +942,11 @@ int nas_mesh_GC_receive(struct nas_priv *gpriv)
#ifdef NAS_DEBUG_GC
printk("NAS_MESH_GC_RECEIVE - begin \n");
#endif
-#ifdef PDCP_USE_NETLINK
-#else
- // bytes_read = rtf_get(gpriv->sap[NAS_GC_SAPI], gpriv->rbuffer, NAS_TL_SIZE);
-#endif
if (bytes_read>0) {
struct nas_ue_gc_element *p;
p= (struct nas_ue_gc_element *)(gpriv->rbuffer);
//get the rest of the primitive
-#ifdef PDCP_USE_NETLINK
-#else
- // bytes_read += rtf_get(gpriv->sap[NAS_GC_SAPI], (uint8_t *)p+NAS_TL_SIZE, p->length-NAS_TL_SIZE);
-#endif
if (bytes_read!=p->length) {
printk("NAS_MESH_GC_RECEIVE: Problem while reading primitive's header\n");
@@ -1004,10 +956,6 @@ int nas_mesh_GC_receive(struct nas_priv *gpriv)
// start decoding message
switch (p->type) {
case INFO_BROADCAST_IND :
-#ifdef PDCP_USE_NETLINK
-#else
- // bytes_read += rtf_get(gpriv->sap[NAS_GC_SAPI], (uint8_t *)p+p->length, p->nasUEGCPrimitive.broadcast_ind.nasDataLength);
-#endif
if (bytes_read!=p->length+p->nasUEGCPrimitive.broadcast_ind.nasDataLength) {
printk("NAS_MESH_GC_RECEIVE: INFO_BROADCAST_IND reception, Problem while reading primitive's data\n");
return bytes_read;
diff --git a/openair2/NETWORK_DRIVER/MESH/proto_extern.h b/openair2/NETWORK_DRIVER/MESH/proto_extern.h
index ac92b2f8bd..332540f3b7 100644
--- a/openair2/NETWORK_DRIVER/MESH/proto_extern.h
+++ b/openair2/NETWORK_DRIVER/MESH/proto_extern.h
@@ -110,14 +110,6 @@ void nas_COMMON_del_send(struct sk_buff *skb,
struct cx_entity *cx,
struct classifier_entity *gc,int inst, struct nas_priv *gpriv);
-#ifndef PDCP_USE_NETLINK
-/**
-\fn void nas_COMMON_QOS_receive()
-\brief Retrieve PDU from PDCP for connection
- */
-void nas_COMMON_QOS_receive(void);
-#endif //PDCP_USE_NETLINK
-
/**
\fn struct rb_entity *nas_COMMON_add_rb(struct cx_entity *cx, nasRadioBearerId_t rabi, nasQoSTrafficClass_t qos)
\brief Add a radio-bearer descriptor
@@ -168,7 +160,6 @@ struct classifier_entity
*/
void nas_COMMON_flush_rb(struct cx_entity *cx);
-#ifdef PDCP_USE_NETLINK
/**
\fn int nas_netlink_send(unsigned char *data,unsigned int len)
\brief Request the transfer of data by PDCP via netlink socket
@@ -185,7 +176,6 @@ int nas_netlink_send(unsigned char *data,unsigned int len);
*/
void nas_COMMON_QOS_receive(struct nlmsghdr *nlh);
-#endif //PDCP_USE_NETLINK
//nasmesh.c
/**
@@ -305,13 +295,10 @@ void nas_tool_print_buffer(char * buffer,int length);
void nas_print_rb_entity(struct rb_entity *rb);
void nas_print_classifier(struct classifier_entity *gc);
-#ifdef PDCP_USE_NETLINK
// nas_netlink.c
void nas_netlink_release(void);
int nas_netlink_init(void);
-#endif
-
/** @} */
#endif
diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c
index cb5bef5ab0..4d04f4e0c8 100644
--- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c
+++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c
@@ -266,13 +266,11 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) {
dump_dl(sched_info);
#endif
- if (ifi->NR_Schedule_response) {
- AssertFatal(ifi->NR_Schedule_response!=NULL,
- "nr_schedule_response is null (mod %d, cc %d)\n",
- module_id,
- CC_id);
- ifi->NR_Schedule_response(sched_info);
- }
+ AssertFatal(ifi->NR_Schedule_response!=NULL,
+ "nr_schedule_response is null (mod %d, cc %d)\n",
+ module_id,
+ CC_id);
+ ifi->NR_Schedule_response(sched_info);
LOG_D(PHY,"NR_Schedule_response: SFN_SF:%d%d dl_pdus:%d\n",
sched_info->frame,
diff --git a/openair2/RRC/LITE/rrc_common.c b/openair2/RRC/LITE/rrc_common.c
index f0279f0ef2..a4239e857d 100644
--- a/openair2/RRC/LITE/rrc_common.c
+++ b/openair2/RRC/LITE/rrc_common.c
@@ -97,35 +97,6 @@ rrc_init_global_param(
//-----------------------------------------------------------------------------
{
- //#ifdef USER_MODE
- // Rrc_xface = (RRC_XFACE*)malloc16(sizeof(RRC_XFACE));
- //#endif //USRE_MODE
-
- // Rrc_xface->openair_rrc_top_init = openair_rrc_top_init;
- // Rrc_xface->openair_rrc_eNB_init = openair_rrc_eNB_init;
- // Rrc_xface->openair_rrc_UE_init = openair_rrc_ue_init;
- // Rrc_xface->mac_rrc_data_ind = mac_rrc_data_ind;
- //Rrc_xface->mac_rrc_data_req = mac_rrc_data_req;
- // Rrc_xface->rrc_data_indP = (void *)rlcrrc_data_ind;
- // Rrc_xface->rrc_rx_tx = rrc_rx_tx;
- // Rrc_xface->mac_rrc_meas_ind = mac_rrc_meas_ind;
- // Rrc_xface->get_rrc_status = get_rrc_status;
-
- //Rrc_xface->rrc_get_status = ...
-
- // Mac_rlc_xface->mac_out_of_sync_ind=mac_out_of_sync_ind;
-
-#ifndef NO_RRM
- // Rrc_xface->fn_rrc=fn_rrc;
-#endif
- // LOG_D(RRC, "[RRC]INIT_GLOBAL_PARAM: Mac_rlc_xface %p, rrc_rlc_register %p,rlcrrc_data_ind%p\n",Mac_rlc_xface,Mac_rlc_xface->rrc_rlc_register_rrc,rlcrrc_data_ind);
- /*
- if((Mac_rlc_xface==NULL) || (Mac_rlc_xface->rrc_rlc_register_rrc==NULL) ||
- (rlcrrc_data_ind==NULL)) {
- LOG_E(RRC,"Data structured is not initialized \n");
- return -1;
- }
- */
rrc_rlc_register_rrc (rrc_data_ind, NULL); //register with rlc
DCCH_LCHAN_DESC.transport_block_size = 4;
diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg_NB_IoT.h b/openair2/RRC/LTE/MESSAGES/asn1_msg_NB_IoT.h
index 6b56be1022..a862af7836 100644
--- a/openair2/RRC/LTE/MESSAGES/asn1_msg_NB_IoT.h
+++ b/openair2/RRC/LTE/MESSAGES/asn1_msg_NB_IoT.h
@@ -28,7 +28,6 @@
* \email: raymond.knopp@eurecom.fr ,navid.nikaein@eurecom.fr, michele.paffetti@studio.unibo.it
*/
-#ifdef USER_MODE
#include
#include
#include /* for atoi(3) */
@@ -36,9 +35,6 @@
#include /* for strerror(3) */
#include /* for EX_* exit codes */
#include /* for errno */
-#else
-#include /* Needed by all modules */
-#endif
#include
#include /* for _ASN_DEFAULT_STACK_MAX */
diff --git a/openair2/RRC/LTE/MESSAGES/asn1_patch b/openair2/RRC/LTE/MESSAGES/asn1_patch
deleted file mode 100644
index 8682f17895..0000000000
--- a/openair2/RRC/LTE/MESSAGES/asn1_patch
+++ /dev/null
@@ -1,522 +0,0 @@
-diff -cB /homes/kaltenbe/Devel/openair/openair_branches/openair_lte/openair2/RRC/LITE/MESSAGES/asn1c/asn1c/skeletons/asn_codecs_prim.c patch_dir/asn_codecs_prim.c
-*** /homes/kaltenbe/Devel/openair/openair_branches/openair_lte/openair2/RRC/LITE/MESSAGES/asn1c/asn1c/skeletons/asn_codecs_prim.c 2011-03-31 10:22:56.000000000 +0200
---- patch_dir/asn_codecs_prim.c 2011-05-31 10:28:26.000000000 +0200
-***************
-*** 4,10 ****
- */
- #include
- #include
-- #include
-
- /*
- * Decode an always-primitive type.
---- 4,9 ----
-diff -cB /homes/kaltenbe/Devel/openair/openair_branches/openair_lte/openair2/RRC/LITE/MESSAGES/asn1c/asn1c/skeletons/asn_internal.h patch_dir/asn_internal.h
-*** /homes/kaltenbe/Devel/openair/openair_branches/openair_lte/openair2/RRC/LITE/MESSAGES/asn1c/asn1c/skeletons/asn_internal.h 2011-03-31 10:22:57.000000000 +0200
---- patch_dir/asn_internal.h 2011-05-31 10:28:26.000000000 +0200
-***************
-*** 10,20 ****
---- 10,31 ----
- #define _ASN_INTERNAL_H_
-
- #include "asn_application.h" /* Application-visible API */
-+ #ifndef USER_MODE
-+ #include
-+ #include
-+ #include "rtai_mem.h"
-+ #endif
-
- #ifndef __NO_ASSERT_H__ /* Include assert.h only for internal use. */
- #include /* for assert() macro */
- #endif
-
-+ #ifndef USER_MODE
-+ #ifndef assert
-+ #define assert(expr) ((expr) ? (void) 0 : printk("Assertion failed in %s:%d\n", __FILE__, __LINE__))
-+ #endif
-+ #endif
-+
- #ifdef __cplusplus
- extern "C" {
- #endif
-***************
-*** 23,32 ****
---- 34,51 ----
- #define ASN1C_ENVIRONMENT_VERSION 922 /* Compile-time version */
- int get_asn1c_environment_version(void); /* Run-time version */
-
-+ #ifdef USER_MODE
- #define CALLOC(nmemb, size) calloc(nmemb, size)
- #define MALLOC(size) malloc(size)
- #define REALLOC(oldptr, size) realloc(oldptr, size)
- #define FREEMEM(ptr) free(ptr)
-+ #else
-+ #define CALLOC(nmemb, size) rt_calloc(nmemb,size)
-+ #define MALLOC(size) rt_malloc(size)
-+ #define REALLOC(oldptr, size) rt_realloc(oldptr, size)
-+ #define FREEMEM(ptr) rt_free(ptr);
-+ #endif
-+
-
- /*
- * A macro for debugging the ASN.1 internals.
-***************
-*** 38,45 ****
- #ifdef ASN_THREAD_SAFE
- #define asn_debug_indent 0
- #else /* !ASN_THREAD_SAFE */
-! int asn_debug_indent;
- #endif /* ASN_THREAD_SAFE */
- #define ASN_DEBUG(fmt, args...) do { \
- int adi = asn_debug_indent; \
- while(adi--) fprintf(stderr, " "); \
---- 57,65 ----
- #ifdef ASN_THREAD_SAFE
- #define asn_debug_indent 0
- #else /* !ASN_THREAD_SAFE */
-! extern int asn_debug_indent;
- #endif /* ASN_THREAD_SAFE */
-+ #ifdef USER_MODE
- #define ASN_DEBUG(fmt, args...) do { \
- int adi = asn_debug_indent; \
- while(adi--) fprintf(stderr, " "); \
-***************
-*** 47,52 ****
---- 67,81 ----
- fprintf(stderr, " (%s:%d)\n", \
- __FILE__, __LINE__); \
- } while(0)
-+ #else
-+ #define ASN_DEBUG(fmt, args...) do { \
-+ int adi = asn_debug_indent; \
-+ while(adi--) printk(" "); \
-+ printk(fmt, ##args); \
-+ printk(" (%s:%d)\n", \
-+ __FILE__, __LINE__); \
-+ } while(0)
-+ #endif
- #else /* !__GNUC__ */
- void ASN_DEBUG_f(const char *fmt, ...);
- #define ASN_DEBUG ASN_DEBUG_f
-diff -cB /homes/kaltenbe/Devel/openair/openair_branches/openair_lte/openair2/RRC/LITE/MESSAGES/asn1c/asn1c/skeletons/asn_SET_OF.c patch_dir/asn_SET_OF.c
-*** /homes/kaltenbe/Devel/openair/openair_branches/openair_lte/openair2/RRC/LITE/MESSAGES/asn1c/asn1c/skeletons/asn_SET_OF.c 2011-03-31 10:22:56.000000000 +0200
---- patch_dir/asn_SET_OF.c 2011-05-31 10:28:26.000000000 +0200
-***************
-*** 4,10 ****
- */
- #include
- #include
-- #include
-
- /*
- * Add another element into the set.
---- 4,9 ----
-***************
-*** 21,26 ****
---- 20,27 ----
- /*
- * Make sure there's enough space to insert an element.
- */
-+ ASN_DEBUG("SET ADD: count %d, size %d",as->count,as->size);
-+
- if(as->count == as->size) {
- int _newsize = as->size ? (as->size << 1) : 4;
- void *_new_arr;
-diff -cB /homes/kaltenbe/Devel/openair/openair_branches/openair_lte/openair2/RRC/LITE/MESSAGES/asn1c/asn1c/skeletons/asn_system.h patch_dir/asn_system.h
-*** /homes/kaltenbe/Devel/openair/openair_branches/openair_lte/openair2/RRC/LITE/MESSAGES/asn1c/asn1c/skeletons/asn_system.h 2011-03-31 10:22:57.000000000 +0200
---- patch_dir/asn_system.h 2011-05-31 10:28:26.000000000 +0200
-***************
-*** 13,25 ****
- #include "config.h"
- #endif
-
-! #include /* For snprintf(3) */
-! #include /* For *alloc(3) */
-! #include /* For memcpy(3) */
-! #include /* For size_t */
-! #include /* For LONG_MAX */
-! #include /* For va_start */
-! #include /* for offsetof and ptrdiff_t */
-
- #ifdef WIN32
-
---- 13,39 ----
- #include "config.h"
- #endif
-
-! #ifdef USER_MODE
-! #include // For snprintf(3)
-! #include // For *alloc(3)
-! #include // For memcpy(3)
-! #include // For size_t
-! #include // For LONG_MAX
-! #include // For va_start
-! #include // for offsetof and ptrdiff_t
-! #include // For errno
-! #else
-! typedef char FILE;
-! #include
-! #include // For snprintf
-! #include // For sort
-! #define qsort(base,num,size,cmp_func) sort(base,num,size,cmp_func,NULL)
-! #include // For errno
-! #ifndef errno
-! extern int errno;
-! #endif
-! #include "bsearch.h"
-! #endif
-
- #ifdef WIN32
-
-***************
-*** 63,69 ****
- #include
- #else /* !defined(__vxworks) */
-
-! #include /* C99 specifies this file */
- /*
- * 1. Earlier FreeBSD version didn't have ,
- * but was present.
---- 77,85 ----
- #include
- #else /* !defined(__vxworks) */
-
-! #ifdef USER_MODE
-! #include /*C99 specifies this file */
-! #endif
- /*
- * 1. Earlier FreeBSD version didn't have ,
- * but was present.
-***************
-*** 81,91 ****
- #define inline
- #endif /* __GNUC__ */
- #else
-! #include /* SUSv2+ and C99 specify this file, for uintXX_t */
- #endif /* defined(sun) */
- #endif
-
-! #include /* for ntohl() */
- #define sys_ntohl(foo) ntohl(foo)
-
- #endif /* defined(__vxworks) */
---- 97,109 ----
- #define inline
- #endif /* __GNUC__ */
- #else
-! #ifdef USER_MODE
-! #include /*SUSv2+ and C99 specify this file, for uintXX_t */
-! #endif
- #endif /* defined(sun) */
- #endif
-
-! /*#include for ntohl() */
- #define sys_ntohl(foo) ntohl(foo)
-
- #endif /* defined(__vxworks) */
-diff -cB /homes/kaltenbe/Devel/openair/openair_branches/openair_lte/openair2/RRC/LITE/MESSAGES/asn1c/asn1c/skeletons/ber_tlv_tag.c patch_dir/ber_tlv_tag.c
-*** /homes/kaltenbe/Devel/openair/openair_branches/openair_lte/openair2/RRC/LITE/MESSAGES/asn1c/asn1c/skeletons/ber_tlv_tag.c 2011-03-31 10:22:56.000000000 +0200
---- patch_dir/ber_tlv_tag.c 2011-05-31 10:28:26.000000000 +0200
-***************
-*** 4,10 ****
- */
- #include
- #include
-- #include
-
- ssize_t
- ber_fetch_tag(const void *ptr, size_t size, ber_tlv_tag_t *tag_r) {
---- 4,9 ----
-***************
-*** 57,63 ****
- return 0; /* Want more */
- }
-
-!
- ssize_t
- ber_tlv_tag_fwrite(ber_tlv_tag_t tag, FILE *f) {
- char buf[sizeof("[APPLICATION ]") + 32];
---- 56,62 ----
- return 0; /* Want more */
- }
-
-! #ifdef USER_MODE
- ssize_t
- ber_tlv_tag_fwrite(ber_tlv_tag_t tag, FILE *f) {
- char buf[sizeof("[APPLICATION ]") + 32];
-***************
-*** 71,76 ****
---- 70,76 ----
-
- return fwrite(buf, 1, ret, f);
- }
-+ #endif
-
- ssize_t
- ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t size) {
-diff -cB /homes/kaltenbe/Devel/openair/openair_branches/openair_lte/openair2/RRC/LITE/MESSAGES/asn1c/asn1c/skeletons/constraints.c patch_dir/constraints.c
-*** /homes/kaltenbe/Devel/openair/openair_branches/openair_lte/openair2/RRC/LITE/MESSAGES/asn1c/asn1c/skeletons/constraints.c 2011-03-31 10:22:57.000000000 +0200
---- patch_dir/constraints.c 2011-05-31 10:28:26.000000000 +0200
-***************
-*** 1,4 ****
-! #include "asn_internal.h"
- #include "constraints.h"
-
- int
---- 1,4 ----
-! #include
- #include "constraints.h"
-
- int
-diff -cB /homes/kaltenbe/Devel/openair/openair_branches/openair_lte/openair2/RRC/LITE/MESSAGES/asn1c/asn1c/skeletons/constr_TYPE.c patch_dir/constr_TYPE.c
-*** /homes/kaltenbe/Devel/openair/openair_branches/openair_lte/openair2/RRC/LITE/MESSAGES/asn1c/asn1c/skeletons/constr_TYPE.c 2011-03-31 10:22:56.000000000 +0200
---- patch_dir/constr_TYPE.c 2011-05-31 10:28:26.000000000 +0200
-***************
-*** 4,10 ****
- */
- #include
- #include
-- #include
-
- /*
- * Version of the ASN.1 infrastructure shipped with compiler.
---- 4,9 ----
-***************
-*** 29,34 ****
---- 28,34 ----
- return type_descriptor->outmost_tag(type_descriptor, struct_ptr, 0, 0);
- }
-
-+ #ifdef USER_MODE
- /*
- * Print the target language's structure in human readable form.
- */
-***************
-*** 75,77 ****
---- 75,78 ----
- fprintf(stderr, "\n");
- va_end(ap);
- }
-+ #endif
-diff -cB /homes/kaltenbe/Devel/openair/openair_branches/openair_lte/openair2/RRC/LITE/MESSAGES/asn1c/asn1c/skeletons/der_encoder.c patch_dir/der_encoder.c
-*** /homes/kaltenbe/Devel/openair/openair_branches/openair_lte/openair2/RRC/LITE/MESSAGES/asn1c/asn1c/skeletons/der_encoder.c 2011-03-31 10:22:56.000000000 +0200
---- patch_dir/der_encoder.c 2011-05-31 10:28:26.000000000 +0200
-***************
-*** 3,9 ****
- * Redistribution and modifications are permitted subject to BSD license.
- */
- #include
-- #include
-
- static ssize_t der_write_TL(ber_tlv_tag_t tag, ber_tlv_len_t len,
- asn_app_consume_bytes_f *cb, void *app_key, int constructed);
---- 3,8 ----
-***************
-*** 81,89 ****
---- 80,90 ----
- asn_app_consume_bytes_f *cb,
- void *app_key) {
- ber_tlv_tag_t *tags; /* Copy of tags stream */
-+ ber_tlv_tag_t tags_array[8];
- int tags_count; /* Number of tags */
- size_t overall_length;
- ssize_t *lens;
-+ ssize_t lens_array[8];
- int i;
-
- ASN_DEBUG("Writing tags (%s, tm=%d, tc=%d, tag=%s, mtc=%d)",
-***************
-*** 102,111 ****
- * and initialize it appropriately.
- */
- int stag_offset;
-! tags = (ber_tlv_tag_t *)alloca((sd->tags_count + 1) * sizeof(ber_tlv_tag_t));
- if(!tags) { /* Can fail on !x86 */
-! errno = ENOMEM;
-! return -1;
- }
- tags_count = sd->tags_count
- + 1 /* EXPLICIT or IMPLICIT tag is given */
---- 103,121 ----
- * and initialize it appropriately.
- */
- int stag_offset;
-! //tags = (ber_tlv_tag_t *)alloca((sd->tags_count + 1) * sizeof(ber_tlv_tag_t));
-! tags = &(tags_array[0]);
-! if ((sd->tags_count + 1)>=8) {
-! #ifdef USER_MODE
-! printf("der_encoder.c: ERROR tags array too small. Increase size!\n");
-! exit(-1);
-! #endif
-! errno = ENOMEM;
-! return -1;
-! }
- if(!tags) { /* Can fail on !x86 */
-! errno = ENOMEM;
-! return -1;
- }
- tags_count = sd->tags_count
- + 1 /* EXPLICIT or IMPLICIT tag is given */
-***************
-*** 124,135 ****
- if(tags_count == 0)
- return 0;
-
-! lens = (ssize_t *)alloca(tags_count * sizeof(lens[0]));
- if(!lens) {
-! errno = ENOMEM;
-! return -1;
- }
-!
- /*
- * Array of tags is initialized.
- * Now, compute the size of the TLV pairs, from right to left.
---- 134,154 ----
- if(tags_count == 0)
- return 0;
-
-! //lens = (ssize_t *)alloca(tags_count * sizeof(lens[0]));
-! lens = &(lens_array[0]);
-! if (tags_count>=8) {
-! #ifdef USER_MODE
-! printf("der_encoder.c: ERROR lens array too small. Increase size!\n");
-! exit(-1);
-! #endif
-! errno = ENOMEM;
-! return -1;
-! }
- if(!lens) {
-! errno = ENOMEM;
-! return -1;
- }
-!
- /*
- * Array of tags is initialized.
- * Now, compute the size of the TLV pairs, from right to left.
-diff -cB /homes/kaltenbe/Devel/openair/openair_branches/openair_lte/openair2/RRC/LITE/MESSAGES/asn1c/asn1c/skeletons/INTEGER.c patch_dir/INTEGER.c
-*** /homes/kaltenbe/Devel/openair/openair_branches/openair_lte/openair2/RRC/LITE/MESSAGES/asn1c/asn1c/skeletons/INTEGER.c 2011-03-31 10:22:56.000000000 +0200
---- patch_dir/INTEGER.c 2011-05-31 10:28:26.000000000 +0200
-***************
-*** 6,12 ****
- #include
- #include
- #include /* Encoder and decoder of a primitive type */
-- #include
-
- /*
- * INTEGER basic type description.
---- 6,11 ----
-***************
-*** 103,109 ****
- static ssize_t
- INTEGER__dump(asn_TYPE_descriptor_t *td, const INTEGER_t *st, asn_app_consume_bytes_f *cb, void *app_key, int plainOrXER) {
- asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics;
-! char scratch[32]; /* Enough for 64-bit integer */
- uint8_t *buf = st->buf;
- uint8_t *buf_end = st->buf + st->size;
- signed long accum;
---- 102,108 ----
- static ssize_t
- INTEGER__dump(asn_TYPE_descriptor_t *td, const INTEGER_t *st, asn_app_consume_bytes_f *cb, void *app_key, int plainOrXER) {
- asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics;
-! char scratch[128];
- uint8_t *buf = st->buf;
- uint8_t *buf_end = st->buf + st->size;
- signed long accum;
-***************
-*** 142,149 ****
---- 141,152 ----
-
- el = INTEGER_map_value2enum(specs, accum);
- if(el) {
-+ scrsize = sizeof(scratch);
-+ scr = scratch;
-+ /* cannot use alloca in kernel
- scrsize = el->enum_len + 32;
- scr = (char *)alloca(scrsize);
-+ */
- if(plainOrXER == 0)
- ret = snprintf(scr, scrsize,
- "%ld (%s)", accum, el->enum_name);
-diff -cB /homes/kaltenbe/Devel/openair/openair_branches/openair_lte/openair2/RRC/LITE/MESSAGES/asn1c/asn1c/skeletons/NativeEnumerated.c patch_dir/NativeEnumerated.c
-*** /homes/kaltenbe/Devel/openair/openair_branches/openair_lte/openair2/RRC/LITE/MESSAGES/asn1c/asn1c/skeletons/NativeEnumerated.c 2011-03-31 10:22:57.000000000 +0200
---- patch_dir/NativeEnumerated.c 2011-05-31 10:28:26.000000000 +0200
-***************
-*** 46,51 ****
---- 46,52 ----
- asn_app_consume_bytes_f *cb, void *app_key) {
- asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics;
- asn_enc_rval_t er;
-+ char scratch[128];
- const long *native = (const long *)sptr;
- const asn_INTEGER_enum_map_t *el;
-
-***************
-*** 57,63 ****
- el = INTEGER_map_value2enum(specs, *native);
- if(el) {
- size_t srcsize = el->enum_len + 5;
-! char *src = (char *)alloca(srcsize);
-
- er.encoded = snprintf(src, srcsize, "<%s/>", el->enum_name);
- assert(er.encoded > 0 && (size_t)er.encoded < srcsize);
---- 58,64 ----
- el = INTEGER_map_value2enum(specs, *native);
- if(el) {
- size_t srcsize = el->enum_len + 5;
-! char *src = (char *)scratch; //alloca(srcsize);
-
- er.encoded = snprintf(src, srcsize, "<%s/>", el->enum_name);
- assert(er.encoded > 0 && (size_t)er.encoded < srcsize);
-diff -cB /homes/kaltenbe/Devel/openair/openair_branches/openair_lte/openair2/RRC/LITE/MESSAGES/asn1c/asn1c/skeletons/OCTET_STRING.c patch_dir/OCTET_STRING.c
-*** /homes/kaltenbe/Devel/openair/openair_branches/openair_lte/openair2/RRC/LITE/MESSAGES/asn1c/asn1c/skeletons/OCTET_STRING.c 2011-03-31 10:22:55.000000000 +0200
---- patch_dir/OCTET_STRING.c 2011-05-31 10:28:26.000000000 +0200
-***************
-*** 6,12 ****
- #include
- #include
- #include /* for .bits_unused member */
-- #include
-
- /*
- * OCTET STRING basic type description.
---- 6,11 ----
-diff -cB /homes/kaltenbe/Devel/openair/openair_branches/openair_lte/openair2/RRC/LITE/MESSAGES/asn1c/asn1c/skeletons/xer_encoder.c patch_dir/xer_encoder.c
-*** /homes/kaltenbe/Devel/openair/openair_branches/openair_lte/openair2/RRC/LITE/MESSAGES/asn1c/asn1c/skeletons/xer_encoder.c 2011-04-11 18:03:26.000000000 +0200
---- patch_dir/xer_encoder.c 2011-05-31 10:28:26.000000000 +0200
-***************
-*** 3,10 ****
- * Redistribution and modifications are permitted subject to BSD license.
- */
- #include
-! #include
-! #include
-
- /*
- * The XER encoder of any type. May be invoked by the application.
---- 3,10 ----
- * Redistribution and modifications are permitted subject to BSD license.
- */
- #include
-! //#include
-! //#include
-
- /*
- * The XER encoder of any type. May be invoked by the application.
-***************
-*** 41,46 ****
---- 41,47 ----
- * This is a helper function for xer_fprint, which directs all incoming data
- * into the provided file descriptor.
- */
-+ #ifdef USER_MODE
- static int
- xer__print2fp(const void *buffer, size_t size, void *app_key) {
- FILE *stream = (FILE *)app_key;
-***************
-*** 65,67 ****
---- 66,69 ----
-
- return fflush(stream);
- }
-+ #endif
diff --git a/openair2/RRC/LTE/rrc_UE.c b/openair2/RRC/LTE/rrc_UE.c
index 30fb20b727..4b862fa11d 100644
--- a/openair2/RRC/LTE/rrc_UE.c
+++ b/openair2/RRC/LTE/rrc_UE.c
@@ -393,15 +393,7 @@ char openair_rrc_ue_init( const module_id_t ue_mod_idP, const unsigned char eNB_
init_SI_UE(&ctxt,eNB_index);
LOG_D(RRC,PROTOCOL_RRC_CTXT_FMT" INIT: phy_sync_2_ch_ind\n",
PROTOCOL_RRC_CTXT_ARGS(&ctxt));
-#ifndef NO_RRM
- send_msg(&S_rrc,msg_rrc_phy_synch_to_CH_ind(ctxt.module_id,eNB_index,UE_rrc_inst[ctxt.module_id].Mac_id));
-#endif
-#ifndef NO_RRM
- send_msg(&S_rrc,msg_rrc_phy_synch_to_CH_ind(ctxt.module_id,eNB_index,UE_rrc_inst[ctxt.module_id].Mac_id));
-#endif
-#ifdef NO_RRM //init ch SRB0, SRB1 & BDTCH
openair_rrc_on_ue(&ctxt);
-#endif
return 0;
}
@@ -2249,9 +2241,6 @@ rrc_ue_decode_dcch(
}
}
-#ifndef NO_RRM
- send_msg(&S_rrc,msg_rrc_end_scan_req(ctxt_pP->module_id,eNB_indexP));
-#endif
}
const char siWindowLength[9][5] = {"1ms","2ms","5ms","10ms","15ms","20ms","40ms","80ms","ERR"};
@@ -2530,14 +2519,6 @@ int decode_BCCH_MBMS_DLSCH_Message(
break;
}
}*/
- /*if ((rrc_get_sub_state(ctxt_pP->module_id) == RRC_SUB_STATE_IDLE_SIB_COMPLETE)
- #if defined(ENABLE_USE_MME)
- && (UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.data != NULL)
- #endif
- ) {
- rrc_ue_generate_RRCConnectionRequest(ctxt_pP, 0);
- rrc_set_sub_state( ctxt_pP->module_id, RRC_SUB_STATE_IDLE_CONNECTING );
- }*/
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_BCCH, VCD_FUNCTION_OUT );
return 0;
}
diff --git a/openair2/RRC/LTE/rrc_defs.h b/openair2/RRC/LTE/rrc_defs.h
index f5b1db8b8c..40aad67a06 100644
--- a/openair2/RRC/LTE/rrc_defs.h
+++ b/openair2/RRC/LTE/rrc_defs.h
@@ -173,13 +173,6 @@ extern pthread_mutex_t slrb_mutex;
//the thread function
void *send_UE_status_notification(void *);
-
-
-//#include "COMMON/openair_defs.h"
-#ifndef USER_MODE
- //#include
-#endif
-
#include "LTE_SystemInformationBlockType1.h"
#include "LTE_SystemInformation.h"
#include "LTE_RRCConnectionReconfiguration.h"
@@ -217,12 +210,6 @@ void *send_UE_status_notification(void *);
#define NB_SIG_CNX_UE 2 //MAX_MANAGED_RG_PER_MOBILE
#define NB_CNX_UE 2//MAX_MANAGED_RG_PER_MOBILE
-#ifndef NO_RRM
- #include "L3_rrc_interface.h"
- #include "rrc_rrm_msg.h"
- #include "rrc_rrm_interface.h"
-#endif
-
#include "intertask_interface.h"
diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c
index a2115763cc..27b0843f6f 100644
--- a/openair2/RRC/LTE/rrc_eNB.c
+++ b/openair2/RRC/LTE/rrc_eNB.c
@@ -7279,9 +7279,6 @@ rrc_eNB_decode_ccch(
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
rrcConnectionReestablishmentRequest->ue_Identity.physCellId,
ue_context_p->ue_context.reestablishment_cause);
-#ifndef NO_RRM
- send_msg(&S_rrc, msg_rrc_MR_attach_ind(ctxt_pP->module_id, Mac_id));
-#else
ue_context_p->ue_context.primaryCC_id = CC_id;
//LG COMMENT Idx = (ue_mod_idP * NB_RB_MAX) + DCCH;
Idx = DCCH;
@@ -7335,7 +7332,6 @@ rrc_eNB_decode_ccch(
);
}
-#endif //NO_RRM
}
break;
@@ -7524,9 +7520,6 @@ rrc_eNB_decode_ccch(
}
}
-#ifndef NO_RRM
- send_msg(&S_rrc, msg_rrc_MR_attach_ind(ctxt_pP->module_id, Mac_id));
-#else
ue_context_p->ue_context.primaryCC_id = CC_id;
//LG COMMENT Idx = (ue_mod_idP * NB_RB_MAX) + DCCH;
Idx = DCCH;
@@ -7579,7 +7572,6 @@ rrc_eNB_decode_ccch(
);
}
-#endif //NO_RRM
break;
default:
diff --git a/openair2/RRC/LTE/rrc_rrm_interface.c b/openair2/RRC/LTE/rrc_rrm_interface.c
deleted file mode 100644
index fe15dae46d..0000000000
--- a/openair2/RRC/LTE/rrc_rrm_interface.c
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The OpenAirInterface Software Alliance licenses this file to You under
- * the OAI Public License, Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.openairinterface.org/?page_id=698
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *-------------------------------------------------------------------------------
- * For more information about the OpenAirInterface (OAI) Software Alliance:
- * contact@openairinterface.org
- */
-
-/*!
-*******************************************************************************
-
-\file rrm_sock.c
-
-\brief RRM (Radio Ressource Manager ) Socket: communication withe other medium:
- - RRC ,
- - CMM ,
- - PUSU
-
-\author BURLOT Pascal
-
-\date 10/07/08
-
-
-\par Historique:
- P.BURLOT 2009-01-20
- + send a message via fifo:
- - sending header
- - and data if any
-
-*******************************************************************************
-*/
-
-#ifndef RRC_RRM_FIFOS_XFACE
- #include
- #include
- #include
- #include
- #include
-
- #include
- #include
-
-#else
-
- #include
-
-#endif
-
-#include "rrc_rrm_interface.h"
-#include "defs.h"
-//! \brief Taille maximale de la charge utile
-#define SIZE_MAX_PAYLOAD 2048
-//! \brief PID de l'espace utilisateur (Netlink mode)
-//#define PID_USERSPACE 0xAA
-
-
-
-
-
-#ifndef RRC_RRM_FIFOS_XFACE
-
-/*!
-*******************************************************************************
-\brief This function opens a unix socket for the rrm communication
-\return The return value is a socket handle
-*/
-int open_socket(
- sock_rrm_t *s, ///< socket descriptor
- char *path_local, ///< local socket path if unix socket
- char *path_dest, ///< host Socket path if unix socket
- int rrm_inst ///< instance of the rrm entity
-) {
- /* Unix socket */
- int socket_fd ;
- int len ;
-
- if ((socket_fd = socket(AF_UNIX, SOCK_DGRAM, 0)) == -1) {
- perror("unix socket");
- return -1 ;
- }
-
- memset(&(s->un_local_addr), 0, sizeof(struct sockaddr_un));
- s->un_local_addr.sun_family = AF_UNIX;
- sprintf(s->un_local_addr.sun_path,"%s%d", path_local, rrm_inst );
- unlink(s->un_local_addr.sun_path);
- msg("local %s\n",s->un_local_addr.sun_path);
- len = strlen((s->un_local_addr).sun_path) + sizeof((s->un_local_addr).sun_family);
-
- if (bind(socket_fd, (struct sockaddr *)&(s->un_local_addr), len) == -1) {
- perror("bind");
- return -1 ;
- }
-
- memset(&(s->un_dest_addr), 0, sizeof(struct sockaddr_un));
- s->un_dest_addr.sun_family = AF_UNIX;
- sprintf(s->un_dest_addr.sun_path,"%s%d", path_dest, rrm_inst );
- msg("Dest %s\n",s->un_dest_addr.sun_path);
- s->s = socket_fd ;
- return socket_fd ;
-}
-/*!
-*******************************************************************************
-\brief This function closes a RRM socket
-\return none
-*/
-void close_socket(
- sock_rrm_t *sock ///< the socket handle
-) {
- shutdown(sock->s, SHUT_RDWR);
- close(sock->s);
-}
-
-/*!
-*******************************************************************************
-\brief This function send a buffer message to the unix socket
-\return if OK then "0" is returned else "-1"
-*/
-char BUFF[2048];
-int send_msg_sock(
- sock_rrm_t *s, ///< socket descriptor
- msg_t *smsg ///< the message to send
-) {
- /* Unix socket */
- int ret = 0 ;
- // char *buf = NULL;
- struct msghdr msghd ;
- struct iovec iov;
- int taille = sizeof(msg_head_t) ;
-
- if ( smsg == NULL ) {
- return -1 ;
- }
-
- if ( smsg->data != NULL ) {
- taille += smsg->head.size ;
- }
-
- //buf = RRM_MALLOC(char, taille);
- //if (buf ==NULL)
- //return -1 ;
- memcpy( BUFF, &(smsg->head), sizeof(msg_head_t) ) ;
- memcpy( BUFF+sizeof(msg_head_t), smsg->data, smsg->head.size ) ;
- iov.iov_base = (void *)BUFF;
- iov.iov_len = taille ;
- msghd.msg_name = (void *)&(s->un_dest_addr);
- msghd.msg_namelen = sizeof(s->un_dest_addr);
- msghd.msg_iov = &iov;
- msghd.msg_iovlen = 1;
- msghd.msg_control = NULL ;
- msghd.msg_controllen = 0 ;
-
- if ( sendmsg(s->s, &msghd, 0) < 0 ) {
- ret = -1;
- msg("socket %d, dest %s\n",s->s,s->un_dest_addr.sun_path);
- perror("sendmsg:unix socket");
- }
-
- //RRM_FREE(buf) ;
- //RRM_FREE(msg->data) ;
- //RRM_FREE(msg) ;
- return ret ;
-}
-
-/*!
-*******************************************************************************
-\brief This function read a buffer from a unix socket
-\return the function returns a message pointer. If the pointeur is NULL, a error
- is happened.
-*/
-char *recv_msg(
- sock_rrm_t *s ///< socket descriptor
-) {
- /* Unix socket */
- char *buf = NULL;
- char *smsg = NULL;
- struct msghdr msghd ;
- struct iovec iov;
- int size_msg ;
- msg_head_t *head ;
- int ret ;
- int taille = SIZE_MAX_PAYLOAD ;
- buf = RRM_CALLOC( char,taille);
-
- if ( buf == NULL ) {
- return NULL ;
- }
-
- iov.iov_base = (void *)buf;
- iov.iov_len = taille ;
- msghd.msg_name = (void *)&(s->un_dest_addr);
- msghd.msg_namelen = sizeof(s->un_dest_addr);
- msghd.msg_iov = &iov;
- msghd.msg_iovlen = 1;
- msghd.msg_control = NULL ;
- msghd.msg_controllen= 0 ;
- ret = recvmsg(s->s, &msghd, 0 ) ;
-
- if ( ret <= 0 ) {
- // non-blocking socket
- // perror("PB recvmsg_un");
- RRM_FREE(buf);
- return NULL ;
- }
-
- if (msghd.msg_flags != 0 ) {
- fprintf(stderr,"error recvmsg_un: 0x%02x\n", msghd.msg_flags) ;
- RRM_FREE(buf);
- return NULL ;
- }
-
- head = (msg_head_t *) buf ;
- size_msg = sizeof(msg_head_t) + head->size ;
- smsg = RRM_CALLOC(char, size_msg ) ;
-
- if ( smsg != NULL ) {
- memcpy( smsg, buf, size_msg ) ;
- }
-
- RRM_FREE( buf ) ;
- return smsg ;
-}
-
-#else //XFACE
-
-int send_msg_fifo(int *s, msg_t *fmsg) {
- int ret = 0, ret1;
- int taille = sizeof(msg_head_t) ;
- msg("write on fifos %d, msg %p\n",*s,fmsg);
-
- if ( fmsg == NULL ) {
- return -1 ;
- }
-
- // envoi le header
- ret1 = rtf_put (*s,(char *) &(fmsg->head), taille);
-
- if(ret1 <0) {
- msg("rtf_put H ERR %d\n",ret1);
- rtf_reset(*s);
- return ret1;
- }
-
- ret=ret1;
-
- // envoi les datas si elles sont definis
- if ( fmsg->data != NULL ) {
- ret1 += rtf_put (*s,(char *) fmsg->data, fmsg->head.size);
-
- if(ret1 <0) {
- msg("rtf_put D ERR %d\n",ret1);
- rtf_reset(*s);
- return ret1;
- }
- }
-
- ret+=ret1;
- return ret;
-}
-
-#endif //XFACE
-
-int send_msg(void *s, msg_t *smsg) {
- send_msg_sock((sock_rrm_t *)s, smsg);
-}
diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c
index 9936fa1c2a..53185c8959 100755
--- a/openair2/RRC/NR/MESSAGES/asn1_msg.c
+++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c
@@ -133,18 +133,6 @@
#include "common/ran_context.h"
-//#include "PHY/defs.h"
-/*#ifndef USER_MODE
-#define msg printk
-#ifndef errno
-int errno;
-#endif
-#else
-# if !defined (msg)
-# define msg printf
-# endif
-#endif*/
-
//#define XER_PRINT
typedef struct xer_sprint_string_s {
diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c
index 31165d8195..8dcf0caafa 100755
--- a/openair2/RRC/NR/rrc_gNB.c
+++ b/openair2/RRC/NR/rrc_gNB.c
@@ -825,7 +825,7 @@ rrc_gNB_generate_defaultRRCReconfiguration(
DRB_config->pdcp_Config->moreThanOneRLC = NULL;
DRB_config->pdcp_Config->t_Reordering = calloc(1, sizeof(*DRB_config->pdcp_Config->t_Reordering));
- *DRB_config->pdcp_Config->t_Reordering = NR_PDCP_Config__t_Reordering_ms0;
+ *DRB_config->pdcp_Config->t_Reordering = NR_PDCP_Config__t_Reordering_ms100;
DRB_config->pdcp_Config->ext1 = NULL;
ASN_SEQUENCE_ADD(&(*DRB_configList)->list, DRB_config);
@@ -4167,57 +4167,6 @@ void *rrc_gnb_task(void *args_p) {
case GTPV1U_GNB_DELETE_TUNNEL_RESP:
break;
- /*
- #if defined(ENABLE_USE_MME)
-
- // Messages from S1AP
- case S1AP_DOWNLINK_NAS:
- rrc_eNB_process_S1AP_DOWNLINK_NAS(msg_p, msg_name_p, instance, &rrc_gNB_mui);
- break;
-
- case S1AP_INITIAL_CONTEXT_SETUP_REQ:
- rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(msg_p, msg_name_p, instance);
- break;
-
- case S1AP_UE_CTXT_MODIFICATION_REQ:
- rrc_eNB_process_S1AP_UE_CTXT_MODIFICATION_REQ(msg_p, msg_name_p, instance);
- break;
-
- case S1AP_PAGING_IND:
- LOG_D(RRC, "[eNB %d] Received Paging message from S1AP: %s\n", instance, msg_name_p);
- rrc_eNB_process_PAGING_IND(msg_p, msg_name_p, instance);
- break;
-
- case S1AP_E_RAB_SETUP_REQ:
- rrc_eNB_process_S1AP_E_RAB_SETUP_REQ(msg_p, msg_name_p, instance);
- LOG_D(RRC, "[eNB %d] Received the message %s\n", instance, msg_name_p);
- break;
-
- case S1AP_E_RAB_MODIFY_REQ:
- rrc_eNB_process_S1AP_E_RAB_MODIFY_REQ(msg_p, msg_name_p, instance);
- break;
-
- case S1AP_E_RAB_RELEASE_COMMAND:
- rrc_eNB_process_S1AP_E_RAB_RELEASE_COMMAND(msg_p, msg_name_p, instance);
- break;
-
- case S1AP_UE_CONTEXT_RELEASE_REQ:
- rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_REQ(msg_p, msg_name_p, instance);
- break;
-
- case S1AP_UE_CONTEXT_RELEASE_COMMAND:
- rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND(msg_p, msg_name_p, instance);
- break;
-
- case GTPV1U_ENB_DELETE_TUNNEL_RESP:
- ///Nothing to do. Apparently everything is done in S1AP processing
- //LOG_I(RRC, "[eNB %d] Received message %s, not processed because procedure not synched\n",
- //instance, msg_name_p);
- AssertFatal(false, "Removed double mechanism for same feature: now delete_tunnel() function should be called\n");
- break;
-
- #endif
- */
/* Messages from gNB app */
case NRRRC_CONFIGURATION_REQ:
LOG_I(NR_RRC, "[gNB %ld] Received %s : %p\n", instance, msg_name_p,&NRRRC_CONFIGURATION_REQ(msg_p));
diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c
index 46954b5734..7987b5a363 100644
--- a/openair2/RRC/NR/rrc_gNB_NGAP.c
+++ b/openair2/RRC/NR/rrc_gNB_NGAP.c
@@ -309,7 +309,6 @@ nr_rrc_pdcp_config_security(
uint8_t *k_kdf = NULL;
static int print_keys= 1;
-
/* Derive the keys from kgnb */
if (SRB_configList != NULL) {
nr_derive_key_up_enc(ue_context_pP->ue_context.ciphering_algorithm,
diff --git a/openair2/RRC/NR_UE/rrc_list.h b/openair2/RRC/NR_UE/rrc_list.h
index 32a452e4a2..20a0adad56 100644
--- a/openair2/RRC/NR_UE/rrc_list.h
+++ b/openair2/RRC/NR_UE/rrc_list.h
@@ -111,4 +111,4 @@
#define RRC_LIST_ENTRY(list, i) \
list.entries[i]
-#endif
\ No newline at end of file
+#endif
diff --git a/openair2/SIMULATION/NR_RRC/itti_sim.c b/openair2/SIMULATION/NR_RRC/itti_sim.c
index 1c248b6b48..3b0d6e721b 100644
--- a/openair2/SIMULATION/NR_RRC/itti_sim.c
+++ b/openair2/SIMULATION/NR_RRC/itti_sim.c
@@ -60,10 +60,6 @@ unsigned short config_frames[4] = {2,9,11,13};
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
-#ifndef OPENAIR2
- #include "UTIL/OTG/otg_vars.h"
-#endif
-
#include "intertask_interface.h"
diff --git a/openair2/UTIL/OMG/makefile_old b/openair2/UTIL/OMG/makefile_old
deleted file mode 100644
index 7bc551cb03..0000000000
--- a/openair2/UTIL/OMG/makefile_old
+++ /dev/null
@@ -1,123 +0,0 @@
-include $(OPENAIR_TARGETS)/Makefile.common
-ifdef TEST_OMG
-
-CC= gcc
-
-OBJstatic = OMG.c common.c static.c
-OBJrwp = OMG.c common.c job.c rwp.c
-OBJrwalk = OMG.c common.c job.c rwalk.c
-OBJtrace = OMG.c common.c job.c trace.c mobility_parser.c hashtable.c
-OBJsumo = OMG.c common.c sumo.c client_traci_OMG.c socket_traci_OMG.c storage_traci_OMG.c id_manager.c
-
-OBJ = OMG.c common.c static.c job.c rwp.c rwalk.c trace.c sumo.c mobility_parser.c hashtable.c client_traci_OMG.c socket_traci_OMG.c storage_traci_OMG.c id_manager.c
-
-CFLAGS += -m32 -DTEST_OMG
-
-.PHONY: help staticOMG rwpOMG clean
-
-help:
- @echo ' "make staticOMG" to compile the STATIC version'
- @echo ' "make rwpOMG" to compile the RWP version'
- @echo ' "make rwalkOMG" to compile the RWALK version'
- @echo ' "make traceOMG" to compile the TRACE version'
- @echo ' "make sumoOMG" to compile the SUMO version'
- @echo ' "make clean" to remove the generated files and restore the original distribution'
- @echo ' "make OMG" to compile the complete version'
-
-
-staticOMG: ${OBJstatic}
- ${CC} ${OBJstatic} -o staticOMG $(CFLAGS)
-
-
-rwpOMG: ${OBJrwp}
- ${CC} ${OBJrwp} -lm -o rwpOMG $(CFLAGS)
- @#-lm: used to link to math lib
-
-traceOMG:${OBJtrace}
- ${CC} ${OBJtrace} -lm -o traceOMG $(CFLAGS)
-
-rwalkOMG: ${OBJrwalk}
- ${CC} ${OBJrwalk} -lm -o rwalkOMG $(CFLAGS)
-
-sumoOMG: ${OBJsumo}
- ${CC} ${OBJsumo} -lm -o rwalkOMG $(CFLAGS)
-
-OMG: ${OBJ}
- ${CC} ${OBJ} -lm -o OMG $(CFLAGS)
-
-clean:
- @echo "Cleaning"
- @rm OMG
- @#rm rwpOMG
- @#rm rwalkOMG
- @#rm traceOMG
- @#rm staticOMG
- @#rm OMG
-
-else
-
-TOP_DIR = ../..
-OPENAIR1_TOP = ../..
-OPENAIR2_TOP = ../../../openair2
-OPENAIR3_TOP = ../../../openair3
-OPENAIR3 = $(OPENAIR3_DIR)
-
-CFLAGS += -DPHYSIM -DNODE_RG -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TX=2 -DMAX_MODULES=1 -I/usr/include/X11 #-Wno-packed-bitfield-compat
-
-
-CFLAGS += -DOPENAIR_LTE -DOPENAIR2 #-DOFDMA_ULSCH -DIFFT_FPGA -DIFFT_FPGA_UE
-
-#CFLAGS += -DXFORMS
-
-ifdef DEBUG_PHY
-CFLAGS += -DDEBUG_PHY
-endif
-
-ifdef PDCP_USE_NETLINK
-CFLAGS += -DPDCP_USE_NETLINK -DLINUX -DDEBUG_CONTROL
-endif
-
-include $(OPENAIR1_DIR)/PHY/Makefile.inc
-include $(OPENAIR1_DIR)/SCHED/Makefile.inc
-include $(OPENAIR2_DIR)/LAYER2/Makefile.inc
-include $(OPENAIR1_DIR)/SIMULATION/ETH_TRANSPORT/Makefile.inc
-
-SIMULATION_OBJS = $(TOP_DIR)/SIMULATION/TOOLS/gauss.o
-SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/random_channel.o
-SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/rangen_double.o
-SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/taus.o
-SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/multipath_channel.o
-SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/RF/rf.o
-SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/RF/adc.o
-SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/RF/dac.o
-
-OBJ = $(PHY_OBJS) $(SIMULATION_OBJS) $(ETHERNET_TRANSPORT_OBJS) $(TOOLS_OBJS) $(SCHED_OBJS) $(STATS_OBJS)
-
-all: physim
-
-
-$(OBJ) : %.o : %.c
- $(CC) -c $(CFLAGS) $(EXTRA_CFLAGS) -DPHY_CONTEXT=1 -I$(TOP_DIR) $(L2_incl) -o $@ $<
-
-$(L2_OBJS) : %.o : %.c
- $(CC) -c $(CFLAGS) $(EXTRA_CFLAGS) -DMAC_CONTEXT=1 -DPHY_CONTEXT=1 -I$(TOP_DIR) $(L2_incl) -o $@ $<
-
-physim : $(OBJ) $(L2_OBJS) OMG.c common.c static.c job.c rwp.c rwalk.c hashtable.c mobility_parser.c trace.c -I$(TOP_DIR) $(L2_incl) -o physim $(CFLAGS) $(EXTRA_CFLAGS) $(OBJ) $(L2_OBJS) -lm -lforms -L/usr/local/lib -lforms -lX11 -L/usr/X11R6/lib -lXpm -lblas -lpthread
-
-clean:
- rm -f physim
- rm -f $(OBJ)
- rm -f $(L2_OBJS)
- rm -f *.o
- rm -f *.exe*
-
-cleanl1:
- rm -f physim
- rm -f $(OBJ)
- rm -f *.o
- rm -f *.exe
-cleanl2:
- rm -f $(L2_OBJS)
-
-endif
-
diff --git a/openair2/UTIL/OPT/probe.c b/openair2/UTIL/OPT/probe.c
index e64f7724c6..8731eb294a 100644
--- a/openair2/UTIL/OPT/probe.c
+++ b/openair2/UTIL/OPT/probe.c
@@ -408,7 +408,7 @@ static void SendFrameNR(guint8 radioType, guint8 direction, guint8 rntiType,
guint8 isPredefinedData, guint8 retx, guint8 crcStatus,
guint8 oob_event, guint8 oob_event_value,
uint8_t *pdu_buffer, unsigned int pdu_buffer_size) {
- unsigned char frameBuffer[9000];
+ unsigned char frameBuffer[12000];
unsigned int frameOffset;
ssize_t bytesSent;
frameOffset = 0;
diff --git a/openair2/UTIL/OTG/otg_kpi.c b/openair2/UTIL/OTG/otg_kpi.c
index ac2fff89fe..c55aecf239 100644
--- a/openair2/UTIL/OTG/otg_kpi.c
+++ b/openair2/UTIL/OTG/otg_kpi.c
@@ -37,8 +37,8 @@ unsigned int start_log_GP=0;
unsigned int start_log_GP_bg=0;
unsigned int start_log_jitter=0;
-#include"otg_kpi.h"
-#include"otg_externs.h"
+#include "otg_kpi.h"
+#include "otg_externs.h"
extern unsigned char NB_eNB_INST;
extern uint16_t NB_UE_INST;
diff --git a/openair2/UTIL/OTG/otg_rx_socket.h b/openair2/UTIL/OTG/otg_rx_socket.h
index e7062aaf58..b0c6d1b364 100644
--- a/openair2/UTIL/OTG/otg_rx_socket.h
+++ b/openair2/UTIL/OTG/otg_rx_socket.h
@@ -32,7 +32,7 @@
#ifndef __OTG_RX_SOCKET_H__
#define __OTG_RX_SOCKET_H__
-#include"otg.h"
+#include "otg.h"
//-----------------------begin func proto-------------------
diff --git a/openair2/UTIL/OTG/otg_tx_socket.c b/openair2/UTIL/OTG/otg_tx_socket.c
index 073b9b6ddd..070e44f361 100644
--- a/openair2/UTIL/OTG/otg_tx_socket.c
+++ b/openair2/UTIL/OTG/otg_tx_socket.c
@@ -30,7 +30,7 @@
* \warning
*/
-#include"otg_tx_socket.h"
+#include "otg_tx_socket.h"
#include "otg_vars.h"
diff --git a/openair2/UTIL/OTG/otg_tx_socket.h b/openair2/UTIL/OTG/otg_tx_socket.h
index 17568244fa..1d2345c242 100644
--- a/openair2/UTIL/OTG/otg_tx_socket.h
+++ b/openair2/UTIL/OTG/otg_tx_socket.h
@@ -37,8 +37,8 @@
#include
#include
#include
-#include"otg.h"
-#include"otg_tx.h"
+#include "otg.h"
+#include "otg_tx.h"
//-----------------------begin func proto-------------------
diff --git a/openair3/GTPV1-U/gtpv1u_eNB_defs.h b/openair3/GTPV1-U/gtpv1u_eNB_defs.h
index 79d9a1dcdd..fb317e4ca6 100644
--- a/openair3/GTPV1-U/gtpv1u_eNB_defs.h
+++ b/openair3/GTPV1-U/gtpv1u_eNB_defs.h
@@ -111,14 +111,6 @@ typedef struct gtpv1u_data_s {
uint16_t seq_num;
uint8_t restart_counter;
-#ifdef GTPU_IN_KERNEL
- char *interface_name;
- int interface_index;
-
- struct iovec *malloc_ring;
- void *sock_mmap_ring[16];
- int sock_desc[16]; // indexed by marking
-#endif
} gtpv1u_data_t;
int
diff --git a/openair3/GTPV1-U/gtpv1u_gNB_defs.h b/openair3/GTPV1-U/gtpv1u_gNB_defs.h
index ddc8b4445e..d4356aa3cf 100644
--- a/openair3/GTPV1-U/gtpv1u_gNB_defs.h
+++ b/openair3/GTPV1-U/gtpv1u_gNB_defs.h
@@ -102,14 +102,6 @@ typedef struct nr_gtpv1u_data_s {
uint16_t seq_num;
uint8_t restart_counter;
-#ifdef GTPU_IN_KERNEL
- char *interface_name;
- int interface_index;
-
- struct iovec *malloc_ring;
- void *sock_mmap_ring[16];
- int sock_desc[16]; // indexed by marking
-#endif
} nr_gtpv1u_data_t;
diff --git a/openair3/NAS/NR_UE/nr_nas_msg_sim.h b/openair3/NAS/NR_UE/nr_nas_msg_sim.h
index 9655f87130..abdc5b2e75 100644
--- a/openair3/NAS/NR_UE/nr_nas_msg_sim.h
+++ b/openair3/NAS/NR_UE/nr_nas_msg_sim.h
@@ -80,7 +80,6 @@ typedef struct {
uint8_t kgnb[32];
} ue_sa_security_key_t;
-
typedef enum fgs_protocol_discriminator_e {
/* Protocol discriminator identifier for 5GS Mobility Management */
FGS_MOBILITY_MANAGEMENT_MESSAGE = 0x7E,
diff --git a/targets/ARCH/COMMON/common_lib.h b/targets/ARCH/COMMON/common_lib.h
index 7b934822ea..0c71a9999a 100644
--- a/targets/ARCH/COMMON/common_lib.h
+++ b/targets/ARCH/COMMON/common_lib.h
@@ -57,9 +57,7 @@
#define RAU_REMOTE_THIRDPARTY_RADIO_HEAD 2
#define MAX_WRITE_THREAD_PACKAGE 10
#define MAX_WRITE_THREAD_BUFFER_SIZE 8
-#ifndef MAX_CARDS
- #define MAX_CARDS 8
-#endif
+#define MAX_CARDS 8
typedef int64_t openair0_timestamp;
typedef volatile int64_t openair0_vtimestamp;
diff --git a/targets/COMMON/create_tasks.c b/targets/COMMON/create_tasks.c
index d302b418c5..8b9631dca3 100644
--- a/targets/COMMON/create_tasks.c
+++ b/targets/COMMON/create_tasks.c
@@ -25,7 +25,6 @@
# include "targets/RT/USER/lte-softmodem.h"
# include "common/ran_context.h"
-#ifdef OPENAIR2
#include "sctp_eNB_task.h"
#include "x2ap_eNB.h"
#include "s1ap_eNB.h"
@@ -36,7 +35,6 @@
#include "lteRALenb.h"
#endif
#include "RRC/LTE/rrc_defs.h"
-#endif
# include "f1ap_cu_task.h"
# include "f1ap_du_task.h"
# include "enb_app.h"
diff --git a/targets/COMMON/create_tasks_mbms.c b/targets/COMMON/create_tasks_mbms.c
index 579e851ea7..8b1736853f 100644
--- a/targets/COMMON/create_tasks_mbms.c
+++ b/targets/COMMON/create_tasks_mbms.c
@@ -25,7 +25,6 @@
# include "targets/RT/USER/lte-softmodem.h"
# include "common/ran_context.h"
-#ifdef OPENAIR2
#include "sctp_eNB_task.h"
#include "x2ap_eNB.h"
#include "s1ap_eNB.h"
@@ -40,7 +39,6 @@
#include "lteRALenb.h"
#endif
#include "RRC/LTE/rrc_defs.h"
-#endif
# include "f1ap_cu_task.h"
# include "f1ap_du_task.h"
# include "enb_app.h"
diff --git a/targets/COMMON/create_tasks_ue.c b/targets/COMMON/create_tasks_ue.c
index 06f36641e7..3b9b7cf7bb 100644
--- a/targets/COMMON/create_tasks_ue.c
+++ b/targets/COMMON/create_tasks_ue.c
@@ -23,7 +23,6 @@
# include "create_tasks.h"
# include "common/utils/LOG/log.h"
-#ifdef OPENAIR2
#include "sctp_eNB_task.h"
#include "s1ap_eNB.h"
#include "openair3/NAS/UE/nas_ue_task.h"
@@ -34,7 +33,6 @@
#include "lteRALenb.h"
#endif
#include "RRC/LTE/rrc_defs.h"
-#endif
# include "enb_app.h"
int create_tasks_ue(uint32_t ue_nb) {
diff --git a/targets/Makefile.common b/targets/Makefile.common
deleted file mode 100644
index ecd5f3821a..0000000000
--- a/targets/Makefile.common
+++ /dev/null
@@ -1,248 +0,0 @@
-# This file gathers compilation directive shared between lte-softmodem and oaisim
-export COMMON_UTILS_DIR = $(OPENAIR_DIR)/common/utils
-export UE_NAS_DIR = $(OPENAIR_DIR)/openair3/NAS
-export S1AP_DIR = $(OPENAIR_DIR)/openair3/S1AP
-export X2AP_DIR = $(OPENAIR_DIR)/openair2/X2AP
-export SCTP_DIR = $(OPENAIR_DIR)/openair3/SCTP
-export UDP_DIR = $(OPENAIR_DIR)/openair3/UDP
-export GTPV1U_DIR = $(OPENAIR_DIR)/openair3/GTPV1-U
-export SECU_DIR = $(OPENAIR_DIR)/openair3/SECU
-
-UE_NAS_OBJ_DIR = $(subst $(OPENAIR_DIR),$(OBJS_DIR),$(UE_NAS_DIR))
-SECU_OBJ_DIR = $(subst $(OPENAIR_DIR),$(OBJS_DIR),$(SECU_DIR))
-S1AP_OBJ_DIR = $(subst $(OPENAIR_DIR),$(OBJS_DIR),$(S1AP_DIR))
-X2AP_OBJ_DIR = $(subst $(OPENAIR_DIR),$(OBJS_DIR),$(X2AP_DIR))
-SCTP_OBJ_DIR = $(subst $(OPENAIR_DIR),$(OBJS_DIR),$(SCTP_DIR))
-UDP_OBJ_DIR = $(subst $(OPENAIR_DIR),$(OBJS_DIR),$(UDP_DIR))
-GTPV1U_OBJ_DIR = $(subst $(OPENAIR_DIR),$(OBJS_DIR),$(GTPV1U_DIR))
-
-#Export common cflags (between softmodem and oaisim)
-COMMON_CFLAGS = \
- -D'FIRMWARE_VERSION="$(SVN_REV) - $(DATE_REV)"' \
- -Wall \
- -fno-strict-aliasing \
- -O2 \
- -Werror=implicit-function-declaration
-
-# the code already uses C99 integer type (like int32_t)
-# switch on full support for C99 + GNU extensions
-CFLAGS += -std=gnu99
-
-ITTI_MESSAGES_H = messages_xml.h
-ITTI_MESSAGES_XML = messages.xml
-ITTI_MESSAGES_FILE = $(ITTI_DIR)/intertask_interface_types.h
-
-include $(COMMON_UTILS_DIR)/Makefile.inc
-include $(OPENAIR_TARGETS)/COMMON/Makefile.inc
-include $(OPENAIR2_DIR)/NAS/Makefile.inc
-
-ifeq ($(SECU), 1)
-ifeq ($(NETTLE_FOUND), 0)
-@(warning "Nettle library >= 2.5 is not installed on your system, nettle-dev lib needed, continuing with security disabled")
-SECU=0
-else
-ifeq ($(OPENSSL_FOUND), 0)
-@(warning "openssl library is not installed on your system, openssl lib needed, continuing with security disabled")
-SECU=0
-else
-LIBS += $(OPENSSL_LIBS) $(NETTLE_LIBS)
-endif
-endif
-endif
-
-CFLAGS += -DJUMBO_FRAME
-
-ifdef MAX_NUM_CCs
-CFLAGS += -DMAX_NUM_CCs=$(MAX_NUM_CCs)
-COMMON_CFLAGS += -DMAX_NUM_CCs=$(MAX_NUM_CCs)
-else
-CFLAGS += -DMAX_NUM_CCs=1
-COMMON_CFLAGS += -DMAX_NUM_CCs=1
-endif
-
-ifeq ($(ENABLE_RAL), 1)
-CFLAGS += -DENABLE_RAL
-endif
-
-ifeq ($(PDCP_USE_NETLINK),1)
-CFLAGS += -DPDCP_USE_NETLINK
-endif
-ifeq ($(LIBCONFIG_LONG),1)
-CFLAGS += -DLIBCONFIG_LONG
-endif
-
-# add R9
-ifeq ($(USE_MME), R10)
-COMMON_CFLAGS += -DENABLE_USE_MME
-ENABLE_ITTI = 1
-ifeq ($(LINK_ENB_PDCP_TO_GTPV1U), 1)
- COMMON_CFLAGS += -DLINK_ENB_PDCP_TO_GTPV1U
-# COMMON_CFLAGS += -I$(UDP_DIR)
-# COMMON_CFLAGS += -I$(GTPV1U_DIR)
-# COMMON_CFLAGS += -I$(GTPV1U_DIR)/nw-gtpv1u/shared
-endif
-endif
-
-ifeq ($(ENABLE_ITTI),1)
-COMMON_CFLAGS += -DENABLE_ITTI
-COMMON_CFLAGS += -I$(OPENAIR1_DIR)
-COMMON_CFLAGS += -I$(OPENAIR2_DIR)/NAS
-COMMON_CFLAGS += $(L2_incl)
-COMMON_CFLAGS += $(UTILS_incl)
-SHARED_DEPENDENCIES += $(ITTI_MESSAGES_H)
-endif
-
-ifeq ($(USE_MME), R10)
-LIBS += $(UE_NAS_OBJ_DIR)/libuenas.a $(SECU_OBJ_DIR)/libsecu.a
-LIBS += $(S1AP_OBJ_DIR)/libs1ap.a $(SCTP_OBJ_DIR)/libsctp.a -lsctp -lcrypt
-LIBS += $(UDP_OBJ_DIR)/libudp.a $(GTPV1U_OBJ_DIR)/libgtpv1u.a
-
-ifdef X2AP
-LIBS += $(X2AP_OBJ_DIR)/libx2ap.a
-SHARED_DEPENDENCIES += $(UE_NAS_OBJ_DIR)/libuenas.a $(SECU_OBJ_DIR)/libsecu.a $(X2AP_OBJ_DIR)/libx2ap.a $(S1AP_OBJ_DIR)/libs1ap.a $(SCTP_OBJ_DIR)/libsctp.a $(UDP_OBJ_DIR)/libudp.a $(GTPV1U_OBJ_DIR)/libgtpv1u.a
-else
-SHARED_DEPENDENCIES += $(UE_NAS_OBJ_DIR)/libuenas.a $(SECU_OBJ_DIR)/libsecu.a $(S1AP_OBJ_DIR)/libs1ap.a $(SCTP_OBJ_DIR)/libsctp.a $(UDP_OBJ_DIR)/libudp.a $(GTPV1U_OBJ_DIR)/libgtpv1u.a
-endif
-
-COMMON_CFLAGS += -DLOG_NO_THREAD
-#-DEMIT_ASN_DEBUG
-
-openair_cn_available := $(shell if [ -d "$(UE_NAS_DIR)" ]; then echo "0" ; else echo "1" ; fi )
-ifeq ($(openair_cn_available), 0)
-COMMON_CFLAGS += -DENABLE_NAS_UE_LOGGING
-COMMON_CFLAGS += -I$(OPENAIR_DIR)/openair3/NAS/EURECOM-NAS/src/api/network
-COMMON_CFLAGS += -I$(OPENAIR_DIR)/openair3/NAS/EURECOM-NAS/src/include
-COMMON_CFLAGS += -I$(OPENAIR_DIR)/openair3/NAS/EURECOM-NAS/src/ies
-COMMON_CFLAGS += -I$(OPENAIR_DIR)/openair3/NAS/EURECOM-NAS/src/emm/msg
-COMMON_CFLAGS += -I$(OPENAIR_DIR)/openair3/NAS/EURECOM-NAS/src/esm/msg
-COMMON_CFLAGS += -I$(OPENAIR_DIR)/openair3/NAS/EURECOM-NAS/src/util
-endif
-
-UENAS_CFLAGS = $(COMMON_CFLAGS)
-UENAS_CFLAGS += -I$(SECU_DIR)
-export UENAS_CFLAGS
-
-SECU_CFLAGS = $(COMMON_CFLAGS)
-SECU_CFLAGS += -I$(OPENAIR_DIR)/openair3/COMMON
-SECU_CFLAGS += -I$(OPENAIR_DIR)/openair3/UTILS
-SECU_CFLAGS += -I$(SECU_DIR)
-export SECU_CFLAGS
-
-COMMON_MME_CFLAGS = -I$(SECU_DIR)
-COMMON_MME_CFLAGS += -I$(SCTP_DIR)
-COMMON_MME_CFLAGS += -I$(X2AP_DIR)
-COMMON_MME_CFLAGS += -I$(S1AP_DIR)
-COMMON_MME_CFLAGS += -I$(UDP_DIR)
-COMMON_MME_CFLAGS += -I$(GTPV1U_DIR)
-
-S1AP_CFLAGS = $(COMMON_CFLAGS) $(COMMON_MME_CFLAGS)
-S1AP_CFLAGS += -DENB_MODE
-S1AP_CFLAGS += -I$(TOP_DIR)
-S1AP_CFLAGS += $(UTIL_incl)
-export S1AP_CFLAGS
-
-X2AP_CFLAGS = $(COMMON_CFLAGS)
-X2AP_CFLAGS += -DENB_MODE
-X2AP_CFLAGS += -I$(TOP_DIR)
-X2AP_CFLAGS += $(UTIL_incl)
-export X2AP_CFLAGS
-
-UDP_CFLAGS = $(COMMON_CFLAGS) $(COMMON_MME_CFLAGS)
-UDP_CFLAGS += -DENB_MODE
-UDP_CFLAGS += -I$(TOP_DIR)
-UDP_CFLAGS += $(UTIL_incl)
-UDP_CFLAGS += -I$(OPENAIR_DIR)/openair2/ENB_APP
-export UDP_CFLAGS
-
-GTPV1U_CFLAGS = $(COMMON_CFLAGS) $(COMMON_MME_CFLAGS)
-GTPV1U_CFLAGS += -DENB_MODE
-GTPV1U_CFLAGS += -I$(TOP_DIR)
-GTPV1U_CFLAGS += -I$(GTPV1U_DIR)/nw-gtpv1u/include
-GTPV1U_CFLAGS += -I$(GTPV1U_DIR)/nw-gtpv1u/shared
-GTPV1U_CFLAGS += -I$(OPENAIR_DIR)/openair2/ENB_APP
-GTPV1U_CFLAGS += $(UTIL_incl) -I$(OPENAIR3_DIR)/UTILS
-export GTPV1U_CFLAGS
-
-GTPV1U_ENB_CFLAGS = $(COMMON_CFLAGS)
-GTPV1U_ENB_CFLAGS += $(OPENAIR_DIR)/openair2/COMMON
-GTPV1U_ENB_CFLAGS += -I$(X2AP_DIR)
-GTPV1U_ENB_CFLAGS += -I$(S1AP_DIR)
-GTPV1U_ENB_CFLAGS += -I$(UDP_DIR)
-GTPV1U_ENB_CFLAGS += -I$(GTPV1U_DIR)
-GTPV1U_ENB_CFLAGS += -DENB_MODE
-GTPV1U_ENB_CFLAGS += -I$(TOP_DIR)
-GTPV1U_ENB_CFLAGS += -I$(GTPV1U_DIR)/nw-gtpv1u/include
-GTPV1U_ENB_CFLAGS += -I$(GTPV1U_DIR)/nw-gtpv1u/shared
-GTPV1U_ENB_CFLAGS += -I$(OPENAIR_DIR)/openair2/ENB_APP
-GTPV1U_ENB_CFLAGS += $(UTIL_incl) -I$(OPENAIR3_DIR)/UTILS
-export GTPV1U_ENB_CFLAGS
-
-
-$(UE_NAS_OBJ_DIR)/libuenas.a: force_look
- @$(MAKE) -C $(UE_NAS_DIR) -f Makefile.UE $(UE_NAS_OBJ_DIR)/libuenas.a OUTDIR=$(UE_NAS_OBJ_DIR)
-$(SECU_OBJ_DIR)/libsecu.a: force_look
- @$(MAKE) -C $(SECU_DIR) -f Makefile.eNB $(SECU_OBJ_DIR)/libsecu.a OUTDIR=$(SECU_OBJ_DIR)
-$(X2AP_OBJ_DIR)/libx2ap.a: force_look
- @$(MAKE) -C $(X2AP_DIR) -f Makefile.inc $(X2AP_OBJ_DIR)/libx2ap.a OUTDIR=$(X2AP_OBJ_DIR)
-$(S1AP_OBJ_DIR)/libs1ap.a: force_look
- @$(MAKE) -C $(S1AP_DIR) -f Makefile.eNB $(S1AP_OBJ_DIR)/libs1ap.a OUTDIR=$(S1AP_OBJ_DIR)
-$(SCTP_OBJ_DIR)/libsctp.a: force_look
- @$(MAKE) -C $(SCTP_DIR) -f Makefile.eNB $(SCTP_OBJ_DIR)/libsctp.a OUTDIR=$(SCTP_OBJ_DIR)
-$(UDP_OBJ_DIR)/libudp.a: force_look
- @$(MAKE) -C $(UDP_DIR) -f Makefile.eNB $(UDP_OBJ_DIR)/libudp.a OUTDIR=$(UDP_OBJ_DIR)
-$(GTPV1U_OBJ_DIR)/libgtpv1u.a: force_look
- @$(MAKE) -C $(GTPV1U_DIR) -f Makefile.eNB $(GTPV1U_OBJ_DIR)/libgtpv1u.a OUTDIR=$(GTPV1U_OBJ_DIR)
-
-OBJ = $(NAS_UE_OBJS) $(SECU_OBJS)
-endif
-
-export COMMON_CFLAGS
-
-ifeq ($(ENABLE_ITTI),1)
-CFLAGS += $(COMMON_CFLAGS) $(COMMON_MME_CFLAGS) $(TARGETS_COMMON_incl)
-OBJ += $(TARGETS_COMMON_OBJS)
-
-gccxml_available = $(shell if [ `gccxml --version | grep GCC-XML -c` = "0" ]; then echo "0" ; else echo "1" ; fi )
-ifeq ($(gccxml_available), 0)
-$(error gccxml is missing, please install)
-endif
-CFLAGS += -I$(OPENAIR2_DIR)/COMMON -DENABLE_ITTI $(UTILS_incl)
-endif
-
-$(ITTI_MESSAGES_XML): $(ITTI_MESSAGES_FILE)
- @echo "Generating messages.xml ..."
- @gccxml $(COMMON_CFLAGS) $< -fxml=$@ -I$(ITTI_DIR)
- @$(CC) -MM $(COMMON_CFLAGS) $< > $(basename $@).d
- @mv -f $(basename $@).d $(basename $@).d.tmp
- @sed -e 's|.*:|$@:|' < $(basename $@).d.tmp > $(basename $@).d
- @sed -e 's/.*://' -e 's/\\$$//' < $(basename $@).d.tmp | fmt -1 | \
- sed -e 's/^ *//' -e 's/$$/:/' >> $(basename $@).d
- @rm -f $(basename $@).d.tmp
-
-$(ITTI_MESSAGES_H): $(ITTI_MESSAGES_XML)
- @echo "Generating messages_xml.h ..."
- @sed -e 's/[ ]*//' -e 's/"/\\"/g' -e 's/^/"/' -e 's/$$/\\n"/' $< > $@
-
-force_look:
- @true
-
-common-clean:
- @$(RM_F_V) $(ITTI_MESSAGES_H) $(ITTI_MESSAGES_XML) $(ITTI_MESSAGES_XML:.xml=.d)
- @$(MAKE) -C $(LFDS_DIR) -f makefile.linux clean OUTDIR=$(LFDS_OBJ_DIR)
- @if [ -d $(UE_NAS_OBJ_DIR) ]; then $(MAKE) -C $(UE_NAS_DIR) -f Makefile.UE clean OUTDIR=$(UE_NAS_OBJ_DIR); fi
- @if [ -d $(SECU_OBJ_DIR) ]; then $(MAKE) -C $(SECU_DIR) -f Makefile.eNB clean OUTDIR=$(SECU_OBJ_DIR); fi
- @if [ -d $(X2AP_OBJ_DIR) ]; then $(MAKE) -C $(X2AP_DIR) -f Makefile.inc clean OUTDIR=$(X2AP_OBJ_DIR); fi
- @if [ -d $(S1AP_OBJ_DIR) ]; then $(MAKE) -C $(S1AP_DIR) -f Makefile.eNB clean OUTDIR=$(S1AP_OBJ_DIR); fi
- @if [ -d $(SCTP_OBJ_DIR) ]; then $(MAKE) -C $(SCTP_DIR) -f Makefile.eNB clean OUTDIR=$(SCTP_OBJ_DIR); fi
- @if [ -d $(UDP_OBJ_DIR) ]; then $(MAKE) -C $(UDP_DIR) -f Makefile.eNB clean OUTDIR=$(UDP_OBJ_DIR); fi
- @if [ -d $(GTPV1U_OBJ_DIR) ]; then $(MAKE) -C $(GTPV1U_DIR) -f Makefile.eNB clean OUTDIR=$(GTPV1U_OBJ_DIR); fi
-
-common-cleanall:
- @if [ -d $(UE_NAS_OBJ_DIR) ]; then $(MAKE) -C $(UE_NAS_DIR) -f Makefile.UE cleanall OUTDIR=$(UE_NAS_OBJ_DIR); fi
- @if [ -d $(SECU_OBJ_DIR) ]; then $(MAKE) -C $(SECU_DIR) -f Makefile.eNB cleanall OUTDIR=$(SECU_OBJ_DIR); fi
- @if [ -d $(X2AP_OBJ_DIR) ]; then $(MAKE) -C $(X2AP_DIR) -f Makefile.inc cleanall OUTDIR=$(X2AP_OBJ_DIR); fi
- @if [ -d $(S1AP_OBJ_DIR) ]; then $(MAKE) -C $(S1AP_DIR) -f Makefile.eNB cleanall OUTDIR=$(S1AP_OBJ_DIR); fi
- @if [ -d $(SCTP_OBJ_DIR) ]; then $(MAKE) -C $(SCTP_DIR) -f Makefile.eNB cleanall OUTDIR=$(SCTP_OBJ_DIR); fi
- @if [ -d $(UDP_OBJ_DIR) ]; then $(MAKE) -C $(UDP_DIR) -f Makefile.eNB cleanall OUTDIR=$(UDP_OBJ_DIR); fi
- @if [ -d $(GTPV1U_OBJ_DIR) ]; then $(MAKE) -C $(GTPV1U_DIR) -f Makefile.eNB cleanall OUTDIR=$(GTPV1U_OBJ_DIR); fi
-
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf
index 62b89188f9..5f9cc0fbf1 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf
@@ -1,4 +1,4 @@
-Active_gNBs = ( "gNB-Eurecom-5GNRBox");
+Active_gNBs = ( "gNB-OAI");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
@@ -7,7 +7,7 @@ gNBs =
{
////////// Identification parameters:
gNB_ID = 0xe00;
- gNB_name = "gNB-Eurecom-5GNRBox";
+ gNB_name = "gNB-OAI";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1;
@@ -204,7 +204,7 @@ gNBs =
};
- ////////// MME parameters:
+ ////////// AMF parameters:
amf_ip_address = ( { ipv4 = "192.168.70.132";
ipv6 = "192:168:30::17";
active = "yes";
@@ -226,59 +226,61 @@ gNBs =
);
MACRLCs = (
- {
- num_cc = 1;
- tr_s_preference = "local_L1";
- tr_n_preference = "local_RRC";
- pusch_TargetSNRx10 = 150;
- pucch_TargetSNRx10 = 200;
- }
+{
+ num_cc = 1;
+ tr_s_preference = "local_L1";
+ tr_n_preference = "local_RRC";
+ pusch_TargetSNRx10 = 150;
+ pucch_TargetSNRx10 = 200;
+ ulsch_max_frame_inactivity = 1;
+}
);
L1s = (
- {
- num_cc = 1;
- tr_n_preference = "local_mac";
- pusch_proc_threads = 8;
- prach_dtx_threshold = 120;
- pucch0_dtx_threshold = 150;
- ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0
- }
+{
+ num_cc = 1;
+ tr_n_preference = "local_mac";
+ pusch_proc_threads = 8;
+ prach_dtx_threshold = 120;
+ pucch0_dtx_threshold = 150;
+ ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0
+}
);
RUs = (
- {
- local_rf = "yes"
- nb_tx = 1
- nb_rx = 1
- att_tx = 0
- att_rx = 0;
- bands = [41];
- max_pdschReferenceSignalPower = -27;
- max_rxgain = 114;
- eNB_instances = [0];
- #beamforming 1x4 matrix:
- bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000];
- clock_src = "internal";
- }
+{
+ local_rf = "yes"
+ nb_tx = 1
+ nb_rx = 1
+ att_tx = 0
+ att_rx = 0;
+ bands = [41];
+ max_pdschReferenceSignalPower = -27;
+ max_rxgain = 114;
+ sf_extension = 0;
+ eNB_instances = [0];
+ #beamforming 1x4 matrix:
+ bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000];
+ clock_src = "internal";
+}
);
THREAD_STRUCT = (
- {
- #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
- parallel_config = "PARALLEL_SINGLE_THREAD";
- #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
- worker_config = "WORKER_ENABLE";
- }
+{
+ #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
+ parallel_config = "PARALLEL_SINGLE_THREAD";
+ #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
+ worker_config = "WORKER_ENABLE";
+}
);
rfsimulator :
{
- serveraddr = "server";
- serverport = "4043";
- options = (); #("saviq"); or/and "chanmod"
- modelname = "AWGN";
- IQfile = "/tmp/rfsimulator.iqs";
+ serveraddr = "server";
+ serverport = "4043";
+ options = (); #("saviq"); or/and "chanmod"
+ modelname = "AWGN";
+ IQfile = "/tmp/rfsimulator.iqs";
};
security = {
@@ -298,23 +300,22 @@ security = {
drb_integrity = "no";
};
- log_config :
- {
- global_log_level ="info";
- global_log_verbosity ="medium";
- hw_log_level ="info";
- hw_log_verbosity ="medium";
- phy_log_level ="info";
- phy_log_verbosity ="medium";
- mac_log_level ="info";
- mac_log_verbosity ="high";
- rlc_log_level ="info";
- rlc_log_verbosity ="medium";
- pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
- rrc_log_level ="info";
- rrc_log_verbosity ="medium";
- ngap_log_level ="debug";
- ngap_log_verbosity ="medium";
- };
-
+log_config :
+{
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="high";
+ rlc_log_level ="info";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="medium";
+ ngap_log_level ="debug";
+ ngap_log_verbosity ="medium";
+};
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf
new file mode 100644
index 0000000000..abc64b6e46
--- /dev/null
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf
@@ -0,0 +1,323 @@
+Active_gNBs = ( "gNB-OAI");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+
+gNBs =
+(
+ {
+ ////////// Identification parameters:
+ gNB_ID = 0xe00;
+ gNB_name = "gNB-OAI";
+
+ // Tracking area code, 0x0000 and 0xfffe are reserved values
+ tracking_area_code = 1;
+ plmn_list = ({
+ mcc = 208;
+ mnc = 99;
+ mnc_length = 2;
+ snssaiList = (
+ {
+ sst = 1;
+ sd = 0x1; // 0 false, else true
+ },
+ {
+ sst = 1;
+ sd = 0x112233; // 0 false, else true
+ }
+ );
+
+ });
+
+ nr_cellid = 12345678L;
+
+ ////////// Physical parameters:
+
+ ssb_SubcarrierOffset = 0;
+ pdsch_AntennaPorts = 1;
+ pusch_AntennaPorts = 2;
+ ul_prbblacklist = "51,52,53,54"
+
+ pdcch_ConfigSIB1 = (
+ {
+ controlResourceSetZero = 11;
+ searchSpaceZero = 0;
+ }
+ );
+
+ servingCellConfigCommon = (
+ {
+ #spCellConfigCommon
+
+ physCellId = 0;
+
+# downlinkConfigCommon
+ #frequencyInfoDL
+ # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68
+ absoluteFrequencySSB = 621312; # 641280
+ dl_frequencyBand = 78;
+ # this is 3300.60 MHz
+ dl_absoluteFrequencyPointA = 620040; # 640008
+ #scs-SpecificCarrierList
+ dl_offstToCarrier = 0;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ dl_subcarrierSpacing = 1;
+ dl_carrierBandwidth = 106;
+ #initialDownlinkBWP
+ #genericParameters
+ # this is RBstart=27,L=48 (275*(L-1))+RBstart
+ initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ initialDLBWPsubcarrierSpacing = 1;
+ #pdcch-ConfigCommon
+ initialDLBWPcontrolResourceSetZero = 11;
+ initialDLBWPsearchSpaceZero = 0;
+ #pdsch-ConfigCommon
+ #pdschTimeDomainAllocationList (up to 16 entries)
+ initialDLBWPk0_0 = 0; #for DL slot
+ initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
+ initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
+
+ initialDLBWPk0_1 = 0; #for mixed slot
+ initialDLBWPmappingType_1 = 0;
+ initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
+
+ #uplinkConfigCommon
+ #frequencyInfoUL
+ ul_frequencyBand = 78;
+ #scs-SpecificCarrierList
+ ul_offstToCarrier = 0;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ ul_subcarrierSpacing = 1;
+ ul_carrierBandwidth = 106;
+ pMax = 20;
+ #initialUplinkBWP
+ #genericParameters
+ initialULBWPlocationAndBandwidth = 28875;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ initialULBWPsubcarrierSpacing = 1;
+ #rach-ConfigCommon
+ #rach-ConfigGeneric
+ prach_ConfigurationIndex = 98;
+#prach_msg1_FDM
+#0 = one, 1=two, 2=four, 3=eight
+ prach_msg1_FDM = 0;
+ prach_msg1_FrequencyStart = 0;
+ zeroCorrelationZoneConfig = 12;
+ preambleReceivedTargetPower = -104;
+#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
+ preambleTransMax = 6;
+#powerRampingStep
+# 0=dB0,1=dB2,2=dB4,3=dB6
+ powerRampingStep = 1;
+#ra_ReponseWindow
+#1,2,4,8,10,20,40,80
+ ra_ResponseWindow = 4;
+#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
+#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
+ ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 3;
+#oneHalf (0..15) 4,8,12,16,...60,64
+ ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15;
+#ra_ContentionResolutionTimer
+#(0..7) 8,16,24,32,40,48,56,64
+ ra_ContentionResolutionTimer = 7;
+ rsrp_ThresholdSSB = 19;
+#prach-RootSequenceIndex_PR
+#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; # used for UL slot
+ initialULBWPmappingType_0 = 1
+ initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13
+
+ initialULBWPk2_1 = 2; # used for mixed slot
+ initialULBWPmappingType_1 = 1;
+ initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4
+
+ initialULBWPk2_2 = 7; # used for Msg.3 during RA
+ initialULBWPmappingType_2 = 1;
+ initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
+
+ msg3_DeltaPreamble = 1;
+ p0_NominalWithGrant =-90;
+
+# pucch-ConfigCommon setup :
+# pucchGroupHopping
+# 0 = neither, 1= group hopping, 2=sequence hopping
+ pucchGroupHopping = 0;
+ hoppingId = 40;
+ p0_nominal = -70;
+# ssb_PositionsInBurs_BitmapPR
+# 1=short, 2=medium, 3=long
+ ssb_PositionsInBurst_PR = 2;
+ ssb_PositionsInBurst_Bitmap = 1;
+
+# ssb_periodicityServingCell
+# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1
+ ssb_periodicityServingCell = 2;
+
+# dmrs_TypeA_position
+# 0 = pos2, 1 = pos3
+ dmrs_TypeA_Position = 0;
+
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ subcarrierSpacing = 1;
+
+
+ #tdd-UL-DL-ConfigurationCommon
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ referenceSubcarrierSpacing = 1;
+ # pattern1
+ # dl_UL_TransmissionPeriodicity
+ # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10
+ dl_UL_TransmissionPeriodicity = 6;
+ nrofDownlinkSlots = 7;
+ nrofDownlinkSymbols = 6;
+ nrofUplinkSlots = 2;
+ nrofUplinkSymbols = 4;
+
+ ssPBCH_BlockPower = -25;
+ }
+
+ );
+
+
+ # ------- SCTP definitions
+ SCTP :
+ {
+ # Number of streams to use in input/output
+ SCTP_INSTREAMS = 2;
+ SCTP_OUTSTREAMS = 2;
+ };
+
+
+ ////////// AMF parameters:
+ amf_ip_address = ( { ipv4 = "192.168.70.132";
+ ipv6 = "192:168:30::17";
+ active = "yes";
+ preference = "ipv4";
+ }
+ );
+
+
+ NETWORK_INTERFACES :
+ {
+ GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai";
+ GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24";
+ GNB_INTERFACE_NAME_FOR_NGU = "demo-oai";
+ GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24";
+ GNB_PORT_FOR_S1U = 2152; # Spec 2152
+ };
+
+ }
+);
+
+MACRLCs = (
+{
+ num_cc = 1;
+ tr_s_preference = "local_L1";
+ tr_n_preference = "local_RRC";
+ #pusch_TargetSNRx10 = 150;
+ #pucch_TargetSNRx10 = 200;
+ ulsch_max_frame_inactivity = 1;
+}
+);
+
+L1s = (
+{
+ num_cc = 1;
+ tr_n_preference = "local_mac";
+ pusch_proc_threads = 4;
+ prach_dtx_threshold = 120;
+ #pucch0_dtx_threshold = 120;
+}
+);
+
+RUs = (
+{
+ local_rf = "yes"
+ nb_tx = 2
+ nb_rx = 2
+ att_tx = 0
+ att_rx = 0;
+ bands = [78];
+ max_pdschReferenceSignalPower = -27;
+ max_rxgain = 75;
+ sf_extension = 0;
+ eNB_instances = [0];
+ ##beamforming 1x2 matrix: 1 layer x 2 antennas
+ bf_weights = [0x00007fff, 0x0000];
+ #clock_src = "internal";
+ sdr_addrs = "mgmt_addr=192.168.10.2,addr=192.168.10.2,clock_source=internal,time_source=internal"
+}
+);
+
+THREAD_STRUCT = (
+{
+ #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
+ parallel_config = "PARALLEL_SINGLE_THREAD";
+ #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
+ worker_config = "WORKER_ENABLE";
+}
+);
+
+rfsimulator :
+{
+ serveraddr = "server";
+ serverport = "4043";
+ options = (); #("saviq"); or/and "chanmod"
+ modelname = "AWGN";
+ IQfile = "/tmp/rfsimulator.iqs";
+};
+
+security = {
+ # preferred ciphering algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nea0, nea1, nea2, nea3
+ ciphering_algorithms = ( "nea0" );
+
+ # preferred integrity algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nia0, nia1, nia2, nia3
+ integrity_algorithms = ( "nia2", "nia0" );
+
+ # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
+ # what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
+ drb_ciphering = "yes";
+ drb_integrity = "no";
+};
+
+log_config :
+{
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="high";
+ rlc_log_level ="info";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="medium";
+ ngap_log_level ="debug";
+ ngap_log_verbosity ="medium";
+ f1ap_log_level ="debug";
+ f1ap_log_verbosity ="medium";
+};
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf
index ac8622fbc5..83b39b85ec 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf
@@ -1,4 +1,4 @@
-Active_gNBs = ( "gNB-Eurecom-5GNRBox");
+Active_gNBs = ( "gNB-OAI");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
@@ -7,7 +7,7 @@ gNBs =
{
////////// Identification parameters:
gNB_ID = 0xe00;
- gNB_name = "gNB-Eurecom-5GNRBox";
+ gNB_name = "gNB-OAI";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1;
@@ -204,7 +204,7 @@ gNBs =
};
- ////////// MME parameters:
+ ////////// AMF parameters:
amf_ip_address = ( { ipv4 = "192.168.70.132";
ipv6 = "192:168:30::17";
active = "yes";
@@ -226,59 +226,61 @@ gNBs =
);
MACRLCs = (
- {
- num_cc = 1;
- tr_s_preference = "local_L1";
- tr_n_preference = "local_RRC";
- pusch_TargetSNRx10 = 150;
- pucch_TargetSNRx10 = 200;
- }
+{
+ num_cc = 1;
+ tr_s_preference = "local_L1";
+ tr_n_preference = "local_RRC";
+ pusch_TargetSNRx10 = 150;
+ pucch_TargetSNRx10 = 200;
+ ulsch_max_frame_inactivity = 1;
+}
);
L1s = (
- {
- num_cc = 1;
- tr_n_preference = "local_mac";
- pusch_proc_threads = 8;
- prach_dtx_threshold = 120;
- pucch0_dtx_threshold = 150;
- ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0
- }
+{
+ num_cc = 1;
+ tr_n_preference = "local_mac";
+ pusch_proc_threads = 8;
+ prach_dtx_threshold = 120;
+ pucch0_dtx_threshold = 150;
+ ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0
+}
);
RUs = (
- {
- local_rf = "yes"
- nb_tx = 1
- nb_rx = 1
- att_tx = 0
- att_rx = 0;
- bands = [78];
- max_pdschReferenceSignalPower = -27;
- max_rxgain = 114;
- eNB_instances = [0];
- #beamforming 1x4 matrix:
- bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000];
- clock_src = "internal";
- }
+{
+ local_rf = "yes"
+ nb_tx = 1
+ nb_rx = 1
+ att_tx = 0
+ att_rx = 0;
+ bands = [78];
+ max_pdschReferenceSignalPower = -27;
+ max_rxgain = 114;
+ sf_extension = 0;
+ eNB_instances = [0];
+ #beamforming 1x4 matrix:
+ bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000];
+ clock_src = "internal";
+}
);
THREAD_STRUCT = (
- {
- #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
- parallel_config = "PARALLEL_SINGLE_THREAD";
- #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
- worker_config = "WORKER_ENABLE";
- }
+{
+ #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
+ parallel_config = "PARALLEL_SINGLE_THREAD";
+ #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
+ worker_config = "WORKER_ENABLE";
+}
);
rfsimulator :
{
- serveraddr = "server";
- serverport = "4043";
- options = (); #("saviq"); or/and "chanmod"
- modelname = "AWGN";
- IQfile = "/tmp/rfsimulator.iqs";
+ serveraddr = "server";
+ serverport = "4043";
+ options = (); #("saviq"); or/and "chanmod"
+ modelname = "AWGN";
+ IQfile = "/tmp/rfsimulator.iqs";
};
security = {
@@ -298,23 +300,23 @@ security = {
drb_integrity = "no";
};
- log_config :
- {
- global_log_level ="info";
- global_log_verbosity ="medium";
- hw_log_level ="info";
- hw_log_verbosity ="medium";
- phy_log_level ="info";
- phy_log_verbosity ="medium";
- mac_log_level ="info";
- mac_log_verbosity ="high";
- rlc_log_level ="info";
- rlc_log_verbosity ="medium";
- pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
- rrc_log_level ="info";
- rrc_log_verbosity ="medium";
- ngap_log_level ="debug";
- ngap_log_verbosity ="medium";
- };
+log_config :
+{
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="high";
+ rlc_log_level ="info";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="medium";
+ ngap_log_level ="debug";
+ ngap_log_verbosity ="medium";
+};
diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c
index 31c142c8da..632a47707b 100644
--- a/targets/RT/USER/lte-enb.c
+++ b/targets/RT/USER/lte-enb.c
@@ -88,10 +88,6 @@
#include "enb_config.h"
#include "targets/RT/USER/lte-softmodem.h"
-#ifndef OPENAIR2
- #include "UTIL/OTG/otg_extern.h"
-#endif
-
#include "s1ap_eNB.h"
#include "SIMULATION/ETH_TRANSPORT/proto.h"
diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c
index a20a377ea5..f229ecf086 100644
--- a/targets/RT/USER/lte-softmodem.c
+++ b/targets/RT/USER/lte-softmodem.c
@@ -82,10 +82,6 @@ unsigned short config_frames[4] = {2,9,11,13};
#include "enb_config.h"
//#include "PHY/TOOLS/time_meas.h"
-#ifndef OPENAIR2
- #include "UTIL/OTG/otg_vars.h"
-#endif
-
#include "create_tasks.h"
diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c
index 6e6c2533b4..1fae6c1e66 100644
--- a/targets/RT/USER/lte-ue.c
+++ b/targets/RT/USER/lte-ue.c
@@ -2067,7 +2067,6 @@ void init_UE_threads_stub(int inst)
}
-#ifdef OPENAIR2
void fill_ue_band_info(void)
{
LTE_UE_EUTRA_Capability_t *UE_EUTRA_Capability = UE_rrc_inst[0].UECap->UE_EUTRA_Capability;
@@ -2092,7 +2091,6 @@ void fill_ue_band_info(void)
}
}
}
-#endif
int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue,
openair0_config_t *openair0_cfg)
diff --git a/targets/RT/USER/lte-uesoftmodem.c b/targets/RT/USER/lte-uesoftmodem.c
index 2797a69514..6d9aa612a2 100644
--- a/targets/RT/USER/lte-uesoftmodem.c
+++ b/targets/RT/USER/lte-uesoftmodem.c
@@ -75,10 +75,6 @@
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
-#ifndef OPENAIR2
- #include "UTIL/OTG/otg_vars.h"
-#endif
-
#include "create_tasks.h"
#include "system.h"