Commit b2e49fd0 authored by Jacques's avatar Jacques

nr ue : integration pucch_uci and unit tests

parent bf674468
......@@ -176,7 +176,8 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${CMAKE_CU
# these changes are related to hardcoded path to include .h files
add_definitions(-DCMAKER)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3 -O2")
#set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3 -O2")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3")
set(GIT_BRANCH "UNKNOWN")
......@@ -435,7 +436,6 @@ execute_process(COMMAND mkdir -p ${S1AP_C_DIR}
COMMAND env "ASN1C_PREFIX=S1AP_" asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${S1AP_C_DIR} ${S1AP_ASN_DIR}/${S1AP_ASN_FILES}
RESULT_VARIABLE ret)
if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${ret}: error")
endif (NOT ${ret} STREQUAL 0)
......@@ -451,7 +451,6 @@ add_custom_command (
DEPENDS ${S1AP_ASN_DIR}/${S1AP_ASN_FILES}
)
add_library(S1AP_LIB
${S1AP_source}
${S1AP_DIR}/s1ap_common.c
......@@ -1045,6 +1044,17 @@ set(SCHED_SRC_UE
)
add_library(SCHED_UE_LIB ${SCHED_SRC_UE})
set(SCHED_SRC_NR_UE
${OPENAIR1_DIR}/SCHED_NR_UE/phy_procedures_nr_ue.c
# ${OPENAIR1_DIR}/SCHED_NR_UE/phy_procedures_nr_common_ue.c
${OPENAIR1_DIR}/SCHED_NR_UE/fapi_nr_ue_l1.c
${OPENAIR1_DIR}/SCHED_NR_UE/phy_frame_config_nr.c
${OPENAIR1_DIR}/SCHED_NR_UE/harq_nr.c
${OPENAIR1_DIR}/SCHED_NR_UE/pucch_uci_ue_nr.c
${OPENAIR1_DIR}/SCHED_NR_UE/pucch_power_control_ue_nr.c
)
add_library(SCHED_NR_UE_LIB ${SCHED_SRC_NR_UE})
# nFAPI
#################################
set(NFAPI_COMMON_SRC
......@@ -1282,6 +1292,7 @@ set(PHY_SRC_UE
${OPENAIR1_DIR}/PHY/TOOLS/lut.c
${PHY_POLARSRC}
)
set(PHY_NR_UE_SRC
# depend on code generation from asn1c
${RRC_FULL_DIR}/asn1_constants.h
......@@ -1315,12 +1326,10 @@ set(PHY_SRC_UE
${OPENAIR1_DIR}/PHY/TOOLS/time_meas.c
${OPENAIR1_DIR}/PHY/TOOLS/lut.c
${OPENAIR1_DIR}/PHY/INIT/nr_init_ue.c
${OPENAIR1_DIR}/SCHED_NR_UE/phy_procedures_nr_ue.c
#${OPENAIR1_DIR}/SCHED_NR_UE/phy_procedures_nr_common_ue.c
${OPENAIR1_DIR}/SCHED_NR_UE/fapi_nr_ue_l1.c
${PHY_POLARSRC}
)
if (${SMBV})
set(PHY_SRC "${PHY_SRC} ${OPENAIR1_DIR}/PHY/TOOLS/smbv.c")
endif (${SMBV})
......@@ -1518,6 +1527,7 @@ add_library(L2
add_library(L2_UE
${L2_SRC_UE}
${MAC_SRC_UE}
${MAC_NR_SRC_UE}
)
add_library( NR_L2_UE
......@@ -2249,7 +2259,6 @@ add_executable(nr-softmodem-nos1
${OPENAIR_TARGETS}/RT/USER/nr-gnb.c
${OPENAIR_TARGETS}/RT/USER/nr-ru.c
${OPENAIR_TARGETS}/RT/USER/nr-softmodem.c
${OPENAIR_TARGETS}/COMMON/create_nr_tasks.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/COMMON/create_tasks.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
......@@ -2305,7 +2314,7 @@ add_executable(nr-uesoftmodem
target_link_libraries (nr-uesoftmodem
-Wl,--start-group
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_NR_UE PHY_COMMON PHY_UE PHY_RU LFDS NR_L2_UE
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB PHY_NR_UE PHY_COMMON PHY_UE PHY_RU LFDS NR_L2_UE
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7
-Wl,--end-group z dl)
......@@ -2340,7 +2349,7 @@ add_executable(nr-uesoftmodem-nos1
target_link_libraries (nr-uesoftmodem-nos1
-Wl,--start-group
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_NR_UE PHY_COMMON PHY_UE PHY_RU LFDS L2_UE
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB PHY_NR_UE PHY_COMMON PHY_UE PHY_RU LFDS L2_UE
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7
-Wl,--end-group z dl)
......
......@@ -164,6 +164,7 @@ typedef struct {
nfapi_uint16_tlv_t p0_nominal; ///// L1 parameter 'p0-nominal-pucch'
} nfapi_nr_pucch_config_t;
typedef struct {
//NR TDD-UL-DL-ConfigCommon ///// L1 parameter 'UL-DL-configuration-common'
nfapi_uint16_tlv_t referenceSubcarrierSpacing; ///// L1 parameter 'reference-SCS'
......
......@@ -32,6 +32,7 @@
#ifndef SSS_NR_H
#define SSS_NR_H
#include "limits.h"
#include "PHY/defs_nr_UE.h"
#include "PHY/types.h"
......@@ -46,7 +47,6 @@
/************** DEFINE ********************************************/
#define INT_MIN (-2147483647 - 1)
#define SAMPLES_IQ (sizeof(int16_t)*2)
#define NUMBER_SSS_SEQUENCE (336)
#define INVALID_SSS_SEQUENCE (NUMBER_SSS_SEQUENCE)
......
......@@ -4574,10 +4574,15 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue,
// packet was actually decoded in previous transmission (ACK was missed by eNB)
// however, the round is not a good check as it might have been decoded in a retransmission prior to this one.
// skip pdsch decoding and report ack
pdlsch0->harq_processes[pdlsch0->current_harq_pid]->harq_ack.ack = 1;
pdlsch0->harq_processes[pdlsch0->current_harq_pid]->harq_ack.send_harq_status;
#if 0
pdlsch0->active = 0;
pdlsch0->harq_ack[nr_tti_rx].ack = 1;
pdlsch0->harq_ack[nr_tti_rx].harq_id = nr_pdci_info_extracted->harq_process_number;
pdlsch0->harq_ack[nr_tti_rx].send_harq_status = 1;
#endif
} else { // normal retransmission, nothing special to do
}
} else {
......@@ -4602,7 +4607,8 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue,
// 2 if one serving cell is configured in the DL and the higher layer parameter HARQ-ACK-codebook=dynamic, where the 2 bits are the counter DAI
// 0 otherwise
nr_pdci_info_extracted->dai = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15]));
pdlsch0->harq_ack[nr_tti_rx].vDAI_DL = nr_pdci_info_extracted->dai+1;
pdlsch0->harq_processes[pdlsch0->current_harq_pid]->harq_ack.vDAI_DL = nr_pdci_info_extracted->dai+1;
//pdlsch0->harq_ack[nr_tti_rx].vDAI_DL = nr_pdci_info_extracted->dai+1;
#ifdef NR_PDCCH_DCI_TOOLS_DEBUG
printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->dai=%x\n",nr_pdci_info_extracted->dai);
#endif
......
......@@ -30,7 +30,6 @@
*
************************************************************************/
//#include "PHY/LTE_REFSIG/defs.h"
#include "PHY/NR_REFSIG/ss_pbch_nr.h"
#include "PHY/NR_REFSIG/dmrs_nr.h"
......
......@@ -31,7 +31,9 @@
*/
#ifndef __NR_TRANSPORT_UE__H__
#define __NR_TRANSPORT_UE__H__
#include "PHY/defs_nr_UE.h"
#include <limits.h>
#include "PHY/impl_defs_top.h"
//#include "PHY/defs_nr_UE.h"
//#include "../LTE_TRANSPORT/dci.h"
//#include "../LTE_TRANSPORT/mdci.h"
//#include "../LTE_TRANSPORT/uci_common.h"
......@@ -48,7 +50,31 @@
* @{
*/
#define SHRT_MAX 32767
//#if defined(UPGRADE_RAT_NR)
#if 1
typedef struct {
/// HARQ process id
uint8_t harq_id;
/// ACK bits (after decoding) 0:NACK / 1:ACK / 2:DTX
uint8_t ack;
/// send status (for PUCCH)
uint8_t send_harq_status;
/// nCCE (for PUCCH)
uint8_t nCCE;
/// DAI value detected from DCI1/1a/1b/1d/2/2a/2b/2c. 0xff indicates not touched
uint8_t vDAI_DL;
/// DAI value detected from DCI0/4. 0xff indicates not touched
uint8_t vDAI_UL;
/// allow to define pucch parameters TS 38.213 9.2.3 UE procedure for reporting HARQ-ACK
uint8_t pucch_resource_indicator;
/// slot on which feedback ack should be send to network
uint16_t slot_for_feedback_ack;
/// index of a first CCE for the PDCCH reception
uint8_t n_CCE;
/// number of CCEs in a control resource set of a PDCCH reception conveying DCI format 1_0
uint8_t N_CCE;
} NR_UE_HARQ_STATUS_t;
#endif
typedef struct {
/// Indicator of first transmission
......@@ -129,8 +155,14 @@ typedef struct {
uint8_t Nsymb_pusch;
/// SRS active flag
uint8_t srs_active;
/// Pointers to 8 HARQ processes for the ULSCH
NR_UL_UE_HARQ_t *harq_processes[8];
//#if defined(UPGRADE_RAT_NR)
#if 1
// Pointers to HARQ processes for the ULSCH
NR_UL_UE_HARQ_t *harq_processes[NR_MAX_ULSCH_HARQ_PROCESSES];
int harq_process_id[NR_MAX_SLOTS_PAR_FRAME];
// UL number of harq processes
uint8_t number_harq_processes_for_pusch;
#endif
/// Pointer to CQI data (+1 for 8 bits crc)
uint8_t o[1+MAX_CQI_BYTES];
/// Length of CQI data (bits)
......@@ -197,9 +229,6 @@ typedef struct {
uint8_t Mlimit;
} NR_UE_ULSCH_t;
typedef struct {
/// Indicator of first transmission
uint8_t first_tx;
......@@ -269,24 +298,10 @@ typedef struct {
uint32_t errors[8];
/// codeword this transport block is mapped to
uint8_t codeword;
/// HARQ-ACKs
NR_UE_HARQ_STATUS_t harq_ack;
} NR_DL_UE_HARQ_t;
typedef struct {
/// HARQ process id
uint8_t harq_id;
/// ACK bits (after decoding) 0:NACK / 1:ACK / 2:DTX
uint8_t ack;
/// send status (for PUCCH)
uint8_t send_harq_status;
/// nCCE (for PUCCH)
uint8_t nCCE;
/// DAI value detected from DCI1/1a/1b/1d/2/2a/2b/2c. 0xff indicates not touched
uint8_t vDAI_DL;
/// DAI value detected from DCI0/4. 0xff indicates not touched
uint8_t vDAI_UL;
} nr_harq_status_t;
typedef struct {
/// RNTI
uint16_t rnti;
......@@ -310,10 +325,17 @@ typedef struct {
uint32_t cqi_alloc2;
/// saved subband PMI allocation from last PUSCH/PUCCH report
uint16_t pmi_alloc;
/// HARQ-ACKs
nr_harq_status_t harq_ack[10];
/// Pointers to up to 8 HARQ processes
NR_DL_UE_HARQ_t *harq_processes[8];
//#if defined(UPGRADE_RAT_NR)
#if 1
/// Pointers to up to HARQ processes
NR_DL_UE_HARQ_t *harq_processes[NR_MAX_DLSCH_HARQ_PROCESSES];
// DL number of harq processes
uint8_t number_harq_processes_for_pdsch;
/* higher layer parameter for reception of two transport blocks TS 38.213 9.1.3.1 Type-2 HARQ-ACK codebook dtermination */
uint8_t Number_MCS_HARQ_DL_DCI;
/* spatial bundling of PUCCH */
uint8_t HARQ_ACK_spatial_bundling_PUCCH;
#endif
/// Maximum number of HARQ processes(for definition see 36-212 V8.6 2009-03, p.17
uint8_t Mdlharq;
/// MIMO transmission mode indicator for this sub-frame (for definition see 36-212 V8.6 2009-03, p.17)
......@@ -363,6 +385,13 @@ typedef struct {
dci_space_t search_space;
/// DCI pdu
uint8_t dci_pdu[8];
//#if defined(UPGRADE_RAT_NR)
#if 1
/// harq information
uint8_t harq_pid_pusch;
/// delay between current slot and slot to transmit
uint8_t number_slots_rx_to_tx;
#endif
} NR_DCI_ALLOC_t;
......
......@@ -669,24 +669,21 @@ int pss_synchro_nr(PHY_VARS_NR_UE *PHY_vars_UE, int rate_change)
#endif
#if 1
synchro_position = pss_search_time_nr(rxdata,
frame_parms,
(int *)&PHY_vars_UE->common_vars.eNb_id);
#else
synchro_position = lte_sync_time(rxdata,
frame_parms,
(int *)&PHY_vars_UE->common_vars.eNb_id);
#endif
#if TEST_SYNCHRO_TIMING_PSS
stop_meas(&generic_time[TIME_PSS]);
printf("PSS execution duration %5.2f \n", generic_time[TIME_PSS].p_time/(cpuf*1000.0));
int duration_ms = generic_time[TIME_PSS].p_time/(cpuf*1000.0);
#ifndef NR_UNIT_TEST
printf("PSS execution duration %4d microseconds \n", duration_ms);
#endif
#endif
......@@ -855,7 +852,9 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain
}
//#endif
#ifdef DEBUG_PHY
#ifdef DBG_PSS_NR
static debug_cnt = 0;
if (debug_cnt == 0) {
write_output("pss_corr_ue0.m","pss_corr_ue0",pss_corr_ue[0],length,1,2);
......
......@@ -305,8 +305,6 @@ int do_pss_sss_extract_nr(PHY_VARS_NR_UE *ue,
int32_t **rxdataF;
NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
#if 1
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
pss_symbol = PSS_SYMBOL_NB; /* symbol position */
......@@ -361,46 +359,6 @@ int do_pss_sss_extract_nr(PHY_VARS_NR_UE *ue,
printf(" pss_rxF_ext [%d] %d %d at address %p\n", i, p2[2*i], p2[2*i+1], &p2[2*i]);
}
#endif
#else
/* same method as LTE implementation */
uint16_t rb,nb_rb = N_RB_SS_PBCH_BLOCK;
int rx_offset = frame_parms->ofdm_symbol_size - (LENGTH_SSS_NR/2);
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
pss_symbol = PSS_SYMBOL_NB;
sss_symbol = SSS_SYMBOL_NB;
rxdataF = ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF;
pss_rxF = &rxdataF[aarx][(rx_offset + (pss_symbol*(frame_parms->ofdm_symbol_size)))];
sss_rxF = &rxdataF[aarx][(rx_offset + (sss_symbol*(frame_parms->ofdm_symbol_size)))];
//printf("extract_rbs: symbol_mod=%d, rx_offset=%d, ch_offset=%d\n",symbol_mod,
// (rx_offset + (symbol*(frame_parms->ofdm_symbol_size)))*2,
// LTE_CE_OFFSET+ch_offset+(symbol_mod*(frame_parms->ofdm_symbol_size)));
pss_rxF_ext = &pss_ext[aarx][0];
sss_rxF_ext = &sss_ext[aarx][0];
for (rb=0; rb<nb_rb; rb++) {
for (int i=0; i<N_SC_RB; i++) {
if (doPss) {pss_rxF_ext[i] = pss_rxF[i];}
if (doSss) {sss_rxF_ext[i] = sss_rxF[i];}
}
pss_rxF += N_SC_RB;
sss_rxF += N_SC_RB;
pss_rxF_ext += N_SC_RB;
sss_rxF_ext += N_SC_RB;
}
}
#endif
return(0);
......
......@@ -82,6 +82,15 @@
//#define RX_NB_TH_MAX 3
//#define RX_NB_TH 3
#ifdef NR_UNIT_TEST
#define FILE_NAME " "
#define LINE_FILE (0)
#define NR_TST_PHY_PRINTF(...) printf(__VA_ARGS__)
#else
#define FILE_NAME (__FILE__)
#define LINE_FILE (__LINE__)
#define NR_TST_PHY_PRINTF(...)
#endif
//#ifdef SHRLIBDEV
//extern int rxrescale;
......@@ -151,6 +160,27 @@
#include "NR_IF_Module.h"
//#if defined(UPGRADE_RAT_NR)
#if 1
/* see 38.321 Table 7.1-2 RNTI usage */
typedef enum { /* Type for Radio Network Temporary Identifier */
C_RNTI_NR = 0, /* Cell RNTI */
Temporary_C_RNTI_NR, /* Temporary C-RNTI */
CS_RNTI_NR, /* Configured Scheduling RNTI */
P_RNTI_NR, /* Paging RNTI */
SI_RNTI_NR, /* System information RNTI */
RA_RNTI_NR, /* Random Access RNTI */
TPC_CS_RNTI_NR, /* configured scheduling uplink power control */
TPC_PUCCH_RNTI_NR, /* PUCCH power control */
TPC_PUSCH_RNTI_NR, /* PUSCH power control */
TPC_SRS_RNTI_NR, /* SRS trigger and power control */
INT_RNTI_NR, /* Indication pre-emption in DL */
SFI_RNTI_NR, /* Slot Format Indication on the given cell */
SP_CSI_RNTI_NR /* Semipersistent CSI reporting on PUSCH */
} nr_rnti_type_t;
#endif
/// Context data structure for RX/TX portion of subframe processing
typedef struct {
/// index of the current UE RX/TX proc
......@@ -978,9 +1008,9 @@ typedef struct {
/// \brief Total gains with bypassed RF gain stage (ExpressMIMO2/Lime)
uint32_t rx_gain_byp[4];
/// \brief Current transmit power
int16_t tx_power_dBm[10];
int16_t tx_power_dBm[MAX_NR_OF_SLOTS];
/// \brief Total number of REs in current transmission
int tx_total_RE[10];
int tx_total_RE[MAX_NR_OF_SLOTS];
/// \brief Maximum transmit power
int8_t tx_power_max_dBm;
/// \brief Number of eNB seen by UE
......@@ -1155,6 +1185,22 @@ typedef struct {
PUCCH_CONFIG_DEDICATED pucch_config_dedicated[NUMBER_OF_CONNECTED_eNB_MAX];
//#if defined(UPGRADE_RAT_NR)
#if 1
SystemInformationBlockType1_nr_t systemInformationBlockType1_nr;
CellGroupConfig_t cell_group_config;
PDSCH_ServingCellConfig_t PDSCH_ServingCellConfig;
PDSCH_Config_t PDSCH_Config;
PUCCH_ConfigCommon_nr_t pucch_config_common_nr[NUMBER_OF_CONNECTED_eNB_MAX];
PUCCH_Config_t pucch_config_dedicated_nr[NUMBER_OF_CONNECTED_eNB_MAX];
PUSCH_Config_t pusch_config;
#endif
uint8_t ncs_cell[20][7];
/// UL-POWER-Control
......@@ -1173,6 +1219,12 @@ typedef struct {
/// Scheduling Request Config
SCHEDULING_REQUEST_CONFIG scheduling_request_config[NUMBER_OF_CONNECTED_eNB_MAX];
//#if defined(UPGRADE_RAT_NR)
#if 1
scheduling_request_config_t scheduling_request_config_nr[NUMBER_OF_CONNECTED_eNB_MAX];
#endif
/// Transmission mode per eNB
uint8_t transmission_mode[NUMBER_OF_CONNECTED_eNB_MAX];
......
......@@ -34,6 +34,7 @@
#ifndef PHY_IMPL_DEFS_NR_H
#define PHY_IMPL_DEFS_NR_H
#include <stdbool.h>
#include "types.h"
#ifdef DEFINE_VARIABLES_PHY_IMPLEMENTATION_DEFS_NR_H
......@@ -65,6 +66,46 @@ EXTERN const uint8_t N_slot_subframe[MU_NUMBER]
#endif
;
//#define RX_NB_TH_MAX 3
//#define RX_NB_TH 3
#if 0
#define LTE_SLOTS_PER_SUBFRAME (2)
#define LTE_NUMBER_OF_SUBFRAMES_PER_FRAME (10)
#define LTE_SLOTS_PER_FRAME (20)
#define LTE_CE_FILTER_LENGTH (5)
#define LTE_CE_OFFSET (LTE_CE_FILTER_LENGTH)
#define TX_RX_SWITCH_SYMBOL (NUMBER_OF_SYMBOLS_PER_FRAME>>1)
#define PBCH_PDU_SIZE (3) //bytes
#define PRACH_SYMBOL (3) //position of the UL PSS wrt 2nd slot of special subframe
#define NUMBER_OF_FREQUENCY_GROUPS (lte_frame_parms->N_RB_DL)
#define SSS_AMP (1148)
#define MAX_NUM_PHICH_GROUPS (56) //110 RBs Ng=2, p.60 36-212, Sec. 6.9
#define MAX_MBSFN_AREA (8)
#endif
#define NB_DL_DATA_TO_UL_ACK (8) /* size of table TS 38.213 Table 9.2.3-1 */
/***********************************************************************
*
* FUNCTIONALITY : System information type 1
*
* DESCRIPTION : parameters provided by system information 1
*
************************************************************************/
typedef struct {
int N_BWP_SIZE; /* size of bandwidth part */
}
SystemInformationBlockType1_nr_t;
/***********************************************************************
*
* FUNCTIONALITY : Time Division Duplex
......@@ -73,7 +114,7 @@ EXTERN const uint8_t N_slot_subframe[MU_NUMBER]
*
************************************************************************/
#define MAX_NR_OF_SLOTS (320) /* maximum number of slots for tdd configuration which is periodic */
#define MAX_NR_OF_SLOTS (320) /* maximum number of slots */
#define NR_TDD_DOWNLINK_SLOT (0x0000)
#define NR_TDD_UPLINK_SLOT (0x3FFF) /* uplink bitmap for each symbol, there are 14 symbols per slots */
......@@ -177,23 +218,23 @@ typedef enum {
} resourceType_t;
typedef enum {
sl1 = 0,
sl2 = 1,
sl4 = 2,
sl5 = 3,
sl8 = 4,
sl10 = 5,
sl16 = 6,
sl20 = 7,
sl32 = 8,
sl40 = 9,
sl64 = 10,
sl80 = 11,
sl160 = 12,
sl320 = 13,
sl640 = 14,
sl1280 = 15,
sl2560 = 16
srs_sl1 = 0,
srs_sl2 = 1,
srs_sl4 = 2,
srs_sl5 = 3,
srs_sl8 = 4,
srs_sl10 = 5,
srs_sl16 = 6,
srs_sl20 = 7,
srs_sl32 = 8,
srs_sl40 = 9,
srs_sl64 = 10,
srs_sl80 = 11,
srs_sl160 = 12,
srs_sl320 = 13,
srs_sl640 = 14,
srs_sl1280 = 15,
srs_sl2560 = 16
} SRS_Periodicity_t;
#define NB_SRS_PERIOD (17)
......@@ -318,27 +359,492 @@ typedef struct {
SRS_ResourceSet_t *p_SRS_ResourceSetList[MAX_NR_OF_SRS_RESOURCE_SET]; /* ue implementation specific */
} SRS_NR;
//#define RX_NB_TH_MAX 3
//#define RX_NB_TH 3
/***********************************************************************
*
* FUNCTIONALITY : Packed Downlink Shared Channel PDSCH
*
* DESCRIPTION : interface description for PSCH configuration
*
************************************************************************/
#define LTE_SLOTS_PER_SUBFRAME 2
/* FFS TODO_NR partial structure that should be complete */
#define LTE_NUMBER_OF_SUBFRAMES_PER_FRAME 10
#define LTE_SLOTS_PER_FRAME 20
#define LTE_CE_FILTER_LENGTH 5
#define LTE_CE_OFFSET LTE_CE_FILTER_LENGTH
#define TX_RX_SWITCH_SYMBOL (NUMBER_OF_SYMBOLS_PER_FRAME>>1)
#define PBCH_PDU_SIZE 3 //bytes
typedef enum {
nb_code_n1 = 1,
nb_code_n2 = 2
} maxNrofCodeWordsScheduledByDCI_t;
#define PRACH_SYMBOL 3 //position of the UL PSS wrt 2nd slot of special subframe
typedef struct {
/*
Maximum number of code words that a single DCI may schedule. This changes the number of MCS/RV/NDI bits in the DCI message from 1 to 2.
*/
maxNrofCodeWordsScheduledByDCI_t maxNrofCodeWordsScheduledByDCI;
#define NUMBER_OF_FREQUENCY_GROUPS (lte_frame_parms->N_RB_DL)
} PDSCH_Config_t;
#define SSS_AMP 1148
/***********************************************************************
*
* FUNCTIONALITY : Packed Uplink Shared Channel
*
* DESCRIPTION : configuration for PUSCH
*
************************************************************************/
#define MAX_NR_OF_UL_ALLOCATIONS (16)
typedef enum {
enable_tpc_accumulation = 0, /* by default it is enable */
disable_tpc_accumulation = 1
} tpc_Accumulation_t;
typedef enum {
typeA = 0,
typeB = 1
} mappingType_t;
typedef struct {
tpc_Accumulation_t tpc_Accumulation;
} PUSCH_PowerControl_t;
#define MAX_NUM_PHICH_GROUPS 56 //110 RBs Ng=2, p.60 36-212, Sec. 6.9
typedef struct {
uint8_t k2;
mappingType_t mappingType;
uint8_t startSymbolAndLength;
} PUSCH_TimeDomainResourceAllocation_t;
typedef struct {
PUSCH_PowerControl_t pusch_PowerControl;
PUSCH_TimeDomainResourceAllocation_t *pusch_TimeDomainResourceAllocation[MAX_NR_OF_UL_ALLOCATIONS];
} PUSCH_Config_t;
/***********************************************************************
*
* FUNCTIONALITY : Pucch Power Control
*
* DESCRIPTION : configuration for pucch power control
*
************************************************************************/
#define MAX_NR_OF_PUCCH_P0_PER_SET (8)
#define NUMBER_PUCCH_FORMAT_NR (5)
typedef int8_t power_level_t; /* INTEGER (-16..15) */
typedef struct {
uint8_t p0_PUCCH_Id; /* INTEGER (1..8) */
power_level_t p0_PUCCH_Value;
} P0_PUCCH_t;
typedef struct {
power_level_t deltaF_PUCCH_f[NUMBER_PUCCH_FORMAT_NR];
P0_PUCCH_t *p0_Set[MAX_NR_OF_PUCCH_P0_PER_SET];
// pathlossReferenceRSs SEQUENCE (SIZE (1..maxNrofPUCCH-PathlossReferenceRSs)) OF PUCCH-PathlossReferenceRS OPTIONAL, -- Need M
int8_t twoPUCCH_PC_AdjustmentStates;
} PUCCH_PowerControl_t;
/***********************************************************************
*
* FUNCTIONALITY : Packed Uplink Control Channel aka PUCCH
*
* DESCRIPTION : interface description for managing PUCCH
* There are two main configurations:
* - a first one in SIB1 which gives configuration (common) for initial access
* - a second one which is send by network for dedicated mode
*
************************************************************************/
typedef enum {
neither = 0,
enable = 1,
disable = 2,
} pucch_GroupHopping_t;
typedef struct {
/*
PUCCH-ConfigCommon ::= SEQUENCE {
-- An entry into a 16-row table where each row configures a set of cell-specific PUCCH resources/parameters. The UE uses
-- those PUCCH resources during initial access on the initial uplink BWP. Once the network provides a dedicated PUCCH-Config
-- for that bandwidth part the UE applies that one instead of the one provided in this field.
-- Corresponds to L1 parameter 'PUCCH-resource-common' (see 38.213, section 9.2)
pucch-ResourceCommon BIT STRING (SIZE (4)) OPTIONAL, -- Need R
*/
uint16_t pucch_ResourceCommon;
/*
-- Configuration of group- and sequence hopping for all the PUCCH formats 0, 1, 3 and 4. "neither" implies neither group
-- or sequence hopping is enabled. "enable" enables group hopping and disables sequence hopping. "disable"” disables group
-- hopping and enables sequence hopping. Corresponds to L1 parameter 'PUCCH-GroupHopping' (see 38.211, section 6.4.1.3)
pucch-GroupHopping ENUMERATED { neither, enable, disable },
*/
pucch_GroupHopping_t pucch_GroupHopping;
/*
-- Cell-Specific scrambling ID for group hoppping and sequence hopping if enabled.
-- Corresponds to L1 parameter 'HoppingID' (see 38.211, section 6.3.2.2)
hoppingId BIT STRING (SIZE (10)) OPTIONAL, -- Need R
*/
uint16_t hoppingId;
/*
-- Power control parameter P0 for PUCCH transmissions. Value in dBm. Only even values (step size 2) allowed.
-- Corresponds to L1 parameter 'p0-nominal-pucch' (see 38.213, section 7.2)
p0-nominal INTEGER (-202..24) OPTIONAL, -- Need R
*/
int8_t p0_nominal;
} PUCCH_ConfigCommon_nr_t;
#define MAX_NB_OF_PUCCH_RESOURCE_SETS (4)
#define MAX_NB_OF_PUCCH_RESOURCES_PER_SET (32)
#define MAX_NB_OF_PUCCH_RESOURCES_PER_SET_NOT_0 (8)
#define MAX_NB_OF_PUCCH_RESOURCES (128)
#define NB_INITIAL_PUCCH_RESOURCE (16)
#define MAX_PUCCH_RESOURCE_INDICATOR (8)
#define MAX_NB_CYCLIC_SHIFT (4)
#define MAX_NR_OF_SPATIAL_RELATION_INFOS (8)
typedef enum {
pucch_format0_nr = 0,
pucch_format1_nr = 1,
pucch_format2_nr = 2,
pucch_format3_nr = 3,
pucch_format4_nr = 4,
} pucch_format_nr_t;
typedef enum {
feature_disabled = 0,
feature_enabled = 1,
} feature_status_t;
typedef enum {
disable_feature = 0,
enable_feature = 1
} enable_feature_t;
typedef enum {
zeroDot08 = 0,
zeroDot15 = 1,
zeroDot25 = 2,
zeroDot35 = 3,
zeroDot45 = 4,
zeroDot60 = 5,
zeroDot80 = 6,
reserved = 7
} PUCCH_MaxCodeRate_t;
typedef struct {
pucch_format_nr_t format;
uint8_t startingSymbolIndex;
uint8_t nrofSymbols;
uint16_t PRB_offset;
uint8_t nb_CS_indexes;
uint8_t initial_CS_indexes[MAX_NB_CYCLIC_SHIFT];
} initial_pucch_resource_t;
const initial_pucch_resource_t initial_pucch_resource[NB_INITIAL_PUCCH_RESOURCE]; /* TS 36.213 Table 9.2.1-1: PUCCH resource sets before dedicated PUCCH resource configuration */
/* structure with all possible field for pucch format from 0 to 4 */
typedef struct {
pucch_format_nr_t format; /* format 0 1 2 3 4 */
uint8_t initialCyclicShift; /* x x */
uint8_t nrofSymbols; /* x x x x x */
uint8_t startingSymbolIndex; /* x x x x x */
uint8_t timeDomainOCC; /* x */
uint8_t nrofPRBs; /* x x */
uint8_t occ_length; /* x */
uint8_t occ_Index; /* x */
} PUCCH_format_t;
typedef struct {
uint8_t pucch_ResourceId; /* maxNrofPUCCH-Resources = 128 */
uint16_t startingPRB; /* maxNrofPhysicalResourceBlocks = 275 */
feature_status_t intraSlotFrequencyHopping;
uint16_t secondHopPRB;
PUCCH_format_t format_parameters;
} PUCCH_Resource_t;
#define MAX_MBSFN_AREA 8
typedef struct {
uint8_t pucch_ResourceSetId; /* maxNrofPUCCH-ResourceSets = 4 */
/*
-- PUCCH resources of format0 and format1 are only allowed in the first PUCCH reosurce set,
-- i.e., in a PUCCH-ResourceSet with pucch-ResourceSetId = 0. This set may contain between 8 and 32 resources.
-- PUCCH resources of format2, format3 and format4 are only allowed in a PUCCH-ReosurceSet with pucch-ResourceSetId > 0. If present, these sets must contain 8 resources each.
-- The UE chooses a PUCCH-Resource from this list based on the 3-bit PUCCH resource indicator field in DCI as
-- speciied in 38.213, FFS_section.
-- Note that this list contains only a list of resource IDs. The actual resources are configured in PUCCH-Config.
*/
uint8_t pucch_resource_id[MAX_NB_OF_PUCCH_RESOURCES_PER_SET]; /* pucch resources belonging to current set is a 32 bit map to address maxNrofPUCCH-ResourcesPerSet = 32 resources */
uint8_t first_resources_set_R_PUCCH; /* size of first resource set which can be higher than 8 */
/*
-- Maximum number of payload bits minus 1 that the UE may transmit using this PUCCH resource set. In a PUCCH occurrence, the UE
-- chooses the first of its PUCCH-ResourceSet which supports the number of bits that the UE wants to transmit.
-- The field is not present in the first set (Set0) since the maximum Size of Set0 is specified to be 3 bit.
-- The field is not present in the last configured set since the UE derives its maximum payload size as specified in 38.213.
-- This field can take integer values that are multiples of 4. Corresponds to L1 parameter 'N_2' or 'N_3' (see 38.213, section 9.2)
*/
uint16_t maxPayloadMinus1; /* INTEGER (4..256) */
} PUCCH_ResourceSet_t;
typedef struct {
/*
-- Enabling inter-slot frequency hopping when PUCCH Format 1, 3 or 4 is repeated over multiple slots.
-- The field is not applicable for format 2.
*/
feature_status_t interslotFrequencyHopping;
/*
-- Enabling 2 DMRS symbols per hop of a PUCCH Format 3 or 4 if both hops are more than X symbols when FH is enabled (X=4).
-- Enabling 4 DMRS sybmols for a PUCCH Format 3 or 4 with more than 2X+1 symbols when FH is disabled (X=4).
-- Corresponds to L1 parameter 'PUCCH-F3-F4-additional-DMRS' (see 38.213, section 9.2.1)
-- The field is not applicable for format 1 and 2.
*/
enable_feature_t additionalDMRS;
/*
-- Max coding rate to determine how to feedback UCI on PUCCH for format 2, 3 or 4
-- Corresponds to L1 parameter 'PUCCH-F2-maximum-coderate', 'PUCCH-F3-maximum-coderate' and 'PUCCH-F4-maximum-coderate'
-- (see 38.213, section 9.2.5)
-- The field is not applicable for format 1.
*/
PUCCH_MaxCodeRate_t maxCodeRate;
/*
-- Number of slots with the same PUCCH F1, F3 or F4. When the field is absent the UE applies the value n1.
-- Corresponds to L1 parameter 'PUCCH-F1-number-of-slots', 'PUCCH-F3-number-of-slots' and 'PUCCH-F4-number-of-slots'
-- (see 38.213, section 9.2.6)
-- The field is not applicable for format 2.
*/
uint8_t nrofSlots;
/*
-- Enabling pi/2 BPSK for UCI symbols instead of QPSK for PUCCH.
-- Corresponds to L1 parameter 'PUCCH-PF3-PF4-pi/2PBSK' (see 38.213, section 9.2.5)
-- The field is not applicable for format 1 and 2.
*/
feature_status_t pi2PBSK;
/*
-- Enabling simultaneous transmission of CSI and HARQ-ACK feedback with or without SR with PUCCH Format 2, 3 or 4
-- Corresponds to L1 parameter 'PUCCH-F2-Simultaneous-HARQ-ACK-CSI', 'PUCCH-F3-Simultaneous-HARQ-ACK-CSI' and
-- 'PUCCH-F4-Simultaneous-HARQ-ACK-CSI' (see 38.213, section 9.2.5)
-- When the field is absent the UE applies the value OFF
-- The field is not applicable for format 1.
*/
enable_feature_t simultaneousHARQ_ACK_CSI;
} PUCCH_FormatConfig_t;
typedef struct {
PUCCH_Resource_t *PUCCH_Resource[MAX_NB_OF_PUCCH_RESOURCES];
PUCCH_ResourceSet_t *PUCCH_ResourceSet[MAX_NB_OF_PUCCH_RESOURCE_SETS];
PUCCH_FormatConfig_t *formatConfig[NUMBER_PUCCH_FORMAT_NR-1]; /* format 0 is not there */
uint8_t dl_DataToUL_ACK[NB_DL_DATA_TO_UL_ACK]; /* table TS 38.213 Table 9.2.3-1: Mapping of PSDCH-to-HARQ_feedback timing indicator field values to numbers of slots */
void *spatial_Relation_Info[MAX_NR_OF_SPATIAL_RELATION_INFOS];
PUCCH_PowerControl_t pucch_PowerControl;
} PUCCH_Config_t;
/***********************************************************************
*
* FUNCTIONALITY : PhysicalCellGroupConfig
*
* DESCRIPTION : Physical cell group configuration
*
************************************************************************/
typedef uint16_t RNTI_value_t;
typedef enum {
semiStatic = 0,
dynamic = 1
} pdsch_HARQ_ACK_Codebook_t;
typedef struct {
/*
-- Enables spatial bundling of HARQ ACKs. It is configured per cell group (i.e. for all the cells within the cell group) for PUCCH
-- reporting of HARQ-ACK. It is only applicable when more than 4 layers are possible to schedule.
-- Corresponds to L1 parameter 'HARQ-ACK-spatial-bundling' (see 38.213, section FFS_Section)
-- Absence indicates that spatial bundling is disabled.
*/
bool harq_ACK_SpatialBundlingPUCCH;
/*
-- Enables spatial bundling of HARQ ACKs. It is configured per cell group (i.e. for all the cells within the cell group) for PUSCH
-- reporting of HARQ-ACK. It is only applicable when more than 4 layers are possible to schedule.
-- Corresponds to L1 parameter 'HARQ-ACK-spatial-bundling' (see 38.213, section FFS_Section)
-- Absence indicates that spatial bundling is disabled.
*/
bool harq_ACK_SpatialBundlingPUSCH;
/*
-- The maximum transmit power to be used by the UE in this NR cell group.
*/
uint8_t p_NR;
/*
-- The PDSCH HARQ-ACK codebook is either semi-static of dynamic. This is applicable to both CA and none CA operation.
-- Corresponds to L1 parameter 'HARQ-ACK-codebook' (see 38.213, section FFS_Section)
*/
pdsch_HARQ_ACK_Codebook_t pdsch_HARQ_ACK_Codebook;
/*
-- RNTI used for SRS TPC commands on DCI. Corresponds to L1 parameter 'TPC-SRS-RNTI' (see 38.213, section 10)
*/
RNTI_value_t tpc_SRS_RNTI;
/*
-- RNTI used for PUCCH TPC commands on DCI. Corresponds to L1 parameter 'TPC-PUCCH-RNTI' (see 38.213, section 10).
*/
RNTI_value_t tpc_PUCCH_RNTI;
/*
-- RNTI used for PUSCH TPC commands on DCI. Corresponds to L1 parameter 'TPC-PUSCH-RNTI' (see 38.213, section 10)
*/
RNTI_value_t tpc_PUSCH_RNTI;
} PhysicalCellGroupConfig_t;
/***********************************************************************
*
* FUNCTIONALITY : CellGroupConfig
*
* DESCRIPTION : Cell Group configuration
*
************************************************************************/
/* FFS TODO_NR partial structure that should be complete */
typedef struct {
/*
cellGroupId CellGroupId,
-- Logical Channel configuration and association with radio bearers:
rlc-BearerToAddModList SEQUENCE (SIZE(1..maxLC-ID)) OF RLC-Bearer-Config OPTIONAL, -- Need N
rlc-BearerToReleaseList SEQUENCE (SIZE(1..maxLC-ID)) OF LogicalChannelIdentity OPTIONAL, -- Need N
-- Parameters applicable for the entire cell group:
mac-CellGroupConfig MAC-CellGroupConfig OPTIONAL, -- Need M
*/
PhysicalCellGroupConfig_t physicalCellGroupConfig;
/*
-- Serving Cell specific parameters (SpCell and SCells)
spCellConfig SpCellConfig OPTIONAL, -- Need M
sCellToAddModList SEQUENCE (SIZE (1..maxNrofSCells)) OF SCellConfig OPTIONAL, -- Need N
-- List of seconary serving cells to be released (not applicable for SpCells)
sCellToReleaseList SEQUENCE (SIZE (1..maxNrofSCells)) OF SCellIndex OPTIONAL, -- Need N
...
*/
} CellGroupConfig_t;
/***********************************************************************
*
* FUNCTIONALITY : PDSCH_ServingCellConfig
*
* DESCRIPTION : pdsch serving cell configuration
*
************************************************************************/
/* FFS TODO_NR partial structure that should be complete */
typedef int PDSCH_CodeBlockGroupTransmission_t; /* dummy struct which should be change by correct structure */
typedef enum {
xOh6 = 0,
xOh12 = 1,
xOh18 = 2
} xOverhead_t;
typedef enum {
n2_dl_harq = 2,
n4_dl_harq = 4,
n6_dl_harq = 6,
n10_dl_harq = 10,
n12_dl_harq = 12,
n16_dl_harq = 16
} nrofHARQ_ProcessesForPDSCH_t;
typedef struct {
/*
-- Enables and configures code-block-group (CBG) based transmission (see 38.213, section 9.1.1)
*/
PDSCH_CodeBlockGroupTransmission_t *codeBlockGroupTransmission;
/*
-- Accounts for overhead from CSI-RS, CORESET, etc. If the field is absent, the UE applies value xOh0.
-- Corresponds to L1 parameter 'Xoh-PDSCH' (see 38.214, section 5.1.3.2)
*/
xOverhead_t xOverhead;
/*
-- The number of HARQ processes to be used on the PDSCH of a serving cell. n2 corresponds to 2 HARQ processes, n4 to 4 HARQ processes
-- and so on. If the field is absent, the UE uses 8 HARQ processes.
-- Corresponds to L1 parameter 'number-HARQ-process-PDSCH' (see 38.214, section REF)
*/
nrofHARQ_ProcessesForPDSCH_t nrofHARQ_ProcessesForPDSCH;
/*
-- The ID of the serving cell (of the same cell group) to use for PUCCH.
-- If the field is absent, the UE sends the HARQ feedback on the PUCCH of the SpCell of this cell group.
*/
uint8_t pucch_Cell;
} PDSCH_ServingCellConfig_t;
/***********************************************************************
*
* FUNCTIONALITY : Scheduling Request Configuration (SR)
*
* DESCRIPTION : Configuration for Scheduling Request send on PUCCH
* In the case that scheduling should be send alone
* in a PUCCH, it should used its configuration.
*
************************************************************************/
#define MAX_NR_OF_SR_CONFIG_PER_CELL_GROUP (8)
#define NB_SR_PERIOD (15)
const uint16_t scheduling_request_periodicity[NB_SR_PERIOD]
#ifdef INIT_VARIABLES_PHY_IMPLEMENTATION_DEFS_NR_H
= { 0, 0, 1, 2, 4, 5, 8, 10, 16, 20, 40, 80, 160, 320, 640 }
#endif
;
typedef enum {
sr_sym2 = 0,
sr_sym6or7 = 1,
sr_sl1 = 2,
sr_sl2 = 3,
sr_sl4 = 4,
sr_sl5 = 5,
sr_sl8 = 6,
sr_sl10 = 7,
sr_sl16 = 8,
sr_sl20 = 9,
sr_sl40 = 10,
sr_sl80 = 11,
sr_sl160 = 12,
sr_sl320 = 13,
sr_sl640 = 14
} sr_periodicity_t;
typedef struct {
uint8_t schedulingRequestResourceId;
/*
-- The ID of the SchedulingRequestConfig that uses this scheduling request resource.
*/
uint8_t schedulingRequestID;
/*
-- SR periodicity and offset in number of slots. Corresponds to L1 parameter 'SR-periodicity' and 'SR-offset' (see 38.213, section 9.2.2)
-- The following periodicities may be configured depending on the chosen subcarrier spacing:
-- SCS = 15 kHz: 2sym, 7sym, 1sl, 2sl, 4sl, 5sl, 8sl, 10sl, 16sl, 20sl, 40sl, 80sl
-- SCS = 30 kHz: 2sym, 7sym, 1sl, 2sl, 4sl, 8sl, 10sl, 16sl, 20sl, 40sl, 80sl, 160sl
-- SCS = 60 kHz: 2sym, 7sym/6sym, 1sl, 2sl, 4sl, 8sl, 16sl, 20sl, 40sl, 80sl, 160sl, 320sl
-- SCS = 120 kHz: 2sym, 7sym, 1sl, 2sl, 4sl, 8sl, 16sl, 40sl, 80sl, 160sl, 320sl, sl640
-- sym6or7 corresponds to 6 symbols if extended cyclic prefix and a SCS of 60 kHz are configured, otherwise it corresponds to 7 symbols.
-- For periodicities sym2, sym7 and sl1 the UE assumes an offset of 0 slots.
*/
sr_periodicity_t periodicity;
uint16_t offset;
/*
-- ID of the PUCCH resource in which the UE shall send the scheduling request. The
-- actual PUCCH-Resource is configured in PUCCH-Config of the same UL BWP and serving cell as this SchedulingRequestResourceConfig.
-- The network configures a PUCCH-Resource of PUCCH-format0 or PUCCH-format1
-- (other formats not supported). Corresponds to L1 parameter 'SR-resource' (see 38.213, section 9.2.2)
*/
uint8_t resource;
} SchedulingRequestResourceConfig_t;
typedef struct {
int active_sr_id;
SchedulingRequestResourceConfig_t *sr_ResourceConfig[MAX_NR_OF_SR_CONFIG_PER_CELL_GROUP];
} scheduling_request_config_t;
#undef EXTERN
#undef INIT_VARIABLES_PHY_IMPLEMENTATION_DEFS_NR_H
......
......@@ -256,6 +256,21 @@
/// Threshold for PUCCH Format 1a/1b detection
#define PUCCH1a_THRES 4
//#if defined(UPGRADE_RAT_NR)
#if 1
#define NB_NUMEROLOGIES_NR (5)
#define TDD_CONFIG_NB_FRAMES (2)
#define NR_MAX_SLOTS_PAR_FRAME (160) /* number of slots per frame */
#define NR_UE_CAPABILITY_SLOT_RX_TO_TX (4) /* FFS_NR_TODO it defines ue capability which is the number of slots */
/* - between reception of pdsch and tarnsmission of its acknowlegment */
/* - between reception of un uplink grant and its related transmission */
#define NR_MAX_HARQ_PROCESSES (16)
#define NR_MAX_ULSCH_HARQ_PROCESSES (NR_MAX_HARQ_PROCESSES) /* cf 38.214 6.1 UE procedure for receiving the physical uplink shared channel */
#define NR_MAX_DLSCH_HARQ_PROCESSES (NR_MAX_HARQ_PROCESSES) /* cf 38.214 5.1 UE procedure for receiving the physical downlink shared channel */
#endif
/// Data structure for transmission.
typedef struct {
/// RAW TX sample buffer
......
......@@ -24,7 +24,6 @@
#include "PHY/types.h"
#include "PHY/defs_nr_UE.h"
#include "PHY/phy_vars_nr_ue.h"
#include "common/ran_context.h"
......@@ -45,7 +44,7 @@ int16_t *primary_synch2_time;
#ifndef OCP_FRAMEWORK
PHY_VARS_NR_UE ***PHY_vars_UE_g;
PHY_VARS_eNB ***PHY_vars_eNB_g;
LTE_DL_FRAME_PARMS *lte_frame_parms_g;
NR_DL_FRAME_PARMS *lte_frame_parms_g;
#else
PHY_VARS_NR_UE * PHY_vars_UE_g[MAX_UE][MAX_NUM_CCs]={NULL};
......
......@@ -219,6 +219,7 @@ void ra_failed(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
*/
void ra_succeeded(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
#if 0
/*! \brief Compute ACK/NACK information for PUSCH/PUCCH for UE transmission in subframe n. This function implements table 10.1-1 of 36.213, p. 69.
@param frame_parms Pointer to DL frame parameter descriptor
@param harq_ack Pointer to dlsch_ue harq_ack status descriptor
......@@ -264,6 +265,7 @@ uint8_t nr_ul_ACK_subframe2_M(NR_DL_FRAME_PARMS *frame_parms,unsigned char subfr
@param eNB_id ID of eNB which is to receive the SR
@returns 1 if TXOp is active.
*/
#endif
uint8_t nr_is_SR_TXOp(PHY_VARS_NR_UE *phy_vars_ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id);
/*! \brief Gives the UL subframe corresponding to a PDDCH order in subframe n
......@@ -295,6 +297,7 @@ unsigned int get_tx_amp(int power_dBm, int power_max_dBm, int N_RB_UL, int nb_rb
void phy_reset_ue(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
#if 0
/*! \brief This function retrives the resource (n1_pucch) corresponding to a PDSCH transmission in
subframe n-4 which is acknowledged in subframe n (for FDD) according to n1_pucch = Ncce + N1_pucch. For
TDD, this routine computes the complex procedure described in Section 10.1 of 36.213 (through tables 10.1-1,10.1-2)
......@@ -313,7 +316,7 @@ uint16_t nr_get_n1_pucch(PHY_VARS_NR_UE *phy_vars_ue,
uint8_t *b,
uint8_t SR);
#endif
/*! \brief This function retrieves the PHY UE mode. It is used as a helper function for the UE MAC.
@param Mod_id Local UE index on which to act
@param CC_id Component Carrier Index
......
/*
* 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
*/
/**********************************************************************
*
* FILENAME : harq_nr.c
*
* MODULE : HARQ
*
* DESCRIPTION : functions related to HARQ feature (Hybrid Automatic Repeat Request Acknowledgment)
* This feature allows to acknowledge downlink and uplink transport blocks
* TS 38.214 5.1 UE procedure for transmitting the physical downlink shared channel
* TS 38.214 6.1 UE procedure for transmitting the physical uplink shared channel
* TS 38.214 6.1.2.1 Resource allocation in time domain
* TS 38.212 7.3 Downlink control information
* TS 38.213 9.2.3 UE procedure for reporting HARQ-ACK
* TS 38.321 5.4.1 UL Grant reception
* TS 38.321 5.4.2.1 HARQ Entity
*
* Downlink HARQ mechanism
* -----------------------
* A downlink DCI is received in a PDCCH.
* Then received parameters are communicated to HARQ entity (including NDI new data indicator and K which is the number of slots
* between current reception and transmission of this downlink acknowledgment.
*
* Reception on slot n transmission of acknowledgment
* slot k
* ---+---------------+---
* | |
* Frame | PUCCH / PUSCH |
* Subframe | |
* Slot n ---+------------+--+---
* ---+-------------+--- / |
* | PDCCH | / |
* | DCI | / |
* | downlink | +---------------+/ |
* | NDI--->------------->----------| downlink HARQ | |
* | k | | entity | |
* ---+-----|-------+--- +---------------+ |
* | | |
* v |/__________________________________________\|
* | \ slot between reception and transmission /|
* |________________________^
*
* Uplink HARQ mechanism
* ---------------------
* An uplink DCI is received in a PDCCH.
* Then received parameters are communicated to HARQ entity (including NDI new data indicator and K which is the number of slots
* between current reception and related PUSCH transmission).
* Uplink HARQ entity decides to transmit a new block or to retransmit current one.
* transmission/retransmission parameters should be determined based on received parameters.
*
* Reception on slot n Transmission on slot k
* slot k
* ---+---------------+---
* | PUSCH |
* Frame | Transmission |
* Subframe | Retransmission|
* Slot n ---+------------+--+---
* ---+-------------+--- / |
* | PDCCH | / |
* | DCI | / |
* | uplink | +-------------+/ |
* | NDI--->------------->----------->| uplink HARQ | |
* | k | | entity | |
* ---+-----|-------+--- +-------------+ |
* | | |
* v |/__________________________________________\|
* | \ slot between reception and transmission /|
* |________________________^
************************************************************************/
#include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h"
#include "SCHED_NR_UE/harq_nr.h"
/*******************************************************************
*
* NAME : config_uplink_harq_process
*
* PARAMETERS : pointer to ue context
* id of current gNB
* number of uplink processes
* maximum number of uplink retransmissions
* RETURN : none
*
* DESCRIPTION : configuration of uplink HARQ entity
*
*********************************************************************/
void config_uplink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, uint8_t number_harq_processes_pusch)
{
NR_UE_ULSCH_t *ulsch;
ulsch = (NR_UE_ULSCH_t *)malloc16(sizeof(NR_UE_ULSCH_t));
if (ulsch != NULL) {
memset(ulsch,0,sizeof(NR_UE_ULSCH_t));
ue->ulsch[gNB_id] = ulsch;
}
else {
LOG_E(PHY, "Fatal memory allocation problem at line %d in function %s of file %s \n", __LINE__ , __func__, __FILE__);
assert(0);
}
ulsch->number_harq_processes_for_pusch = number_harq_processes_pusch;
/* allocation of HARQ process context */
for (int harq_pid = 0; harq_pid < number_harq_processes_pusch; harq_pid++) {
ulsch->harq_processes[harq_pid] = (NR_UL_UE_HARQ_t *)malloc16(sizeof(NR_UL_UE_HARQ_t));
if (ulsch->harq_processes[harq_pid] == NULL) {
LOG_E(PHY, "Fatal memory allocation problem at line %d in function %s of file %s \n", __LINE__ , __func__, __FILE__);
assert(0);
}
ulsch->harq_processes[harq_pid]->subframe_scheduling_flag = 0;
ulsch->harq_processes[harq_pid]->first_tx = 1;
ulsch->harq_processes[harq_pid]->round = 0;
}
}
/*******************************************************************
*
* NAME : release_uplink_harq_process
*
* PARAMETERS : pointer to ue context
* id of current gNB
*
* RETURN : none
*
* DESCRIPTION : release of HARQ uplink entity
*
*********************************************************************/
void release_uplink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id)
{
NR_UE_ULSCH_t *ulsch = ue->ulsch[gNB_id];
for (int process_id = 0; process_id < ulsch->number_harq_processes_for_pusch; process_id++) {
free16(ulsch->harq_processes[process_id],sizeof(NR_UL_UE_HARQ_t));
ulsch->harq_processes[process_id] = NULL;
}
free16(ulsch, sizeof(NR_UE_ULSCH_t));
ue->ulsch[gNB_id] = NULL;
}
/*******************************************************************
*
* NAME : set_tx_harq_id
*
* PARAMETERS : ue context
* slot_tx slot for transmission
* gNB_id identifier
*
* RETURN : none
*
* DESCRIPTION : store tx harq process identifier for given transmission slot
*
*********************************************************************/
void set_tx_harq_id(PHY_VARS_NR_UE *ue, int gNB_id, int harq_pid, int slot_tx)
{
ue->ulsch[gNB_id]->harq_process_id[slot_tx] = harq_pid;
}
/*******************************************************************
*
* NAME : get_tx_harq_id
*
* PARAMETERS : ue context
* slot_tx slot for transmission
* gNB_id identifier
*
* RETURN : harq process identifier
*
* DESCRIPTION : return tx harq process identifier for given transmission slot
*
*********************************************************************/
int get_tx_harq_id(PHY_VARS_NR_UE *ue, int gNB_id, int slot_tx)
{
return (ue->ulsch[gNB_id]->harq_process_id[slot_tx]);
}
/*******************************************************************
*
* NAME : get_dci_slot_rx_to_tx
*
* PARAMETERS : dci index
*
* RETURN : number of slots
*
* DESCRIPTION : extract from DCI number of slots between current reception and its related transmission
*
*********************************************************************/
int get_dci_slot_rx_to_tx(int dci_index)
{
return (4);
}
/*******************************************************************
*
* NAME : uplink_harq_process
*
* PARAMETERS : ue context
* slot_tx slot for transmission
* gNB_id identifier
* ndi from DCI
* rnti_type from DCI
*
* RETURN : true it a new transmission
* false it is a retransmission
*
* DESCRIPTION : manage uplink grant information for transmissions/retransmissions
* TS 38.321 5.4.1 UL Grant reception
* TS 38.321 5.4.2.1 HARQ Entity
*
*********************************************************************/
harq_result_t uplink_harq_process(NR_UE_ULSCH_t *ulsch, int harq_pid, int ndi, nr_rnti_type_t rnti_type)
{
harq_result_t result_harq = RETRANSMISSION_HARQ;
if ((rnti_type != C_RNTI_NR) && (rnti_type != Temporary_C_RNTI_NR)) {
LOG_E(PHY, "Fatal error in HARQ entity due to unsupported RNTI at line %d in function %s of file %s \n", __LINE__ , __func__, __FILE__);
assert(0);
}
else if (harq_pid > ulsch->number_harq_processes_for_pusch) {
LOG_E(PHY, "Fatal error in HARQ entity due to unknown process identity %d at line %d in function %s of file %s \n", harq_pid, __LINE__ , __func__, __FILE__);
assert(0);
}
/* 38.321 5.4.2.1 2> if the uplink grant was received on PDCCH for the C-RNTI and the HARQ buffer of the identified process is empty */
if ((ulsch->harq_processes[harq_pid]->first_tx == 1) && (rnti_type == C_RNTI_NR)) { /* no transmission yet on this process so consider its harq buffer as empty */
ulsch->harq_processes[harq_pid]->first_tx = 0;
ulsch->harq_processes[harq_pid]->DCINdi = ndi; /* store first value of ndi */
ulsch->harq_processes[harq_pid]->round = 0;
ulsch->harq_processes[harq_pid]->subframe_scheduling_flag = 1;
result_harq = NEW_TRANSMISSION_HARQ;
NR_TST_PHY_PRINTF("[HARQ-UL-PUSCH harqId : %d] first new transmission \n", harq_pid);
}
/* 38.321 5.4.2.1 2> if the received grant was not addressed to a Temporary C-RNTI on PDCCH, and the NDI provided in the associated HARQ */
/* information has been toggled compared to the value in the previous transmission of this TB of this HARQ process */
else if ((ulsch->harq_processes[harq_pid]->DCINdi != ndi) && (rnti_type != Temporary_C_RNTI_NR)) { /* is ndi toogled so this is a new grant ? */
ulsch->harq_processes[harq_pid]->DCINdi = ndi; /* store first value of ndi */
ulsch->harq_processes[harq_pid]->round = 0;
ulsch->harq_processes[harq_pid]->subframe_scheduling_flag = 1;
result_harq = NEW_TRANSMISSION_HARQ;
NR_TST_PHY_PRINTF("[HARQ-UL-PUSCH harqId : %d] new transmission due to toogle of ndi \n", harq_pid);
}
/* 38.321 5.4.2.1 2> else (i.e. retransmission): */
else {
ulsch->harq_processes[harq_pid]->DCINdi = ndi; /* ndi has not toggled si this is a retransmission */
ulsch->harq_processes[harq_pid]->round++; /* increment number of retransmission */
result_harq = RETRANSMISSION_HARQ;
NR_TST_PHY_PRINTF("[HARQ-UL-PUSCH harqId : %d] retransmission \n", harq_pid);
}
return (result_harq);
}
/*******************************************************************
*
* NAME : init_downlink_harq_status
*
* PARAMETERS : pointer to dl harq status
*
* RETURN : none
*
* DESCRIPTION : initialisation of downlink HARQ status
*
*********************************************************************/
void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq)
{
dl_harq->status = SCH_IDLE;
dl_harq->first_tx = 1;
dl_harq->round = 0;
dl_harq->harq_ack.ack = DL_ACKNACK_NO_SET;
dl_harq->harq_ack.send_harq_status = 0;
dl_harq->harq_ack.vDAI_UL = UL_DAI_NO_SET;
dl_harq->harq_ack.vDAI_DL = DL_DAI_NO_SET;
dl_harq->harq_ack.slot_for_feedback_ack = NR_MAX_SLOTS_PAR_FRAME;
dl_harq->harq_ack.pucch_resource_indicator = MAX_PUCCH_RESOURCE_INDICATOR;
dl_harq->harq_ack.n_CCE = 0;
dl_harq->harq_ack.N_CCE = 0;;
}
/*******************************************************************
*
* NAME : config_downlink_harq_process
*
* PARAMETERS : pointer to ue context
* id of current gNB
* number of downlink processes
*
* RETURN : none
*
* DESCRIPTION : configuration of downlink HARQ entity
*
*********************************************************************/
void config_downlink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, int TB_id, int execution_thread_number, uint8_t number_harq_processes_for_pdsch)
{
NR_UE_DLSCH_t *dlsch;
dlsch = (NR_UE_DLSCH_t *)malloc16(sizeof(NR_UE_DLSCH_t));
if (dlsch != NULL) {
memset(dlsch,0,sizeof(NR_UE_DLSCH_t));
ue->dlsch[execution_thread_number][gNB_id][TB_id] = dlsch;
}
else {
LOG_E(PHY, "Fatal memory allocation problem at line %d in function %s of file %s \n", __LINE__ , __func__, __FILE__);
assert(0);
}
dlsch->Mdlharq = number_harq_processes_for_pdsch; /* an additional HARQ is reserved for PBCCH */
dlsch->number_harq_processes_for_pdsch = number_harq_processes_for_pdsch;
/* allocation of HARQ process context */
for (int harq_pid = 0; harq_pid < number_harq_processes_for_pdsch; harq_pid++) {
dlsch->harq_processes[harq_pid] = (NR_DL_UE_HARQ_t *)malloc16(sizeof(NR_DL_UE_HARQ_t));
if (dlsch->harq_processes[harq_pid] == NULL) {
LOG_E(PHY, "Fatal memory allocation problem at line %d in function %s of file %s \n", __LINE__ , __func__, __FILE__);
assert(0);
}
memset(dlsch->harq_processes[harq_pid],0,sizeof(NR_DL_UE_HARQ_t));
NR_DL_UE_HARQ_t *dl_harq = dlsch->harq_processes[harq_pid];
init_downlink_harq_status(dl_harq);
}
}
/*******************************************************************
*
* NAME : release_downlink_harq_process
*
* PARAMETERS : pointer to ue context
* id of current gNB
* TB_id transport block identity 0 or 1
* execution_thread_number thread number for current downlink processing
* RETURN : none
*
* DESCRIPTION : release of HARQ downlink entity
*
*********************************************************************/
void release_downlink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, int TB_id, int execution_thread_number)
{
NR_UE_DLSCH_t *dlsch = ue->dlsch[execution_thread_number][gNB_id][TB_id];
for (int process_id = 0; process_id < dlsch->Mdlharq; process_id++) {
free16(dlsch->harq_processes[process_id],sizeof(NR_DL_UE_HARQ_t));
dlsch->harq_processes[process_id] = NULL;
}
free16(dlsch,sizeof(NR_UE_DLSCH_t));
ue->dlsch[execution_thread_number][gNB_id][TB_id] = NULL;
}
/*******************************************************************
*
* NAME : downlink_harq_process
*
* PARAMETERS : downlink harq context
* harq identifier
* ndi (new data indicator) from DCI
* rnti_type from DCI
*
* RETURN : none
*
* DESCRIPTION : manage downlink information from DCI for downlink transmissions/retransmissions
* TS 38.321 5.3.1 DL Assignment reception
* TS 38.321 5.3.2 HARQ operation
*
*********************************************************************/
harq_result_t downlink_harq_process(NR_DL_UE_HARQ_t *dl_harq, int harq_pid, int ndi, nr_rnti_type_t rnti_type)
{
harq_result_t result_harq = RETRANSMISSION_HARQ;
if ((rnti_type != C_RNTI_NR) && (rnti_type != Temporary_C_RNTI_NR)) {
LOG_E(PHY, "Fatal error in HARQ entity due to unknown RNTI at line %d in function %s of file %s \n", __LINE__ , __func__, __FILE__);
assert(0);
}
if (dl_harq->first_tx == 1) {
dl_harq->round = 0;
dl_harq->status = ACTIVE;
dl_harq->DCINdi = ndi;
dl_harq->first_tx = 0;
result_harq = NEW_TRANSMISSION_HARQ;
NR_TST_PHY_PRINTF("[HARQ-DL-PDSCH harqId : %d] first new reception \n", harq_pid);
} else if (dl_harq->DCINdi != ndi) {
dl_harq->round = 0;
dl_harq->status = ACTIVE;
dl_harq->DCINdi = ndi;
result_harq = NEW_TRANSMISSION_HARQ;
NR_TST_PHY_PRINTF("[HARQ-DL-PDSCH harqId : %d] new reception due to toogle of ndi \n", harq_pid);
} else {
dl_harq->round++;
result_harq = RETRANSMISSION_HARQ;
NR_TST_PHY_PRINTF("[HARQ-DL-PDSCH harqId : %d] reception of a retransmission \n", harq_pid);
}
return (result_harq);
}
/*
* 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
*/
/***********************************************************************
*
* FILENAME : harq_nr.h
*
* MODULE : HARQ
*
* DESCRIPTION : header related to Hybrid Automatic Repeat Request Acknowledgment
* This feature allows to acknowledge downlink and uplink transport blocks
*
************************************************************************/
#ifndef HARQ_NR_H
#define HARQ_NR_H
/************** DEFINE ********************************************/
#if 0
/* these define are in file PHY/impl_defs_top.h" because of compilation problems due to multiple header files inclusions */
#define NR_MAX_HARQ_PROCESSES (16)
#define NR_MAX_ULSCH_HARQ_PROCESSES (NR_MAX_HARQ_PROCESSES) /* TS 38.214 6.1 UE procedure for receiving the physical uplink shared channel */
#define NR_MAX_DLSCH_HARQ_PROCESSES (NR_MAX_HARQ_PROCESSES) /* TS 38.214 5.1 UE procedure for receiving the physical downlink shared channel */
#endif
#define NR_DEFAULT_DLSCH_HARQ_PROCESSES (8) /* TS 38.214 5.1 */
#define NR_DL_MAX_DAI (4) /* TS 38.213 table 9.1.3-1 Value of counter DAI for DCI format 1_0 and 1_1 */
#define NR_DL_MAX_NB_CW (2) /* number of downlink code word */
#define DL_ACKNACK_NO_SET (2)
#define DL_NACK (0)
#define DL_ACK (1)
#define DL_MAX_NB_FEEDBACK (NR_DL_MAX_DAI * NR_DL_MAX_NB_CW)
#define DL_DAI_NO_SET (0xFF)
#define UL_DAI_NO_SET (DL_DAI_NO_SET)
/************** INCLUDE *******************************************/
#include "PHY/defs_nr_UE.h"
/************* TYPE ***********************************************/
typedef enum {
NEW_TRANSMISSION_HARQ,
RETRANSMISSION_HARQ
} harq_result_t;
/************** VARIABLES *****************************************/
/*************** FUNCTIONS ****************************************/
/** \brief This function configures uplink HARQ context
@param PHY_VARS_NR_UE ue context
@param gNB_id gNodeB identifier
@param number_harq_processes_pusch maximum number of uplink HARQ processes
@returns none */
void config_uplink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, uint8_t number_harq_processes_pusch);
/** \brief This function releases uplink HARQ context
@param PHY_VARS_NR_UE ue context
@param gNB_id gNodeB identifier
@returns none */
void release_uplink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id);
/** \brief This function stores slot for transmission in HARQ context
@param ulsch_harq uplink harq context
@param harq process identifier harq_pid
@param slot_tx slot for transmission related to current downlink PDCCH
@returns 0 none */
void set_tx_harq_id(PHY_VARS_NR_UE *ue, int gNB_id, int harq_pid, int slot_tx);
/** \brief This function initialises context of an uplink HARQ process
@param ulsch_harq uplink harq context
@param harq process identifier harq_pid
@returns 0 none */
int get_tx_harq_id(PHY_VARS_NR_UE *ue, int gNB_id, int slot_tx);
/** \brief This function returns number of slots between current reception and related transmission
@param dci value
@returns slots number between reception and related transmission */
int get_dci_slot_rx_to_tx(int dci_index);
/** \brief This function update uplink harq context and return transmission type (new transmission or retransmission)
@param ulsch uplink harq context
@param harq process identifier harq_pid
@returns retransmission or new transmission */
harq_result_t uplink_harq_process(NR_UE_ULSCH_t *ulsch, int harq_pid, int ndi, nr_rnti_type_t rnti_type);
/** \brief This function initialises downlink HARQ status
@param pointer to downlink harq status
@returns none */
void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq);
/** \brief This function configures downlink HARQ context
@param PHY_VARS_NR_UE ue context
@param gNB_id gNodeB identifier
@param TB_id transport block identifier
@param execution_thread_number thread_number
@param number_harq_processes maximum number of downlink HARQ processes
@returns none */
void config_downlink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, int TB_id, int execution_thread_number, uint8_t number_harq_processes);
/** \brief This function releases downlink HARQ context
@param PHY_VARS_NR_UE ue context
@param gNB_id gNodeB identifier
@param TB_id transport block identifier
@param execution_thread_number thread_number
@returns none */
void release_downlink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, int TB_id, int execution_thread_number);
/** \brief This function update downlink harq context and return reception type (new transmission or retransmission)
@param dlsch downlink harq context
@param harq process identifier harq_pid
@param rnti_type type of rnti
@returns retransmission or new transmission */
harq_result_t downlink_harq_process(NR_DL_UE_HARQ_t *dlsch, int harq_pid, int ndi, nr_rnti_type_t rnti_type);
#undef EXTERN
#undef INIT_VARIABLES_HARQ_NR_H
#endif /* HARQ_NR_H */
/*
* 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
*/
/***********************************************************************
*
* FILENAME : phy_frame_configuration_nr.c
*
* DESCRIPTION : functions related to FDD/TDD configuration for NR
* see TS 38.213 11.1 Slot configuration
* and TS 38.331 for RRC configuration
*
************************************************************************/
#include "SCHED_NR_UE/defs.h"
#include "PHY/defs_nr_UE.h"
#include "SCHED_NR_UE/phy_frame_config_nr.h"
/*******************************************************************
*
* NAME : set_tdd_configuration
*
* PARAMETERS : pointer to frame configuration
*
* OUTPUT: table of uplink symbol for each slot for 2 frames
*
* RETURN : 0 if tdd has been properly configurated
* -1 tdd configuration can not be done
*
* DESCRIPTION : generate bit map for uplink symbol for each slot for several frames
* see TS 38.213 11.1 Slot configuration
*
*********************************************************************/
int set_tdd_config_nr(NR_DL_FRAME_PARMS *frame_parms, int dl_UL_TransmissionPeriodicity,
int nrofDownlinkSlots, int nrofDownlinkSymbols,
int nrofUplinkSlots, int nrofUplinkSymbols)
{
TDD_UL_DL_configCommon_t *p_tdd_ul_dl_configuration;
int slot_number = 0;
int nb_slots_to_set = TDD_CONFIG_NB_FRAMES*(frame_parms->ttis_per_subframe * LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
/* allocate buffer for configuration structure */
p_tdd_ul_dl_configuration = calloc( 1, sizeof(TDD_UL_DL_configCommon_t));
if (p_tdd_ul_dl_configuration == NULL) {
printf("Error test_frame_configuration: memory allocation problem \n");
assert(0);
}
else {
frame_parms->frame_type = TDD;
}
p_tdd_ul_dl_configuration->dl_UL_TransmissionPeriodicity = dl_UL_TransmissionPeriodicity;
p_tdd_ul_dl_configuration->nrofDownlinkSlots = nrofDownlinkSlots;
p_tdd_ul_dl_configuration->nrofDownlinkSymbols = nrofDownlinkSymbols;
p_tdd_ul_dl_configuration->nrofUplinkSlots = nrofUplinkSlots;
p_tdd_ul_dl_configuration->nrofUplinkSymbols = nrofUplinkSymbols;
frame_parms->p_tdd_UL_DL_Configuration = p_tdd_ul_dl_configuration;
int nb_periods_per_frame = (FRAME_DURATION_MICRO_SEC/dl_UL_TransmissionPeriodicity);
int nb_slots_per_period = (frame_parms->ttis_per_subframe * LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)/nb_periods_per_frame;
if (nb_slots_per_period != (nrofDownlinkSlots + nrofUplinkSlots)) {
LOG_E(PHY,"set_tdd_configuration_nr: given period is inconsistent with current tdd configuration \n");
return (-1);
}
while(slot_number != nb_slots_to_set) {
for (int number_of_slot = 0; number_of_slot < nrofDownlinkSlots; number_of_slot++) {
frame_parms->tdd_uplink_nr[slot_number] = NR_TDD_DOWNLINK_SLOT;
slot_number++;
}
if (p_tdd_ul_dl_configuration->nrofDownlinkSymbols != 0) {
LOG_E(PHY,"set_tdd_configuration_nr: downlink symbol for slot is not supported for tdd configuration \n");
return (-1);
}
for (int number_of_slot = 0; number_of_slot < nrofUplinkSlots; number_of_slot++) {
frame_parms->tdd_uplink_nr[slot_number] = NR_TDD_UPLINK_SLOT;
slot_number++;
}
if (p_tdd_ul_dl_configuration->nrofUplinkSymbols != 0) {
LOG_E(PHY,"set_tdd_configuration_nr: uplink symbol for slot is not supported for tdd configuration \n");
return (-1);
}
}
if (frame_parms->p_tdd_UL_DL_ConfigurationCommon2 != NULL) {
LOG_E(PHY,"set_tdd_configuration_nr: additionnal tdd configuration 2 is not supported for tdd configuration \n");
return (-1);
}
return (0);
}
/*******************************************************************
*
* NAME : add_tdd_dedicated_configuration_nr
*
* PARAMETERS : pointer to frame configuration
*
* OUTPUT: table of uplink symbol for each slot for several frames
*
* RETURN : 0 if tdd has been properly configurated
* -1 tdd configuration can not be done
*
* DESCRIPTION : generate bit map for uplink symbol for each slot for several frames
* see TS 38.213 11.1 Slot configuration
*
*********************************************************************/
void add_tdd_dedicated_configuration_nr(NR_DL_FRAME_PARMS *frame_parms, int slotIndex, int nrofDownlinkSymbols, int nrofUplinkSymbols)
{
TDD_UL_DL_SlotConfig_t *p_TDD_UL_DL_ConfigDedicated = frame_parms->p_TDD_UL_DL_ConfigDedicated;
TDD_UL_DL_SlotConfig_t *p_previous_TDD_UL_DL_ConfigDedicated;
int next = 0;
while (p_TDD_UL_DL_ConfigDedicated != NULL) {
p_previous_TDD_UL_DL_ConfigDedicated = p_TDD_UL_DL_ConfigDedicated;
p_TDD_UL_DL_ConfigDedicated = (TDD_UL_DL_SlotConfig_t *)(p_TDD_UL_DL_ConfigDedicated->p_next_TDD_UL_DL_SlotConfig);
next = 1;
}
p_TDD_UL_DL_ConfigDedicated = calloc( 1, sizeof(TDD_UL_DL_SlotConfig_t));
//printf("allocate pt %p \n", p_TDD_UL_DL_ConfigDedicated);
if (p_TDD_UL_DL_ConfigDedicated == NULL) {
printf("Error test_frame_configuration: memory allocation problem \n");
assert(0);
}
if (next == 0) {
frame_parms->p_TDD_UL_DL_ConfigDedicated = p_TDD_UL_DL_ConfigDedicated;
}
else {
p_previous_TDD_UL_DL_ConfigDedicated->p_next_TDD_UL_DL_SlotConfig = (struct TDD_UL_DL_SlotConfig_t *)p_TDD_UL_DL_ConfigDedicated;
}
p_TDD_UL_DL_ConfigDedicated->slotIndex = slotIndex;
p_TDD_UL_DL_ConfigDedicated->nrofDownlinkSymbols = nrofDownlinkSymbols;
p_TDD_UL_DL_ConfigDedicated->nrofUplinkSymbols = nrofUplinkSymbols;
}
/*******************************************************************
*
* NAME : set_tdd_configuration_dedicated_nr
*
* PARAMETERS : pointer to frame configuration
*
* OUTPUT: table of uplink symbol for each slot for several frames
*
* RETURN : 0 if tdd has been properly configurated
* -1 tdd configuration can not be done
*
* DESCRIPTION : generate bit map for uplink symbol for each slot for several frames
* see TS 38.213 11.1 Slot configuration
*
*********************************************************************/
int set_tdd_configuration_dedicated_nr(NR_DL_FRAME_PARMS *frame_parms)
{
TDD_UL_DL_SlotConfig_t *p_current_TDD_UL_DL_SlotConfig;
p_current_TDD_UL_DL_SlotConfig = frame_parms->p_TDD_UL_DL_ConfigDedicated;
NR_TST_PHY_PRINTF("\nSet tdd dedicated configuration\n ");
while(p_current_TDD_UL_DL_SlotConfig != NULL) {
int slot_index = p_current_TDD_UL_DL_SlotConfig->slotIndex;
if (slot_index < TDD_CONFIG_NB_FRAMES*(frame_parms->ttis_per_subframe * LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)) {
if (p_current_TDD_UL_DL_SlotConfig->nrofDownlinkSymbols != 0) {
if (p_current_TDD_UL_DL_SlotConfig->nrofDownlinkSymbols == NR_TDD_SET_ALL_SYMBOLS) {
if (p_current_TDD_UL_DL_SlotConfig->nrofUplinkSymbols == 0) {
frame_parms->tdd_uplink_nr[slot_index] = NR_TDD_DOWNLINK_SLOT;
NR_TST_PHY_PRINTF(" DL[%d] ", slot_index);
}
else {
LOG_E(PHY,"set_tdd_configuration_dedicated_nr: tdd downlink & uplink symbol configuration is not supported \n");
return (-1);
}
}
else {
LOG_E(PHY,"set_tdd_configuration_dedicated_nr: tdd downlink symbol configuration is not supported \n");
return (-1);
}
}
else if (p_current_TDD_UL_DL_SlotConfig->nrofUplinkSymbols != 0) {
if (p_current_TDD_UL_DL_SlotConfig->nrofUplinkSymbols == NR_TDD_SET_ALL_SYMBOLS) {
frame_parms->tdd_uplink_nr[slot_index] = NR_TDD_UPLINK_SLOT;
NR_TST_PHY_PRINTF(" UL[%d] ", slot_index);
}
else {
LOG_E(PHY,"set_tdd_configuration_dedicated_nr: tdd uplink symbol configuration is not supported \n");
return (-1);
}
}
else {
LOG_E(PHY,"set_tdd_configuration_dedicated_nr: no tdd symbol configuration is specified \n");
return (-1);
}
}
else {
LOG_E(PHY,"set_tdd_configuration_dedicated_nr: tdd slot index exceeds maximum value \n");
return (-1);
}
p_current_TDD_UL_DL_SlotConfig = (TDD_UL_DL_SlotConfig_t *)(p_current_TDD_UL_DL_SlotConfig->p_next_TDD_UL_DL_SlotConfig);
}
NR_TST_PHY_PRINTF("\n");
return (0);
}
/*******************************************************************
*
* NAME : set_tdd_configuration
*
* PARAMETERS : pointer to tdd common configuration
* pointer to tdd common configuration2
* pointer to tdd dedicated configuration
*
* OUTPUT: table of uplink symbol for each slot for 2 frames
*
* RETURN : 0 if srs sequence has been successfully generated
* -1 if sequence can not be properly generated
*
* DESCRIPTION : generate bit map for uplink symbol for each slot for 2 frames
* see TS 38.213 11.1 Slot configuration
*
*********************************************************************/
nr_slot_t slot_select_nr(NR_DL_FRAME_PARMS *frame_parms, int nr_frame, int nr_tti)
{
/* for FFD all slot can be considered as an uplink */
if (frame_parms->frame_type == FDD) {
return (NR_TDD_UPLINK_SLOT);
}
if (nr_frame%2 == 0) {
if (frame_parms->tdd_uplink_nr[nr_tti] == NR_TDD_UPLINK_SLOT) {
return (NR_TDD_UPLINK_SLOT);
}
else {
return (NR_TDD_DOWNLINK_SLOT);
}
}
else if ((frame_parms->tdd_uplink_nr[(frame_parms->ttis_per_subframe * LTE_NUMBER_OF_SUBFRAMES_PER_FRAME) + nr_tti] == NR_TDD_UPLINK_SLOT)) {
return (NR_TDD_UPLINK_SLOT);
}
else {
return (NR_TDD_DOWNLINK_SLOT);
}
}
/*******************************************************************
*
* NAME : free_tdd_configuration_nr
*
* PARAMETERS : pointer to frame configuration
*
* RETURN : none
*
* DESCRIPTION : free structure related to tdd configuration
*
*********************************************************************/
void free_tdd_configuration_nr(NR_DL_FRAME_PARMS *frame_parms)
{
TDD_UL_DL_configCommon_t *p_tdd_UL_DL_Configuration = frame_parms->p_tdd_UL_DL_Configuration;
free_tdd_configuration_dedicated_nr(frame_parms);
if (p_tdd_UL_DL_Configuration != NULL) {
frame_parms->p_tdd_UL_DL_Configuration = NULL;
free(p_tdd_UL_DL_Configuration);
}
for (int number_of_slot = 0; number_of_slot < MAX_NR_OF_SLOTS; number_of_slot++) {
frame_parms->tdd_uplink_nr[number_of_slot] = NR_TDD_DOWNLINK_SLOT;
}
}
/*******************************************************************
*
* NAME : free_tdd_configuration_dedicated_nr
*
* PARAMETERS : pointer to frame configuration
*
* RETURN : none
*
* DESCRIPTION : free structure related to tdd dedicated configuration
*
*********************************************************************/
void free_tdd_configuration_dedicated_nr(NR_DL_FRAME_PARMS *frame_parms)
{
TDD_UL_DL_SlotConfig_t *p_current_TDD_UL_DL_ConfigDedicated = frame_parms->p_TDD_UL_DL_ConfigDedicated;
TDD_UL_DL_SlotConfig_t *p_next_TDD_UL_DL_ConfigDedicated;
int next = 0;
if (p_current_TDD_UL_DL_ConfigDedicated != NULL) {
do {
if (p_current_TDD_UL_DL_ConfigDedicated->p_next_TDD_UL_DL_SlotConfig != NULL) {
next = 1;
p_next_TDD_UL_DL_ConfigDedicated = (TDD_UL_DL_SlotConfig_t *)(p_current_TDD_UL_DL_ConfigDedicated->p_next_TDD_UL_DL_SlotConfig);
p_current_TDD_UL_DL_ConfigDedicated->p_next_TDD_UL_DL_SlotConfig = NULL;
//printf("free pt %p \n", p_current_TDD_UL_DL_ConfigDedicated);
free(p_current_TDD_UL_DL_ConfigDedicated);
p_current_TDD_UL_DL_ConfigDedicated = p_next_TDD_UL_DL_ConfigDedicated;
}
else {
if (p_current_TDD_UL_DL_ConfigDedicated != NULL) {
frame_parms->p_TDD_UL_DL_ConfigDedicated = NULL;
//printf("free pt %p \n", p_current_TDD_UL_DL_ConfigDedicated);
free(p_current_TDD_UL_DL_ConfigDedicated);
next = 0;
}
}
} while (next);
}
}
/*
* 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
*/
/***********************************************************************
*
* FILENAME : phy_frame_configuration_nr.h
*
* DESCRIPTION : functions related to FDD/TDD configuration for NR
* see TS 38.213 11.1 Slot configuration
* and TS 38.331 for RRC configuration
*
************************************************************************/
#ifndef PHY_FRAME_CONFIG_NR_H
#define PHY_FRAME_CONFIG_NR_H
/************** DEFINE ********************************************/
/*************** FUNCTIONS *****************************************/
/** \brief This function processes tdd dedicated configuration for nr
* @param frame_parms NR DL Frame parameters
* @param dl_UL_TransmissionPeriodicity periodicity
* @param nrofDownlinkSlots number of downlink slots
* @param nrofDownlinkSymbols number of downlink symbols
* @param nrofUplinkSlots number of uplink slots
* @param nrofUplinkSymbols number of uplink symbols
@returns 0 if tdd dedicated configuration has been properly set or -1 on error with message */
int set_tdd_config_nr(NR_DL_FRAME_PARMS *frame_parms, int dl_UL_TransmissionPeriodicity,
int nrofDownlinkSlots, int nrofDownlinkSymbols,
int nrofUplinkSlots, int nrofUplinkSymbols);
/** \brief This function adds a slot configuration to current dedicated configuration for nr
* @param frame_parms NR DL Frame parameters
* @param slotIndex
* @param nrofDownlinkSymbols
* @param nrofUplinkSymbols
@returns none */
void add_tdd_dedicated_configuration_nr(NR_DL_FRAME_PARMS *frame_parms, int slotIndex,
int nrofDownlinkSymbols, int nrofUplinkSymbols);
/** \brief This function processes tdd dedicated configuration for nr
* @param frame_parms nr frame parameters
* @param dl_UL_TransmissionPeriodicity periodicity
* @param nrofDownlinkSlots number of downlink slots
* @param nrofDownlinkSymbols number of downlink symbols
* @param nrofUplinkSlots number of uplink slots
* @param nrofUplinkSymbols number of uplink symbols
@returns 0 if tdd dedicated configuration has been properly set or -1 on error with message */
int set_tdd_configuration_dedicated_nr(NR_DL_FRAME_PARMS *frame_parms);
/** \brief This function checks nr slot direction : downlink or uplink
* @param frame_parms NR DL Frame parameters
* @param nr_frame : frame number
* @param nr_tti : slot number
@returns nr_slot_t : downlink or uplink */
nr_slot_t slot_select_nr(NR_DL_FRAME_PARMS *frame_parms, int nr_frame, int nr_tti);
/** \brief This function frees tdd configuration for nr
* @param frame_parms NR DL Frame parameters
@returns none */
void free_tdd_configuration_nr(NR_DL_FRAME_PARMS *frame_parms);
/** \brief This function frees tdd dedicated configuration for nr
* @param frame_parms NR DL Frame parameters
@returns none */
void free_tdd_configuration_dedicated_nr(NR_DL_FRAME_PARMS *frame_parms);
#endif /* PHY_FRAME_CONFIG_NR_H */
......@@ -36,13 +36,14 @@
#include "defs.h"
//#include "PHY/defs.h"
#include "PHY/defs_nr_UE.h"
#include "PHY/phy_vars_nr_ue.h"
//#include "PHY/phy_vars_nr_ue.h"
#include "PHY/phy_extern_nr_ue.h"
//#include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h"
//#include "PHY/extern.h"
#include "SCHED_NR_UE/defs.h"
#include "SCHED_NR/extern.h"
#include <sched.h>
#include "targets/RT/USER/nr-softmodem.h"
//#include <sched.h>
//#include "targets/RT/USER/nr-softmodem.h"
#ifdef EMOS
#include "SCHED/phy_procedures_emos.h"
......@@ -3132,7 +3133,7 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *
int do_pdcch_monitoring_current_slot=0;
// For Type0-PDCCH searchspace, we need to calculate the monitoring slot from Tables 13-1 .. 13-15 in TS 38.213 Subsection 13
NR_UE_SLOT_PERIOD_OFFSET_t sl_period_offset_mon = pdcch_vars2->searchSpace[nb_searchspace_active].monitoringSlotPeriodicityAndOffset;
if (sl_period_offset_mon == sl1) {
if (sl_period_offset_mon == srs_sl1) {
do_pdcch_monitoring_current_slot=1; // PDCCH monitoring in every slot
} else if (nr_tti_rx%(int)sl_period_offset_mon == pdcch_vars2->searchSpace[nb_searchspace_active].monitoringSlotPeriodicityAndOffset_offset) {
do_pdcch_monitoring_current_slot=1; // PDCCH monitoring in every monitoringSlotPeriodicityAndOffset slot with offset
......
/*
* 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
*/
/************************************************************************
*
* MODULE : PUCCH power control for UE NR
*
* DESCRIPTION : functions related to PUCCH Transmit power
* TS 38.213 7.2.1 UE behaviour
*
**************************************************************************/
#include "PHY/NR_REFSIG/ss_pbch_nr.h"
#include "PHY/defs_nr_UE.h"
#include "SCHED_NR_UE/pucch_uci_ue_nr.h"
#include "SCHED_NR_UE/pucch_power_control_ue_nr.h"
/**************** defines **************************************/
/**************** variables **************************************/
/**************** functions **************************************/
/*******************************************************************
*
* NAME : get_pucch_tx_power_ue
*
* PARAMETERS : ue context
* gNB_id identity
* slots for rx and tx
* pucch_format_nr_t pucch format
* nb_of_prbs number of prb allocated to pucch
* N_sc_ctrl_RB subcarrier control rb related to current pucch format
* N_symb_PUCCH number of pucch symbols excluding those reserved for dmrs
* O_UCI number of bits for UCI Uplink Control Information
* O_SR number of bits for SR scheduling Request
* O_UCI number of bits for CSI Channel State Information
* O_ACK number of bits for HARQ-ACK
* O_CRC number of bits for CRC
* n_HARQ_ACK use for obtaining a PUCCH transmission power
*
* RETURN : pucch power level in dBm
*
* DESCRIPTION : determines pucch transmission power in dBm
* TS 38.213 7.2.1 UE behaviour
*
*********************************************************************/
int16_t get_pucch_tx_power_ue(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_t *proc, pucch_format_nr_t pucch_format,
int nb_of_prbs, int N_sc_ctrl_RB, int N_symb_PUCCH, int O_UCI, int O_SR, int O_CSI, int O_ACK,
int O_CRC, int n_HARQ_ACK) {
int16_t P_O_NOMINAL_PUCCH = ue->pucch_config_common_nr[gNB_id].p0_nominal;
PUCCH_PowerControl_t *power_config = &ue->pucch_config_dedicated_nr[gNB_id].pucch_PowerControl;
int16_t P_O_UE_PUCCH;
int16_t G_b_f_c = 0;
if (ue->pucch_config_dedicated_nr[gNB_id].spatial_Relation_Info[0] != NULL) { /* FFS TODO NR */
LOG_E(PHY,"PUCCH Spatial relation infos are not yet implemented : at line %d in function %s of file %s \n", LINE_FILE , __func__, __FILE__);
return (PUCCH_POWER_DEFAULT);
}
if (power_config->p0_Set[0] != NULL) {
P_O_UE_PUCCH = power_config->p0_Set[0]->p0_PUCCH_Value; /* get from index 0 if no spatial relation set */
G_b_f_c = 0;
}
else {
G_b_f_c = ue->dlsch[ue->current_thread_id[proc->subframe_rx]][gNB_id][0]->g_pucch;
LOG_W(PHY,"PUCCH Transmit power control command not yet implemented for NR : at line %d in function %s of file %s \n", LINE_FILE , __func__, __FILE__);
return (PUCCH_POWER_DEFAULT);
}
int P_O_PUCCH = P_O_NOMINAL_PUCCH + P_O_UE_PUCCH;
int16_t PL = get_PL(ue->Mod_id, ue->CC_id, gNB_id); /* LTE function because NR path loss not yet implemented FFS TODO NR */
int16_t delta_F_PUCCH = power_config->deltaF_PUCCH_f[pucch_format];
int DELTA_TF;
uint16_t N_ref_PUCCH;
/* computing of pucch transmission power adjustment */
switch (pucch_format) {
case pucch_format0_nr:
{
N_ref_PUCCH = 2;
DELTA_TF = 10 * log10(N_ref_PUCCH/N_symb_PUCCH);
break;
}
case pucch_format1_nr:
{
N_ref_PUCCH = N_SYMB_SLOT;
DELTA_TF = 10 * log10(N_ref_PUCCH/N_symb_PUCCH);
break;
}
case pucch_format2_nr:
case pucch_format3_nr:
case pucch_format4_nr:
{
float N_RE = nb_of_prbs * N_sc_ctrl_RB * N_symb_PUCCH;
float K1 = 6;
/* initial phase so no higher layer parameters */
if (ue->UE_mode[gNB_id] != PUSCH) {
if (O_ACK == 0) {
n_HARQ_ACK = 0;
}
else {
n_HARQ_ACK = 1;
}
}
if (O_UCI < 12) {
DELTA_TF = 10 * log10((double)(((K1 * (n_HARQ_ACK + O_SR + O_CSI))/N_RE)));
}
else {
float K2 = 2.4;
float BPRE = (O_ACK + O_SR + O_CSI + O_CRC)/N_RE;
DELTA_TF = 10 * log10((double)(pow(2,(K2*BPRE)) - 1));
}
break;
}
default:
{
LOG_E(PHY,"PUCCH unknown pucch format : at line %d in function %s of file %s \n", LINE_FILE , __func__, __FILE__);
return (0);
}
}
int l = 0;
int k2;
if (power_config->twoPUCCH_PC_AdjustmentStates > 1) {
LOG_E(PHY,"PUCCH power control adjustment states with 2 states not yet implemented : at line %d in function %s of file %s \n", LINE_FILE , __func__, __FILE__);
return (PUCCH_POWER_DEFAULT);
}
/* response to a detection by the UE of a DCI format 1_0 or DCI format 1_1 */
int K_PUCCH = 0;
if (O_ACK != 0) {
/* it assumes that PDCCH is in the first symbol of receive slot FFS TDDO NR */
int slots_gap = (proc->nr_tti_tx > proc->nr_tti_rx ? (proc->nr_tti_tx - proc->nr_tti_rx - 1) : ((proc->nr_tti_tx + ue->frame_parms.ttis_per_subframe) - proc->nr_tti_rx - 1));
K_PUCCH = (slots_gap * (ue->frame_parms.symbols_per_tti)) - 1;
}
else {
/* field k2 is not present - to check k2 of pucch from upper layer FFS TDDO NR */
if (ue->pusch_config.pusch_TimeDomainResourceAllocation[0] == NULL) {
if (ue->frame_parms.numerology_index == 0) {
k2 = 1;
}
else {
k2 = ue->frame_parms.numerology_index;
}
}
else
{
/* get minimum value of k2 */
int i = 0;
int k2_min = 32; /* max value of k2 */
do {
k2 = ue->pusch_config.pusch_TimeDomainResourceAllocation[i]->k2;
if (k2 < k2_min) {
k2_min = k2;
}
i++;
if (i >= MAX_NR_OF_UL_ALLOCATIONS) {
break;
}
} while(ue->pusch_config.pusch_TimeDomainResourceAllocation[i] != NULL);
k2 = k2_min;
}
K_PUCCH = N_SYMB_SLOT * k2; /* the product of a number of symbols per slot and the minimum of the values provided by higher layer parameter k2 */
}
int contributor = (10 * log10((double)(pow(2,(ue->frame_parms.numerology_index)) * nb_of_prbs)));
int16_t pucch_power = P_O_PUCCH + contributor + PL + delta_F_PUCCH + DELTA_TF + G_b_f_c;
if (pucch_power > ue->tx_power_max_dBm) {
pucch_power = ue->tx_power_max_dBm;
}
NR_TST_PHY_PRINTF("PUCCH ( Tx power : %d dBm ) ( 10Log(...) : %d ) ( from Path Loss : %d ) ( delta_F_PUCCH : %d ) ( DELTA_TF : %d ) ( G_b_f_c : %d ) \n",
pucch_power, contributor, PL, delta_F_PUCCH, DELTA_TF, G_b_f_c);
return (pucch_power);
}
/*
* 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
*/
/************************************************************************
*
* MODULE : PUCCH power control for UE NR
*
* DESCRIPTION : functions related to PUCCH Transmit power
* TS 38.213 7.2.1 UE behaviour
*
**************************************************************************/
#ifndef PUCCH_POWER_CONTROL_H
#define PUCCH_POWER_CONTROL_H
/*************** INCLUDE *******************************************/
/*************** DEFINE ********************************************/
#define PUCCH_POWER_DEFAULT (0) /* in dBm */
/*************** VARIABLES *****************************************/
/*************** FUNCTIONS *****************************************/
/** \brief This function returns pucch power level in dBm
@param ue context
@param gNB_id identity
@param slots for rx and tx
@param pucch_format_nr_t pucch format
@param nb_of_prbs number of prb allocated to pucch
@param N_sc_ctrl_RB subcarrier control rb related to current pucch format
@param N_symb_PUCCH number of pucch symbols excluding those reserved for dmrs
@param O_UCI number of bits for UCI Uplink Control Information
@param O_SR number of bits for SR scheduling Request
@param int O_UCI number of bits for CSI Channel State Information
@param O_ACK number of bits for HARQ-ACK
@param O_CRC number of bits for CRC
@param n_HARQ_ACK use for obtaining a PUCCH transmission power
@returns pucch power level in dBm */
int16_t get_pucch_tx_power_ue(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_t *proc, pucch_format_nr_t pucch_format,
int nb_of_prbs, int N_sc_ctrl_RB, int N_symb_PUCCH, int O_UCI, int O_SR, int O_CSI, int O_ACK,
int O_CRC, int n_HARQ_ACK);
#endif /* PUCCH_POWER_CONTROL_H */
/*
* 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
*/
/************************************************************************
*
* MODULE : PUCCH Packed Uplink Control Channel for UE NR
* PUCCH is used to transmit Uplink Control Information UCI
* which is composed of:
* - SR Scheduling Request
* - HARQ ACK/NACK
* - CSI Channel State Information
* UCI can also be transmitted on a PUSCH if it schedules.
*
* DESCRIPTION : functions related to PUCCH UCI management
* TS 38.213 9 UE procedure for reporting control information
*
**************************************************************************/
#include "PHY/NR_REFSIG/ss_pbch_nr.h"
#include "PHY/defs_nr_UE.h"
#ifndef NO_RAT_NR
#include "SCHED_NR_UE/harq_nr.h"
#include "SCHED_NR_UE/pucch_power_control_ue_nr.h"
#define DEFINE_VARIABLES_PUCCH_UE_NR_H
#include "SCHED_NR_UE/pucch_uci_ue_nr.h"
#undef DEFINE_VARIABLES_PUCCH_UE_NR_H
#endif
/**************** variables **************************************/
/**************** functions **************************************/
extern uint8_t is_cqi_TXOp(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id);
extern uint8_t is_ri_TXOp(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id);
/*******************************************************************
*
* NAME : pucch_procedures_ue_nr
*
* PARAMETERS : ue context
* processing slots of reception/transmission
* gNB_id identifier
*
* RETURN : bool TRUE PUCCH will be transmitted
* FALSE No PUCCH to transmit
*
* DESCRIPTION : determines UCI (uplink Control Information) payload
* and PUCCH format and its parameters.
* PUCCH is no transmitted if:
* - there is no valid data to transmit
* - Pucch parameters are not valid
*
* Below information is scanned in order to know what information should be transmitted to network.
*
* (SR Scheduling Request) (HARQ ACK/NACK) (CSI Channel State Information)
* | | - CQI Channel Quality Indicator
* | | - RI Rank Indicator
* | | - PMI Primary Matrux Indicator
* | | - LI Layer Indicator
* | | - L1-RSRP
* | | - CSI-RS resource idicator
* | V |
* +-------------------- -> + <------------------
* |
* +--------------------------------+
* | UCI Uplink Control Information |
* +--------------------------------+
* V PUCCH Configuration
* +----------------------------------------+ +--------------------------+
* | Determine PUCCH payload and its | | PUCCH Resource Set |
* +----------------------------------------+ | PUCCH Resource |
* V | Format parameters |
* +-----------------------------------------+ | |
* | Select PUCCH format with its parameters | <----------------+--------------------------+
* +-----------------------------------------+
* V
* +-----------------+
* | Generate PUCCH |
* +-----------------+
*
* TS 38.213 9 UE procedure for reporting control information
*
*********************************************************************/
bool pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_t *proc, bool reset_harq)
{
uint8_t sr_payload = 0;
uint32_t pucch_ack_payload = 0; /* maximum number of bits for pucch payload is supposed to be 32 */
uint64_t pucch_payload = 0;
uint32_t csi_payload = 0;
int frame_tx = proc->frame_tx;
int nr_tti_tx = proc->nr_tti_tx;
int Mod_id = ue->Mod_id;
int CC_id = ue->CC_id;
int O_SR = 0;
int O_ACK = 0;
int O_CSI = 0; /* channel state information */
int N_UCI = 0; /* size in bits for Uplink Control Information */
int cqi_status = 0;
int ri_status = 0;
int csi_status = 0;
int initial_pucch_id = NB_INITIAL_PUCCH_RESOURCE;;
int pucch_resource_set = MAX_NB_OF_PUCCH_RESOURCE_SETS;
int pucch_resource_id = MAX_NB_OF_PUCCH_RESOURCES;
int pucch_resource_indicator = MAX_PUCCH_RESOURCE_INDICATOR;
int n_HARQ_ACK;
/* update current context */
int subframe_number = (proc->nr_tti_rx)/(ue->frame_parms.ttis_per_subframe);
nb_pucch_format_4_in_subframes[subframe_number] = 0; /* reset pucch format 4 counter at current rx position */
int dl_harq_pid = ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->current_harq_pid;
if (dl_harq_pid < ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->number_harq_processes_for_pdsch) {
/* pucch indicator can be reseted in function get_downlink_ack so it should be get now */
pucch_resource_indicator = ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->harq_processes[dl_harq_pid]->harq_ack.pucch_resource_indicator;
}
/* Part - I
* Collect feedback that should be transmitted at this nr_tti_tx :
* - ACK/NACK, SR, CSI (CQI, RI, ...)
*/
sr_payload = 0;
if (trigger_periodic_scheduling_request( ue, gNB_id, proc ) == 1) {
O_SR = 1; /* sr should be transmitted */
if (ue->mac_enabled == 1) {
/* sr_payload = 1 means that this is a positive SR, sr_payload = 0 means that it is a negative SR */
sr_payload = ue_get_SR(Mod_id,
CC_id,
frame_tx,
gNB_id,
ue->pdcch_vars[ue->current_thread_id[proc->nr_tti_rx]][gNB_id]->crnti,
nr_tti_tx); // nr_tti_rx used for meas gap
}
else {
sr_payload = 1;
}
}
O_ACK = get_downlink_ack( ue, gNB_id, proc, &pucch_ack_payload,
&n_HARQ_ACK, reset_harq); // 1 to reset ACK/NACK status : 0 otherwise
cqi_status = ((ue->cqi_report_config[gNB_id].CQI_ReportPeriodic.cqi_PMI_ConfigIndex>0) &&
(is_cqi_TXOp(ue,proc,gNB_id) == 1));
ri_status = ((ue->cqi_report_config[gNB_id].CQI_ReportPeriodic.ri_ConfigIndex>0) &&
(is_ri_TXOp(ue,proc,gNB_id) == 1));
csi_status = get_csi_nr(ue, gNB_id, &csi_payload);
O_CSI = cqi_status + ri_status + csi_status;
/* Part - II */
/* if payload is empty or only negative SR -> no pucch transmission */
if(O_ACK == 0) {
N_UCI = O_SR + O_CSI;
if ((N_UCI == 0) || ((O_CSI == 0) && (sr_payload == 0))) { /* TS 38.213 9.2.4 UE procedure for reporting SR */
NR_TST_PHY_PRINTF("PUCCH No feedback AbsSubframe %d.%d \n", frame_tx%1024, nr_tti_tx);
LOG_D(PHY,"PUCCH No feedback AbsSubframe %d.%d \n", frame_tx%1024, nr_tti_tx);
return (FALSE);
}
else {
/* a resource set and a resource should be find according to payload size */
pucch_resource_set = find_pucch_resource_set( ue, gNB_id, N_UCI);
if (pucch_resource_set != MAX_NB_OF_PUCCH_RESOURCE_SETS) {
pucch_resource_indicator = 0;
pucch_resource_id = ue->pucch_config_dedicated_nr[gNB_id].PUCCH_ResourceSet[pucch_resource_set]->pucch_resource_id[pucch_resource_indicator]; /* get the first resource of the set */
}
else {
LOG_W(PHY,"PUCCH no resource set found for CSI at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
O_CSI = 0;
csi_payload = 0;
}
if (O_CSI == 0) {
/* only SR has to be send */
/* in this case there is no DCI related to PUCCH parameters so pucch resource should be get from sr configuration */
/* TS 38.213 9.2.4 UE procedure for reporting SR */
pucch_resource_set = 0; /* force it to a valid value */
if (ue->scheduling_request_config_nr[gNB_id].sr_ResourceConfig[ue->scheduling_request_config_nr[gNB_id].active_sr_id] != NULL) {
pucch_resource_id = ue->scheduling_request_config_nr[gNB_id].sr_ResourceConfig[ue->scheduling_request_config_nr[gNB_id].active_sr_id]->resource;
}
else {
LOG_E(PHY,"PUCCH No scheduling request configuration : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return(FALSE);
}
}
}
}
else {
N_UCI = O_SR + O_ACK + O_CSI;
}
/* Part - III */
/* Choice PUCCH format and its related parameters */
pucch_format_nr_t format = pucch_format0_nr;
uint8_t starting_symbol_index;
uint8_t nb_symbols_total = 0;
uint8_t nb_symbols = 0;
uint16_t starting_prb = 0;; /* it can be considered as first hop on case of pucch hopping */
uint16_t second_hop = 0; /* second part for pucch for hopping */
uint8_t nb_of_prbs = 0;
int m_0 = 0; /* format 0 only */
int m_CS = 0; /* for all format except for format 0 */
int index_additional_dmrs = I_PUCCH_NO_ADDITIONAL_DMRS;
int index_hopping = I_PUCCH_NO_HOPPING;
int time_domain_occ = 0;
int occ_length = 0;
int occ_Index = 0;
NR_UE_HARQ_STATUS_t *harq_status = &ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->harq_processes[dl_harq_pid]->harq_ack;
if (select_pucch_resource(ue, gNB_id, N_UCI, pucch_resource_indicator, &initial_pucch_id, &pucch_resource_set,
&pucch_resource_id, harq_status) == TRUE) {
/* use of initial pucch configuration provided by system information 1 */
/***********************************************************************/
if (initial_pucch_id != NB_INITIAL_PUCCH_RESOURCE) {
format = initial_pucch_resource[initial_pucch_id].format;
starting_symbol_index = initial_pucch_resource[initial_pucch_id].startingSymbolIndex;
nb_symbols_total = initial_pucch_resource[initial_pucch_id].nrofSymbols;
int N_CS = initial_pucch_resource[initial_pucch_id].nb_CS_indexes;
int RB_BWP_offset;
if (initial_pucch_id == 15) {
RB_BWP_offset = ue->systemInformationBlockType1_nr.N_BWP_SIZE/4;
}
else
{
RB_BWP_offset = initial_pucch_resource[initial_pucch_id].PRB_offset;
}
if (initial_pucch_id/8 == 0) {
starting_prb = RB_BWP_offset + (initial_pucch_id/N_CS);
second_hop = ue->systemInformationBlockType1_nr.N_BWP_SIZE - 1 - RB_BWP_offset - (initial_pucch_id/N_CS);
m_0 = initial_pucch_resource[initial_pucch_id].initial_CS_indexes[initial_pucch_id%N_CS];
}
else if (initial_pucch_id/8 == 1)
{
starting_prb = RB_BWP_offset + (initial_pucch_id/N_CS);
second_hop = ue->systemInformationBlockType1_nr.N_BWP_SIZE - 1 - RB_BWP_offset - ((initial_pucch_id - 8)/N_CS);
m_0 = initial_pucch_resource[initial_pucch_id].initial_CS_indexes[(initial_pucch_id - 8)%N_CS];
}
if ((ue->UE_mode[gNB_id] != PUSCH) && (O_ACK > 1)) {
O_ACK = 1;
pucch_ack_payload &= 0x1; /* take only first ack */
LOG_W(PHY,"PUCCH ue is not expected to generate more than one HARQ-ACK at AbsSubframe %d.%d \n", frame_tx%1024, nr_tti_tx);
}
NR_TST_PHY_PRINTF("PUCCH common configuration with index %d \n", initial_pucch_id);
}
/* use dedicated pucch resource configuration */
/**********************************************/
else if ((pucch_resource_set != MAX_NB_OF_PUCCH_RESOURCE_SETS) && (pucch_resource_id != MAX_NB_OF_PUCCH_RESOURCES)) {
/* check that current configuration is supported */
if ((ue->cell_group_config.physicalCellGroupConfig.harq_ACK_SpatialBundlingPUCCH != FALSE)
|| (ue->cell_group_config.physicalCellGroupConfig.pdsch_HARQ_ACK_Codebook != dynamic)) {
LOG_E(PHY,"PUCCH Unsupported cell group configuration : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return(FALSE);
}
else if (ue->PDSCH_ServingCellConfig.codeBlockGroupTransmission != NULL) {
LOG_E(PHY,"PUCCH Unsupported code block group for serving cell config : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return(FALSE);
}
format = ue->pucch_config_dedicated_nr[gNB_id].PUCCH_Resource[pucch_resource_id]->format_parameters.format;
nb_symbols_total = ue->pucch_config_dedicated_nr[gNB_id].PUCCH_Resource[pucch_resource_id]->format_parameters.nrofSymbols;
starting_symbol_index = ue->pucch_config_dedicated_nr[gNB_id].PUCCH_Resource[pucch_resource_id]->format_parameters.startingSymbolIndex;
starting_prb = ue->pucch_config_dedicated_nr[gNB_id].PUCCH_Resource[pucch_resource_id]->startingPRB;
second_hop = starting_prb;
time_domain_occ = ue->pucch_config_dedicated_nr[gNB_id].PUCCH_Resource[pucch_resource_id]->format_parameters.timeDomainOCC; /* format 1 only */
occ_length = ue->pucch_config_dedicated_nr[gNB_id].PUCCH_Resource[pucch_resource_id]->format_parameters.occ_length; /* format 4 only */
occ_Index = ue->pucch_config_dedicated_nr[gNB_id].PUCCH_Resource[pucch_resource_id]->format_parameters.occ_Index; /* format 4 only */
if ((format == pucch_format0_nr) || (format == pucch_format1_nr)) {
m_0 = ue->pucch_config_dedicated_nr[gNB_id].PUCCH_Resource[pucch_resource_id]->format_parameters.initialCyclicShift;
}
else if ((format == pucch_format3_nr) || (format == pucch_format4_nr)) {
if (ue->pucch_config_dedicated_nr[gNB_id].formatConfig[format-1]->additionalDMRS == enable_feature) {
index_additional_dmrs = I_PUCCH_ADDITIONAL_DMRS;
}
if (ue->pucch_config_dedicated_nr[gNB_id].PUCCH_Resource[pucch_resource_id]->intraSlotFrequencyHopping == feature_enabled) {
index_hopping = I_PUCCH_HOPING;
}
}
NR_TST_PHY_PRINTF("PUCCH dedicated configuration with resource index %d \n", pucch_resource_id);
}
}
else {
LOG_W(PHY,"PUCCH No PUCCH resource found at AbsSubframe %d.%d \n", frame_tx%1024, nr_tti_tx);
return (FALSE);
}
int max_code_rate = 0;
int Q_m = BITS_PER_SYMBOL_QPSK; /* default pucch modulation type is QPSK with 2 bits per symbol */
int N_sc_ctrl_RB = 0;
int O_CRC = 0;
nb_symbols = nb_symbols_total; /* by default, it can be reduced due to symbols reserved for dmrs */
switch(format) {
case pucch_format0_nr:
{
nb_of_prbs = 1;
N_sc_ctrl_RB = N_SC_RB;
break;
}
case pucch_format1_nr:
{
nb_of_prbs = 1;
N_sc_ctrl_RB = N_SC_RB;
break;
}
case pucch_format2_nr:
{
nb_of_prbs = ue->pucch_config_dedicated_nr[gNB_id].PUCCH_Resource[pucch_resource_id]->format_parameters.nrofPRBs;
N_sc_ctrl_RB = N_SC_RB - 4;
break;
}
case pucch_format3_nr:
{
nb_of_prbs = ue->pucch_config_dedicated_nr[gNB_id].PUCCH_Resource[pucch_resource_id]->format_parameters.nrofPRBs;
if (ue->pucch_config_dedicated_nr[gNB_id].formatConfig[format-1]->pi2PBSK == feature_enabled) {
Q_m = BITS_PER_SYMBOL_BPSK; /* set bpsk modulation type with 1 bit per modulation symbol */
}
N_sc_ctrl_RB = N_SC_RB;
nb_symbols = nb_symbols_excluding_dmrs[nb_symbols_total-4][index_additional_dmrs][index_hopping];
break;
}
case pucch_format4_nr:
{
if (ue->pucch_config_dedicated_nr[gNB_id].formatConfig[format-1]->pi2PBSK == feature_enabled) {
Q_m = BITS_PER_SYMBOL_BPSK; /* set bpsk modulation type with 1 bit per modulation symbol */
}
nb_symbols = nb_symbols_excluding_dmrs[nb_symbols_total-4][index_additional_dmrs][index_hopping];
nb_of_prbs = 1;
subframe_number = nr_tti_tx/(ue->frame_parms.ttis_per_subframe);
nb_pucch_format_4_in_subframes[subframe_number]++; /* increment number of transmit pucch 4 in current subframe */
NR_TST_PHY_PRINTF("PUCCH Number of pucch format 4 in subframe %d is %d \n", subframe_number, nb_pucch_format_4_in_subframes[subframe_number]);
N_sc_ctrl_RB = N_SC_RB/(nb_pucch_format_4_in_subframes[subframe_number]);
break;
}
}
/* TS 38.213 9.2.5.2 UE procedure for multiplexing HARQ-ACK/SR and CSI */
/* drop CSI report if simultaneous HARQ-ACK/SR and periodic/semi-periodic CSI cannot be transmitted at the same time */
if (format != pucch_format0_nr) {
if (ue->pucch_config_dedicated_nr[gNB_id].formatConfig[format-1] != NULL) {
max_code_rate = code_rate_r_time_100[ue->pucch_config_dedicated_nr[gNB_id].formatConfig[format-1]->maxCodeRate]; /* it is code rate * 10 */
if ((O_ACK != 0) && (ue->pucch_config_dedicated_nr[gNB_id].formatConfig[format-1]->simultaneousHARQ_ACK_CSI == disable_feature)) {
N_UCI = N_UCI - O_CSI;
O_CSI = cqi_status = ri_status = 0;
csi_payload = 0; /* csi should be dropped in this case */
}
}
/* TS 38.212 6.3.1.2 Code block segmentation and CRC attachment */
/* crc attachment can be done depending of paylaod size */
if (N_UCI < 11) {
O_CRC = 0; /* no additional crc bits */
}
else if ((N_UCI >= 12) && (N_UCI <= 19)) {
O_CRC = 6; /* number of additional crc bits */
}
else if (N_UCI >= 20) {
O_CRC = 11; /* number of additional crc bits */
}
N_UCI = N_UCI + O_CRC;
/* for format 2 and 3, number of prb should be adjusted to minimum value which cope to information size */
if (nb_of_prbs > 1 ) {
int nb_prb_min = 0;
int payload_in_bits;
do {
nb_prb_min++;
payload_in_bits = (nb_prb_min * N_sc_ctrl_RB * nb_symbols * Q_m * max_code_rate)/100; /* code rate has been multiplied by 100 */
NR_TST_PHY_PRINTF("PUCCH Adjust number of prb : (N_UCI : %d ) (payload_in_bits : %d) (N_sc_ctrl_RB : %d) (nb_symbols : %d) (Q_m : %d) (max_code_rate*100 : %d) \n",
N_UCI, payload_in_bits, N_sc_ctrl_RB, nb_symbols, Q_m, max_code_rate);
} while (N_UCI > payload_in_bits);
if (nb_prb_min > nb_of_prbs) {
LOG_E(PHY,"PUCCH Number of prbs too small for current pucch bits to transmit : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return (FALSE);
}
else {
nb_of_prbs = nb_prb_min;
}
}
/* TS 38.213 9.2.4 for a positive SR transmission, payload b(0) = 0 */
if ((O_SR == 1) && (format == pucch_format1_nr)) {
sr_payload = 0;
}
}
else { /* only format 0 here */
if ((O_SR == 0) && (O_CSI == 0)) { /* only ack is transmitted TS 36.213 9.2.3 UE procedure for reporting HARQ-ACK */
if (O_ACK == 1) {
m_CS = sequence_cyclic_shift_1_harq_ack_bit[pucch_ack_payload & 0x1]; /* only harq of 1 bit */
}
else {
m_CS = sequence_cyclic_shift_2_harq_ack_bits[pucch_ack_payload & 0x3]; /* only harq with 2 bits */
}
}
else if ((O_SR == 1) && (O_CSI == 0)) { /* SR + eventually ack are transmitted TS 36.213 9.2.5.1 UE procedure for multiplexing HARQ-ACK or CSI and SR */
if (sr_payload == 1) { /* positive scheduling request */
if (O_ACK == 1) {
m_CS = sequence_cyclic_shift_1_harq_ack_bit_positive_sr[pucch_ack_payload & 0x1]; /* positive SR and harq of 1 bit */
}
else if (O_ACK == 2) {
m_CS = sequence_cyclic_shift_2_harq_ack_bits_positive_sr[pucch_ack_payload & 0x3]; /* positive SR and harq with 2 bits */
}
else {
m_CS = 0; /* only positive SR */
}
}
}
N_UCI = O_SR = O_ACK = 0;
pucch_payload = sr_payload = pucch_ack_payload = 0; /* no data for format 0 */
}
/* TS 38.212 6.3.1 Uplink control information on PUCCH */
/* information concatenation of payload */
/* CSI SR HARQ-ACK */
/* bit order of payload of size n : a(n)....................................a(0) */
/* a(0) is the LSB and a(n) the MSB <--------><--------------><------------><----------> */
/* O_CRC O_CSI O_SR O_ACK */
/* */
/* remark: crc is not part of payload, it is later added by block coding. */
if (N_UCI > (sizeof(uint64_t)*8)) {
LOG_E(PHY,"PUCCH number of UCI bits exceeds payload size : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return(0);
}
pucch_payload = pucch_payload | (csi_payload << (O_ACK + O_SR)) | (sr_payload << O_ACK) | pucch_ack_payload;
NR_TST_PHY_PRINTF("PUCCH ( AbsSubframe : %d.%d ) ( total payload size %d data 0x%02x ) ( ack length %d data 0x%02x ) ( sr length %d value %d ) ( csi length %d data : 0x%02x ) \n",
frame_tx%1024, nr_tti_tx, N_UCI, pucch_payload, O_ACK, pucch_ack_payload, O_SR, sr_payload, csi_status, csi_payload);
NR_TST_PHY_PRINTF("PUCCH ( format : %d ) ( modulation : %s ) ( nb prb : %d ) ( nb symbols : %d ) ( max code rate*100 : %d ) ( starting_symbol_index : %d ) \n",
format, (Q_m == BITS_PER_SYMBOL_QPSK ? " QPSK " : " BPSK "), nb_of_prbs, nb_symbols, max_code_rate, starting_symbol_index);
NR_TST_PHY_PRINTF("PUCCH ( starting_prb : %d ) ( second_hop : %d ) ( m_0 : %d ) ( m_CS : %d ) ( time_domain_occ %d ) (occ_length : %d ) ( occ_Index : %d ) \n",
starting_prb, second_hop, m_0, m_CS, time_domain_occ, occ_length, occ_Index);
/* Part - IV */
/* Generate PUCCH signal according to its format and parameters */
ue->generate_ul_signal[gNB_id] = 1;
int16_t pucch_tx_power = get_pucch_tx_power_ue( ue, gNB_id, proc, format,
nb_of_prbs, N_sc_ctrl_RB, nb_symbols, N_UCI, O_SR, O_CSI, O_ACK,
O_CRC, n_HARQ_ACK);
return (TRUE);
}
/*******************************************************************
*
* NAME : get_downlink_ack
*
* PARAMETERS : ue context
* processing slots of reception/transmission
* gNB_id identifier
*
* RETURN : o_ACK acknowledgment data
* o_ACK_number_bits number of bits for acknowledgment
*
* DESCRIPTION : return acknowledgment value
* TS 38.213 9.1.3 Type-2 HARQ-ACK codebook determination
*
* --+--------+-------+--------+-------+--- ---+-------+--
* | PDCCH1 | | PDCCH2 |PDCCH3 | | PUCCH |
* --+--------+-------+--------+-------+--- ---+-------+--
* DAI_DL 1 2 3 ACK for
* V V V PDCCH1, PDDCH2 and PCCH3
* | | | ^
* +-----------------+-------+---------------+
*
* PDCCH1, PDCCH2 and PDCCH3 are PDCCH monitoring occasions
* M is the total of monitoring occasions
*
*********************************************************************/
uint8_t get_downlink_ack(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_t *proc,
uint32_t *o_ACK, int *n_HARQ_ACK,
bool do_reset) // 1 to reset ACK/NACK status : 0 otherwise
{
NR_UE_HARQ_STATUS_t *harq_status;
uint32_t ack_data[NR_DL_MAX_NB_CW][NR_DL_MAX_DAI] = {{0},{0}};
uint32_t dai[NR_DL_MAX_NB_CW][NR_DL_MAX_DAI] = {{0},{0}}; /* for serving cell */
uint32_t dai_total[NR_DL_MAX_NB_CW][NR_DL_MAX_DAI] = {{0},{0}}; /* for multiple cells */
int number_harq_feedback = 0;
uint32_t dai_current = 0;
uint32_t dai_max = 0;
int number_pid_dl = ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->number_harq_processes_for_pdsch;
bool two_transport_blocks = FALSE;
int number_of_code_word = 1;
int U_DAI_c = 0;
int N_m_c_rx = 0;
int V_DAI_m_DL = 0;
if (ue->PDSCH_Config.maxNrofCodeWordsScheduledByDCI == nb_code_n2) {
two_transport_blocks = TRUE;
number_of_code_word = 2;
}
else {
number_of_code_word = 1;
}
if (ue->n_connected_eNB > 1) {
LOG_E(PHY,"PUCCH ACK feedback is not implemented for mutiple gNB cells : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return (0);
}
/* look for dl acknowledgment which should be done on current uplink slot */
for (int code_word = 0; code_word < number_of_code_word; code_word++) {
for (int dl_harq_pid = 0; dl_harq_pid < number_pid_dl; dl_harq_pid++) {
harq_status = &ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][code_word]->harq_processes[dl_harq_pid]->harq_ack;
/* check if current tx slot should transmit downlink acknowlegment */
if (harq_status->slot_for_feedback_ack == proc->nr_tti_tx) {
if (harq_status->ack == DL_ACKNACK_NO_SET) {
LOG_E(PHY,"PUCCH Downlink acknowledgment has not been set : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return (0);
}
else if (harq_status->vDAI_DL == DL_DAI_NO_SET) {
LOG_E(PHY,"PUCCH Downlink DAI has not been set : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return (0);
}
else if (harq_status->vDAI_DL > NR_DL_MAX_DAI) {
LOG_E(PHY,"PUCCH Downlink DAI has an invalid value : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return (0);
}
else if (harq_status->send_harq_status == 0) {
LOG_E(PHY,"PUCCH Downlink ack can not be transmitted : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return(0);
}
else {
dai_current = harq_status->vDAI_DL;
if (dai_current == 0) {
LOG_E(PHY,"PUCCH Downlink dai is invalid : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return(0);
} else if (dai_current > dai_max) {
dai_max = dai_current;
}
number_harq_feedback++;
ack_data[code_word][dai_current - 1] = harq_status->ack;
dai[code_word][dai_current - 1] = dai_current;
}
}
if (do_reset == TRUE) {
init_downlink_harq_status(ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][code_word]->harq_processes[dl_harq_pid]);
}
}
}
/* no any ack to transmit */
if (number_harq_feedback == 0) {
*n_HARQ_ACK = 0;
return(0);
}
else if (number_harq_feedback > (sizeof(uint32_t)*8)) {
LOG_E(PHY,"PUCCH number of ack bits exceeds payload size : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return(0);
}
/* for computing n_HARQ_ACK for power */
V_DAI_m_DL = dai_max;
U_DAI_c = number_harq_feedback/number_of_code_word;
N_m_c_rx = number_harq_feedback;
int N_SPS_c = 0; /* FFS TODO_NR multicells and SPS are not supported at the moment */
if (ue->cell_group_config.physicalCellGroupConfig.harq_ACK_SpatialBundlingPUCCH == FALSE) {
int N_TB_max_DL = ue->PDSCH_Config.maxNrofCodeWordsScheduledByDCI;
*n_HARQ_ACK = (((V_DAI_m_DL - U_DAI_c)%4) * N_TB_max_DL) + N_m_c_rx + N_SPS_c;
NR_TST_PHY_PRINTF("PUCCH power n(%d) = ( V(%d) - U(%d) )mod4 * N_TB(%d) + N(%d) \n", *n_HARQ_ACK, V_DAI_m_DL, U_DAI_c, N_TB_max_DL, N_m_c_rx);
}
/*
* For a monitoring occasion of a PDCCH with DCI format 1_0 or DCI format 1_1 in at least one serving cell,
* when a UE receives a PDSCH with one transport block and the value of higher layer parameter maxNrofCodeWordsScheduledByDCI is 2,
* the HARQ-ACK response is associated with the first transport block and the UE generates a NACK for the second transport block
* if spatial bundling is not applied (HARQ-ACK-spatial-bundling-PUCCH = FALSE) and generates HARQ-ACK value of ACK for the second
* transport block if spatial bundling is applied.
*/
for (int code_word = 0; code_word < number_of_code_word; code_word++) {
for (uint32_t i = 0; i < dai_max ; i++ ) {
if (dai[code_word][i] != i + 1) { /* fill table with consistent value for each dai */
dai[code_word][i] = i + 1; /* it covers case for which PDCCH DCI has not been successfully decoded and so it has been missed */
ack_data[code_word][i] = 0; /* nack data transport block which has been missed */
number_harq_feedback++;
}
if (two_transport_blocks == TRUE) {
dai_total[code_word][i] = dai[code_word][i]; /* for a single cell, dai_total is the same as dai of first cell */
}
}
}
int M = dai_max;
int j = 0;
uint32_t V_temp = 0;
uint32_t V_temp2 = 0;
int O_ACK = 0;
int O_bit_number_cw0 = 0;
int O_bit_number_cw1 = 0;
for (int m = 0; m < M ; m++) {
if (dai[0][m] <= V_temp) {
j = j + 1;
}
V_temp = dai[0][m]; /* value of the counter DAI for format 1_0 and format 1_1 on serving cell c */
if (dai_total[0][m] == 0) {
V_temp2 = dai[0][m];
} else {
V_temp2 = dai[1][m]; /* second code word has been received */
O_bit_number_cw1 = (8 * j) + 2*(V_temp - 1) + 1;
*o_ACK = *o_ACK | (ack_data[1][m] << O_bit_number_cw1);
}
if (two_transport_blocks == TRUE) {
O_bit_number_cw0 = (8 * j) + 2*(V_temp - 1);
}
else {
O_bit_number_cw0 = (4 * j) + (V_temp - 1);
}
*o_ACK = *o_ACK | (ack_data[0][m] << O_bit_number_cw0);
}
if (V_temp2 < V_temp) {
j = j + 1;
}
if (two_transport_blocks == TRUE) {
O_ACK = 2 * ( 4 * j + V_temp2); /* for two transport blocks */
}
else {
O_ACK = 4 * j + V_temp2; /* only one transport block */
}
if (number_harq_feedback != O_ACK) {
LOG_E(PHY,"PUCCH Error for number of bits for acknowledgment : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return (0);
}
return(number_harq_feedback);
}
/*******************************************************************
*
* NAME : select_pucch_format
*
* PARAMETERS : ue context
* processing slots of reception/transmission
* gNB_id identifier
*
* RETURN : TRUE a valid resource has been found
*
* DESCRIPTION : return tx harq process identifier for given transmission slot
* TS 38.213 9.2.1 PUCCH Resource Sets
* TS 38.213 9.2.2 PUCCH Formats for UCI transmission
* In the case of pucch for scheduling request only, resource is already get from scheduling request configuration
*
*********************************************************************/
boolean_t select_pucch_resource(PHY_VARS_NR_UE *ue, uint8_t gNB_id, int uci_size, int pucch_resource_indicator,
int *initial_pucch_id, int *resource_set_id, int *resource_id, NR_UE_HARQ_STATUS_t *harq_status)
{
boolean_t resource_set_found = FALSE;
int nb_symbols_for_tx = 0;
int current_resource_id = MAX_NB_OF_PUCCH_RESOURCES;
pucch_format_nr_t format_pucch;
int ready_pucch_resource_id = FALSE; /* in the case that it is already given */
/* ini values to unset */
*initial_pucch_id = NB_INITIAL_PUCCH_RESOURCE;
//*resource_set_id = MAX_NB_OF_PUCCH_RESOURCE_SETS;
//*resource_id = MAX_NB_OF_PUCCH_RESOURCES;
if (ue->pucch_config_dedicated_nr[gNB_id].PUCCH_ResourceSet[0] == NULL) {
/* No resource set has been already configured so pucch_configCommon from Sib1 should be used in this case */
if (ue->UE_mode[gNB_id] != PUSCH) {
*initial_pucch_id = ue->pucch_config_common_nr[gNB_id].pucch_ResourceCommon;
if (*initial_pucch_id >= NB_INITIAL_PUCCH_RESOURCE) {
LOG_E(PHY,"PUCCH Invalid initial resource index : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
*initial_pucch_id = NB_INITIAL_PUCCH_RESOURCE;
return (FALSE);
}
}
else {
/* see TS 38.213 9.2.1 PUCCH Resource Sets */
int delta_PRI = harq_status->pucch_resource_indicator;
int n_CCE_0 = harq_status->n_CCE;
int N_CCE_0 = harq_status->N_CCE;
if (N_CCE_0 == 0) {
LOG_E(PHY,"PUCCH No compatible pucch format found : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return (FALSE);
}
int r_PUCCH = ((2 * n_CCE_0)/N_CCE_0) + (2 * delta_PRI);
*initial_pucch_id = r_PUCCH;
}
nb_symbols_for_tx = initial_pucch_resource[*initial_pucch_id].nrofSymbols;
format_pucch = initial_pucch_resource[*initial_pucch_id].format;
if (check_pucch_format(ue, gNB_id, format_pucch, nb_symbols_for_tx, uci_size) == TRUE) {
return (TRUE);
}
else {
LOG_E(PHY,"PUCCH No compatible pucch format found : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return (FALSE);
}
}
else {
/* dedicated resources have been configured */
int pucch_resource_set_id = 0;
if (*resource_set_id == MAX_NB_OF_PUCCH_RESOURCE_SETS) {
/* from TS 38.331 field maxPayloadMinus1
-- Maximum number of payload bits minus 1 that the UE may transmit using this PUCCH resource set. In a PUCCH occurrence, the UE
-- chooses the first of its PUCCH-ResourceSet which supports the number of bits that the UE wants to transmit.
-- The field is not present in the first set (Set0) since the maximum Size of Set0 is specified to be 3 bit.
-- The field is not present in the last configured set since the UE derives its maximum payload size as specified in 38.213.
-- This field can take integer values that are multiples of 4. Corresponds to L1 parameter 'N_2' or 'N_3' (see 38.213, section 9.2)
*/
/* look for the first resource set which supports uci_size number of bits for payload */
pucch_resource_set_id = find_pucch_resource_set( ue, gNB_id, uci_size);
if (pucch_resource_set_id != MAX_NB_OF_PUCCH_RESOURCE_SETS) {
resource_set_found = TRUE;
}
}
else {
/* a valid resource has already be found outside this function */
resource_set_found = TRUE;
ready_pucch_resource_id = TRUE;
pucch_resource_indicator = pucch_resource_indicator;
}
if (resource_set_found == TRUE) {
if (pucch_resource_indicator < MAX_PUCCH_RESOURCE_INDICATOR) {
/* check if resource indexing by pucch_resource_indicator of this set is compatible */
if ((ready_pucch_resource_id == TRUE) || (ue->pucch_config_dedicated_nr[gNB_id].PUCCH_ResourceSet[pucch_resource_set_id]->pucch_resource_id[pucch_resource_indicator] != MAX_NB_OF_PUCCH_RESOURCES)) {
if (ready_pucch_resource_id == TRUE) {
current_resource_id = *resource_id;
}
else {
int R_PUCCH = ue->pucch_config_dedicated_nr[gNB_id].PUCCH_ResourceSet[pucch_resource_set_id]->first_resources_set_R_PUCCH;
/* is it the first resource and its size exceeds 8 */
if ((pucch_resource_set_id == 0)
&& (R_PUCCH > MAX_NB_OF_PUCCH_RESOURCES_PER_SET_NOT_0)) {
/* see TS 38.213 9.2.3 UE procedure for reporting HARQ-ACK */
int delta_PRI = pucch_resource_indicator;
int n_CCE_p = harq_status->n_CCE;
int N_CCE_p = harq_status->N_CCE;
int r_PUCCH;
if (N_CCE_p == 0) {
LOG_E(PHY,"PUCCH No compatible pucch format found : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return (FALSE);
}
if (pucch_resource_set_id < (R_PUCCH%8)) {
r_PUCCH = ((n_CCE_p * (R_PUCCH/8))/N_CCE_p) + (delta_PRI*(R_PUCCH/8));
}
else {
r_PUCCH = ((n_CCE_p * (R_PUCCH/8))/N_CCE_p) + (delta_PRI*(R_PUCCH/8)) + (R_PUCCH%8);
}
current_resource_id = r_PUCCH;
}
else {
current_resource_id = ue->pucch_config_dedicated_nr[gNB_id].PUCCH_ResourceSet[pucch_resource_set_id]->pucch_resource_id[pucch_resource_indicator];
}
}
if (ue->pucch_config_dedicated_nr[gNB_id].PUCCH_Resource[current_resource_id] != NULL) {
nb_symbols_for_tx = ue->pucch_config_dedicated_nr[gNB_id].PUCCH_Resource[current_resource_id]->format_parameters.nrofSymbols;
format_pucch = ue->pucch_config_dedicated_nr[gNB_id].PUCCH_Resource[current_resource_id]->format_parameters.format;
if (check_pucch_format(ue, gNB_id, format_pucch, nb_symbols_for_tx, uci_size) == TRUE) {
*resource_set_id = pucch_resource_set_id;
*resource_id = current_resource_id;
return (TRUE);
}
else {
LOG_E(PHY,"PUCCH Found format no compatible with payload size and symbol length : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return (FALSE);
}
}
}
else {
LOG_E(PHY,"PUCCH Undefined Resource related to pucch resource indicator: at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return (FALSE);
}
}
else {
LOG_E(PHY,"PUCCH Invalid pucch resource indicator: at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return (FALSE);
}
}
/* check that a resource has been found */
if (*resource_set_id == MAX_NB_OF_PUCCH_RESOURCES) {
LOG_E(PHY,"PUCCH No compatible pucch format found : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return (FALSE);
}
}
return (FALSE);
}
/*******************************************************************
*
* NAME : find_pucch_resource_set
*
* PARAMETERS : ue context
* gNB_id identifier
*
*
* RETURN : harq process identifier
*
* DESCRIPTION : return tx harq process identifier for given transmission slot
* YS 38.213 9.2.2 PUCCH Formats for UCI transmission
*
*********************************************************************/
int find_pucch_resource_set(PHY_VARS_NR_UE *ue, uint8_t gNB_id, int uci_size)
{
int pucch_resource_set_id = 0;
/* from TS 38.331 field maxPayloadMinus1
-- Maximum number of payload bits minus 1 that the UE may transmit using this PUCCH resource set. In a PUCCH occurrence, the UE
-- chooses the first of its PUCCH-ResourceSet which supports the number of bits that the UE wants to transmit.
-- The field is not present in the first set (Set0) since the maximum Size of Set0 is specified to be 3 bit.
-- The field is not present in the last configured set since the UE derives its maximum payload size as specified in 38.213.
-- This field can take integer values that are multiples of 4. Corresponds to L1 parameter 'N_2' or 'N_3' (see 38.213, section 9.2)
*/
/* look for the first resource set which supports uci_size number of bits for payload */
while (pucch_resource_set_id < MAX_NB_OF_PUCCH_RESOURCE_SETS) {
if (ue->pucch_config_dedicated_nr[gNB_id].PUCCH_ResourceSet[pucch_resource_set_id] != NULL) {
if (uci_size <= ue->pucch_config_dedicated_nr[gNB_id].PUCCH_ResourceSet[pucch_resource_set_id]->maxPayloadMinus1 + 1) {
NR_TST_PHY_PRINTF("PUCCH found resource set %d \n", pucch_resource_set_id);
return (pucch_resource_set_id);
break;
}
}
pucch_resource_set_id++;
}
pucch_resource_set_id = MAX_NB_OF_PUCCH_RESOURCE_SETS;
return (pucch_resource_set_id);
}
/*******************************************************************
*
* NAME : check_pucch_format
*
* PARAMETERS : ue context
* processing slots of reception/transmission
* gNB_id identifier
*
* RETURN : harq process identifier
*
* DESCRIPTION : return tx harq process identifier for given transmission slot
* YS 38.213 9.2.2 PUCCH Formats for UCI transmission
*
*********************************************************************/
boolean_t check_pucch_format(PHY_VARS_NR_UE *ue, uint8_t gNB_id, pucch_format_nr_t format_pucch, int nb_symbols_for_tx, int uci_size)
{
pucch_format_nr_t selected_pucch_format;
pucch_format_nr_t selected_pucch_format_second;
if (format_pucch != pucch_format0_nr) {
if (ue->pucch_config_dedicated_nr[gNB_id].formatConfig[format_pucch-1] != NULL) {
if (ue->pucch_config_dedicated_nr[gNB_id].formatConfig[format_pucch-1]->nrofSlots != 1) {
LOG_E(PHY,"PUCCH not implemented multislots transmission : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return (FALSE);
}
}
}
if (nb_symbols_for_tx <= 2) {
if (uci_size <= 2) {
selected_pucch_format = pucch_format0_nr;
selected_pucch_format_second = selected_pucch_format;
}
else {
selected_pucch_format = pucch_format2_nr;
selected_pucch_format_second = selected_pucch_format;
}
}
else {
if (nb_symbols_for_tx >= 4) {
if (uci_size <= 2) {
selected_pucch_format = pucch_format1_nr;
selected_pucch_format_second = selected_pucch_format;
}
else {
selected_pucch_format = pucch_format3_nr; /* in this case choice can be done between two formats */
selected_pucch_format_second = pucch_format4_nr;
}
}
else {
LOG_D(PHY,"PUCCH Undefined PUCCH format : set PUCCH to format 4 : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return (FALSE);
}
}
NR_TST_PHY_PRINTF("PUCCH format %d nb symbols %d uci size %d selected format %d \n", format_pucch, nb_symbols_for_tx, uci_size, selected_pucch_format);
if (format_pucch != selected_pucch_format) {
if (format_pucch != selected_pucch_format_second) {
NR_TST_PHY_PRINTF("PUCCH mismatched of selected format: at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
LOG_D(PHY,"PUCCH format mismatched of selected format: at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return (FALSE);
}
else {
return (TRUE);
}
}
else {
return (TRUE);
}
}
/*******************************************************************
*
* NAME : trigger_periodic_scheduling_request
*
* PARAMETERS : pointer to resource set
*
* RETURN : 1 if peridic scheduling request is triggered
* 0 no periodic scheduling request
*
* DESCRIPTION : TS 38.213 9.2.4 UE procedure for reporting SR
*
*********************************************************************/
int trigger_periodic_scheduling_request(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_t *proc)
{
const int max_sr_periodicity[NB_NUMEROLOGIES_NR] = { 80, 160, 320, 640, 640 };
int active_scheduling_request = ue->scheduling_request_config_nr[gNB_id].active_sr_id;
/* is there any valid scheduling request configuration */
if (ue->scheduling_request_config_nr[gNB_id].sr_ResourceConfig[active_scheduling_request] == NULL) {
return (0);
}
if (ue->scheduling_request_config_nr[gNB_id].sr_ResourceConfig[active_scheduling_request]->periodicity < 2) {
LOG_W(PHY,"PUCCH Not supported scheduling request period smaller than 1 slot : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return (0);
}
int16_t SR_periodicity = scheduling_request_periodicity[ue->scheduling_request_config_nr[gNB_id].sr_ResourceConfig[active_scheduling_request]->periodicity];
uint16_t SR_offset = ue->scheduling_request_config_nr[gNB_id].sr_ResourceConfig[active_scheduling_request]->offset;
if (SR_periodicity > max_sr_periodicity[ue->frame_parms.numerology_index]) {
LOG_W(PHY,"PUCCH Invalid scheduling request period : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return (0);
}
if (SR_offset > SR_periodicity) {
LOG_E(PHY,"PUCCH SR offset %d is greater than SR periodicity %d : at line %d in function %s of file %s \n", SR_offset, SR_periodicity, LINE_FILE , __func__, FILE_NAME);
return (0);
}
else if (SR_periodicity == 1) {
return (1); /* period is slot */
}
int16_t N_slot_frame = NR_NUMBER_OF_SUBFRAMES_PER_FRAME * ue->frame_parms.ttis_per_subframe;
if (((proc->frame_tx * N_slot_frame) + proc->nr_tti_tx - SR_offset)%SR_periodicity == 0) {
return (1);
}
else {
return (0);
}
}
/*******************************************************************
*
* NAME : get_csi_nr
* PARAMETERS : ue context
* processing slots of reception/transmission
* gNB_id identifier
*
* RETURN : size of csi payload
*
* DESCRIPTION : CSI management is not already implemented
* so it has been simulated thank to two functions:
* - set_csi_nr
* - get_csi_nr
*
*********************************************************************/
int dummy_csi_status = 0;
uint32_t dummy_csi_payload = 0;
/* FFS TODO_NR code that should be developed */
int get_csi_nr(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint32_t *csi_payload)
{
VOID_PARAMETER ue;
VOID_PARAMETER gNB_id;
if (dummy_csi_status == 0) {
*csi_payload = 0;
}
else {
*csi_payload = dummy_csi_payload;
}
return (dummy_csi_status);
}
/* FFS TODO_NR code that should be removed */
void set_csi_nr(int csi_status, uint32_t csi_payload)
{
dummy_csi_status = csi_status;
if (dummy_csi_status == 0) {
dummy_csi_payload = 0;
}
else {
dummy_csi_payload = csi_payload;
}
}
/*
* 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
*/
/**********************************************************************
*
* FILENAME : pucch_uci_ue_nr.h
*
* MODULE : Packed Uplink Control Channel aka PUCCH
* PUCCH is used to trasnmit Uplink Control Information UCI
* which is composed of:
* - SR Scheduling Request
* - HARQ ACK/NACK
* - CSI Channel State Information
*
* DESCRIPTION : functions related to PUCCH management
* TS 38.213 9 UE procedure for reporting control information
*
************************************************************************/
#ifndef PUCCH_UCI_UE_NR_H
#define PUCCH_UCI_UE_NR_H
/************** INCLUDE *******************************************/
#include "PHY/defs_nr_UE.h"
#ifdef DEFINE_VARIABLES_PUCCH_UE_NR_H
#define EXTERN
#define INIT_VARIABLES_PUCCH_UE_NR_H
#else
#define EXTERN extern
#undef INIT_VARIABLES_PUCCH_UE_NR_H
#endif
/************** DEFINE ********************************************/
#define BITS_PER_SYMBOL_BPSK (1) /* 1 bit per symbol for bpsk modulation */
#define BITS_PER_SYMBOL_QPSK (2) /* 2 bits per symbol for bpsk modulation */
/************** VARIABLES *****************************************/
/* TS 36.213 Table 9.2.1-1: PUCCH resource sets before dedicated PUCCH resource configuration */
const initial_pucch_resource_t initial_pucch_resource[NB_INITIAL_PUCCH_RESOURCE]
#ifdef INIT_VARIABLES_PUCCH_UE_NR_H
=
{
/* format first symbol Number of symbols PRB offset nb index for set of initial CS */
/* 0 */ { pucch_format0_nr, 12, 2, 0, 2, { 0, 3, 0, 0 } },
/* 1 */ { pucch_format0_nr, 12, 2, 0, 3, { 0, 4, 8, 0 } },
/* 2 */ { pucch_format0_nr, 12, 2, 3, 3, { 0, 4, 8, 0 } },
/* 3 */ { pucch_format1_nr, 10, 4, 0, 2, { 0, 6, 0, 0 } },
/* 4 */ { pucch_format1_nr, 10, 4, 0, 4, { 0, 3, 6, 9 } },
/* 5 */ { pucch_format1_nr, 10, 4, 2, 4, { 0, 3, 6, 9 } },
/* 6 */ { pucch_format1_nr, 10, 4, 4, 4, { 0, 3, 6, 9 } },
/* 7 */ { pucch_format1_nr, 4, 10, 0, 2, { 0, 6, 0, 0 } },
/* 8 */ { pucch_format1_nr, 4, 10, 0, 4, { 0, 3, 6, 9 } },
/* 9 */ { pucch_format1_nr, 4, 10, 2, 4, { 0, 3, 6, 9 } },
/* 10 */ { pucch_format1_nr, 4, 10, 4, 4, { 0, 3, 6, 9 } },
/* 11 */ { pucch_format1_nr, 0, 14, 0, 2, { 0, 6, 0, 0 } },
/* 12 */ { pucch_format1_nr, 0, 14, 0, 4, { 0, 3, 6, 9 } },
/* 13 */ { pucch_format1_nr, 0, 14, 2, 4, { 0, 3, 6, 9 } },
/* 14 */ { pucch_format1_nr, 0, 14, 4, 4, { 0, 3, 6, 9 } },
/* 15 */ { pucch_format1_nr, 0, 14, 0, 4, { 0, 3, 6, 9 } },
}
#endif
;
/* TS 36.213 Table 9.2.3-3: Mapping of values for one HARQ-ACK bit to sequences */
const int sequence_cyclic_shift_1_harq_ack_bit[2]
#ifdef INIT_VARIABLES_PUCCH_UE_NR_H
/* HARQ-ACK Value 0 1 */
/* Sequence cyclic shift */ = { 0, 6 }
#endif
;
/* TS 38.213 Table 9.2.3-4: Mapping of values for two HARQ-ACK bits to sequences */
const int sequence_cyclic_shift_2_harq_ack_bits[4]
#ifdef INIT_VARIABLES_PUCCH_UE_NR_H
/* HARQ-ACK Value (0,0) (0,1) (1,0) (1,1) */
/* Sequence cyclic shift */ = { 0, 3, 9, 6 }
#endif
;
/* TS 36.213 Table 9.2.5-1: Mapping of values for one HARQ-ACK bit and positive SR to sequences */
const int sequence_cyclic_shift_1_harq_ack_bit_positive_sr[2]
#ifdef INIT_VARIABLES_PUCCH_UE_NR_H
/* HARQ-ACK Value 0 1 */
/* Sequence cyclic shift */ = { 3, 9 }
#endif
;
/* TS 36.213 Table 9.2.5-2: Mapping of values for two HARQ-ACK bits and positive SR to sequences */
const int sequence_cyclic_shift_2_harq_ack_bits_positive_sr[4]
#ifdef INIT_VARIABLES_PUCCH_UE_NR_H
/* HARQ-ACK Value (0,0) (0,1) (1,0) (1,1) */
/* Sequence cyclic shift */ = { 1, 4, 10, 7 }
#endif
;
/* TS 36.213 Table 9.2.5.2-1: Code rate corresponding to higher layer parameter PUCCH-F2-maximum-coderate, */
/* or PUCCH-F3-maximum-coderate, or PUCCH-F4-maximum-coderate */
/* add one additional element set to 0 for parsing the array until this end */
/* stored values are code rates * 100 */
const int code_rate_r_time_100[8]
#ifdef INIT_VARIABLES_PUCCH_UE_NR_H
= { (0.08 * 100), (0.15 * 100), (0.25*100), (0.35*100), (0.45*100), (0.60*100), (0.80*100), 0 }
#endif
;
#define NB_SYMBOL_MINUS_FOUR (11)
#define I_PUCCH_NO_ADDITIONAL_DMRS (0)
#define I_PUCCH_ADDITIONAL_DMRS (1)
#define I_PUCCH_NO_HOPPING (0)
#define I_PUCCH_HOPING (1)
/* TS 38.211 Table 6.4.1.3.3.2-1: DM-RS positions for PUCCH format 3 and 4 */
const int nb_symbols_excluding_dmrs[NB_SYMBOL_MINUS_FOUR][2][2]
#ifdef INIT_VARIABLES_PUCCH_UE_NR_H
= {
/* No additional DMRS Additional DMRS */
/* PUCCH length No hopping hopping No hopping hopping */
/* index 0 1 0 1 */
/* 4 */ {{ 3 , 2 } , { 3 , 2 }},
/* 5 */ {{ 3 , 3 } , { 3 , 3 }},
/* 6 */ {{ 4 , 4 } , { 4 , 4 }},
/* 7 */ {{ 5 , 5 } , { 5 , 5 }},
/* 8 */ {{ 6 , 6 } , { 6 , 6 }},
/* 9 */ {{ 7 , 7 } , { 7 , 7 }},
/* 10 */ {{ 8 , 8 } , { 6 , 6 }},
/* 11 */ {{ 9 , 9 } , { 7 , 7 }},
/* 12 */ {{ 10 , 10 } , { 8 , 8 }},
/* 13 */ {{ 11 , 11 } , { 9 , 9 }},
/* 14 */ {{ 12 , 12 } , { 10 , 10 }},
}
#endif
;
/* TS 38.213 9.2.5.2 UE procedure for multiplexing HARQ-ACK/SR and CSI in a PUCCH */
/* this is a counter of number of pucch format 4 per subframe */
int nb_pucch_format_4_in_subframes[LTE_NUMBER_OF_SUBFRAMES_PER_FRAME]
#ifdef INIT_VARIABLES_PUCCH_UE_NR_H
= { 0 }
#endif
;
/*************** FUNCTIONS ****************************************/
bool pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_t *proc, bool reset_harq);
/** \brief This function return number of downlink acknowledgement and its bitmap
@param ue context
@param gNB_id identity
@param slots for rx and tx
@param o_ACK HARQ-ACK information bits
@param n_HARQ_ACK use for obtaining a PUCCH transmission power
@param do_reset reset downlink HARQ context
@returns number of bits of o_ACK */
uint8_t get_downlink_ack(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_t *proc, uint32_t *o_ACK,
int *n_HARQ_ACK, bool do_reset);
/** \brief This function selects a pucch resource
@param ue context
@param gNB_id identity
@param uci size number of uci bits
@param pucch_resource_indicator is from downlink DCI
@param initial_pucch_id pucch resource id for initial phase
@param resource_set_id pucch resource set if any
@param resource_id pucch resource id if any
@returns TRUE a pucch resource has been found FALSE no valid pucch resource */
boolean_t select_pucch_resource(PHY_VARS_NR_UE *ue, uint8_t gNB_id, int uci_size, int pucch_resource_indicator,
int *initial_pucch_id, int *resource_set_id, int *resource_id, NR_UE_HARQ_STATUS_t *harq_status);
/** \brief This function select a pucch resource set
@param ue context
@param gNB_id identity
@param uci size number of uci bits
@returns number of the pucch resource set */
int find_pucch_resource_set(PHY_VARS_NR_UE *ue, uint8_t gNB_id, int uci_size);
/** \brief This function check pucch format
@param ue context
@param gNB_id identity
@param format_pucch pucch format
@param nb_symbols_for_tx number of symbols for pucch transmission
@param uci size number of uci bits
@returns TRUE pucch format matched uci size and constraints, FALSE invalid pucch format */
boolean_t check_pucch_format(PHY_VARS_NR_UE *ue, uint8_t gNB_id, pucch_format_nr_t format_pucch, int nb_symbols_for_tx,
int uci_size);
/** \brief This function selects a pucch resource
@param ue context
@param gNB_id identity
@param slots for rx and tx
@returns TRUE a scheduling request is triggered */
int trigger_periodic_scheduling_request(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_t *proc);
/** \brief This function reads current CSI
@param ue context
@param gNB_id identity
@param csi_payload is updated with CSI
@returns number of bits of CSI */
int get_csi_nr(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint32_t *csi_payload);
/** \brief This dummy function sets current CSI for simulation
@param csi_status
@param csi_payload is updated with CSI
@returns none */
void set_csi_nr(int csi_status, uint32_t csi_payload);
#endif /* PUCCH_UCI_UE_NR_H */
#/*
# * 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
# */
cmake_minimum_required(VERSION 2.8)
set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS} -O0 -g -Wextra -march=native"
)
add_definitions("-DUPGRADE_RAT_NR")
add_definitions("-DDEBUG_PSS_NR")
add_definitions("-DDEBUG_SSS_NR")
add_definitions("-DNR_UNIT_TEST")
set(PACKAGE_NAME "Testbench for unitary tests")
set(PHYSIM True)
set(RF_BOARD None)
set(XFORMS False)
set(ENABLE_ITTI False)
set(DEBUG_PHY False)
set(DEBUG_PSS True)
set(DEBUG_PHY True)
set(DEBUG_PHY_PROC False)
set(DEBUG_DLSCH True)
# standard cmake file for nr ue build
include(../../../../../cmake_targets/CMakeLists.txt)
set(SRC_UNIT_TESTS
${OPENAIR1_DIR}/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.c
${OPENAIR1_DIR}/SIMULATION/NR_UE_PHY/unit_tests/src/dummy_functions.c
)
set(INC_UNIT_TESTS
${OPENAIR1_DIR}/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.h
)
add_executable(pss_test ${OPENAIR1_DIR}/SIMULATION/NR_UE_PHY/unit_tests/src/pss_test.c ${SRC_UNIT_TESTS} ${INC_UNIT_TESTS})
target_link_libraries(pss_test
-Wl,--start-group UTIL SCHED_UE_LIB SCHED_NR_UE_LIB PHY PHY_COMMON PHY_UE PHY_NR_UE -Wl,--end-group
pthread m ${ATLAS_LIBRARIES}
)
add_executable(sss_test ${OPENAIR1_DIR}/SIMULATION/NR_UE_PHY/unit_tests/src/sss_test.c ${SRC_UNIT_TESTS} ${INC_UNIT_TESTS})
target_link_libraries(sss_test
-Wl,--start-group UTIL SCHED_UE_LIB SCHED_NR_UE_LIB PHY PHY_COMMON PHY_UE PHY_NR_UE -Wl,--end-group
pthread m ${ATLAS_LIBRARIES}
)
add_executable(frame_config_test ${OPENAIR1_DIR}/SIMULATION/NR_UE_PHY/unit_tests/src/frame_config_test.c ${SRC_UNIT_TESTS} ${INC_UNIT_TESTS})
target_link_libraries(frame_config_test
-Wl,--start-group UTIL SCHED_UE_LIB SCHED_NR_UE_LIB PHY PHY_COMMON PHY_UE PHY_NR_UE -Wl,--end-group
pthread m ${ATLAS_LIBRARIES}
)
add_executable(harq_test ${OPENAIR1_DIR}/SIMULATION/NR_UE_PHY/unit_tests/src/harq_test.c ${SRC_UNIT_TESTS} ${INC_UNIT_TESTS})
target_link_libraries(harq_test
-Wl,--start-group UTIL SCHED_UE_LIB SCHED_NR_UE_LIB PHY PHY_COMMON PHY_UE PHY_NR_UE -Wl,--end-group
pthread m ${ATLAS_LIBRARIES}
)
add_executable(srs_test ${OPENAIR1_DIR}/SIMULATION/NR_UE_PHY/unit_tests/src/srs_test.c ${SRC_UNIT_TESTS} ${INC_UNIT_TESTS})
target_link_libraries(srs_test
-Wl,--start-group UTIL SCHED_UE_LIB SCHED_NR_UE_LIB PHY PHY_COMMON PHY_UE PHY_NR_UE -Wl,--end-group
pthread m ${ATLAS_LIBRARIES}
)
add_executable(pbch_test ${OPENAIR1_DIR}/SIMULATION/NR_UE_PHY/unit_tests/src/pbch_test.c ${SRC_UNIT_TESTS} ${INC_UNIT_TESTS})
target_link_libraries(pbch_test
-Wl,--start-group UTIL SCHED_UE_LIB SCHED_NR_UE_LIB PHY PHY_COMMON PHY_UE PHY_NR_UE -Wl,--end-group
pthread m ${ATLAS_LIBRARIES}
)
add_executable(pucch_uci_test ${OPENAIR1_DIR}/SIMULATION/NR_UE_PHY/unit_tests/src/pucch_uci_test.c ${SRC_UNIT_TESTS} ${INC_UNIT_TESTS})
target_link_libraries(pucch_uci_test
-Wl,--start-group UTIL SCHED_UE_LIB SCHED_NR_UE_LIB PHY PHY_COMMON PHY_UE PHY_NR_UE -Wl,--end-group
pthread m ${ATLAS_LIBRARIES}
)
FRAME CONFIGURATION TEST
--------------------------
log init done
Start lte_param_init, frame_type 0, extended_prefix 0
[PHY][I][nr_init_frame_parms_ue] Initializing frame parms for mu 1, N_RB 106, Ncp 0
Initializing UE vars (abstraction 0) for eNB TXant 1, UE RXant 1
[PHY][E][set_tdd_config_nr] set_tdd_configuration_nr: given period is inconsistent with current tdd configuration

Tdd configuration tti 2 downlink 5 uplink 1 period 2500
[ 0] D [ 1] D [ 2] D [ 3] D [ 4] D [ 5] D [ 6] D [ 7] D [ 8] D [ 9] D [ 10] D [ 11] D [ 12] D [ 13] D [ 14] D [ 15] D [ 16] D [ 17] D [ 18] D [ 19] D
[ 20] D [ 21] D [ 22] D [ 23] D [ 24] D [ 25] D [ 26] D [ 27] D [ 28] D [ 29] D [ 30] D [ 31] D [ 32] D [ 33] D [ 34] D [ 35] D [ 36] D [ 37] D [ 38] D [ 39] D
[PHY][E][set_tdd_config_nr] set_tdd_configuration_nr: given period is inconsistent with current tdd configuration

Tdd configuration tti 2 downlink 4 uplink 2 period 2500
[ 0] D [ 1] D [ 2] D [ 3] D [ 4] D [ 5] D [ 6] D [ 7] D [ 8] D [ 9] D [ 10] D [ 11] D [ 12] D [ 13] D [ 14] D [ 15] D [ 16] D [ 17] D [ 18] D [ 19] D
[ 20] D [ 21] D [ 22] D [ 23] D [ 24] D [ 25] D [ 26] D [ 27] D [ 28] D [ 29] D [ 30] D [ 31] D [ 32] D [ 33] D [ 34] D [ 35] D [ 36] D [ 37] D [ 38] D [ 39] D
[PHY][E][set_tdd_config_nr] set_tdd_configuration_nr: given period is inconsistent with current tdd configuration

Tdd configuration tti 2 downlink 4 uplink 1 period 500
[ 0] D [ 1] D [ 2] D [ 3] D [ 4] D [ 5] D [ 6] D [ 7] D [ 8] D [ 9] D [ 10] D [ 11] D [ 12] D [ 13] D [ 14] D [ 15] D [ 16] D [ 17] D [ 18] D [ 19] D
[ 20] D [ 21] D [ 22] D [ 23] D [ 24] D [ 25] D [ 26] D [ 27] D [ 28] D [ 29] D [ 30] D [ 31] D [ 32] D [ 33] D [ 34] D [ 35] D [ 36] D [ 37] D [ 38] D [ 39] D
Tdd configuration tti 1 downlink 1 uplink 1 period 2000
[ 0] D [ 1] U [ 2] D [ 3] U [ 4] D [ 5] U [ 6] D [ 7] U [ 8] D [ 9] U [ 10] D [ 11] U [ 12] D [ 13] U [ 14] D [ 15] U [ 16] D [ 17] U [ 18] D [ 19] U
Tdd configuration tti 1 downlink 4 uplink 1 period 5000
[ 0] D [ 1] D [ 2] D [ 3] D [ 4] U [ 5] D [ 6] D [ 7] D [ 8] D [ 9] U [ 10] D [ 11] D [ 12] D [ 13] D [ 14] U [ 15] D [ 16] D [ 17] D [ 18] D [ 19] U
Tdd configuration tti 1 downlink 9 uplink 1 period 10000
[ 0] D [ 1] D [ 2] D [ 3] D [ 4] D [ 5] D [ 6] D [ 7] D [ 8] D [ 9] U [ 10] D [ 11] D [ 12] D [ 13] D [ 14] D [ 15] D [ 16] D [ 17] D [ 18] D [ 19] U
Tdd configuration tti 2 downlink 1 uplink 1 period 1000
[ 0] D [ 1] U [ 2] D [ 3] U [ 4] D [ 5] U [ 6] D [ 7] U [ 8] D [ 9] U [ 10] D [ 11] U [ 12] D [ 13] U [ 14] D [ 15] U [ 16] D [ 17] U [ 18] D [ 19] U
[ 20] D [ 21] U [ 22] D [ 23] U [ 24] D [ 25] U [ 26] D [ 27] U [ 28] D [ 29] U [ 30] D [ 31] U [ 32] D [ 33] U [ 34] D [ 35] U [ 36] D [ 37] U [ 38] D [ 39] U
Tdd configuration tti 2 downlink 3 uplink 1 period 2000
[ 0] D [ 1] D [ 2] D [ 3] U [ 4] D [ 5] D [ 6] D [ 7] U [ 8] D [ 9] D [ 10] D [ 11] U [ 12] D [ 13] D [ 14] D [ 15] U [ 16] D [ 17] D [ 18] D [ 19] U
[ 20] D [ 21] D [ 22] D [ 23] U [ 24] D [ 25] D [ 26] D [ 27] U [ 28] D [ 29] D [ 30] D [ 31] U [ 32] D [ 33] D [ 34] D [ 35] U [ 36] D [ 37] D [ 38] D [ 39] U
Tdd configuration tti 2 downlink 4 uplink 1 period 2500
[ 0] D [ 1] D [ 2] D [ 3] D [ 4] U [ 5] D [ 6] D [ 7] D [ 8] D [ 9] U [ 10] D [ 11] D [ 12] D [ 13] D [ 14] U [ 15] D [ 16] D [ 17] D [ 18] D [ 19] U
[ 20] D [ 21] D [ 22] D [ 23] D [ 24] U [ 25] D [ 26] D [ 27] D [ 28] D [ 29] U [ 30] D [ 31] D [ 32] D [ 33] D [ 34] U [ 35] D [ 36] D [ 37] D [ 38] D [ 39] U
Tdd configuration tti 2 downlink 9 uplink 1 period 5000
[ 0] D [ 1] D [ 2] D [ 3] D [ 4] D [ 5] D [ 6] D [ 7] D [ 8] D [ 9] U [ 10] D [ 11] D [ 12] D [ 13] D [ 14] D [ 15] D [ 16] D [ 17] D [ 18] D [ 19] U
[ 20] D [ 21] D [ 22] D [ 23] D [ 24] D [ 25] D [ 26] D [ 27] D [ 28] D [ 29] U [ 30] D [ 31] D [ 32] D [ 33] D [ 34] D [ 35] D [ 36] D [ 37] D [ 38] D [ 39] U
Tdd configuration tti 2 downlink 19 uplink 1 period 10000
[ 0] D [ 1] D [ 2] D [ 3] D [ 4] D [ 5] D [ 6] D [ 7] D [ 8] D [ 9] D [ 10] D [ 11] D [ 12] D [ 13] D [ 14] D [ 15] D [ 16] D [ 17] D [ 18] D [ 19] U
[ 20] D [ 21] D [ 22] D [ 23] D [ 24] D [ 25] D [ 26] D [ 27] D [ 28] D [ 29] D [ 30] D [ 31] D [ 32] D [ 33] D [ 34] D [ 35] D [ 36] D [ 37] D [ 38] D [ 39] U
Tdd configuration tti 4 downlink 1 uplink 1 period 500
[ 0] D [ 1] U [ 2] D [ 3] U [ 4] D [ 5] U [ 6] D [ 7] U [ 8] D [ 9] U [ 10] D [ 11] U [ 12] D [ 13] U [ 14] D [ 15] U [ 16] D [ 17] U [ 18] D [ 19] U
[ 20] D [ 21] U [ 22] D [ 23] U [ 24] D [ 25] U [ 26] D [ 27] U [ 28] D [ 29] U [ 30] D [ 31] U [ 32] D [ 33] U [ 34] D [ 35] U [ 36] D [ 37] U [ 38] D [ 39] U
[ 40] D [ 41] U [ 42] D [ 43] U [ 44] D [ 45] U [ 46] D [ 47] U [ 48] D [ 49] U [ 50] D [ 51] U [ 52] D [ 53] U [ 54] D [ 55] U [ 56] D [ 57] U [ 58] D [ 59] U
[ 60] D [ 61] U [ 62] D [ 63] U [ 64] D [ 65] U [ 66] D [ 67] U [ 68] D [ 69] U [ 70] D [ 71] U [ 72] D [ 73] U [ 74] D [ 75] U [ 76] D [ 77] U [ 78] D [ 79] U
Tdd configuration tti 4 downlink 3 uplink 1 period 1000
[ 0] D [ 1] D [ 2] D [ 3] U [ 4] D [ 5] D [ 6] D [ 7] U [ 8] D [ 9] D [ 10] D [ 11] U [ 12] D [ 13] D [ 14] D [ 15] U [ 16] D [ 17] D [ 18] D [ 19] U
[ 20] D [ 21] D [ 22] D [ 23] U [ 24] D [ 25] D [ 26] D [ 27] U [ 28] D [ 29] D [ 30] D [ 31] U [ 32] D [ 33] D [ 34] D [ 35] U [ 36] D [ 37] D [ 38] D [ 39] U
[ 40] D [ 41] D [ 42] D [ 43] U [ 44] D [ 45] D [ 46] D [ 47] U [ 48] D [ 49] D [ 50] D [ 51] U [ 52] D [ 53] D [ 54] D [ 55] U [ 56] D [ 57] D [ 58] D [ 59] U
[ 60] D [ 61] D [ 62] D [ 63] U [ 64] D [ 65] D [ 66] D [ 67] U [ 68] D [ 69] D [ 70] D [ 71] U [ 72] D [ 73] D [ 74] D [ 75] U [ 76] D [ 77] D [ 78] D [ 79] U
Tdd configuration tti 4 downlink 4 uplink 1 period 1250
[ 0] D [ 1] D [ 2] D [ 3] D [ 4] U [ 5] D [ 6] D [ 7] D [ 8] D [ 9] U [ 10] D [ 11] D [ 12] D [ 13] D [ 14] U [ 15] D [ 16] D [ 17] D [ 18] D [ 19] U
[ 20] D [ 21] D [ 22] D [ 23] D [ 24] U [ 25] D [ 26] D [ 27] D [ 28] D [ 29] U [ 30] D [ 31] D [ 32] D [ 33] D [ 34] U [ 35] D [ 36] D [ 37] D [ 38] D [ 39] U
[ 40] D [ 41] D [ 42] D [ 43] D [ 44] U [ 45] D [ 46] D [ 47] D [ 48] D [ 49] U [ 50] D [ 51] D [ 52] D [ 53] D [ 54] U [ 55] D [ 56] D [ 57] D [ 58] D [ 59] U
[ 60] D [ 61] D [ 62] D [ 63] D [ 64] U [ 65] D [ 66] D [ 67] D [ 68] D [ 69] U [ 70] D [ 71] D [ 72] D [ 73] D [ 74] U [ 75] D [ 76] D [ 77] D [ 78] D [ 79] U
Tdd configuration tti 4 downlink 7 uplink 1 period 2000
[ 0] D [ 1] D [ 2] D [ 3] D [ 4] D [ 5] D [ 6] D [ 7] U [ 8] D [ 9] D [ 10] D [ 11] D [ 12] D [ 13] D [ 14] D [ 15] U [ 16] D [ 17] D [ 18] D [ 19] D
[ 20] D [ 21] D [ 22] D [ 23] U [ 24] D [ 25] D [ 26] D [ 27] D [ 28] D [ 29] D [ 30] D [ 31] U [ 32] D [ 33] D [ 34] D [ 35] D [ 36] D [ 37] D [ 38] D [ 39] U
[ 40] D [ 41] D [ 42] D [ 43] D [ 44] D [ 45] D [ 46] D [ 47] U [ 48] D [ 49] D [ 50] D [ 51] D [ 52] D [ 53] D [ 54] D [ 55] U [ 56] D [ 57] D [ 58] D [ 59] D
[ 60] D [ 61] D [ 62] D [ 63] U [ 64] D [ 65] D [ 66] D [ 67] D [ 68] D [ 69] D [ 70] D [ 71] U [ 72] D [ 73] D [ 74] D [ 75] D [ 76] D [ 77] D [ 78] D [ 79] U
Tdd configuration tti 4 downlink 9 uplink 1 period 2500
[ 0] D [ 1] D [ 2] D [ 3] D [ 4] D [ 5] D [ 6] D [ 7] D [ 8] D [ 9] U [ 10] D [ 11] D [ 12] D [ 13] D [ 14] D [ 15] D [ 16] D [ 17] D [ 18] D [ 19] U
[ 20] D [ 21] D [ 22] D [ 23] D [ 24] D [ 25] D [ 26] D [ 27] D [ 28] D [ 29] U [ 30] D [ 31] D [ 32] D [ 33] D [ 34] D [ 35] D [ 36] D [ 37] D [ 38] D [ 39] U
[ 40] D [ 41] D [ 42] D [ 43] D [ 44] D [ 45] D [ 46] D [ 47] D [ 48] D [ 49] U [ 50] D [ 51] D [ 52] D [ 53] D [ 54] D [ 55] D [ 56] D [ 57] D [ 58] D [ 59] U
[ 60] D [ 61] D [ 62] D [ 63] D [ 64] D [ 65] D [ 66] D [ 67] D [ 68] D [ 69] U [ 70] D [ 71] D [ 72] D [ 73] D [ 74] D [ 75] D [ 76] D [ 77] D [ 78] D [ 79] U
Tdd configuration tti 4 downlink 19 uplink 1 period 5000
[ 0] D [ 1] D [ 2] D [ 3] D [ 4] D [ 5] D [ 6] D [ 7] D [ 8] D [ 9] D [ 10] D [ 11] D [ 12] D [ 13] D [ 14] D [ 15] D [ 16] D [ 17] D [ 18] D [ 19] U
[ 20] D [ 21] D [ 22] D [ 23] D [ 24] D [ 25] D [ 26] D [ 27] D [ 28] D [ 29] D [ 30] D [ 31] D [ 32] D [ 33] D [ 34] D [ 35] D [ 36] D [ 37] D [ 38] D [ 39] U
[ 40] D [ 41] D [ 42] D [ 43] D [ 44] D [ 45] D [ 46] D [ 47] D [ 48] D [ 49] D [ 50] D [ 51] D [ 52] D [ 53] D [ 54] D [ 55] D [ 56] D [ 57] D [ 58] D [ 59] U
[ 60] D [ 61] D [ 62] D [ 63] D [ 64] D [ 65] D [ 66] D [ 67] D [ 68] D [ 69] D [ 70] D [ 71] D [ 72] D [ 73] D [ 74] D [ 75] D [ 76] D [ 77] D [ 78] D [ 79] U
Tdd configuration tti 4 downlink 38 uplink 2 period 10000
[ 0] D [ 1] D [ 2] D [ 3] D [ 4] D [ 5] D [ 6] D [ 7] D [ 8] D [ 9] D [ 10] D [ 11] D [ 12] D [ 13] D [ 14] D [ 15] D [ 16] D [ 17] D [ 18] D [ 19] D
[ 20] D [ 21] D [ 22] D [ 23] D [ 24] D [ 25] D [ 26] D [ 27] D [ 28] D [ 29] D [ 30] D [ 31] D [ 32] D [ 33] D [ 34] D [ 35] D [ 36] D [ 37] D [ 38] U [ 39] U
[ 40] D [ 41] D [ 42] D [ 43] D [ 44] D [ 45] D [ 46] D [ 47] D [ 48] D [ 49] D [ 50] D [ 51] D [ 52] D [ 53] D [ 54] D [ 55] D [ 56] D [ 57] D [ 58] D [ 59] D
[ 60] D [ 61] D [ 62] D [ 63] D [ 64] D [ 65] D [ 66] D [ 67] D [ 68] D [ 69] D [ 70] D [ 71] D [ 72] D [ 73] D [ 74] D [ 75] D [ 76] D [ 77] D [ 78] U [ 79] U
Tdd configuration tti 8 downlink 4 uplink 1 period 625
[ 0] D [ 1] D [ 2] D [ 3] D [ 4] U [ 5] D [ 6] D [ 7] D [ 8] D [ 9] U [ 10] D [ 11] D [ 12] D [ 13] D [ 14] U [ 15] D [ 16] D [ 17] D [ 18] D [ 19] U
[ 20] D [ 21] D [ 22] D [ 23] D [ 24] U [ 25] D [ 26] D [ 27] D [ 28] D [ 29] U [ 30] D [ 31] D [ 32] D [ 33] D [ 34] U [ 35] D [ 36] D [ 37] D [ 38] D [ 39] U
[ 40] D [ 41] D [ 42] D [ 43] D [ 44] U [ 45] D [ 46] D [ 47] D [ 48] D [ 49] U [ 50] D [ 51] D [ 52] D [ 53] D [ 54] U [ 55] D [ 56] D [ 57] D [ 58] D [ 59] U
[ 60] D [ 61] D [ 62] D [ 63] D [ 64] U [ 65] D [ 66] D [ 67] D [ 68] D [ 69] U [ 70] D [ 71] D [ 72] D [ 73] D [ 74] U [ 75] D [ 76] D [ 77] D [ 78] D [ 79] U
[ 80] D [ 81] D [ 82] D [ 83] D [ 84] U [ 85] D [ 86] D [ 87] D [ 88] D [ 89] U [ 90] D [ 91] D [ 92] D [ 93] D [ 94] U [ 95] D [ 96] D [ 97] D [ 98] D [ 99] U
[100] D [101] D [102] D [103] D [104] U [105] D [106] D [107] D [108] D [109] U [110] D [111] D [112] D [113] D [114] U [115] D [116] D [117] D [118] D [119] U
[120] D [121] D [122] D [123] D [124] U [125] D [126] D [127] D [128] D [129] U [130] D [131] D [132] D [133] D [134] U [135] D [136] D [137] D [138] D [139] U
[140] D [141] D [142] D [143] D [144] U [145] D [146] D [147] D [148] D [149] U [150] D [151] D [152] D [153] D [154] U [155] D [156] D [157] D [158] D [159] U
Tdd configuration tti 16 downlink 7 uplink 1 period 500
[ 0] D [ 1] D [ 2] D [ 3] D [ 4] D [ 5] D [ 6] D [ 7] U [ 8] D [ 9] D [ 10] D [ 11] D [ 12] D [ 13] D [ 14] D [ 15] U [ 16] D [ 17] D [ 18] D [ 19] D
[ 20] D [ 21] D [ 22] D [ 23] U [ 24] D [ 25] D [ 26] D [ 27] D [ 28] D [ 29] D [ 30] D [ 31] U [ 32] D [ 33] D [ 34] D [ 35] D [ 36] D [ 37] D [ 38] D [ 39] U
[ 40] D [ 41] D [ 42] D [ 43] D [ 44] D [ 45] D [ 46] D [ 47] U [ 48] D [ 49] D [ 50] D [ 51] D [ 52] D [ 53] D [ 54] D [ 55] U [ 56] D [ 57] D [ 58] D [ 59] D
[ 60] D [ 61] D [ 62] D [ 63] U [ 64] D [ 65] D [ 66] D [ 67] D [ 68] D [ 69] D [ 70] D [ 71] U [ 72] D [ 73] D [ 74] D [ 75] D [ 76] D [ 77] D [ 78] D [ 79] U
[ 80] D [ 81] D [ 82] D [ 83] D [ 84] D [ 85] D [ 86] D [ 87] U [ 88] D [ 89] D [ 90] D [ 91] D [ 92] D [ 93] D [ 94] D [ 95] U [ 96] D [ 97] D [ 98] D [ 99] D
[100] D [101] D [102] D [103] U [104] D [105] D [106] D [107] D [108] D [109] D [110] D [111] U [112] D [113] D [114] D [115] D [116] D [117] D [118] D [119] U
[120] D [121] D [122] D [123] D [124] D [125] D [126] D [127] U [128] D [129] D [130] D [131] D [132] D [133] D [134] D [135] U [136] D [137] D [138] D [139] D
[140] D [141] D [142] D [143] U [144] D [145] D [146] D [147] D [148] D [149] D [150] D [151] U [152] D [153] D [154] D [155] D [156] D [157] D [158] D [159] U
[160] D [161] D [162] D [163] D [164] D [165] D [166] D [167] U [168] D [169] D [170] D [171] D [172] D [173] D [174] D [175] U [176] D [177] D [178] D [179] D
[180] D [181] D [182] D [183] U [184] D [185] D [186] D [187] D [188] D [189] D [190] D [191] U [192] D [193] D [194] D [195] D [196] D [197] D [198] D [199] U
[200] D [201] D [202] D [203] D [204] D [205] D [206] D [207] U [208] D [209] D [210] D [211] D [212] D [213] D [214] D [215] U [216] D [217] D [218] D [219] D
[220] D [221] D [222] D [223] U [224] D [225] D [226] D [227] D [228] D [229] D [230] D [231] U [232] D [233] D [234] D [235] D [236] D [237] D [238] D [239] U
[240] D [241] D [242] D [243] D [244] D [245] D [246] D [247] U [248] D [249] D [250] D [251] D [252] D [253] D [254] D [255] U [256] D [257] D [258] D [259] D
[260] D [261] D [262] D [263] U [264] D [265] D [266] D [267] D [268] D [269] D [270] D [271] U [272] D [273] D [274] D [275] D [276] D [277] D [278] D [279] U
[280] D [281] D [282] D [283] D [284] D [285] D [286] D [287] U [288] D [289] D [290] D [291] D [292] D [293] D [294] D [295] U [296] D [297] D [298] D [299] D
[300] D [301] D [302] D [303] U [304] D [305] D [306] D [307] D [308] D [309] D [310] D [311] U [312] D [313] D [314] D [315] D [316] D [317] D [318] D [319] U
Tdd configuration tti 2 downlink 4 uplink 1 period 2500
[ 0] D [ 1] D [ 2] D [ 3] D [ 4] U [ 5] D [ 6] D [ 7] D [ 8] D [ 9] U [ 10] D [ 11] D [ 12] D [ 13] D [ 14] U [ 15] D [ 16] D [ 17] D [ 18] D [ 19] U
[ 20] D [ 21] D [ 22] D [ 23] D [ 24] U [ 25] D [ 26] D [ 27] D [ 28] D [ 29] U [ 30] D [ 31] D [ 32] D [ 33] D [ 34] U [ 35] D [ 36] D [ 37] D [ 38] D [ 39] U
Set tdd dedicated configuration
[PHY][E][set_tdd_configuration_dedicated_nr] set_tdd_configuration_dedicated_nr: tdd downlink symbol configuration is not supported

Set tdd dedicated configuration
[PHY][E][set_tdd_configuration_dedicated_nr] set_tdd_configuration_dedicated_nr: tdd uplink symbol configuration is not supported

Set tdd dedicated configuration
[PHY][E][set_tdd_configuration_dedicated_nr] set_tdd_configuration_dedicated_nr: tdd slot index exceeds maximum value

Set tdd dedicated configuration
[PHY][E][set_tdd_configuration_dedicated_nr] set_tdd_configuration_dedicated_nr: tdd downlink & uplink symbol configuration is not supported

Set tdd dedicated configuration
[PHY][E][set_tdd_configuration_dedicated_nr] set_tdd_configuration_dedicated_nr: no tdd symbol configuration is specified

Set tdd dedicated configuration
UL[0] [PHY][E][set_tdd_configuration_dedicated_nr] set_tdd_configuration_dedicated_nr: no tdd symbol configuration is specified

Set tdd dedicated configuration
DL[0]
Tdd configuration tti 2 downlink 4 uplink 1 period 2500
[ 0] D [ 1] D [ 2] D [ 3] D [ 4] U [ 5] D [ 6] D [ 7] D [ 8] D [ 9] U [ 10] D [ 11] D [ 12] D [ 13] D [ 14] U [ 15] D [ 16] D [ 17] D [ 18] D [ 19] U
[ 20] D [ 21] D [ 22] D [ 23] D [ 24] U [ 25] D [ 26] D [ 27] D [ 28] D [ 29] U [ 30] D [ 31] D [ 32] D [ 33] D [ 34] U [ 35] D [ 36] D [ 37] D [ 38] D [ 39] U
Set tdd dedicated configuration
UL[0] UL[5] UL[10] UL[15] UL[20] UL[25] UL[30] UL[35] DL[4] DL[9] DL[14] DL[19] DL[19] DL[24] DL[29] DL[34] DL[39]
Tdd configuration tti 2 downlink 4 uplink 1 period 2500
[ 0] U [ 1] D [ 2] D [ 3] D [ 4] D [ 5] U [ 6] D [ 7] D [ 8] D [ 9] D [ 10] U [ 11] D [ 12] D [ 13] D [ 14] D [ 15] U [ 16] D [ 17] D [ 18] D [ 19] D
[ 20] U [ 21] D [ 22] D [ 23] D [ 24] D [ 25] U [ 26] D [ 27] D [ 28] D [ 29] D [ 30] U [ 31] D [ 32] D [ 33] D [ 34] D [ 35] U [ 36] D [ 37] D [ 38] D [ 39] D
Test NR FRAME CONFIGURATION is pass
HARQ TEST
----------
log init done
Start lte_param_init, frame_type 0, extended_prefix 0
[PHY][I][nr_init_frame_parms_ue] Initializing frame parms for mu 1, N_RB 106, Ncp 0
Initializing UE vars (abstraction 0) for eNB TXant 1, UE RXant 1
HARQ Uplink
First sequence ndi does not toggle
[HARQ-UL-PUSCH harqId : 0] first new transmission
[HARQ-UL-PUSCH harqId : 0] retransmission
[HARQ-UL-PUSCH harqId : 0] retransmission
[HARQ-UL-PUSCH harqId : 0] retransmission
[HARQ-UL-PUSCH harqId : 0] retransmission
Second sequence ndi toggle each transmission
[HARQ-UL-PUSCH harqId : 1] first new transmission
[HARQ-UL-PUSCH harqId : 1] new transmission due to toogle of ndi
[HARQ-UL-PUSCH harqId : 1] new transmission due to toogle of ndi
[HARQ-UL-PUSCH harqId : 1] new transmission due to toogle of ndi
[HARQ-UL-PUSCH harqId : 1] new transmission due to toogle of ndi
Third sequence ndi toggle each two transmissions
[HARQ-UL-PUSCH harqId : 2] first new transmission
[HARQ-UL-PUSCH harqId : 2] retransmission
[HARQ-UL-PUSCH harqId : 2] new transmission due to toogle of ndi
[HARQ-UL-PUSCH harqId : 2] retransmission
[HARQ-UL-PUSCH harqId : 2] new transmission due to toogle of ndi
HARQ Downlink
First sequence ndi does not toggle
[HARQ-DL-PDSCH harqId : 0] first new reception
[HARQ-DL-PDSCH harqId : 0] reception of a retransmission
[HARQ-DL-PDSCH harqId : 0] reception of a retransmission
[HARQ-DL-PDSCH harqId : 0] reception of a retransmission
[HARQ-DL-PDSCH harqId : 0] reception of a retransmission
Second sequence ndi toggle each transmission
[HARQ-DL-PDSCH harqId : 1] first new reception
[HARQ-DL-PDSCH harqId : 1] new reception due to toogle of ndi
[HARQ-DL-PDSCH harqId : 1] new reception due to toogle of ndi
[HARQ-DL-PDSCH harqId : 1] new reception due to toogle of ndi
[HARQ-DL-PDSCH harqId : 1] new reception due to toogle of ndi
Third sequence ndi toggle each two transmissions
[HARQ-DL-PDSCH harqId : 2] first new reception
[HARQ-DL-PDSCH harqId : 2] reception of a retransmission
[HARQ-DL-PDSCH harqId : 2] new reception due to toogle of ndi
[HARQ-DL-PDSCH harqId : 2] reception of a retransmission
[HARQ-DL-PDSCH harqId : 2] new reception due to toogle of ndi
Test NR HARQ is pass
PSS TEST
----------
log init done
Start lte_param_init, frame_type 0, extended_prefix 0
[PHY][I][nr_init_frame_parms_ue] Initializing frame parms for mu 1, N_RB 106, Ncp 0
Initializing UE vars (abstraction 0) for eNB TXant 1, UE RXant 1
***********************************
PSS NR Test synchronisation
***********************************
------------------------------------------------
Test nr pss with Nid2 0 at position 0
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 0, Peak found at pos 0, val = 232379536 (41 dB)
[UE] nr_synchro_time: Sync source = 0, Peak found at pos 0, val = 232379536 (41 dB)
PSS NR Test is pass: pss detected at right position
------------------------------------------------
Test nr pss with Nid2 1 at position 0
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 1, Peak found at pos 0, val = 232105225 (41 dB)
[UE] nr_synchro_time: Sync source = 1, Peak found at pos 0, val = 232105225 (41 dB)
PSS NR Test is pass: pss detected at right position
------------------------------------------------
Test nr pss with Nid2 2 at position 0
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 0, val = 231344100 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 0, val = 231344100 (41 dB)
PSS NR Test is pass: pss detected at right position
------------------------------------------------
Test nr pss with Nid2 0 at position 492
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 0, Peak found at pos 492, val = 232379536 (41 dB)
[UE] nr_synchro_time: Sync source = 0, Peak found at pos 492, val = 232379536 (41 dB)
PSS NR Test is pass: pss detected at right position
------------------------------------------------
Test nr pss with Nid2 1 at position 492
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 1, Peak found at pos 492, val = 232105225 (41 dB)
[UE] nr_synchro_time: Sync source = 1, Peak found at pos 492, val = 232105225 (41 dB)
PSS NR Test is pass: pss detected at right position
------------------------------------------------
Test nr pss with Nid2 2 at position 492
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 492, val = 231344100 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 492, val = 231344100 (41 dB)
PSS NR Test is pass: pss detected at right position
------------------------------------------------
Test nr pss with Nid2 0 at position 493
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 0, Peak found at pos 492, val = 230217517 (41 dB)
[UE] nr_synchro_time: Sync source = 0, Peak found at pos 492, val = 230217517 (41 dB)
PSS NR Test is pass with warning: pss detected with a shift of 1
------------------------------------------------
Test nr pss with Nid2 1 at position 493
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 1, Peak found at pos 492, val = 230099437 (41 dB)
[UE] nr_synchro_time: Sync source = 1, Peak found at pos 492, val = 230099437 (41 dB)
PSS NR Test is pass with warning: pss detected with a shift of 1
------------------------------------------------
Test nr pss with Nid2 2 at position 493
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 492, val = 229165600 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 492, val = 229165600 (41 dB)
PSS NR Test is pass with warning: pss detected with a shift of 1
------------------------------------------------
Test nr pss with Nid2 0 at position 56788
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 0, Peak found at pos 56788, val = 232379536 (41 dB)
[UE] nr_synchro_time: Sync source = 0, Peak found at pos 56788, val = 232379536 (41 dB)
PSS NR Test is pass: pss detected at right position
------------------------------------------------
Test nr pss with Nid2 1 at position 56788
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 1, Peak found at pos 56788, val = 232105225 (41 dB)
[UE] nr_synchro_time: Sync source = 1, Peak found at pos 56788, val = 232105225 (41 dB)
PSS NR Test is pass: pss detected at right position
------------------------------------------------
Test nr pss with Nid2 2 at position 56788
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 56788, val = 231344100 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 56788, val = 231344100 (41 dB)
PSS NR Test is pass: pss detected at right position
------------------------------------------------
Test nr pss with Nid2 0 at position 56888
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 0, Peak found at pos 56888, val = 232379536 (41 dB)
[UE] nr_synchro_time: Sync source = 0, Peak found at pos 56888, val = 232379536 (41 dB)
PSS NR Test is pass: pss detected at right position
------------------------------------------------
Test nr pss with Nid2 1 at position 56888
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 1, Peak found at pos 56888, val = 232105225 (41 dB)
[UE] nr_synchro_time: Sync source = 1, Peak found at pos 56888, val = 232105225 (41 dB)
PSS NR Test is pass: pss detected at right position
------------------------------------------------
Test nr pss with Nid2 2 at position 56888
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 56888, val = 231344100 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 56888, val = 231344100 (41 dB)
PSS NR Test is pass: pss detected at right position
------------------------------------------------
Test nr pss with Nid2 0 at position 111111
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 0, Peak found at pos 111112, val = 230349320 (41 dB)
[UE] nr_synchro_time: Sync source = 0, Peak found at pos 111112, val = 230349320 (41 dB)
PSS NR Test is pass with warning: pss detected with a shift of 1
------------------------------------------------
Test nr pss with Nid2 1 at position 111111
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 1, Peak found at pos 111112, val = 230409881 (41 dB)
[UE] nr_synchro_time: Sync source = 1, Peak found at pos 111112, val = 230409881 (41 dB)
PSS NR Test is pass with warning: pss detected with a shift of 1
------------------------------------------------
Test nr pss with Nid2 2 at position 111111
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 111112, val = 229601794 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 111112, val = 229601794 (41 dB)
PSS NR Test is pass with warning: pss detected with a shift of 1
------------------------------------------------
Test nr pss with Nid2 0 at position 151234
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 0, Peak found at pos 151236, val = 219912170 (41 dB)
[UE] nr_synchro_time: Sync source = 0, Peak found at pos 151236, val = 219912170 (41 dB)
PSS NR Test is pass with warning: pss detected with a shift of 2
------------------------------------------------
Test nr pss with Nid2 1 at position 151234
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 1, Peak found at pos 151236, val = 219714314 (41 dB)
[UE] nr_synchro_time: Sync source = 1, Peak found at pos 151236, val = 219714314 (41 dB)
PSS NR Test is pass with warning: pss detected with a shift of 2
------------------------------------------------
Test nr pss with Nid2 2 at position 151234
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 151236, val = 219588850 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 151236, val = 219588850 (41 dB)
PSS NR Test is pass with warning: pss detected with a shift of 2
------------------------------------------------
Test nr pss with Nid2 0 at position 151500
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 0, Peak found at pos 151500, val = 232379536 (41 dB)
[UE] nr_synchro_time: Sync source = 0, Peak found at pos 151500, val = 232379536 (41 dB)
PSS NR Test is pass: pss detected at right position
------------------------------------------------
Test nr pss with Nid2 1 at position 151500
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 1, Peak found at pos 151500, val = 232105225 (41 dB)
[UE] nr_synchro_time: Sync source = 1, Peak found at pos 151500, val = 232105225 (41 dB)
PSS NR Test is pass: pss detected at right position
------------------------------------------------
Test nr pss with Nid2 2 at position 151500
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 151500, val = 231344100 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 151500, val = 231344100 (41 dB)
PSS NR Test is pass: pss detected at right position
------------------------------------------------
Test nr pss with Nid2 0 at position 200000
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 0, Peak found at pos 200000, val = 232379536 (41 dB)
[UE] nr_synchro_time: Sync source = 0, Peak found at pos 200000, val = 232379536 (41 dB)
PSS NR Test is pass: pss detected at right position
------------------------------------------------
Test nr pss with Nid2 1 at position 200000
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 1, Peak found at pos 200000, val = 232105225 (41 dB)
[UE] nr_synchro_time: Sync source = 1, Peak found at pos 200000, val = 232105225 (41 dB)
PSS NR Test is pass: pss detected at right position
------------------------------------------------
Test nr pss with Nid2 2 at position 200000
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 200000, val = 231344100 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 200000, val = 231344100 (41 dB)
PSS NR Test is pass: pss detected at right position
------------------------------------------------
Test nr pss with Nid2 0 at position 250004
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 0, Peak found at pos 250004, val = 232379536 (41 dB)
[UE] nr_synchro_time: Sync source = 0, Peak found at pos 250004, val = 232379536 (41 dB)
PSS NR Test is pass: pss detected at right position
------------------------------------------------
Test nr pss with Nid2 1 at position 250004
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 1, Peak found at pos 250004, val = 232105225 (41 dB)
[UE] nr_synchro_time: Sync source = 1, Peak found at pos 250004, val = 232105225 (41 dB)
PSS NR Test is pass: pss detected at right position
------------------------------------------------
Test nr pss with Nid2 2 at position 250004
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 250004, val = 231344100 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 250004, val = 231344100 (41 dB)
PSS NR Test is pass: pss detected at right position
------------------------------------------------
Test nr pss with Nid2 0 at position 305152
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 0, Peak found at pos 305148, val = 185066768 (41 dB)
[UE] nr_synchro_time: Sync source = 0, Peak found at pos 305148, val = 185066768 (41 dB)
PSS NR Test is pass with warning: pss detected with a shift of 4
------------------------------------------------
Test nr pss with Nid2 1 at position 305152
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 1, Peak found at pos 305148, val = 185490842 (41 dB)
[UE] nr_synchro_time: Sync source = 1, Peak found at pos 305148, val = 185490842 (41 dB)
PSS NR Test is pass with warning: pss detected with a shift of 4
------------------------------------------------
Test nr pss with Nid2 2 at position 305152
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 305148, val = 185637380 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 305148, val = 185637380 (41 dB)
PSS NR Test is pass with warning: pss detected with a shift of 4
PSS NR Number of tests : 33 Pass : 21 Pass with warning : 12 Fail : 0
PSS NR Synchronisaton test is terminated.
PUCCH TEST
-----------
log init done
Start lte_param_init, frame_type 0, extended_prefix 0
[PHY][I][nr_init_frame_parms_ue] Initializing frame parms for mu 1, N_RB 106, Ncp 0
Initializing UE vars (abstraction 0) for eNB TXant 1, UE RXant 1
-------------------------------------------------------------------------------------------
=> Test : No harq feedback on going
Set pucch common configuration
PUCCH No feedback AbsSubframe 0.4
[PHY][D][pucch_procedures_ue_nr] PUCCH No feedback AbsSubframe 0.4
=> Test : Error due to acknownlegment not set
[PHY][E][get_downlink_ack] PUCCH Downlink acknowledgment has not been set : at line 0 in function get_downlink_ack of file
PUCCH No feedback AbsSubframe 0.4
[PHY][D][pucch_procedures_ue_nr] PUCCH No feedback AbsSubframe 0.4
=> Test : Error due to DAI not set
[PHY][E][get_downlink_ack] PUCCH Downlink DAI has not been set : at line 0 in function get_downlink_ack of file
PUCCH No feedback AbsSubframe 0.4
[PHY][D][pucch_procedures_ue_nr] PUCCH No feedback AbsSubframe 0.4
=> Test : Error due to DAI at wrong value
[PHY][E][get_downlink_ack] PUCCH Downlink DAI has an invalid value : at line 0 in function get_downlink_ack of file
PUCCH No feedback AbsSubframe 0.4
[PHY][D][pucch_procedures_ue_nr] PUCCH No feedback AbsSubframe 0.4
=> Test : Error due to ACK not ready to be send
[PHY][E][get_downlink_ack] PUCCH Downlink ack can not be transmitted : at line 0 in function get_downlink_ack of file
PUCCH No feedback AbsSubframe 0.4
[PHY][D][pucch_procedures_ue_nr] PUCCH No feedback AbsSubframe 0.4
=> Test : Error due to invalid DAI value
[PHY][E][get_downlink_ack] PUCCH Downlink dai is invalid : at line 0 in function get_downlink_ack of file
PUCCH No feedback AbsSubframe 0.4
[PHY][D][pucch_procedures_ue_nr] PUCCH No feedback AbsSubframe 0.4
Set pucch common configuration
=> Test : Error due to undefined PUCCH format from common config
PUCCH power n(1) = ( V(1) - U(1) )mod4 * N_TB(1) + N(1)
[PHY][E][select_pucch_resource] PUCCH Invalid initial resource index : at line 0 in function select_pucch_resource of file
[PHY][W][pucch_procedures_ue_nr] PUCCH No PUCCH resource found at AbsSubframe 0.4

=> Test : Error due to PUCCH format with multiple cells not already implemented
[PHY][E][get_downlink_ack] PUCCH ACK feedback is not implemented for mutiple gNB cells : at line 0 in function get_downlink_ack of file
PUCCH No feedback AbsSubframe 0.4
[PHY][D][pucch_procedures_ue_nr] PUCCH No feedback AbsSubframe 0.4
-------------------------------------------------------------------------------------------
Set pucch common configuration
=> Test : PUCCH format from common config in prach mode: one positive downlink ACKnowledgment
PUCCH power n(1) = ( V(1) - U(1) )mod4 * N_TB(1) + N(1)
PUCCH format 0 nb symbols 2 uci size 1 selected format 0
PUCCH common configuration with index 1
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 0 data 0x00 ) ( ack length 0 data 0x00 ) ( sr length 0 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 0 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 2 ) ( max code rate*100 : 0 ) ( starting_symbol_index : 12 )
PUCCH ( starting_prb : 0 ) ( second_hop : 99 ) ( m_0 : 4 ) ( m_CS : 6 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 4 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 1 ) ( DELTA_TF : 0 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from common config in prach mode: one negative downlink ACKnowledgment
PUCCH power n(1) = ( V(1) - U(1) )mod4 * N_TB(1) + N(1)
PUCCH format 0 nb symbols 2 uci size 1 selected format 0
PUCCH common configuration with index 1
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 0 data 0x00 ) ( ack length 0 data 0x00 ) ( sr length 0 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 0 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 2 ) ( max code rate*100 : 0 ) ( starting_symbol_index : 12 )
PUCCH ( starting_prb : 0 ) ( second_hop : 99 ) ( m_0 : 4 ) ( m_CS : 0 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 4 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 1 ) ( DELTA_TF : 0 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from common config in dedicated mode: two positive downlink ACKnowledgments
PUCCH power n(2) = ( V(2) - U(2) )mod4 * N_TB(1) + N(2)
PUCCH format 1 nb symbols 4 uci size 2 selected format 1
PUCCH common configuration with index 3
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 2 data 0x02 ) ( ack length 2 data 0x02 ) ( sr length 0 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 1 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 4 ) ( max code rate*100 : 0 ) ( starting_symbol_index : 10 )
PUCCH ( starting_prb : 1 ) ( second_hop : 98 ) ( m_0 : 6 ) ( m_CS : 0 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 9 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 2 ) ( DELTA_TF : 4 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from common config in dedicated mode: one positive and one negative downlink ACKnowledgments
PUCCH power n(2) = ( V(2) - U(2) )mod4 * N_TB(1) + N(2)
PUCCH format 1 nb symbols 4 uci size 2 selected format 1
PUCCH common configuration with index 3
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 2 data 0x00 ) ( ack length 2 data 0x00 ) ( sr length 0 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 1 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 4 ) ( max code rate*100 : 0 ) ( starting_symbol_index : 10 )
PUCCH ( starting_prb : 1 ) ( second_hop : 98 ) ( m_0 : 6 ) ( m_CS : 0 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 9 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 2 ) ( DELTA_TF : 4 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from common config in dedicated mode: two negative downlink ACKnowledgments
PUCCH power n(2) = ( V(2) - U(2) )mod4 * N_TB(1) + N(2)
PUCCH format 1 nb symbols 4 uci size 2 selected format 1
PUCCH common configuration with index 3
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 2 data 0x00 ) ( ack length 2 data 0x00 ) ( sr length 0 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 1 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 4 ) ( max code rate*100 : 0 ) ( starting_symbol_index : 10 )
PUCCH ( starting_prb : 1 ) ( second_hop : 98 ) ( m_0 : 6 ) ( m_CS : 0 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 9 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 2 ) ( DELTA_TF : 4 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from common config in dedicated mode: no resource is found
PUCCH power n(2) = ( V(2) - U(2) )mod4 * N_TB(1) + N(2)
[PHY][E][select_pucch_resource] PUCCH No compatible pucch format found : at line 0 in function select_pucch_resource of file
[PHY][W][pucch_procedures_ue_nr] PUCCH No PUCCH resource found at AbsSubframe 0.4

=> Test : PUCCH format from common config in dedicated mode: no PUCCH after reset of pending harq ACKnowledgments
PUCCH No feedback AbsSubframe 0.4
[PHY][D][pucch_procedures_ue_nr] PUCCH No feedback AbsSubframe 0.4
Set default pucch dedicated configuration
-------------------------------------------------------------------------------------------
=> Test : PUCCH format from dedicated config : pucch resource indicator is invalid
PUCCH power n(1) = ( V(1) - U(1) )mod4 * N_TB(1) + N(1)
PUCCH found resource set 0
[PHY][E][select_pucch_resource] PUCCH Invalid pucch resource indicator: at line 0 in function select_pucch_resource of file
[PHY][W][pucch_procedures_ue_nr] PUCCH No PUCCH resource found at AbsSubframe 0.4

=> Test : PUCCH format from dedicated config with 1 transport block : with 1 downlink ACKnowledgments and pucch resource indicator 0
PUCCH power n(1) = ( V(1) - U(1) )mod4 * N_TB(1) + N(1)
PUCCH found resource set 0
PUCCH format 0 nb symbols 1 uci size 1 selected format 0
PUCCH dedicated configuration with resource index 0
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 0 data 0x00 ) ( ack length 0 data 0x00 ) ( sr length 0 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 0 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 1 ) ( max code rate*100 : 0 ) ( starting_symbol_index : 0 )
PUCCH ( starting_prb : 1 ) ( second_hop : 1 ) ( m_0 : 2 ) ( m_CS : 6 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 7 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 1 ) ( DELTA_TF : 3 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from dedicated config with 1 transport block : with 1 downlink ACKnowledgments and pucch resource indicator 5
PUCCH power n(1) = ( V(1) - U(1) )mod4 * N_TB(1) + N(1)
PUCCH found resource set 0
PUCCH format 1 nb symbols 9 uci size 1 selected format 1
PUCCH dedicated configuration with resource index 5
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 1 data 0x01 ) ( ack length 1 data 0x01 ) ( sr length 0 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 1 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 9 ) ( max code rate*100 : 8 ) ( starting_symbol_index : 0 )
PUCCH ( starting_prb : 1 ) ( second_hop : 1 ) ( m_0 : 2 ) ( m_CS : 0 ) ( time_domain_occ 5 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 5 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 2 ) ( DELTA_TF : 0 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from dedicated config with 1 transport block : with 2 downlink ACKnowledgments and pucch resource indicator 1
PUCCH power n(2) = ( V(2) - U(2) )mod4 * N_TB(1) + N(2)
PUCCH found resource set 0
PUCCH format 1 nb symbols 5 uci size 2 selected format 1
PUCCH dedicated configuration with resource index 1
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 2 data 0x03 ) ( ack length 2 data 0x03 ) ( sr length 0 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 1 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 5 ) ( max code rate*100 : 8 ) ( starting_symbol_index : 0 )
PUCCH ( starting_prb : 1 ) ( second_hop : 1 ) ( m_0 : 2 ) ( m_CS : 0 ) ( time_domain_occ 1 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 8 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 2 ) ( DELTA_TF : 3 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from dedicated config with 1 transport block : with 2 downlink ACKnowledgments and pucch resource indicator 0
PUCCH power n(2) = ( V(2) - U(2) )mod4 * N_TB(1) + N(2)
PUCCH found resource set 0
PUCCH format 0 nb symbols 1 uci size 2 selected format 0
PUCCH dedicated configuration with resource index 0
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 0 data 0x00 ) ( ack length 0 data 0x00 ) ( sr length 0 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 0 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 1 ) ( max code rate*100 : 0 ) ( starting_symbol_index : 0 )
PUCCH ( starting_prb : 1 ) ( second_hop : 1 ) ( m_0 : 2 ) ( m_CS : 6 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 7 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 1 ) ( DELTA_TF : 3 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from dedicated config with 1 transport block : with 3 downlink ACKnowledgments and pucch resource indicator 1
PUCCH power n(3) = ( V(3) - U(3) )mod4 * N_TB(1) + N(3)
PUCCH found resource set 1
PUCCH format 3 nb symbols 5 uci size 3 selected format 3
PUCCH dedicated configuration with resource index 9
PUCCH Adjust number of prb : (N_UCI : 3 ) (payload_in_bits : 18) (N_sc_ctrl_RB : 12) (nb_symbols : 3) (Q_m : 2) (max_code_rate*100 : 25)
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 3 data 0x07 ) ( ack length 3 data 0x07 ) ( sr length 0 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 3 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 3 ) ( max code rate*100 : 25 ) ( starting_symbol_index : 1 )
PUCCH ( starting_prb : 2 ) ( second_hop : 2 ) ( m_0 : 0 ) ( m_CS : 0 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 4 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 4 ) ( DELTA_TF : -3 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from dedicated config with 1 transport block : with 3 downlink ACKnowledgments and pucch resource indicator 3
PUCCH power n(3) = ( V(3) - U(3) )mod4 * N_TB(1) + N(3)
PUCCH found resource set 1
PUCCH format 2 nb symbols 2 uci size 3 selected format 2
PUCCH dedicated configuration with resource index 11
PUCCH Adjust number of prb : (N_UCI : 3 ) (payload_in_bits : 4) (N_sc_ctrl_RB : 8) (nb_symbols : 2) (Q_m : 2) (max_code_rate*100 : 15)
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 3 data 0x07 ) ( ack length 3 data 0x07 ) ( sr length 0 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 2 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 2 ) ( max code rate*100 : 15 ) ( starting_symbol_index : 1 )
PUCCH ( starting_prb : 2 ) ( second_hop : 2 ) ( m_0 : 0 ) ( m_CS : 0 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 6 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 3 ) ( DELTA_TF : 0 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from dedicated config with 1 transport block : with 4 downlink ACKnowledgments and pucch resource indicator 5
PUCCH power n(4) = ( V(4) - U(4) )mod4 * N_TB(1) + N(4)
PUCCH found resource set 2
PUCCH format 4 nb symbols 9 uci size 4 selected format 3
PUCCH dedicated configuration with resource index 21
PUCCH Number of pucch format 4 in subframe 4 is 1
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 4 data 0x0f ) ( ack length 4 data 0x0f ) ( sr length 0 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 4 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 7 ) ( max code rate*100 : 35 ) ( starting_symbol_index : 2 )
PUCCH ( starting_prb : 3 ) ( second_hop : 3 ) ( m_0 : 0 ) ( m_CS : 0 ) ( time_domain_occ 0 ) (occ_length : 15 ) ( occ_Index : 16 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 3 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 5 ) ( DELTA_TF : -5 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from dedicated config with 1 transport block : with 4 downlink ACKnowledgments and pucch resource indicator 7
PUCCH power n(4) = ( V(4) - U(4) )mod4 * N_TB(1) + N(4)
PUCCH found resource set 2
PUCCH format 3 nb symbols 11 uci size 4 selected format 3
PUCCH dedicated configuration with resource index 23
PUCCH Adjust number of prb : (N_UCI : 4 ) (payload_in_bits : 54) (N_sc_ctrl_RB : 12) (nb_symbols : 9) (Q_m : 2) (max_code_rate*100 : 25)
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 4 data 0x0f ) ( ack length 4 data 0x0f ) ( sr length 0 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 3 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 9 ) ( max code rate*100 : 25 ) ( starting_symbol_index : 2 )
PUCCH ( starting_prb : 3 ) ( second_hop : 3 ) ( m_0 : 0 ) ( m_CS : 0 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 1 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 4 ) ( DELTA_TF : -6 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from dedicated config with 1 transport block and missed PDSCH : with 6 downlink ACKnowledgments and pucch resource indicator 5
PUCCH power n(4) = ( V(4) - U(2) )mod4 * N_TB(1) + N(2)
PUCCH found resource set 2
PUCCH format 4 nb symbols 9 uci size 4 selected format 3
PUCCH dedicated configuration with resource index 21
PUCCH Number of pucch format 4 in subframe 4 is 2
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 4 data 0x0a ) ( ack length 4 data 0x0a ) ( sr length 0 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 4 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 7 ) ( max code rate*100 : 35 ) ( starting_symbol_index : 2 )
PUCCH ( starting_prb : 3 ) ( second_hop : 3 ) ( m_0 : 0 ) ( m_CS : 0 ) ( time_domain_occ 0 ) (occ_length : 15 ) ( occ_Index : 16 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 6 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 5 ) ( DELTA_TF : -2 ) ( G_b_f_c : 0 )
-------------------------------------------------------------------------------------------
=> Test : PUCCH format from dedicated config with 2 transport blocks : with 1 downlink ACKnowledgments and pucch resource indicator 0
PUCCH power n(2) = ( V(1) - U(1) )mod4 * N_TB(2) + N(2)
PUCCH found resource set 0
PUCCH format 0 nb symbols 1 uci size 2 selected format 0
PUCCH dedicated configuration with resource index 0
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 0 data 0x00 ) ( ack length 0 data 0x00 ) ( sr length 0 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 0 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 1 ) ( max code rate*100 : 0 ) ( starting_symbol_index : 0 )
PUCCH ( starting_prb : 1 ) ( second_hop : 1 ) ( m_0 : 2 ) ( m_CS : 6 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 7 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 1 ) ( DELTA_TF : 3 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from dedicated config with 2 transport blocks : with 1 downlink ACKnowledgments and pucch resource indicator 1
PUCCH power n(2) = ( V(1) - U(1) )mod4 * N_TB(2) + N(2)
PUCCH found resource set 0
PUCCH format 1 nb symbols 5 uci size 2 selected format 1
PUCCH dedicated configuration with resource index 1
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 2 data 0x03 ) ( ack length 2 data 0x03 ) ( sr length 0 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 1 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 5 ) ( max code rate*100 : 8 ) ( starting_symbol_index : 0 )
PUCCH ( starting_prb : 1 ) ( second_hop : 1 ) ( m_0 : 2 ) ( m_CS : 0 ) ( time_domain_occ 1 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 8 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 2 ) ( DELTA_TF : 3 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from dedicated config with 2 transport blocks : with 2 downlink ACKnowledgments and pucch resource indicator 3
PUCCH power n(4) = ( V(2) - U(2) )mod4 * N_TB(2) + N(4)
PUCCH found resource set 2
PUCCH format 2 nb symbols 2 uci size 4 selected format 2
PUCCH dedicated configuration with resource index 19
PUCCH Adjust number of prb : (N_UCI : 4 ) (payload_in_bits : 4) (N_sc_ctrl_RB : 8) (nb_symbols : 2) (Q_m : 2) (max_code_rate*100 : 15)
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 4 data 0x0f ) ( ack length 4 data 0x0f ) ( sr length 0 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 2 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 2 ) ( max code rate*100 : 15 ) ( starting_symbol_index : 2 )
PUCCH ( starting_prb : 3 ) ( second_hop : 3 ) ( m_0 : 0 ) ( m_CS : 0 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 7 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 3 ) ( DELTA_TF : 1 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from dedicated config with 2 transport blocks : with 2 downlink ACKnowledgments and pucch resource indicator 7
PUCCH power n(4) = ( V(2) - U(2) )mod4 * N_TB(2) + N(4)
PUCCH found resource set 2
PUCCH format 3 nb symbols 11 uci size 4 selected format 3
PUCCH dedicated configuration with resource index 23
PUCCH Adjust number of prb : (N_UCI : 4 ) (payload_in_bits : 54) (N_sc_ctrl_RB : 12) (nb_symbols : 9) (Q_m : 2) (max_code_rate*100 : 25)
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 4 data 0x0f ) ( ack length 4 data 0x0f ) ( sr length 0 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 3 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 9 ) ( max code rate*100 : 25 ) ( starting_symbol_index : 2 )
PUCCH ( starting_prb : 3 ) ( second_hop : 3 ) ( m_0 : 0 ) ( m_CS : 0 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 1 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 4 ) ( DELTA_TF : -6 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from dedicated config with 2 transport blocks : with 3 downlink ACKnowledgments and pucch resource indicator 2
PUCCH power n(6) = ( V(3) - U(3) )mod4 * N_TB(2) + N(6)
PUCCH found resource set 3
PUCCH format 4 nb symbols 6 uci size 6 selected format 3
PUCCH dedicated configuration with resource index 26
PUCCH Number of pucch format 4 in subframe 4 is 3
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 6 data 0x3f ) ( ack length 6 data 0x3f ) ( sr length 0 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 4 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 4 ) ( max code rate*100 : 35 ) ( starting_symbol_index : 3 )
PUCCH ( starting_prb : 4 ) ( second_hop : 4 ) ( m_0 : 0 ) ( m_CS : 0 ) ( time_domain_occ 0 ) (occ_length : 12 ) ( occ_Index : 13 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 11 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 5 ) ( DELTA_TF : 3 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from dedicated config with 2 transport blocks : with 3 downlink ACKnowledgments and pucch resource indicator 4
PUCCH power n(6) = ( V(3) - U(3) )mod4 * N_TB(2) + N(6)
PUCCH found resource set 3
PUCCH format 3 nb symbols 8 uci size 6 selected format 3
PUCCH dedicated configuration with resource index 28
PUCCH Adjust number of prb : (N_UCI : 6 ) (payload_in_bits : 36) (N_sc_ctrl_RB : 12) (nb_symbols : 6) (Q_m : 2) (max_code_rate*100 : 25)
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 6 data 0x3f ) ( ack length 6 data 0x3f ) ( sr length 0 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 3 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 6 ) ( max code rate*100 : 25 ) ( starting_symbol_index : 3 )
PUCCH ( starting_prb : 4 ) ( second_hop : 4 ) ( m_0 : 0 ) ( m_CS : 0 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 4 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 4 ) ( DELTA_TF : -3 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from dedicated config with 2 transport blocks : with 4 downlink ACKnowledgments and pucch resource indicator 4
PUCCH power n(8) = ( V(4) - U(4) )mod4 * N_TB(2) + N(8)
PUCCH found resource set 3
PUCCH format 3 nb symbols 8 uci size 8 selected format 3
PUCCH dedicated configuration with resource index 28
PUCCH Adjust number of prb : (N_UCI : 8 ) (payload_in_bits : 36) (N_sc_ctrl_RB : 12) (nb_symbols : 6) (Q_m : 2) (max_code_rate*100 : 25)
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 8 data 0xff ) ( ack length 8 data 0xff ) ( sr length 0 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 3 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 6 ) ( max code rate*100 : 25 ) ( starting_symbol_index : 3 )
PUCCH ( starting_prb : 4 ) ( second_hop : 4 ) ( m_0 : 0 ) ( m_CS : 0 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 6 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 4 ) ( DELTA_TF : -1 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from dedicated config with 2 transport blocks : with 4 downlink ACKnowledgments and pucch resource indicator 6
PUCCH power n(8) = ( V(4) - U(4) )mod4 * N_TB(2) + N(8)
PUCCH found resource set 3
PUCCH format 3 nb symbols 10 uci size 8 selected format 3
PUCCH dedicated configuration with resource index 30
PUCCH Adjust number of prb : (N_UCI : 8 ) (payload_in_bits : 48) (N_sc_ctrl_RB : 12) (nb_symbols : 8) (Q_m : 2) (max_code_rate*100 : 25)
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 8 data 0xff ) ( ack length 8 data 0xff ) ( sr length 0 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 3 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 8 ) ( max code rate*100 : 25 ) ( starting_symbol_index : 3 )
PUCCH ( starting_prb : 4 ) ( second_hop : 4 ) ( m_0 : 0 ) ( m_CS : 0 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 4 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 4 ) ( DELTA_TF : -3 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from dedicated config with 2 transport blocks and 1 missed PDSCH : with 4 downlink ACKnowledgments and pucch resource indicator 4
PUCCH power n(8) = ( V(4) - U(3) )mod4 * N_TB(2) + N(6)
PUCCH found resource set 3
PUCCH format 3 nb symbols 10 uci size 8 selected format 3
PUCCH dedicated configuration with resource index 30
PUCCH Adjust number of prb : (N_UCI : 8 ) (payload_in_bits : 48) (N_sc_ctrl_RB : 12) (nb_symbols : 8) (Q_m : 2) (max_code_rate*100 : 25)
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 8 data 0xfc ) ( ack length 8 data 0xfc ) ( sr length 0 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 3 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 8 ) ( max code rate*100 : 25 ) ( starting_symbol_index : 3 )
PUCCH ( starting_prb : 4 ) ( second_hop : 4 ) ( m_0 : 0 ) ( m_CS : 0 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 4 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 4 ) ( DELTA_TF : -3 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from dedicated config with 2 transport blocks and 2 missed PDSCH : with 4 downlink ACKnowledgments and pucch resource indicator 4
PUCCH power n(8) = ( V(4) - U(2) )mod4 * N_TB(2) + N(4)
PUCCH found resource set 3
PUCCH format 3 nb symbols 10 uci size 8 selected format 3
PUCCH dedicated configuration with resource index 30
PUCCH Adjust number of prb : (N_UCI : 8 ) (payload_in_bits : 48) (N_sc_ctrl_RB : 12) (nb_symbols : 8) (Q_m : 2) (max_code_rate*100 : 25)
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 8 data 0xcc ) ( ack length 8 data 0xcc ) ( sr length 0 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 3 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 8 ) ( max code rate*100 : 25 ) ( starting_symbol_index : 3 )
PUCCH ( starting_prb : 4 ) ( second_hop : 4 ) ( m_0 : 0 ) ( m_CS : 0 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 4 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 4 ) ( DELTA_TF : -3 ) ( G_b_f_c : 0 )
-------------------------------------------------------------------------------------------
=> Test : PUCCH format from dedicated config with only a negative scheduling request : no PUCCH should be generated
PUCCH No feedback AbsSubframe 0.4
[PHY][D][pucch_procedures_ue_nr] PUCCH No feedback AbsSubframe 0.4
=> Test : PUCCH format 0 from dedicated config with only a positive scheduling request
PUCCH found resource set 0
PUCCH format 0 nb symbols 1 uci size 1 selected format 0
PUCCH dedicated configuration with resource index 0
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 0 data 0x00 ) ( ack length 0 data 0x00 ) ( sr length 0 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 0 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 1 ) ( max code rate*100 : 0 ) ( starting_symbol_index : 0 )
PUCCH ( starting_prb : 1 ) ( second_hop : 1 ) ( m_0 : 2 ) ( m_CS : 0 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 7 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 1 ) ( DELTA_TF : 3 ) ( G_b_f_c : 0 )
=> Test : PUCCH format 1 from dedicated config with only a positive scheduling request
PUCCH found resource set 0
PUCCH format 1 nb symbols 5 uci size 1 selected format 1
PUCCH dedicated configuration with resource index 1
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 1 data 0x00 ) ( ack length 0 data 0x00 ) ( sr length 1 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 1 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 5 ) ( max code rate*100 : 8 ) ( starting_symbol_index : 0 )
PUCCH ( starting_prb : 1 ) ( second_hop : 1 ) ( m_0 : 2 ) ( m_CS : 0 ) ( time_domain_occ 1 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 8 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 2 ) ( DELTA_TF : 3 ) ( G_b_f_c : 0 )
-------------------------------------------------------------------------------------------
=> Test : PUCCH format from dedicated config with a negative scheduling request and a positive ack
PUCCH power n(1) = ( V(1) - U(1) )mod4 * N_TB(1) + N(1)
PUCCH found resource set 0
PUCCH format 0 nb symbols 1 uci size 2 selected format 0
PUCCH dedicated configuration with resource index 0
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 0 data 0x00 ) ( ack length 0 data 0x00 ) ( sr length 0 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 0 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 1 ) ( max code rate*100 : 0 ) ( starting_symbol_index : 0 )
PUCCH ( starting_prb : 1 ) ( second_hop : 1 ) ( m_0 : 2 ) ( m_CS : 0 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 7 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 1 ) ( DELTA_TF : 3 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from dedicated config with a positive scheduling request and a positive ack
PUCCH power n(1) = ( V(1) - U(1) )mod4 * N_TB(1) + N(1)
PUCCH found resource set 0
PUCCH format 0 nb symbols 1 uci size 2 selected format 0
PUCCH dedicated configuration with resource index 0
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 0 data 0x00 ) ( ack length 0 data 0x00 ) ( sr length 0 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 0 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 1 ) ( max code rate*100 : 0 ) ( starting_symbol_index : 0 )
PUCCH ( starting_prb : 1 ) ( second_hop : 1 ) ( m_0 : 2 ) ( m_CS : 9 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 7 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 1 ) ( DELTA_TF : 3 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from dedicated config with a positive scheduling request and a positive ack
PUCCH power n(1) = ( V(1) - U(1) )mod4 * N_TB(1) + N(1)
PUCCH found resource set 0
PUCCH format 1 nb symbols 5 uci size 2 selected format 1
PUCCH dedicated configuration with resource index 1
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 2 data 0x01 ) ( ack length 1 data 0x01 ) ( sr length 1 value 0 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 1 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 5 ) ( max code rate*100 : 8 ) ( starting_symbol_index : 0 )
PUCCH ( starting_prb : 1 ) ( second_hop : 1 ) ( m_0 : 2 ) ( m_CS : 0 ) ( time_domain_occ 1 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 8 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 2 ) ( DELTA_TF : 3 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from dedicated config with a positive scheduling request and two positive acks
PUCCH power n(2) = ( V(2) - U(2) )mod4 * N_TB(1) + N(2)
PUCCH found resource set 1
PUCCH format 2 nb symbols 2 uci size 3 selected format 2
PUCCH dedicated configuration with resource index 8
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 3 data 0x07 ) ( ack length 2 data 0x03 ) ( sr length 1 value 1 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 2 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 2 ) ( max code rate*100 : 15 ) ( starting_symbol_index : 1 )
PUCCH ( starting_prb : 2 ) ( second_hop : 2 ) ( m_0 : 0 ) ( m_CS : 0 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 6 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 3 ) ( DELTA_TF : 0 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from dedicated config with a positive scheduling request and two positive acks
PUCCH power n(2) = ( V(2) - U(2) )mod4 * N_TB(1) + N(2)
PUCCH found resource set 1
PUCCH format 3 nb symbols 5 uci size 3 selected format 3
PUCCH dedicated configuration with resource index 9
PUCCH Adjust number of prb : (N_UCI : 3 ) (payload_in_bits : 18) (N_sc_ctrl_RB : 12) (nb_symbols : 3) (Q_m : 2) (max_code_rate*100 : 25)
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 3 data 0x07 ) ( ack length 2 data 0x03 ) ( sr length 1 value 1 ) ( csi length 0 data : 0x00 )
PUCCH ( format : 3 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 3 ) ( max code rate*100 : 25 ) ( starting_symbol_index : 1 )
PUCCH ( starting_prb : 2 ) ( second_hop : 2 ) ( m_0 : 0 ) ( m_CS : 0 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 4 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 4 ) ( DELTA_TF : -3 ) ( G_b_f_c : 0 )
-------------------------------------------------------------------------------------------
=> Test : PUCCH format from dedicated config with CSI alone
PUCCH found resource set 2
PUCCH format 2 nb symbols 2 uci size 4 selected format 2
PUCCH dedicated configuration with resource index 16
PUCCH Adjust number of prb : (N_UCI : 4 ) (payload_in_bits : 4) (N_sc_ctrl_RB : 8) (nb_symbols : 2) (Q_m : 2) (max_code_rate*100 : 15)
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 4 data 0x0e ) ( ack length 0 data 0x00 ) ( sr length 0 value 0 ) ( csi length 4 data : 0x0e )
PUCCH ( format : 2 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 2 ) ( max code rate*100 : 15 ) ( starting_symbol_index : 2 )
PUCCH ( starting_prb : 3 ) ( second_hop : 3 ) ( m_0 : 0 ) ( m_CS : 0 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 7 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 3 ) ( DELTA_TF : 1 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from dedicated config with ACK and CSI
PUCCH power n(1) = ( V(1) - U(1) )mod4 * N_TB(1) + N(1)
PUCCH found resource set 2
PUCCH format 2 nb symbols 2 uci size 5 selected format 2
PUCCH dedicated configuration with resource index 19
PUCCH Adjust number of prb : (N_UCI : 5 ) (payload_in_bits : 4) (N_sc_ctrl_RB : 8) (nb_symbols : 2) (Q_m : 2) (max_code_rate*100 : 15)
PUCCH Adjust number of prb : (N_UCI : 5 ) (payload_in_bits : 9) (N_sc_ctrl_RB : 8) (nb_symbols : 2) (Q_m : 2) (max_code_rate*100 : 15)
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 5 data 0x1d ) ( ack length 1 data 0x01 ) ( sr length 0 value 0 ) ( csi length 4 data : 0x0e )
PUCCH ( format : 2 ) ( modulation : QPSK ) ( nb prb : 2 ) ( nb symbols : 2 ) ( max code rate*100 : 15 ) ( starting_symbol_index : 2 )
PUCCH ( starting_prb : 3 ) ( second_hop : 3 ) ( m_0 : 0 ) ( m_CS : 0 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 9 dBm ) ( 10Log(...) : 3 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 3 ) ( DELTA_TF : 0 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from dedicated config with ACK, negative SR and CSI
PUCCH power n(1) = ( V(1) - U(1) )mod4 * N_TB(1) + N(1)
PUCCH found resource set 3
PUCCH format 3 nb symbols 7 uci size 6 selected format 3
PUCCH dedicated configuration with resource index 27
PUCCH Adjust number of prb : (N_UCI : 2 ) (payload_in_bits : 30) (N_sc_ctrl_RB : 12) (nb_symbols : 5) (Q_m : 2) (max_code_rate*100 : 25)
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 2 data 0x01 ) ( ack length 1 data 0x01 ) ( sr length 1 value 0 ) ( csi length 4 data : 0x00 )
PUCCH ( format : 3 ) ( modulation : QPSK ) ( nb prb : 1 ) ( nb symbols : 5 ) ( max code rate*100 : 25 ) ( starting_symbol_index : 3 )
PUCCH ( starting_prb : 4 ) ( second_hop : 4 ) ( m_0 : 0 ) ( m_CS : 0 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 1 dBm ) ( 10Log(...) : 0 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 4 ) ( DELTA_TF : -6 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from dedicated config with negative SR and CSI
PUCCH found resource set 2
PUCCH format 2 nb symbols 2 uci size 5 selected format 2
PUCCH dedicated configuration with resource index 16
PUCCH Adjust number of prb : (N_UCI : 5 ) (payload_in_bits : 4) (N_sc_ctrl_RB : 8) (nb_symbols : 2) (Q_m : 2) (max_code_rate*100 : 15)
PUCCH Adjust number of prb : (N_UCI : 5 ) (payload_in_bits : 9) (N_sc_ctrl_RB : 8) (nb_symbols : 2) (Q_m : 2) (max_code_rate*100 : 15)
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 5 data 0x1c ) ( ack length 0 data 0x00 ) ( sr length 1 value 0 ) ( csi length 4 data : 0x0e )
PUCCH ( format : 2 ) ( modulation : QPSK ) ( nb prb : 2 ) ( nb symbols : 2 ) ( max code rate*100 : 15 ) ( starting_symbol_index : 2 )
PUCCH ( starting_prb : 3 ) ( second_hop : 3 ) ( m_0 : 0 ) ( m_CS : 0 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 9 dBm ) ( 10Log(...) : 3 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 3 ) ( DELTA_TF : 0 ) ( G_b_f_c : 0 )
=> Test : PUCCH format from dedicated config with positive SR and CSI
PUCCH found resource set 2
PUCCH format 2 nb symbols 2 uci size 5 selected format 2
PUCCH dedicated configuration with resource index 16
PUCCH Adjust number of prb : (N_UCI : 5 ) (payload_in_bits : 4) (N_sc_ctrl_RB : 8) (nb_symbols : 2) (Q_m : 2) (max_code_rate*100 : 15)
PUCCH Adjust number of prb : (N_UCI : 5 ) (payload_in_bits : 9) (N_sc_ctrl_RB : 8) (nb_symbols : 2) (Q_m : 2) (max_code_rate*100 : 15)
PUCCH ( AbsSubframe : 0.4 ) ( total payload size 5 data 0x1d ) ( ack length 0 data 0x00 ) ( sr length 1 value 1 ) ( csi length 4 data : 0x0e )
PUCCH ( format : 2 ) ( modulation : QPSK ) ( nb prb : 2 ) ( nb symbols : 2 ) ( max code rate*100 : 15 ) ( starting_symbol_index : 2 )
PUCCH ( starting_prb : 3 ) ( second_hop : 3 ) ( m_0 : 0 ) ( m_CS : 0 ) ( time_domain_occ 0 ) (occ_length : 0 ) ( occ_Index : 0 )
[PHY][D][get_PL] get_PL : Frame 0 : rsrp 0.000000 dBm/RE (-inf), eNB power 0 dBm/RE
PUCCH ( Tx power : 9 dBm ) ( 10Log(...) : 3 ) ( from Path Loss : 0 ) ( delta_F_PUCCH : 3 ) ( DELTA_TF : 0 ) ( G_b_f_c : 0 )
Release default pucch dedicated configuration
Test PUCCH is pass
This source diff could not be displayed because it is too large. You can view the blob instead.
SSS TEST
----------
log init done
Start lte_param_init, frame_type 0, extended_prefix 0
[PHY][I][nr_init_frame_parms_ue] Initializing frame parms for mu 1, N_RB 106, Ncp 0
Initializing UE vars (abstraction 0) for eNB TXant 1, UE RXant 1
***********************************
SSS NR Test synchronisation
***********************************
------------------------------------------------
Test nr pss with Nid2 0 at position 0
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 0, Peak found at pos 0, val = 232379536 (41 dB)
[UE] nr_synchro_time: Sync source = 0, Peak found at pos 0, val = 232379536 (41 dB)
Test nr sss with Nid1 0
(phase,Nid1) (0,0), metric_phase -201728 tot_metric -201728, phase_max 0
(phase,Nid1) (0,1), metric_phase 2048 tot_metric 2048, phase_max 0
(phase,Nid1) (0,3), metric_phase 18432 tot_metric 18432, phase_max 0
(phase,Nid1) (0,8), metric_phase 19456 tot_metric 19456, phase_max 0
(phase,Nid1) (0,13), metric_phase 22528 tot_metric 22528, phase_max 0
(phase,Nid1) (0,113), metric_phase 43008 tot_metric 43008, phase_max 0
(phase,Nid1) (0,135), metric_phase 45056 tot_metric 45056, phase_max 0
(phase,Nid1) (0,287), metric_phase 46080 tot_metric 46080, phase_max 0
(phase,Nid1) (1,0), metric_phase 48128 tot_metric 48128, phase_max 1
(phase,Nid1) (2,0), metric_phase 310272 tot_metric 310272, phase_max 2
(phase,Nid1) (3,0), metric_phase 498176 tot_metric 498176, phase_max 3
(phase,Nid1) (4,0), metric_phase 642048 tot_metric 642048, phase_max 4
(phase,Nid1) (5,0), metric_phase 760832 tot_metric 760832, phase_max 5
Nid2 0 Nid1 0 tot_metric 760832, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 0 Nid1 0 Nid2 0
------------------------------------------------
Test nr pss with Nid2 0 at position 492
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 0, Peak found at pos 492, val = 232379536 (41 dB)
[UE] nr_synchro_time: Sync source = 0, Peak found at pos 492, val = 232379536 (41 dB)
Test nr sss with Nid1 0
(phase,Nid1) (0,0), metric_phase -201728 tot_metric -201728, phase_max 0
(phase,Nid1) (0,1), metric_phase 2048 tot_metric 2048, phase_max 0
(phase,Nid1) (0,3), metric_phase 18432 tot_metric 18432, phase_max 0
(phase,Nid1) (0,8), metric_phase 19456 tot_metric 19456, phase_max 0
(phase,Nid1) (0,13), metric_phase 22528 tot_metric 22528, phase_max 0
(phase,Nid1) (0,113), metric_phase 43008 tot_metric 43008, phase_max 0
(phase,Nid1) (0,135), metric_phase 45056 tot_metric 45056, phase_max 0
(phase,Nid1) (0,287), metric_phase 46080 tot_metric 46080, phase_max 0
(phase,Nid1) (1,0), metric_phase 48128 tot_metric 48128, phase_max 1
(phase,Nid1) (2,0), metric_phase 310272 tot_metric 310272, phase_max 2
(phase,Nid1) (3,0), metric_phase 498176 tot_metric 498176, phase_max 3
(phase,Nid1) (4,0), metric_phase 642048 tot_metric 642048, phase_max 4
(phase,Nid1) (5,0), metric_phase 760832 tot_metric 760832, phase_max 5
Nid2 0 Nid1 0 tot_metric 760832, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 492 Nid1 0 Nid2 0
------------------------------------------------
Test nr pss with Nid2 0 at position 493
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 0, Peak found at pos 492, val = 230217517 (41 dB)
[UE] nr_synchro_time: Sync source = 0, Peak found at pos 492, val = 230217517 (41 dB)
Test nr sss with Nid1 0
(phase,Nid1) (0,0), metric_phase -201728 tot_metric -201728, phase_max 0
(phase,Nid1) (0,1), metric_phase 2048 tot_metric 2048, phase_max 0
(phase,Nid1) (0,3), metric_phase 18432 tot_metric 18432, phase_max 0
(phase,Nid1) (0,8), metric_phase 19456 tot_metric 19456, phase_max 0
(phase,Nid1) (0,13), metric_phase 22528 tot_metric 22528, phase_max 0
(phase,Nid1) (0,113), metric_phase 43008 tot_metric 43008, phase_max 0
(phase,Nid1) (0,135), metric_phase 45056 tot_metric 45056, phase_max 0
(phase,Nid1) (0,287), metric_phase 46080 tot_metric 46080, phase_max 0
(phase,Nid1) (1,0), metric_phase 48128 tot_metric 48128, phase_max 1
(phase,Nid1) (2,0), metric_phase 310272 tot_metric 310272, phase_max 2
(phase,Nid1) (3,0), metric_phase 498176 tot_metric 498176, phase_max 3
(phase,Nid1) (4,0), metric_phase 642048 tot_metric 642048, phase_max 4
(phase,Nid1) (5,0), metric_phase 760832 tot_metric 760832, phase_max 5
Nid2 0 Nid1 0 tot_metric 760832, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 493 Nid1 0 Nid2 0
------------------------------------------------
Test nr pss with Nid2 0 at position 56788
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 0, Peak found at pos 56788, val = 232379536 (41 dB)
[UE] nr_synchro_time: Sync source = 0, Peak found at pos 56788, val = 232379536 (41 dB)
Test nr sss with Nid1 0
(phase,Nid1) (0,0), metric_phase -201728 tot_metric -201728, phase_max 0
(phase,Nid1) (0,1), metric_phase 2048 tot_metric 2048, phase_max 0
(phase,Nid1) (0,3), metric_phase 18432 tot_metric 18432, phase_max 0
(phase,Nid1) (0,8), metric_phase 19456 tot_metric 19456, phase_max 0
(phase,Nid1) (0,13), metric_phase 22528 tot_metric 22528, phase_max 0
(phase,Nid1) (0,113), metric_phase 43008 tot_metric 43008, phase_max 0
(phase,Nid1) (0,135), metric_phase 45056 tot_metric 45056, phase_max 0
(phase,Nid1) (0,287), metric_phase 46080 tot_metric 46080, phase_max 0
(phase,Nid1) (1,0), metric_phase 48128 tot_metric 48128, phase_max 1
(phase,Nid1) (2,0), metric_phase 310272 tot_metric 310272, phase_max 2
(phase,Nid1) (3,0), metric_phase 498176 tot_metric 498176, phase_max 3
(phase,Nid1) (4,0), metric_phase 642048 tot_metric 642048, phase_max 4
(phase,Nid1) (5,0), metric_phase 760832 tot_metric 760832, phase_max 5
Nid2 0 Nid1 0 tot_metric 760832, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 56788 Nid1 0 Nid2 0
------------------------------------------------
Test nr pss with Nid2 0 at position 111111
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 0, Peak found at pos 111112, val = 230349320 (41 dB)
[UE] nr_synchro_time: Sync source = 0, Peak found at pos 111112, val = 230349320 (41 dB)
Test nr sss with Nid1 0
(phase,Nid1) (0,0), metric_phase -201728 tot_metric -201728, phase_max 0
(phase,Nid1) (0,1), metric_phase 2048 tot_metric 2048, phase_max 0
(phase,Nid1) (0,3), metric_phase 18432 tot_metric 18432, phase_max 0
(phase,Nid1) (0,8), metric_phase 19456 tot_metric 19456, phase_max 0
(phase,Nid1) (0,13), metric_phase 22528 tot_metric 22528, phase_max 0
(phase,Nid1) (0,113), metric_phase 43008 tot_metric 43008, phase_max 0
(phase,Nid1) (0,135), metric_phase 45056 tot_metric 45056, phase_max 0
(phase,Nid1) (0,287), metric_phase 46080 tot_metric 46080, phase_max 0
(phase,Nid1) (1,0), metric_phase 48128 tot_metric 48128, phase_max 1
(phase,Nid1) (2,0), metric_phase 310272 tot_metric 310272, phase_max 2
(phase,Nid1) (3,0), metric_phase 498176 tot_metric 498176, phase_max 3
(phase,Nid1) (4,0), metric_phase 642048 tot_metric 642048, phase_max 4
(phase,Nid1) (5,0), metric_phase 760832 tot_metric 760832, phase_max 5
Nid2 0 Nid1 0 tot_metric 760832, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 111111 Nid1 0 Nid2 0
------------------------------------------------
Test nr pss with Nid2 0 at position 222222
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 0, Peak found at pos 222224, val = 219912170 (41 dB)
[UE] nr_synchro_time: Sync source = 0, Peak found at pos 222224, val = 219912170 (41 dB)
Test nr sss with Nid1 0
(phase,Nid1) (0,0), metric_phase -201728 tot_metric -201728, phase_max 0
(phase,Nid1) (0,1), metric_phase 2048 tot_metric 2048, phase_max 0
(phase,Nid1) (0,3), metric_phase 18432 tot_metric 18432, phase_max 0
(phase,Nid1) (0,8), metric_phase 19456 tot_metric 19456, phase_max 0
(phase,Nid1) (0,13), metric_phase 22528 tot_metric 22528, phase_max 0
(phase,Nid1) (0,113), metric_phase 43008 tot_metric 43008, phase_max 0
(phase,Nid1) (0,135), metric_phase 45056 tot_metric 45056, phase_max 0
(phase,Nid1) (0,287), metric_phase 46080 tot_metric 46080, phase_max 0
(phase,Nid1) (1,0), metric_phase 48128 tot_metric 48128, phase_max 1
(phase,Nid1) (2,0), metric_phase 310272 tot_metric 310272, phase_max 2
(phase,Nid1) (3,0), metric_phase 498176 tot_metric 498176, phase_max 3
(phase,Nid1) (4,0), metric_phase 642048 tot_metric 642048, phase_max 4
(phase,Nid1) (5,0), metric_phase 760832 tot_metric 760832, phase_max 5
Nid2 0 Nid1 0 tot_metric 760832, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 222222 Nid1 0 Nid2 0
------------------------------------------------
Test nr pss with Nid2 0 at position 0
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 0, Peak found at pos 0, val = 232379536 (41 dB)
[UE] nr_synchro_time: Sync source = 0, Peak found at pos 0, val = 232379536 (41 dB)
Test nr sss with Nid1 71
(phase,Nid1) (0,0), metric_phase -14336 tot_metric -14336, phase_max 0
(phase,Nid1) (0,1), metric_phase 2048 tot_metric 2048, phase_max 0
(phase,Nid1) (0,3), metric_phase 18432 tot_metric 18432, phase_max 0
(phase,Nid1) (0,8), metric_phase 20480 tot_metric 20480, phase_max 0
(phase,Nid1) (0,23), metric_phase 22528 tot_metric 22528, phase_max 0
(phase,Nid1) (0,79), metric_phase 23552 tot_metric 23552, phase_max 0
(phase,Nid1) (0,113), metric_phase 46080 tot_metric 46080, phase_max 0
(phase,Nid1) (0,226), metric_phase 47104 tot_metric 47104, phase_max 0
(phase,Nid1) (1,71), metric_phase 60928 tot_metric 60928, phase_max 1
(phase,Nid1) (2,71), metric_phase 324608 tot_metric 324608, phase_max 2
(phase,Nid1) (3,71), metric_phase 509440 tot_metric 509440, phase_max 3
(phase,Nid1) (4,71), metric_phase 650240 tot_metric 650240, phase_max 4
(phase,Nid1) (5,71), metric_phase 770560 tot_metric 770560, phase_max 5
Nid2 0 Nid1 71 tot_metric 770560, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 0 Nid1 71 Nid2 0
------------------------------------------------
Test nr pss with Nid2 0 at position 492
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 0, Peak found at pos 492, val = 232379536 (41 dB)
[UE] nr_synchro_time: Sync source = 0, Peak found at pos 492, val = 232379536 (41 dB)
Test nr sss with Nid1 71
(phase,Nid1) (0,0), metric_phase -14336 tot_metric -14336, phase_max 0
(phase,Nid1) (0,1), metric_phase 2048 tot_metric 2048, phase_max 0
(phase,Nid1) (0,3), metric_phase 18432 tot_metric 18432, phase_max 0
(phase,Nid1) (0,8), metric_phase 20480 tot_metric 20480, phase_max 0
(phase,Nid1) (0,23), metric_phase 22528 tot_metric 22528, phase_max 0
(phase,Nid1) (0,79), metric_phase 23552 tot_metric 23552, phase_max 0
(phase,Nid1) (0,113), metric_phase 46080 tot_metric 46080, phase_max 0
(phase,Nid1) (0,226), metric_phase 47104 tot_metric 47104, phase_max 0
(phase,Nid1) (1,71), metric_phase 60928 tot_metric 60928, phase_max 1
(phase,Nid1) (2,71), metric_phase 324608 tot_metric 324608, phase_max 2
(phase,Nid1) (3,71), metric_phase 509440 tot_metric 509440, phase_max 3
(phase,Nid1) (4,71), metric_phase 650240 tot_metric 650240, phase_max 4
(phase,Nid1) (5,71), metric_phase 770560 tot_metric 770560, phase_max 5
Nid2 0 Nid1 71 tot_metric 770560, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 492 Nid1 71 Nid2 0
------------------------------------------------
Test nr pss with Nid2 0 at position 493
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 0, Peak found at pos 492, val = 230217517 (41 dB)
[UE] nr_synchro_time: Sync source = 0, Peak found at pos 492, val = 230217517 (41 dB)
Test nr sss with Nid1 71
(phase,Nid1) (0,0), metric_phase -14336 tot_metric -14336, phase_max 0
(phase,Nid1) (0,1), metric_phase 2048 tot_metric 2048, phase_max 0
(phase,Nid1) (0,3), metric_phase 18432 tot_metric 18432, phase_max 0
(phase,Nid1) (0,8), metric_phase 20480 tot_metric 20480, phase_max 0
(phase,Nid1) (0,23), metric_phase 22528 tot_metric 22528, phase_max 0
(phase,Nid1) (0,79), metric_phase 23552 tot_metric 23552, phase_max 0
(phase,Nid1) (0,113), metric_phase 46080 tot_metric 46080, phase_max 0
(phase,Nid1) (0,226), metric_phase 47104 tot_metric 47104, phase_max 0
(phase,Nid1) (1,71), metric_phase 60928 tot_metric 60928, phase_max 1
(phase,Nid1) (2,71), metric_phase 324608 tot_metric 324608, phase_max 2
(phase,Nid1) (3,71), metric_phase 509440 tot_metric 509440, phase_max 3
(phase,Nid1) (4,71), metric_phase 650240 tot_metric 650240, phase_max 4
(phase,Nid1) (5,71), metric_phase 770560 tot_metric 770560, phase_max 5
Nid2 0 Nid1 71 tot_metric 770560, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 493 Nid1 71 Nid2 0
------------------------------------------------
Test nr pss with Nid2 0 at position 56788
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 0, Peak found at pos 56788, val = 232379536 (41 dB)
[UE] nr_synchro_time: Sync source = 0, Peak found at pos 56788, val = 232379536 (41 dB)
Test nr sss with Nid1 71
(phase,Nid1) (0,0), metric_phase -14336 tot_metric -14336, phase_max 0
(phase,Nid1) (0,1), metric_phase 2048 tot_metric 2048, phase_max 0
(phase,Nid1) (0,3), metric_phase 18432 tot_metric 18432, phase_max 0
(phase,Nid1) (0,8), metric_phase 20480 tot_metric 20480, phase_max 0
(phase,Nid1) (0,23), metric_phase 22528 tot_metric 22528, phase_max 0
(phase,Nid1) (0,79), metric_phase 23552 tot_metric 23552, phase_max 0
(phase,Nid1) (0,113), metric_phase 46080 tot_metric 46080, phase_max 0
(phase,Nid1) (0,226), metric_phase 47104 tot_metric 47104, phase_max 0
(phase,Nid1) (1,71), metric_phase 60928 tot_metric 60928, phase_max 1
(phase,Nid1) (2,71), metric_phase 324608 tot_metric 324608, phase_max 2
(phase,Nid1) (3,71), metric_phase 509440 tot_metric 509440, phase_max 3
(phase,Nid1) (4,71), metric_phase 650240 tot_metric 650240, phase_max 4
(phase,Nid1) (5,71), metric_phase 770560 tot_metric 770560, phase_max 5
Nid2 0 Nid1 71 tot_metric 770560, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 56788 Nid1 71 Nid2 0
------------------------------------------------
Test nr pss with Nid2 0 at position 111111
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 0, Peak found at pos 111112, val = 230349320 (41 dB)
[UE] nr_synchro_time: Sync source = 0, Peak found at pos 111112, val = 230349320 (41 dB)
Test nr sss with Nid1 71
(phase,Nid1) (0,0), metric_phase -14336 tot_metric -14336, phase_max 0
(phase,Nid1) (0,1), metric_phase 2048 tot_metric 2048, phase_max 0
(phase,Nid1) (0,3), metric_phase 18432 tot_metric 18432, phase_max 0
(phase,Nid1) (0,8), metric_phase 20480 tot_metric 20480, phase_max 0
(phase,Nid1) (0,23), metric_phase 22528 tot_metric 22528, phase_max 0
(phase,Nid1) (0,79), metric_phase 23552 tot_metric 23552, phase_max 0
(phase,Nid1) (0,113), metric_phase 46080 tot_metric 46080, phase_max 0
(phase,Nid1) (0,226), metric_phase 47104 tot_metric 47104, phase_max 0
(phase,Nid1) (1,71), metric_phase 60928 tot_metric 60928, phase_max 1
(phase,Nid1) (2,71), metric_phase 324608 tot_metric 324608, phase_max 2
(phase,Nid1) (3,71), metric_phase 509440 tot_metric 509440, phase_max 3
(phase,Nid1) (4,71), metric_phase 650240 tot_metric 650240, phase_max 4
(phase,Nid1) (5,71), metric_phase 770560 tot_metric 770560, phase_max 5
Nid2 0 Nid1 71 tot_metric 770560, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 111111 Nid1 71 Nid2 0
------------------------------------------------
Test nr pss with Nid2 0 at position 222222
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 0, Peak found at pos 222224, val = 219912170 (41 dB)
[UE] nr_synchro_time: Sync source = 0, Peak found at pos 222224, val = 219912170 (41 dB)
Test nr sss with Nid1 71
(phase,Nid1) (0,0), metric_phase -14336 tot_metric -14336, phase_max 0
(phase,Nid1) (0,1), metric_phase 2048 tot_metric 2048, phase_max 0
(phase,Nid1) (0,3), metric_phase 18432 tot_metric 18432, phase_max 0
(phase,Nid1) (0,8), metric_phase 20480 tot_metric 20480, phase_max 0
(phase,Nid1) (0,23), metric_phase 22528 tot_metric 22528, phase_max 0
(phase,Nid1) (0,79), metric_phase 23552 tot_metric 23552, phase_max 0
(phase,Nid1) (0,113), metric_phase 46080 tot_metric 46080, phase_max 0
(phase,Nid1) (0,226), metric_phase 47104 tot_metric 47104, phase_max 0
(phase,Nid1) (1,71), metric_phase 60928 tot_metric 60928, phase_max 1
(phase,Nid1) (2,71), metric_phase 324608 tot_metric 324608, phase_max 2
(phase,Nid1) (3,71), metric_phase 509440 tot_metric 509440, phase_max 3
(phase,Nid1) (4,71), metric_phase 650240 tot_metric 650240, phase_max 4
(phase,Nid1) (5,71), metric_phase 770560 tot_metric 770560, phase_max 5
Nid2 0 Nid1 71 tot_metric 770560, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 222222 Nid1 71 Nid2 0
------------------------------------------------
Test nr pss with Nid2 2 at position 0
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 0, val = 231344100 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 0, val = 231344100 (41 dB)
Test nr sss with Nid1 21
(phase,Nid1) (0,0), metric_phase 19456 tot_metric 19456, phase_max 0
(phase,Nid1) (0,8), metric_phase 21504 tot_metric 21504, phase_max 0
(phase,Nid1) (0,13), metric_phase 23552 tot_metric 23552, phase_max 0
(phase,Nid1) (0,88), metric_phase 24576 tot_metric 24576, phase_max 0
(phase,Nid1) (0,124), metric_phase 41984 tot_metric 41984, phase_max 0
(phase,Nid1) (0,135), metric_phase 46080 tot_metric 46080, phase_max 0
(phase,Nid1) (0,319), metric_phase 47104 tot_metric 47104, phase_max 0
(phase,Nid1) (2,21), metric_phase 308736 tot_metric 308736, phase_max 2
(phase,Nid1) (3,21), metric_phase 494592 tot_metric 494592, phase_max 3
(phase,Nid1) (4,21), metric_phase 642048 tot_metric 642048, phase_max 4
(phase,Nid1) (5,21), metric_phase 759808 tot_metric 759808, phase_max 5
Nid2 2 Nid1 21 tot_metric 759808, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 0 Nid1 21 Nid2 2
------------------------------------------------
Test nr pss with Nid2 2 at position 492
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 492, val = 231344100 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 492, val = 231344100 (41 dB)
Test nr sss with Nid1 21
(phase,Nid1) (0,0), metric_phase 19456 tot_metric 19456, phase_max 0
(phase,Nid1) (0,8), metric_phase 21504 tot_metric 21504, phase_max 0
(phase,Nid1) (0,13), metric_phase 23552 tot_metric 23552, phase_max 0
(phase,Nid1) (0,88), metric_phase 24576 tot_metric 24576, phase_max 0
(phase,Nid1) (0,124), metric_phase 41984 tot_metric 41984, phase_max 0
(phase,Nid1) (0,135), metric_phase 46080 tot_metric 46080, phase_max 0
(phase,Nid1) (0,319), metric_phase 47104 tot_metric 47104, phase_max 0
(phase,Nid1) (2,21), metric_phase 308736 tot_metric 308736, phase_max 2
(phase,Nid1) (3,21), metric_phase 494592 tot_metric 494592, phase_max 3
(phase,Nid1) (4,21), metric_phase 642048 tot_metric 642048, phase_max 4
(phase,Nid1) (5,21), metric_phase 759808 tot_metric 759808, phase_max 5
Nid2 2 Nid1 21 tot_metric 759808, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 492 Nid1 21 Nid2 2
------------------------------------------------
Test nr pss with Nid2 2 at position 493
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 492, val = 229165600 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 492, val = 229165600 (41 dB)
Test nr sss with Nid1 21
(phase,Nid1) (0,0), metric_phase 19456 tot_metric 19456, phase_max 0
(phase,Nid1) (0,8), metric_phase 21504 tot_metric 21504, phase_max 0
(phase,Nid1) (0,13), metric_phase 23552 tot_metric 23552, phase_max 0
(phase,Nid1) (0,88), metric_phase 24576 tot_metric 24576, phase_max 0
(phase,Nid1) (0,124), metric_phase 41984 tot_metric 41984, phase_max 0
(phase,Nid1) (0,135), metric_phase 46080 tot_metric 46080, phase_max 0
(phase,Nid1) (0,319), metric_phase 47104 tot_metric 47104, phase_max 0
(phase,Nid1) (2,21), metric_phase 308736 tot_metric 308736, phase_max 2
(phase,Nid1) (3,21), metric_phase 494592 tot_metric 494592, phase_max 3
(phase,Nid1) (4,21), metric_phase 642048 tot_metric 642048, phase_max 4
(phase,Nid1) (5,21), metric_phase 759808 tot_metric 759808, phase_max 5
Nid2 2 Nid1 21 tot_metric 759808, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 493 Nid1 21 Nid2 2
------------------------------------------------
Test nr pss with Nid2 2 at position 56788
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 56788, val = 231344100 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 56788, val = 231344100 (41 dB)
Test nr sss with Nid1 21
(phase,Nid1) (0,0), metric_phase 19456 tot_metric 19456, phase_max 0
(phase,Nid1) (0,8), metric_phase 21504 tot_metric 21504, phase_max 0
(phase,Nid1) (0,13), metric_phase 23552 tot_metric 23552, phase_max 0
(phase,Nid1) (0,88), metric_phase 24576 tot_metric 24576, phase_max 0
(phase,Nid1) (0,124), metric_phase 41984 tot_metric 41984, phase_max 0
(phase,Nid1) (0,135), metric_phase 46080 tot_metric 46080, phase_max 0
(phase,Nid1) (0,319), metric_phase 47104 tot_metric 47104, phase_max 0
(phase,Nid1) (2,21), metric_phase 308736 tot_metric 308736, phase_max 2
(phase,Nid1) (3,21), metric_phase 494592 tot_metric 494592, phase_max 3
(phase,Nid1) (4,21), metric_phase 642048 tot_metric 642048, phase_max 4
(phase,Nid1) (5,21), metric_phase 759808 tot_metric 759808, phase_max 5
Nid2 2 Nid1 21 tot_metric 759808, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 56788 Nid1 21 Nid2 2
------------------------------------------------
Test nr pss with Nid2 2 at position 111111
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 111112, val = 229601794 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 111112, val = 229601794 (41 dB)
Test nr sss with Nid1 21
(phase,Nid1) (0,0), metric_phase 19456 tot_metric 19456, phase_max 0
(phase,Nid1) (0,8), metric_phase 21504 tot_metric 21504, phase_max 0
(phase,Nid1) (0,13), metric_phase 23552 tot_metric 23552, phase_max 0
(phase,Nid1) (0,88), metric_phase 24576 tot_metric 24576, phase_max 0
(phase,Nid1) (0,124), metric_phase 41984 tot_metric 41984, phase_max 0
(phase,Nid1) (0,135), metric_phase 46080 tot_metric 46080, phase_max 0
(phase,Nid1) (0,319), metric_phase 47104 tot_metric 47104, phase_max 0
(phase,Nid1) (2,21), metric_phase 308736 tot_metric 308736, phase_max 2
(phase,Nid1) (3,21), metric_phase 494592 tot_metric 494592, phase_max 3
(phase,Nid1) (4,21), metric_phase 642048 tot_metric 642048, phase_max 4
(phase,Nid1) (5,21), metric_phase 759808 tot_metric 759808, phase_max 5
Nid2 2 Nid1 21 tot_metric 759808, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 111111 Nid1 21 Nid2 2
------------------------------------------------
Test nr pss with Nid2 2 at position 222222
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 222224, val = 219559301 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 222224, val = 219559301 (41 dB)
Test nr sss with Nid1 21
(phase,Nid1) (0,0), metric_phase 19456 tot_metric 19456, phase_max 0
(phase,Nid1) (0,8), metric_phase 21504 tot_metric 21504, phase_max 0
(phase,Nid1) (0,13), metric_phase 23552 tot_metric 23552, phase_max 0
(phase,Nid1) (0,88), metric_phase 24576 tot_metric 24576, phase_max 0
(phase,Nid1) (0,124), metric_phase 41984 tot_metric 41984, phase_max 0
(phase,Nid1) (0,135), metric_phase 46080 tot_metric 46080, phase_max 0
(phase,Nid1) (0,319), metric_phase 47104 tot_metric 47104, phase_max 0
(phase,Nid1) (2,21), metric_phase 308736 tot_metric 308736, phase_max 2
(phase,Nid1) (3,21), metric_phase 494592 tot_metric 494592, phase_max 3
(phase,Nid1) (4,21), metric_phase 642048 tot_metric 642048, phase_max 4
(phase,Nid1) (5,21), metric_phase 759808 tot_metric 759808, phase_max 5
Nid2 2 Nid1 21 tot_metric 759808, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 222222 Nid1 21 Nid2 2
------------------------------------------------
Test nr pss with Nid2 2 at position 0
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 0, val = 231344100 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 0, val = 231344100 (41 dB)
Test nr sss with Nid1 21
(phase,Nid1) (0,0), metric_phase 19456 tot_metric 19456, phase_max 0
(phase,Nid1) (0,8), metric_phase 21504 tot_metric 21504, phase_max 0
(phase,Nid1) (0,13), metric_phase 23552 tot_metric 23552, phase_max 0
(phase,Nid1) (0,88), metric_phase 24576 tot_metric 24576, phase_max 0
(phase,Nid1) (0,124), metric_phase 41984 tot_metric 41984, phase_max 0
(phase,Nid1) (0,135), metric_phase 46080 tot_metric 46080, phase_max 0
(phase,Nid1) (0,319), metric_phase 47104 tot_metric 47104, phase_max 0
(phase,Nid1) (2,21), metric_phase 308736 tot_metric 308736, phase_max 2
(phase,Nid1) (3,21), metric_phase 494592 tot_metric 494592, phase_max 3
(phase,Nid1) (4,21), metric_phase 642048 tot_metric 642048, phase_max 4
(phase,Nid1) (5,21), metric_phase 759808 tot_metric 759808, phase_max 5
Nid2 2 Nid1 21 tot_metric 759808, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 0 Nid1 21 Nid2 2
------------------------------------------------
Test nr pss with Nid2 2 at position 492
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 492, val = 231344100 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 492, val = 231344100 (41 dB)
Test nr sss with Nid1 21
(phase,Nid1) (0,0), metric_phase 19456 tot_metric 19456, phase_max 0
(phase,Nid1) (0,8), metric_phase 21504 tot_metric 21504, phase_max 0
(phase,Nid1) (0,13), metric_phase 23552 tot_metric 23552, phase_max 0
(phase,Nid1) (0,88), metric_phase 24576 tot_metric 24576, phase_max 0
(phase,Nid1) (0,124), metric_phase 41984 tot_metric 41984, phase_max 0
(phase,Nid1) (0,135), metric_phase 46080 tot_metric 46080, phase_max 0
(phase,Nid1) (0,319), metric_phase 47104 tot_metric 47104, phase_max 0
(phase,Nid1) (2,21), metric_phase 308736 tot_metric 308736, phase_max 2
(phase,Nid1) (3,21), metric_phase 494592 tot_metric 494592, phase_max 3
(phase,Nid1) (4,21), metric_phase 642048 tot_metric 642048, phase_max 4
(phase,Nid1) (5,21), metric_phase 759808 tot_metric 759808, phase_max 5
Nid2 2 Nid1 21 tot_metric 759808, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 492 Nid1 21 Nid2 2
------------------------------------------------
Test nr pss with Nid2 2 at position 493
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 492, val = 229165600 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 492, val = 229165600 (41 dB)
Test nr sss with Nid1 21
(phase,Nid1) (0,0), metric_phase 19456 tot_metric 19456, phase_max 0
(phase,Nid1) (0,8), metric_phase 21504 tot_metric 21504, phase_max 0
(phase,Nid1) (0,13), metric_phase 23552 tot_metric 23552, phase_max 0
(phase,Nid1) (0,88), metric_phase 24576 tot_metric 24576, phase_max 0
(phase,Nid1) (0,124), metric_phase 41984 tot_metric 41984, phase_max 0
(phase,Nid1) (0,135), metric_phase 46080 tot_metric 46080, phase_max 0
(phase,Nid1) (0,319), metric_phase 47104 tot_metric 47104, phase_max 0
(phase,Nid1) (2,21), metric_phase 308736 tot_metric 308736, phase_max 2
(phase,Nid1) (3,21), metric_phase 494592 tot_metric 494592, phase_max 3
(phase,Nid1) (4,21), metric_phase 642048 tot_metric 642048, phase_max 4
(phase,Nid1) (5,21), metric_phase 759808 tot_metric 759808, phase_max 5
Nid2 2 Nid1 21 tot_metric 759808, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 493 Nid1 21 Nid2 2
------------------------------------------------
Test nr pss with Nid2 2 at position 56788
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 56788, val = 231344100 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 56788, val = 231344100 (41 dB)
Test nr sss with Nid1 21
(phase,Nid1) (0,0), metric_phase 19456 tot_metric 19456, phase_max 0
(phase,Nid1) (0,8), metric_phase 21504 tot_metric 21504, phase_max 0
(phase,Nid1) (0,13), metric_phase 23552 tot_metric 23552, phase_max 0
(phase,Nid1) (0,88), metric_phase 24576 tot_metric 24576, phase_max 0
(phase,Nid1) (0,124), metric_phase 41984 tot_metric 41984, phase_max 0
(phase,Nid1) (0,135), metric_phase 46080 tot_metric 46080, phase_max 0
(phase,Nid1) (0,319), metric_phase 47104 tot_metric 47104, phase_max 0
(phase,Nid1) (2,21), metric_phase 308736 tot_metric 308736, phase_max 2
(phase,Nid1) (3,21), metric_phase 494592 tot_metric 494592, phase_max 3
(phase,Nid1) (4,21), metric_phase 642048 tot_metric 642048, phase_max 4
(phase,Nid1) (5,21), metric_phase 759808 tot_metric 759808, phase_max 5
Nid2 2 Nid1 21 tot_metric 759808, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 56788 Nid1 21 Nid2 2
------------------------------------------------
Test nr pss with Nid2 2 at position 111111
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 111112, val = 229601794 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 111112, val = 229601794 (41 dB)
Test nr sss with Nid1 21
(phase,Nid1) (0,0), metric_phase 19456 tot_metric 19456, phase_max 0
(phase,Nid1) (0,8), metric_phase 21504 tot_metric 21504, phase_max 0
(phase,Nid1) (0,13), metric_phase 23552 tot_metric 23552, phase_max 0
(phase,Nid1) (0,88), metric_phase 24576 tot_metric 24576, phase_max 0
(phase,Nid1) (0,124), metric_phase 41984 tot_metric 41984, phase_max 0
(phase,Nid1) (0,135), metric_phase 46080 tot_metric 46080, phase_max 0
(phase,Nid1) (0,319), metric_phase 47104 tot_metric 47104, phase_max 0
(phase,Nid1) (2,21), metric_phase 308736 tot_metric 308736, phase_max 2
(phase,Nid1) (3,21), metric_phase 494592 tot_metric 494592, phase_max 3
(phase,Nid1) (4,21), metric_phase 642048 tot_metric 642048, phase_max 4
(phase,Nid1) (5,21), metric_phase 759808 tot_metric 759808, phase_max 5
Nid2 2 Nid1 21 tot_metric 759808, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 111111 Nid1 21 Nid2 2
------------------------------------------------
Test nr pss with Nid2 2 at position 222222
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 222224, val = 219559301 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 222224, val = 219559301 (41 dB)
Test nr sss with Nid1 21
(phase,Nid1) (0,0), metric_phase 19456 tot_metric 19456, phase_max 0
(phase,Nid1) (0,8), metric_phase 21504 tot_metric 21504, phase_max 0
(phase,Nid1) (0,13), metric_phase 23552 tot_metric 23552, phase_max 0
(phase,Nid1) (0,88), metric_phase 24576 tot_metric 24576, phase_max 0
(phase,Nid1) (0,124), metric_phase 41984 tot_metric 41984, phase_max 0
(phase,Nid1) (0,135), metric_phase 46080 tot_metric 46080, phase_max 0
(phase,Nid1) (0,319), metric_phase 47104 tot_metric 47104, phase_max 0
(phase,Nid1) (2,21), metric_phase 308736 tot_metric 308736, phase_max 2
(phase,Nid1) (3,21), metric_phase 494592 tot_metric 494592, phase_max 3
(phase,Nid1) (4,21), metric_phase 642048 tot_metric 642048, phase_max 4
(phase,Nid1) (5,21), metric_phase 759808 tot_metric 759808, phase_max 5
Nid2 2 Nid1 21 tot_metric 759808, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 222222 Nid1 21 Nid2 2
------------------------------------------------
Test nr pss with Nid2 1 at position 0
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 1, Peak found at pos 0, val = 232105225 (41 dB)
[UE] nr_synchro_time: Sync source = 1, Peak found at pos 0, val = 232105225 (41 dB)
Test nr sss with Nid1 55
(phase,Nid1) (0,0), metric_phase -1536 tot_metric -1536, phase_max 0
(phase,Nid1) (0,1), metric_phase 1536 tot_metric 1536, phase_max 0
(phase,Nid1) (0,2), metric_phase 5632 tot_metric 5632, phase_max 0
(phase,Nid1) (0,3), metric_phase 20992 tot_metric 20992, phase_max 0
(phase,Nid1) (0,13), metric_phase 23040 tot_metric 23040, phase_max 0
(phase,Nid1) (0,120), metric_phase 28160 tot_metric 28160, phase_max 0
(phase,Nid1) (0,135), metric_phase 43520 tot_metric 43520, phase_max 0
(phase,Nid1) (0,228), metric_phase 44544 tot_metric 44544, phase_max 0
(phase,Nid1) (1,55), metric_phase 61440 tot_metric 61440, phase_max 1
(phase,Nid1) (2,55), metric_phase 326144 tot_metric 326144, phase_max 2
(phase,Nid1) (3,55), metric_phase 507392 tot_metric 507392, phase_max 3
(phase,Nid1) (4,55), metric_phase 651264 tot_metric 651264, phase_max 4
(phase,Nid1) (5,55), metric_phase 770560 tot_metric 770560, phase_max 5
Nid2 1 Nid1 55 tot_metric 770560, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 0 Nid1 55 Nid2 1
------------------------------------------------
Test nr pss with Nid2 1 at position 492
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 1, Peak found at pos 492, val = 232105225 (41 dB)
[UE] nr_synchro_time: Sync source = 1, Peak found at pos 492, val = 232105225 (41 dB)
Test nr sss with Nid1 55
(phase,Nid1) (0,0), metric_phase -1536 tot_metric -1536, phase_max 0
(phase,Nid1) (0,1), metric_phase 1536 tot_metric 1536, phase_max 0
(phase,Nid1) (0,2), metric_phase 5632 tot_metric 5632, phase_max 0
(phase,Nid1) (0,3), metric_phase 20992 tot_metric 20992, phase_max 0
(phase,Nid1) (0,13), metric_phase 23040 tot_metric 23040, phase_max 0
(phase,Nid1) (0,120), metric_phase 28160 tot_metric 28160, phase_max 0
(phase,Nid1) (0,135), metric_phase 43520 tot_metric 43520, phase_max 0
(phase,Nid1) (0,228), metric_phase 44544 tot_metric 44544, phase_max 0
(phase,Nid1) (1,55), metric_phase 61440 tot_metric 61440, phase_max 1
(phase,Nid1) (2,55), metric_phase 326144 tot_metric 326144, phase_max 2
(phase,Nid1) (3,55), metric_phase 507392 tot_metric 507392, phase_max 3
(phase,Nid1) (4,55), metric_phase 651264 tot_metric 651264, phase_max 4
(phase,Nid1) (5,55), metric_phase 770560 tot_metric 770560, phase_max 5
Nid2 1 Nid1 55 tot_metric 770560, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 492 Nid1 55 Nid2 1
------------------------------------------------
Test nr pss with Nid2 1 at position 493
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 1, Peak found at pos 492, val = 230099437 (41 dB)
[UE] nr_synchro_time: Sync source = 1, Peak found at pos 492, val = 230099437 (41 dB)
Test nr sss with Nid1 55
(phase,Nid1) (0,0), metric_phase -1536 tot_metric -1536, phase_max 0
(phase,Nid1) (0,1), metric_phase 1536 tot_metric 1536, phase_max 0
(phase,Nid1) (0,2), metric_phase 5632 tot_metric 5632, phase_max 0
(phase,Nid1) (0,3), metric_phase 20992 tot_metric 20992, phase_max 0
(phase,Nid1) (0,13), metric_phase 23040 tot_metric 23040, phase_max 0
(phase,Nid1) (0,120), metric_phase 28160 tot_metric 28160, phase_max 0
(phase,Nid1) (0,135), metric_phase 43520 tot_metric 43520, phase_max 0
(phase,Nid1) (0,228), metric_phase 44544 tot_metric 44544, phase_max 0
(phase,Nid1) (1,55), metric_phase 61440 tot_metric 61440, phase_max 1
(phase,Nid1) (2,55), metric_phase 326144 tot_metric 326144, phase_max 2
(phase,Nid1) (3,55), metric_phase 507392 tot_metric 507392, phase_max 3
(phase,Nid1) (4,55), metric_phase 651264 tot_metric 651264, phase_max 4
(phase,Nid1) (5,55), metric_phase 770560 tot_metric 770560, phase_max 5
Nid2 1 Nid1 55 tot_metric 770560, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 493 Nid1 55 Nid2 1
------------------------------------------------
Test nr pss with Nid2 1 at position 56788
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 1, Peak found at pos 56788, val = 232105225 (41 dB)
[UE] nr_synchro_time: Sync source = 1, Peak found at pos 56788, val = 232105225 (41 dB)
Test nr sss with Nid1 55
(phase,Nid1) (0,0), metric_phase -1536 tot_metric -1536, phase_max 0
(phase,Nid1) (0,1), metric_phase 1536 tot_metric 1536, phase_max 0
(phase,Nid1) (0,2), metric_phase 5632 tot_metric 5632, phase_max 0
(phase,Nid1) (0,3), metric_phase 20992 tot_metric 20992, phase_max 0
(phase,Nid1) (0,13), metric_phase 23040 tot_metric 23040, phase_max 0
(phase,Nid1) (0,120), metric_phase 28160 tot_metric 28160, phase_max 0
(phase,Nid1) (0,135), metric_phase 43520 tot_metric 43520, phase_max 0
(phase,Nid1) (0,228), metric_phase 44544 tot_metric 44544, phase_max 0
(phase,Nid1) (1,55), metric_phase 61440 tot_metric 61440, phase_max 1
(phase,Nid1) (2,55), metric_phase 326144 tot_metric 326144, phase_max 2
(phase,Nid1) (3,55), metric_phase 507392 tot_metric 507392, phase_max 3
(phase,Nid1) (4,55), metric_phase 651264 tot_metric 651264, phase_max 4
(phase,Nid1) (5,55), metric_phase 770560 tot_metric 770560, phase_max 5
Nid2 1 Nid1 55 tot_metric 770560, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 56788 Nid1 55 Nid2 1
------------------------------------------------
Test nr pss with Nid2 1 at position 111111
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 1, Peak found at pos 111112, val = 230409881 (41 dB)
[UE] nr_synchro_time: Sync source = 1, Peak found at pos 111112, val = 230409881 (41 dB)
Test nr sss with Nid1 55
(phase,Nid1) (0,0), metric_phase -1536 tot_metric -1536, phase_max 0
(phase,Nid1) (0,1), metric_phase 1536 tot_metric 1536, phase_max 0
(phase,Nid1) (0,2), metric_phase 5632 tot_metric 5632, phase_max 0
(phase,Nid1) (0,3), metric_phase 20992 tot_metric 20992, phase_max 0
(phase,Nid1) (0,13), metric_phase 23040 tot_metric 23040, phase_max 0
(phase,Nid1) (0,120), metric_phase 28160 tot_metric 28160, phase_max 0
(phase,Nid1) (0,135), metric_phase 43520 tot_metric 43520, phase_max 0
(phase,Nid1) (0,228), metric_phase 44544 tot_metric 44544, phase_max 0
(phase,Nid1) (1,55), metric_phase 61440 tot_metric 61440, phase_max 1
(phase,Nid1) (2,55), metric_phase 326144 tot_metric 326144, phase_max 2
(phase,Nid1) (3,55), metric_phase 507392 tot_metric 507392, phase_max 3
(phase,Nid1) (4,55), metric_phase 651264 tot_metric 651264, phase_max 4
(phase,Nid1) (5,55), metric_phase 770560 tot_metric 770560, phase_max 5
Nid2 1 Nid1 55 tot_metric 770560, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 111111 Nid1 55 Nid2 1
------------------------------------------------
Test nr pss with Nid2 1 at position 222222
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 1, Peak found at pos 222224, val = 219714314 (41 dB)
[UE] nr_synchro_time: Sync source = 1, Peak found at pos 222224, val = 219714314 (41 dB)
Test nr sss with Nid1 55
(phase,Nid1) (0,0), metric_phase -1536 tot_metric -1536, phase_max 0
(phase,Nid1) (0,1), metric_phase 1536 tot_metric 1536, phase_max 0
(phase,Nid1) (0,2), metric_phase 5632 tot_metric 5632, phase_max 0
(phase,Nid1) (0,3), metric_phase 20992 tot_metric 20992, phase_max 0
(phase,Nid1) (0,13), metric_phase 23040 tot_metric 23040, phase_max 0
(phase,Nid1) (0,120), metric_phase 28160 tot_metric 28160, phase_max 0
(phase,Nid1) (0,135), metric_phase 43520 tot_metric 43520, phase_max 0
(phase,Nid1) (0,228), metric_phase 44544 tot_metric 44544, phase_max 0
(phase,Nid1) (1,55), metric_phase 61440 tot_metric 61440, phase_max 1
(phase,Nid1) (2,55), metric_phase 326144 tot_metric 326144, phase_max 2
(phase,Nid1) (3,55), metric_phase 507392 tot_metric 507392, phase_max 3
(phase,Nid1) (4,55), metric_phase 651264 tot_metric 651264, phase_max 4
(phase,Nid1) (5,55), metric_phase 770560 tot_metric 770560, phase_max 5
Nid2 1 Nid1 55 tot_metric 770560, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 222222 Nid1 55 Nid2 1
------------------------------------------------
Test nr pss with Nid2 2 at position 0
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 0, val = 231344100 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 0, val = 231344100 (41 dB)
Test nr sss with Nid1 111
(phase,Nid1) (0,0), metric_phase 19968 tot_metric 19968, phase_max 0
(phase,Nid1) (0,13), metric_phase 22016 tot_metric 22016, phase_max 0
(phase,Nid1) (0,109), metric_phase 23040 tot_metric 23040, phase_max 0
(phase,Nid1) (0,117), metric_phase 26112 tot_metric 26112, phase_max 0
(phase,Nid1) (0,124), metric_phase 37376 tot_metric 37376, phase_max 0
(phase,Nid1) (0,161), metric_phase 42496 tot_metric 42496, phase_max 0
(phase,Nid1) (0,170), metric_phase 43520 tot_metric 43520, phase_max 0
(phase,Nid1) (0,210), metric_phase 45568 tot_metric 45568, phase_max 0
(phase,Nid1) (1,111), metric_phase 62464 tot_metric 62464, phase_max 1
(phase,Nid1) (2,111), metric_phase 327680 tot_metric 327680, phase_max 2
(phase,Nid1) (3,111), metric_phase 511488 tot_metric 511488, phase_max 3
(phase,Nid1) (4,111), metric_phase 651264 tot_metric 651264, phase_max 4
(phase,Nid1) (5,111), metric_phase 770048 tot_metric 770048, phase_max 5
Nid2 2 Nid1 111 tot_metric 770048, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 0 Nid1 111 Nid2 2
------------------------------------------------
Test nr pss with Nid2 2 at position 492
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 492, val = 231344100 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 492, val = 231344100 (41 dB)
Test nr sss with Nid1 111
(phase,Nid1) (0,0), metric_phase 19968 tot_metric 19968, phase_max 0
(phase,Nid1) (0,13), metric_phase 22016 tot_metric 22016, phase_max 0
(phase,Nid1) (0,109), metric_phase 23040 tot_metric 23040, phase_max 0
(phase,Nid1) (0,117), metric_phase 26112 tot_metric 26112, phase_max 0
(phase,Nid1) (0,124), metric_phase 37376 tot_metric 37376, phase_max 0
(phase,Nid1) (0,161), metric_phase 42496 tot_metric 42496, phase_max 0
(phase,Nid1) (0,170), metric_phase 43520 tot_metric 43520, phase_max 0
(phase,Nid1) (0,210), metric_phase 45568 tot_metric 45568, phase_max 0
(phase,Nid1) (1,111), metric_phase 62464 tot_metric 62464, phase_max 1
(phase,Nid1) (2,111), metric_phase 327680 tot_metric 327680, phase_max 2
(phase,Nid1) (3,111), metric_phase 511488 tot_metric 511488, phase_max 3
(phase,Nid1) (4,111), metric_phase 651264 tot_metric 651264, phase_max 4
(phase,Nid1) (5,111), metric_phase 770048 tot_metric 770048, phase_max 5
Nid2 2 Nid1 111 tot_metric 770048, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 492 Nid1 111 Nid2 2
------------------------------------------------
Test nr pss with Nid2 2 at position 493
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 492, val = 229165600 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 492, val = 229165600 (41 dB)
Test nr sss with Nid1 111
(phase,Nid1) (0,0), metric_phase 19968 tot_metric 19968, phase_max 0
(phase,Nid1) (0,13), metric_phase 22016 tot_metric 22016, phase_max 0
(phase,Nid1) (0,109), metric_phase 23040 tot_metric 23040, phase_max 0
(phase,Nid1) (0,117), metric_phase 26112 tot_metric 26112, phase_max 0
(phase,Nid1) (0,124), metric_phase 37376 tot_metric 37376, phase_max 0
(phase,Nid1) (0,161), metric_phase 42496 tot_metric 42496, phase_max 0
(phase,Nid1) (0,170), metric_phase 43520 tot_metric 43520, phase_max 0
(phase,Nid1) (0,210), metric_phase 45568 tot_metric 45568, phase_max 0
(phase,Nid1) (1,111), metric_phase 62464 tot_metric 62464, phase_max 1
(phase,Nid1) (2,111), metric_phase 327680 tot_metric 327680, phase_max 2
(phase,Nid1) (3,111), metric_phase 511488 tot_metric 511488, phase_max 3
(phase,Nid1) (4,111), metric_phase 651264 tot_metric 651264, phase_max 4
(phase,Nid1) (5,111), metric_phase 770048 tot_metric 770048, phase_max 5
Nid2 2 Nid1 111 tot_metric 770048, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 493 Nid1 111 Nid2 2
------------------------------------------------
Test nr pss with Nid2 2 at position 56788
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 56788, val = 231344100 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 56788, val = 231344100 (41 dB)
Test nr sss with Nid1 111
(phase,Nid1) (0,0), metric_phase 19968 tot_metric 19968, phase_max 0
(phase,Nid1) (0,13), metric_phase 22016 tot_metric 22016, phase_max 0
(phase,Nid1) (0,109), metric_phase 23040 tot_metric 23040, phase_max 0
(phase,Nid1) (0,117), metric_phase 26112 tot_metric 26112, phase_max 0
(phase,Nid1) (0,124), metric_phase 37376 tot_metric 37376, phase_max 0
(phase,Nid1) (0,161), metric_phase 42496 tot_metric 42496, phase_max 0
(phase,Nid1) (0,170), metric_phase 43520 tot_metric 43520, phase_max 0
(phase,Nid1) (0,210), metric_phase 45568 tot_metric 45568, phase_max 0
(phase,Nid1) (1,111), metric_phase 62464 tot_metric 62464, phase_max 1
(phase,Nid1) (2,111), metric_phase 327680 tot_metric 327680, phase_max 2
(phase,Nid1) (3,111), metric_phase 511488 tot_metric 511488, phase_max 3
(phase,Nid1) (4,111), metric_phase 651264 tot_metric 651264, phase_max 4
(phase,Nid1) (5,111), metric_phase 770048 tot_metric 770048, phase_max 5
Nid2 2 Nid1 111 tot_metric 770048, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 56788 Nid1 111 Nid2 2
------------------------------------------------
Test nr pss with Nid2 2 at position 111111
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 111112, val = 229601794 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 111112, val = 229601794 (41 dB)
Test nr sss with Nid1 111
(phase,Nid1) (0,0), metric_phase 19968 tot_metric 19968, phase_max 0
(phase,Nid1) (0,13), metric_phase 22016 tot_metric 22016, phase_max 0
(phase,Nid1) (0,109), metric_phase 23040 tot_metric 23040, phase_max 0
(phase,Nid1) (0,117), metric_phase 26112 tot_metric 26112, phase_max 0
(phase,Nid1) (0,124), metric_phase 37376 tot_metric 37376, phase_max 0
(phase,Nid1) (0,161), metric_phase 42496 tot_metric 42496, phase_max 0
(phase,Nid1) (0,170), metric_phase 43520 tot_metric 43520, phase_max 0
(phase,Nid1) (0,210), metric_phase 45568 tot_metric 45568, phase_max 0
(phase,Nid1) (1,111), metric_phase 62464 tot_metric 62464, phase_max 1
(phase,Nid1) (2,111), metric_phase 327680 tot_metric 327680, phase_max 2
(phase,Nid1) (3,111), metric_phase 511488 tot_metric 511488, phase_max 3
(phase,Nid1) (4,111), metric_phase 651264 tot_metric 651264, phase_max 4
(phase,Nid1) (5,111), metric_phase 770048 tot_metric 770048, phase_max 5
Nid2 2 Nid1 111 tot_metric 770048, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 111111 Nid1 111 Nid2 2
------------------------------------------------
Test nr pss with Nid2 2 at position 222222
[PHY][I][pss_search_time_nr] [UE] nr_synchro_time: Sync source = 2, Peak found at pos 222224, val = 219559301 (41 dB)
[UE] nr_synchro_time: Sync source = 2, Peak found at pos 222224, val = 219559301 (41 dB)
Test nr sss with Nid1 111
(phase,Nid1) (0,0), metric_phase 19968 tot_metric 19968, phase_max 0
(phase,Nid1) (0,13), metric_phase 22016 tot_metric 22016, phase_max 0
(phase,Nid1) (0,109), metric_phase 23040 tot_metric 23040, phase_max 0
(phase,Nid1) (0,117), metric_phase 26112 tot_metric 26112, phase_max 0
(phase,Nid1) (0,124), metric_phase 37376 tot_metric 37376, phase_max 0
(phase,Nid1) (0,161), metric_phase 42496 tot_metric 42496, phase_max 0
(phase,Nid1) (0,170), metric_phase 43520 tot_metric 43520, phase_max 0
(phase,Nid1) (0,210), metric_phase 45568 tot_metric 45568, phase_max 0
(phase,Nid1) (1,111), metric_phase 62464 tot_metric 62464, phase_max 1
(phase,Nid1) (2,111), metric_phase 327680 tot_metric 327680, phase_max 2
(phase,Nid1) (3,111), metric_phase 511488 tot_metric 511488, phase_max 3
(phase,Nid1) (4,111), metric_phase 651264 tot_metric 651264, phase_max 4
(phase,Nid1) (5,111), metric_phase 770048 tot_metric 770048, phase_max 5
Nid2 2 Nid1 111 tot_metric 770048, phase_max 5
SSS NR Test is pass with warning due to phase difference 5 (instead of 3) offset 222222 Nid1 111 Nid2 2
SSS NR Number of tests : 36 Pass : 0 Pass with warning : 36 Fail : 0
SSS NR Synchronisaton test is terminated.
#!/bin/bash
#
# 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: run_tests.sh
#----------------------
# Description: script batch for:
# - building tests
# - executing tests
# - checking output files with reference files.
# ./run_test to build/run and check all tests
# -b no build
# -r no run
# -c no check
# an alone specific test can be executed ./run_test test_name
#----------------------------------------------------------------------------
# CONFIGURATION
# files and directories
WORK_DIR="openair1/SIMULATION/NR_UE_PHY/unit_tests/build"
OAIENV_DIR="../../../../.."
EXECUTABLE_DIR="."
REFERENCE_DIR="./reflogs"
RESULT_TEST_FILE=""
RESULT_DIR="./testlogs"
BROWSER="firefox"
#----------------------------------------------------------------------------
# For building and executing test application
BUILD_TEST="yes"
CHECK_TEST="yes"
RUN_TEST="yes"
SINGLE_TEST="no"
# for removing files
REMOVE="rm -f"
COMPARE="cmp"
#----------------------------------------------------------------------------
# List of tests
tst_files="
pss_test
sss_test
pbch_test
srs_test
frame_config_test
harq_test
pucch_uci_test"
#---------------------------------------------------------------------------
# manage input parameters
while [ $# != "0" ]
do
case $1 in
-b)
echo "No build of unit test"
BUILD_TEST="no"
;;
-r)
echo "No run of unit test"
RUN_TEST="no"
;;
-c)
echo "No check of unit test"
CHECK_TEST="no"
;;
-h)
echo "Option of run_test script"
echo "-b : No Build of unit tests"
echo "-c : No check for unit test"
echo "-r : No run of unit tests"
exit
BUILD_TEST="no"
CHECK_TEST="no"
RUN_TEST="no"
;;
*)
for file in $tst_files
do
if [ $file == $1 ]
then
SINGLE_TEST="yes"
TEST=$1
echo "Single test $TEST"
fi
done
if [ $SINGLE_TEST == "no" ]
then
echo "Unknown parameter $1"
BUILD_TEST="no"
CHECK_TEST="no"
RUN_TEST="no"
exit
fi
;;
esac
# shift of input parameter (excluding $0 ) $1 <- $2 <- $3 ...
# $# is decrement by shift
shift
done
#--------------------------------------------------------------------------------------------
# RUN AND CHECK RESULTS
# compare reference log file to results file
# diff -s -d -a -q ./testlogs/*.txt ./reflog/*.txt
# compare $RESULTS_FILE to $REFERENCE_DIR/$RESULTS_FILE
numberDisplayFilesDifferencies=0
let MAX_NUMBER_DISPLAY_FILES_DIFFERENCES=8
num_diff=0
if [ $RUN_TEST == "yes" ]
then
mkdir $RESULT_DIR
fi
if [ $BUILD_TEST == "yes" ]
then
if [ $SINGLE_TEST == "no" ]
then
echo "cd $OAIENV_DIR"
cd $OAIENV_DIR
echo "source oaienv"
source oaienv
echo "cd $WORK_DIR"
cd $WORK_DIR
echo "cmake CMakeLists.txt"
cmake CMakeLists.txt
echo -e "make clean\n"
#make clean
fi
fi
if [ $CHECK_TEST == "yes" ]
then
echo "Display differencies for a maximum of "$MAX_NUMBER_DISPLAY_FILES_DIFFERENCES" files"
fi
for file in $tst_files
do
if [ $SINGLE_TEST == "yes" ]
then
file=$TEST
fi
echo "Test : $file"
RESULT_TEST_FILE="$file.txt"
# build executable
if [ $BUILD_TEST == "yes" ]
then
echo -e "make $file\n"
make $file
fi
if [ $RUN_TEST == "yes" ]
then
echo "rm $RESULT_DIR/$RESULT_TEST_FILE"
rm $RESULT_DIR/$RESULT_TEST_FILE
echo "$EXECUTABLE_DIR/$file > $RESULT_DIR/$RESULT_TEST_FILE"
$EXECUTABLE_DIR/$file > $RESULT_DIR/$RESULT_TEST_FILE
fi
if [ $CHECK_TEST == "yes" ]
then
# check if there is already a reference file
if [ -f "$REFERENCE_DIR/$RESULT_TEST_FILE" ]
then
echo File "$REFERENCE_DIR/$RESULT_TEST_FILE" exists
$COMPARE $RESULT_DIR/$RESULT_TEST_FILE $REFERENCE_DIR/$RESULT_TEST_FILE > /dev/null 2>&1
if [ $? == 0 ]
then
echo "Same file for $file"
else
echo "Difference for scenario $file"
let "num_diff=$num_diff + 1"
meld $RESULT_DIR/$RESULT_TEST_FILE $REFERENCE_DIR/$RESULT_TEST_FILE &
let "numberDisplayFilesDifferencies=$numberDisplayFilesDifferencies + 1"
echo "Meld number "$numberDisplayFilesDifferencies
if [ $numberDisplayFilesDifferencies = $MAX_NUMBER_DISPLAY_FILES_DIFFERENCES ]
then
echo "###### ERROR ###### ERROR ###### ERROR ###### ERROR ###### ERROR ###### ERROR ######"
echo "=> ERROR Test aborted because there are already $MAX_NUMBER_DISPLAY_FILES_DIFFERENCES detected files which are different"
break
fi
fi
else
echo "No reference file for test $file"
fi
fi
if [ $SINGLE_TEST == "yes" ]
then
exit
fi
done
if [ $CHECK_TEST == "yes" ]
then
echo "There are $num_diff result files which are different"
fi
# end of script
/*
* 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: /home/jacques/workspace/oai_openairinterface/openairinterface5g/openair1/SIMULATION/NR_UE_PHY/unit_tests/README.txt
This directory contains testbenchs for 5G NR physical layers.
Before building unit tests, full UE build should be done before (maily for asn1 dependencies):
Initialise environment:
- under openairinterface5g enter >source oaienv
Install tools:
- under openairinterface5g/cmake_targets/build -I
Build NR UE:
- under openairinterface5g/cmake_targets/build --nrUE
Files
=====
pss_test.c: test for detection of primary synchronisation signal.
sss_test.c: test for detection of secundary synchronisation signal.
pbch_test.c: test for decoding of packet braodcast channel.
srs_test.c: test of sounding reference signal.
frame_config_test.c : test of frame configurations (FDD/TDD).
harq_test.c : test of HARQ downlink and uplink.
pucch_uci_test : test of packed Uplink Control Channel Uplink Control Information
pss_util_test.c: common functions for running synchronisation tests.
pss_util_test.h: common headers for synchronisation tests.
input_buffer_test.h: it allows providing samples for pss test.
How to build & run tests
========================
Before building, oai environment should be set by entering under openairinterface5g "source oaienv".
A script allows to build, to run and to check all tests:
>run_tests
build is based on cmake tool.
cmake file is "/openairinterface5g/openair1/SIMULATION/NR_UE_PHY/unit_tests/build/CMakeList.txt".
CMakeList.txt lists different build.
How to build: in directory "oai_openairinterface/openairinterface5g/openair1/SIMULATION/NR_UE_PHY/unit_tests/build/", below commands should be entered:
cmake CMakeList.txt -> it generates makefiles to build all projects.
make pss_test -> build pss_test: detection of NR (Primary Synchronisation Channel - synchronisation of UE).
make sss_test -> build sss_test: detection of NR SSS (Secundary Synchronisation Channel - second step for UE synchronisation).
make pbch_test -> build pbch_test: decoding of NR PBCH (Packet Broadcast Channel -> UE read MIB Master Information Block which gives network parameters).
make frame_config_test -> build frame_config_test: NR FDD/TDD configuration.
make srs_test -> build srs_test: Sounding Reference Signals are transmitted by UE to the network which can use them for channel estimations.
make harq_test -> build harq_test: Hybrid Repeat Request Acknowledgment: mecanism to acknowledge transmitted and received transport blocks.
make pucch_uci_test -> build pucch_uci_test : Packet Uplink Control Channel / Uplink Control information : create UCI payload and select PUCCH formats and its parameters.
make clean -> clean all projects.
./pss_test -> run NR PSS tests.
./sss_test -> run NR SSS tests.
./pbch_test -> run NR PBCH tests.
./srs_test -> run NR srs tests.
./frame_config_test -> run NR frame configuration tests.
./harq_test -> run NR HARQ downlink and uplink tests.
./pucch_uci_test -> run NR PUCCH UCI tests.
There is a script in build/run_test.sh which allows:
- building/running/checking all tests
Checking consists in a comparaison of generated logging file at execution with a reference logging file which is stored under git for each test.
By default, tool "meld" is open each time there is a difference between reference file and logging file.
Which processing can be tuned?
=============================
Decimation feature:
By default pss processing uses samples from received buffer at input sampling frequency fs.
For saving processing time, it is possible that pss uses a decimation of input signal.
To enable decimation file openairinterface5g_bis/openairinterface5g/openair1/PHY/NR_REFSIG/pss_nr.h should be modified.
//#define PSS_DECIMATOR should be enable to get decimation.
By default, decimation uses a FIR filter.
It is possible to use a CIC (Cascaded Integrated Comb filter) for decimation by enabling line //#define CIC_DECIMATOR.
Input received signal:
Different waveforms can be generated for testing pss and sss detection.
By default, it uses a sinusoidal signals at different frequencies with an amplitude at the same level than pss or sss signals.
For modifying these waveforms, function "set_random_rx_buffer" in file pss_util_test.c has to be modified.
For wavecom type, line data_format = SINUSOIDAL_DATA should be changed with new format.
For amplitude of waveform, declaration have to be modified in the function.
Status
======
NR synchronisation tests run successfully with default parameters.
Warning: Tests of PSS NR with decimation (based on FIR or CIC filter) does not run successfully at the moment.
/*
* 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
*/
/*********************************************************************
*
* FILENAME : dummy_functions.c
*
* MODULE : NR UE unit test
*
* DESCRIPTION : it allows to define unused functions for unit tests.
*
************************************************************************/
#include <stddef.h>
#include "../../unit_tests/src/pss_util_test.h"
#include "PHY/types.h"
#include "PHY/defs_gNB.h"
#include "../common/ran_context.h"
#include "../common/config/config_paramdesc.h"
/*****************variables****************************************/
RAN_CONTEXT_t RC;
uint32_t (*p_nr_ue_get_SR)(module_id_t module_idP,int CC_id,frame_t frameP,uint8_t eNB_id,uint16_t rnti, sub_frame_t subframe) = NULL;
/*****************functions****************************************/
PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP, int CC_id,
frame_t frameP, uint8_t new_Msg3,
sub_frame_t subframe){ return(NULL);}
void ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
sub_frame_t subframe, uint8_t eNB_index,
uint8_t * ulsch_buffer, uint16_t buflen,
uint8_t * access_mode){}
void Msg1_transmitted(module_id_t module_idP, uint8_t CC_id,
frame_t frameP, uint8_t eNB_id){}
void Msg3_transmitted(module_id_t module_idP, uint8_t CC_id,
frame_t frameP, uint8_t eNB_id){}
uint32_t ue_get_SR(module_id_t module_idP, int CC_id, frame_t frameP,
uint8_t eNB_id, rnti_t rnti, sub_frame_t subframe){
uint32_t value = 0;
if (p_nr_ue_get_SR != NULL)
{
value = (p_nr_ue_get_SR)(module_idP, CC_id, frameP, eNB_id, rnti, subframe);
}
return(value);}
void rrc_out_of_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_index)
{}
UE_L2_STATE_t ue_scheduler(const module_id_t module_idP,
const frame_t rxFrameP,
const sub_frame_t rxSubframe,
const frame_t txFrameP,
const sub_frame_t txSubframe,
const lte_subframe_t direction,
const uint8_t eNB_index, const int CC_id){ return(0);}
void ue_decode_p(module_id_t module_idP, int CC_id, frame_t frame,
uint8_t CH_index, void *pdu, uint16_t len){}
void ue_decode_si(module_id_t module_idP, int CC_id, frame_t frame,
uint8_t CH_index, void *pdu, uint16_t len){}
void ue_send_sdu(module_id_t module_idP, uint8_t CC_id, frame_t frame,
sub_frame_t subframe, uint8_t * sdu, uint16_t sdu_len,
uint8_t CH_index){}
uint16_t
ue_process_rar(const module_id_t module_idP,
const int CC_id,
const frame_t frameP,
const rnti_t ra_rnti,
uint8_t * const dlsch_buffer,
rnti_t * const t_crnti,
const uint8_t preamble_index,
uint8_t * selected_rar_buffer){ return(0);}
void ue_send_mch_sdu(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
uint8_t * sdu, uint16_t sdu_len, uint8_t eNB_index,
uint8_t sync_area){}
int ue_query_mch(uint8_t Mod_id, uint8_t CC_id, uint32_t frame,
sub_frame_t subframe, uint8_t eNB_index,
uint8_t * sync_area, uint8_t * mcch_active){ return(0);}
void dl_phy_sync_success(module_id_t module_idP,
frame_t frameP,
unsigned char eNB_index, uint8_t first_sync){}
uint32_t from_earfcn(int eutra_bandP, uint32_t dl_earfcn) { return(0);}
int32_t get_uldl_offset(int eutra_bandP) { return(0);}
IF_Module_t *IF_Module_init(int Mod_id) { return(NULL);}
int8_t get_Po_NOMINAL_PUSCH(module_id_t module_idP, uint8_t CC_id) { return(0);}
int8_t get_deltaP_rampup(module_id_t module_idP, uint8_t CC_id) { return(0);}
void thread_top_init(char *thread_name,
int affinity,
uint64_t runtime,
uint64_t deadline,
uint64_t period) {}
int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) { return(0);}
int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) { return(0); }
int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { return(0); }
int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return(0); }
static int step_log = 0;
const char log_first[] = "debug";
const char log_second[] = "full";
const char log_default[] = " ";
int config_get(paramdef_t *params,int numparams, char *prefix)
{
#define MAX_STRING_SIZE (255)
char *p_log;
for (int i=0; i < numparams; i++)
{
switch(step_log)
{
case 1:
p_log = log_first;
params[i].strptr = calloc(1, MAX_STRING_SIZE);
*(params[i].strptr) = p_log;
break;
case 2:
p_log = log_first;
params[i].strptr = calloc(1, MAX_STRING_SIZE);
*(params[i].strptr) = p_log;
break;
case 3:
params[i].uptr = calloc(1, sizeof(int));
*(params[i].uptr) = 0;
break;
default:
p_log = log_default;
params[i].strptr = calloc(1, MAX_STRING_SIZE);
*(params[i].strptr) = p_log;
break;
}
}
step_log++;
return(0);
}
unsigned int taus(void) { return (0); }
typedef int loader_shlibfunc_t;
int load_module_shlib(char *modname,loader_shlibfunc_t *farray, int numf) { return(0); }
void * get_shlibmodule_fptr(char *modname, char *fname) { return(NULL) ; }
void exit_fun(const char* s)
{
VOID_PARAMETER s;
undefined_function(__FUNCTION__);
}
/*
* 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
*/
/**********************************************************************
*
* FILENAME : frame_config_test.c
*
* MODULE : UE test bench for tdd configuration
*
* DESCRIPTION : it allows unitary tests for tdd configuration
*
************************************************************************/
#include "../../unit_tests/src/pss_util_test.h"
#include "PHY/defs_nr_UE.h"
#include "PHY/INIT/init_extern.h"
#include "PHY/phy_extern_nr_ue.h"
#include "SCHED_NR_UE/phy_frame_config_nr.h"
/*******************************************************************
*
* NAME : display_frame_configuration
*
* PARAMETERS : none
*
* RETURN : none
*
* DESCRIPTION : display uplink & downlink configuration
*
*********************************************************************/
void display_frame_configuration(NR_DL_FRAME_PARMS *frame_parms) {
printf("\nTdd configuration tti %d downlink %d uplink %d period %d \n", frame_parms->ttis_per_subframe, frame_parms->p_tdd_UL_DL_Configuration->nrofDownlinkSlots,
frame_parms->p_tdd_UL_DL_Configuration->nrofUplinkSlots, frame_parms->p_tdd_UL_DL_Configuration->dl_UL_TransmissionPeriodicity);
int k = (TDD_CONFIG_NB_FRAMES * LTE_NUMBER_OF_SUBFRAMES_PER_FRAME) - 1; //19;
int tti = 0;
for (int j = 0; j < TDD_CONFIG_NB_FRAMES * frame_parms->ttis_per_subframe * LTE_NUMBER_OF_SUBFRAMES_PER_FRAME; j++) {
int frame = 0;
if (j != 0) {
frame = (frame_parms->ttis_per_subframe * LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)/j;
tti = (j)%(frame_parms->ttis_per_subframe * LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
}
else {
frame = 0;
tti = 0;
}
if (slot_select_nr(frame_parms, frame, tti) == NR_TDD_DOWNLINK_SLOT) {
//if (frame_parms->tdd_uplink_nr[j] == NR_TDD_DOWNLINK_SLOT) {
printf(" [%3d] D", j);
}
else {
if (slot_select_nr(frame_parms, frame, tti) == NR_TDD_UPLINK_SLOT) {
//if (frame_parms->tdd_uplink_nr[j] == NR_TDD_UPLINK_SLOT) {
printf(" [%3d] U", j);
}
else {
printf("Error test_frame_configuration: unexpected value \n");
assert(0);
}
}
if (j == k) {
printf("\n");
k += (TDD_CONFIG_NB_FRAMES * LTE_NUMBER_OF_SUBFRAMES_PER_FRAME); // 20
}
}
printf("\n");
}
/*******************************************************************
*
* NAME : set_tti_test
*
* PARAMETERS : none
*
* RETURN : none
*
* DESCRIPTION : set tti
*
*********************************************************************/
void set_tti_test(NR_DL_FRAME_PARMS *frame_parms, int ttis_per_subframe)
{
frame_parms->ttis_per_subframe = ttis_per_subframe;
}
/*******************************************************************
*
* NAME : test_frame_configuration
*
* PARAMETERS : none
*
* RETURN : none
*
* DESCRIPTION : test of frame configuration feature
*
*********************************************************************/
int test_frame_configuration(PHY_VARS_NR_UE *PHY_vars_UE)
{
LTE_DL_FRAME_PARMS *frame_parms = &(PHY_vars_UE->frame_parms);
int v_return = 0;
#define NO_DOWNLINK_SYMBOL (0)
#define NO_UPLINK_SYMBOL (0)
#define TTI_DEFAULT (2)
#define DL_SLOT_DEFAULT (4)
#define UL_SLOT_DEFAULT (1)
#define TDD_PERIODICITY_DEFAULT (ms2p5)
#define TDD_WRONG_CONFIG_TEST (3)
#define TDD_GOOD_CONFIG_TEST (18)
#define TDD_CONFIG_TEST (TDD_WRONG_CONFIG_TEST + TDD_GOOD_CONFIG_TEST)
/* this array allows setting different tdd configurations */
/* it defines number of tti (slot) per subframe, number of downlink slots, number of uplink slots */
/* and a period of the configuration */
/* first configurations (wrong) shall be fired error because they are not correct */
/* other configurations (good) are correct and they do not generate any error */
/* there is a tdd configuration for each line */
uint16_t TDD_configuration[TDD_CONFIG_TEST][4] = {
/* tti per subframe SLOT_DL SLOT_UL period */
{ 2, 4+1, 1, ms2p5 },
{ 2, 4, 1+1, ms2p5 },
{ 2, 4, 1, ms0p5 },
{ 1, 1, 1, ms2 },
{ 1, 4, 1, ms5 },
{ 1, 9, 1, ms10 },
{ 2, 1, 1, ms1 },
{ 2, 3, 1, ms2 },
{ 2, 4, 1, ms2p5 },
{ 2, 9, 1, ms5 },
{ 2, 19, 1, ms10 },
{ 4, 1, 1, ms0p5 },
{ 4, 3, 1, ms1 },
{ 4, 4, 1, ms1p25 },
{ 4, 7, 1, ms2 },
{ 4, 9, 1, ms2p5 },
{ 4, 19, 1, ms5 },
{ 4, 38, 2, ms10 },
{ 8, 4, 1, ms0p625 },
{ 16, 7, 1, ms0p5 },
{ TTI_DEFAULT, DL_SLOT_DEFAULT, UL_SLOT_DEFAULT, TDD_PERIODICITY_DEFAULT },
};
#define TDD_WRONG_DEDICATED_CONFIG_TEST (7)
#define TDD_GOOD_DEDICATED_CONFIG_TEST (18)
#define TDD_DEDICATED_CONFIG_TEST (TDD_WRONG_DEDICATED_CONFIG_TEST + TDD_GOOD_DEDICATED_CONFIG_TEST)
/* this array allows setting different tdd dedicated configurations */
/* tdd dedicated configuration overwrite current tdd confirguration for specified slot number */
/* it defines slot number to modify, then with a bit map number of downlink symbol, number of uplink symbols */
/* if next slot is set to 0 means that there is no additional slot to modify with current dedicated configuration */
/* if next slot is set to 1 means that there is an additional slot to mdofy with current dedicated configuration */
/* so tdd dedicated configuration can be composed of only 1 lines (for 1 slot) or several lines for several slots */
/* first dedictaed configurations (wrong) shall be fired errors because they are not correct */
/* other dedicated configurations (good) are correct and they do not generate any error */
uint16_t TDD_dedicated_config[TDD_DEDICATED_CONFIG_TEST][4] = {
/* slot number SLOT_DL SLOT_UL next slot */
{ 0, 1, 1, 0 },
{ 0, 0, 1, 0 },
{ 40, 0, NR_TDD_SET_ALL_SYMBOLS, 0 },
{ 0, NR_TDD_SET_ALL_SYMBOLS, NR_TDD_SET_ALL_SYMBOLS, 0 },
{ 0, 0, 0, 0 },
{ 0, 0, NR_TDD_SET_ALL_SYMBOLS, 1 },
{ 0, 0, 0, 0 },
{ 0, NR_TDD_SET_ALL_SYMBOLS, 0, 0 },
{ 0, 0, NR_TDD_SET_ALL_SYMBOLS, 1 },
{ 5, 0, NR_TDD_SET_ALL_SYMBOLS, 1 },
{ 10, 0, NR_TDD_SET_ALL_SYMBOLS, 1 },
{ 15, 0, NR_TDD_SET_ALL_SYMBOLS, 1 },
{ 20, 0, NR_TDD_SET_ALL_SYMBOLS, 1 },
{ 25, 0, NR_TDD_SET_ALL_SYMBOLS, 1 },
{ 30, 0, NR_TDD_SET_ALL_SYMBOLS, 1 },
{ 35, 0, NR_TDD_SET_ALL_SYMBOLS, 1 },
{ 4, NR_TDD_SET_ALL_SYMBOLS, 0, 1 },
{ 9, NR_TDD_SET_ALL_SYMBOLS, 0, 1 },
{ 14, NR_TDD_SET_ALL_SYMBOLS, 0, 1 },
{ 19, NR_TDD_SET_ALL_SYMBOLS, 0, 1 },
{ 19, NR_TDD_SET_ALL_SYMBOLS, 0, 1 },
{ 24, NR_TDD_SET_ALL_SYMBOLS, 0, 1 },
{ 29, NR_TDD_SET_ALL_SYMBOLS, 0, 1 },
{ 34, NR_TDD_SET_ALL_SYMBOLS, 0, 1 },
{ 39, NR_TDD_SET_ALL_SYMBOLS, 0, 0 },
};
/* TEST wrong and good tdd configurations starting by wrong ones */
int return_status = -1;
for (int i = 0; i < TDD_CONFIG_TEST; i++) {
if (i == TDD_WRONG_CONFIG_TEST) {
return_status = 0; /* status should be fine for fine configurations */
}
set_tti_test(frame_parms, TDD_configuration[i][0]);
if (set_tdd_config_nr(frame_parms, TDD_configuration[i][3], TDD_configuration[i][1], NO_DOWNLINK_SYMBOL,
TDD_configuration[i][2], NO_UPLINK_SYMBOL) != return_status) {
v_return = (-1);
}
display_frame_configuration(frame_parms);
free_tdd_configuration_nr(frame_parms);
}
/* set default configuration */
set_tti_test(frame_parms, TTI_DEFAULT);
if (set_tdd_config_nr(frame_parms, TDD_PERIODICITY_DEFAULT, DL_SLOT_DEFAULT, NO_DOWNLINK_SYMBOL, UL_SLOT_DEFAULT, NO_UPLINK_SYMBOL) != 0) {
v_return = (-1);
}
/* TEST wrong and good tdd dedicated configurations starting by wrong ones */
return_status = (-1);
for (int i = 0; i < TDD_DEDICATED_CONFIG_TEST; i++) {
bool next = false;
do {
if (i == TDD_WRONG_DEDICATED_CONFIG_TEST) {
return_status = 0; /* status should be fine for fine configurations */
}
add_tdd_dedicated_configuration_nr( frame_parms, TDD_dedicated_config[i][0], TDD_dedicated_config[i][1], TDD_dedicated_config[i][2]);
if (TDD_dedicated_config[i][3] == 1) {
next = true;
i = i + 1;
}
else {
next = false;
}
} while (next);
if (set_tdd_configuration_dedicated_nr(frame_parms) != return_status) {
v_return = (-1);
}
if (return_status == 0) {
display_frame_configuration(frame_parms);
}
free_tdd_configuration_dedicated_nr(frame_parms);
}
free_tdd_configuration_nr(frame_parms);
return (v_return);
}
/*******************************************************************
*
* NAME : main
*
* DESCRIPTION : test of tdd configuration
*
*********************************************************************/
int main(int argc, char *argv[])
{
uint8_t transmission_mode = 1;
uint8_t nb_antennas_tx = 1;
uint8_t nb_antennas_rx = 1;
uint8_t frame_type = FDD;
uint8_t N_RB_DL=100;
lte_prefix_type_t extended_prefix_flag = NORMAL;
int Nid_cell[] = {(3*0+0)};
VOID_PARAMETER argc;
VOID_PARAMETER argv;
printf(" FRAME CONFIGURATION TEST \n");
printf("--------------------------\n");
if (init_test(nb_antennas_tx, nb_antennas_rx, transmission_mode, extended_prefix_flag, frame_type, Nid_cell[0], N_RB_DL) != 0) {
printf("Initialisation problem for frame configuration test \n");
exit(-1);;
}
if (test_frame_configuration(PHY_vars_UE) != 0) {
printf("Test NR FRAME CONFIGURATION is fail \n");
}
else {
printf("Test NR FRAME CONFIGURATION is pass \n");
}
lte_sync_time_free();
free_context_synchro_nr();
return(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
*/
/**********************************************************************
*
* FILENAME : harq_test.c
*
* MODULE : UE test bench for hard (hybrid repeat request acknowledgment)
*
* DESCRIPTION : it allows unitary tests for uplink and downlink harq
*
************************************************************************/
#include "../../unit_tests/src/pss_util_test.h"
#include "PHY/defs_nr_UE.h"
#include "PHY/INIT/init_extern.h"
#include "PHY/phy_extern_nr_ue.h"
#include "SCHED_NR_UE/harq_nr.h"
//#include "PHY/vars.h"
//#include "LAYER2/MAC/vars.h"
/*******************************************************************
*
* NAME : test_harq_uplink
*
* PARAMETERS : none
*
* RETURN : none
*
* DESCRIPTION : test of HARQ uplink feature
*
*********************************************************************/
int test_harq_uplink(PHY_VARS_NR_UE *phy_vars_ue)
{
int gNB_id = 0;
int harq_pid = 0;
int ndi = 1;
nr_rnti_type_t rnti_type = C_RNTI_NR;
int number_steps = 5;
printf("\nHARQ Uplink \n");
config_uplink_harq_process(phy_vars_ue , gNB_id, NR_DEFAULT_DLSCH_HARQ_PROCESSES);
NR_UE_ULSCH_t *ulsch_harq = phy_vars_ue->ulsch[gNB_id];
/* reach maximum number of retransmissions */
printf("First sequence ndi does not toggle \n");
for (int i = 0 ; i < number_steps; i++) {
uplink_harq_process(ulsch_harq, harq_pid, ndi, rnti_type);
}
harq_pid++; /* next harq */
/* new grant so new transmission each try */
printf("Second sequence ndi toggle each transmission \n");
for (int i = 0 ; i < number_steps; i++) {
uplink_harq_process(ulsch_harq, harq_pid, ndi, rnti_type);
ndi ^= 1; /* toogle ndi each try */
}
harq_pid++; /* next harq */
/* new grant so new transmission each try */
printf("Third sequence ndi toggle each two transmissions \n");
for (int i = 0 ; i < number_steps; i++) {
uplink_harq_process(ulsch_harq, harq_pid, ndi, rnti_type);
if (i & 0x1) {
ndi ^= 1; /* toogle ndi each try */
}
}
release_uplink_harq_process(phy_vars_ue , gNB_id);
return 0;
}
/*******************************************************************
*
* NAME : test_harq_downlink
*
* PARAMETERS : none
*
* RETURN : none
*
* DESCRIPTION : test of HARQ downlink feature
*
*********************************************************************/
int test_harq_downlink(PHY_VARS_NR_UE *phy_vars_ue)
{
int gNB_id = 0;
int harq_pid = 0;
int ndi = 1;
nr_rnti_type_t rnti_type = C_RNTI_NR;
int number_steps = 5;
int thread_number = 0;
int TB_identifier = 0;
printf("\nHARQ Downlink \n");
config_downlink_harq_process(phy_vars_ue , gNB_id, TB_identifier, thread_number, NR_DEFAULT_DLSCH_HARQ_PROCESSES);
NR_DL_UE_HARQ_t *dlsch_harq = phy_vars_ue->dlsch[thread_number][gNB_id][TB_identifier]->harq_processes[harq_pid];
/* reach maximum number of retransmissions */
printf("First sequence ndi does not toggle \n");
for (int i = 0 ; i < number_steps; i++) {
downlink_harq_process(dlsch_harq, harq_pid, ndi, rnti_type);
}
harq_pid++; /* next harq */
dlsch_harq = phy_vars_ue->dlsch[thread_number][gNB_id][TB_identifier]->harq_processes[harq_pid];
/* new grant so new transmission each try */
printf("Second sequence ndi toggle each transmission \n");
for (int i = 0 ; i < number_steps; i++) {
downlink_harq_process(dlsch_harq, harq_pid, ndi, rnti_type);
ndi ^= 1; /* toogle ndi each try */
}
harq_pid++; /* next harq */
dlsch_harq = phy_vars_ue->dlsch[thread_number][gNB_id][TB_identifier]->harq_processes[harq_pid];
/* new grant so new transmission each try */
printf("Third sequence ndi toggle each two transmissions \n");
for (int i = 0 ; i < number_steps; i++) {
downlink_harq_process(dlsch_harq, harq_pid, ndi, rnti_type);
if (i & 0x1) {
ndi ^= 1; /* toogle ndi each try */
}
}
release_downlink_harq_process(phy_vars_ue , gNB_id, TB_identifier, thread_number);
return 0;
}
/*******************************************************************
*
* NAME : test_harq
*
* PARAMETERS : none
*
* RETURN : none
*
* DESCRIPTION : test of HARQ feature
*
*********************************************************************/
int test_harq(PHY_VARS_NR_UE *phy_vars_ue)
{
int result = -1;
result = test_harq_uplink(phy_vars_ue);
if (result == 0) {
result = test_harq_downlink(phy_vars_ue);
}
return (result);
}
/*******************************************************************
*
* NAME : main
*
* DESCRIPTION : test of uplink and downlink harq entities
*
*********************************************************************/
int main(int argc, char *argv[])
{
VOID_PARAMETER argc;
VOID_PARAMETER argv;
uint8_t transmission_mode = 1;
uint8_t nb_antennas_tx = 1;
uint8_t nb_antennas_rx = 1;
uint8_t frame_type = FDD;
uint8_t N_RB_DL=100;
lte_prefix_type_t extended_prefix_flag = NORMAL;
int Nid_cell[] = {(3*0+0)};
VOID_PARAMETER argc;
VOID_PARAMETER argv;
printf(" HARQ TEST \n");
printf("----------\n");
if (init_test(nb_antennas_tx, nb_antennas_rx, transmission_mode, extended_prefix_flag, frame_type, Nid_cell[0], N_RB_DL) != 0) {
printf("Initialisation problem for harq test \n");
exit(-1);;
}
if (test_harq(PHY_vars_UE) != 0) {
printf("Test NR HARQ is fail \n");
}
else {
printf("Test NR HARQ is pass \n");
}
free_context_synchro_nr();
return(0);
}
This source diff could not be displayed because it is too large. You can view the blob instead.
/*
* 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
*/
/**********************************************************************
*
* FILENAME : pbch_test.c
*
* MODULE : UE test bench for sss tests
*
* DESCRIPTION : it allows unitary tests for SSS on host machine
*
************************************************************************/
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <limits.h>
typedef int nfapi_nr_pfcch_commonSearchSpaces_t;
#include "../nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h"
#include "PHY/defs_nr_UE.h"
#include "PHY/INIT/init_extern.h"
#include "PHY/phy_extern_nr_ue.h"
#include "PHY/NR_TRANSPORT/nr_transport.h"
#include "PHY/NR_REFSIG/ss_pbch_nr.h"
#include "PHY/NR_REFSIG/pss_nr.h"
#include "PHY/NR_REFSIG/sss_nr.h"
#include "PHY/NR_REFSIG/dmrs_nr.h"
#include "../../unit_tests/src/pss_util_test.h"
/************** EXTERNAL ******************************************/
extern int pbch_detection(PHY_VARS_NR_UE *ue, runmode_t mode);
/*******************************************************************
*
* NAME : test_synchro_pss_sss_nr
*
* INPUT : UE context
* for first and second pss sequence
* - position of pss in the received UE buffer
* - number of pss sequence
*
* RETURN : 0 if OK else error
*
* DESCRIPTION : detect pss sequences in the received UE buffer
* then detect sss sequence
*
* Test procedure:
* - reference pss sequences (first, second or both) are written at specific
* positions
* - correlation is done between the received buffer and the possible pss sequences
* - results indicate pss sequence number and correlation result
* - reference sss sequences are written at specific positions
* - correlation is done with possible sss sequence
*
* (10 ms)
* <--------------------------------------------------------------------------->
* -----------------------------------------------------------------------------
* | Received UE data buffer |
* ----------------------------------------------------------------------------
* ---------------------------------------------
* <-------------->| pss | pbch | sss | pbch |
* ---------------------------------------------
* offset
*
* SSS/PBCH block contains following symbols: pss + pbch + sss + pbch
*
*********************************************************************/
int test_synchro_pss_sss_nr(PHY_VARS_NR_UE *PHY_vars_UE, int position_symbol, int pss_sequence_number)
{
NR_DL_FRAME_PARMS *frame_parms = &(PHY_vars_UE->frame_parms);
int synchro_position;
int offset;
int16_t *tmp;
int32_t metric_fdd_ncp=0;
uint8_t phase_fdd_ncp;
int rate_change = SYNCHRO_RATE_CHANGE_FACTOR;
int decoded_pbch = -1;
set_sequence_pss(PHY_vars_UE, position_symbol, pss_sequence_number, INVALID_PSS_SEQUENCE);
synchro_position = pss_synchro_nr(PHY_vars_UE, rate_change);
synchro_position = synchro_position * rate_change;
if (abs(synchro_position - position_symbol) > PSS_DETECTION_MARGIN_MAX)
{
printf("NR Pss has been detected at position %d instead of %d \n", synchro_position, position_symbol);
}
/* symbols order for synchronisation block is PSS - PBCH - SSS */
/* knowing that synchronisation position gives pss ofdm start one can deduce start of sss symbol */
offset = (position_symbol + (SSS_SYMBOL_NB - PSS_SYMBOL_NB)*(frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples));
tmp = (int16_t *)&PHY_vars_UE->common_vars.rxdata[0][offset];
insert_sss_nr(tmp, frame_parms);
//PHY_vars_UE->rx_offset = position_symbol; /* offset is given for samples of type int16 */
PHY_vars_UE->rx_offset = synchro_position; /* offset is given for samples of type int16 */
#if TEST_SYNCHRO_TIMING_PSS
start_meas(&generic_time[TIME_SSS]);
#endif
rx_sss_nr(PHY_vars_UE, &metric_fdd_ncp, &phase_fdd_ncp);
#if TEST_SYNCHRO_TIMING_PSS
stop_meas(&generic_time[TIME_SSS]);
#ifndef NR_UNIT_TEST
printf("PSS execution duration %5.2f \n", generic_time[TIME_PSS].p_time/(cpuf*1000.0));
printf("SSS execution duration %5.2f \n", generic_time[TIME_SSS].p_time/(cpuf*1000.0));
#endif
#endif
if (phase_fdd_ncp != INDEX_NO_PHASE_DIFFERENCE) {
printf("Error: detected phase on sss is not correct: expected index phase is %d, detected index phase is %d !\n", INDEX_NO_PHASE_DIFFERENCE, phase_fdd_ncp);
return -1;
}
generate_dmrs_pbch(PHY_vars_UE->dmrs_pbch_bitmap_nr, frame_parms->Nid_cell);
decoded_pbch = pbch_detection(PHY_vars_UE, PHY_vars_UE->mode);
return decoded_pbch;
}
/*******************************************************************
*
* NAME : set_sequence_sss
*
* PARAMETERS : UE context
* position of sss in the received UE buffer
*
* RETURN : none
*
* DESCRIPTION : write reference sss sequence at a specified sample position in the received UE buffer
*
*********************************************************************/
void set_sequence_sss(PHY_VARS_NR_UE *PHY_vars_UE, int offset, int slot_offset)
{
NR_DL_FRAME_PARMS *frame_parms = &(PHY_vars_UE->frame_parms);
int length = frame_parms->ofdm_symbol_size;
int size = length * IQ_SIZE; /* i & q */
nfapi_config_request_t nfapi_config;
int16_t data_sss[LENGTH_SSS_NR];
nfapi_config.sch_config.physical_cell_id.value = PHY_vars_UE->frame_parms.Nid_cell;
/* reinitialise random for always getting same data */
srand(0);
int random;
for (int i=0; i< size/2; i++) {
random = ((rand() % AMP) - AMP/2); /* AMP allows to get a scaling of samples */
synchroF_tmp[i] = random;
}
bzero(synchro_tmp, size);
/* Computation of below offset has been added due to function generate_sss which is used for eNodeB to process transmission */
/* so it is based on a transmitted buffer which has been dimensioned for a full frame */
/* here one uses a smaller buffer according to the size of an ofdm symbol so it can not properly work in this case. */
/* so in order to only write in this buffer, pointer of the buffer has been modified in such a way that function */
/* generate_sss writes correct data at the right buffer location */
/* this address offset is applied for SSS which is in the second part of the frame */
int Nsymb = (frame_parms->Ncp==NORMAL)?14:12;
int index_offset = slot_offset*Nsymb/2*frame_parms->ofdm_symbol_size;
int16_t *tmp = synchroF_tmp - (2*index_offset);
#if 0
nr_generate_sss(data_sss,
(int32_t **)&tmp,
AMP,
0, // symbol number
&nfapi_config,
frame_parms);
/* get sss in the frequency domain by applying an inverse FFT */
idft2048(synchroF_tmp, /* complex input */
synchro_tmp, /* complex output */
1); /* scaling factor */
for (int aa=0;aa<PHY_vars_UE->frame_parms.nb_antennas_rx;aa++) {
/* copy sss in rx buffer */
for (int i=0; i<length; i++) {
((int32_t*)PHY_vars_UE->common_vars.rxdata[aa])[i + offset] = ((int32_t *)synchro_tmp)[i];
}
}
#else
insert_sss_nr(&tmp, frame_parms);
#endif
}
/*******************************************************************
*
* NAME : insert_sequence_sss
*
* PARAMETERS : UE context
* position of sss in the received UE buffer
*
* RETURN : none
*
* DESCRIPTION : write reference sss sequence at a specified sample position in the received UE buffer
*
*********************************************************************/
void insert_sequence_sss(PHY_VARS_NR_UE *PHY_vars_UE, int offset)
{
NR_DL_FRAME_PARMS *frame_parms = &(PHY_vars_UE->frame_parms);
int samples_for_half_frame = (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti)>>1;
set_sequence_sss(PHY_vars_UE, offset, 0);
set_sequence_sss(PHY_vars_UE, offset + samples_for_half_frame, 10);
}
/********************************************************************
*
* NAME : test_synchro_pss_sss
*
* INPUT : UE context
* for first and second pss sequence
* - position of pss in the received UE buffer
* - number of pss sequence
*
* RETURN : 0 if OK else error
*
* DESCRIPTION : detect pss sequences in the received UE buffer
* then detect sss sequence
*
* Test procedure:
*
* - reference pss sequences (first, second or both) are written at specific
* positions
* - correlation is done between the received buffer and the possible pss sequences
* - results indicate pss sequence number and correlation result
* - reference sss sequences are written at specific positions
* - correlation is done with possible sss sequence
*
* (10 ms)
* <--------------------------------------------------------------------------->
* -----------------------------------------------------------------------------
* | Received UE data buffer |
* ----------------------------------------------------------------------------
* ------------- -------------
* <-------------->| first pss |<--------------------->| second pss |
* position ------------- (5 ms) -------------
* ---------- ----------
* | first sss| |second sss|
* ------------ -----------
* As specified by the standard:
* - first and second sss sequence are different -> allow to get frame slot timing
* - first sss sequence is located in slot 0 and second sss sequence is in slot 10
* - ofdm symbol of sss is just before ofdm symbol of pss
*
*********************************************************************/
int test_synchro_pss_sss(PHY_VARS_NR_UE *PHY_vars_UE, int position_symbol, int sequence_number, test_t *test)
{
VOID_PARAMETER test;
NR_DL_FRAME_PARMS *frame_parms = &(PHY_vars_UE->frame_parms);
int synchro_position;
int offset;
int32_t metric_fdd_ncp=0;
uint8_t flip_fdd_ncp;
uint8_t phase_fdd_ncp;
int rate_change = SYNCHRO_RATE_CHANGE_FACTOR; /* by default there is no sampling rate change */
int decoded_pbch = -1;
offset = position_symbol - frame_parms->ofdm_symbol_size - frame_parms->nb_prefix_samples;
if (offset < 0)
{
printf("Test aborted because sss position is outside the window\n");
exit(0);
}
set_sequence_pss(PHY_vars_UE, position_symbol, sequence_number, sequence_number);
synchro_position = pss_synchro_nr(PHY_vars_UE, rate_change);
printf("Pss has been detected at position %d with Nid2 %d \n", synchro_position, PHY_vars_UE->common_vars.eNb_id );
insert_sequence_sss(PHY_vars_UE, offset);
if ((frame_parms->Ncp != NORMAL) || (frame_parms->frame_type != FDD)) {
printf("This configuration is not supported. Please use call to function ""initial_sync"" for covering others configurations.\n");
exit(0);
}
int sync_pos2 = synchro_position - frame_parms->nb_prefix_samples;
int sync_pos_slot = (frame_parms->samples_per_tti>>1) - frame_parms->ofdm_symbol_size - frame_parms->nb_prefix_samples;
if (sync_pos2 >= sync_pos_slot)
PHY_vars_UE->rx_offset = sync_pos2 - sync_pos_slot;
else
PHY_vars_UE->rx_offset = FRAME_LENGTH_COMPLEX_SAMPLES + sync_pos2 - sync_pos_slot;
rx_sss(PHY_vars_UE, &metric_fdd_ncp, &flip_fdd_ncp, &phase_fdd_ncp);
if (phase_fdd_ncp != INDEX_NO_PHASE_DIFFERENCE) {
printf("Error: detected phase on sss is not correct: expected index phase is %d, detected index phase is %d !\n", INDEX_NO_PHASE_DIFFERENCE, phase_fdd_ncp);
return -1;
}
init_frame_parms(&PHY_vars_UE->frame_parms,1);
//lte_gold_new(frame_parms, PHY_vars_UE->lte_gold_table[0],frame_parms->Nid_cell);
decoded_pbch = pbch_detection(PHY_vars_UE, PHY_vars_UE->mode);
return decoded_pbch;
}
/*******************************************************************
*
* NAME : main
*
* DESCRIPTION : test bench for synchronisation sequence (pss/sss/pbch)
* purpose of test is to check that synchronisation sequence can be
* properly detected depending of input waveforms.
*
* - First step of synchronisation consists in pss search (primary synchronisation signal).
* pss sequence should be detected at the right position
* in the received buffer whatever the position along the
* received data buffer.
* Detection of position is based on correlation in time domain between
* received signal and pss sequence -> position is given by
* peak of correlation result.
* - Second step of synchronisation is sss decoding (secundary synchronisation signal).
* sss detection is based on position of detected pss.
*
*********************************************************************/
int main(int argc, char *argv[])
{
VOID_PARAMETER argc;
VOID_PARAMETER argv;
uint8_t transmission_mode = 1;
uint8_t nb_antennas_tx = 1;
uint8_t nb_antennas_rx = 1;
uint8_t frame_type = FDD;
uint8_t N_RB_DL=100;
lte_prefix_type_t extended_prefix_flag = NORMAL;
int decoded_pbch = -1;
int Nid1, Nid2;
const char *name_test = " PBCH NR ";
test_t test = { name_test, 0, 0, 0, 0};
#if 1
int test_position[] = { 20000 }; /* this is the sample number in the frame */
#else
int test_position[] = { -1 }; /* to get samples from a buffer initialised from an external file */
#endif
int size_test_position;
/* this is a pointer to the function in charge of the test */
int (*p_test_synchro_pss_sss)(PHY_VARS_NR_UE *PHY_vars_UE, int position_symbol, int sequence_number, test_t *test) = test_synchro_pss_sss;
#if 0
int Nid_cell[] = { (3*0+0), (3*71+0), (3*21+2), (3*21+2), (3*55+1), (3*111+2) };
#else
int Nid_cell[] = { ((3*1+2)) };
#endif
printf(" PBCH TEST \n");
printf("----------\n");
if (init_test(nb_antennas_tx, nb_antennas_rx, transmission_mode, extended_prefix_flag, frame_type, Nid_cell[0], N_RB_DL) != 0) {
printf("Initialisation problem for synchronisation test \n");
exit(-1);;
}
p_test_synchro_pss_sss = test_synchro_pss_sss_nr;
size_test_position = sizeof(test_position)/sizeof(int);
printf("***********************************\n");
printf(" %s Test NR synchronisation \n", test.test_current);
printf("***********************************\n");
for (unsigned int index = 0; index < (sizeof(Nid_cell)/sizeof(int)); index++) {
PHY_vars_eNB->frame_parms.Nid_cell = Nid_cell[index];
Nid2 = GET_NID2(PHY_vars_eNB->frame_parms.Nid_cell);
Nid1 = GET_NID1(PHY_vars_eNB->frame_parms.Nid_cell);
for (int position = 0; position < size_test_position; position++) {
PHY_vars_UE->frame_parms.Nid_cell = (3 * N_ID_1_NUMBER) + N_ID_2_NUMBER; /* set to unvalid value */
decoded_pbch = (*p_test_synchro_pss_sss)(PHY_vars_UE, test_position[position], Nid2, &test); /* return phase index which gives phase error from an array */
test.number_of_tests++;
printf("\n%s ", test.test_current);
if (PHY_vars_UE->frame_parms.Nid_cell == (3 * Nid1) + Nid2) {
if (decoded_pbch != -1) {
printf("Test is pass with offset %d Nid1 %d Nid2 %d \n", test_position[position], Nid1, Nid2);
test.number_of_pass++;
}
else {
printf("Test is fail because pbch has not been decoded \n");
test.number_of_fail++;
}
}
else {
printf("Test is fail with offset %d Nid1 %d Nid2 %d \n", test_position[position], Nid1, Nid2);
test.number_of_fail++;
}
break;
}
break;
}
printf("\n %s Number of tests : %d Pass : %d Pass with warning : %d Fail : %d \n", test.test_current, test.number_of_tests, test.number_of_pass, test.number_of_pass_warning, test.number_of_fail);
printf("%s Synchronisaton test is terminated.\n\n", test.test_current);
/* reset test statistics */
test.number_of_tests = test.number_of_pass = test.number_of_pass_warning = test.number_of_fail = 0;
free_context_synchro_nr();
return(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
*/
/**********************************************************************
*
* FILENAME : pss_test.c
*
* MODULE : UE test bench for synchronisation
*
* DESCRIPTION : it allows unitary tests of UE synchronisation on host machine
*
************************************************************************/
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include "../../unit_tests/src/pss_util_test.h"
#include "PHY/defs_nr_UE.h"
#include "PHY/INIT/init_extern.h"
#include "PHY/phy_extern_nr_ue.h"
#include "PHY/NR_REFSIG/ss_pbch_nr.h"
#include "PHY/NR_REFSIG/pss_nr.h"
#include "PHY/NR_REFSIG/sss_nr.h"
#include "PHY/NR_REFSIG/dmrs_nr.h"
/************** DEFINE *******************************************/
/*************** LOCAL VARIABLES***********************************/
/*************** FUNCTIONS ****************************************/
/********************************************************************
*
* NAME : pss_test
*
* INPUT : UE context
* for a pss sequence
* - position of pss in the received UE buffer
* - number of pss sequence
*
* RETURN : 0 if OK else error
*
* DESCRIPTION : detect pss sequences in the received UE buffer
*
* Test procedure:
*
* - reference pss sequences is written at a specific position
* - correlation is done between the received buffer and the possible pss sequences
* - results indicate pss sequence number and correlation result.
*
* Test is pass if detection of pss position is the one which has been set.
*
* (10 ms)
* <--------------------------------------------------------------------------->
* -----------------------------------------------------------------------------
* | Received UE data buffer |
* ----------------------------------------------------------------------------
* +-----------+
* <--------->| pss |
* position +-----------+
* ^
* |
* peak position
* given by maximum of correlation result
* position matches beginning of ofdm symbol
*
* Remark: memory position should be aligned on a multiple of 4 due to I & Q samples of int16
* An OFDM symbol is composed of x number of received samples depending of Rf front end sample rate.
*
* I & Q storage in memory
*
* First samples Second samples
* ------------------------- ------------------------- ...
* | I1 | Q1 | I2 | Q2 |
* --------------------------------------------------- ...
* ^ 16 bits 16 bits ^
* | |
* --------------------------------------------------- ...
* | sample 1 | sample 2 |
* ---------------------------------------------------- ...
* ^
* |
* OFDM in time
*
*********************************************************************/
void test_synchro_pss_nr(PHY_VARS_NR_UE *PHY_VARS_NR_UE, int position_symbol, int pss_sequence_number, test_t *test)
{
int rate_change = SYNCHRO_RATE_CHANGE_FACTOR;
int synchro_position;
int NID2_value;
display_test_configuration_pss(position_symbol, pss_sequence_number);
set_sequence_pss(PHY_VARS_NR_UE, position_symbol, pss_sequence_number);
/* search pss */
synchro_position = pss_synchro_nr(PHY_VARS_NR_UE, rate_change);
if (pss_sequence_number < NUMBER_PSS_SEQUENCE) {
NID2_value = pss_sequence_number;
} else {
NID2_value = NUMBER_PSS_SEQUENCE;
}
if (NID2_value < NUMBER_PSS_SEQUENCE) {
test->number_of_tests++;
/* position should be adjusted with i&q samples which are successively stored as int16 in the received buffer */
int test_margin = PSS_DETECTION_MARGIN_MAX; /* warning correlation results give an offset position between 0 and 12 */
int delta_position = abs(position_symbol - (synchro_position*rate_change));
printf("%s ", test->test_current);
if (PHY_VARS_NR_UE->common_vars.eNb_id == pss_sequence_number) {
if ( delta_position != 0) {
if (delta_position > test_margin*rate_change) {
printf("Test is fail due to wrong position %d instead of %d \n", (synchro_position*rate_change), position_symbol);
printf("%s ", test->test_current);
printf("Test is fail : pss detected with a shift of %d \n", delta_position);
test->number_of_fail++;
}
else {
printf("Test is pass with warning: pss detected with a shift of %d \n", delta_position);
test->number_of_pass_warning++;
}
}
else {
printf("Test is pass: pss detected at right position \n");
test->number_of_pass++;
}
}
else {
printf("Test is fail due to wrong NID2 detection %d instead of %d \n", PHY_VARS_NR_UE->common_vars.eNb_id, NID2_value);
test->number_of_fail++;
}
}
}
/*******************************************************************
*
* NAME : main
*
* DESCRIPTION : test bench for synchronisation sequence (pss/sss/pbch)
* purpose of test is to check that synchronisation sequence can be
* properly detected depending of input waveforms.
*
* - First step of synchronisation is pss sequence.
* pss sequence should be detected at the right position
* in the received buffer whatever the position along the
* received data buffer.
* Detection of position is based on correlation in time domain between
* received signal and pss sequence -> position is given by
* peak of correlation result.
*
*********************************************************************/
int main(int argc, char *argv[])
{
VOID_PARAMETER argc;
VOID_PARAMETER argv;
uint8_t transmission_mode = 1;
uint8_t nb_antennas_tx = 1;
uint8_t nb_antennas_rx = 1;
uint16_t Nid_cell=123;
uint8_t frame_type=FDD;
uint8_t N_RB_DL=100;
lte_prefix_type_t extended_prefix_flag=NORMAL;
const char *name_test = "PSS NR";
test_t test = { name_test, 0, 0, 0, 0};
/* this is a pointer to the function in charge of the test */
void (*p_test_synchro_pss)(PHY_VARS_NR_UE *PHY_VARS_NR_UE, int position_symbol, int pss_sequence_number, test_t *test) = test_synchro_pss_nr;
int test_position[] = { 0, 492, 493, 56788, 56888, 111111, 151234, 151500, 200000, 250004, (307200-2048) };
int size_test_position = sizeof(test_position)/sizeof(int);
printf(" PSS TEST \n");
printf("----------\n");
if (init_test(nb_antennas_tx, nb_antennas_rx, transmission_mode, extended_prefix_flag, frame_type, Nid_cell, N_RB_DL) != 0) {
printf("Initialisation problem for synchronisation test \n");
exit(-1);;
}
printf("***********************************\n");
printf(" %s Test synchronisation \n", test.test_current);
printf("***********************************\n");
#if 0
printf("Synchronisation with random data\n");
test_synchro_pss_nr(PHY_vars_UE, 0, INVALID_PSS_SEQUENCE, &test);
#endif
for (int index_position = 0; index_position < size_test_position; index_position++) {
for (int number_pss_sequence = 0; number_pss_sequence < NUMBER_PSS_SEQUENCE; number_pss_sequence++) {
p_test_synchro_pss(PHY_vars_UE, test_position[index_position], number_pss_sequence, &test);
//break;
}
//break;
}
printf("\n%s Number of tests : %d Pass : %d Pass with warning : %d Fail : %d \n\n", test.test_current, test.number_of_tests, test.number_of_pass, test.number_of_pass_warning, test.number_of_fail);
printf("%s Synchronisaton test is terminated.\n\n", test.test_current);
/* reset test statistics */
test.number_of_tests = test.number_of_pass = test.number_of_pass_warning = test.number_of_fail = 0;
free_context_synchro_nr();
return(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
*/
/*********************************************************************
*
* FILENAME : pss_util_test.c
*
* MODULE : UE test bench for unit tests
*
* DESCRIPTION : it allows unitary tests of NR UE
*
************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#include <signal.h>
#include <time.h>
#include "PHY/defs_nr_UE.h"
#include "PHY/INIT/phy_init.h"
#include "PHY/phy_extern_nr_ue.h"
/* to declare ue variables */
#include "PHY/phy_vars_nr_ue.h"
#include "PHY/LTE_TRANSPORT/transport_vars.h"
#include "SCHED/sched_common_vars.h"
#include "PHY/MODULATION/modulation_vars.h"
#include "PHY/NR_REFSIG/pss_nr.h"
#include "PHY/NR_REFSIG/sss_nr.h"
#include "PHY/NR_UE_TRANSPORT/cic_filter_nr.h"
#define DEFINE_VARIABLES_PSS_NR_H
#include "../../unit_tests/src/pss_util_test.h"
#undef DEFINE_VARIABLES_PSS_NR_H
#define DEFINE_VARIABLES_INPUT_BUFFER_TEST_H
#include "../../unit_tests/src/input_buffer_test.h"
#undef DEFINE_VARIABLES_INPUT_BUFFER_TEST_H
/************** DEFINE *******************************************/
/*************** LOCAL VARIABLES***********************************/
static nfapi_config_request_t config_t;
static nfapi_config_request_t* config =&config_t;
/*************** FUNCTIONS ****************************************/
void phy_init_nr_top(NR_DL_FRAME_PARMS *frame_parms);
int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_eNB, uint8_t abstraction_flag);
/*******************************************************************
*
* NAME : apply phase shift
*
* PARAMETERS : pointer to buffer in frequency
* length of sample
*
* RETURN : none
*
* DESCRIPTION : apply phase shift to samples
*
*********************************************************************/
void phase_shift_samples(int16_t *samples, int length, int16_t phase_shift_re, int16_t phase_shift_im)
{
int16_t sample_re, sample_im;
for (int i = 0; i < length; i++) {
sample_re = (((phase_shift_re*samples[2*i])>>SCALING_METRIC_SSS_NR) - ((phase_shift_im*samples[2*i+1])>>SCALING_METRIC_SSS_NR));
sample_im = (((phase_shift_im*samples[2*i])>>SCALING_METRIC_SSS_NR) + ((phase_shift_re*samples[2*i+1])>>SCALING_METRIC_SSS_NR));
samples[2*i] = sample_re;
samples[2*i+1] = sample_im;
}
}
/*******************************************************************
*
* NAME : display_data
*
* PARAMETERS : pointer to buffer
* position in the buffer
*
* RETURN : none
*
* DESCRIPTION : display pss sequence and data of a buffer
*
*
*********************************************************************/
void display_data(int pss_sequence_number, int16_t *rxdata, int position)
{
#ifdef DEBUG_TEST_PSS
int16_t *pss_sequence[NUMBER_PSS_SEQUENCE] = {primary_synch0_time, primary_synch1_time, primary_synch2_time};
int16_t *pss_sequence_time = pss_sequence[pss_sequence_number];
printf(" pss %6d data \n", pss_sequence_number);
for (int i = 0; i < 4; i++) {
if (pss_sequence_number < NUMBER_PSS_SEQUENCE) {
printf("[i %6d] : %4d [i %6d] : %8i at address : %p \n", i, pss_sequence_time[2*i], (i + position), rxdata[2*i + (position*2)], &(rxdata[2*i + (position*2)]));
printf("[q %6d] : %4d [q %6d] : %8i at address : %p \n", i, pss_sequence_time[2*i+1], (i + position), rxdata[2*i + 1 + (position*2)], &(rxdata[2*i + 1 + (position*2)]));
}
else {
printf("[i %6d] : Undef [i %6d] : %8i at address : %p \n", i, (i + position), rxdata[2*i + (position*2)], &(rxdata[2*i + (position*2)]));
printf("[q %6d] : Undef [q %6d] : %8i at address : %p \n", i, (i + position), rxdata[2*i + 1 + (position*2)], &(rxdata[2*i + 1 + (position*2)]));
}
}nr_init_frame_parms
printf(" ... ... \n");
#else
(void) pss_sequence_number;
(void) rxdata;
(void) position;
#endif
}
/*******************************************************************
*
* NAME : display_test_configuration_pss
*
* PARAMETERS :
*
*
* RETURN : none
*
* DESCRIPTION : display test configuration of pss
*
*********************************************************************/
void display_test_configuration_pss(int position, int pss_sequence_number)
{
const char next_test_text[] = "------------------------------------------------\n";
const char test_text_pss[] = "Test nr pss with Nid2 %i at position %i \n";
printf(next_test_text);
printf(test_text_pss, pss_sequence_number, position);
}
/*******************************************************************
*
* NAME : display_test_configuration_sss
*
* PARAMETERS :
*
*
* RETURN : none
*
* DESCRIPTION : display test configuration of pss
*
*********************************************************************/
void display_test_configuration_sss(int sss_sequence_number)
{
const char test_text_sss[] = "Test nr sss with Nid1 %i \n";
printf(test_text_sss, sss_sequence_number);
}
/*******************************************************************
*
* NAME : undefinedFunction
*
* PARAMETERS : function name
*
* RETURN : none
*
* DESCRIPTION : these functions allow to solve undefined functions at link
* function name is printed at execution time for checking that
* each function is not called
*
*********************************************************************/
void undefined_function(const char *function)
{
printf("%s undefined \n", function);
printf("Warning: function \"%s\" has been replaced by an empty function for avoiding undefined function error at build \n", function);
}
/*******************************************************************
*
* NAME : init_synchro_test
*
* PARAMETERS : configuration for UE and eNB
*
* RETURN : 0 if OK else error
*
* DESCRIPTION : initialisation of UE and eNode contexts
*
*********************************************************************/
int init_test(unsigned char N_tx, unsigned char N_rx, unsigned char transmission_mode,
unsigned char extended_prefix_flag, uint8_t frame_type, uint16_t Nid_cell, uint8_t N_RB_DL)
{
(void) transmission_mode;
NR_DL_FRAME_PARMS *frame_parms;
int log_level = LOG_TRACE;
logInit();
// enable these lines if you need debug info
set_comp_log(PHY,LOG_DEBUG,LOG_HIGH,1);
set_glog(log_level,LOG_HIGH);
#ifndef NR_UNIT_TEST
cpuf = get_cpu_freq_GHz();
LOG_I(PHY, "[CONFIG] Test of UE synchronisation \n");
set_component_filelog(USIM); // file located in /tmp/testSynchroue.txt
#endif
//randominit(0);
//set_taus_seed(0);
printf("Start lte_param_init, frame_type %d, extended_prefix %d\n",frame_type,extended_prefix_flag);
PHY_vars_UE = malloc(sizeof(PHY_VARS_NR_UE));
bzero(PHY_vars_UE, sizeof(PHY_VARS_NR_UE));
if (PHY_vars_UE == NULL)
return(-1);
frame_parms = &(PHY_vars_UE->frame_parms);
frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz
frame_parms->N_RB_UL = N_RB_DL;
frame_parms->Ncp = extended_prefix_flag;
frame_parms->Nid_cell = Nid_cell;
frame_parms->nushift = Nid_cell%6;
frame_parms->nb_antennas_tx = N_tx;
frame_parms->nb_antennas_rx = N_rx;
frame_parms->frame_type = frame_type;
frame_parms->nb_antenna_ports_eNB = 1;
frame_parms->threequarter_fs = 0;
frame_parms->numerology_index = NUMEROLOGY_INDEX_MAX_NR;
nr_init_frame_parms_ue(config,frame_parms);
PHY_vars_UE->frame_parms.Nid_cell = (3 * N_ID_1_NUMBER) + N_ID_2_NUMBER; /* set to unvalid value */
phy_init_nr_top(frame_parms);
if (init_nr_ue_signal(PHY_vars_UE, 1, 0) != 0)
{
LOG_E(PHY,"Error at UE NR initialisation : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return (0);
}
/* dummy initialisation of global structure PHY_vars_UE_g */
unsigned char NB_UE_INST=1;
PHY_vars_UE_g = (PHY_VARS_NR_UE***)calloc( NB_UE_INST, sizeof(PHY_VARS_NR_UE**));
for (int UE_id=0; UE_id<NB_UE_INST; UE_id++) {
PHY_vars_UE_g[UE_id] = (PHY_VARS_NR_UE**) calloc( MAX_NUM_CCs, sizeof(PHY_VARS_NR_UE*));
for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
//(frame_parms[CC_id])->nb_antennas_tx = 1;
//(frame_parms[CC_id])->nb_antennas_rx = nb_antennas_rx_ue;
// PHY_vars_UE_g[UE_id][CC_id] = init_lte_UE(frame_parms[CC_id], UE_id,abstraction_flag);
PHY_vars_UE_g[UE_id][CC_id] = calloc(1, sizeof(PHY_VARS_NR_UE));
PHY_vars_UE_g[UE_id][CC_id]->Mod_id=UE_id;
PHY_vars_UE_g[UE_id][CC_id]->CC_id=CC_id;
}
}
return (0);
}
/*******************************************************************
*
* NAME : set_random_rx_buffer
*
* PARAMETERS : Ue context
*
* RETURN : 0 if OK else error
*
* DESCRIPTION : write random data in received UE buffer of the synchronisation window
*
*********************************************************************/
typedef enum {
ZERO_DATA,
SINUSOIDAL_DATA,
RANDOM_DATA,
RANDOM_MAX_DATA
} random_data_format_t;
/* data is a pure cosinus wave */
#define SAMPLING_RATE (30720000L)
#define SCALING_SINUSOIDAL_DATA (4) /* 16 is max value without decimation */
#define FREQUENCY_15_MHZ (15360000L)
#define FREQUENCY (FREQUENCY_15_MHZ) /* to generate a frequency with a sampling of 30,72 MHz 5 gives 770 KHz, 20 gives 1,5 MHz, 40 gives 3 MHz */
void set_random_rx_buffer(PHY_VARS_NR_UE *PHY_vars_UE, int amp)
{
NR_DL_FRAME_PARMS *frame_parms = &(PHY_vars_UE->frame_parms);
int samples_for_frame = (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti);
int16_t random;
int16_t *data_p;
random_data_format_t data_format = SINUSOIDAL_DATA;
/* reinitialise random for always getting same data */
srand(0);
double n = 0;
for (int aa=0;aa<PHY_vars_UE->frame_parms.nb_antennas_rx;aa++) {
data_p = (int16_t *) &(PHY_vars_UE->common_vars.rxdata[aa][0]);
int frequency_switch = samples_for_frame/LTE_NUMBER_OF_SUBFRAMES_PER_FRAME;
int frequency_step = 0;
double beat = (2*M_PI*FREQUENCY_15_MHZ)/(SAMPLING_RATE);
for (int i=0; i< samples_for_frame; i++) {
switch(data_format) {
case ZERO_DATA:
{
/* all data are forced to zero */
random = 0;
break;
}
case SINUSOIDAL_DATA:
{
/* sinusoidal signal */
n = cos(beat*i);
random = n * (amp * SCALING_SINUSOIDAL_DATA);
frequency_step++;
if (frequency_step == frequency_switch) {
beat = beat/2; /* frequency is divided by 2 */
//printf("frequency %f at %d\n", (beat/2*M_PI), i);
frequency_step = 0;
}
//printf("%d : cos %d %d \n", i, n, random);
break;
}
case RANDOM_DATA:
{
/* random data can take any value between -SHRT_MAX and SHRT_MAX */
/* in this case one can use maxim value for uint16 because there is no saturation */
#define SCALING_RANDOM_DATA (24) /* 48 is max value without decimation */
#define RANDOM_MAX_AMP (amp * SCALING_RANDOM_DATA)
random = ((rand() % RANDOM_MAX_AMP) - RANDOM_MAX_AMP/2);
break;
}
case RANDOM_MAX_DATA:
{
/* random data can take only two value (-RANDOM_MAX) or RANDOM_MAX */
/* In this case saturation can occur with value of scaling_value greater than 23 */
#define SCALING_RANDOM_MAX_DATA (8)
#define RANDOM_VALUE (amp * SCALING_RANDOM_DATA)
const int random_number[2] = {-1,+1};
random = random_number[rand()%2] * RANDOM_VALUE;
break;
}
default:
{
printf("Format of data is undefined \n");
assert(0);
break;
}
}
data_p[2*i] = random;
data_p[2*i+1] = random;
#if 0
if (i < 10) {
printf("random %d \n", random);
printf("data[%d] : %d %d at address %p \n", i, data_p[2*i], data_p[2*i+1], &data_p[2*i]);
}
#endif
}
}
}
/*******************************************************************
*
* NAME : set_pss_in_rx_buffer_from_external_buffer
*
* PARAMETERS : UE context
* position of pss in the received UE buffer
* number of pss sequence*
*
* RETURN : 0 if OK else error
*
* DESCRIPTION : set received buffer according to an external buffer
*
*********************************************************************/
int set_pss_in_rx_buffer_from_external_buffer(PHY_VARS_NR_UE *PHY_vars_UE, short *input_buffer)
{
NR_DL_FRAME_PARMS *frame_parms = &(PHY_vars_UE->frame_parms);
int samples_for_frame = LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_subframe; /* both i and q */
for (int aa=0;aa<PHY_vars_UE->frame_parms.nb_antennas_rx;aa++) {
for (int i = 0; i < samples_for_frame; i++) {
((int16_t*)PHY_vars_UE->common_vars.rxdata[aa])[2*i] = input_buffer[2*i]; /* real part */
((int16_t*)PHY_vars_UE->common_vars.rxdata[aa])[2*i+1] = input_buffer[2*i+1]; /* imaginary part */
}
}
/* check that sequence has been properly copied */
for (int aa=0;aa<PHY_vars_UE->frame_parms.nb_antennas_rx;aa++) {
for (int i=0; i<samples_for_frame; i++) {
if ((input_buffer[2*i] != ((int16_t*)PHY_vars_UE->common_vars.rxdata[aa])[2*i])
|| (input_buffer[2*i+1] != ((int16_t*)PHY_vars_UE->common_vars.rxdata[aa])[2*i+1])) {
printf("Sequence pss was not properly copied into received buffer at index %d \n", i);
exit(-1);
}
}
}
return (0);
}
/*******************************************************************
*
* NAME : set_pss_in_rx_buffer
*
* PARAMETERS : UE context
* position of pss in the received UE buffer
* number of pss sequence*
*
* RETURN : 0 if OK else error
*
* DESCRIPTION : write reference pss sequence at a specified sample position in the received UE buffer
*
* first pss sequence is written into the buffer only if:
* - pss sequence is valid
* - there is enough room for written the complete sequence
*
* second sequence is written at a position of 5 ms after first pss sequence if:
* - pss sequence is valid
* - there is enough room for written the complete sequence*
*
*********************************************************************/
int set_pss_in_rx_buffer(PHY_VARS_NR_UE *PHY_vars_UE, int position_symbol, int pss_sequence_number)
{
NR_DL_FRAME_PARMS *frame_parms = &(PHY_vars_UE->frame_parms);
int samples_for_frame = frame_parms->samples_per_frame;
int16_t *pss_sequence_time;
if ((position_symbol > samples_for_frame)
|| ((position_symbol + frame_parms->ofdm_symbol_size) > samples_for_frame))
{
printf("This pss sequence can not be fully written in the received window \n");
return (-1);
}
if ((pss_sequence_number >= NUMBER_PSS_SEQUENCE) && (pss_sequence_number < 0)) {
printf("Unknow pss sequence %d \n", pss_sequence_number);
return (-1);
}
pss_sequence_time = primary_synchro_time_nr[pss_sequence_number];
for (int aa=0;aa<PHY_vars_UE->frame_parms.nb_antennas_rx;aa++) {
for (int i = 0; i < frame_parms->ofdm_symbol_size; i++) {
((int16_t*)PHY_vars_UE->common_vars.rxdata[aa])[(position_symbol*2) + (2*i)] = pss_sequence_time[2*i]; /* real part */
((int16_t*)PHY_vars_UE->common_vars.rxdata[aa])[(position_symbol*2) + (2*i+1)] = pss_sequence_time[2*i+1]; /* imaginary part */
}
}
/* check that sequence has been properly copied */
for (int aa=0;aa<PHY_vars_UE->frame_parms.nb_antennas_rx;aa++) {
for (int i=0; i<(frame_parms->ofdm_symbol_size); i++) {
if ((pss_sequence_time[2*i] != ((int16_t*)PHY_vars_UE->common_vars.rxdata[aa])[(position_symbol*2) + (2*i)])
|| (pss_sequence_time[2*i+1] != ((int16_t*)PHY_vars_UE->common_vars.rxdata[aa])[(position_symbol*2) + (2*i+1)])) {
printf("Sequence pss was not properly copied into received buffer at index %d \n", i);
exit(-1);
}
}
}
return (0);
}
/*******************************************************************
*
* NAME : set_sequence_pss
*
* PARAMETERS : UE context
* position of pss in the received UE buffer
* number of pss sequence*
*
* RETURN : 0 if OK else error
*
* DESCRIPTION : write reference pss sequence at a specified sample position in the received UE buffer
*
* pss sequence is written into the buffer only if:
* - pss sequence is valid
* - there is enough room for written the complete sequence*
*
*********************************************************************/
void set_sequence_pss(PHY_VARS_NR_UE *PHY_vars_UE, int position_symbol, int pss_sequence_number)
{
NR_DL_FRAME_PARMS *frame_parms = &(PHY_vars_UE->frame_parms);
int samples_for_frame = frame_parms->samples_per_frame;
/* initialise received ue data with random */
set_random_rx_buffer(PHY_vars_UE, AMP);
/* in this case input buffer is provided by an external buffer */
if (position_symbol < 0) {
set_pss_in_rx_buffer_from_external_buffer(PHY_vars_UE, input_buffer);
}
/* write pss sequence in received ue buffer */
else if (pss_sequence_number < NUMBER_PSS_SEQUENCE) {
if (position_symbol > (samples_for_frame - frame_parms->ofdm_symbol_size)) {
printf("This position for pss sequence %d is not supported because it exceeds the frame length %d!\n", position_symbol, samples_for_frame);
exit(0);
}
if (set_pss_in_rx_buffer(PHY_vars_UE, position_symbol, pss_sequence_number) != 0)
printf("Warning: pss sequence can not be properly written into received buffer !\n");
}
display_data(pss_sequence_number, (int16_t *)&(PHY_vars_UE->common_vars.rxdata[0][0]), position_symbol);
}
/*
* 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
*/
/**********************************************************************
*
* FILENAME : pss_util_test.h
*
* MODULE : UE utilities for test bench of synchronisation
*
* DESCRIPTION : it allows unitary tests of UE synchronisation on host machine
*
************************************************************************/
#ifndef PSS_UTIL_TEST_H
#define PSS_UTIL_TEST_H
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include "PHY/defs_nr_UE.h"
#include "PHY/INIT/init_extern.h"
#include "PHY/phy_extern_nr_ue.h"
#include "PHY/NR_REFSIG/pss_nr.h"
#ifdef DEFINE_VARIABLES_PSS_NR_H
#define EXTERN
#define INIT_VARIABLES_PSS_NR_H
#else
#define EXTERN extern
#undef INIT_VARIABLES_PSS_NR_H
#endif
/************** DEFINE *******************************************/
//#define DEBUG_TEST_PSS
#define PSS_DETECTION_MARGIN_MAX (4)
#define NUMEROLOGY_INDEX_MAX_NR (5)
/*************** TYPE*********************************************/
typedef struct {
const char *test_current;
int number_of_tests;
int number_of_pass;
int number_of_pass_warning;
int number_of_fail;
} test_t;
typedef struct {
uint16_t ofdm_symbol_size;
uint32_t samples_per_tti;
uint32_t samples_per_subframe;
} save_frame_parms_t;
/*************** GLOBAL VARIABLES***********************************/
EXTERN PHY_VARS_eNB *PHY_vars_eNB;
EXTERN PHY_VARS_NR_UE *PHY_vars_UE;
/*************** FUNCTIONS *****************************************/
void undefined_function(const char *function);
void display_data(int pss_sequence_number, int16_t *rxdata, int position);
void init_decimator_test(void);
void decimation_synchro_nr(PHY_VARS_NR_UE *PHY_vars_UE, int **rxdata);
void restore_context_frame(int **rxdata);
int set_pss_in_rx_buffer(PHY_VARS_NR_UE *PHY_vars_UE, int position_symbol, int pss_sequence_number);
int init_test(unsigned char N_tx, unsigned char N_rx, unsigned char transmission_mode,
unsigned char extended_prefix_flag, uint8_t frame_type, uint16_t Nid_cell,
uint8_t N_RB_DL);
void display_test_configuration_pss(int position, int pss_sequence_number);
void display_test_configuration_sss(int sss_sequence_number);
int set_pss_nr(int ofdm_symbol_size);
void set_random_rx_buffer(PHY_VARS_NR_UE *PHY_vars_UE, int amp);
void set_sequence_pss(PHY_VARS_NR_UE *PHY_vars_UE, int position_symbol, int pss_sequence_number);
int set_pss_in_rx_buffer_from_external_buffer(PHY_VARS_NR_UE *PHY_vars_UE, short *inputBuffer);
void phase_shift_samples(int16_t *samples, int length, int16_t phase_shift_re, int16_t phase_shift_im);
#endif /* PSS_UTIL_TEST_H */
/*
* 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
*/
/**********************************************************************
*
* FILENAME : pucch_uci_test.c
*
* MODULE : UE test bench for pucch tests
*
* DESCRIPTION : it allows unitary tests of PUCCH UCI on host machine
*
************************************************************************/
#include "../../unit_tests/src/pss_util_test.h"
#include "PHY/defs_nr_UE.h"
#include "PHY/INIT/init_extern.h"
#include "PHY/phy_extern_nr_ue.h"
#include "SCHED_NR_UE/defs.h"
#include "SCHED_NR/extern.h"
#include "SCHED_NR_UE/harq_nr.h"
#include "SCHED_NR_UE/pucch_uci_ue_nr.h"
/**************** define **************************************/
#define TST_GNB_ID_0 (0) /* first index of gNB */
#define TST_THREAD_ID (0)
#define TST_N_BWP_SIZE (100) /* band width for pucch */
#define TST_PUCCH_COMMON_CONFIG_INDEX_KO (6)
#define TST_PUCCH_COMMON_CONFIG_INDEX_OK (1)
#define TST_DL_HARQ_PID_FIRST (1)
#define TST_DL_HARQ_PID_SECOND (3)
#define TST_DL_HARQ_PID_THIRD (4)
#define TST_DL_HARQ_PID_FOURTH (0)
#define TST_NB_RESOURCE_SET (MAX_NB_OF_PUCCH_RESOURCE_SETS)
#define TST_NB_RESOURCES (32)
#define TST_NB_RESOURCES_PER_SET (8)
/* pucch power control */
#define TST_P0_NOMINAL (3) /* -202..24 */
#define TST_P0_PUCCH_VALUE (0) /* -16..15 */
#define TST_DELTA_F (1) /* -16..15 */
#define TST_TX_POWER_MAX_DBM (24) /* -202..24 */
/**************** extern *****************************************/
extern uint32_t (*p_nr_ue_get_SR)(module_id_t module_idP,int CC_id,frame_t frameP,uint8_t eNB_id,uint16_t rnti, sub_frame_t subframe);
/**************** variables **************************************/
uint32_t tst_scheduling_request_payload;
const char tst_separator[255] = "\n-------------------------------------------------------------------------------------------\n";
/*******************************************************************
*
* NAME : init_pucch_power_configuration
*
* PARAMETERS : none
*
* RETURN : none
*
* DESCRIPTION : set power onfiguration
*
*********************************************************************/
void init_pucch_power_configuration(PHY_VARS_NR_UE *ue, uint8_t gNB_id) {
ue->pucch_config_common_nr[gNB_id].p0_nominal = TST_P0_NOMINAL;
PUCCH_PowerControl_t *power_config = &ue->pucch_config_dedicated_nr[gNB_id].pucch_PowerControl;
P0_PUCCH_t *p_p0_pucch = calloc( 1, sizeof(P0_PUCCH_t));
p_p0_pucch->p0_PUCCH_Value = TST_P0_PUCCH_VALUE;
p_p0_pucch->p0_PUCCH_Id = 1;
power_config->p0_Set[0] = p_p0_pucch;
for (int i = 0; i < NUMBER_PUCCH_FORMAT_NR; i++) {
power_config->deltaF_PUCCH_f[i] = TST_DELTA_F + i;
}
ue->tx_power_max_dBm = TST_TX_POWER_MAX_DBM;
}
/*******************************************************************
*
* NAME : init_pucch_configuration
*
* PARAMETERS : none
*
* RETURN : none
*
* DESCRIPTION : set srs default configuration
*
*********************************************************************/
void common_pucch_configuration(PHY_VARS_NR_UE *ue, uint8_t gNB_id, int pucch_index_config)
{
printf("\nSet pucch common configuration \n");
for (int i = 0; i < MAX_NB_OF_PUCCH_RESOURCES; i++) {
ue->pucch_config_dedicated_nr[gNB_id].PUCCH_Resource[i] = NULL;
}
for (int i = 0; i < MAX_NB_OF_PUCCH_RESOURCE_SETS; i++) {
ue->pucch_config_dedicated_nr[gNB_id].PUCCH_ResourceSet[i] = NULL;
}
for (int i = 0; i < NUMBER_PUCCH_FORMAT_NR-1; i++) {
ue->pucch_config_dedicated_nr[gNB_id].formatConfig[i] = NULL;
}
ue->pucch_config_common_nr[gNB_id].pucch_ResourceCommon = pucch_index_config;
/* default number of pdsch code words */
ue->PDSCH_Config.maxNrofCodeWordsScheduledByDCI = nb_code_n1;
/* init of band width part for pucch */
ue->systemInformationBlockType1_nr.N_BWP_SIZE = TST_N_BWP_SIZE;
/* init default state */
ue->UE_mode[gNB_id] = PRACH;
}
/*******************************************************************
*
* NAME : test_pucch_basic_error
*
* PARAMETERS : none
*
* RETURN : none
*
* DESCRIPTION : test of PUCCH error cases
* in this case no transmission occurs
*
*********************************************************************/
int test_pucch_basic_error(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *proc)
{
int v_return = 0;
bool reset_harq = FALSE;
printf("%s", tst_separator);
ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->current_harq_pid = TST_DL_HARQ_PID_FIRST;
printf("\n => Test : No harq feedback on going\n");
common_pucch_configuration(ue, gNB_id, TST_PUCCH_COMMON_CONFIG_INDEX_KO);
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != FALSE) {
v_return = -1;
}
/* set a tx slot with no ack */
NR_UE_HARQ_STATUS_t *harq_status = &ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->harq_processes[TST_DL_HARQ_PID_FIRST]->harq_ack;
harq_status->slot_for_feedback_ack = proc->nr_tti_tx;
printf("\n => Test : Error due to acknownlegment not set \n");
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != FALSE) {
v_return = -1;
}
harq_status->ack = DL_ACK;
printf("\n => Test : Error due to DAI not set \n");
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != FALSE) {
v_return = -1;
}
printf("\n => Test : Error due to DAI at wrong value \n");
harq_status->vDAI_DL = NR_DL_MAX_DAI + 1;
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != FALSE) {
v_return = -1;
}
printf("\n => Test : Error due to ACK not ready to be send \n");
harq_status->vDAI_DL = 0;
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != FALSE) {
v_return = -1;
}
printf("\n => Test : Error due to invalid DAI value \n");
harq_status->send_harq_status = 1; /* ack ready to be send */
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != FALSE) {
v_return = -1;
}
common_pucch_configuration(ue, gNB_id, NB_INITIAL_PUCCH_RESOURCE);
printf("\n => Test : Error due to undefined PUCCH format from common config \n");
harq_status->vDAI_DL = 1;
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != FALSE) {
v_return = -1;
}
ue->n_connected_eNB = 2;
printf("\n => Test : Error due to PUCCH format with multiple cells not already implemented \n");
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != FALSE) {
v_return = -1;
}
ue->n_connected_eNB = 1;
return (v_return);
}
/*******************************************************************
*
* NAME : test_pucch_common_config_single_transport_block
*
* PARAMETERS : none
*
* RETURN : none
*
* DESCRIPTION : test of PUCCH from common configuration*
*
*********************************************************************/
int test_pucch_common_config_single_transport_block(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *proc)
{
int v_return = 0;
bool reset_harq = FALSE;
printf("%s", tst_separator);
common_pucch_configuration(ue, gNB_id, TST_PUCCH_COMMON_CONFIG_INDEX_OK);
/* set a tx slot with no ack */
NR_UE_HARQ_STATUS_t *harq_status = &ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->harq_processes[TST_DL_HARQ_PID_FIRST]->harq_ack;
harq_status->ack = DL_ACK;
printf("\n => Test : PUCCH format from common config in prach mode: one positive downlink ACKnowledgment \n");
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
v_return = -1;
}
harq_status->ack = DL_NACK;
printf("\n => Test : PUCCH format from common config in prach mode: one negative downlink ACKnowledgment \n");
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
v_return = -1;
}
/* switch ue mode after PRACH phase */
ue->UE_mode[gNB_id] = PUSCH;
/* set a second ack on a different downlink harq process */
ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->current_harq_pid = TST_DL_HARQ_PID_SECOND;
harq_status = &ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->harq_processes[TST_DL_HARQ_PID_SECOND]->harq_ack;
harq_status->n_CCE = 2;
harq_status->N_CCE = 4;
harq_status->pucch_resource_indicator = 1;
harq_status->send_harq_status = 1;
harq_status->vDAI_DL = 2;
harq_status->ack = DL_ACK;
harq_status->slot_for_feedback_ack = proc->nr_tti_tx;
printf("\n => Test : PUCCH format from common config in dedicated mode: two positive downlink ACKnowledgments \n");
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
v_return = -1;
}
harq_status->ack = DL_NACK;
printf("\n => Test : PUCCH format from common config in dedicated mode: one positive and one negative downlink ACKnowledgments \n");
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
v_return = -1;
}
ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->harq_processes[TST_DL_HARQ_PID_FIRST]->harq_ack.ack = DL_NACK;
printf("\n => Test : PUCCH format from common config in dedicated mode: two negative downlink ACKnowledgments \n");
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
v_return = -1;
}
harq_status->ack = DL_ACK;
reset_harq = TRUE;
printf("\n => Test : PUCCH format from common config in dedicated mode: no resource is found \n");
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != FALSE) {
v_return = -1;
}
printf("\n => Test : PUCCH format from common config in dedicated mode: no PUCCH after reset of pending harq ACKnowledgments \n");
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != FALSE) {
v_return = -1;
}
return (v_return);
}
/*******************************************************************
*
* NAME : init_pucch_dedicated_configuration
*
* PARAMETERS : none
*
* RETURN : none
*
* DESCRIPTION : initialisation of PUCCH from dedicated configuration
*
*********************************************************************/
void init_pucch_dedicated_configuration(PHY_VARS_NR_UE *ue, uint8_t gNB_id)
{
PUCCH_FormatConfig_t *p_format;
PUCCH_Resource_t *p_resource;
PUCCH_ResourceSet_t *p_resource_set;
int i,j;
/* set cell group parameters which are supported */
ue->cell_group_config.physicalCellGroupConfig.harq_ACK_SpatialBundlingPUCCH = FALSE;
ue->cell_group_config.physicalCellGroupConfig.pdsch_HARQ_ACK_Codebook = dynamic;
ue->PDSCH_ServingCellConfig.codeBlockGroupTransmission = NULL;
ue->PDSCH_ServingCellConfig.nrofHARQ_ProcessesForPDSCH = 8;
printf("\nSet default pucch dedicated configuration \n");
for (i = 0; i < NB_DL_DATA_TO_UL_ACK; i++) {
ue->pucch_config_dedicated_nr[gNB_id].dl_DataToUL_ACK[i] = i + NR_UE_CAPABILITY_SLOT_RX_TO_TX;
}
/* set configuration for format 1 to 4 */
for (i = 0; i < NUMBER_PUCCH_FORMAT_NR-1; i++) {
p_format = calloc( 1, sizeof(PUCCH_FormatConfig_t));
if (p_format == NULL) {
printf("Error of memory allocation : at line %d in function %s of file %s \n", LINE_FILE , __func__, __FILE__);
assert(0);
}
else {
//printf("Allocation %p \n", p_format);
p_format->interslotFrequencyHopping = feature_disabled;
p_format->additionalDMRS = disable_feature;
p_format->maxCodeRate = i;
p_format->nrofSlots = 1;
p_format->pi2PBSK = feature_disabled;
p_format->simultaneousHARQ_ACK_CSI = disable_feature;
}
ue->pucch_config_dedicated_nr[gNB_id].formatConfig[i] = p_format;
}
/* 4 resource set with 8 resources */
/* for set 0 only format 0 and 1 can be used */
const pucch_format_nr_t tst_pucch_format[TST_NB_RESOURCE_SET][TST_NB_RESOURCES_PER_SET] = {
/* set 0 */ { pucch_format0_nr, pucch_format1_nr, pucch_format0_nr, pucch_format1_nr, pucch_format0_nr, pucch_format1_nr, pucch_format0_nr, pucch_format1_nr},
/* set 1 */ { pucch_format2_nr, pucch_format3_nr, pucch_format4_nr, pucch_format2_nr, pucch_format3_nr, pucch_format4_nr, pucch_format2_nr, pucch_format3_nr},
/* set 2 */ { pucch_format2_nr, pucch_format3_nr, pucch_format4_nr, pucch_format2_nr, pucch_format3_nr, pucch_format4_nr, pucch_format2_nr, pucch_format3_nr},
/* set 3 */ { pucch_format3_nr, pucch_format3_nr, pucch_format4_nr, pucch_format3_nr, pucch_format3_nr, pucch_format4_nr, pucch_format3_nr, pucch_format3_nr},
};
/* from TS 38.331 The field is not present in the first set (Set0) since the maximum Size of Set0 is specified to be 3 bit. */
const int tst_max_payload[TST_NB_RESOURCE_SET] = { 1, 2, 4, 9 };
int counter_resource_id = 0;
/* create TST_NB_RESOURCE_SET resources set with resources according to test tables */
/* each resource set has TST_NB_RESOURCES_PER_SET resources */
for (i = 0; i < TST_NB_RESOURCE_SET; i++) {
p_resource_set = calloc( 1, sizeof(PUCCH_ResourceSet_t));
if (p_resource_set == NULL) {
printf("Error of memory allocation : at line %d in function %s of file %s \n", LINE_FILE , __func__, __FILE__);
assert(0);
}
else {
//printf("Allocation %p \n", p_resource_set);
p_resource_set->pucch_ResourceSetId = i;
p_resource_set->maxPayloadMinus1 = tst_max_payload[i];
/* create resources for format 0 to 4 */
for (j = 0; j < TST_NB_RESOURCES_PER_SET; j++) {
p_resource_set->pucch_resource_id[j] = counter_resource_id;
p_resource = calloc( 1, sizeof(PUCCH_Resource_t));
if (p_resource == NULL) {
//printf("Error of memory allocation : at line %d in function %s of file %s \n", LINE_FILE , __func__, __FILE__);
assert(0);
}
else {
//printf("Allocation %p \n", p_resource);
p_resource->format_parameters.format = tst_pucch_format[i][j];
p_resource->pucch_ResourceId = counter_resource_id;
p_resource->startingPRB = i+1;
p_resource->intraSlotFrequencyHopping = 0;
p_resource->secondHopPRB = 0;
p_resource->format_parameters.initialCyclicShift = i+2;
p_resource->format_parameters.timeDomainOCC = 0;
p_resource->format_parameters.nrofPRBs = j + i;
p_resource->format_parameters.occ_length = 0;
p_resource->format_parameters.occ_Index = 0;
switch(p_resource->format_parameters.format) {
case 0:
p_resource->format_parameters.nrofSymbols = 1;
break;
case 1:
p_resource->format_parameters.timeDomainOCC = 10+j;
p_resource->format_parameters.nrofSymbols = 4+j;
p_resource->format_parameters.timeDomainOCC = j%6;
break;
case 2:
p_resource->format_parameters.nrofSymbols = 2;
break;
case 3:
p_resource->format_parameters.nrofSymbols = 4+j;
break;
case 4:
p_resource->format_parameters.nrofSymbols = 4+j;
p_resource->format_parameters.occ_length = 10+j;
p_resource->format_parameters.occ_Index = 11+j;
break;
default:
LOG_E(PHY,"Unknown format : at line %d in function %s of file %s \n", LINE_FILE , __func__, __FILE__);
}
p_resource->format_parameters.startingSymbolIndex = i;
}
ue->pucch_config_dedicated_nr[gNB_id].PUCCH_Resource[counter_resource_id] = p_resource;
counter_resource_id++; /* next resource id */
}
}
if (i == 0) { /* this is the first resource set */
p_resource_set->first_resources_set_R_PUCCH = j;
}
for (; j < MAX_NB_OF_PUCCH_RESOURCES_PER_SET; j++) {
p_resource_set->pucch_resource_id[j] = MAX_NB_OF_PUCCH_RESOURCES;
ue->pucch_config_dedicated_nr[gNB_id].PUCCH_ResourceSet[i] = p_resource_set;
}
}
}
/*******************************************************************
*
* NAME : relase_pucch_dedicated_configuration
*
* PARAMETERS : none
*
* RETURN : none
*
* DESCRIPTION : release of PUCCH dedicated configuration
*
*********************************************************************/
void release_pucch_dedicated_configuration(PHY_VARS_NR_UE *ue, uint8_t gNB_id)
{
int i;
printf("\nRelease default pucch dedicated configuration \n");
/* release of resources set */
for (i = 0; i < MAX_NB_OF_PUCCH_RESOURCE_SETS; i++) {
if (ue->pucch_config_dedicated_nr[gNB_id].PUCCH_ResourceSet[i] != NULL) {
//printf("Free %p \n", ue->pucch_config_dedicated_nr[gNB_id].PUCCH_ResourceSet[i]);
free(ue->pucch_config_dedicated_nr[gNB_id].PUCCH_ResourceSet[i]);
}
}
/* release of resources */
for (i = 0; i < MAX_NB_OF_PUCCH_RESOURCES; i++) {
if (ue->pucch_config_dedicated_nr[gNB_id].PUCCH_Resource[i] != NULL) {
//printf("Free %p \n", ue->pucch_config_dedicated_nr[gNB_id].PUCCH_Resource[i]);
free(ue->pucch_config_dedicated_nr[gNB_id].PUCCH_Resource[i]);
}
}
/* release of format */
for (i = 0; i < NUMBER_PUCCH_FORMAT_NR-1; i++) {
if (ue->pucch_config_dedicated_nr[gNB_id].formatConfig[i] != NULL) {
//printf("Free %p \n", ue->pucch_config_dedicated_nr[gNB_id].formatConfig[i]);
free(ue->pucch_config_dedicated_nr[gNB_id].formatConfig[i]);
}
}
}
/*******************************************************************
*
* NAME : test_pucch_dedicated_single_transport_block
*
* PARAMETERS : ue context
* gNB identity
* current rx and tx time frame
*
* RETURN : none
*
* DESCRIPTION : test of PUCCH from dedicated configuration
* get DAI values from downlink harq and the generates
* acknownledgment with a PUCCH
*
*********************************************************************/
int test_pucch_dedicated_single_transport_block(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *proc)
{
#define TST_NB_STEP_SINGLE_TRANSPORT_BLOCK (4)
int v_return = 0;
int reset_harq = FALSE;
int dl_harq_pid[TST_NB_STEP_SINGLE_TRANSPORT_BLOCK] = {TST_DL_HARQ_PID_FIRST, TST_DL_HARQ_PID_SECOND, TST_DL_HARQ_PID_THIRD, TST_DL_HARQ_PID_FOURTH };
int pucch_resource_indicator[TST_NB_STEP_SINGLE_TRANSPORT_BLOCK][2] = { { 0, 5 }, { 1, 0 } , { 1, 3 } , { 5, 7 } };
NR_UE_HARQ_STATUS_t *harq_status;
ue->PDSCH_Config.maxNrofCodeWordsScheduledByDCI = nb_code_n1;
printf("%s", tst_separator);
ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->current_harq_pid = TST_DL_HARQ_PID_FIRST;
harq_status = &ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->harq_processes[TST_DL_HARQ_PID_FIRST]->harq_ack;
harq_status->slot_for_feedback_ack = proc->nr_tti_tx;
harq_status->send_harq_status = 1;
harq_status->vDAI_DL = 1;
harq_status->ack = DL_ACK;
harq_status->pucch_resource_indicator = MAX_PUCCH_RESOURCE_INDICATOR;
printf("\n => Test : PUCCH format from dedicated config : pucch resource indicator is invalid \n");
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != FALSE) {
v_return = -1;
}
for (int i = 0; i < TST_NB_STEP_SINGLE_TRANSPORT_BLOCK; i++) {
/* set a tx slot with no ack */
ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->current_harq_pid = dl_harq_pid[i];
NR_UE_HARQ_STATUS_t *harq_status = &ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->harq_processes[dl_harq_pid[i]]->harq_ack;
harq_status->slot_for_feedback_ack = proc->nr_tti_tx;
harq_status->send_harq_status = 1;
harq_status->vDAI_DL = i+1;
harq_status->ack = DL_ACK;
for (int j = 0 ; j < 2; j++) {
/* reset ack context on last test */
if ((i == (TST_NB_STEP_SINGLE_TRANSPORT_BLOCK-1)) && (j == 1)) {
reset_harq = TRUE;
}
harq_status->pucch_resource_indicator = pucch_resource_indicator[i][j];
printf("\n => Test : PUCCH format from dedicated config with 1 transport block : with %d downlink ACKnowledgments and pucch resource indicator %d \n", i+1, pucch_resource_indicator[i][j]);
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
v_return = -1;
}
}
}
/* Test with missed PDSCH */
/* some transport blocks have been missed and they need to be nack by UE in order to be retransmitted by the network */
int i;
for (i = 1; i < TST_NB_STEP_SINGLE_TRANSPORT_BLOCK; i = i+2) {
/* set a tx slot with no ack */
ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->current_harq_pid = dl_harq_pid[i];
NR_UE_HARQ_STATUS_t *harq_status = &ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->harq_processes[dl_harq_pid[i]]->harq_ack;
harq_status->slot_for_feedback_ack = proc->nr_tti_tx;
harq_status->send_harq_status = 1;
harq_status->vDAI_DL = i+1;
harq_status->ack = DL_ACK;
harq_status->pucch_resource_indicator = pucch_resource_indicator[i][0];
}
reset_harq = TRUE;
printf("\n => Test : PUCCH format from dedicated config with 1 transport block and missed PDSCH : with %d downlink ACKnowledgments and pucch resource indicator %d \n", i+1, pucch_resource_indicator[3][0]);
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
v_return = -1;
}
return (v_return);
}
/*******************************************************************
*
* NAME : test_pucch_dedicated_config_two_transport_blocks
*
* PARAMETERS : ue context
* gNB identity
* current rx and tx time frame
*
* RETURN : none
*
* DESCRIPTION : test of PUCCH from dedicated configuration
* get DAI values from downlink harq and the generates
* acknownledgment with a PUCCH
*
*********************************************************************/
int test_pucch_dedicated_two_transport_blocks(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *proc)
{
#define TST_NB_STEP_TWO_TRANSPORT_BLOCKS (4)
int v_return = 0;
int reset_harq = FALSE;
int dl_harq_pid[TST_NB_STEP_TWO_TRANSPORT_BLOCKS] = {TST_DL_HARQ_PID_FIRST, TST_DL_HARQ_PID_SECOND, TST_DL_HARQ_PID_THIRD, TST_DL_HARQ_PID_FOURTH };
int pucch_resource_indicator[TST_NB_STEP_TWO_TRANSPORT_BLOCKS][2] = { { 0, 1 }, { 3, 7 } , { 2 , 4 } , { 4 , 6 } };
NR_UE_HARQ_STATUS_t *harq_status;
int TB_identifier = 1;
int thread_number = TST_THREAD_ID;
ue->PDSCH_Config.maxNrofCodeWordsScheduledByDCI = nb_code_n2;
printf("%s", tst_separator);
/* create context for second transport block */
config_downlink_harq_process(ue , gNB_id, TB_identifier, thread_number, NR_DEFAULT_DLSCH_HARQ_PROCESSES);
for (int i = 0; i < TST_NB_STEP_TWO_TRANSPORT_BLOCKS; i++) {
for (int code_word = 0; code_word < 2; code_word++) {
ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][code_word]->Number_MCS_HARQ_DL_DCI = 2;
/* set a tx slot with no ack */
ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][code_word]->current_harq_pid = dl_harq_pid[i];
NR_UE_HARQ_STATUS_t *harq_status = &ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][code_word]->harq_processes[dl_harq_pid[i]]->harq_ack;
harq_status->slot_for_feedback_ack = proc->nr_tti_tx;
harq_status->send_harq_status = 1;
harq_status->vDAI_DL = i+1;
harq_status->ack = DL_ACK;
}
for (int j = 0 ; j < 2; j++) {
/* reset ack context on last test */
if ((i == (TST_NB_STEP_TWO_TRANSPORT_BLOCKS-1)) && (j == 1)) {
reset_harq = TRUE;
}
harq_status = &ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->harq_processes[dl_harq_pid[i]]->harq_ack;
harq_status->pucch_resource_indicator = pucch_resource_indicator[i][j];
printf("\n => Test : PUCCH format from dedicated config with 2 transport blocks : with %d downlink ACKnowledgments and pucch resource indicator %d \n", i+1, pucch_resource_indicator[i][j]);
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
printf("Test fail \n");
v_return = -1;
}
}
}
/* Test with missed PDSCH */
/* some transport blocks have been missed and they need to be nack by UE in order to be retransmitted by the network */
/* here first and third block receptions have been missed */
reset_harq = TRUE;
for (int i = 1; i < TST_NB_STEP_TWO_TRANSPORT_BLOCKS; i = i + 1) {
for (int code_word = 0; code_word < 2; code_word++) {
ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][code_word]->Number_MCS_HARQ_DL_DCI = 2;
/* set a tx slot with no ack */
ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][code_word]->current_harq_pid = dl_harq_pid[i];
NR_UE_HARQ_STATUS_t *harq_status = &ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][code_word]->harq_processes[dl_harq_pid[i]]->harq_ack;
harq_status->slot_for_feedback_ack = proc->nr_tti_tx;
harq_status->send_harq_status = 1;
harq_status->vDAI_DL = i+1;
harq_status->ack = DL_ACK;
for (int j = 0 ; j < 2; j++) {
harq_status = &ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->harq_processes[dl_harq_pid[i]]->harq_ack;
harq_status->pucch_resource_indicator = pucch_resource_indicator[i][j];
}
}
}
printf("\n => Test : PUCCH format from dedicated config with 2 transport blocks and 1 missed PDSCH : with %d downlink ACKnowledgments and pucch resource indicator %d \n", 4, pucch_resource_indicator[3][0]);
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
printf("Test fail \n");
v_return = -1;
}
printf("\n => Test : PUCCH format from dedicated config with 2 transport blocks and 2 missed PDSCH : with %d downlink ACKnowledgments and pucch resource indicator %d \n", 4, pucch_resource_indicator[3][0]);
for (int i = 1; i < TST_NB_STEP_TWO_TRANSPORT_BLOCKS; i = i + 2) {
for (int code_word = 0; code_word < 2; code_word++) {
ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][code_word]->Number_MCS_HARQ_DL_DCI = 2;
/* set a tx slot with no ack */
ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][code_word]->current_harq_pid = dl_harq_pid[i];
NR_UE_HARQ_STATUS_t *harq_status = &ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][code_word]->harq_processes[dl_harq_pid[i]]->harq_ack;
harq_status->slot_for_feedback_ack = proc->nr_tti_tx;
harq_status->send_harq_status = 1;
harq_status->vDAI_DL = i+1;
harq_status->ack = DL_ACK;
for (int j = 0 ; j < 2; j++) {
harq_status = &ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->harq_processes[dl_harq_pid[i]]->harq_ack;
harq_status->pucch_resource_indicator = pucch_resource_indicator[i][j];
}
}
}
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
printf("Test fail \n");
v_return = -1;
}
ue->PDSCH_Config.maxNrofCodeWordsScheduledByDCI = nb_code_n1; /* set to default value */
return (v_return);
}
/*******************************************************************
*
* NAME : tst_set_scheduling_request_configuration
*
* PARAMETERS : resource identity
* period and offset
*
* RETURN : none
*
* DESCRIPTION : set configuration of scheduling request
*
*********************************************************************/
void tst_set_scheduling_request_configuration (PHY_VARS_NR_UE *ue, int gNB_id, int sr_config_index, int resource_id, sr_periodicity_t periodicity, int offset)
{
SchedulingRequestResourceConfig_t *p_scheduling_request_config = calloc( 1, sizeof(SchedulingRequestResourceConfig_t));
p_scheduling_request_config->schedulingRequestResourceId = 0;
p_scheduling_request_config->schedulingRequestID = 0;
p_scheduling_request_config->resource = resource_id;
p_scheduling_request_config->periodicity = periodicity;
p_scheduling_request_config->offset = offset;
ue->scheduling_request_config_nr[gNB_id].sr_ResourceConfig[sr_config_index] = p_scheduling_request_config;
ue->scheduling_request_config_nr[gNB_id].active_sr_id = sr_config_index;
}
/*******************************************************************
*
* NAME : tst_free_scheduling_request_configuration
*
* PARAMETERS : resource identity
* period and offset
*
* RETURN : none
*
* DESCRIPTION : set configuration of scheduling request
*
*********************************************************************/
void tst_free_scheduling_request_configuration (PHY_VARS_NR_UE *ue, int gNB_id, int sr_config_index)
{
free(ue->scheduling_request_config_nr[gNB_id].sr_ResourceConfig[sr_config_index]);
ue->scheduling_request_config_nr[gNB_id].sr_ResourceConfig[sr_config_index] = NULL;
}
/*******************************************************************
*
* NAME : tst_ue_get_SR
*
* PARAMETERS : frameP is the sr payload
*
* RETURN : frameP is the sr payload
*
* DESCRIPTION : return payload of scheduling request
*
*********************************************************************/
uint32_t tst_ue_get_SR(module_id_t module_idP,int CC_id,frame_t frameP,uint8_t eNB_id,uint16_t rnti, sub_frame_t subframe)
{
VOID_PARAMETER module_idP;
VOID_PARAMETER CC_id;
VOID_PARAMETER frameP;
VOID_PARAMETER eNB_id;
VOID_PARAMETER subframe;
VOID_PARAMETER rnti;
return (tst_scheduling_request_payload);
}
/*******************************************************************
*
* NAME : tst_set_sr_config
*
* PARAMETERS : ue context
* gNB_id identity
*
* RETURN : none
*
* DESCRIPTION : set sr configuration
*
*********************************************************************/
void tst_set_sr_config(PHY_VARS_NR_UE *ue, int gNB_id) {
ue->mac_enabled = 1;
ue->scheduling_request_config[gNB_id].sr_ConfigIndex = 0;
p_nr_ue_get_SR = tst_ue_get_SR;
}
/*******************************************************************
*
* NAME : test_sr_dedicated
*
* PARAMETERS : ue context
* gNB identity
* current rx and tx time frame
*
* RETURN : none
*
* DESCRIPTION : test of PUCCH from dedicated configuration
* with scheduling request
*
*********************************************************************/
int test_sr_alone_dedicated(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *proc)
{
int v_return = 0;
int reset_harq = 0;
int sr_config_id = 0;
int sr_resource_id = 0;
int sr_offset = 0;
printf("%s", tst_separator);
tst_set_scheduling_request_configuration( ue, gNB_id, sr_config_id, sr_resource_id, sr_sl1, sr_offset);
tst_set_sr_config( ue, gNB_id);
printf("\n => Test : PUCCH format from dedicated config with only a negative scheduling request : no PUCCH should be generated \n");
tst_scheduling_request_payload = 0;
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != FALSE) {
printf("Test fail \n");
v_return = -1;
}
printf("\n => Test : PUCCH format 0 from dedicated config with only a positive scheduling request \n");
tst_scheduling_request_payload = 1;
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
printf("Test fail \n");
v_return = -1;
}
printf("\n => Test : PUCCH format 1 from dedicated config with only a positive scheduling request \n");
sr_resource_id = 1;
tst_set_scheduling_request_configuration( ue, gNB_id, sr_config_id, sr_resource_id, sr_sl1, sr_offset );
tst_scheduling_request_payload = 1;
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
printf("Test fail \n");
v_return = -1;
}
/* restore single transport block */
ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->Number_MCS_HARQ_DL_DCI = 1;
return (v_return);
}
/*******************************************************************
*
* NAME : test_sr_ack_dedicated
*
* PARAMETERS : ue context
* gNB identity
* current rx and tx time frame
*
* RETURN : none
*
* DESCRIPTION : test of PUCCH from dedicated configuration
* with scheduling request and acknowledgment
*
*********************************************************************/
int test_sr_ack_dedicated(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *proc)
{
int v_return = 0;
int reset_harq = 0;
int sr_config_id = 0;
int sr_resource_id = 0;
int sr_offset = 0;
int pucch_resource_indicator[5] = { 0, 1, 2, 3, 4 };
printf("%s", tst_separator);
tst_set_scheduling_request_configuration( ue, gNB_id, sr_config_id, sr_resource_id, sr_sl1, sr_offset);
tst_set_sr_config( ue, gNB_id);
printf("\n => Test : PUCCH format from dedicated config with a negative scheduling request and a positive ack \n");
/* set a first harq ack context */
NR_UE_HARQ_STATUS_t *harq_status;
ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->current_harq_pid = TST_DL_HARQ_PID_FIRST;
harq_status = &ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->harq_processes[TST_DL_HARQ_PID_FIRST]->harq_ack;
harq_status->slot_for_feedback_ack = proc->nr_tti_tx;
harq_status->send_harq_status = 1;
harq_status->vDAI_DL = 1;
harq_status->ack = DL_ACK;
harq_status->pucch_resource_indicator = pucch_resource_indicator[0];
tst_scheduling_request_payload = 0; /* set sr payload */
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
printf("Test fail \n");
v_return = -1;
}
printf("\n => Test : PUCCH format from dedicated config with a positive scheduling request and a positive ack \n");
tst_scheduling_request_payload = 1; /* set sr payload */
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
printf("Test fail \n");
v_return = -1;
}
printf("\n => Test : PUCCH format from dedicated config with a positive scheduling request and a positive ack \n");
harq_status->pucch_resource_indicator = pucch_resource_indicator[1];
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
printf("Test fail \n");
v_return = -1;
}
printf("\n => Test : PUCCH format from dedicated config with a positive scheduling request and two positive acks \n");
/* set a second harq ack context */
ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->current_harq_pid = TST_DL_HARQ_PID_SECOND;
harq_status = &ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->harq_processes[TST_DL_HARQ_PID_SECOND]->harq_ack;
harq_status->slot_for_feedback_ack = proc->nr_tti_tx;
harq_status->send_harq_status = 1;
harq_status->vDAI_DL = 2;
harq_status->ack = DL_ACK;
harq_status->pucch_resource_indicator = pucch_resource_indicator[0];
tst_scheduling_request_payload = 1; /* set sr payload */
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
printf("Test fail \n");
v_return = -1;
}
printf("\n => Test : PUCCH format from dedicated config with a positive scheduling request and two positive acks \n");
harq_status->pucch_resource_indicator = pucch_resource_indicator[1];
reset_harq = TRUE;
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
printf("Test fail \n");
v_return = -1;
}
tst_free_scheduling_request_configuration(ue, gNB_id, sr_config_id);
return (v_return);
}
/*******************************************************************
*
* NAME : test_csi_dedicated
*
* PARAMETERS : ue context
* gNB identity
* current rx and tx time frame
*
* RETURN : none
*
* DESCRIPTION : test of PUCCH from dedicated configuration
* with channel state information CSI
*
*********************************************************************/
int test_csi_dedicated(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *proc)
{
int v_return = 0;
int reset_harq = FALSE;
int sr_config_id = 0;
int sr_resource_id = 0;
int sr_offset = 0;
int pucch_resource_indicator[5] = { 0, 1, 2, 3, 4 };
printf("%s", tst_separator);
ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->current_harq_pid = NR_MAX_DLSCH_HARQ_PROCESSES;
set_csi_nr( 4, 0x0E );
printf("\n => Test : PUCCH format from dedicated config with CSI alone \n");
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
printf("Test fail \n");
v_return = -1;
}
printf("\n => Test : PUCCH format from dedicated config with ACK and CSI \n");
/* set a first harq ack context */
NR_UE_HARQ_STATUS_t *harq_status;
ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->current_harq_pid = TST_DL_HARQ_PID_FIRST;
harq_status = &ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->harq_processes[TST_DL_HARQ_PID_FIRST]->harq_ack;
harq_status->slot_for_feedback_ack = proc->nr_tti_tx;
harq_status->send_harq_status = 1;
harq_status->vDAI_DL = 1;
harq_status->ack = DL_ACK;
harq_status->pucch_resource_indicator = pucch_resource_indicator[3];
ue->pucch_config_dedicated_nr[gNB_id].formatConfig[2-1]->simultaneousHARQ_ACK_CSI = enable_feature; /* format 2 */
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
printf("Test fail \n");
v_return = -1;
}
printf("\n => Test : PUCCH format from dedicated config with ACK, negative SR and CSI \n");
tst_set_scheduling_request_configuration( ue, gNB_id, sr_config_id, sr_resource_id, sr_sl1, sr_offset);
tst_set_sr_config( ue, gNB_id);
tst_scheduling_request_payload = 0; /* set sr payload */
reset_harq = TRUE;
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
printf("Test fail \n");
v_return = -1;
}
printf("\n => Test : PUCCH format from dedicated config with negative SR and CSI \n");
harq_status->pucch_resource_indicator = pucch_resource_indicator[4];
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
printf("Test fail \n");
v_return = -1;
}
tst_scheduling_request_payload = 1;
printf("\n => Test : PUCCH format from dedicated config with positive SR and CSI \n");
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
printf("Test fail \n");
v_return = -1;
}
return (v_return);
}
/*******************************************************************
*
* NAME : test_pucch
*
* PARAMETERS : none
*
* RETURN : none
*
* DESCRIPTION : test of PUCCH feature
*
*********************************************************************/
int test_pucch(PHY_VARS_NR_UE *ue)
{
int gNB_id = TST_GNB_ID_0;
int thread_number = TST_THREAD_ID;
int TB_identifier = 0;
int v_return = 0;
UE_nr_rxtx_proc_t *proc = calloc( 1, sizeof(UE_nr_rxtx_proc_t));
if (proc == NULL) {
printf("Error test_srs: memory allocation problem p_rxtx_proc \n");
assert(0);
}
proc->frame_tx = 0;
proc->nr_tti_rx = 0;
proc->nr_tti_tx = (proc->nr_tti_rx + NR_UE_CAPABILITY_SLOT_RX_TO_TX)%(ue->frame_parms.ttis_per_subframe*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
init_pucch_power_configuration( ue, gNB_id);
/* init and clear downlink harq */
config_downlink_harq_process(ue , gNB_id, TB_identifier, thread_number, NR_DEFAULT_DLSCH_HARQ_PROCESSES);
if (test_pucch_basic_error(ue, gNB_id, proc) != 0) {
v_return = -1;
return (v_return);
}
if (test_pucch_common_config_single_transport_block(ue, gNB_id, proc) != 0) {
v_return = -1;
return (v_return);
}
init_pucch_dedicated_configuration(ue , gNB_id);
if (test_pucch_dedicated_single_transport_block(ue, gNB_id, proc) != 0) {
v_return = -1;
return (v_return);
}
if (test_pucch_dedicated_two_transport_blocks(ue, gNB_id, proc) != 0) {
v_return = -1;
return (v_return);
}
if (test_sr_alone_dedicated(ue, gNB_id, proc) != 0) {
v_return = -1;
return (v_return);
}
if (test_sr_ack_dedicated(ue, gNB_id, proc) != 0) {
v_return = -1;
return (v_return);
}
if (test_csi_dedicated(ue, gNB_id, proc) != 0) {
v_return = -1;
return (v_return);
}
release_downlink_harq_process(ue, gNB_id, TB_identifier, thread_number);
release_pucch_dedicated_configuration(ue , gNB_id);
free(proc);
return (v_return);
}
/*******************************************************************
*
* NAME : main
*
* DESCRIPTION : test of uplink sounding reference signal aka SRS feature
*
*********************************************************************/
int main(int argc, char *argv[])
{
uint8_t transmission_mode = 1;
uint8_t nb_antennas_tx = 1;
uint8_t nb_antennas_rx = 1;
uint8_t frame_type = FDD;
uint8_t N_RB_DL=100;
lte_prefix_type_t extended_prefix_flag = NORMAL;
int Nid_cell[] = {(3*1+3)};
VOID_PARAMETER argc;
VOID_PARAMETER argv;
printf(" PUCCH TEST \n");
printf("-----------\n");
if (init_test(nb_antennas_tx, nb_antennas_rx, transmission_mode, extended_prefix_flag, frame_type, Nid_cell[0], N_RB_DL) != 0) {
printf("Initialisation problem for test \n");
exit(-1);;
}
if (test_pucch(PHY_vars_UE) != 0) {
printf("\nTest PUCCH is fail \n");
}
else {
printf("\nTest PUCCH is pass \n");
}
free_context_synchro_nr();
return(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
*/
/**********************************************************************
*
* FILENAME : pbch_test.c
*
* MODULE : UE test bench for sss tests
*
* DESCRIPTION : it allows unitary tests for SSS on host machine
*
************************************************************************/
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include "../../unit_tests/src/pss_util_test.h"
#include "PHY/defs_nr_UE.h"
#include "PHY/INIT/init_extern.h"
#include "PHY/phy_extern_nr_ue.h"
#include "PHY/NR_REFSIG/ul_ref_seq_nr.h"
#include "PHY/NR_UE_TRANSPORT/srs_modulation_nr.h"
/*******************************************************************
*
* NAME : generate_reference_signals
*
* PARAMETERS : none
*
* RETURN : none
*
* DESCRIPTION : generate sequence of reference signals
*
*********************************************************************/
void generate_reference_signals(void)
{
int number_differencies = 0;;
int u, v, Msc_RS;
generate_ul_reference_signal_sequences(SHRT_MAX);
generate_ul_ref_sigs();
for (Msc_RS = 2; Msc_RS < 33; Msc_RS++) {
for (u=0; u < U_GROUP_NUMBER; u++) {
for (v=0; v < V_BASE_SEQUENCE_NUMBER; v++) {
int number_differencies = 0;
/* find index of table which is for this srs length */
unsigned int Msc_RS_index_nr = 0;
while((ul_allocated_re[Msc_RS_index_nr] != dftsizes[Msc_RS]) && (Msc_RS_index_nr < SRS_SB_CONF)){
Msc_RS_index_nr++;
}
if (Msc_RS_index_nr == SRS_SB_CONF) {
printf("No nr index found for length %d \n", dftsizes[Msc_RS]);
assert(0);
}
for (int n=0; n<ul_allocated_re[Msc_RS]; n++) {
if ((ul_ref_sigs[u][v][Msc_RS][2*n] != rv_ul_ref_sig[u][v][Msc_RS_index_nr][2*n])
|| (ul_ref_sigs[u][v][Msc_RS][2*n+1] != rv_ul_ref_sig[u][v][Msc_RS_index_nr][2*n+1])) {
number_differencies++;
}
}
}
if (number_differencies != 0) {
printf("Differencies for u %d v %d Msc_RS %d differencies %d \n", u, v, Msc_RS, number_differencies);
assert(0);
}
else {
//printf("no differencies for u %d v %d Msc_RS %d of size %d differencies %d \n", u, v, Msc_RS, dftsizes[Msc_RS], number_differencies);
}
}
}
printf("Ok: No detected differences for uplink reference sequences \n");
}
/*******************************************************************
*
* NAME : default_srs_configuration
*
* PARAMETERS : none
*
* RETURN : none
*
* DESCRIPTION : set srs default configuration
*
*********************************************************************/
void default_srs_configuration(NR_DL_FRAME_PARMS *frame_parms)
{
SRS_ResourceSet_t *p_srs_resource_set;
SRS_Resource_t *p_srs_resource;
p_srs_resource_set = calloc( 1, sizeof(SRS_ResourceSet_t));
if (p_srs_resource_set == NULL) {
printf("Error default_srs_configuration: memory allocation problem \n");
assert(0);
}
else {
frame_parms->srs_nr.active_srs_Resource_Set = 0;
frame_parms->srs_nr.number_srs_Resource_Set++;
frame_parms->srs_nr.p_SRS_ResourceSetList[0] = p_srs_resource_set;
}
p_srs_resource = calloc( 1, sizeof(SRS_Resource_t));
if (p_srs_resource == NULL) {
free(p_srs_resource_set);
printf("Error default_srs_configuration: memory allocation problem \n");
assert(0);
}
/* init resource */
p_srs_resource->nrof_SrsPorts = port1;
p_srs_resource->transmissionComb = 2; /* K_TC */
p_srs_resource->resourceMapping_nrofSymbols = 1;
p_srs_resource->resourceMapping_repetitionFactor = 1;
p_srs_resource->SRS_Periodicity = sr_sl4;
p_srs_resource->SRS_Offset = 3;
/* init resource set with only 1 resource */
p_srs_resource_set->resourceType = periodic;
p_srs_resource_set->number_srs_Resource++;
frame_parms->srs_nr.p_SRS_ResourceSetList[0]->p_srs_ResourceList[0] = p_srs_resource;
}
/*******************************************************************
*
* NAME : test_srs_single
*
* PARAMETERS : none
*
* RETURN : none
*
* DESCRIPTION : test of SRS feature
* for various combinations of parameters
*
*********************************************************************/
int test_srs_single(NR_DL_FRAME_PARMS *frame_parms,
int32_t *txptr,
UE_nr_rxtx_proc_t *proc)
{
SRS_Resource_t *p_SRS_Resource = frame_parms->srs_nr.p_SRS_ResourceSetList[0]->p_srs_ResourceList[0];
if (generate_srs_nr(frame_parms->srs_nr.p_SRS_ResourceSetList[0],
frame_parms,
txptr,
AMP,
proc) != 0) {
printf("Ok: test_srs_single for K_TC %d comboffset %d cyclicShift %d u %d B_SRS %d C_SRS %d n_shift %d n_RRC %d b_hop %d groupOrSequenceHopping %d "
" sequenceId %d l_offset %d \n",
p_SRS_Resource->transmissionComb, p_SRS_Resource->combOffset, p_SRS_Resource->cyclicShift, p_SRS_Resource->sequenceId,
p_SRS_Resource->freqHopping_b_SRS, p_SRS_Resource->freqHopping_c_SRS, p_SRS_Resource->freqDomainPosition,
p_SRS_Resource->freqDomainShift, p_SRS_Resource->freqHopping_b_hop, p_SRS_Resource->groupOrSequenceHopping,
p_SRS_Resource->sequenceId, p_SRS_Resource->resourceMapping_startPosition);
printf("Error: generate_srs_nr was not successfully executed ! \n");
return (-1);
}
else {
#if 1
printf("Ok: test_srs_single for K_TC %d comboffset %d cyclicShift %d u %d B_SRS %d C_SRS %d n_shift %d n_RRC %d b_hop %d groupOrSequenceHopping %d "
" sequenceId %d l_offset %d \n",
p_SRS_Resource->transmissionComb, p_SRS_Resource->combOffset, p_SRS_Resource->cyclicShift, p_SRS_Resource->sequenceId,
p_SRS_Resource->freqHopping_b_SRS, p_SRS_Resource->freqHopping_c_SRS, p_SRS_Resource->freqDomainPosition,
p_SRS_Resource->freqDomainShift, p_SRS_Resource->freqHopping_b_hop, p_SRS_Resource->groupOrSequenceHopping,
p_SRS_Resource->sequenceId, p_SRS_Resource->resourceMapping_startPosition);
#endif
return (0);
}
}
/*******************************************************************
*
* NAME : test_srs_periodicity
*
* PARAMETERS : none
*
* RETURN : none
*
* DESCRIPTION : test of SRS feature
* for various combinations of parameters
*
*********************************************************************/
int test_srs_periodicity(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc)
{
NR_DL_FRAME_PARMS *frame_parms = &(ue->frame_parms);
SRS_Resource_t *p_srs_resource = frame_parms->srs_nr.p_SRS_ResourceSetList[0]->p_srs_ResourceList[0];
for (int test_index = 0; test_index < NB_SRS_PERIOD; test_index++) {
p_srs_resource->SRS_Periodicity = test_index;
int srs_current_period = srs_period[p_srs_resource->SRS_Periodicity];
for (int offset = 0 ; offset < 2; offset++) {
if (offset == 0) {
p_srs_resource->SRS_Offset = 0;
}
else {
p_srs_resource->SRS_Offset = srs_current_period - 1;
}
printf("srs period %d offset %d \n", srs_current_period, p_srs_resource->SRS_Offset);
int duration = (10 * srs_current_period)/(NR_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->ttis_per_subframe);
for (int frame_tx = 0; frame_tx < duration; frame_tx++) {
for (int slot_tx = 0; slot_tx < (NR_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->ttis_per_subframe); slot_tx++) {
proc->frame_tx = frame_tx;
proc->nr_tti_tx = slot_tx;
if (ue_srs_procedure_nr( ue, proc, 0) == 0) {
printf("test_srs_periodicity srs at frame %d slot %d \n", frame_tx, slot_tx);
}
}
}
}
}
return(0);
}
/*******************************************************************
*
* NAME : test_srs_single
*
* PARAMETERS : none
*
* RETURN : none
*
* DESCRIPTION : test of SRS feature
* for various combinations of parameters
*
*********************************************************************/
int test_srs_specific(NR_DL_FRAME_PARMS *frame_parms,
int32_t *txptr,
UE_nr_rxtx_proc_t *proc)
{
#define NUMBER_TEST_PARAMETERS (12)
//#define SRS_TEST_HOPPING
#ifdef SRS_TEST_HOPPING
#define NUMBER_SRS_TEST (5)
#else
#define NUMBER_SRS_TEST (3)
#endif
SRS_Resource_t *p_SRS_Resource = frame_parms->srs_nr.p_SRS_ResourceSetList[0]->p_srs_ResourceList[0];
uint8_t test_parameters[NUMBER_SRS_TEST][NUMBER_TEST_PARAMETERS] = {
/* K_TC comboffset cyclicShift u B_SRS C_SRS n_shift b_hop n_RRC groupOrSequenceHopping sequenceId l_offset*/
{ 2, 0, 0, 0, 1, 3, 0, 3, 0, neitherHopping, 0, 0 },
{ 2, 0, 0, 0, 1, 3, 0, 3, 2, neitherHopping, 0, 1 },
{ 2, 0, 0, 0, 3, 3, 0, 1, 0, neitherHopping, 0, 0 },
#ifdef SRS_TEST_HOPPING
{ 2, 0, 0, 0, 1, 3, 0, 0, 0, groupHopping, 30, 0 },
{ 2, 0, 0, 0, 0, 14, 0, 0, 0, sequenceHopping, 55, 1 },
#endif
};
for (int test_index = 0; test_index < NUMBER_SRS_TEST; test_index++) {
p_SRS_Resource->transmissionComb = test_parameters[test_index][0]; /* K_TC */
p_SRS_Resource->combOffset = test_parameters[test_index][1];
p_SRS_Resource->cyclicShift = test_parameters[test_index][2];
p_SRS_Resource->sequenceId = test_parameters[test_index][3];
p_SRS_Resource->freqHopping_b_SRS = test_parameters[test_index][4];
p_SRS_Resource->freqHopping_c_SRS = test_parameters[test_index][5];
p_SRS_Resource->freqDomainPosition = test_parameters[test_index][6];
p_SRS_Resource->freqHopping_b_hop = test_parameters[test_index][7];
p_SRS_Resource->freqDomainShift = (uint16_t)test_parameters[test_index][8];
p_SRS_Resource->groupOrSequenceHopping = test_parameters[test_index][9];
p_SRS_Resource->sequenceId = test_parameters[test_index][10];
p_SRS_Resource->resourceMapping_startPosition = test_parameters[test_index][11];
if (test_srs_single(frame_parms,
txptr,
proc) != 0) {
return (-1);
}
}
return (0);
}
/*******************************************************************
*
* NAME : test_srs_group
*
* PARAMETERS : none
*
* RETURN : none
*
* DESCRIPTION : test of SRS feature
* for various combinations of parameters
*
*********************************************************************/
int test_srs_group(NR_DL_FRAME_PARMS *frame_parms,
int32_t *txptr,
UE_nr_rxtx_proc_t *proc)
{
SRS_Resource_t *p_SRS_Resource = frame_parms->srs_nr.p_SRS_ResourceSetList[0]->p_srs_ResourceList[0];
uint8_t n_SRS_cs_max[5] = { 0, 0, 8, 0, 12};
int number_of_test = 0;
for (int K_TC = 2; K_TC < 5; K_TC = K_TC + 2) {
for (int comboffset = 0; comboffset < K_TC; comboffset++) {
for (int cyclicShift = 0; cyclicShift < n_SRS_cs_max[K_TC]; cyclicShift++) {
for (int u = 0; u < U_GROUP_NUMBER; u++) {
for (uint8_t B_SRS = 0; B_SRS < B_SRS_NUMBER; B_SRS++) {
for (uint8_t C_SRS = 0; C_SRS < C_SRS_NUMBER; C_SRS++) {
p_SRS_Resource->transmissionComb = K_TC;
p_SRS_Resource->combOffset = comboffset;
p_SRS_Resource->cyclicShift = cyclicShift;
p_SRS_Resource->sequenceId = u;
p_SRS_Resource->freqHopping_b_SRS = B_SRS;
p_SRS_Resource->freqHopping_c_SRS = C_SRS;
number_of_test++;
if (test_srs_single(frame_parms, txptr, proc) != 0) {
return (-1);
}
}
}
}
}
}
}
printf("Number of srs generations %d\n", number_of_test);
return (0);
}
/*******************************************************************
*
* NAME : test_srs
*
* PARAMETERS : none
*
* RETURN : none
*
* DESCRIPTION : test of SRS feature
*
*********************************************************************/
int test_srs(PHY_VARS_NR_UE *PHY_vars_UE)
{
int32_t *txptr;
NR_DL_FRAME_PARMS *frame_parms = &(PHY_vars_UE->frame_parms);
UE_nr_rxtx_proc_t *p_rxtx_proc;
int v_return = 0;
generate_reference_signals();
/* start test of sounding reference signals */
default_srs_configuration(frame_parms);
txptr = calloc(frame_parms->samples_per_tti , sizeof(int32_t));
if (txptr == NULL) {
printf("Error test_srs: memory allocation problem txptr \n");
assert(0);
}
p_rxtx_proc = calloc( 1, sizeof(UE_nr_rxtx_proc_t));
if (p_rxtx_proc == NULL) {
printf("Error test_srs: memory allocation problem p_rxtx_proc \n");
assert(0);
}
if (test_srs_group(frame_parms,
txptr,
p_rxtx_proc) != 0) {
v_return = -1;
}
if (test_srs_specific(frame_parms,
txptr,
p_rxtx_proc) != 0) {
v_return = -1;
}
if (test_srs_periodicity(PHY_vars_UE, p_rxtx_proc) != 0) {
v_return = -1;
}
for (int i = 0; i < frame_parms->srs_nr.number_srs_Resource_Set; i++) {
if (frame_parms->srs_nr.p_SRS_ResourceSetList[i] != NULL) {
for (int j = 0; j < frame_parms->srs_nr.p_SRS_ResourceSetList[i]->number_srs_Resource; j++) {
if (frame_parms->srs_nr.p_SRS_ResourceSetList[0]->p_srs_ResourceList[0] != NULL) {
free(frame_parms->srs_nr.p_SRS_ResourceSetList[0]->p_srs_ResourceList[0]);
}
else {
printf("Error test_srs: memory allocation problem p_srs_ResourceList \n");
assert(0);
}
}
free(frame_parms->srs_nr.p_SRS_ResourceSetList[i]);
}
else {
printf("Error test_srs: memory allocation problem \n");
assert(0);
}
}
free(txptr);
free(p_rxtx_proc);
free_ul_reference_signal_sequences();
free_ul_ref_sigs();
return (v_return);
}
/*******************************************************************
*
* NAME : main
*
* DESCRIPTION : test of uplink sounding reference signal aka SRS feature
*
*********************************************************************/
int main(int argc, char *argv[])
{
uint8_t transmission_mode = 1;
uint8_t nb_antennas_tx = 1;
uint8_t nb_antennas_rx = 1;
uint8_t frame_type = FDD;
uint8_t N_RB_DL=100;
lte_prefix_type_t extended_prefix_flag = NORMAL;
int Nid_cell[] = {(3*0+0)};
VOID_PARAMETER argc;
VOID_PARAMETER argv;
printf(" SRS TEST \n");
printf("----------\n");
if (init_test(nb_antennas_tx, nb_antennas_rx, transmission_mode, extended_prefix_flag, frame_type, Nid_cell[0], N_RB_DL) != 0) {
printf("Initialisation problem for synchronisation test \n");
exit(-1);;
}
if (test_srs(PHY_vars_UE) != 0) {
printf("Test NR SRS is fail \n");
}
else {
printf("Test NR SRS is pass \n");
}
free_context_synchro_nr();
return(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
*/
/**********************************************************************
*
* FILENAME : sss_test.c
*
* MODULE : UE test bench for sss tests
*
* DESCRIPTION : it allows unitary tests for SSS on host machine
*
************************************************************************/
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include "../../unit_tests/src/pss_util_test.h"
#include "PHY/defs_nr_UE.h"
#include "PHY/INIT/init_extern.h"
#include "PHY/phy_extern_nr_ue.h"
#include "PHY/NR_REFSIG/ss_pbch_nr.h"
#include "PHY/NR_REFSIG/pss_nr.h"
#include "PHY/NR_REFSIG/sss_nr.h"
#include "PHY/NR_REFSIG/dmrs_nr.h"
/*******************************************************************
*
* NAME : test_synchro_pss_sss_nr
*
* INPUT : UE context
* for first and second pss sequence
* - position of pss in the received UE buffer
* - number of pss sequence
*
* RETURN : 0 if OK else error
*
* DESCRIPTION : detect pss sequences in the received UE buffer
* then detect sss sequence
*
* Test procedure:
* - reference pss sequences (first, second or both) are written at specific
* positions
* - correlation is done between the received buffer and the possible pss sequences
* - results indicate pss sequence number and correlation result
* - reference sss sequences are written at specific positions
* - correlation is done with possible sss sequence
*
* (10 ms)
* <--------------------------------------------------------------------------->
* -----------------------------------------------------------------------------
* | Received UE data buffer |
* ----------------------------------------------------------------------------
* ---------------------------------------------
* <-------------->| pss | pbch | sss | pbch |
* ---------------------------------------------
* offset
*
* SSS/PBCH block contains following symbols: pss + pbch + sss + pbch
*
*********************************************************************/
int test_synchro_pss_sss_nr(PHY_VARS_NR_UE *PHY_vars_UE, int position_symbol, NR_DL_FRAME_PARMS *frame_parms_gNB, test_t *test)
{
VOID_PARAMETER test;
int synchro_position;
int offset;
int16_t *tmp;
int32_t metric_fdd_ncp=0;
uint8_t phase_fdd_ncp;
int rate_change = SYNCHRO_RATE_CHANGE_FACTOR;
int Nid2 = GET_NID2(frame_parms_gNB->Nid_cell);
int Nid1 = GET_NID1(frame_parms_gNB->Nid_cell);
display_test_configuration_pss(position_symbol, Nid2);
set_sequence_pss(PHY_vars_UE, position_symbol, Nid2);
synchro_position = pss_synchro_nr(PHY_vars_UE, rate_change);
display_test_configuration_sss(Nid1);
synchro_position = synchro_position * rate_change;
if (abs(synchro_position - position_symbol) > PSS_DETECTION_MARGIN_MAX)
{
printf("NR Pss has been detected at position %d instead of %d \n", synchro_position, position_symbol);
}
/* symbols order for synchronisation block is PSS - PBCH - SSS */
/* knowing that synchronisation position gives pss ofdm start one can deduce start of sss symbol */
offset = (position_symbol + (SSS_SYMBOL_NB - PSS_SYMBOL_NB)*(PHY_vars_UE->frame_parms.ofdm_symbol_size + PHY_vars_UE->frame_parms.nb_prefix_samples));
tmp = (int16_t *)&PHY_vars_UE->common_vars.rxdata[0][offset];
insert_sss_nr(tmp, frame_parms_gNB);
PHY_vars_UE->rx_offset = position_symbol; /* offset is given for samples of type int16 */
#if 0
int samples_for_frame = PHY_vars_UE->frame_parms.samples_per_frame;
write_output("rxdata0_rand.m","rxd0_rand", &PHY_vars_UE->common_vars.rxdata[0][0], samples_for_frame, 1, 1);
#endif
#if TEST_SYNCHRO_TIMING_PSS
start_meas(&generic_time[TIME_SSS]);
#endif
rx_sss_nr(PHY_vars_UE, &metric_fdd_ncp, &phase_fdd_ncp);
#if TEST_SYNCHRO_TIMING_PSS
stop_meas(&generic_time[TIME_SSS]);
#ifndef NR_UNIT_TEST
printf("PSS execution duration %5.2f \n", generic_time[TIME_PSS].p_time/(cpuf*1000.0));
printf("SSS execution duration %5.2f \n", generic_time[TIME_SSS].p_time/(cpuf*1000.0));
#endif
#endif
return phase_fdd_ncp;
}
/*******************************************************************
*
* NAME : main
*
* DESCRIPTION : test bench for synchronisation sequence (pss/sss/pbch)
* purpose of test is to check that synchronisation sequence can be
* properly detected depending of input waveforms.
*
* - First step of synchronisation consists in pss search (primary synchronisation signal).
* pss sequence should be detected at the right position
* in the received buffer whatever the position along the
* received data buffer.
* Detection of position is based on correlation in time domain between
* received signal and pss sequence -> position is given by
* peak of correlation result.
* - Second step of synchronisation is sss decoding (secundary synchronisation signal).
* sss detection is based on position of detected pss.
*
*********************************************************************/
int main(int argc, char *argv[])
{
VOID_PARAMETER argc;
VOID_PARAMETER argv;
uint8_t transmission_mode = 1;
uint8_t nb_antennas_tx = 1;
uint8_t nb_antennas_rx = 1;
uint8_t frame_type = FDD;
uint8_t N_RB_DL=100;
lte_prefix_type_t extended_prefix_flag = NORMAL;
int phase;
int Nid1, Nid2;
NR_DL_FRAME_PARMS frame_parms_gNB;
const char *name_test = "SSS NR";
test_t test = { name_test, 0, 0, 0, 0};
#if 1
int test_position[] = { 0, 492, 493, 56788, 111111, 222222 }; /* this is the sample number in the frame */
#else
int test_position[] = {-1}; /* to get samples from an array */
#endif
int size_test_position = sizeof(test_position)/sizeof(int);
/* this is a pointer to the function in charge of the test */
int (*p_test_synchro_pss_sss)(PHY_VARS_NR_UE *PHY_vars_UE, int position_symbol, NR_DL_FRAME_PARMS *frame_parms, test_t *test) = test_synchro_pss_sss_nr;
#if 1
int Nid_cell[] = { (3*0+0), (3*71+0), (3*21+2), (3*21+2), (3*55+1), (3*111+2) };
#else
int Nid_cell[] = { ((3*1+2)) };
#endif
printf(" SSS TEST \n");
printf("----------\n");
if (init_test(nb_antennas_tx, nb_antennas_rx, transmission_mode, extended_prefix_flag, frame_type, Nid_cell[0], N_RB_DL) != 0) {
printf("Initialisation problem for synchronisation test \n");
exit(-1);;
}
memcpy((void *)&frame_parms_gNB, (void*)&PHY_vars_UE->frame_parms, sizeof(NR_DL_FRAME_PARMS));
printf("***********************************\n");
printf(" %s Test synchronisation \n", test.test_current);
printf("***********************************\n");
for (unsigned int index = 0; index < (sizeof(Nid_cell)/sizeof(int)); index++) {
frame_parms_gNB.Nid_cell = Nid_cell[index];
Nid2 = GET_NID2(Nid_cell[index]);
Nid1 = GET_NID1(Nid_cell[index]);
for (int position = 0; position < size_test_position; position++) {
PHY_vars_UE->frame_parms.Nid_cell = (3 * N_ID_1_NUMBER) + N_ID_2_NUMBER; /* set to invalid value */
phase = (*p_test_synchro_pss_sss)(PHY_vars_UE, test_position[position], &frame_parms_gNB, &test); /* return phase index which gives phase error from an array */
test.number_of_tests++;
printf("%s ", test.test_current);
if (PHY_vars_UE->frame_parms.Nid_cell == (3 * Nid1) + Nid2) {
if (phase != INDEX_NO_PHASE_DIFFERENCE) {
printf("Test is pass with warning due to phase difference %d (instead of %d) offset %d Nid1 %d Nid2 %d \n",
phase, INDEX_NO_PHASE_DIFFERENCE, test_position[position], Nid1, Nid2);
test.number_of_pass_warning++;
} else {
printf("Test is pass with offset %d Nid1 %d Nid2 %d \n", test_position[position], Nid1, Nid2);
test.number_of_pass++;
}
}
else {
printf("Test is fail with offset %d Nid1 %d Nid2 %d \n", test_position[position], Nid1, Nid2);
test.number_of_fail++;
}
//break;
}
//break;
}
printf("\n%s Number of tests : %d Pass : %d Pass with warning : %d Fail : %d \n", test.test_current, test.number_of_tests, test.number_of_pass, test.number_of_pass_warning, test.number_of_fail);
printf("%s Synchronisaton test is terminated.\n\n", test.test_current);
/* reset test statistics */
test.number_of_tests = test.number_of_pass = test.number_of_pass_warning = test.number_of_fail = 0;
free_context_synchro_nr();
return(0);
}
......@@ -388,8 +388,8 @@ static __inline__ uint64_t rdtsc(void) {
extern double cpuf;
static inline uint64_t checkTCPU(int timeout, char * file, int line) {
static uint64_t __thread lastCPUTime=0;
static uint64_t __thread last=0;
static __thread uint64_t lastCPUTime=0;
static __thread uint64_t last=0;
uint64_t cur=rdtsc();
struct timespec CPUt;
clock_gettime(CLOCK_THREAD_CPUTIME_ID, &CPUt);
......@@ -408,7 +408,7 @@ static inline uint64_t checkTCPU(int timeout, char * file, int line) {
}
static inline unsigned long long checkT(int timeout, char * file, int line) {
static unsigned long long __thread last=0;
static __thread unsigned long long last=0;
unsigned long long cur=rdtsc();
int microCycles=(int)(cpuf*1000);
int duration=(int)((cur-last)/microCycles);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment