From 69b79efe502c9fd1422e5364facf434965a7e2e7 Mon Sep 17 00:00:00 2001 From: hardy Date: Tue, 26 Oct 2021 13:58:19 +0200 Subject: [PATCH 001/113] change eNB ID for the different test config --- .../enb.band38.lte_2x2.100PRB.usrpn310.conf | 281 ++++++++++++++++++ .../enb.band38.nsa_2x2.100PRB.usrpn310.conf | 2 +- ci-scripts/xml_files/fr1_lte_2x2_quectel.xml | 2 +- 3 files changed, 283 insertions(+), 2 deletions(-) create mode 100644 ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf diff --git a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf new file mode 100644 index 0000000000..d2e91fb872 --- /dev/null +++ b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf @@ -0,0 +1,281 @@ +Active_eNBs = ( "eNB-Eurecom-B38"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe02; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB-Eurecom-B38"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ( { mcc = 208; mnc = 97; mnc_length = 2; } ); + + tr_s_preference = "local_mac" + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "3GPP_eNODEB"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "TDD"; + tdd_config = 1; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 38; + downlink_frequency = 2605000000L; + nr_scg_ssb_freq = 624608; + uplink_frequency_offset = 0; + Nid_cell = 0; + N_RB_DL = 100; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 2; + nb_antennas_rx = 2; + tx_gain = 90; + rx_gain = 125; + pbch_repetition = "FALSE"; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 0; + pucch_nCS_AN = 0; + pucch_n1_AN = 0; + pdsch_referenceSignalPower = -29; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -96; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -104; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -108; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + ue_TransmissionMode = 1; + + //Parameters for SIB18 + rxPool_sc_CP_Len = "normal"; + rxPool_sc_Period = "sf40"; + rxPool_data_CP_Len = "normal"; + rxPool_ResourceConfig_prb_Num = 20; + rxPool_ResourceConfig_prb_Start = 5; + rxPool_ResourceConfig_prb_End = 44; + rxPool_ResourceConfig_offsetIndicator_present = "prSmall"; + rxPool_ResourceConfig_offsetIndicator_choice = 0; + rxPool_ResourceConfig_subframeBitmap_present = "prBs40"; + rxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "00000000000000000000"; + rxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5; + rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0; +/* rxPool_dataHoppingConfig_hoppingParameter = 0; + rxPool_dataHoppingConfig_numSubbands = "ns1"; + rxPool_dataHoppingConfig_rbOffset = 0; + rxPool_commTxResourceUC-ReqAllowed = "TRUE"; +*/ + // Parameters for SIB19 + discRxPool_cp_Len = "normal" + discRxPool_discPeriod = "rf32" + discRxPool_numRetx = 1; + discRxPool_numRepetition = 2; + discRxPool_ResourceConfig_prb_Num = 5; + discRxPool_ResourceConfig_prb_Start = 3; + discRxPool_ResourceConfig_prb_End = 21; + discRxPool_ResourceConfig_offsetIndicator_present = "prSmall"; + discRxPool_ResourceConfig_offsetIndicator_choice = 0; + discRxPool_ResourceConfig_subframeBitmap_present = "prBs40"; + discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "f0ffffffff"; + discRxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5; + discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0; + + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + enable_measurement_reports = "no"; + + ///X2 + enable_x2 = "yes"; + t_reloc_prep = 1000; /* unit: millisecond */ + tx2_reloc_overall = 2000; /* unit: millisecond */ + t_dc_prep = 1000; /* unit: millisecond */ + t_dc_overall = 2000; /* unit: millisecond */ + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "eno1"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "CI_ENB_IP_ADDR"; + ENB_INTERFACE_NAME_FOR_S1U = "eno1"; + ENB_IPV4_ADDRESS_FOR_S1U = "CI_ENB_IP_ADDR"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + ENB_IPV4_ADDRESS_FOR_X2C = "CI_ENB_IP_ADDR"; + ENB_PORT_FOR_X2C = 36422; # Spec 36422 + }; + } +); + +MACRLCs = ( + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + phy_test_mode = 0; + scheduler_mode = "fairRR"; + bler_target_upper = 20.0; + bler_target_lower = 10.0; + max_ul_rb_index = 27; + puSch10xSnr = 200; + puCch10xSnr = 150; + } +); + +L1s = ( + { + num_cc = 1; + tr_n_preference = "local_mac"; + prach_dtx_threshold = 200; + pucch1_dtx_threshold = 5 + pucch1ab_dtx_threshold =0; + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 2 + nb_rx = 2 + att_tx = 0 + att_rx = 0; + bands = [38]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 75; + eNB_instances = [0]; + sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.2"; + + } +); + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + +NETWORK_CONTROLLER : +{ + FLEXRAN_ENABLED = "no"; + FLEXRAN_INTERFACE_NAME = "lo"; + FLEXRAN_IPV4_ADDRESS = "127.0.0.1"; + FLEXRAN_PORT = 2210; + FLEXRAN_CACHE = "/mnt/oai_agent_cache"; + FLEXRAN_AWAIT_RECONF = "no"; +}; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + diff --git a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf index 3460b82ac5..7a9df04996 100644 --- a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf @@ -6,7 +6,7 @@ eNBs = ( { ////////// Identification parameters: - eNB_ID = 0xe00; + eNB_ID = 0xe05; cell_type = "CELL_MACRO_ENB"; diff --git a/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml b/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml index 86d9e5d5f0..03d474aef0 100644 --- a/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml @@ -59,7 +59,7 @@ Initialize_eNB Initialize eNB - -O ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf --usrp-tx-thread-config 1 --thread-pool 0,2,4,6 + -O ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf --usrp-tx-thread-config 1 --thread-pool 0,2,4,6 0 0 lte From ac31ef5622d72789106fe845b511a60f609bf000 Mon Sep 17 00:00:00 2001 From: hardy Date: Wed, 27 Oct 2021 10:24:06 +0200 Subject: [PATCH 002/113] push DL to 60Mb in NSA --- ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml | 4 ++-- ci-scripts/xml_files/fr1_nsa_quectel.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml index 12a6186403..8ed4d4486e 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml @@ -113,8 +113,8 @@ Iperf - iperf (DL/20Mbps/UDP)(60 sec)(single-ue profile) - -u -b 20M -t 60 + iperf (DL/60Mbps/UDP)(60 sec)(single-ue profile) + -u -b 60M -t 60 DL nrmodule2_quectel 5 diff --git a/ci-scripts/xml_files/fr1_nsa_quectel.xml b/ci-scripts/xml_files/fr1_nsa_quectel.xml index 6c11a66d91..2d0ff53525 100644 --- a/ci-scripts/xml_files/fr1_nsa_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_quectel.xml @@ -110,8 +110,8 @@ Iperf - iperf (DL/20Mbps/UDP)(60 sec)(single-ue profile) - -u -b 20M -t 60 + iperf (DL/60Mbps/UDP)(60 sec)(single-ue profile) + -u -b 60M -t 60 DL idefix 3 From 9aab2b73b272d72c7c5ee1d91a37631c18caeb08 Mon Sep 17 00:00:00 2001 From: hardy Date: Wed, 27 Oct 2021 16:05:18 +0200 Subject: [PATCH 003/113] tentative : change eNB ID again --- ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf index 7a9df04996..4a9fd780b7 100644 --- a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf @@ -6,7 +6,7 @@ eNBs = ( { ////////// Identification parameters: - eNB_ID = 0xe05; + eNB_ID = 0xe06; cell_type = "CELL_MACRO_ENB"; From 2f30123fc27365d4b39fa474fc1c6e7b123df3d2 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sun, 31 Oct 2021 07:44:25 +0100 Subject: [PATCH 004/113] testing up to mcs 28 --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 8 ++++---- openair2/GNB_APP/MACRLC_nr_paramdef.h | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 11 ++++++----- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 2 +- openair2/RRC/NR/rrc_gNB.c | 2 +- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 96842426f5..88ab5a19a8 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -426,8 +426,8 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_confidence_level = no_conf ? 1 : 0; uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(1); uci_pdu->harq->harq_list[0].harq_value = index&0x01; - LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n", - frame,slot,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,10*log10((double)sigenergy),gNB->ulsch_stats[0].sync_pos); + LOG_I(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d SR_flag %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n", + frame,slot,uci_pdu->harq->harq_list[0].harq_value,pucch_pdu->sr_flag,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,10*log10((double)sigenergy),gNB->ulsch_stats[0].sync_pos); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); uci_pdu->sr->sr_indication = (index>1) ? 1 : 0; @@ -443,8 +443,8 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2); uci_pdu->harq->harq_list[1].harq_value = index&0x01; uci_pdu->harq->harq_list[0].harq_value = (index>>1)&0x01; - LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n", - frame,slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,gNB->ulsch_stats[0].sync_pos); + LOG_I(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d SR_flag %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n", + frame,slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,pucch_pdu->sr_flag,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,gNB->ulsch_stats[0].sync_pos); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); uci_pdu->sr->sr_indication = (index>3) ? 1 : 0; diff --git a/openair2/GNB_APP/MACRLC_nr_paramdef.h b/openair2/GNB_APP/MACRLC_nr_paramdef.h index f014e737a4..861d20bdd5 100644 --- a/openair2/GNB_APP/MACRLC_nr_paramdef.h +++ b/openair2/GNB_APP/MACRLC_nr_paramdef.h @@ -96,7 +96,7 @@ {CONFIG_STRING_MACRLC_DL_BLER_TARGET_UPPER, "Upper threshold of BLER to decrease DL MCS", 0, dblptr:NULL, defdblval:0.15, TYPE_DOUBLE, 0}, \ {CONFIG_STRING_MACRLC_DL_BLER_TARGET_LOWER, "Lower threshold of BLER to increase DL MCS", 0, dblptr:NULL, defdblval:0.05, TYPE_DOUBLE, 0}, \ {CONFIG_STRING_MACRLC_DL_RD2_BLER_THRESHOLD, "Threshold of RD2/RETX2 BLER to decrease DL MCS", 0, dblptr:NULL, defdblval:0.01, TYPE_DOUBLE, 0}, \ -{CONFIG_STRING_MACRLC_DL_MAX_MCS, "Maximum DL MCS that should be used", 0, u8ptr:NULL, defintval:20, TYPE_UINT8, 0}, \ +{CONFIG_STRING_MACRLC_DL_MAX_MCS, "Maximum DL MCS that should be used", 0, u8ptr:NULL, defintval:28, TYPE_UINT8, 0}, \ } #define MACRLC_CC_IDX 0 #define MACRLC_TRANSPORT_N_PREFERENCE_IDX 1 diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index bda151f938..7850056289 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -410,13 +410,13 @@ int get_mcs_from_bler(module_id_t mod_id, int CC_id, frame_t frame, sub_frame_t const uint8_t old_mcs = bler_stats->mcs; const NR_mac_stats_t *stats = &nrmac->UE_info.mac_stats[UE_id]; const int dret3x = stats->dlsch_rounds[3] - bler_stats->dlsch_rounds[3]; - if (dret3x > 0) { + if (0/*dret3x > 0*/) { /* if there is a third retransmission, decrease MCS for stabilization and * restart averaging window to stabilize transmission */ bler_stats->last_frame_slot = now; bler_stats->mcs = max(9, bler_stats->mcs - 1); memcpy(bler_stats->dlsch_rounds, stats->dlsch_rounds, sizeof(stats->dlsch_rounds)); - LOG_I(MAC, "%4d.%2d: %d retx in 3rd round, setting MCS to %d and restarting window\n", frame, slot, dret3x, bler_stats->mcs); + LOG_D(MAC, "%4d.%2d: %d retx in 3rd round, setting MCS to %d and restarting window\n", frame, slot, dret3x, bler_stats->mcs); return bler_stats->mcs; } if (diff < BLER_UPDATE_FRAME * n) @@ -434,20 +434,21 @@ int get_mcs_from_bler(module_id_t mod_id, int CC_id, frame_t frame, sub_frame_t int new_mcs = old_mcs; /* first ensure that number of 2nd retx is below threshold. If this is the * case, use 1st retx to adjust faster */ + /* if (bler_stats->rd2_bler > nrmac->dl_rd2_bler_threshold && old_mcs > 6) { new_mcs -= 2; - } else if (bler_stats->rd2_bler < nrmac->dl_rd2_bler_threshold) { + } else if (bler_stats->rd2_bler < nrmac->dl_rd2_bler_threshold) {*/ if (bler_stats->bler < nrmac->dl_bler_target_lower && old_mcs < nrmac->dl_max_mcs && dtx > 9) new_mcs += 1; else if (bler_stats->bler > nrmac->dl_bler_target_upper && old_mcs > 6) new_mcs -= 1; // else we are within threshold boundaries - } + /*}*/ bler_stats->last_frame_slot = now; bler_stats->mcs = new_mcs; memcpy(bler_stats->dlsch_rounds, stats->dlsch_rounds, sizeof(stats->dlsch_rounds)); - LOG_I(MAC, "%4d.%2d MCS %d -> %d (dtx %d, dretx %d, BLER wnd %.3f avg %.6f, dretx2 %d, RD2 BLER wnd %.3f avg %.6f)\n", + LOG_D(MAC, "%4d.%2d MCS %d -> %d (dtx %d, dretx %d, BLER wnd %.3f avg %.6f, dretx2 %d, RD2 BLER wnd %.3f avg %.6f)\n", frame, slot, old_mcs, new_mcs, dtx, dretx, bler_window, bler_stats->bler, dretx2, rd2_bler_wnd, bler_stats->rd2_bler); return new_mcs; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index f2ce8498fd..2692cac4c9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1103,7 +1103,7 @@ void handle_nr_uci_pucch_0_1(module_id_t mod_id, // tpc (power control) only if we received AckNack or positive SR. For a // negative SR, the UE won't have sent anything, and the SNR is not valid - if (((uci_01->pduBitmap >> 1) & 0x1) || sched_ctrl->SR) { + if (((uci_01->pduBitmap >> 1) & 0x1) ) { if ((uci_01->harq) && (uci_01->harq->harq_confidence_level==0)) sched_ctrl->tpc1 = nr_get_tpc(RC.nrmac[mod_id]->pucch_target_snrx10, uci_01->ul_cqi, 30); else sched_ctrl->tpc1 = 3; sched_ctrl->pucch_snrx10 = uci_01->ul_cqi * 5 - 640; diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 655e6973a1..ee924c7a58 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -1043,7 +1043,7 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( DRB_config->pdcp_Config->moreThanOneRLC = NULL; DRB_config->pdcp_Config->t_Reordering = calloc(1, sizeof(*DRB_config->pdcp_Config->t_Reordering)); - *DRB_config->pdcp_Config->t_Reordering = NR_PDCP_Config__t_Reordering_ms750; + *DRB_config->pdcp_Config->t_Reordering = NR_PDCP_Config__t_Reordering_ms0; DRB_config->pdcp_Config->ext1 = NULL; if (rrc->security.do_drb_integrity) { From 1263074f59044b12c76282fae1cb1d5b868891f0 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Mon, 1 Nov 2021 23:16:01 +0100 Subject: [PATCH 005/113] log removal --- openair1/PHY/CODING/crc_byte.c | 4 ++-- .../PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c | 2 +- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 4 ++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/openair1/PHY/CODING/crc_byte.c b/openair1/PHY/CODING/crc_byte.c index d85d72d2bc..987f692a32 100644 --- a/openair1/PHY/CODING/crc_byte.c +++ b/openair1/PHY/CODING/crc_byte.c @@ -167,7 +167,7 @@ unsigned int crc24a (unsigned char * inptr, return crc; #else return crc32_calc_pclmulqdq(inptr, octetlen, 0, - <e_crc24a_pclmulqdq) >> 8; + <e_crc24a_pclmulqdq); #endif } @@ -201,7 +201,7 @@ unsigned int crc24b (unsigned char * inptr, return crc; #else return crc32_calc_pclmulqdq(inptr, octetlen, 0, - <e_crc24b_pclmulqdq) >> 8; + <e_crc24b_pclmulqdq); #endif } diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c index 56a28822f2..57643a1bd8 100644 --- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c +++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c @@ -38,7 +38,7 @@ #include "common/utils/LOG/log.h" #include "PHY/TOOLS/time_meas.h" #include "openair1/PHY/CODING/nrLDPC_defs.h" -#define DEBUG_LDPC +//#define DEBUG_LDPC #include "ldpc_encode_parity_check.c" #include "ldpc_generate_coefficient.c" diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 9923579f1a..9b14781062 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -426,7 +426,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_confidence_level = no_conf ? 1 : 0; uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(1); uci_pdu->harq->harq_list[0].harq_value = index&0x01; - LOG_I(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d SR_flag %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n", + LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d SR_flag %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n", frame,slot,uci_pdu->harq->harq_list[0].harq_value,pucch_pdu->sr_flag,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,10*log10((double)sigenergy),gNB->ulsch_stats[0].sync_pos); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); @@ -443,7 +443,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2); uci_pdu->harq->harq_list[1].harq_value = index&0x01; uci_pdu->harq->harq_list[0].harq_value = (index>>1)&0x01; - LOG_I(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d SR_flag %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n", + LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d SR_flag %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n", frame,slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,pucch_pdu->sr_flag,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,gNB->ulsch_stats[0].sync_pos); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 109976f518..6f9115f58c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -956,7 +956,7 @@ void nr_schedule_ue_spec(module_id_t module_id, harq->is_waiting = true; UE_info->mac_stats[UE_id].dlsch_rounds[harq->round]++; - LOG_I(NR_MAC, + LOG_D(NR_MAC, "%4d.%2d [DLSCH/PDSCH/PUCCH] UE %d RNTI %04x DCI L %d start %3d RBs %3d startSymbol %2d nb_symbol %2d dmrspos %x MCS %2d TBS %4d HARQ PID %2d round %d RV %d NDI %d dl_data_to_ULACK %d (%d.%d) PUCCH allocation %d TPC %d\n", frame, slot, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 2692cac4c9..95d0cc944b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1328,7 +1328,7 @@ int nr_acknack_scheduling(int mod_id, pucch->ul_slot = (s + 1) % n_slots_frame; } if (ind_found==-1) { - LOG_W(NR_MAC, + LOG_D(NR_MAC, "%4d.%2d could not find pdsch_to_harq_feedback for UE %d: earliest " "ack slot %d\n", frame, From cd2f704163b98497ebea1e5251210fedfa748b71 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Tue, 2 Nov 2021 17:24:10 +0000 Subject: [PATCH 006/113] Fix segmentation fault when exporting packets to wireshark with high MCS --- openair2/UTIL/OPT/probe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/UTIL/OPT/probe.c b/openair2/UTIL/OPT/probe.c index e64f7724c6..8731eb294a 100644 --- a/openair2/UTIL/OPT/probe.c +++ b/openair2/UTIL/OPT/probe.c @@ -408,7 +408,7 @@ static void SendFrameNR(guint8 radioType, guint8 direction, guint8 rntiType, guint8 isPredefinedData, guint8 retx, guint8 crcStatus, guint8 oob_event, guint8 oob_event_value, uint8_t *pdu_buffer, unsigned int pdu_buffer_size) { - unsigned char frameBuffer[9000]; + unsigned char frameBuffer[12000]; unsigned int frameOffset; ssize_t bytesSent; frameOffset = 0; From 12e8818bed71935813b95834b19a9e2188e8d782 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Tue, 2 Nov 2021 17:49:52 +0000 Subject: [PATCH 007/113] Remove duplicate validation --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index c20055507e..39b6e82be3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -1935,7 +1935,7 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG add_nr_list(&UE_info->list, UE_id); memset(&UE_info->mac_stats[UE_id], 0, sizeof(NR_mac_stats_t)); set_Y(UE_info->Y[UE_id], rntiP); - if (CellGroup && CellGroup->spCellConfig && CellGroup->spCellConfig && CellGroup->spCellConfig->spCellConfigDedicated) + if (CellGroup && CellGroup->spCellConfig && CellGroup->spCellConfig->spCellConfigDedicated) compute_csi_bitlen (CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup, UE_info, UE_id, mod_idP); NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; memset(sched_ctrl, 0, sizeof(*sched_ctrl)); From bac8bc569c6a9ea073a17bff7fa487c8129cc114 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Tue, 9 Nov 2021 10:51:00 +0100 Subject: [PATCH 008/113] minor changes in dlschsim, still doesn't work :-( --- openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c | 8 ++---- openair1/SIMULATION/NR_PHY/dlschsim.c | 31 ++++++++++++++++----- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c index 5620018b73..0165a4062e 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c @@ -254,7 +254,7 @@ void ldpc8blocks( void *p) { #ifdef DEBUG_DLSCH_CODING for (int i =0; i<16; i++) - printf("output ratematching e[%d]= %d r_offset %u\n", i,harq->e[i+r_offset], r_offset); + printf("output ratematching e[%d]= %d r_offset %u\n", i,e[i], r_offset); #endif nr_interleaving_ldpc(E, @@ -266,8 +266,6 @@ void ldpc8blocks( void *p) { for (int i =0; i<16; i++) printf("output interleaving f[%d]= %d r_offset %u\n", i,impp->output[i+r_offset], r_offset); - if (r==impp->n_segments-1) - write_output("enc_output.m","enc",impp->output,G,1,4); #endif r_offset += E; @@ -370,11 +368,11 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB, //d_tmp[r] = &harq->d[r][0]; //channel_input[r] = &harq->d[r][0]; #ifdef DEBUG_DLSCH_CODING - LOG_D(PHY,"Encoder: B %d F %d \n",harq->B, impp->F); + LOG_D(PHY,"Encoder: B %d F %d \n",harq->B, impp.F); LOG_D(PHY,"start ldpc encoder segment %d/%d\n",r,impp.n_segments); LOG_D(PHY,"input %d %d %d %d %d \n", harq->c[r][0], harq->c[r][1], harq->c[r][2],harq->c[r][3], harq->c[r][4]); - for (int cnt =0 ; cnt < 22*(*Zc)/8; cnt ++) { + for (int cnt =0 ; cnt < 22*(*impp.Zc)/8; cnt ++) { LOG_D(PHY,"%d ", harq->c[r][cnt]); } diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index 96bd435674..b304327138 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -68,6 +68,7 @@ uint16_t n_rnti = 0x1234; openair0_config_t openair0_cfg[MAX_CARDS]; void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq) {} +void processSlotTX(void *arg) {} int main(int argc, char **argv) { @@ -116,8 +117,10 @@ int main(int argc, char **argv) uint8_t Imcs = 9; uint8_t mcs_table = 0; double DS_TDL = .03; - cpuf = get_cpu_freq_GHz(); + cpuf = get_cpu_freq_GHz(); + char gNBthreads[128]="n"; + if (load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY) == 0) { exit_fun("[NR_DLSCHSIM] Error, configuration module init failed\n"); } @@ -426,9 +429,22 @@ int main(int argc, char **argv) UE->dlsch_SI[0] = new_nr_ue_dlsch(1, 1, Nsoft, 5, N_RB_DL, 0); UE->dlsch_ra[0] = new_nr_ue_dlsch(1, 1, Nsoft, 5, N_RB_DL, 0); unsigned char harq_pid = 0; //dlsch->harq_ids[subframe]; - processingData_L1tx_t msgDataTx; - init_DLSCH_struct(gNB, &msgDataTx); - NR_gNB_DLSCH_t *dlsch = msgDataTx.dlsch[0][0]; + + gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t)); + initTpool(gNBthreads, gNB->threadPool, true); + gNB->resp_L1_tx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); + initNotifiedFIFO(gNB->resp_L1_tx); + // we create 2 threads for L1 tx processing + notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->resp_L1_tx,processSlotTX); + processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx); + init_DLSCH_struct(gNB, msgDataTx); + msgDataTx->slot = slot; + msgDataTx->frame = frame; + memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t)); + reset_meas(&msgDataTx->phy_proc_tx); + gNB->phy_proc_tx_0 = &msgDataTx->phy_proc_tx; + pushTpool(gNB->threadPool,msgL1Tx); + NR_gNB_DLSCH_t *dlsch = msgDataTx->dlsch[0][0]; nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &dlsch->harq_process.pdsch_pdu.pdsch_pdu_rel15; //time_stats_t *rm_stats, *te_stats, *i_stats; uint8_t is_crnti = 0, llr8_flag = 0; @@ -501,10 +517,11 @@ int main(int argc, char **argv) /*for (int i=0; i0x%08x\n",crc24c(test_input, 32)); // generate signal - unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS] __attribute__((aligned(32))); - bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); + unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS] __attribute__((aligned(32))); + bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); if (input_fd == NULL) { nr_dlsch_encoding(gNB, test_input, frame, slot, dlsch, frame_parms,output,NULL,NULL,NULL,NULL,NULL,NULL,NULL); } @@ -640,7 +657,7 @@ int main(int argc, char **argv) for (i = 0; i < 2; i++) { printf("gNB %d\n", i); - free_gNB_dlsch(&(msgDataTx.dlsch[0][i]),N_RB_DL); + free_gNB_dlsch(&(msgDataTx->dlsch[0][i]),N_RB_DL); printf("UE %d\n", i); free_nr_ue_dlsch(&(UE->dlsch[0][0][i]),N_RB_DL); } From 32e7b7b83f1cee02b69134ceee5cc454c8e46635 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 12 Nov 2021 16:39:16 +0000 Subject: [PATCH 009/113] Update SA default configuration files --- .../gnb.sa.band41.fr1.106PRB.usrpb210.conf | 126 +++---- ...gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 323 ++++++++++++++++++ .../gnb.sa.band78.fr1.106PRB.usrpb210.conf | 126 +++---- 3 files changed, 451 insertions(+), 124 deletions(-) create mode 100644 targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 62b89188f9..de6bafc9f7 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -1,4 +1,4 @@ -Active_gNBs = ( "gNB-Eurecom-5GNRBox"); +Active_gNBs = ( "gNB-OAI"); # Asn1_verbosity, choice in: none, info, annoying Asn1_verbosity = "none"; @@ -7,7 +7,7 @@ gNBs = { ////////// Identification parameters: gNB_ID = 0xe00; - gNB_name = "gNB-Eurecom-5GNRBox"; + gNB_name = "gNB-OAI"; // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1; @@ -204,7 +204,7 @@ gNBs = }; - ////////// MME parameters: + ////////// AMF parameters: amf_ip_address = ( { ipv4 = "192.168.70.132"; ipv6 = "192:168:30::17"; active = "yes"; @@ -226,59 +226,61 @@ gNBs = ); MACRLCs = ( - { - num_cc = 1; - tr_s_preference = "local_L1"; - tr_n_preference = "local_RRC"; - pusch_TargetSNRx10 = 150; - pucch_TargetSNRx10 = 200; - } +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 150; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; +} ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - prach_dtx_threshold = 120; - pucch0_dtx_threshold = 150; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( - { - local_rf = "yes" - nb_tx = 1 - nb_rx = 1 - att_tx = 0 - att_rx = 0; - bands = [41]; - max_pdschReferenceSignalPower = -27; - max_rxgain = 114; - eNB_instances = [0]; - #beamforming 1x4 matrix: - bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; - clock_src = "internal"; - } +{ + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [41]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 114; + sf_extension = 0; + eNB_instances = [0]; + #beamforming 1x4 matrix: + bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; + clock_src = "internal"; +} ); THREAD_STRUCT = ( - { - #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" - parallel_config = "PARALLEL_SINGLE_THREAD"; - #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" - worker_config = "WORKER_ENABLE"; - } +{ + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; +} ); rfsimulator : { - serveraddr = "server"; - serverport = "4043"; - options = (); #("saviq"); or/and "chanmod" - modelname = "AWGN"; - IQfile = "/tmp/rfsimulator.iqs"; + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; }; security = { @@ -298,23 +300,23 @@ security = { drb_integrity = "no"; }; - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; - }; +log_config : +{ + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; +}; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf new file mode 100644 index 0000000000..abc64b6e46 --- /dev/null +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -0,0 +1,323 @@ +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + gNB_name = "gNB-OAI"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ({ + mcc = 208; + mnc = 99; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x1; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + + }); + + nr_cellid = 12345678L; + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 2; + ul_prbblacklist = "51,52,53,54" + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 11; + searchSpaceZero = 0; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68 + absoluteFrequencySSB = 621312; # 641280 + dl_frequencyBand = 78; + # this is 3300.60 MHz + dl_absoluteFrequencyPointA = 620040; # 640008 + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 106; + #initialDownlinkBWP + #genericParameters + # this is RBstart=27,L=48 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952 +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 11; + initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 78; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 106; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 12; + preambleReceivedTargetPower = -104; +#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) + preambleTransMax = 6; +#powerRampingStep +# 0=dB0,1=dB2,2=dB4,3=dB6 + powerRampingStep = 1; +#ra_ReponseWindow +#1,2,4,8,10,20,40,80 + ra_ResponseWindow = 4; +#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR +#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 3; +#oneHalf (0..15) 4,8,12,16,...60,64 + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15; +#ra_ContentionResolutionTimer +#(0..7) 8,16,24,32,40,48,56,64 + ra_ContentionResolutionTimer = 7; + rsrp_ThresholdSSB = 19; +#prach-RootSequenceIndex_PR +#1 = 839, 2 = 139 + prach_RootSequenceIndex_PR = 2; + prach_RootSequenceIndex = 1; + # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex + # + msg1_SubcarrierSpacing = 1, +# restrictedSetConfig +# 0=unrestricted, 1=restricted type A, 2=restricted type B + restrictedSetConfig = 0, + + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 2; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 + + msg3_DeltaPreamble = 1; + p0_NominalWithGrant =-90; + +# pucch-ConfigCommon setup : +# pucchGroupHopping +# 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -70; +# ssb_PositionsInBurs_BitmapPR +# 1=short, 2=medium, 3=long + ssb_PositionsInBurst_PR = 2; + ssb_PositionsInBurst_Bitmap = 1; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 2; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 1; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 1; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 6; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "192.168.70.132"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24"; + GNB_INTERFACE_NAME_FOR_NGU = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + #pusch_TargetSNRx10 = 150; + #pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; +} +); + +L1s = ( +{ + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 4; + prach_dtx_threshold = 120; + #pucch0_dtx_threshold = 120; +} +); + +RUs = ( +{ + local_rf = "yes" + nb_tx = 2 + nb_rx = 2 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 75; + sf_extension = 0; + eNB_instances = [0]; + ##beamforming 1x2 matrix: 1 layer x 2 antennas + bf_weights = [0x00007fff, 0x0000]; + #clock_src = "internal"; + sdr_addrs = "mgmt_addr=192.168.10.2,addr=192.168.10.2,clock_source=internal,time_source=internal" +} +); + +THREAD_STRUCT = ( +{ + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; +} +); + +rfsimulator : +{ + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; +}; + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + +log_config : +{ + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; +}; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index ac8622fbc5..83b39b85ec 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -1,4 +1,4 @@ -Active_gNBs = ( "gNB-Eurecom-5GNRBox"); +Active_gNBs = ( "gNB-OAI"); # Asn1_verbosity, choice in: none, info, annoying Asn1_verbosity = "none"; @@ -7,7 +7,7 @@ gNBs = { ////////// Identification parameters: gNB_ID = 0xe00; - gNB_name = "gNB-Eurecom-5GNRBox"; + gNB_name = "gNB-OAI"; // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1; @@ -204,7 +204,7 @@ gNBs = }; - ////////// MME parameters: + ////////// AMF parameters: amf_ip_address = ( { ipv4 = "192.168.70.132"; ipv6 = "192:168:30::17"; active = "yes"; @@ -226,59 +226,61 @@ gNBs = ); MACRLCs = ( - { - num_cc = 1; - tr_s_preference = "local_L1"; - tr_n_preference = "local_RRC"; - pusch_TargetSNRx10 = 150; - pucch_TargetSNRx10 = 200; - } +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 150; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; +} ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - prach_dtx_threshold = 120; - pucch0_dtx_threshold = 150; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( - { - local_rf = "yes" - nb_tx = 1 - nb_rx = 1 - att_tx = 0 - att_rx = 0; - bands = [78]; - max_pdschReferenceSignalPower = -27; - max_rxgain = 114; - eNB_instances = [0]; - #beamforming 1x4 matrix: - bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; - clock_src = "internal"; - } +{ + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 114; + sf_extension = 0; + eNB_instances = [0]; + #beamforming 1x4 matrix: + bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; + clock_src = "internal"; +} ); THREAD_STRUCT = ( - { - #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" - parallel_config = "PARALLEL_SINGLE_THREAD"; - #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" - worker_config = "WORKER_ENABLE"; - } +{ + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; +} ); rfsimulator : { - serveraddr = "server"; - serverport = "4043"; - options = (); #("saviq"); or/and "chanmod" - modelname = "AWGN"; - IQfile = "/tmp/rfsimulator.iqs"; + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; }; security = { @@ -298,23 +300,23 @@ security = { drb_integrity = "no"; }; - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; - }; +log_config : +{ + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; +}; From 02b17c79d6ce432d0a56086af3f32adbe9855387 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sun, 14 Nov 2021 17:28:24 +0100 Subject: [PATCH 010/113] commit before merge. minor changes for testing --- executables/nr-gnb.c | 7 ++++--- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 2 +- openair1/PHY/TOOLS/time_meas.h | 1 + openair1/PHY/defs_gNB.h | 1 + openair1/SCHED_NR/fapi_nr_l1.c | 4 ++-- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 4 ++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 4 +++- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 5 +++++ openair2/LAYER2/NR_MAC_gNB/main.c | 2 ++ openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 2 ++ openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 12 +++++------- openair2/RRC/NR/rrc_gNB.c | 2 +- 12 files changed, 29 insertions(+), 17 deletions(-) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 439f4691d3..bbb6ee99f4 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -268,13 +268,13 @@ void rx_func(void *param) { // Call the scheduler start_meas(&gNB->ul_indication_stats); - pthread_mutex_lock(&gNB->UL_INFO_mutex); +// pthread_mutex_lock(&gNB->UL_INFO_mutex); gNB->UL_INFO.frame = frame_rx; gNB->UL_INFO.slot = slot_rx; gNB->UL_INFO.module_id = gNB->Mod_id; gNB->UL_INFO.CC_id = gNB->CC_id; gNB->if_inst->NR_UL_indication(&gNB->UL_INFO); - pthread_mutex_unlock(&gNB->UL_INFO_mutex); +// pthread_mutex_unlock(&gNB->UL_INFO_mutex); stop_meas(&gNB->ul_indication_stats); if (tx_slot_type == NR_DOWNLINK_SLOT || tx_slot_type == NR_MIXED_SLOT) { @@ -342,7 +342,7 @@ static void *process_stats_thread(void *param) { reset_meas(&gNB->ul_indication_stats); reset_meas(&gNB->rx_pusch_stats); reset_meas(&gNB->ulsch_decoding_stats); - + reset_meas(&gNB->schedule_response_stats); wait_sync("process_stats_thread"); while(!oai_exit) @@ -353,6 +353,7 @@ static void *process_stats_thread(void *param) { print_meas(&gNB->dlsch_encoding_stats, "DLSCH encoding", NULL, NULL); print_meas(&gNB->phy_proc_rx, "L1 Rx processing", NULL, NULL); print_meas(&gNB->ul_indication_stats, "UL Indication", NULL, NULL); + print_meas(&gNB->schedule_response_stats,"Schedule Response",NULL,NULL); print_meas(&gNB->rx_pusch_stats, "PUSCH inner-receiver", NULL, NULL); print_meas(&gNB->ulsch_decoding_stats, "PUSCH decoding", NULL, NULL); } diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index abae2f0cc4..2c5c6d6d4a 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -424,7 +424,7 @@ uint8_t nr_generate_pdsch(processingData_L1tx_t *msgTx, remaining_re = upper_limit + start_sc - frame_parms->ofdm_symbol_size; upper_limit = frame_parms->ofdm_symbol_size - start_sc; } - if (frame_parms->N_RB_DL&1==0) { + if (0/*(frame_parms->N_RB_DL&1)==0*/) { __m128i *txF=(__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc+txdataF_offset)<<1)]; __m128i *txl = (__m128i*)&tx_layers[ap][m<<1]; diff --git a/openair1/PHY/TOOLS/time_meas.h b/openair1/PHY/TOOLS/time_meas.h index f78ea55530..bf6999de70 100644 --- a/openair1/PHY/TOOLS/time_meas.h +++ b/openair1/PHY/TOOLS/time_meas.h @@ -128,6 +128,7 @@ static inline void start_meas(time_stats_t *ts) { } else { ts->in = rdtsc_oai(); } + if ((ts->trials&16383)<10) ts->max=0; } } diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index fb4f9a0092..1db4f6328a 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -868,6 +868,7 @@ typedef struct PHY_VARS_gNB_s { time_stats_t rx_pusch_stats; time_stats_t ul_indication_stats; + time_stats_t schedule_response_stats; time_stats_t ulsch_decoding_stats; time_stats_t ulsch_rate_unmatching_stats; time_stats_t ulsch_ldpc_decoding_stats; diff --git a/openair1/SCHED_NR/fapi_nr_l1.c b/openair1/SCHED_NR/fapi_nr_l1.c index 8f315ba214..f9d90d9204 100644 --- a/openair1/SCHED_NR/fapi_nr_l1.c +++ b/openair1/SCHED_NR/fapi_nr_l1.c @@ -148,7 +148,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){ AssertFatal(RC.gNB[Mod_id]!=NULL,"RC.gNB[%d] is null\n",Mod_id); gNB = RC.gNB[Mod_id]; - + start_meas(&gNB->schedule_response_stats); notifiedFIFO_elt_t *res; res = pullTpool(gNB->resp_L1_tx, gNB->threadPool); processingData_L1tx_t *msgTx = (processingData_L1tx_t *)NotifiedFifoData(res); @@ -248,5 +248,5 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){ oai_nfapi_tx_data_req(TX_req); } - + stop_meas(&gNB->schedule_response_stats); } diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 63cf6f2f2d..8a69f18b88 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -401,7 +401,7 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id, uint8_t harq_pid, uint8_t crc_flag, int dtx_flag) { - pthread_mutex_lock(&gNB->UL_INFO_mutex); + //pthread_mutex_lock(&gNB->UL_INFO_mutex); int timing_advance_update, cqi; int sync_pos; @@ -526,7 +526,7 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id, gNB->UL_INFO.rx_ind.number_of_pdus++; - pthread_mutex_unlock(&gNB->UL_INFO_mutex); +// pthread_mutex_unlock(&gNB->UL_INFO_mutex); } // Function to fill UL RB mask to be used for N0 measurements diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index b62f8e0282..ebe4758e27 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -393,7 +393,9 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, nr_schedule_ulsch(module_idP, frame, slot); // This schedules the DCI for Downlink and PDSCH - nr_schedule_ue_spec(module_idP, frame, slot); + start_meas(&gNB->schedule_dlsch); + nr_schedule_ue_spec(module_idP, frame, slot); + stop_meas(&gNB->schedule_dlsch); nr_schedule_pucch(module_idP, frame, slot); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 17241e4d1f..06797f2f2e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -1218,6 +1218,7 @@ void nr_schedule_ue_spec(module_id_t module_id, // const int lcid = DL_SCH_LCID_DTCH; const int lcid = sched_ctrl->lcid_to_schedule; int dlsch_total_bytes = 0; + start_meas(&gNB_mac->rlc_data_req); if (sched_ctrl->num_total_bytes > 0) { tbs_size_t len = 0; while (size > 3) { @@ -1231,6 +1232,8 @@ void nr_schedule_ue_spec(module_id_t module_id, /* limit requested number of bytes to what preprocessor specified, or * such that TBS is full */ const rlc_buffer_occupancy_t ndata = min(sched_ctrl->rlc_status[lcid].bytes_in_buffer, size); + + len = mac_rlc_data_req(module_id, rnti, module_id, @@ -1243,6 +1246,7 @@ void nr_schedule_ue_spec(module_id_t module_id, 0, 0); + LOG_D(NR_MAC, "%4d.%2d RNTI %04x: %d bytes from %s %d (ndata %d, remaining size %d)\n", frame, @@ -1291,6 +1295,7 @@ void nr_schedule_ue_spec(module_id_t module_id, buf += size; dlsch_total_bytes += size; } + stop_meas(&gNB_mac->rlc_data_req); // Add padding header and zero rest out if there is space left if (size > 0) { diff --git a/openair2/LAYER2/NR_MAC_gNB/main.c b/openair2/LAYER2/NR_MAC_gNB/main.c index 4b8b36600b..0ea94523d5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/main.c +++ b/openair2/LAYER2/NR_MAC_gNB/main.c @@ -128,6 +128,8 @@ void dump_mac_stats(gNB_MAC_INST *gNB, char *output, int strlen) } } print_meas(&gNB->eNB_scheduler, "DL & UL scheduling timing stats", NULL, NULL); + print_meas(&gNB->schedule_dlsch,"dlsch scheduler",NULL,NULL); + print_meas(&gNB->rlc_data_req, "rlc_data_req",NULL,NULL); } diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 81be37872b..007573c4c3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -736,6 +736,8 @@ typedef struct gNB_MAC_INST_s { time_stats_t schedule_dlsch_preprocessor; /// processing time of eNB DLSCH scheduler time_stats_t schedule_dlsch; // include rlc_data_req + MAC header + preprocessor + /// processing time of rlc_data_req + time_stats_t rlc_data_req; /// processing time of eNB MCH scheduler time_stats_t schedule_mch; /// processing time of eNB ULSCH reception diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index cb5bef5ab0..4d04f4e0c8 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -266,13 +266,11 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) { dump_dl(sched_info); #endif - if (ifi->NR_Schedule_response) { - AssertFatal(ifi->NR_Schedule_response!=NULL, - "nr_schedule_response is null (mod %d, cc %d)\n", - module_id, - CC_id); - ifi->NR_Schedule_response(sched_info); - } + AssertFatal(ifi->NR_Schedule_response!=NULL, + "nr_schedule_response is null (mod %d, cc %d)\n", + module_id, + CC_id); + ifi->NR_Schedule_response(sched_info); LOG_D(PHY,"NR_Schedule_response: SFN_SF:%d%d dl_pdus:%d\n", sched_info->frame, diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 95852c8ccb..5a6e679c60 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -800,7 +800,7 @@ rrc_gNB_generate_defaultRRCReconfiguration( DRB_config->pdcp_Config->moreThanOneRLC = NULL; DRB_config->pdcp_Config->t_Reordering = calloc(1, sizeof(*DRB_config->pdcp_Config->t_Reordering)); - *DRB_config->pdcp_Config->t_Reordering = NR_PDCP_Config__t_Reordering_ms0; + *DRB_config->pdcp_Config->t_Reordering = NR_PDCP_Config__t_Reordering_ms100; DRB_config->pdcp_Config->ext1 = NULL; ASN_SEQUENCE_ADD(&(*DRB_configList)->list, DRB_config); From 3d454a45a338390dc02733f285e18dc212b0ad9b Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sun, 14 Nov 2021 20:09:21 +0100 Subject: [PATCH 011/113] allow max_ul_frame_inactivity=0. This means 1/2 frame. --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 9a6fa32b5f..2d117a3131 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -869,7 +869,7 @@ bool nr_UE_is_to_be_scheduled(module_id_t mod_id, int CC_id, int UE_id, frame_t * (2) there is a scheduling request * (3) or we did not schedule it in more than 10 frames */ const bool has_data = sched_ctrl->estimated_ul_buffer > sched_ctrl->sched_ul_bytes; - const bool high_inactivity = diff >= nrmac->ulsch_max_frame_inactivity * n; + const bool high_inactivity = diff >= (nrmac->ulsch_max_frame_inactivity>0 ? (nrmac->ulsch_max_frame_inactivity * n) : (n/2)); LOG_D(NR_MAC, "%4d.%2d UL inactivity %d slots has_data %d SR %d\n", frame, From 7738462b0c8574c5a565caf7c265760c22e0d992 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 15 Nov 2021 07:44:54 +0000 Subject: [PATCH 012/113] Add missing stats after merge --- executables/nr-gnb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 491daec565..8e1b9c6765 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -339,6 +339,7 @@ static void dump_L1_meas_stats(PHY_VARS_gNB *gNB, RU_t *ru, char *output) { stroff += print_meas_log(&gNB->ul_indication_stats, "UL Indication", NULL, NULL, output+stroff); stroff += print_meas_log(&gNB->rx_pusch_stats, "PUSCH inner-receiver", NULL, NULL, output+stroff); stroff += print_meas_log(&gNB->ulsch_decoding_stats, "PUSCH decoding", NULL, NULL, output+stroff); + stroff += print_meas_log(&gNB->schedule_response_stats, "Schedule Response",NULL,NULL, output+stroff); if (ru->feprx) stroff += print_meas_log(&ru->ofdm_demod_stats,"feprx",NULL,NULL, output+stroff); if (ru->feptx_ofdm) { From 260eb84633e436bd78463f993b231a36a165a0c4 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 15 Nov 2021 08:00:40 +0000 Subject: [PATCH 013/113] Schedule ulsch in all slots for SA --- .../conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 2 +- .../GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 2 +- .../CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 2 +- .../GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index 0e8466e2df..3a3d083130 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -255,7 +255,7 @@ MACRLCs = ( tr_n_preference = "local_RRC"; # pusch_TargetSNRx10 = 200; # pucch_TargetSNRx10 = 150; - ulsch_max_frame_inactivity = 1; + ulsch_max_frame_inactivity = 0; } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index de6bafc9f7..a975b02154 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -232,7 +232,7 @@ MACRLCs = ( tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; pucch_TargetSNRx10 = 200; - ulsch_max_frame_inactivity = 1; + ulsch_max_frame_inactivity = 0; } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index abc64b6e46..a24139025c 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -232,7 +232,7 @@ MACRLCs = ( tr_n_preference = "local_RRC"; #pusch_TargetSNRx10 = 150; #pucch_TargetSNRx10 = 200; - ulsch_max_frame_inactivity = 1; + ulsch_max_frame_inactivity = 0; } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index 83b39b85ec..6e51487b83 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -232,7 +232,7 @@ MACRLCs = ( tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; pucch_TargetSNRx10 = 200; - ulsch_max_frame_inactivity = 1; + ulsch_max_frame_inactivity = 0; } ); From bc9eeef2f8357293a283536224bc7ecb7c46536c Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 15 Nov 2021 08:21:53 +0000 Subject: [PATCH 014/113] Put back a pthread_mutex_lock for UL_INFO_mutex --- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 270123aeda..1685e206ae 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -401,7 +401,7 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id, uint8_t harq_pid, uint8_t crc_flag, int dtx_flag) { - //pthread_mutex_lock(&gNB->UL_INFO_mutex); + pthread_mutex_lock(&gNB->UL_INFO_mutex); NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id][0]; NR_UL_gNB_HARQ_t *harq_process = ulsch->harq_processes[harq_pid]; @@ -526,7 +526,7 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id, gNB->UL_INFO.rx_ind.number_of_pdus++; -// pthread_mutex_unlock(&gNB->UL_INFO_mutex); + pthread_mutex_unlock(&gNB->UL_INFO_mutex); } // Function to fill UL RB mask to be used for N0 measurements From 7c469da2ad8801c5149eef33c9363b8011b22a7e Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 15 Nov 2021 12:35:24 +0100 Subject: [PATCH 015/113] handle tdd period in max ulsch inactivity --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 2d117a3131..b51014021b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -863,13 +863,22 @@ bool nr_UE_is_to_be_scheduled(module_id_t mod_id, int CC_id, int UE_id, frame_t const NR_UE_sched_ctrl_t *sched_ctrl = &nrmac->UE_info.UE_sched_ctrl[UE_id]; const int last_ul_sched = sched_ctrl->last_ul_frame * n + sched_ctrl->last_ul_slot; + const NR_TDD_UL_DL_Pattern_t *tdd = + scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; + int num_slots_per_period; + int tdd_period_len[8] = {500,625,1000,1250,2000,2500,5000,10000}; + if (tdd) + num_slots_per_period = n*tdd_period_len[tdd->dl_UL_TransmissionPeriodicity]/10000; + else + num_slots_per_period = n; + const int diff = (now - last_ul_sched + 1024 * n) % (1024 * n); /* UE is to be scheduled if * (1) we think the UE has more bytes awaiting than what we scheduled * (2) there is a scheduling request * (3) or we did not schedule it in more than 10 frames */ const bool has_data = sched_ctrl->estimated_ul_buffer > sched_ctrl->sched_ul_bytes; - const bool high_inactivity = diff >= (nrmac->ulsch_max_frame_inactivity>0 ? (nrmac->ulsch_max_frame_inactivity * n) : (n/2)); + const bool high_inactivity = diff >= (nrmac->ulsch_max_frame_inactivity>0 ? (nrmac->ulsch_max_frame_inactivity * n) : num_slots_per_period); LOG_D(NR_MAC, "%4d.%2d UL inactivity %d slots has_data %d SR %d\n", frame, From bd9b730383706152c1d7ecff9f90fd33e103e995 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 15 Nov 2021 16:36:34 +0000 Subject: [PATCH 016/113] Change variable types in statistics to accommodate more bytes and to avoid negative values --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 6 ++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 2 +- openair2/LAYER2/NR_MAC_gNB/main.c | 30 +++++++++---------- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 24 +++++++-------- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 185f35562b..f11b0148eb 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -420,9 +420,9 @@ int get_mcs_from_bler(module_id_t mod_id, int CC_id, frame_t frame, sub_frame_t return old_mcs; // no update // last update is longer than x frames ago - const int dtx = stats->dlsch_rounds[0] - bler_stats->dlsch_rounds[0]; - const int dretx = stats->dlsch_rounds[1] - bler_stats->dlsch_rounds[1]; - const int dretx2 = stats->dlsch_rounds[2] - bler_stats->dlsch_rounds[2]; + const int dtx = (int)(stats->dlsch_rounds[0] - bler_stats->dlsch_rounds[0]); + const int dretx = (int)(stats->dlsch_rounds[1] - bler_stats->dlsch_rounds[1]); + const int dretx2 = (int)(stats->dlsch_rounds[2] - bler_stats->dlsch_rounds[2]); const float bler_window = dtx > 0 ? (float) dretx / dtx : bler_stats->bler; const float rd2_bler_wnd = dtx > 0 ? (float) dretx2 / dtx : bler_stats->rd2_bler; bler_stats->bler = BLER_FILTER * bler_stats->bler + (1 - BLER_FILTER) * bler_window; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 55d38889a4..32b2f47101 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -582,7 +582,7 @@ static void handle_dl_harq(module_id_t mod_id, harq->ndi ^= 1; NR_mac_stats_t *stats = &UE_info->mac_stats[UE_id]; stats->dlsch_errors++; - LOG_D(NR_MAC, "retransmission error for UE %d (total %d)\n", UE_id, stats->dlsch_errors); + LOG_D(NR_MAC, "retransmission error for UE %d (total %"PRIu64")\n", UE_id, stats->dlsch_errors); } else { add_tail_nr_list(&UE_info->UE_sched_ctrl[UE_id].retrans_dl_harq, harq_pid); harq->round++; diff --git a/openair2/LAYER2/NR_MAC_gNB/main.c b/openair2/LAYER2/NR_MAC_gNB/main.c index 0ea94523d5..bfc2e39186 100644 --- a/openair2/LAYER2/NR_MAC_gNB/main.c +++ b/openair2/LAYER2/NR_MAC_gNB/main.c @@ -94,36 +94,36 @@ void dump_mac_stats(gNB_MAC_INST *gNB, char *output, int strlen) avg_rsrp, stats->num_rsrp_meas); - stroff+=sprintf(output+stroff,"UE %d: dlsch_rounds %d/%d/%d/%d, dlsch_errors %d, pucch0_DTX %d, BLER %.5f MCS %d\n", - UE_id, - stats->dlsch_rounds[0], stats->dlsch_rounds[1], - stats->dlsch_rounds[2], stats->dlsch_rounds[3], - stats->dlsch_errors, - stats->pucch0_DTX, - sched_ctrl->dl_bler_stats.bler, - sched_ctrl->dl_bler_stats.mcs); + stroff+=sprintf(output+stroff,"UE %d: dlsch_rounds %"PRIu64"/%"PRIu64"/%"PRIu64"/%"PRIu64", dlsch_errors %"PRIu64", pucch0_DTX %d, BLER %.5f MCS %d\n", + UE_id, + stats->dlsch_rounds[0], stats->dlsch_rounds[1], + stats->dlsch_rounds[2], stats->dlsch_rounds[3], + stats->dlsch_errors, + stats->pucch0_DTX, + sched_ctrl->dl_bler_stats.bler, + sched_ctrl->dl_bler_stats.mcs); stats->num_rsrp_meas = 0; stats->cumul_rsrp = 0 ; - stroff+=sprintf(output+stroff,"UE %d: dlsch_total_bytes %d\n", UE_id, stats->dlsch_total_bytes); - stroff+=sprintf(output+stroff,"UE %d: ulsch_rounds %d/%d/%d/%d, ulsch_DTX %d, ulsch_errors %d\n", + stroff+=sprintf(output+stroff,"UE %d: dlsch_total_bytes %"PRIu64"\n", UE_id, stats->dlsch_total_bytes); + stroff+=sprintf(output+stroff,"UE %d: ulsch_rounds %"PRIu64"/%"PRIu64"/%"PRIu64"/%"PRIu64", ulsch_DTX %d, ulsch_errors %"PRIu64"\n", UE_id, stats->ulsch_rounds[0], stats->ulsch_rounds[1], stats->ulsch_rounds[2], stats->ulsch_rounds[3], stats->ulsch_DTX, stats->ulsch_errors); stroff+=sprintf(output+stroff, - "UE %d: ulsch_total_bytes_scheduled %d, ulsch_total_bytes_received %d\n", + "UE %d: ulsch_total_bytes_scheduled %"PRIu64", ulsch_total_bytes_received %"PRIu64"\n", UE_id, stats->ulsch_total_bytes_scheduled, stats->ulsch_total_bytes_rx); for (int lc_id = 0; lc_id < 63; lc_id++) { if (stats->lc_bytes_tx[lc_id] > 0) { - stroff+=sprintf(output+stroff, "UE %d: LCID %d: %d bytes TX\n", UE_id, lc_id, stats->lc_bytes_tx[lc_id]); - LOG_D(NR_MAC, "UE %d: LCID %d: %d bytes TX\n", UE_id, lc_id, stats->lc_bytes_tx[lc_id]); + stroff+=sprintf(output+stroff, "UE %d: LCID %d: %"PRIu64" bytes TX\n", UE_id, lc_id, stats->lc_bytes_tx[lc_id]); + LOG_D(NR_MAC, "UE %d: LCID %d: %"PRIu64" bytes TX\n", UE_id, lc_id, stats->lc_bytes_tx[lc_id]); } if (stats->lc_bytes_rx[lc_id] > 0) { - stroff+=sprintf(output+stroff, "UE %d: LCID %d: %d bytes RX\n", UE_id, lc_id, stats->lc_bytes_rx[lc_id]); - LOG_D(NR_MAC, "UE %d: LCID %d: %d bytes RX\n", UE_id, lc_id, stats->lc_bytes_rx[lc_id]); + stroff+=sprintf(output+stroff, "UE %d: LCID %d: %"PRIu64" bytes RX\n", UE_id, lc_id, stats->lc_bytes_rx[lc_id]); + LOG_D(NR_MAC, "UE %d: LCID %d: %"PRIu64" bytes RX\n", UE_id, lc_id, stats->lc_bytes_rx[lc_id]); } } } diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 007573c4c3..4072c3ded7 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -427,7 +427,7 @@ typedef struct NR_DL_bler_stats { float bler; float rd2_bler; uint8_t mcs; - int dlsch_rounds[8]; + uint64_t dlsch_rounds[8]; } NR_DL_bler_stats_t; // @@ -618,19 +618,19 @@ typedef struct { } NRUEcontext_t; typedef struct { - int lc_bytes_tx[64]; - int lc_bytes_rx[64]; - int dlsch_rounds[8]; - int dlsch_errors; - int dlsch_total_bytes; + uint64_t lc_bytes_tx[64]; + uint64_t lc_bytes_rx[64]; + uint64_t dlsch_rounds[8]; + uint64_t dlsch_errors; + uint64_t dlsch_total_bytes; int dlsch_current_bytes; - int ulsch_rounds[8]; - int ulsch_errors; - int ulsch_DTX; - int ulsch_total_bytes_scheduled; - int ulsch_total_bytes_rx; + uint64_t ulsch_rounds[8]; + uint64_t ulsch_errors; + uint32_t ulsch_DTX; + uint64_t ulsch_total_bytes_scheduled; + uint64_t ulsch_total_bytes_rx; int ulsch_current_bytes; - int pucch0_DTX; + uint32_t pucch0_DTX; int cumul_rsrp; uint8_t num_rsrp_meas; } NR_mac_stats_t; From 0b88c164277eec2d13f5ebb28e08bea5774cb60f Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 15 Nov 2021 16:39:36 +0000 Subject: [PATCH 017/113] Add T support for GNB_MAC_RETRANSMISSION_DL_PDU_WITH_DATA --- common/utils/T/T_messages.txt | 4 ++++ openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/common/utils/T/T_messages.txt b/common/utils/T/T_messages.txt index cd66be73f5..192bf8cc37 100644 --- a/common/utils/T/T_messages.txt +++ b/common/utils/T/T_messages.txt @@ -155,6 +155,10 @@ ID = GNB_MAC_DL_RAR_PDU_WITH_DATA DESC = NR MAC downlink PDU for RAR GROUP = ALL:MAC:GNB:WIRESHARK FORMAT = int,gNB_ID : int,CC_id : int,rnti : int,frame : int,slot : int,harq_pid : buffer,data +ID = GNB_MAC_RETRANSMISSION_DL_PDU_WITH_DATA + DESC = NR MAC downlink retransmitted PDU for an UE + GROUP = ALL:MAC:GNB:WIRESHARK + FORMAT = int,gNB_ID : int,CC_id : int,rnti : int,frame : int,slot : int,harq_pid : int,round : buffer,data #RLC logs ID = ENB_RLC_DL diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index f11b0148eb..9ef8009926 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -1198,6 +1198,9 @@ void nr_schedule_ue_spec(module_id_t module_id, "UE %d mismatch between scheduled TBS and buffered TB for HARQ PID %d\n", UE_id, current_harq_pid); + + T(T_GNB_MAC_RETRANSMISSION_DL_PDU_WITH_DATA, T_INT(module_id), T_INT(CC_id), T_INT(rnti), + T_INT(frame), T_INT(slot), T_INT(current_harq_pid), T_INT(harq->round), T_BUFFER(harq->tb, TBS)); } else { /* initial transmission */ LOG_D(NR_MAC, "[%s] Initial HARQ transmission in %d.%d\n", __FUNCTION__, frame, slot); From 32f090c2987132e1b6a1c871f051c3d0b4797d67 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sun, 21 Nov 2021 09:59:19 +0100 Subject: [PATCH 018/113] minor changes for testing --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 4 ++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 24 ++++++++++--------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 2 +- openair2/LAYER2/NR_MAC_gNB/main.c | 1 + openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 2 ++ 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 1a844aaaf1..8df27e3d52 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -430,7 +430,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_confidence_level = no_conf ? 1 : 0; uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(1); uci_pdu->harq->harq_list[0].harq_value = index&0x01; - LOG_D(NR_PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d SR_flag %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n", + if (no_conf) LOG_I(NR_PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d SR_flag %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n", frame,slot,uci_pdu->harq->harq_list[0].harq_value,pucch_pdu->sr_flag,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,10*log10((double)sigenergy),gNB->ulsch_stats[0].sync_pos); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); @@ -447,7 +447,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2); uci_pdu->harq->harq_list[1].harq_value = index&0x01; uci_pdu->harq->harq_list[0].harq_value = (index>>1)&0x01; - LOG_D(NR_PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d SR_flag %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n", + if (no_conf) LOG_I(NR_PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d SR_flag %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n", frame,slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,pucch_pdu->sr_flag,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,gNB->ulsch_stats[0].sync_pos); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 1316c8445c..7a80223be3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -485,7 +485,8 @@ void nr_store_dlsch_buffer(module_id_t module_id, DL_SCH_LCID_DCCH, 0, 0); - if ((sched_ctrl->lcid_mask&(1<<4)) > 0) + if ((sched_ctrl->lcid_mask&(1<<4)) > 0) { + start_meas(&RC.nrmac[module_id]->rlc_status_ind); sched_ctrl->rlc_status[DL_SCH_LCID_DTCH] = mac_rlc_status_ind(module_id, rnti, module_id, @@ -496,16 +497,17 @@ void nr_store_dlsch_buffer(module_id_t module_id, DL_SCH_LCID_DTCH, 0, 0); - - if(sched_ctrl->rlc_status[DL_SCH_LCID_DCCH].bytes_in_buffer > 0){ - lcid = DL_SCH_LCID_DCCH; - } - else if (sched_ctrl->rlc_status[DL_SCH_LCID_DCCH1].bytes_in_buffer > 0) - { - lcid = DL_SCH_LCID_DCCH1; - }else{ - lcid = DL_SCH_LCID_DTCH; - } + stop_meas(&RC.nrmac[module_id]->rlc_status_ind); + } + if(sched_ctrl->rlc_status[DL_SCH_LCID_DCCH].bytes_in_buffer > 0){ + lcid = DL_SCH_LCID_DCCH; + } + else if (sched_ctrl->rlc_status[DL_SCH_LCID_DCCH1].bytes_in_buffer > 0) + { + lcid = DL_SCH_LCID_DCCH1; + }else{ + lcid = DL_SCH_LCID_DTCH; + } sched_ctrl->num_total_bytes += sched_ctrl->rlc_status[lcid].bytes_in_buffer; //later multiplex here. Just select DCCH/SRB before DTCH/DRB diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 2d117a3131..1939f74e65 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1025,7 +1025,7 @@ void pf_ul(module_id_t module_id, gNB_MAC_INST *nrmac = RC.nrmac[module_id]; NR_ServingCellConfigCommon_t *scc = nrmac->common_channels[CC_id].ServingCellConfigCommon; NR_UE_info_t *UE_info = &nrmac->UE_info; - const int min_rb = 5; + const int min_rb = 40; float coeff_ue[MAX_MOBILES_PER_GNB]; // UEs that could be scheduled int ue_array[MAX_MOBILES_PER_GNB]; diff --git a/openair2/LAYER2/NR_MAC_gNB/main.c b/openair2/LAYER2/NR_MAC_gNB/main.c index 0ea94523d5..d91b4ae793 100644 --- a/openair2/LAYER2/NR_MAC_gNB/main.c +++ b/openair2/LAYER2/NR_MAC_gNB/main.c @@ -130,6 +130,7 @@ void dump_mac_stats(gNB_MAC_INST *gNB, char *output, int strlen) print_meas(&gNB->eNB_scheduler, "DL & UL scheduling timing stats", NULL, NULL); print_meas(&gNB->schedule_dlsch,"dlsch scheduler",NULL,NULL); print_meas(&gNB->rlc_data_req, "rlc_data_req",NULL,NULL); + print_meas(&gNB->rlc_status_ind,"rlc_status_ind",NULL,NULL); } diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 007573c4c3..939bbe0e7c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -738,6 +738,8 @@ typedef struct gNB_MAC_INST_s { time_stats_t schedule_dlsch; // include rlc_data_req + MAC header + preprocessor /// processing time of rlc_data_req time_stats_t rlc_data_req; + /// processing time of rlc_status_ind + time_stats_t rlc_status_ind; /// processing time of eNB MCH scheduler time_stats_t schedule_mch; /// processing time of eNB ULSCH reception From b8e81a15fd8a829d30d787f1a019dd86ec705194 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Tue, 23 Nov 2021 11:26:08 +0000 Subject: [PATCH 019/113] Revert "Add T support for GNB_MAC_RETRANSMISSION_DL_PDU_WITH_DATA" This reverts commit 0b88c164277eec2d13f5ebb28e08bea5774cb60f. --- common/utils/T/T_messages.txt | 4 ---- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 3 --- 2 files changed, 7 deletions(-) diff --git a/common/utils/T/T_messages.txt b/common/utils/T/T_messages.txt index 192bf8cc37..cd66be73f5 100644 --- a/common/utils/T/T_messages.txt +++ b/common/utils/T/T_messages.txt @@ -155,10 +155,6 @@ ID = GNB_MAC_DL_RAR_PDU_WITH_DATA DESC = NR MAC downlink PDU for RAR GROUP = ALL:MAC:GNB:WIRESHARK FORMAT = int,gNB_ID : int,CC_id : int,rnti : int,frame : int,slot : int,harq_pid : buffer,data -ID = GNB_MAC_RETRANSMISSION_DL_PDU_WITH_DATA - DESC = NR MAC downlink retransmitted PDU for an UE - GROUP = ALL:MAC:GNB:WIRESHARK - FORMAT = int,gNB_ID : int,CC_id : int,rnti : int,frame : int,slot : int,harq_pid : int,round : buffer,data #RLC logs ID = ENB_RLC_DL diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index d8b168ae75..568f8abc37 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -1200,9 +1200,6 @@ void nr_schedule_ue_spec(module_id_t module_id, "UE %d mismatch between scheduled TBS and buffered TB for HARQ PID %d\n", UE_id, current_harq_pid); - - T(T_GNB_MAC_RETRANSMISSION_DL_PDU_WITH_DATA, T_INT(module_id), T_INT(CC_id), T_INT(rnti), - T_INT(frame), T_INT(slot), T_INT(current_harq_pid), T_INT(harq->round), T_BUFFER(harq->tb, TBS)); } else { /* initial transmission */ LOG_D(NR_MAC, "[%s] Initial HARQ transmission in %d.%d\n", __FUNCTION__, frame, slot); From 2fb5ec3a5ff32786c5d3dd956db4f26f15eeb1ce Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Mon, 22 Nov 2021 11:44:04 +0100 Subject: [PATCH 020/113] T tracer: trace MAC DL retransmission PDUs in the gnb and adapt macpdu2wireshark to deal with them --- common/utils/T/T_messages.txt | 4 ++ common/utils/T/tracer/macpdu2wireshark.c | 52 ++++++++++++++++--- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 3 ++ 3 files changed, 52 insertions(+), 7 deletions(-) diff --git a/common/utils/T/T_messages.txt b/common/utils/T/T_messages.txt index cd66be73f5..192bf8cc37 100644 --- a/common/utils/T/T_messages.txt +++ b/common/utils/T/T_messages.txt @@ -155,6 +155,10 @@ ID = GNB_MAC_DL_RAR_PDU_WITH_DATA DESC = NR MAC downlink PDU for RAR GROUP = ALL:MAC:GNB:WIRESHARK FORMAT = int,gNB_ID : int,CC_id : int,rnti : int,frame : int,slot : int,harq_pid : buffer,data +ID = GNB_MAC_RETRANSMISSION_DL_PDU_WITH_DATA + DESC = NR MAC downlink retransmitted PDU for an UE + GROUP = ALL:MAC:GNB:WIRESHARK + FORMAT = int,gNB_ID : int,CC_id : int,rnti : int,frame : int,slot : int,harq_pid : int,round : buffer,data #RLC logs ID = ENB_RLC_DL diff --git a/common/utils/T/tracer/macpdu2wireshark.c b/common/utils/T/tracer/macpdu2wireshark.c index d04f2c317d..c473888180 100644 --- a/common/utils/T/tracer/macpdu2wireshark.c +++ b/common/utils/T/tracer/macpdu2wireshark.c @@ -65,6 +65,11 @@ typedef struct { int nr_dl_frame; int nr_dl_slot; int nr_dl_data; + /* NR dl retx */ + int nr_dl_retx_rnti; + int nr_dl_retx_frame; + int nr_dl_retx_slot; + int nr_dl_retx_data; /* NR mib */ int nr_mib_frame; int nr_mib_slot; @@ -338,6 +343,16 @@ void nr_dl(void *_d, event e) e.e[d->nr_dl_data].b, e.e[d->nr_dl_data].bsize, NO_PREAMBLE); } +void nr_dl_retx(void *_d, event e) +{ + ev_data *d = _d; + + trace_nr(d, NR_DIRECTION_DOWNLINK, NR_C_RNTI, e.e[d->nr_dl_retx_rnti].i, + e.e[d->nr_dl_retx_frame].i, e.e[d->nr_dl_retx_slot].i, + e.e[d->nr_dl_retx_data].b, e.e[d->nr_dl_retx_data].bsize, + NO_PREAMBLE); +} + void nr_mib(void *_d, event e) { ev_data *d = _d; @@ -367,7 +382,8 @@ void nr_rar(void *_d, event e) void setup_data(ev_data *d, void *database, int ul_id, int dl_id, int mib_id, int preamble_id, int rar_id, int sr_id, - int nr_ul_id, int nr_dl_id, int nr_mib_id, int nr_rar_id) + int nr_ul_id, int nr_dl_id, int nr_dl_retx_id, int nr_mib_id, + int nr_rar_id) { database_event_format f; int i; @@ -401,6 +417,10 @@ void setup_data(ev_data *d, void *database, int ul_id, int dl_id, int mib_id, d->nr_dl_frame = -1; d->nr_dl_slot = -1; d->nr_dl_data = -1; + d->nr_dl_retx_rnti = -1; + d->nr_dl_retx_frame = -1; + d->nr_dl_retx_slot = -1; + d->nr_dl_retx_data = -1; d->nr_mib_frame = -1; d->nr_mib_slot = -1; d->nr_mib_data = -1; @@ -518,6 +538,20 @@ void setup_data(ev_data *d, void *database, int ul_id, int dl_id, int mib_id, d->nr_dl_data == -1) goto error; + /* NR dl retx: rnti, frame, slot, data */ + f = get_format(database, nr_dl_retx_id); + + for (i = 0; i < f.count; i++) { + G("rnti", "int", d->nr_dl_retx_rnti); + G("frame", "int", d->nr_dl_retx_frame); + G("slot", "int", d->nr_dl_retx_slot); + G("data", "buffer", d->nr_dl_retx_data); + } + + if (d->nr_dl_retx_rnti == -1 || d->nr_dl_retx_frame == -1 || + d->nr_dl_retx_slot == -1 || d->nr_dl_retx_data == -1) + goto error; + /* NR MIB: frame, slot, data */ f = get_format(database, nr_mib_id); @@ -612,7 +646,7 @@ int main(int n, char **v) int in; int i; int ul_id, dl_id, mib_id, preamble_id, rar_id; - int nr_ul_id, nr_dl_id, nr_mib_id, nr_rar_id; + int nr_ul_id, nr_dl_id, nr_dl_retx_id, nr_mib_id, nr_rar_id; int sr_id; ev_data d; char *ip = DEFAULT_IP; @@ -692,6 +726,7 @@ int main(int n, char **v) on_off(database, "GNB_MAC_UL_PDU_WITH_DATA", is_on, 1); on_off(database, "GNB_MAC_DL_PDU_WITH_DATA", is_on, 1); + on_off(database, "GNB_MAC_RETRANSMISSION_DL_PDU_WITH_DATA", is_on, 1); on_off(database, "GNB_PHY_MIB", is_on, 1); on_off(database, "GNB_MAC_DL_RAR_PDU_WITH_DATA", is_on, 1); @@ -715,11 +750,12 @@ int main(int n, char **v) nr_ul_id = event_id_from_name(database, "GNB_MAC_UL_PDU_WITH_DATA"); nr_dl_id = event_id_from_name(database, "GNB_MAC_DL_PDU_WITH_DATA"); + nr_dl_retx_id = event_id_from_name(database, "GNB_MAC_RETRANSMISSION_DL_PDU_WITH_DATA"); nr_mib_id = event_id_from_name(database, "GNB_PHY_MIB"); nr_rar_id = event_id_from_name(database, "GNB_MAC_DL_RAR_PDU_WITH_DATA"); setup_data(&d, database, ul_id, dl_id, mib_id, preamble_id, rar_id, sr_id, - nr_ul_id, nr_dl_id, nr_mib_id, nr_rar_id); + nr_ul_id, nr_dl_id, nr_dl_retx_id, nr_mib_id, nr_rar_id); register_handler_function(h, ul_id, ul, &d); register_handler_function(h, dl_id, dl, &d); @@ -730,6 +766,7 @@ int main(int n, char **v) register_handler_function(h, nr_ul_id, nr_ul, &d); register_handler_function(h, nr_dl_id, nr_dl, &d); + register_handler_function(h, nr_dl_retx_id, nr_dl_retx, &d); register_handler_function(h, nr_mib_id, nr_mib, &d); register_handler_function(h, nr_rar_id, nr_rar, &d); @@ -753,10 +790,11 @@ int main(int n, char **v) if (e.type == -1) break; - if (!(e.type == ul_id || e.type == dl_id || e.type == mib_id || - e.type == preamble_id || e.type == rar_id || e.type == sr_id || - e.type == nr_ul_id || e.type == nr_dl_id || - e.type == nr_mib_id || e.type == nr_rar_id)) continue; + if (!(e.type == ul_id || e.type == dl_id || e.type == mib_id || + e.type == preamble_id || e.type == rar_id || e.type == sr_id || + e.type == nr_ul_id || e.type == nr_dl_id || + e.type == nr_dl_retx_id || e.type == nr_mib_id || + e.type == nr_rar_id)) continue; handle_event(h, e); } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 568f8abc37..d8b168ae75 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -1200,6 +1200,9 @@ void nr_schedule_ue_spec(module_id_t module_id, "UE %d mismatch between scheduled TBS and buffered TB for HARQ PID %d\n", UE_id, current_harq_pid); + + T(T_GNB_MAC_RETRANSMISSION_DL_PDU_WITH_DATA, T_INT(module_id), T_INT(CC_id), T_INT(rnti), + T_INT(frame), T_INT(slot), T_INT(current_harq_pid), T_INT(harq->round), T_BUFFER(harq->tb, TBS)); } else { /* initial transmission */ LOG_D(NR_MAC, "[%s] Initial HARQ transmission in %d.%d\n", __FUNCTION__, frame, slot); From 9fc0da267a84c8926517e086a03b7a4582f7e6a7 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Tue, 23 Nov 2021 12:26:25 +0000 Subject: [PATCH 021/113] Fix build warnings --- openair1/PHY/CODING/crc_byte.c | 17 +++++++++-------- .../CODING/nrLDPC_encoder/ldpc_encoder_optim.c | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/openair1/PHY/CODING/crc_byte.c b/openair1/PHY/CODING/crc_byte.c index 987f692a32..277598b4b4 100644 --- a/openair1/PHY/CODING/crc_byte.c +++ b/openair1/PHY/CODING/crc_byte.c @@ -151,12 +151,12 @@ can use SIMD optimized Intel CRC for LTE/NR 24a/24b variants unsigned int crc24a (unsigned char * inptr, int bitlen) { + int octetlen = bitlen / 8; /* Change in octets */ - int octetlen, resbit; - unsigned int crc = 0; - octetlen = bitlen / 8; /* Change in octets */ - resbit = (bitlen % 8); #ifndef USE_INTEL_CRC + unsigned int crc = 0; + int resbit = (bitlen % 8); + while (octetlen-- > 0) { // printf("crc24a: in %x => crc %x\n",crc,*inptr); crc = (crc << 8) ^ crc24aTable[(*inptr++) ^ (crc >> 24)]; @@ -185,11 +185,12 @@ static DECLARE_ALIGNED(struct crc_pclmulqdq_ctx lte_crc24b_pclmulqdq, 16) = { unsigned int crc24b (unsigned char * inptr, int bitlen) { - int octetlen, resbit; - unsigned int crc = 0; - octetlen = bitlen / 8; /* Change in octets */ - resbit = (bitlen % 8); + int octetlen = bitlen / 8; /* Change in octets */ + #ifndef USE_INTEL_CRC + unsigned int crc = 0; + int resbit = (bitlen % 8); + while (octetlen-- > 0) { // printf("crc24b: in %x => crc %x (%x)\n",crc,*inptr,crc24bTable[(*inptr) ^ (crc >> 24)]); crc = (crc << 8) ^ crc24bTable[(*inptr++) ^ (crc >> 24)]; diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim.c index 7baa5d2c94..056ead3ab1 100644 --- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim.c +++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim.c @@ -50,7 +50,7 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc { short nrows=0,ncols=0; - int i,i1,rate=3; + int i,rate=3; int no_punctured_columns,removed_bit; int simd_size; From df9e492d02fd23f7b916ee7ae8116273177b6e6a Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 29 Nov 2021 16:39:05 +0100 Subject: [PATCH 022/113] removing bwp from pdcch_pdu_idx and cce_list --- openair1/SIMULATION/NR_PHY/dlsim.c | 4 ++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 10 ++++------ openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 12 ++++++------ openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 9 ++++----- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 9 ++------- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 8 ++------ openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 6 +++--- 8 files changed, 24 insertions(+), 36 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 51fdfc917e..72e8d11be6 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -1038,8 +1038,8 @@ int main(int argc, char **argv) while ((roundack==0)) { - memset(RC.nrmac[0]->cce_list[1][0],0,MAX_NUM_CCE*sizeof(int)); - memset(RC.nrmac[0]->cce_list[1][1],0,MAX_NUM_CCE*sizeof(int)); + memset(RC.nrmac[0]->cce_list[0],0,MAX_NUM_CCE*sizeof(int)); + memset(RC.nrmac[0]->cce_list[1],0,MAX_NUM_CCE*sizeof(int)); clear_nr_nfapi_information(RC.nrmac[0], 0, frame, slot); UE_info->UE_sched_ctrl[0].harq_processes[harq_pid].ndi = !(trial&1); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 4c0e9dab9f..c4e1fbff96 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -67,7 +67,7 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB, const int num_slots = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; nfapi_nr_dl_tti_request_t *DL_req = &gNB->DL_req[0]; - nfapi_nr_dl_tti_pdcch_pdu_rel15_t ***pdcch = (nfapi_nr_dl_tti_pdcch_pdu_rel15_t ***)gNB->pdcch_pdu_idx[CC_idP]; + nfapi_nr_dl_tti_pdcch_pdu_rel15_t **pdcch = (nfapi_nr_dl_tti_pdcch_pdu_rel15_t **)gNB->pdcch_pdu_idx[CC_idP]; nfapi_nr_ul_tti_request_t *future_ul_tti_req = &gNB->UL_tti_req_ahead[CC_idP][(slotP + num_slots - 1) % num_slots]; nfapi_nr_ul_dci_request_t *UL_dci_req = &gNB->UL_dci_req[0]; @@ -80,7 +80,7 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB, DL_req[CC_idP].dl_tti_request_body.nPDUs = 0; DL_req[CC_idP].dl_tti_request_body.nGroup = 0; //DL_req[CC_idP].dl_tti_request_body.transmission_power_pcfich = 6000; - memset(pdcch, 0, sizeof(**pdcch) * MAX_NUM_BWP * MAX_NUM_CORESET); + memset(pdcch, 0, sizeof(*pdcch) * MAX_NUM_CORESET); UL_dci_req[CC_idP].SFN = frameP; UL_dci_req[CC_idP].Slot = slotP; @@ -276,7 +276,6 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, protocol_ctxt_t ctxt={0}; PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, NOT_A_RNTI, frame, slot,module_idP); - const int bwp_id = 1; char stats_output[16384]; gNB_MAC_INST *gNB = RC.nrmac[module_idP]; @@ -307,9 +306,8 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, nr_rrc_trigger(&ctxt, 0 /*CC_id*/, frame, slot >> *scc->ssbSubcarrierSpacing); } - memset(RC.nrmac[module_idP]->cce_list[0][0],0,MAX_NUM_CCE*sizeof(int)); // coreset0 - memset(RC.nrmac[module_idP]->cce_list[0][1],0,MAX_NUM_CCE*sizeof(int)); // coreset1 on initialBWP - memset(RC.nrmac[module_idP]->cce_list[bwp_id][1],0,MAX_NUM_CCE*sizeof(int)); // coresetid 1 + memset(RC.nrmac[module_idP]->cce_list[0],0,MAX_NUM_CCE*sizeof(int)); // coreset0 + memset(RC.nrmac[module_idP]->cce_list[1],0,MAX_NUM_CCE*sizeof(int)); // coreset1 NR_UE_info_t *UE_info = &RC.nrmac[module_idP]->UE_info; for (int UE_id = UE_info->list.head; UE_id >= 0; UE_id = UE_info->list.next[UE_id]) for (int i=0; iUL_dci_req[CC_id]; const int coresetid = coreset->controlResourceSetId; - nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15 = nr_mac->pdcch_pdu_idx[CC_id][ra->bwp_id][coresetid]; + nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15 = nr_mac->pdcch_pdu_idx[CC_id][coresetid]; if (!pdcch_pdu_rel15) { nfapi_nr_ul_dci_request_pdus_t *ul_dci_request_pdu = &ul_dci_req->ul_dci_pdu_list[ul_dci_req->numPdus]; memset(ul_dci_request_pdu, 0, sizeof(nfapi_nr_ul_dci_request_pdus_t)); @@ -789,7 +789,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t pdcch_pdu_rel15 = &ul_dci_request_pdu->pdcch_pdu.pdcch_pdu_rel15; ul_dci_req->numPdus += 1; nr_configure_pdcch(nr_mac, pdcch_pdu_rel15, ss, coreset, scc, genericParameters, NULL); - nr_mac->pdcch_pdu_idx[CC_id][ra->bwp_id][coresetid] = pdcch_pdu_rel15; + nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu_rel15; } uint8_t aggregation_level; @@ -1196,7 +1196,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra // important if we have multiple RAs, and the DLSCH has to reuse them, so we need to mark them const int bwpid = bwp ? bwp->bwp_Id : 0; const int coresetid = coreset->controlResourceSetId; - nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15 = nr_mac->pdcch_pdu_idx[CC_id][bwpid][coresetid]; + nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15 = nr_mac->pdcch_pdu_idx[CC_id][coresetid]; if (!pdcch_pdu_rel15) { nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdcch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; memset(dl_tti_pdcch_pdu, 0, sizeof(nfapi_nr_dl_tti_request_pdu_t)); @@ -1205,7 +1205,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra dl_req->nPDUs += 1; pdcch_pdu_rel15 = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; nr_configure_pdcch(nr_mac, pdcch_pdu_rel15, ss, coreset, scc, genericParameters, NULL); - nr_mac->pdcch_pdu_idx[CC_id][bwpid][coresetid] = pdcch_pdu_rel15; + nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu_rel15; } nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdsch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; @@ -1572,7 +1572,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra // important if we have multiple RAs, and the DLSCH has to reuse them, so we need to mark them const int bwpid = bwp ? bwp->bwp_Id : 0; const int coresetid = coreset->controlResourceSetId; - nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15 = nr_mac->pdcch_pdu_idx[CC_id][bwpid][coresetid]; + nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15 = nr_mac->pdcch_pdu_idx[CC_id][coresetid]; if (!pdcch_pdu_rel15) { nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdcch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; memset(dl_tti_pdcch_pdu, 0, sizeof(nfapi_nr_dl_tti_request_pdu_t)); @@ -1581,7 +1581,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra dl_req->nPDUs += 1; pdcch_pdu_rel15 = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; nr_configure_pdcch(nr_mac, pdcch_pdu_rel15, ss, coreset, scc, genericParameters, NULL); - nr_mac->pdcch_pdu_idx[CC_id][bwpid][coresetid] = pdcch_pdu_rel15; + nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu_rel15; } nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdsch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 0e01702d77..bbae3c48a2 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -627,7 +627,7 @@ bool allocate_dl_retransmission(module_id_t module_id, slot); int cid = sched_ctrl->coreset->controlResourceSetId; UE_info->num_pdcch_cand[UE_id][cid]--; - int *cce_list = RC.nrmac[module_id]->cce_list[sched_ctrl->active_bwp?sched_ctrl->active_bwp->bwp_Id:0][cid]; + int *cce_list = RC.nrmac[module_id]->cce_list[cid]; for (int i = 0; i < sched_ctrl->aggregation_level; i++) cce_list[sched_ctrl->cce_index + i] = 0; return false; @@ -732,7 +732,6 @@ void pf_dl(module_id_t module_id, NR_BWP_DownlinkDedicated_t *bwpd= cg ? cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP:NULL; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; - int bwp_Id = sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0; const uint16_t rnti = UE_info->rnti[UE_id]; NR_BWP_t *genericParameters = sched_ctrl->active_bwp ? &sched_ctrl->active_bwp->bwp_Common->genericParameters: @@ -764,7 +763,7 @@ void pf_dl(module_id_t module_id, slot); int cid = sched_ctrl->coreset->controlResourceSetId; UE_info->num_pdcch_cand[UE_id][cid]--; - int *cce_list = mac->cce_list[bwp_Id][cid]; + int *cce_list = mac->cce_list[cid]; for (int i = 0; i < sched_ctrl->aggregation_level; i++) cce_list[sched_ctrl->cce_index + i] = 0; return; @@ -995,7 +994,7 @@ void nr_schedule_ue_spec(module_id_t module_id, const int bwpid = bwp ? bwp->bwp_Id : 0; const int coresetid = (bwp||bwpd) ? sched_ctrl->coreset->controlResourceSetId : gNB_mac->sched_ctrlCommon->coreset->controlResourceSetId; - nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu = gNB_mac->pdcch_pdu_idx[CC_id][bwpid][coresetid]; + nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu = gNB_mac->pdcch_pdu_idx[CC_id][coresetid]; if (!pdcch_pdu) { nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdcch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; memset(dl_tti_pdcch_pdu, 0, sizeof(nfapi_nr_dl_tti_request_pdu_t)); @@ -1007,7 +1006,7 @@ void nr_schedule_ue_spec(module_id_t module_id, NR_SearchSpace_t *ss = (bwp||bwpd) ? sched_ctrl->search_space:gNB_mac->sched_ctrlCommon->search_space; NR_ControlResourceSet_t *coreset = (bwp||bwpd)? sched_ctrl->coreset:gNB_mac->sched_ctrlCommon->coreset; nr_configure_pdcch(gNB_mac, pdcch_pdu, ss, coreset, scc, genericParameters, NULL); - gNB_mac->pdcch_pdu_idx[CC_id][bwpid][coresetid] = pdcch_pdu; + gNB_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu; } nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdsch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index f1005cea70..75f3a1ae8d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -358,7 +358,7 @@ void nr_preprocessor_phytest(module_id_t module_id, frame, slot); UE_info->num_pdcch_cand[UE_id][cid]--; - int *cce_list = RC.nrmac[module_id]->cce_list[sched_ctrl->active_bwp->bwp_Id][cid]; + int *cce_list = RC.nrmac[module_id]->cce_list[cid]; for (int i = 0; i < sched_ctrl->aggregation_level; i++) cce_list[sched_ctrl->cce_index + i] = 0; return; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 7387bfe698..4f455e0b92 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -218,12 +218,7 @@ int allocate_nr_CCEs(gNB_MAC_INST *nr_mac, int coreset_id = coreset->controlResourceSetId; - int *cce_list; - if(bwp == NULL) { - cce_list = nr_mac->cce_list[0][coreset_id]; - } else { - cce_list = nr_mac->cce_list[bwp->bwp_Id][coreset_id]; - } + int *cce_list = nr_mac->cce_list[coreset_id]; int n_rb=0; for (int i=0;i<6;i++) @@ -2410,7 +2405,7 @@ bool find_free_CCE(module_id_t module_id, const int cid = sched_ctrl->coreset->controlResourceSetId; const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid][slot]; const int m = RC.nrmac[module_id]->UE_info.num_pdcch_cand[UE_id][cid]; - if (UE_id >= 0) LOG_D(NR_MAC,"calling allocate_nr_CCEs with L %d, nr_of_candidates %d, Y %x\n",sched_ctrl->aggregation_level,nr_of_candidates,Y); + if (UE_id >= 0) LOG_D(NR_MAC,"slot %d calling allocate_nr_CCEs with L %d, nr_of_candidates %d, Y %x\n",slot, sched_ctrl->aggregation_level,nr_of_candidates,Y); sched_ctrl->cce_index = allocate_nr_CCEs(RC.nrmac[module_id], sched_ctrl->active_bwp, sched_ctrl->coreset, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 9a6fa32b5f..bcc0832863 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1388,10 +1388,6 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) nfapi_nr_ul_dci_request_t *ul_dci_req = &RC.nrmac[module_id]->UL_dci_req[CC_id]; ul_dci_req->SFN = frame; ul_dci_req->Slot = slot; - /* a PDCCH PDU groups DCIs per BWP and CORESET. Save a pointer to each - * allocated PDCCH so we can easily allocate UE's DCIs independent of any - * CORESET order */ - nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_bwp_coreset[MAX_NUM_BWP][MAX_NUM_CORESET] = {{0}}; NR_ServingCellConfigCommon_t *scc = RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon; NR_UE_info_t *UE_info = &RC.nrmac[module_id]->UE_info; @@ -1628,7 +1624,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) NR_SearchSpace_t *ss = (sched_ctrl->active_bwp || ubwpd) ? sched_ctrl->search_space: RC.nrmac[module_id]->sched_ctrlCommon->search_space; NR_ControlResourceSet_t *coreset = (sched_ctrl->active_bwp || ubwpd) ? sched_ctrl->coreset: RC.nrmac[module_id]->sched_ctrlCommon->coreset; const int coresetid = coreset->controlResourceSetId; - nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu = pdcch_pdu_bwp_coreset[bwpid][coresetid]; + nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu = nr_mac->pdcch_pdu_idx[CC_id][coresetid]; if (!pdcch_pdu) { nfapi_nr_ul_dci_request_pdus_t *ul_dci_request_pdu = &ul_dci_req->ul_dci_pdu_list[ul_dci_req->numPdus]; memset(ul_dci_request_pdu, 0, sizeof(nfapi_nr_ul_dci_request_pdus_t)); @@ -1637,7 +1633,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) pdcch_pdu = &ul_dci_request_pdu->pdcch_pdu.pdcch_pdu_rel15; ul_dci_req->numPdus += 1; nr_configure_pdcch(nr_mac, pdcch_pdu, ss, coreset, scc, genericParameters, NULL); - pdcch_pdu_bwp_coreset[bwpid][coresetid] = pdcch_pdu; + nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu; } LOG_D(NR_MAC,"Configuring ULDCI/PDCCH in %d.%d at CCE %d, rnti %x\n", frame,slot,sched_ctrl->cce_index,rnti); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 27f42f4b1d..99e21b6560 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -73,7 +73,7 @@ /* Defs */ #define MAX_NUM_BWP 2 -#define MAX_NUM_CORESET 2 +#define MAX_NUM_CORESET 12 #define MAX_NUM_CCE 90 #define MAX_HARQ_ROUNDS 4 /*!\brief Maximum number of random access process */ @@ -703,7 +703,7 @@ typedef struct gNB_MAC_INST_s { /// a PDCCH PDU groups DCIs per BWP and CORESET. The following structure /// keeps pointers to PDCCH PDUs within DL_req so that we can easily track /// PDCCH PDUs per CC/BWP/CORESET - nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_idx[NFAPI_CC_MAX][MAX_NUM_BWP][MAX_NUM_CORESET]; + nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_idx[NFAPI_CC_MAX][MAX_NUM_CORESET]; /// NFAPI UL TTI Request Structure, simple pointer into structure /// UL_tti_req_ahead for current frame/slot nfapi_nr_ul_tti_request_t *UL_tti_req[NFAPI_CC_MAX]; @@ -743,7 +743,7 @@ typedef struct gNB_MAC_INST_s { /// processing time of eNB PCH scheduler time_stats_t schedule_pch; /// CCE lists - int cce_list[MAX_NUM_BWP][MAX_NUM_CORESET][MAX_NUM_CCE]; + int cce_list[MAX_NUM_CORESET][MAX_NUM_CCE]; /// list of allocated beams per period int16_t *tdd_beam_association; From 99250c95249c1f40acc90d94da2e31356db93997 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 30 Nov 2021 09:27:07 +0100 Subject: [PATCH 023/113] fix for Y --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 4 ++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index 75f3a1ae8d..596169cc29 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -334,7 +334,7 @@ void nr_preprocessor_phytest(module_id_t module_id, AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n"); const int cid = sched_ctrl->coreset->controlResourceSetId; - const uint16_t Y = UE_info->Y[UE_id][cid][slot]; + const uint16_t Y = UE_info->Y[UE_id][cid%3][slot]; const int m = UE_info->num_pdcch_cand[UE_id][cid]; sched_ctrl->cce_index = allocate_nr_CCEs(RC.nrmac[module_id], sched_ctrl->active_bwp, @@ -501,7 +501,7 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n"); const int cid = sched_ctrl->coreset->controlResourceSetId; - const uint16_t Y = UE_info->Y[UE_id][cid][slot]; + const uint16_t Y = UE_info->Y[UE_id][cid%3][slot]; const int m = UE_info->num_pdcch_cand[UE_id][cid]; sched_ctrl->cce_index = allocate_nr_CCEs(RC.nrmac[module_id], sched_ctrl->active_bwp, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 4f455e0b92..36ae3c607f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2403,7 +2403,7 @@ bool find_free_CCE(module_id_t module_id, } AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n"); const int cid = sched_ctrl->coreset->controlResourceSetId; - const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid][slot]; + const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid%3][slot]; const int m = RC.nrmac[module_id]->UE_info.num_pdcch_cand[UE_id][cid]; if (UE_id >= 0) LOG_D(NR_MAC,"slot %d calling allocate_nr_CCEs with L %d, nr_of_candidates %d, Y %x\n",slot, sched_ctrl->aggregation_level,nr_of_candidates,Y); sched_ctrl->cce_index = allocate_nr_CCEs(RC.nrmac[module_id], From 242828dd29011bf508f1963beea3890c56caafba Mon Sep 17 00:00:00 2001 From: Laurent Thomas Date: Wed, 1 Dec 2021 15:59:16 +0100 Subject: [PATCH 024/113] hardcode instruction set usage: Carry-less Multiplication on intel/AMD --- cmake_targets/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 71e030dad3..5547227af9 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -315,9 +315,9 @@ add_definitions("-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAV set(commonOpts "-pipe -Wno-packed-bitfield-compat -fPIC -Wall -fno-strict-aliasing -rdynamic") set(CMAKE_C_FLAGS - "${CMAKE_C_FLAGS} ${C_FLAGS_PROCESSOR} ${commonOpts} -std=gnu99 -funroll-loops -march=native") + "${CMAKE_C_FLAGS} ${C_FLAGS_PROCESSOR} ${commonOpts} -std=gnu99 -funroll-loops -mpclmul") set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} ${commonOpts} -std=c++11 -march=native") + "${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} ${commonOpts} -std=c++11 -mpclmul") From 3d10b9fc41eace583216ac3f40fb622b28360036 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 2 Dec 2021 10:08:55 +0100 Subject: [PATCH 025/113] symbol-wise vrb map occupation for dl --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 24 +++---- .../LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 5 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 63 ++++++++++++------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 24 ++++--- 4 files changed, 70 insertions(+), 46 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 28c95e87f7..8a9c5b3f52 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -1144,13 +1144,19 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra BWPSize = type0_PDCCH_CSS_config->num_rbs; } + // Calculate number of symbols + int startSymbolIndex, nrOfSymbols; + const int startSymbolAndLength = pdsch_TimeDomainAllocationList->list.array[time_domain_assignment]->startSymbolAndLength; + SLIV2SL(startSymbolAndLength, &startSymbolIndex, &nrOfSymbols); + AssertFatal(startSymbolIndex >= 0, "StartSymbolIndex is negative\n"); + coreset = get_coreset(module_idP, scc, bwp, ss, NR_SearchSpace__searchSpaceType_PR_common); AssertFatal(coreset!=NULL,"Coreset cannot be null for RA-Msg2\n"); uint16_t *vrb_map = cc[CC_id].vrb_map; for (int i = 0; (i < rbSize) && (rbStart <= (BWPSize - rbSize)); i++) { - if (vrb_map[BWPStart + rbStart + i]) { + if (vrb_map[BWPStart + rbStart + i]&(((1<list.array[time_domain_assignment]->startSymbolAndLength; - SLIV2SL(startSymbolAndLength, &startSymbolIndex, &nrOfSymbols); - AssertFatal(startSymbolIndex >= 0, "StartSymbolIndex is negative\n"); - LOG_D(NR_MAC,"Msg2 startSymbolIndex.nrOfSymbols %d.%d\n",startSymbolIndex,nrOfSymbols); int mappingtype = pdsch_TimeDomainAllocationList->list.array[time_domain_assignment]->mappingType; @@ -1362,9 +1362,9 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra nr_mac->TX_req[CC_id].Number_of_PDUs++; nr_mac->TX_req[CC_id].Slot = slotP; - // Mark the corresponding RBs as used + // Mark the corresponding symbols RBs as used for (int rb = 0; rb < rbSize; rb++) { - vrb_map[BWPStart + rb + rbStart] = 1; + vrb_map[BWPStart + rb + rbStart] = ((1<state = WAIT_Msg3; @@ -1547,7 +1547,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra int i = 0; while ((i < rbSize) && (rbStart + rbSize <= BWPSize)) { - if (vrb_map[BWPStart + rbStart + i]) { + if (vrb_map[BWPStart + rbStart + i]&(((1<TX_req[CC_id].Number_of_PDUs++; nr_mac->TX_req[CC_id].Slot = slotP; - // Mark the corresponding RBs as used + // Mark the corresponding symbols and RBs as used for (int rb = 0; rb < pdsch_pdu_rel15->rbSize; rb++) { - vrb_map[BWPStart + rb + pdsch_pdu_rel15->rbStart] = 1; + vrb_map[BWPStart + rb + pdsch_pdu_rel15->rbStart] = ((1<BWPSize); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index df25b085e6..7f7a202fc4 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -384,7 +384,7 @@ uint32_t schedule_control_sib1(module_id_t module_id, int rbSize = 0; uint32_t TBS = 0; do { - if(rbSize < bwpSize && !vrb_map[rbStart + rbSize]) + if(rbSize < bwpSize && !(vrb_map[rbStart + rbSize]&(((1<sched_ctrlCommon->sched_pdsch.mcs<10) @@ -411,10 +411,9 @@ uint32_t schedule_control_sib1(module_id_t module_id, LOG_D(MAC,"dmrs_length %d\n",dmrs_length); LOG_D(MAC,"N_PRB_DMRS = %d\n",N_PRB_DMRS); LOG_D(MAC,"mappingtype = %d\n", mappingtype); - // Mark the corresponding RBs as used for (int rb = 0; rb < gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize; rb++) { - vrb_map[rb + rbStart] = 1; + vrb_map[rb + rbStart] = ((1<rbSize) { rbStart += rbSize; /* last iteration rbSize was not enough, skip it */ rbSize = 0; - while (rbStart < bwpSize && !rballoc_mask[rbStart]) + while (rbStart < bwpSize && + !(rballoc_mask[rbStart]&(((1<nrOfSymbols)-1)<startSymbolIndex))) rbStart++; if (rbStart >= bwpSize) { LOG_D(NR_MAC, "cannot allocate retransmission for UE %d/RNTI %04x: no resources\n", UE_id, UE_info->rnti[UE_id]); return false; } - while (rbStart + rbSize < bwpSize && rballoc_mask[rbStart + rbSize] && rbSize < retInfo->rbSize) + while (rbStart + rbSize < bwpSize && + (rballoc_mask[rbStart + rbSize]&(((1<nrOfSymbols)-1)<startSymbolIndex)) && + rbSize < retInfo->rbSize) rbSize++; } /* check whether we need to switch the TDA allocation since the last @@ -577,13 +580,15 @@ bool allocate_dl_retransmission(module_id_t module_id, } else { /* the retransmission will use a different time domain allocation, check * that we have enough resources */ - while (rbStart < bwpSize && !rballoc_mask[rbStart]) - rbStart++; - while (rbStart + rbSize < bwpSize && rballoc_mask[rbStart + rbSize]) - rbSize++; NR_pdsch_semi_static_t temp_ps; temp_ps.nrOfLayers = 1; nr_set_pdsch_semi_static(scc, cg, sched_ctrl->active_bwp, bwpd, tda, f, &temp_ps); + while (rbStart < bwpSize && + !(rballoc_mask[rbStart]&(((1<nrOfSymbols)-1)<startSymbolIndex))) + rbStart++; + while (rbStart + rbSize < bwpSize && + (rballoc_mask[rbStart + rbSize]&(((1<nrOfSymbols)-1)<startSymbolIndex))) + rbSize++; uint32_t new_tbs; uint16_t new_rbSize; bool success = nr_find_nb_rb(retInfo->Qm, @@ -642,7 +647,7 @@ bool allocate_dl_retransmission(module_id_t module_id, /* retransmissions: directly allocate */ *n_rb_sched -= sched_ctrl->sched_pdsch.rbSize; for (int rb = 0; rb < sched_ctrl->sched_pdsch.rbSize; rb++) - rballoc_mask[rb + sched_ctrl->sched_pdsch.rbStart] = 0; + rballoc_mask[rb + sched_ctrl->sched_pdsch.rbStart] -= (((1<nrOfSymbols)-1)<startSymbolIndex); return true; } @@ -655,7 +660,7 @@ void pf_dl(module_id_t module_id, NR_list_t *UE_list, int max_num_ue, int n_rb_sched, - uint8_t *rballoc_mask) { + uint16_t *rballoc_mask) { gNB_MAC_INST *mac = RC.nrmac[module_id]; NR_UE_info_t *UE_info = &mac->UE_info; @@ -769,13 +774,6 @@ void pf_dl(module_id_t module_id, return; } - // Freq-demain allocation - while (rbStart < bwpSize && !rballoc_mask[rbStart]) rbStart++; - - uint16_t max_rbSize = 1; - while (rbStart + max_rbSize < bwpSize && rballoc_mask[rbStart + max_rbSize]) - max_rbSize++; - /* MCS has been set above */ const int tda = RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0][slot]; @@ -785,6 +783,17 @@ void pf_dl(module_id_t module_id, const long f = (sched_ctrl->active_bwp || bwpd) ? sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0; if (ps->time_domain_allocation != tda) nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, f, ps); + + // Freq-demain allocation + while (rbStart < bwpSize && + !(rballoc_mask[rbStart]&(((1<nrOfSymbols)-1)<startSymbolIndex))) + rbStart++; + + uint16_t max_rbSize = 1; + while (rbStart + max_rbSize < bwpSize && + (rballoc_mask[rbStart + max_rbSize]&(((1<nrOfSymbols)-1)<startSymbolIndex))) + max_rbSize++; + sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->pucch_allocation = alloc; @@ -806,7 +815,7 @@ void pf_dl(module_id_t module_id, /* transmissions: directly allocate */ n_rb_sched -= sched_pdsch->rbSize; for (int rb = 0; rb < sched_pdsch->rbSize; rb++) - rballoc_mask[rb + sched_pdsch->rbStart] = 0; + rballoc_mask[rb + sched_pdsch->rbStart] -= (((1<nrOfSymbols)-1)<startSymbolIndex); } } @@ -819,9 +828,18 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t NR_ServingCellConfigCommon_t *scc = RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon; const int CC_id = 0; - /* Get bwpSize from the first UE */ + /* Get bwpSize and TDAfrom the first UE */ + /* This is temporary and it assumes all UEs have the same BWP and TDA*/ int UE_id = UE_info->list.head; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; + const int tda = RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0][slot]; + int startSymbolIndex, nrOfSymbols; + const struct NR_PDSCH_TimeDomainResourceAllocationList *tdaList = sched_ctrl->active_bwp ? + sched_ctrl->active_bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList : + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; + AssertFatal(tda < tdaList->list.count, "time_domain_allocation %d>=%d\n", tda, tdaList->list.count); + const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength; + SLIV2SL(startSymbolAndLength, &startSymbolIndex, &nrOfSymbols); const uint16_t bwpSize = NRRIV2BW(sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Common->genericParameters.locationAndBandwidth: @@ -833,13 +851,16 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t MAX_BWP_SIZE); uint16_t *vrb_map = RC.nrmac[module_id]->common_channels[CC_id].vrb_map; - uint8_t rballoc_mask[bwpSize]; + uint16_t rballoc_mask[bwpSize]; int n_rb_sched = 0; for (int i = 0; i < bwpSize; i++) { // calculate mask: init with "NOT" vrb_map: // if any RB in vrb_map is blocked (1), the current RBG will be 0 - rballoc_mask[i] = !vrb_map[i+BWPStart]; - n_rb_sched += rballoc_mask[i]; + rballoc_mask[i] = (~vrb_map[i+BWPStart])&0x3fff; //bitwise not and 14 symbols + // if all the pdsch symbols are free + if((rballoc_mask[i]&(((1<UE_sched_ctrl[UE_id]; + const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1; + const long f = sched_ctrl->active_bwp ? sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0; + NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; + ps->nrOfLayers = target_dl_Nl; + if (ps->time_domain_allocation != tda) + nr_set_pdsch_semi_static( + scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, NULL, tda, f, ps); + /* find largest unallocated chunk */ const int bwpSize = NRRIV2BW(sched_ctrl->active_bwp->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); const int BWPStart = NRRIV2PRBOFFSET(sched_ctrl->active_bwp->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); @@ -289,11 +297,14 @@ void nr_preprocessor_phytest(module_id_t module_id, /* loop ensures that we allocate exactly target_dl_bw, or return */ while (true) { /* advance to first free RB */ - while (rbStart < bwpSize && vrb_map[rbStart + BWPStart]) + while (rbStart < bwpSize && + (vrb_map[rbStart + BWPStart]&(((1<nrOfSymbols)-1)<startSymbolIndex))) rbStart++; rbSize = 1; /* iterate until we are at target_dl_bw or no available RBs */ - while (rbStart + rbSize < bwpSize && !vrb_map[rbStart + rbSize + BWPStart] && rbSize < target_dl_bw) + while (rbStart + rbSize < bwpSize && + !(vrb_map[rbStart + rbSize + BWPStart]&(((1<nrOfSymbols)-1)<startSymbolIndex)) && + rbSize < target_dl_bw) rbSize++; /* found target_dl_bw? */ if (rbSize == target_dl_bw) @@ -369,16 +380,9 @@ void nr_preprocessor_phytest(module_id_t module_id, // rnti, frame, slot); NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch; - NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; sched_pdsch->pucch_allocation = alloc; sched_pdsch->rbStart = rbStart; sched_pdsch->rbSize = rbSize; - const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1; - const long f = sched_ctrl->active_bwp ? sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0; - ps->nrOfLayers = target_dl_Nl; - if (ps->time_domain_allocation != tda) - nr_set_pdsch_semi_static( - scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, NULL, tda, f, ps); sched_pdsch->mcs = target_dl_mcs; sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); @@ -398,7 +402,7 @@ void nr_preprocessor_phytest(module_id_t module_id, /* mark the corresponding RBs as used */ for (int rb = 0; rb < sched_pdsch->rbSize; rb++) - vrb_map[rb + sched_pdsch->rbStart + BWPStart] = 1; + vrb_map[rb + sched_pdsch->rbStart + BWPStart] = ((1<nrOfSymbols)-1)<startSymbolIndex; if ((frame&127) == 0) LOG_D(MAC,"phytest: %d.%d DL mcs %d, DL rbStart %d, DL rbSize %d\n", frame, slot, sched_pdsch->mcs, rbStart,rbSize); } From 13d6147e03db0c40a80ef5f4826a2fb493d542de Mon Sep 17 00:00:00 2001 From: Laurent Thomas Date: Thu, 2 Dec 2021 13:31:15 +0100 Subject: [PATCH 026/113] fix code review and cross compilation issue --- openair1/PHY/CODING/crc_byte.c | 38 +++++++++++++++---------------- openair1/PHY/CODING/nrLDPC_defs.h | 20 ++++++++-------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/openair1/PHY/CODING/crc_byte.c b/openair1/PHY/CODING/crc_byte.c index 277598b4b4..c3b141db8e 100644 --- a/openair1/PHY/CODING/crc_byte.c +++ b/openair1/PHY/CODING/crc_byte.c @@ -153,22 +153,22 @@ unsigned int crc24a (unsigned char * inptr, { int octetlen = bitlen / 8; /* Change in octets */ -#ifndef USE_INTEL_CRC - unsigned int crc = 0; - int resbit = (bitlen % 8); - - while (octetlen-- > 0) { - // printf("crc24a: in %x => crc %x\n",crc,*inptr); - crc = (crc << 8) ^ crc24aTable[(*inptr++) ^ (crc >> 24)]; - } - - if (resbit > 0) - crc = (crc << resbit) ^ crc24aTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))]; - return crc; -#else - return crc32_calc_pclmulqdq(inptr, octetlen, 0, + if ( bitlen % 8 || !__builtin_cpu_supports ("pclmul") ) { + unsigned int crc = 0; + int resbit = (bitlen % 8); + + while (octetlen-- > 0) { + // printf("crc24a: in %x => crc %x\n",crc,*inptr); + crc = (crc << 8) ^ crc24aTable[(*inptr++) ^ (crc >> 24)]; + } + + if (resbit > 0) + crc = (crc << resbit) ^ crc24aTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))]; + return crc; + } else { + return crc32_calc_pclmulqdq(inptr, octetlen, 0, <e_crc24a_pclmulqdq); -#endif + } } @@ -186,8 +186,8 @@ unsigned int crc24b (unsigned char * inptr, int bitlen) { int octetlen = bitlen / 8; /* Change in octets */ - -#ifndef USE_INTEL_CRC + + if ( bitlen % 8 || !__builtin_cpu_supports ("pclmul") ) { unsigned int crc = 0; int resbit = (bitlen % 8); @@ -200,10 +200,10 @@ unsigned int crc24b (unsigned char * inptr, crc = (crc << resbit) ^ crc24bTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))]; return crc; -#else + } else { return crc32_calc_pclmulqdq(inptr, octetlen, 0, <e_crc24b_pclmulqdq); -#endif + } } unsigned int crc24c (unsigned char * inptr, diff --git a/openair1/PHY/CODING/nrLDPC_defs.h b/openair1/PHY/CODING/nrLDPC_defs.h index 67248d971c..0d7ff9ef9f 100644 --- a/openair1/PHY/CODING/nrLDPC_defs.h +++ b/openair1/PHY/CODING/nrLDPC_defs.h @@ -38,12 +38,12 @@ */ typedef struct { unsigned int n_segments; // optim8seg - unsigned int macro_num; // optim8segmulti - unsigned char gen_code; //orig - time_stats_t *tinput; - time_stats_t *tprep; - time_stats_t *tparity; - time_stats_t *toutput; + unsigned int macro_num; // optim8segmulti + unsigned char gen_code; //orig + time_stats_t *tinput; + time_stats_t *tprep; + time_stats_t *tparity; + time_stats_t *toutput; int Kr; uint32_t Kb; uint32_t *Zc; @@ -58,10 +58,10 @@ typedef struct { uint32_t F; /// LDPC-code outputs uint8_t *d[MAX_NUM_NR_DLSCH_SEGMENTS]; -}encoder_implemparams_t; +} encoder_implemparams_t; #define INIT0_LDPCIMPLEMPARAMS {0,0,0,NULL,NULL,NULL,NULL} -typedef void(*nrLDPC_initcallfunc_t)(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_out); -typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,short, short, encoder_implemparams_t*); +typedef void(*nrLDPC_initcallfunc_t)(t_nrLDPC_dec_params *p_decParams, int8_t *p_llr, int8_t *p_out); +typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,short, short, encoder_implemparams_t *); //============================================================================================================================ // decoder interface /** @@ -71,5 +71,5 @@ typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,sho \param p_llrOut Output vector \param p_profiler LDPC profiler statistics */ -typedef int32_t(*nrLDPC_decoderfunc_t)(t_nrLDPC_dec_params* , int8_t*, int8_t* , t_nrLDPC_procBuf* , t_nrLDPC_time_stats* ); +typedef int32_t(*nrLDPC_decoderfunc_t)(t_nrLDPC_dec_params *, int8_t *, int8_t *, t_nrLDPC_procBuf *, t_nrLDPC_time_stats * ); #endif From 5f0a9fba894e6623b51765606822a25dfc6c5253 Mon Sep 17 00:00:00 2001 From: francescomani Date: Sat, 4 Dec 2021 15:49:33 +0100 Subject: [PATCH 027/113] reworking handling pdcch at mac, including support for multiple pdcch pdu --- openair1/SIMULATION/NR_PHY/dlsim.c | 4 +- openair2/LAYER2/NR_MAC_gNB/config.c | 11 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 8 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 68 +++- .../LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 36 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 77 ++++- .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 57 ++-- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 316 +++++++++++------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 95 +++++- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 28 +- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 25 +- 11 files changed, 510 insertions(+), 215 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 72e8d11be6..affa7fd803 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -1038,8 +1038,6 @@ int main(int argc, char **argv) while ((roundack==0)) { - memset(RC.nrmac[0]->cce_list[0],0,MAX_NUM_CCE*sizeof(int)); - memset(RC.nrmac[0]->cce_list[1],0,MAX_NUM_CCE*sizeof(int)); clear_nr_nfapi_information(RC.nrmac[0], 0, frame, slot); UE_info->UE_sched_ctrl[0].harq_processes[harq_pid].ndi = !(trial&1); @@ -1047,7 +1045,7 @@ int main(int argc, char **argv) UE_info->UE_sched_ctrl[0].harq_processes[harq_pid].round = round; for (int i=0; iUE_info.num_pdcch_cand[0][i] = 0; + gNB_mac->UE_info.pdcch_cand[i] = 0; if (css_flag == 0) { nr_schedule_ue_spec(0, frame, slot); diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index cedd095794..a99f08b641 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -535,7 +535,6 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, if (CellGroup) { const NR_ServingCellConfig_t *servingCellConfig = CellGroup->spCellConfig->spCellConfigDedicated; - const struct NR_ServingCellConfig__downlinkBWP_ToAddModList *bwpList = servingCellConfig->downlinkBWP_ToAddModList; if(bwpList) { AssertFatal(bwpList->list.count > 0, "downlinkBWP_ToAddModList has no BWPs!\n"); @@ -605,6 +604,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, } LOG_I(NR_MAC,"Added new RA process for UE RNTI %04x with initial CellGroup\n", rnti); } else { // CellGroup has been updated + NR_ServingCellConfigCommon_t *scc = RC.nrmac[Mod_idP]->common_channels[0].ServingCellConfigCommon; const int UE_id = find_nr_UE_id(Mod_idP,rnti); int target_ss; UE_info->CellGroup[UE_id] = CellGroup; @@ -612,19 +612,28 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, process_CellGroup(CellGroup,&UE_info->UE_sched_ctrl[UE_id]); // update coreset/searchspace void *bwpd = NULL; + NR_BWP_t *genericParameters = NULL; target_ss = NR_SearchSpace__searchSpaceType_PR_common; if ((UE_info->UE_sched_ctrl[UE_id].active_bwp)) { target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific; bwpd = (void*)UE_info->UE_sched_ctrl[UE_id].active_bwp->bwp_Dedicated; + genericParameters = &UE_info->UE_sched_ctrl[UE_id].active_bwp->bwp_Common->genericParameters; } else if (CellGroup->spCellConfig && CellGroup->spCellConfig->spCellConfigDedicated && (CellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP)) { target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific; bwpd = (void*)CellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP; + genericParameters = &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters; } UE_info->UE_sched_ctrl[UE_id].search_space = get_searchspace(scc, bwpd, target_ss); UE_info->UE_sched_ctrl[UE_id].coreset = get_coreset(Mod_idP, scc, bwpd, UE_info->UE_sched_ctrl[UE_id].search_space, target_ss); + UE_info->UE_sched_ctrl[UE_id].sched_pdcch = set_pdcch_structure(RC.nrmac[Mod_idP], + UE_info->UE_sched_ctrl[UE_id].search_space, + UE_info->UE_sched_ctrl[UE_id].coreset, + scc, + genericParameters, + NULL); UE_info->UE_sched_ctrl[UE_id].maxL = 2; } } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index c4e1fbff96..1fd6417214 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -306,12 +306,8 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, nr_rrc_trigger(&ctxt, 0 /*CC_id*/, frame, slot >> *scc->ssbSubcarrierSpacing); } - memset(RC.nrmac[module_idP]->cce_list[0],0,MAX_NUM_CCE*sizeof(int)); // coreset0 - memset(RC.nrmac[module_idP]->cce_list[1],0,MAX_NUM_CCE*sizeof(int)); // coreset1 - NR_UE_info_t *UE_info = &RC.nrmac[module_idP]->UE_info; - for (int UE_id = UE_info->list.head; UE_id >= 0; UE_id = UE_info->list.next[UE_id]) - for (int i=0; inum_pdcch_cand[UE_id][i] = 0; + for (int i=0; ipdcch_cand[i] = 0; for (int CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { //mbsfn_status[CC_id] = 0; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 8a9c5b3f52..e5b96ccaa5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -581,12 +581,15 @@ void nr_initiate_ra_proc(module_id_t module_idP, NR_SearchSpaceId_t ra_SearchSpace = 0; struct NR_PDCCH_ConfigCommon__commonSearchSpaceList *commonSearchSpaceList = NULL; + NR_BWP_t *genericParameters = NULL; if(bwp) { commonSearchSpaceList = bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList; ra_SearchSpace = *bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->ra_SearchSpace; + genericParameters = &bwp->bwp_Common->genericParameters; } else { commonSearchSpaceList = scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList; ra_SearchSpace = *scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->ra_SearchSpace; + genericParameters = &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters; } AssertFatal(commonSearchSpaceList->list.count > 0, "common SearchSpace list has 0 elements\n"); @@ -599,6 +602,14 @@ void nr_initiate_ra_proc(module_id_t module_idP, AssertFatal(ra->ra_ss!=NULL,"SearchSpace cannot be null for RA\n"); + ra->coreset = get_coreset(module_idP, scc, bwp, ra->ra_ss, NR_SearchSpace__searchSpaceType_PR_common); + ra->sched_pdcch = set_pdcch_structure(nr_mac, + ra->ra_ss, + ra->coreset, + scc, + genericParameters, + NULL); + // retrieving ra pdcch monitoring period and offset find_monitoring_periodicity_offset_common(ra->ra_ss, &monitoring_slot_period, &monitoring_offset); @@ -774,7 +785,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t // generation of DCI 0_0 to schedule msg3 retransmission NR_SearchSpace_t *ss = ra->ra_ss; - NR_ControlResourceSet_t *coreset = get_coreset(module_idP, scc, NULL, ss, NR_SearchSpace__searchSpaceType_PR_common); + NR_ControlResourceSet_t *coreset = ra->coreset; AssertFatal(coreset!=NULL,"Coreset cannot be null for RA-Msg3 retransmission\n"); nfapi_nr_ul_dci_request_t *ul_dci_req = &nr_mac->UL_dci_req[CC_id]; @@ -788,7 +799,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t ul_dci_request_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_pdcch_pdu)); pdcch_pdu_rel15 = &ul_dci_request_pdu->pdcch_pdu.pdcch_pdu_rel15; ul_dci_req->numPdus += 1; - nr_configure_pdcch(nr_mac, pdcch_pdu_rel15, ss, coreset, scc, genericParameters, NULL); + nr_configure_pdcch(pdcch_pdu_rel15, coreset, genericParameters, ra->sched_pdcch); nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu_rel15; } @@ -800,7 +811,13 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t if(nr_of_candidates>0) break; } AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n"); - int CCEIndex = allocate_nr_CCEs(nr_mac, NULL, coreset, aggregation_level, 0, 0, nr_of_candidates); + int CCEIndex = find_pdcch_candidate(nr_mac, + CC_id, + aggregation_level, + nr_of_candidates, + ra->sched_pdcch, + coreset, + 0); if (CCEIndex < 0) { LOG_E(NR_MAC, "%s(): cannot find free CCE for RA RNTI %04x!\n", __func__, ra->rnti); return; @@ -841,6 +858,13 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t ra->bwp_id); // Mark the corresponding RBs as used + + fill_pdcch_vrb_map(nr_mac, + CC_id, + ra->sched_pdcch, + CCEIndex, + aggregation_level); + for (int rb = 0; rb < ra->msg3_nb_rb; rb++) { vrb_map_UL[rbStart + BWPStart + rb] = 1; } @@ -1150,7 +1174,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra SLIV2SL(startSymbolAndLength, &startSymbolIndex, &nrOfSymbols); AssertFatal(startSymbolIndex >= 0, "StartSymbolIndex is negative\n"); - coreset = get_coreset(module_idP, scc, bwp, ss, NR_SearchSpace__searchSpaceType_PR_common); + coreset = ra->coreset; AssertFatal(coreset!=NULL,"Coreset cannot be null for RA-Msg2\n"); @@ -1182,7 +1206,15 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra if(nr_of_candidates>0) break; } AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n"); - int CCEIndex = allocate_nr_CCEs(nr_mac, bwp, coreset, aggregation_level,0,0,nr_of_candidates); + + int CCEIndex = find_pdcch_candidate(nr_mac, + CC_id, + aggregation_level, + nr_of_candidates, + ra->sched_pdcch, + coreset, + 0); + if (CCEIndex < 0) { LOG_E(NR_MAC, "%s(): cannot find free CCE for RA RNTI %04x!\n", __func__, ra->rnti); return; @@ -1204,7 +1236,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra dl_tti_pdcch_pdu->PDUSize = (uint8_t)(2 + sizeof(nfapi_nr_dl_tti_pdcch_pdu)); dl_req->nPDUs += 1; pdcch_pdu_rel15 = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; - nr_configure_pdcch(nr_mac, pdcch_pdu_rel15, ss, coreset, scc, genericParameters, NULL); + nr_configure_pdcch(pdcch_pdu_rel15, coreset, genericParameters, ra->sched_pdcch); nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu_rel15; } @@ -1363,6 +1395,11 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra nr_mac->TX_req[CC_id].Slot = slotP; // Mark the corresponding symbols RBs as used + fill_pdcch_vrb_map(nr_mac, + CC_id, + ra->sched_pdcch, + CCEIndex, + aggregation_level); for (int rb = 0; rb < rbSize; rb++) { vrb_map[BWPStart + rb + rbStart] = ((1<downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; } - coreset = get_coreset(module_idP, scc, bwp, ss, NR_SearchSpace__searchSpaceType_PR_common); + coreset = ra->coreset; AssertFatal(coreset!=NULL,"Coreset cannot be null for RA-Msg4\n"); @@ -1447,7 +1484,15 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra if(nr_of_candidates>0) break; } AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n"); - int CCEIndex = allocate_nr_CCEs(nr_mac, bwp, coreset, aggregation_level,0,0,nr_of_candidates); + + int CCEIndex = find_pdcch_candidate(nr_mac, + CC_id, + aggregation_level, + nr_of_candidates, + ra->sched_pdcch, + coreset, + 0); + if (CCEIndex < 0) { LOG_E(NR_MAC, "%s(): cannot find free CCE for RA RNTI %04x!\n", __func__, ra->rnti); return; @@ -1580,7 +1625,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra dl_tti_pdcch_pdu->PDUSize = (uint8_t)(2 + sizeof(nfapi_nr_dl_tti_pdcch_pdu)); dl_req->nPDUs += 1; pdcch_pdu_rel15 = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; - nr_configure_pdcch(nr_mac, pdcch_pdu_rel15, ss, coreset, scc, genericParameters, NULL); + nr_configure_pdcch(pdcch_pdu_rel15, coreset, genericParameters, ra->sched_pdcch); nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu_rel15; } @@ -1722,6 +1767,11 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra nr_mac->TX_req[CC_id].Slot = slotP; // Mark the corresponding symbols and RBs as used + fill_pdcch_vrb_map(nr_mac, + CC_id, + ra->sched_pdcch, + CCEIndex, + aggregation_level); for (int rb = 0; rb < pdsch_pdu_rel15->rbSize; rb++) { vrb_map[BWPStart + rb + pdsch_pdu_rel15->rbStart] = ((1<common_channels[CC_id].vrb_map; + NR_COMMON_channels_t *cc = &gNB_mac->common_channels[CC_id]; + NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; + uint16_t *vrb_map = cc->vrb_map; if (gNB_mac->sched_ctrlCommon == NULL){ LOG_D(NR_MAC,"schedule_control_common: Filling nr_mac->sched_ctrlCommon\n"); @@ -340,6 +342,12 @@ uint32_t schedule_control_sib1(module_id_t module_id, fill_coresetZero(gNB_mac->sched_ctrlCommon->coreset,type0_PDCCH_CSS_config); gNB_mac->cset0_bwp_start = type0_PDCCH_CSS_config->cset_start_rb; gNB_mac->cset0_bwp_size = type0_PDCCH_CSS_config->num_rbs; + gNB_mac->sched_ctrlCommon->sched_pdcch = set_pdcch_structure(NULL, + gNB_mac->sched_ctrlCommon->search_space, + gNB_mac->sched_ctrlCommon->coreset, + scc, + NULL, + type0_PDCCH_CSS_config); } gNB_mac->sched_ctrlCommon->pdsch_semi_static.time_domain_allocation = time_domain_allocation; @@ -354,13 +362,13 @@ uint32_t schedule_control_sib1(module_id_t module_id, if (nr_of_candidates>0) break; // choosing the lower value of aggregation level available } AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n"); - gNB_mac->sched_ctrlCommon->cce_index = allocate_nr_CCEs(RC.nrmac[module_id], - NULL, - gNB_mac->sched_ctrlCommon->coreset, - gNB_mac->sched_ctrlCommon->aggregation_level, - 0, - candidate_idx, - nr_of_candidates); + gNB_mac->sched_ctrlCommon->cce_index = find_pdcch_candidate(gNB_mac, + CC_id, + gNB_mac->sched_ctrlCommon->aggregation_level, + nr_of_candidates, + gNB_mac->sched_ctrlCommon->sched_pdcch, + gNB_mac->sched_ctrlCommon->coreset, + 0); AssertFatal(gNB_mac->sched_ctrlCommon->cce_index >= 0, "Could not find CCE for coreset0\n"); @@ -412,6 +420,11 @@ uint32_t schedule_control_sib1(module_id_t module_id, LOG_D(MAC,"N_PRB_DMRS = %d\n",N_PRB_DMRS); LOG_D(MAC,"mappingtype = %d\n", mappingtype); // Mark the corresponding RBs as used + fill_pdcch_vrb_map(gNB_mac, + CC_id, + gNB_mac->sched_ctrlCommon->sched_pdcch, + gNB_mac->sched_ctrlCommon->cce_index, + gNB_mac->sched_ctrlCommon->aggregation_level); for (int rb = 0; rb < gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize; rb++) { vrb_map[rb + rbStart] = ((1<PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_pdcch_pdu)); dl_req->nPDUs += 1; nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15 = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; - nr_configure_pdcch(NULL, - pdcch_pdu_rel15, - gNB_mac->sched_ctrlCommon->search_space, + nr_configure_pdcch(pdcch_pdu_rel15, gNB_mac->sched_ctrlCommon->coreset, - scc, NULL, - type0_PDCCH_CSS_config); + gNB_mac->sched_ctrlCommon->sched_pdcch); nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdsch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; memset((void*)dl_tti_pdsch_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t)); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 30724db595..fd07b66bf6 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -612,8 +612,27 @@ bool allocate_dl_retransmission(module_id_t module_id, } /* Find a free CCE */ - bool freeCCE = find_free_CCE(module_id, slot, UE_id); - if (!freeCCE) { + const int cid = sched_ctrl->coreset->controlResourceSetId; + const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid%3][slot]; + uint8_t nr_of_candidates; + for (int i=0; i<5; i++) { + // for now taking the lowest value among the available aggregation levels + find_aggregation_candidates(&sched_ctrl->aggregation_level, + &nr_of_candidates, + sched_ctrl->search_space, + 1<0) break; + } + + int CCEIndex = find_pdcch_candidate(RC.nrmac[module_id], + /* CC_id = */ 0, + sched_ctrl->aggregation_level, + nr_of_candidates, + sched_ctrl->sched_pdcch, + sched_ctrl->coreset, + Y); + + if (CCEIndex<0) { LOG_D(MAC, "%4d.%2d could not find CCE for DL DCI retransmission UE %d/RNTI %04x\n", frame, slot, UE_id, UE_info->rnti[UE_id]); return false; @@ -630,14 +649,18 @@ bool allocate_dl_retransmission(module_id_t module_id, UE_info->rnti[UE_id], frame, slot); - int cid = sched_ctrl->coreset->controlResourceSetId; - UE_info->num_pdcch_cand[UE_id][cid]--; - int *cce_list = RC.nrmac[module_id]->cce_list[cid]; - for (int i = 0; i < sched_ctrl->aggregation_level; i++) - cce_list[sched_ctrl->cce_index + i] = 0; + RC.nrmac[module_id]->pdcch_cand[cid]--; return false; } + sched_ctrl->cce_index = CCEIndex; + + fill_pdcch_vrb_map(RC.nrmac[module_id], + /* CC_id = */ 0, + sched_ctrl->sched_pdcch, + CCEIndex, + sched_ctrl->aggregation_level); + /* just reuse from previous scheduling opportunity, set new start RB */ sched_ctrl->sched_pdsch = *retInfo; sched_ctrl->sched_pdsch.rbStart = rbStart; @@ -746,8 +769,27 @@ void pf_dl(module_id_t module_id, int rbStart = 0; // start wrt BWPstart /* Find a free CCE */ - bool freeCCE = find_free_CCE(module_id, slot, UE_id); - if (!freeCCE) { + const int cid = sched_ctrl->coreset->controlResourceSetId; + const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid%3][slot]; + uint8_t nr_of_candidates; + for (int i=0; i<5; i++) { + // for now taking the lowest value among the available aggregation levels + find_aggregation_candidates(&sched_ctrl->aggregation_level, + &nr_of_candidates, + sched_ctrl->search_space, + 1<0) break; + } + + int CCEIndex = find_pdcch_candidate(mac, + /* CC_id = */ 0, + sched_ctrl->aggregation_level, + nr_of_candidates, + sched_ctrl->sched_pdcch, + sched_ctrl->coreset, + Y); + + if (CCEIndex<0) { LOG_D(NR_MAC, "%4d.%2d could not find CCE for DL DCI UE %d/RNTI %04x\n", frame, slot, UE_id, rnti); continue; } @@ -766,14 +808,18 @@ void pf_dl(module_id_t module_id, rnti, frame, slot); - int cid = sched_ctrl->coreset->controlResourceSetId; - UE_info->num_pdcch_cand[UE_id][cid]--; - int *cce_list = mac->cce_list[cid]; - for (int i = 0; i < sched_ctrl->aggregation_level; i++) - cce_list[sched_ctrl->cce_index + i] = 0; + mac->pdcch_cand[cid]--; return; } + sched_ctrl->cce_index = CCEIndex; + + fill_pdcch_vrb_map(mac, + /* CC_id = */ 0, + sched_ctrl->sched_pdcch, + CCEIndex, + sched_ctrl->aggregation_level); + /* MCS has been set above */ const int tda = RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0][slot]; @@ -1024,9 +1070,8 @@ void nr_schedule_ue_spec(module_id_t module_id, dl_req->nPDUs += 1; pdcch_pdu = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; LOG_D(NR_MAC,"Trying to configure DL pdcch for UE %d, bwp %d, cs %d\n",UE_id,bwpid,coresetid); - NR_SearchSpace_t *ss = (bwp||bwpd) ? sched_ctrl->search_space:gNB_mac->sched_ctrlCommon->search_space; NR_ControlResourceSet_t *coreset = (bwp||bwpd)? sched_ctrl->coreset:gNB_mac->sched_ctrlCommon->coreset; - nr_configure_pdcch(gNB_mac, pdcch_pdu, ss, coreset, scc, genericParameters, NULL); + nr_configure_pdcch(pdcch_pdu, coreset, genericParameters, sched_ctrl->sched_pdcch); gNB_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index f5f8a91299..b691674b3e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -346,15 +346,16 @@ void nr_preprocessor_phytest(module_id_t module_id, const int cid = sched_ctrl->coreset->controlResourceSetId; const uint16_t Y = UE_info->Y[UE_id][cid%3][slot]; - const int m = UE_info->num_pdcch_cand[UE_id][cid]; - sched_ctrl->cce_index = allocate_nr_CCEs(RC.nrmac[module_id], - sched_ctrl->active_bwp, - sched_ctrl->coreset, - sched_ctrl->aggregation_level, - Y, - m, - nr_of_candidates); - AssertFatal(sched_ctrl->cce_index >= 0, + + int CCEIndex = find_pdcch_candidate(RC.nrmac[module_id], + CC_id, + sched_ctrl->aggregation_level, + nr_of_candidates, + sched_ctrl->sched_pdcch, + sched_ctrl->coreset, + Y); + + AssertFatal(CCEIndex >= 0, "%s(): could not find CCE for UE %d\n", __func__, UE_id); @@ -368,13 +369,18 @@ void nr_preprocessor_phytest(module_id_t module_id, rnti, frame, slot); - UE_info->num_pdcch_cand[UE_id][cid]--; - int *cce_list = RC.nrmac[module_id]->cce_list[cid]; - for (int i = 0; i < sched_ctrl->aggregation_level; i++) - cce_list[sched_ctrl->cce_index + i] = 0; + RC.nrmac[module_id]->pdcch_cand[cid]--; return; } + sched_ctrl->cce_index = CCEIndex; + + fill_pdcch_vrb_map(RC.nrmac[module_id], + CC_id, + sched_ctrl->sched_pdcch, + CCEIndex, + sched_ctrl->aggregation_level); + //AssertFatal(alloc, // "could not find uplink slot for PUCCH (RNTI %04x@%d.%d)!\n", // rnti, frame, slot); @@ -506,19 +512,20 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ const int cid = sched_ctrl->coreset->controlResourceSetId; const uint16_t Y = UE_info->Y[UE_id][cid%3][slot]; - const int m = UE_info->num_pdcch_cand[UE_id][cid]; - sched_ctrl->cce_index = allocate_nr_CCEs(RC.nrmac[module_id], - sched_ctrl->active_bwp, - sched_ctrl->coreset, - sched_ctrl->aggregation_level, - Y, - m, - nr_of_candidates); + + int CCEIndex = find_pdcch_candidate(nr_mac, + CC_id, + sched_ctrl->aggregation_level, + nr_of_candidates, + sched_ctrl->sched_pdcch, + sched_ctrl->coreset, + Y); + if (sched_ctrl->cce_index < 0) { LOG_E(MAC, "%s(): CCE list not empty, couldn't schedule PUSCH\n", __func__); + nr_mac->pdcch_cand[cid]--; return false; } - UE_info->num_pdcch_cand[UE_id][cid]++; const int mcs = target_ul_mcs; NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch; @@ -547,6 +554,12 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ >> 3; /* mark the corresponding RBs as used */ + fill_pdcch_vrb_map(nr_mac, + CC_id, + sched_ctrl->sched_pdcch, + CCEIndex, + sched_ctrl->aggregation_level); + for (int rb = rbStart; rb < rbStart + rbSize; rb++) vrb_map_UL[rb+BWPStart] = 1; return true; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 36ae3c607f..97405b6f32 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -159,6 +159,7 @@ NR_ControlResourceSet_t *get_coreset(module_id_t module_idP, NR_SearchSpace_t *ss, NR_SearchSpace__searchSpaceType_PR ss_type) { NR_ControlResourceSetId_t coreset_id = *ss->controlResourceSetId; + if (ss_type == NR_SearchSpace__searchSpaceType_PR_common) { // common search space NR_ControlResourceSet_t *coreset; if(coreset_id == 0) { @@ -208,48 +209,183 @@ NR_SearchSpace_t *get_searchspace(NR_ServingCellConfigCommon_t *scc, AssertFatal(0, "Couldn't find an adequate searchspace bwp_Dedicated %p\n",bwp_Dedicated); } -int allocate_nr_CCEs(gNB_MAC_INST *nr_mac, - NR_BWP_Downlink_t *bwp, - NR_ControlResourceSet_t *coreset, - int aggregation, - uint16_t Y, - int m, - int nr_of_candidates) { +NR_sched_pdcch_t *set_pdcch_structure(gNB_MAC_INST *gNB_mac, + NR_SearchSpace_t *ss, + NR_ControlResourceSet_t *coreset, + NR_ServingCellConfigCommon_t *scc, + NR_BWP_t *bwp, + NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config) { - int coreset_id = coreset->controlResourceSetId; + NR_sched_pdcch_t *pdcch = calloc(1,sizeof(NR_sched_pdcch_t)); - int *cce_list = nr_mac->cce_list[coreset_id]; + int sps; + AssertFatal(*ss->controlResourceSetId == coreset->controlResourceSetId, + "coreset id in SS %ld does not correspond to the one in coreset %ld", + *ss->controlResourceSetId, coreset->controlResourceSetId); - int n_rb=0; - for (int i=0;i<6;i++) - for (int j=0;j<8;j++) { - n_rb+=((coreset->frequencyDomainResources.buf[i]>>j)&1); + if (bwp) { // This is not for SIB1 + if(coreset->controlResourceSetId == 0){ + pdcch->BWPSize = gNB_mac->cset0_bwp_size; + pdcch->BWPStart = gNB_mac->cset0_bwp_start; } - n_rb*=6; + else { + pdcch->BWPSize = NRRIV2BW(bwp->locationAndBandwidth, MAX_BWP_SIZE); + pdcch->BWPStart = NRRIV2PRBOFFSET(bwp->locationAndBandwidth, MAX_BWP_SIZE); + } + pdcch->SubcarrierSpacing = bwp->subcarrierSpacing; + pdcch->CyclicPrefix = (bwp->cyclicPrefix==NULL) ? 0 : *bwp->cyclicPrefix; - uint16_t N_reg = n_rb * coreset->duration; - uint16_t n_CI = 0; + //AssertFatal(pdcch_scs==kHz15, "PDCCH SCS above 15kHz not allowed if a symbol above 2 is monitored"); + sps = bwp->cyclicPrefix == NULL ? 14 : 12; + } + else { + AssertFatal(type0_PDCCH_CSS_config!=NULL,"type0_PDCCH_CSS_config is null,bwp %p\n",bwp); + pdcch->BWPSize = type0_PDCCH_CSS_config->num_rbs; + pdcch->BWPStart = type0_PDCCH_CSS_config->cset_start_rb; + pdcch->SubcarrierSpacing = type0_PDCCH_CSS_config->scs_pdcch; + pdcch->CyclicPrefix = 0; + sps = 14; + } - const uint16_t N_cce = N_reg / NR_NB_REG_PER_CCE; - const uint16_t M_s_max = nr_of_candidates; + AssertFatal(ss->monitoringSymbolsWithinSlot!=NULL,"ss->monitoringSymbolsWithinSlot is null\n"); + AssertFatal(ss->monitoringSymbolsWithinSlot->buf!=NULL,"ss->monitoringSymbolsWithinSlot->buf is null\n"); - LOG_D(PHY,"allocate_NR_CCes : bwp_id %d, coreset_id %d : N_cce %d, m %d, nr_of_candidates %d, Y %d\n", - (int)(bwp ? bwp->bwp_Id : 0),coreset_id,N_cce,m,nr_of_candidates, Y); - //PDCCH candidate index m in CORESET exceeds the maximum number of PDCCH candidates - if(m >= nr_of_candidates) - return -1; + // for SPS=14 8 MSBs in positions 13 downto 6 + uint16_t monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | + (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps)); - int first_cce = aggregation * (( Y + CEILIDIV((m*N_cce),(aggregation*M_s_max)) + n_CI ) % CEILIDIV(N_cce,aggregation)); + for (int i=0; i>(sps-1-i))&1) { + pdcch->StartSymbolIndex=i; + break; + } + } - for (int i=0;iDurationSymbols = coreset->duration; - return(first_cce); + //cce-REG-MappingType + pdcch->CceRegMappingType = coreset->cce_REG_MappingType.present == NR_ControlResourceSet__cce_REG_MappingType_PR_interleaved? + NFAPI_NR_CCE_REG_MAPPING_INTERLEAVED : NFAPI_NR_CCE_REG_MAPPING_NON_INTERLEAVED; + if (pdcch->CceRegMappingType == NFAPI_NR_CCE_REG_MAPPING_INTERLEAVED) { + pdcch->RegBundleSize = (coreset->cce_REG_MappingType.choice.interleaved->reg_BundleSize == + NR_ControlResourceSet__cce_REG_MappingType__interleaved__reg_BundleSize_n6) ? 6 : (2+coreset->cce_REG_MappingType.choice.interleaved->reg_BundleSize); + pdcch->InterleaverSize = (coreset->cce_REG_MappingType.choice.interleaved->interleaverSize == + NR_ControlResourceSet__cce_REG_MappingType__interleaved__interleaverSize_n6) ? 6 : (2+coreset->cce_REG_MappingType.choice.interleaved->interleaverSize); + AssertFatal(scc->physCellId != NULL,"scc->physCellId is null\n"); + pdcch->ShiftIndex = coreset->cce_REG_MappingType.choice.interleaved->shiftIndex != NULL ? *coreset->cce_REG_MappingType.choice.interleaved->shiftIndex : *scc->physCellId; + } + else { + pdcch->RegBundleSize = 6; + pdcch->InterleaverSize = 0; + pdcch->ShiftIndex = 0; + } + + int N_rb = 0; // nb of rbs of coreset per symbol + for (int i=0;i<6;i++) { + for (int t=0;t<8;t++) { + N_rb+=((coreset->frequencyDomainResources.buf[i]>>t)&1); + } + } + pdcch->n_rb = N_rb*=6; // each bit of frequencyDomainResources represents 6 PRBs + + return pdcch; } + +uint8_t find_pdcch_candidate(gNB_MAC_INST *mac, + int cc_id, + int aggregation, + int nr_of_candidates, + NR_sched_pdcch_t *pdcch, + NR_ControlResourceSet_t *coreset, + uint16_t Y){ + + uint16_t *vrb_map = mac->common_channels[cc_id].vrb_map; + const int next_cand = mac->pdcch_cand[coreset->controlResourceSetId]; + const int N_ci = 0; + + if(next_cand>=nr_of_candidates) { + LOG_D(NR_MAC,"No more available candidates for this coreset\n"); + return -1; + } + + int N_rb = pdcch->n_rb; // nb of rbs of coreset per symbol + int N_symb = coreset->duration; // nb of coreset symbols + int N_regs = N_rb*N_symb; // nb of REGs per coreset + int N_cces = N_regs / NR_NB_REG_PER_CCE; // nb of cces in coreset + + int L = pdcch->RegBundleSize; + int R = pdcch->InterleaverSize; + int n_shift = pdcch->ShiftIndex; + int C = R>0 ? N_regs/(L*R) : 0; + int B_rb = L/N_symb; // nb of RBs occupied by each REG bundle + + int first_cce; + bool taken = false; // flag if the resource for a given candidate are taken + // loop over all the available candidates + for(int m=next_cand; mBWPStart + f*B_rb + rb]&(((1<StartSymbolIndex)) { + taken = true; + break; + } + } + } + } + if(!taken){ + mac->pdcch_cand[coreset->controlResourceSetId] = m++; // using candidate m, next available is m+1 + return first_cce; + } + } + return -1; +} + +void fill_pdcch_vrb_map(gNB_MAC_INST *mac, + int CC_id, + NR_sched_pdcch_t *pdcch, + int first_cce, + int aggregation){ + + uint16_t *vrb_map = mac->common_channels[CC_id].vrb_map; + + int N_rb = pdcch->n_rb; // nb of rbs of coreset per symbol + int L = pdcch->RegBundleSize; + int R = pdcch->InterleaverSize; + int n_shift = pdcch->ShiftIndex; + int N_symb = pdcch->DurationSymbols; + int N_regs = N_rb*N_symb; // nb of REGs per coreset + int B_rb = L/N_symb; // nb of RBs occupied by each REG bundle + int C = R>0 ? N_regs/(L*R) : 0; + + for (int j=first_cce; jBWPStart + f*B_rb + rb] = ((1<StartSymbolIndex; + } + } +} + + bool nr_find_nb_rb(uint16_t Qm, uint16_t R, uint16_t nb_symb_sch, @@ -346,7 +482,7 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc, const NR_BWP_Uplink_t *ubwp, - const NR_BWP_UplinkDedicated_t *ubwpd, + const NR_BWP_UplinkDedicated_t *ubwpd, long dci_format, int tda, uint8_t num_dmrs_cdm_grps_no_data, @@ -718,81 +854,32 @@ int nr_get_default_pucch_res(int pucch_ResourceCommon) { return(default_pucch_csset[pucch_ResourceCommon]); } -void nr_configure_pdcch(gNB_MAC_INST *gNB_mac, - nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu, - NR_SearchSpace_t *ss, + + +void nr_configure_pdcch(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu, NR_ControlResourceSet_t *coreset, - NR_ServingCellConfigCommon_t *scc, NR_BWP_t *bwp, - NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config) { + NR_sched_pdcch_t *pdcch) { - int sps; - AssertFatal(*ss->controlResourceSetId == coreset->controlResourceSetId, - "coreset id in SS %ld does not correspond to the one in coreset %ld", - *ss->controlResourceSetId, coreset->controlResourceSetId); - if (bwp) { // This is not for SIB1 - if(coreset->controlResourceSetId == 0){ - pdcch_pdu->BWPSize = gNB_mac->cset0_bwp_size; - pdcch_pdu->BWPStart = gNB_mac->cset0_bwp_start; - } - else { - pdcch_pdu->BWPSize = NRRIV2BW(bwp->locationAndBandwidth, MAX_BWP_SIZE); - pdcch_pdu->BWPStart = NRRIV2PRBOFFSET(bwp->locationAndBandwidth, MAX_BWP_SIZE); - } - pdcch_pdu->SubcarrierSpacing = bwp->subcarrierSpacing; - pdcch_pdu->CyclicPrefix = (bwp->cyclicPrefix==NULL) ? 0 : *bwp->cyclicPrefix; - - //AssertFatal(pdcch_scs==kHz15, "PDCCH SCS above 15kHz not allowed if a symbol above 2 is monitored"); - sps = bwp->cyclicPrefix == NULL ? 14 : 12; - } - else { - AssertFatal(type0_PDCCH_CSS_config!=NULL,"type0_PDCCH_CSS_config is null,bwp %p\n",bwp); - pdcch_pdu->BWPSize = type0_PDCCH_CSS_config->num_rbs; - pdcch_pdu->BWPStart = type0_PDCCH_CSS_config->cset_start_rb; - pdcch_pdu->SubcarrierSpacing = type0_PDCCH_CSS_config->scs_pdcch; - pdcch_pdu->CyclicPrefix = 0; - sps = 14; - } - - AssertFatal(ss->monitoringSymbolsWithinSlot!=NULL,"ss->monitoringSymbolsWithinSlot is null\n"); - AssertFatal(ss->monitoringSymbolsWithinSlot->buf!=NULL,"ss->monitoringSymbolsWithinSlot->buf is null\n"); - - // for SPS=14 8 MSBs in positions 13 downto 6 - uint16_t monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | - (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps)); - - for (int i=0; i>(sps-1-i))&1) { - pdcch_pdu->StartSymbolIndex=i; - break; - } - } + pdcch_pdu->BWPSize = pdcch->BWPSize; + pdcch_pdu->BWPStart = pdcch->BWPStart; + pdcch_pdu->SubcarrierSpacing = pdcch->SubcarrierSpacing; + pdcch_pdu->CyclicPrefix = pdcch->CyclicPrefix; + pdcch_pdu->StartSymbolIndex = pdcch->StartSymbolIndex; pdcch_pdu->DurationSymbols = coreset->duration; for (int i=0;i<6;i++) pdcch_pdu->FreqDomainResource[i] = coreset->frequencyDomainResources.buf[i]; - LOG_D(MAC,"Coreset : BWPstart %d, BWPsize %d, SCS %d, freq %x, , duration %d, \n",pdcch_pdu->BWPStart,pdcch_pdu->BWPSize,(int)pdcch_pdu->SubcarrierSpacing,(int)coreset->frequencyDomainResources.buf[0],(int)coreset->duration); + LOG_D(MAC,"Coreset : BWPstart %d, BWPsize %d, SCS %d, freq %x, , duration %d, \n", + pdcch_pdu->BWPStart,pdcch_pdu->BWPSize,(int)pdcch_pdu->SubcarrierSpacing,(int)coreset->frequencyDomainResources.buf[0],(int)coreset->duration); - //cce-REG-MappingType - pdcch_pdu->CceRegMappingType = coreset->cce_REG_MappingType.present == NR_ControlResourceSet__cce_REG_MappingType_PR_interleaved? - NFAPI_NR_CCE_REG_MAPPING_INTERLEAVED : NFAPI_NR_CCE_REG_MAPPING_NON_INTERLEAVED; - - if (pdcch_pdu->CceRegMappingType == NFAPI_NR_CCE_REG_MAPPING_INTERLEAVED) { - pdcch_pdu->RegBundleSize = (coreset->cce_REG_MappingType.choice.interleaved->reg_BundleSize == - NR_ControlResourceSet__cce_REG_MappingType__interleaved__reg_BundleSize_n6) ? 6 : (2+coreset->cce_REG_MappingType.choice.interleaved->reg_BundleSize); - pdcch_pdu->InterleaverSize = (coreset->cce_REG_MappingType.choice.interleaved->interleaverSize == - NR_ControlResourceSet__cce_REG_MappingType__interleaved__interleaverSize_n6) ? 6 : (2+coreset->cce_REG_MappingType.choice.interleaved->interleaverSize); - AssertFatal(scc->physCellId != NULL,"scc->physCellId is null\n"); - pdcch_pdu->ShiftIndex = coreset->cce_REG_MappingType.choice.interleaved->shiftIndex != NULL ? *coreset->cce_REG_MappingType.choice.interleaved->shiftIndex : *scc->physCellId; - } - else { - pdcch_pdu->RegBundleSize = 0; - pdcch_pdu->InterleaverSize = 0; - pdcch_pdu->ShiftIndex = 0; - } + pdcch_pdu->CceRegMappingType = pdcch->CceRegMappingType; + pdcch_pdu->RegBundleSize = pdcch->RegBundleSize; + pdcch_pdu->InterleaverSize = pdcch->InterleaverSize; + pdcch_pdu->ShiftIndex = pdcch->ShiftIndex; if(coreset->controlResourceSetId == 0) { if(bwp == NULL) @@ -1968,6 +2055,9 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG bwpList->list.count); const int bwp_id = 1; sched_ctrl->active_bwp = bwpList ? bwpList->list.array[bwp_id - 1] : NULL; + NR_BWP_t *genericParameters = sched_ctrl->active_bwp ? + &sched_ctrl->active_bwp->bwp_Common->genericParameters: + &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; const int target_ss = sched_ctrl->active_bwp ? NR_SearchSpace__searchSpaceType_PR_ue_Specific : NR_SearchSpace__searchSpaceType_PR_common; sched_ctrl->search_space = get_searchspace(scc, sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Dedicated : NULL, @@ -1975,6 +2065,12 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG sched_ctrl->coreset = get_coreset(mod_idP, scc, sched_ctrl->active_bwp ? (void*)sched_ctrl->active_bwp->bwp_Dedicated : NULL, sched_ctrl->search_space, target_ss); + sched_ctrl->sched_pdcch = set_pdcch_structure(RC.nrmac[mod_idP], + sched_ctrl->search_space, + sched_ctrl->coreset, + scc, + genericParameters, + NULL); const struct NR_UplinkConfig__uplinkBWP_ToAddModList *ubwpList = servingCellConfig ? servingCellConfig->uplinkConfig->uplinkBWP_ToAddModList : NULL; if (ubwpList) AssertFatal(ubwpList->list.count == 1, "uplinkBWP_ToAddModList has %d BWP!\n", @@ -2388,38 +2484,6 @@ void nr_csirs_scheduling(int Mod_idP, } } -bool find_free_CCE(module_id_t module_id, - sub_frame_t slot, - int UE_id){ - NR_UE_sched_ctrl_t *sched_ctrl = &RC.nrmac[module_id]->UE_info.UE_sched_ctrl[UE_id]; - uint8_t nr_of_candidates; - for (int i=0; i<5; i++) { - // for now taking the lowest value among the available aggregation levels - find_aggregation_candidates(&sched_ctrl->aggregation_level, - &nr_of_candidates, - sched_ctrl->search_space, - 1<0) break; - } - AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n"); - const int cid = sched_ctrl->coreset->controlResourceSetId; - const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid%3][slot]; - const int m = RC.nrmac[module_id]->UE_info.num_pdcch_cand[UE_id][cid]; - if (UE_id >= 0) LOG_D(NR_MAC,"slot %d calling allocate_nr_CCEs with L %d, nr_of_candidates %d, Y %x\n",slot, sched_ctrl->aggregation_level,nr_of_candidates,Y); - sched_ctrl->cce_index = allocate_nr_CCEs(RC.nrmac[module_id], - sched_ctrl->active_bwp, - sched_ctrl->coreset, - sched_ctrl->aggregation_level, - Y, - m, - nr_of_candidates); - if (sched_ctrl->cce_index < 0) - return false; - - RC.nrmac[module_id]->UE_info.num_pdcch_cand[UE_id][cid]++; - return true; -} - /*void fill_nfapi_coresets_and_searchspaces(NR_CellGroupConfig_t *cg, nfapi_nr_coreset_t *coreset, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index bcc0832863..30f5ba1476 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -963,13 +963,38 @@ bool allocate_ul_retransmission(module_id_t module_id, sched_ctrl->pusch_semi_static = temp_ps; } - /* Find free CCE */ - bool freeCCE = find_free_CCE(module_id, slot, UE_id); - if (!freeCCE) { + /* Find a free CCE */ + const int cid = sched_ctrl->coreset->controlResourceSetId; + const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid%3][slot]; + uint8_t nr_of_candidates; + for (int i=0; i<5; i++) { + // for now taking the lowest value among the available aggregation levels + find_aggregation_candidates(&sched_ctrl->aggregation_level, + &nr_of_candidates, + sched_ctrl->search_space, + 1<0) break; + } + int CCEIndex = find_pdcch_candidate(RC.nrmac[module_id], + CC_id, + sched_ctrl->aggregation_level, + nr_of_candidates, + sched_ctrl->sched_pdcch, + sched_ctrl->coreset, + Y); + + if (CCEIndex<0) { LOG_D(NR_MAC, "%4d.%2d no free CCE for retransmission UL DCI UE %04x\n", frame, slot, UE_info->rnti[UE_id]); return false; } + sched_ctrl->cce_index = CCEIndex; + fill_pdcch_vrb_map(RC.nrmac[module_id], + CC_id, + sched_ctrl->sched_pdcch, + CCEIndex, + sched_ctrl->aggregation_level); + /* frame/slot in sched_pusch has been set previously. In the following, we * overwrite the information in the retransmission information before storing * as the new scheduling instruction */ @@ -1084,8 +1109,27 @@ void pf_ul(module_id_t module_id, * based on data to transmit) */ if (B == 0 && do_sched) { /* if no data, pre-allocate 5RB */ - bool freeCCE = find_free_CCE(module_id, slot, UE_id); - if (!freeCCE) { + /* Find a free CCE */ + const int cid = sched_ctrl->coreset->controlResourceSetId; + const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid%3][slot]; + uint8_t nr_of_candidates; + for (int i=0; i<5; i++) { + // for now taking the lowest value among the available aggregation levels + find_aggregation_candidates(&sched_ctrl->aggregation_level, + &nr_of_candidates, + sched_ctrl->search_space, + 1<0) break; + } + int CCEIndex = find_pdcch_candidate(RC.nrmac[module_id], + CC_id, + sched_ctrl->aggregation_level, + nr_of_candidates, + sched_ctrl->sched_pdcch, + sched_ctrl->coreset, + Y); + + if (CCEIndex<0) { LOG_D(NR_MAC, "%4d.%2d no free CCE for UL DCI UE %04x (BSR 0)\n", frame, slot, UE_info->rnti[UE_id]); continue; } @@ -1102,6 +1146,13 @@ void pf_ul(module_id_t module_id, return; } + sched_ctrl->cce_index = CCEIndex; + fill_pdcch_vrb_map(RC.nrmac[module_id], + CC_id, + sched_ctrl->sched_pdcch, + CCEIndex, + sched_ctrl->aggregation_level); + /* Save PUSCH field */ /* we want to avoid a lengthy deduction of DMRS and other parameters in * every TTI if we can save it, so check whether dci_format, TDA, or @@ -1167,8 +1218,27 @@ void pf_ul(module_id_t module_id, *max = UE_sched.next[*max]; *p = -1; - bool freeCCE = find_free_CCE(module_id, slot, UE_id); - if (!freeCCE) { + NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; + + const int cid = sched_ctrl->coreset->controlResourceSetId; + const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid%3][slot]; + uint8_t nr_of_candidates; + for (int i=0; i<5; i++) { + // for now taking the lowest value among the available aggregation levels + find_aggregation_candidates(&sched_ctrl->aggregation_level, + &nr_of_candidates, + sched_ctrl->search_space, + 1<0) break; + } + int CCEIndex = find_pdcch_candidate(RC.nrmac[module_id], + CC_id, + sched_ctrl->aggregation_level, + nr_of_candidates, + sched_ctrl->sched_pdcch, + sched_ctrl->coreset, + Y); + if (CCEIndex<0) { LOG_D(NR_MAC, "%4d.%2d no free CCE for UL DCI UE %04x\n", frame, slot, UE_info->rnti[UE_id]); continue; } @@ -1179,7 +1249,6 @@ void pf_ul(module_id_t module_id, if (max_num_ue < 0) return; - NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id]; NR_BWP_UplinkDedicated_t *ubwpd= cg ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP:NULL; NR_BWP_t *genericParameters = sched_ctrl->active_ubwp ? &sched_ctrl->active_ubwp->bwp_Common->genericParameters : &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; @@ -1232,6 +1301,14 @@ void pf_ul(module_id_t module_id, rbSize, sched_pusch->tb_size, sched_ctrl->estimated_ul_buffer, sched_ctrl->sched_ul_bytes, B,sched_ctrl->cce_index,ps->num_dmrs_symb,ps->N_PRB_DMRS); /* Mark the corresponding RBs as used */ + + sched_ctrl->cce_index = CCEIndex; + fill_pdcch_vrb_map(RC.nrmac[module_id], + CC_id, + sched_ctrl->sched_pdcch, + CCEIndex, + sched_ctrl->aggregation_level); + n_rb_sched -= sched_pusch->rbSize; for (int rb = 0; rb < sched_ctrl->sched_pusch.rbSize; rb++) rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] = 0; @@ -1632,7 +1709,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) ul_dci_request_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_pdcch_pdu)); pdcch_pdu = &ul_dci_request_pdu->pdcch_pdu.pdcch_pdu_rel15; ul_dci_req->numPdus += 1; - nr_configure_pdcch(nr_mac, pdcch_pdu, ss, coreset, scc, genericParameters, NULL); + nr_configure_pdcch(pdcch_pdu, coreset, genericParameters, sched_ctrl->sched_pdcch); nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu; } diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 62d70f4f2c..56a24c5b94 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -248,13 +248,31 @@ void find_search_space(int ss_type, NR_BWP_Downlink_t *bwp, NR_SearchSpace_t *ss); -void nr_configure_pdcch(gNB_MAC_INST *gNB_mac, - nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu, - NR_SearchSpace_t *ss, +void nr_configure_pdcch(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu, NR_ControlResourceSet_t *coreset, - NR_ServingCellConfigCommon_t *scc, NR_BWP_t *bwp, - NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config); + NR_sched_pdcch_t *pdcch); + +NR_sched_pdcch_t *set_pdcch_structure(gNB_MAC_INST *gNB_mac, + NR_SearchSpace_t *ss, + NR_ControlResourceSet_t *coreset, + NR_ServingCellConfigCommon_t *scc, + NR_BWP_t *bwp, + NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config); + +uint8_t find_pdcch_candidate(gNB_MAC_INST *mac, + int cc_id, + int aggregation, + int nr_of_candidates, + NR_sched_pdcch_t *pdcch, + NR_ControlResourceSet_t *coreset, + uint16_t Y); + +void fill_pdcch_vrb_map(gNB_MAC_INST *mac, + int CC_id, + NR_sched_pdcch_t *pdcch, + int first_cce, + int aggregation); void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc, const NR_CellGroupConfig_t *CellGroup, diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 99e21b6560..f7bd2a5ac8 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -103,6 +103,20 @@ typedef struct NR_preamble_ue { uint8_t *preamble_list; } NR_preamble_ue_t; +typedef struct NR_sched_pdcch { + uint16_t BWPSize; + uint16_t BWPStart; + uint8_t CyclicPrefix; + uint8_t SubcarrierSpacing; + uint8_t StartSymbolIndex; + uint8_t CceRegMappingType; + uint8_t RegBundleSize; + uint8_t InterleaverSize; + uint16_t ShiftIndex; + uint8_t DurationSymbols; + int n_rb; +} NR_sched_pdcch_t; + /*! \brief gNB template for the Random access information */ typedef struct { /// Flag to indicate this process is active @@ -163,6 +177,9 @@ typedef struct { int mac_pdu_length; /// RA search space NR_SearchSpace_t *ra_ss; + /// RA Coreset + NR_ControlResourceSet_t *coreset; + NR_sched_pdcch_t *sched_pdcch; // Beam index uint8_t beam_id; /// CellGroup for UE that is to come (NSA is non-null, null for SA) @@ -298,7 +315,6 @@ typedef struct UE_info { pdschTciStatesActDeact_t pdsch_TCI_States_ActDeact; } NR_UE_mac_ce_ctrl_t; - typedef struct NR_sched_pucch { int frame; int ul_slot; @@ -533,6 +549,7 @@ typedef struct { /// CCE index and aggregation, should be coherent with cce_list NR_SearchSpace_t *search_space; NR_ControlResourceSet_t *coreset; + NR_sched_pdcch_t *sched_pdcch; /// CCE index and Aggr. Level are shared for PUSCH/PDSCH allocation decisions /// corresponding to the sched_pusch/sched_pdsch structures below @@ -652,10 +669,10 @@ typedef struct { /// CCE indexing int Y[MAX_MOBILES_PER_GNB][3][160]; int m[MAX_MOBILES_PER_GNB]; - int num_pdcch_cand[MAX_MOBILES_PER_GNB][MAX_NUM_CORESET]; // UE selected beam index uint8_t UE_beam_index[MAX_MOBILES_PER_GNB]; bool Msg4_ACKed[MAX_MOBILES_PER_GNB]; + } NR_UE_info_t; typedef void (*nr_pp_impl_dl)(module_id_t mod_id, @@ -714,7 +731,7 @@ typedef struct gNB_MAC_INST_s { nfapi_nr_ul_dci_request_t UL_dci_req[NFAPI_CC_MAX]; /// NFAPI DL PDU structure nfapi_nr_tx_data_request_t TX_req[NFAPI_CC_MAX]; - + int pdcch_cand[MAX_NUM_CORESET]; NR_UE_info_t UE_info; /// UL handle @@ -742,8 +759,6 @@ typedef struct gNB_MAC_INST_s { time_stats_t rx_ulsch_sdu; // include rlc_data_ind /// processing time of eNB PCH scheduler time_stats_t schedule_pch; - /// CCE lists - int cce_list[MAX_NUM_CORESET][MAX_NUM_CCE]; /// list of allocated beams per period int16_t *tdd_beam_association; From 1af5a89dd15b7fe4cfb40bcd811101aaab102b47 Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Sun, 5 Dec 2021 10:48:16 +0530 Subject: [PATCH 028/113] Removed active waiting loop which could block threads. Instead used a separate thread to reorder the finished the job messages --- executables/nr-gnb.c | 122 +++++++++++++++++++----------- executables/nr-ru.c | 4 +- nfapi/oai_integration/nfapi_pnf.c | 40 ++-------- openair1/PHY/defs_gNB.h | 7 +- openair1/SCHED_NR/fapi_nr_l1.c | 90 +++++++++++----------- 5 files changed, 136 insertions(+), 127 deletions(-) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index f83fac2737..dfea55e325 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -87,7 +87,7 @@ #include #include #include -//#define DEBUG_THREADS 1 +#define DEBUG_THREADS 0 //#define USRP_DEBUG 1 // Fix per CC openair rf/if device update @@ -114,7 +114,6 @@ time_stats_t softmodem_stats_rx_sf; // total rx time void tx_func(void *param) { processingData_L1tx_t *info = (processingData_L1tx_t *) param; - PHY_VARS_gNB *gNB = info->gNB; int frame_tx = info->frame; int slot_tx = info->slot; @@ -122,31 +121,6 @@ void tx_func(void *param) { frame_tx, slot_tx, 1); - info->slot = -1; - //if ((frame_tx&127) == 0) dump_pdsch_stats(fd,gNB); - - // If the later of the 2 L1 tx thread finishes first, - // we wait for the earlier one to finish and start the RU thread - // to avoid realtime issues with USRP - - // Start RU TX processing. - notifiedFIFO_elt_t *res; - res = pullTpool(gNB->resp_RU_tx, gNB->threadPool); - processingData_RU_t *syncMsg = (processingData_RU_t *)NotifiedFifoData(res); - LOG_D(PHY,"waiting for previous tx to finish, next slot %d,%d\n",syncMsg->next_slot,slot_tx); - while (syncMsg->next_slot != slot_tx) { - pushNotifiedFIFO(gNB->resp_RU_tx, res); - res = pullTpool(gNB->resp_RU_tx, gNB->threadPool); - syncMsg = (processingData_RU_t *)NotifiedFifoData(res); - } - LOG_D(PHY,"previous tx finished, next slot %d,%d\n",syncMsg->next_slot,slot_tx); - syncMsg->frame_tx = frame_tx; - syncMsg->slot_tx = slot_tx; - syncMsg->next_slot = get_next_downlink_slot(gNB, &gNB->gNB_config, frame_tx, slot_tx); - syncMsg->timestamp_tx = info->timestamp_tx; - syncMsg->ru = gNB->RU_list[0]; - res->key = slot_tx; - pushTpool(gNB->threadPool, res); } void rx_func(void *param) { @@ -276,15 +250,12 @@ void rx_func(void *param) { if (tx_slot_type == NR_DOWNLINK_SLOT || tx_slot_type == NR_MIXED_SLOT) { notifiedFIFO_elt_t *res; - res = pullTpool(gNB->resp_L1_tx, gNB->threadPool); - processingData_L1tx_t *syncMsg = (processingData_L1tx_t *)NotifiedFifoData(res); - while (syncMsg->slot != slot_tx) { - pushNotifiedFIFO(gNB->resp_L1_tx, res); - res = pullTpool(gNB->resp_L1_tx, gNB->threadPool); - syncMsg = (processingData_L1tx_t *)NotifiedFifoData(res); - } + processingData_L1tx_t *syncMsg; + // Its a FIFO so it maitains the order in which the MAC fills the messages + // so no need for checking for right slot + res = pullTpool(gNB->L1_tx_filled, gNB->threadPool); + syncMsg = (processingData_L1tx_t *)NotifiedFifoData(res); syncMsg->gNB = gNB; - AssertFatal(syncMsg->slot == slot_tx, "Thread message slot and logical slot number do not match\n"); syncMsg->timestamp_tx = info->timestamp_tx; res->key = slot_tx; pushTpool(gNB->threadPool, res); @@ -390,6 +361,64 @@ void *nrL1_stats_thread(void *param) { return(NULL); } +// This thread reads the finished L1 tx jobs from threaPool +// and pushes RU tx thread in the right order. It works only +// two parallel L1 tx threads. +void *tx_reorder_thread(void* param) { + PHY_VARS_gNB *gNB = (PHY_VARS_gNB *)param; + notifiedFIFO_elt_t *resL1; + notifiedFIFO_elt_t *resL1Reserve = NULL; + notifiedFIFO_elt_t *resRU; + processingData_L1tx_t *syncMsgL1; + processingData_RU_t *syncMsgRU; + + while (!oai_exit) { + // check if there is a message in reserve + if (resL1Reserve) { + syncMsgL1 = (processingData_L1tx_t *)NotifiedFifoData(resL1Reserve); + if (syncMsgL1->slot == gNB->next_tx_slot) { + resRU = pullTpool(gNB->resp_RU_tx, gNB->threadPool); + // processing of last ru_tx_func finished + syncMsgRU = (processingData_RU_t *)NotifiedFifoData(resRU); + syncMsgRU->frame_tx = syncMsgL1->frame; + syncMsgRU->slot_tx = syncMsgL1->slot; + syncMsgRU->timestamp_tx = syncMsgL1->timestamp_tx; + syncMsgRU->ru = gNB->RU_list[0]; + resRU->key = syncMsgL1->slot; + gNB->next_tx_slot = get_next_downlink_slot(gNB, &gNB->gNB_config, syncMsgRU->frame_tx, syncMsgRU->slot_tx); + pushNotifiedFIFO(gNB->L1_tx_free, resL1Reserve); + pushTpool(gNB->threadPool, resRU); + resL1Reserve = NULL; + } else { +#if DEBUG_THREADS + printf("Waiting for reserve L1 Tx message to be sent to RU for slot %d\n", syncMsgL1->slot); +#endif + } + } + // pull message from output FIFO of tx_func + resL1 = pullTpool(gNB->L1_tx_out, gNB->threadPool); + syncMsgL1 = (processingData_L1tx_t *)NotifiedFifoData(resL1); + + if (syncMsgL1->slot == gNB->next_tx_slot) { + resRU = pullTpool(gNB->resp_RU_tx, gNB->threadPool); + // processing of last ru_tx_func finished + syncMsgRU = (processingData_RU_t *)NotifiedFifoData(resRU); + syncMsgRU->frame_tx = syncMsgL1->frame; + syncMsgRU->slot_tx = syncMsgL1->slot; + syncMsgRU->timestamp_tx = syncMsgL1->timestamp_tx; + syncMsgRU->ru = gNB->RU_list[0]; + resRU->key = syncMsgL1->slot; + gNB->next_tx_slot = get_next_downlink_slot(gNB, &gNB->gNB_config, syncMsgRU->frame_tx, syncMsgRU->slot_tx); + pushNotifiedFIFO(gNB->L1_tx_free, resL1); + pushTpool(gNB->threadPool, resRU); + } else { + AssertFatal(resL1Reserve == NULL, "Error! There is already a waiting message\n"); + resL1Reserve = resL1; + } + } + return(NULL); +} + void init_gNB_Tpool(int inst) { PHY_VARS_gNB *gNB; gNB = RC.gNB[inst]; @@ -421,38 +450,39 @@ void init_gNB_Tpool(int inst) { pushNotifiedFIFO(gNB->resp_L1,msg); // to unblock the process in the beginning // L1 TX result FIFO - gNB->resp_L1_tx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); - initNotifiedFIFO(gNB->resp_L1_tx); + gNB->L1_tx_free = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); + gNB->L1_tx_filled = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); + gNB->L1_tx_out = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); + initNotifiedFIFO(gNB->L1_tx_free); + initNotifiedFIFO(gNB->L1_tx_filled); + initNotifiedFIFO(gNB->L1_tx_out); // we create 2 threads for L1 tx processing - notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->resp_L1_tx,tx_func); + notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->L1_tx_out,tx_func); processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx); init_DLSCH_struct(gNB, msgDataTx); - msgDataTx->slot = -1; memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t)); reset_meas(&msgDataTx->phy_proc_tx); gNB->phy_proc_tx_0 = &msgDataTx->phy_proc_tx; - pushNotifiedFIFO(gNB->resp_L1_tx,msgL1Tx); // to unblock the process in the beginning + pushNotifiedFIFO(gNB->L1_tx_free,msgL1Tx); // to unblock the process in the beginning - msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->resp_L1_tx,tx_func); + msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->L1_tx_out,tx_func); msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx); init_DLSCH_struct(gNB, msgDataTx); - msgDataTx->slot = -1; memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t)); reset_meas(&msgDataTx->phy_proc_tx); gNB->phy_proc_tx_1 = &msgDataTx->phy_proc_tx; - pushNotifiedFIFO(gNB->resp_L1_tx,msgL1Tx); // to unblock the process in the beginning + pushNotifiedFIFO(gNB->L1_tx_free,msgL1Tx); // to unblock the process in the beginning // RU TX result FIFO gNB->resp_RU_tx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); initNotifiedFIFO(gNB->resp_RU_tx); notifiedFIFO_elt_t *msgRUTx = newNotifiedFIFO_elt(sizeof(processingData_RU_t),0,gNB->resp_RU_tx,ru_tx_func); - processingData_RU_t *msgData = (processingData_RU_t*)msgRUTx->msgData; int first_tx_slot = sf_ahead*gNB->frame_parms.slots_per_subframe; - msgData->next_slot = get_next_downlink_slot(gNB, &gNB->gNB_config, 0, first_tx_slot-1); pushNotifiedFIFO(gNB->resp_RU_tx,msgRUTx); // to unblock the process in the beginning + gNB->next_tx_slot = get_next_downlink_slot(gNB, &gNB->gNB_config, 0, first_tx_slot-1); threadCreate(&proc->L1_stats_thread,nrL1_stats_thread,(void*)gNB,"L1_stats",-1,OAI_PRIORITY_RT_LOW); - + threadCreate(&proc->pthread_tx_reorder, tx_reorder_thread, (void *)gNB, "thread_tx_reorder", -1, OAI_PRIORITY_RT_MAX); } diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 3a2589632b..b749928b37 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -1445,9 +1445,9 @@ void *ru_thread( void *param ) { res = pullNotifiedFIFO(gNB->resp_L1); delNotifiedFIFO_elt(res); - res = pullNotifiedFIFO(gNB->resp_L1_tx); + res = pullNotifiedFIFO(gNB->L1_tx_free); delNotifiedFIFO_elt(res); - res = pullNotifiedFIFO(gNB->resp_L1_tx); + res = pullNotifiedFIFO(gNB->L1_tx_free); delNotifiedFIFO_elt(res); res = pullNotifiedFIFO(gNB->resp_RU_tx); delNotifiedFIFO_elt(res); diff --git a/nfapi/oai_integration/nfapi_pnf.c b/nfapi/oai_integration/nfapi_pnf.c index 4edbeee342..3d8fee7615 100644 --- a/nfapi/oai_integration/nfapi_pnf.c +++ b/nfapi/oai_integration/nfapi_pnf.c @@ -1108,39 +1108,9 @@ notifiedFIFO_elt_t *l1tx_message_extract(PHY_VARS_gNB *gNB, int frame, int slot) notifiedFIFO_elt_t *res; notifiedFIFO_elt_t *freeRes = NULL; - // check first message - res = pullTpool(gNB->resp_L1_tx, gNB->threadPool); - processingData_L1tx_t *msgTx = (processingData_L1tx_t *)NotifiedFifoData(res); - if (msgTx->slot == slot) { - return res; - } - if (msgTx->slot == -1) { - freeRes = res; - } - - // check second message - pushNotifiedFIFO(gNB->resp_L1_tx,res); - res = pullTpool(gNB->resp_L1_tx, gNB->threadPool); - msgTx = (processingData_L1tx_t *)NotifiedFifoData(res); - if (msgTx->slot == slot) { - return res; - } - if (msgTx->slot == -1) { - freeRes = res; - } - - if (freeRes) { - msgTx = (processingData_L1tx_t *)NotifiedFifoData(res); - msgTx->num_pdsch_slot=0; - msgTx->pdcch_pdu.pdcch_pdu_rel15.numDlDci = 0; - msgTx->ul_pdcch_pdu.pdcch_pdu.pdcch_pdu_rel15.numDlDci = 0; - msgTx->slot = slot; - msgTx->frame = frame; - return freeRes; - } - pushNotifiedFIFO(gNB->resp_L1_tx,res); - AssertFatal(1==0, "It means both L1 Tx messages are still waiting to be processed. This happens when L1 Tx processing is too slow. Message slot %d, scheduled slot %d\n", - msgTx->slot, slot); + //TODO: This needs to be reworked for nfapi to work + res = pullTpool(gNB->L1_tx_free, gNB->threadPool); + return res; } int pnf_phy_ul_dci_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfapi_nr_ul_dci_request_t *req) { @@ -1166,7 +1136,7 @@ int pnf_phy_ul_dci_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, } } - pushNotifiedFIFO(gNB->resp_L1_tx,res); + pushNotifiedFIFO(gNB->L1_tx_filled,res); return 0; } @@ -1274,7 +1244,7 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, else { NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() UNKNOWN:%d\n", __FUNCTION__, dl_tti_pdu_list[i].PDUType); } - pushNotifiedFIFO(gNB->resp_L1_tx,res); + pushNotifiedFIFO(gNB->L1_tx_filled,res); } if(req->vendor_extension) diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 11b5112a6c..d309990ed0 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -608,6 +608,8 @@ typedef struct gNB_L1_proc_t_s { pthread_t L1_stats_thread; /// pthread structure for printing time meas pthread_t process_stats_thread; + /// pthread structure for reordering L1 tx thread messages + pthread_t pthread_tx_reorder; /// flag to indicate first RX acquisition int first_rx; /// flag to indicate first TX transmission @@ -897,11 +899,14 @@ typedef struct PHY_VARS_gNB_s { */ notifiedFIFO_t *respDecode; notifiedFIFO_t *resp_L1; - notifiedFIFO_t *resp_L1_tx; + notifiedFIFO_t *L1_tx_free; + notifiedFIFO_t *L1_tx_filled; + notifiedFIFO_t *L1_tx_out; notifiedFIFO_t *resp_RU_tx; tpool_t *threadPool; int nbDecode; uint8_t pusch_proc_threads; + int next_tx_slot; int number_of_nr_dlsch_max; int number_of_nr_ulsch_max; void * scopeData; diff --git a/openair1/SCHED_NR/fapi_nr_l1.c b/openair1/SCHED_NR/fapi_nr_l1.c index 8f315ba214..54534eee0f 100644 --- a/openair1/SCHED_NR/fapi_nr_l1.c +++ b/openair1/SCHED_NR/fapi_nr_l1.c @@ -148,11 +148,9 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){ AssertFatal(RC.gNB[Mod_id]!=NULL,"RC.gNB[%d] is null\n",Mod_id); gNB = RC.gNB[Mod_id]; + nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; - notifiedFIFO_elt_t *res; - res = pullTpool(gNB->resp_L1_tx, gNB->threadPool); - processingData_L1tx_t *msgTx = (processingData_L1tx_t *)NotifiedFifoData(res); - + int slot_type = nr_slot_select(cfg,frame,slot); uint8_t number_dl_pdu = (DL_req==NULL) ? 0 : DL_req->dl_tti_request_body.nPDUs; uint8_t number_ul_dci_pdu = (UL_dci_req==NULL) ? 0 : UL_dci_req->numPdus; uint8_t number_ul_tti_pdu = (UL_tti_req==NULL) ? 0 : UL_tti_req->n_pdus; @@ -166,53 +164,59 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){ TX_req->SFN,TX_req->Slot,TX_req->Number_of_PDUs, number_ul_dci_pdu,number_ul_tti_pdu); - int pdcch_received=0; - msgTx->num_pdsch_slot=0; - msgTx->pdcch_pdu.pdcch_pdu_rel15.numDlDci = 0; - msgTx->ul_pdcch_pdu.pdcch_pdu.pdcch_pdu_rel15.numDlDci = 0; - msgTx->slot = slot; - msgTx->frame = frame; + if (slot_type == NR_DOWNLINK_SLOT || slot_type == NR_MIXED_SLOT) { + notifiedFIFO_elt_t *res; + res = pullTpool(gNB->L1_tx_free, gNB->threadPool); + processingData_L1tx_t *msgTx = (processingData_L1tx_t *)NotifiedFifoData(res); - for (int i=0;idl_tti_request_body.dl_tti_pdu_list[i]; - LOG_D(PHY,"NFAPI: dl_pdu %d : type %d\n",i,dl_tti_pdu->PDUType); - switch (dl_tti_pdu->PDUType) { - case NFAPI_NR_DL_TTI_SSB_PDU_TYPE: - handle_nr_nfapi_ssb_pdu(msgTx,frame,slot, - dl_tti_pdu); - break; + int pdcch_received=0; + msgTx->num_pdsch_slot=0; + msgTx->pdcch_pdu.pdcch_pdu_rel15.numDlDci = 0; + msgTx->ul_pdcch_pdu.pdcch_pdu.pdcch_pdu_rel15.numDlDci = 0; + msgTx->slot = slot; + msgTx->frame = frame; - case NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE: - AssertFatal(pdcch_received == 0, "pdcch_received is not 0, we can only handle one PDCCH PDU per slot\n"); - msgTx->pdcch_pdu = dl_tti_pdu->pdcch_pdu; + for (int i=0;idl_tti_request_body.dl_tti_pdu_list[i]; + LOG_D(PHY,"NFAPI: dl_pdu %d : type %d\n",i,dl_tti_pdu->PDUType); + switch (dl_tti_pdu->PDUType) { + case NFAPI_NR_DL_TTI_SSB_PDU_TYPE: + handle_nr_nfapi_ssb_pdu(msgTx,frame,slot, + dl_tti_pdu); + break; - pdcch_received = 1; - break; + case NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE: + AssertFatal(pdcch_received == 0, "pdcch_received is not 0, we can only handle one PDCCH PDU per slot\n"); + msgTx->pdcch_pdu = dl_tti_pdu->pdcch_pdu; - case NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE: - LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE for %d.%d\n",frame,slot,DL_req->SFN,DL_req->Slot); - handle_nfapi_nr_csirs_pdu(msgTx,frame,slot, - &dl_tti_pdu->csi_rs_pdu); - break; + pdcch_received = 1; + break; - case NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE: - LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE for %d.%d\n",frame,slot,DL_req->SFN,DL_req->Slot); - nfapi_nr_dl_tti_pdsch_pdu_rel15_t *pdsch_pdu_rel15 = &dl_tti_pdu->pdsch_pdu.pdsch_pdu_rel15; - uint16_t pduIndex = pdsch_pdu_rel15->pduIndex; - AssertFatal(TX_req->pdu_list[pduIndex].num_TLV == 1, "TX_req->pdu_list[%d].num_TLV %d != 1\n", - pduIndex,TX_req->pdu_list[pduIndex].num_TLV); - uint8_t *sdu = (uint8_t *)TX_req->pdu_list[pduIndex].TLVs[0].value.direct; - AssertFatal(msgTx->num_pdsch_slot < gNB->number_of_nr_dlsch_max,"Number of PDSCH PDUs %d exceeded the limit %d\n", - msgTx->num_pdsch_slot,gNB->number_of_nr_dlsch_max); - handle_nr_nfapi_pdsch_pdu(msgTx,&dl_tti_pdu->pdsch_pdu, sdu); + case NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE: + LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE for %d.%d\n",frame,slot,DL_req->SFN,DL_req->Slot); + handle_nfapi_nr_csirs_pdu(msgTx,frame,slot, + &dl_tti_pdu->csi_rs_pdu); + break; + + case NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE: + LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE for %d.%d\n",frame,slot,DL_req->SFN,DL_req->Slot); + nfapi_nr_dl_tti_pdsch_pdu_rel15_t *pdsch_pdu_rel15 = &dl_tti_pdu->pdsch_pdu.pdsch_pdu_rel15; + uint16_t pduIndex = pdsch_pdu_rel15->pduIndex; + AssertFatal(TX_req->pdu_list[pduIndex].num_TLV == 1, "TX_req->pdu_list[%d].num_TLV %d != 1\n", + pduIndex,TX_req->pdu_list[pduIndex].num_TLV); + uint8_t *sdu = (uint8_t *)TX_req->pdu_list[pduIndex].TLVs[0].value.direct; + AssertFatal(msgTx->num_pdsch_slot < gNB->number_of_nr_dlsch_max,"Number of PDSCH PDUs %d exceeded the limit %d\n", + msgTx->num_pdsch_slot,gNB->number_of_nr_dlsch_max); + handle_nr_nfapi_pdsch_pdu(msgTx,&dl_tti_pdu->pdsch_pdu, sdu); + } } + + if (number_ul_dci_pdu > 0) + msgTx->ul_pdcch_pdu = UL_dci_req->ul_dci_pdu_list[number_ul_dci_pdu-1]; // copy the last pdu + + pushNotifiedFIFO(gNB->L1_tx_filled,res); } - if (number_ul_dci_pdu > 0) - msgTx->ul_pdcch_pdu = UL_dci_req->ul_dci_pdu_list[number_ul_dci_pdu-1]; // copy the last pdu - - pushNotifiedFIFO(gNB->resp_L1_tx,res); - for (int i = 0; i < number_ul_tti_pdu; i++) { switch (UL_tti_req->pdus_list[i].pdu_type) { case NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE: From 348c4ed36f6974ec90fa7c9ea8a4ad87815c3e47 Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Sun, 5 Dec 2021 20:26:24 +0530 Subject: [PATCH 029/113] Changing a log msg to debug --- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 1685e206ae..04366d40b2 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -263,7 +263,7 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) { nr_fill_indication(gNB,ulsch_harq->frame, ulsch_harq->slot, rdata->ulsch_id, rdata->harq_pid, 0,0); //dumpsig=1; } else { - LOG_I(PHY,"[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, ndi %d, status %d, round %d, RV %d, prb_start %d, prb_size %d, TBS %d) r %d\n", + LOG_D(PHY,"[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, ndi %d, status %d, round %d, RV %d, prb_start %d, prb_size %d, TBS %d) r %d\n", gNB->Mod_id, ulsch_harq->frame, ulsch_harq->slot, rdata->harq_pid, pusch_pdu->pusch_data.new_data_indicator, ulsch_harq->status, ulsch_harq->round, From 82dc3430f7a3ac4f21ffd112e64213ee79523abe Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 6 Dec 2021 11:20:51 +0100 Subject: [PATCH 030/113] function for bitmap from start symbol and length --- common/utils/nr/nr_common.c | 5 +++ common/utils/nr/nr_common.h | 1 + openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 8 ++--- .../LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 6 ++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 20 +++++------ .../NR_MAC_gNB/gNB_scheduler_primitives.c | 36 +++++++++---------- 6 files changed, 41 insertions(+), 35 deletions(-) diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c index a704a66c76..42c7ef9c7e 100644 --- a/common/utils/nr/nr_common.c +++ b/common/utils/nr/nr_common.c @@ -472,6 +472,11 @@ int get_subband_size(int NPRB,int size) { } +// from start symbol index and nb or symbols to symbol occupation bitmap in a slot +uint16_t startandlength_to_bitmat(int startSymbolIndex, int nrOfSymbols) { + return (((1<state = WAIT_Msg3; @@ -1592,7 +1592,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra int i = 0; while ((i < rbSize) && (rbStart + rbSize <= BWPSize)) { - if (vrb_map[BWPStart + rbStart + i]&(((1<rbSize; rb++) { - vrb_map[BWPStart + rb + pdsch_pdu_rel15->rbStart] = ((1<rbStart] |= startandlength_to_bitmat(startSymbolIndex, nrOfSymbols); } LOG_D(NR_MAC,"BWPSize: %i\n", pdcch_pdu_rel15->BWPSize); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index 342e441673..7945042ba5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -314,7 +314,7 @@ void fill_ssb_vrb_map (NR_COMMON_channels_t *cc, int rbStart, uint16_t symStart uint16_t *vrb_map = cc[CC_id].vrb_map; for (int rb = 0; rb < 20; rb++) - vrb_map[rbStart + rb] = 15<sched_ctrlCommon->sched_pdsch.mcs<10) @@ -426,7 +426,7 @@ uint32_t schedule_control_sib1(module_id_t module_id, gNB_mac->sched_ctrlCommon->cce_index, gNB_mac->sched_ctrlCommon->aggregation_level); for (int rb = 0; rb < gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize; rb++) { - vrb_map[rb + rbStart] = ((1<nrOfSymbols)-1)<startSymbolIndex))) + !(rballoc_mask[rbStart]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) rbStart++; if (rbStart >= bwpSize) { LOG_D(NR_MAC, "cannot allocate retransmission for UE %d/RNTI %04x: no resources\n", UE_id, UE_info->rnti[UE_id]); return false; } while (rbStart + rbSize < bwpSize && - (rballoc_mask[rbStart + rbSize]&(((1<nrOfSymbols)-1)<startSymbolIndex)) && + (rballoc_mask[rbStart + rbSize]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols)) && rbSize < retInfo->rbSize) rbSize++; } @@ -584,10 +584,10 @@ bool allocate_dl_retransmission(module_id_t module_id, temp_ps.nrOfLayers = 1; nr_set_pdsch_semi_static(scc, cg, sched_ctrl->active_bwp, bwpd, tda, f, &temp_ps); while (rbStart < bwpSize && - !(rballoc_mask[rbStart]&(((1<nrOfSymbols)-1)<startSymbolIndex))) + !(rballoc_mask[rbStart]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) rbStart++; while (rbStart + rbSize < bwpSize && - (rballoc_mask[rbStart + rbSize]&(((1<nrOfSymbols)-1)<startSymbolIndex))) + (rballoc_mask[rbStart + rbSize]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) rbSize++; uint32_t new_tbs; uint16_t new_rbSize; @@ -670,7 +670,7 @@ bool allocate_dl_retransmission(module_id_t module_id, /* retransmissions: directly allocate */ *n_rb_sched -= sched_ctrl->sched_pdsch.rbSize; for (int rb = 0; rb < sched_ctrl->sched_pdsch.rbSize; rb++) - rballoc_mask[rb + sched_ctrl->sched_pdsch.rbStart] -= (((1<nrOfSymbols)-1)<startSymbolIndex); + rballoc_mask[rb + sched_ctrl->sched_pdsch.rbStart] -= startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols); return true; } @@ -832,12 +832,12 @@ void pf_dl(module_id_t module_id, // Freq-demain allocation while (rbStart < bwpSize && - !(rballoc_mask[rbStart]&(((1<nrOfSymbols)-1)<startSymbolIndex))) + !(rballoc_mask[rbStart]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) rbStart++; uint16_t max_rbSize = 1; while (rbStart + max_rbSize < bwpSize && - (rballoc_mask[rbStart + max_rbSize]&(((1<nrOfSymbols)-1)<startSymbolIndex))) + (rballoc_mask[rbStart + max_rbSize]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) max_rbSize++; sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); @@ -861,7 +861,7 @@ void pf_dl(module_id_t module_id, /* transmissions: directly allocate */ n_rb_sched -= sched_pdsch->rbSize; for (int rb = 0; rb < sched_pdsch->rbSize; rb++) - rballoc_mask[rb + sched_pdsch->rbStart] -= (((1<nrOfSymbols)-1)<startSymbolIndex); + rballoc_mask[rb + sched_pdsch->rbStart] -= startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols); } } @@ -904,8 +904,8 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t // if any RB in vrb_map is blocked (1), the current RBG will be 0 rballoc_mask[i] = (~vrb_map[i+BWPStart])&0x3fff; //bitwise not and 14 symbols // if all the pdsch symbols are free - if((rballoc_mask[i]&(((1<BWPStart + f*B_rb + rb] = ((1<StartSymbolIndex; + vrb_map[pdcch->BWPStart + f*B_rb + rb] |= startandlength_to_bitmat(pdcch->StartSymbolIndex, N_symb); } } } @@ -2359,20 +2359,20 @@ void nr_csirs_scheduling(int Mod_idP, csirs_pdu_rel15->row = 1; csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row1.buf[0])>>4)&0x0f; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (1 << csirs_pdu_rel15->symb_l0); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 1); break; case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2: csirs_pdu_rel15->row = 2; csirs_pdu_rel15->freq_domain = (((resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]>>4)&0x0f) | ((resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]<<8)&0xff0)); for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (1 << csirs_pdu_rel15->symb_l0); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 1); break; case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row4: csirs_pdu_rel15->row = 4; csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row4.buf[0])>>5)&0x07; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (1 << csirs_pdu_rel15->symb_l0); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 1); break; case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other: csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.other.buf[0])>>2)&0x3f; @@ -2383,18 +2383,18 @@ void nr_csirs_scheduling(int Mod_idP, case NR_CSI_RS_ResourceMapping__nrofPorts_p2: csirs_pdu_rel15->row = 3; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (1 << csirs_pdu_rel15->symb_l0); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 1); break; case NR_CSI_RS_ResourceMapping__nrofPorts_p4: csirs_pdu_rel15->row = 5; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0)); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2); break; case NR_CSI_RS_ResourceMapping__nrofPorts_p8: if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { csirs_pdu_rel15->row = 8; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0)); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2); } else{ int num_k = 0; @@ -2403,12 +2403,12 @@ void nr_csirs_scheduling(int Mod_idP, if(num_k==4) { csirs_pdu_rel15->row = 6; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (1 << csirs_pdu_rel15->symb_l0); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 1); } else { csirs_pdu_rel15->row = 7; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0)); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2); } } break; @@ -2416,12 +2416,12 @@ void nr_csirs_scheduling(int Mod_idP, if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { csirs_pdu_rel15->row = 10; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0)); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2); } else { csirs_pdu_rel15->row = 9; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (1 << csirs_pdu_rel15->symb_l0); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 1); } break; case NR_CSI_RS_ResourceMapping__nrofPorts_p16: @@ -2430,24 +2430,24 @@ void nr_csirs_scheduling(int Mod_idP, else csirs_pdu_rel15->row = 11; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0)); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2); break; case NR_CSI_RS_ResourceMapping__nrofPorts_p24: if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { csirs_pdu_rel15->row = 14; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= ((3 << csirs_pdu_rel15->symb_l0) | (3 << csirs_pdu_rel15->symb_l1)); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2) | startandlength_to_bitmat(csirs_pdu_rel15->symb_l1, 2)); } else{ if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) { csirs_pdu_rel15->row = 15; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (7 << csirs_pdu_rel15->symb_l0); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 3); } else { csirs_pdu_rel15->row = 13; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= ((3 << csirs_pdu_rel15->symb_l0) | (3 << csirs_pdu_rel15->symb_l1)); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2) | startandlength_to_bitmat(csirs_pdu_rel15->symb_l1, 2)); } } break; @@ -2455,18 +2455,18 @@ void nr_csirs_scheduling(int Mod_idP, if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { csirs_pdu_rel15->row = 17; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= ((3 << csirs_pdu_rel15->symb_l0) | (3 << csirs_pdu_rel15->symb_l1)); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2) | startandlength_to_bitmat(csirs_pdu_rel15->symb_l1, 2)); } else{ if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) { csirs_pdu_rel15->row = 18; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (7 << csirs_pdu_rel15->symb_l0); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 3); } else { csirs_pdu_rel15->row = 16; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= ((3 << csirs_pdu_rel15->symb_l0) | (3 << csirs_pdu_rel15->symb_l1)); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2) | startandlength_to_bitmat(csirs_pdu_rel15->symb_l1, 2)); } } break; From 951d1242d7eabe1777e106a33b29f6f51ad05dbf Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Wed, 8 Dec 2021 16:40:46 +0100 Subject: [PATCH 031/113] remove async ru_tx_func and simplify --- executables/nr-gnb.c | 86 ++++++++++++++++------------------------- executables/nr-ru.c | 2 - openair1/PHY/defs_gNB.h | 1 - 3 files changed, 33 insertions(+), 56 deletions(-) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index dfea55e325..c2906617b0 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -366,55 +366,43 @@ void *nrL1_stats_thread(void *param) { // two parallel L1 tx threads. void *tx_reorder_thread(void* param) { PHY_VARS_gNB *gNB = (PHY_VARS_gNB *)param; - notifiedFIFO_elt_t *resL1; - notifiedFIFO_elt_t *resL1Reserve = NULL; - notifiedFIFO_elt_t *resRU; - processingData_L1tx_t *syncMsgL1; - processingData_RU_t *syncMsgRU; + notifiedFIFO_elt_t *resL1Reserve = NULL; + + resL1Reserve=pullTpool(gNB->L1_tx_out, gNB->threadPool); + int next_tx_slot=((processingData_L1tx_t *)NotifiedFifoData(resL1Reserve))->slot; + while (!oai_exit) { - // check if there is a message in reserve + notifiedFIFO_elt_t *resL1; if (resL1Reserve) { - syncMsgL1 = (processingData_L1tx_t *)NotifiedFifoData(resL1Reserve); - if (syncMsgL1->slot == gNB->next_tx_slot) { - resRU = pullTpool(gNB->resp_RU_tx, gNB->threadPool); - // processing of last ru_tx_func finished - syncMsgRU = (processingData_RU_t *)NotifiedFifoData(resRU); - syncMsgRU->frame_tx = syncMsgL1->frame; - syncMsgRU->slot_tx = syncMsgL1->slot; - syncMsgRU->timestamp_tx = syncMsgL1->timestamp_tx; - syncMsgRU->ru = gNB->RU_list[0]; - resRU->key = syncMsgL1->slot; - gNB->next_tx_slot = get_next_downlink_slot(gNB, &gNB->gNB_config, syncMsgRU->frame_tx, syncMsgRU->slot_tx); - pushNotifiedFIFO(gNB->L1_tx_free, resL1Reserve); - pushTpool(gNB->threadPool, resRU); - resL1Reserve = NULL; - } else { -#if DEBUG_THREADS - printf("Waiting for reserve L1 Tx message to be sent to RU for slot %d\n", syncMsgL1->slot); -#endif - } - } - // pull message from output FIFO of tx_func - resL1 = pullTpool(gNB->L1_tx_out, gNB->threadPool); - syncMsgL1 = (processingData_L1tx_t *)NotifiedFifoData(resL1); - - if (syncMsgL1->slot == gNB->next_tx_slot) { - resRU = pullTpool(gNB->resp_RU_tx, gNB->threadPool); - // processing of last ru_tx_func finished - syncMsgRU = (processingData_RU_t *)NotifiedFifoData(resRU); - syncMsgRU->frame_tx = syncMsgL1->frame; - syncMsgRU->slot_tx = syncMsgL1->slot; - syncMsgRU->timestamp_tx = syncMsgL1->timestamp_tx; - syncMsgRU->ru = gNB->RU_list[0]; - resRU->key = syncMsgL1->slot; - gNB->next_tx_slot = get_next_downlink_slot(gNB, &gNB->gNB_config, syncMsgRU->frame_tx, syncMsgRU->slot_tx); - pushNotifiedFIFO(gNB->L1_tx_free, resL1); - pushTpool(gNB->threadPool, resRU); - } else { - AssertFatal(resL1Reserve == NULL, "Error! There is already a waiting message\n"); - resL1Reserve = resL1; + resL1=resL1Reserve; + if (((processingData_L1tx_t *)NotifiedFifoData(resL1))->slot != next_tx_slot) { + LOG_E(PHY,"order mistake"); + resL1Reserve=NULL; + resL1 = pullTpool(gNB->L1_tx_out, gNB->threadPool); + } + } else { + resL1 = pullTpool(gNB->L1_tx_out, gNB->threadPool); + if (((processingData_L1tx_t *)NotifiedFifoData(resL1))->slot != next_tx_slot) { + if (resL1Reserve) + LOG_E(PHY,"error, have a stored packet, then a second one\n"); + resL1Reserve=resL1; + resL1 = pullTpool(gNB->L1_tx_out, gNB->threadPool); + if (((processingData_L1tx_t *)NotifiedFifoData(resL1))->slot != next_tx_slot) + LOG_E(PHY,"error, pull two msg, none is good\n"); + } } + processingData_L1tx_t *syncMsgL1= (processingData_L1tx_t *)NotifiedFifoData(resL1); + processingData_RU_t syncMsgRU; + syncMsgRU.frame_tx = syncMsgL1->frame; + syncMsgRU.slot_tx = syncMsgL1->slot; + syncMsgRU.timestamp_tx = syncMsgL1->timestamp_tx; + syncMsgRU.ru = gNB->RU_list[0]; + next_tx_slot = get_next_downlink_slot(gNB, &gNB->gNB_config, syncMsgRU.frame_tx, syncMsgRU.slot_tx); + pushNotifiedFIFO(gNB->L1_tx_free, resL1); + if (resL1==resL1Reserve) + resL1Reserve=NULL; + ru_tx_func((void*)&syncMsgRU); } return(NULL); } @@ -473,14 +461,6 @@ void init_gNB_Tpool(int inst) { gNB->phy_proc_tx_1 = &msgDataTx->phy_proc_tx; pushNotifiedFIFO(gNB->L1_tx_free,msgL1Tx); // to unblock the process in the beginning - // RU TX result FIFO - gNB->resp_RU_tx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); - initNotifiedFIFO(gNB->resp_RU_tx); - notifiedFIFO_elt_t *msgRUTx = newNotifiedFIFO_elt(sizeof(processingData_RU_t),0,gNB->resp_RU_tx,ru_tx_func); - int first_tx_slot = sf_ahead*gNB->frame_parms.slots_per_subframe; - pushNotifiedFIFO(gNB->resp_RU_tx,msgRUTx); // to unblock the process in the beginning - gNB->next_tx_slot = get_next_downlink_slot(gNB, &gNB->gNB_config, 0, first_tx_slot-1); - threadCreate(&proc->L1_stats_thread,nrL1_stats_thread,(void*)gNB,"L1_stats",-1,OAI_PRIORITY_RT_LOW); threadCreate(&proc->pthread_tx_reorder, tx_reorder_thread, (void *)gNB, "thread_tx_reorder", -1, OAI_PRIORITY_RT_MAX); } diff --git a/executables/nr-ru.c b/executables/nr-ru.c index b749928b37..76051945e7 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -1449,8 +1449,6 @@ void *ru_thread( void *param ) { delNotifiedFIFO_elt(res); res = pullNotifiedFIFO(gNB->L1_tx_free); delNotifiedFIFO_elt(res); - res = pullNotifiedFIFO(gNB->resp_RU_tx); - delNotifiedFIFO_elt(res); ru_thread_status = 0; return &ru_thread_status; diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index d309990ed0..6202cc72cd 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -906,7 +906,6 @@ typedef struct PHY_VARS_gNB_s { tpool_t *threadPool; int nbDecode; uint8_t pusch_proc_threads; - int next_tx_slot; int number_of_nr_dlsch_max; int number_of_nr_ulsch_max; void * scopeData; From d6dedc1f49b4caeeb28344d50d0a04c5e7599b55 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 9 Dec 2021 13:14:19 +0100 Subject: [PATCH 032/113] handling multiple pdcch pdu at fapi and phy --- nfapi/oai_integration/nfapi_pnf.c | 16 +++++++------- .../nfapi/public_inc/nfapi_nr_interface_scf.h | 5 +---- openair1/PHY/NR_TRANSPORT/nr_dci.c | 22 ++++++++----------- openair1/PHY/NR_TRANSPORT/nr_dci.h | 11 +++++----- openair1/PHY/defs_gNB.h | 6 +++-- openair1/SCHED_NR/fapi_nr_l1.c | 17 +++++++------- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 12 +++++----- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- 8 files changed, 41 insertions(+), 50 deletions(-) diff --git a/nfapi/oai_integration/nfapi_pnf.c b/nfapi/oai_integration/nfapi_pnf.c index 4edbeee342..a0b4a03e04 100644 --- a/nfapi/oai_integration/nfapi_pnf.c +++ b/nfapi/oai_integration/nfapi_pnf.c @@ -1132,8 +1132,8 @@ notifiedFIFO_elt_t *l1tx_message_extract(PHY_VARS_gNB *gNB, int frame, int slot) if (freeRes) { msgTx = (processingData_L1tx_t *)NotifiedFifoData(res); msgTx->num_pdsch_slot=0; - msgTx->pdcch_pdu.pdcch_pdu_rel15.numDlDci = 0; - msgTx->ul_pdcch_pdu.pdcch_pdu.pdcch_pdu_rel15.numDlDci = 0; + msgTx->num_dl_pdcch = 0; + msgTx->num_ul_pdcch = 0; msgTx->slot = slot; msgTx->frame = frame; return freeRes; @@ -1158,11 +1158,11 @@ int pnf_phy_ul_dci_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, proc = &gNB->proc.L1_proc; if (req->numPdus > 0) { - if (req->ul_dci_pdu_list[req->numPdus-1].PDUType == 0) { // copy only the last PDU (PHY can have only one UL PDCCH pdu) - msgTx->ul_pdcch_pdu = req->ul_dci_pdu_list[req->numPdus-1]; // copy the last pdu - } - else { - LOG_E(PHY,"[PNF] UL_DCI_REQ sfn_slot:%d PDU[%d] - unknown pdu type:%d\n", NFAPI_SFNSLOT2DEC(req->SFN, req->Slot), req->numPdus-1, req->ul_dci_pdu_list[req->numPdus-1].PDUType); + for (int i=0; inumPdus; i++) { + if (req->ul_dci_pdu_list[i].PDUType == 0) // only possible value 0: PDCCH PDU + msgTx->ul_pdcch_pdu[i] = req->ul_dci_pdu_list[i]; + else + LOG_E(PHY,"[PNF] UL_DCI_REQ sfn_slot:%d PDU[%d] - unknown pdu type:%d\n", NFAPI_SFNSLOT2DEC(req->SFN, req->Slot), req->numPdus-1, req->ul_dci_pdu_list[req->numPdus-1].PDUType); } } @@ -1244,7 +1244,7 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE) { // we trust the scheduler sends only one PDCCH PDU per slot - msgTx->pdcch_pdu = dl_tti_pdu_list[i].pdcch_pdu; // fills the last received PDCCH PDU + msgTx->pdcch_pdu[i] = dl_tti_pdu_list[i].pdcch_pdu; // fills the last received PDCCH PDU } else if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_SSB_PDU_TYPE) { //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() PDU:%d BCH: pdu_index:%u pdu_length:%d sdu_length:%d BCH_SDU:%x,%x,%x\n", __FUNCTION__, i, pdu_index, bch_pdu->bch_pdu_rel8.length, tx_request_pdu[sfn][sf][pdu_index]->segments[0].segment_length, sdu[0], sdu[1], sdu[2]); diff --git a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h index 9d245446c8..b7337538ed 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h @@ -1400,9 +1400,6 @@ typedef struct } nfapi_nr_ul_dci_request_t; */ - // normally one PDU per coreset per BWP -#define NFAPI_NR_MAX_UL_DCI_PDUS 4 - typedef struct { /// only possible value 0: PDCCH PDU uint16_t PDUType; @@ -1416,7 +1413,7 @@ typedef struct { uint16_t SFN; uint16_t Slot; uint8_t numPdus; - nfapi_nr_ul_dci_request_pdus_t ul_dci_pdu_list[NFAPI_NR_MAX_UL_DCI_PDUS]; + nfapi_nr_ul_dci_request_pdus_t ul_dci_pdu_list[NFAPI_NR_MAX_NB_CORESETS]; } nfapi_nr_ul_dci_request_t; //3.4.5 slot_errors diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.c b/openair1/PHY/NR_TRANSPORT/nr_dci.c index 3dd44a7896..ba67822b9f 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.c @@ -251,20 +251,16 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, } void nr_generate_dci_top(PHY_VARS_gNB *gNB, - nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu, - nfapi_nr_dl_tti_pdcch_pdu *ul_dci_pdu, - uint32_t **gold_pdcch_dmrs, - int32_t *txdataF, - int16_t amp, - NR_DL_FRAME_PARMS *frame_parms) { + processingData_L1tx_t *msgTx, + uint32_t **gold_pdcch_dmrs, + int32_t *txdataF, + int16_t amp, + NR_DL_FRAME_PARMS *frame_parms) { - AssertFatal(pdcch_pdu!=NULL || ul_dci_pdu!=NULL,"At least one pointer has to be !NULL\n"); + for (int i=0; inum_ul_pdcch; i++) + nr_generate_dci(gNB,&msgTx->ul_pdcch_pdu[i].pdcch_pdu.pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms); + for (int i=0; inum_dl_pdcch; i++) + nr_generate_dci(gNB,&msgTx->pdcch_pdu[i].pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms); - if (pdcch_pdu) { - nr_generate_dci(gNB,&pdcch_pdu->pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms); - } - if (ul_dci_pdu) { - nr_generate_dci(gNB,&ul_dci_pdu->pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms); - } } diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.h b/openair1/PHY/NR_TRANSPORT/nr_dci.h index 07baaf2728..0077bd2f38 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.h +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.h @@ -30,12 +30,11 @@ uint16_t nr_get_dci_size(nfapi_nr_dci_format_e format, uint16_t N_RB); void nr_generate_dci_top(PHY_VARS_gNB *gNB, - nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu, - nfapi_nr_dl_tti_pdcch_pdu *ul_pdcch_pdu, - uint32_t **gold_pdcch_dmrs, - int32_t *txdataF, - int16_t amp, - NR_DL_FRAME_PARMS *frame_parms); + processingData_L1tx_t *msgTx, + uint32_t **gold_pdcch_dmrs, + int32_t *txdataF, + int16_t amp, + NR_DL_FRAME_PARMS *frame_parms); void nr_pdcch_scrambling(uint32_t *in, uint32_t size, diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 11b5112a6c..ff77854898 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -962,12 +962,14 @@ typedef struct processingData_L1tx { int slot; openair0_timestamp timestamp_tx; PHY_VARS_gNB *gNB; - nfapi_nr_dl_tti_pdcch_pdu pdcch_pdu; - nfapi_nr_ul_dci_request_pdus_t ul_pdcch_pdu; + nfapi_nr_dl_tti_pdcch_pdu pdcch_pdu[NFAPI_NR_MAX_NB_CORESETS]; + nfapi_nr_ul_dci_request_pdus_t ul_pdcch_pdu[NFAPI_NR_MAX_NB_CORESETS]; NR_gNB_CSIRS_t csirs_pdu[NUMBER_OF_NR_CSIRS_MAX]; NR_gNB_DLSCH_t *dlsch[NUMBER_OF_NR_DLSCH_MAX][2]; NR_gNB_SSB_t ssb[64]; uint16_t num_pdsch_slot; + int num_dl_pdcch; + int num_ul_pdcch; time_stats_t phy_proc_tx; } processingData_L1tx_t; diff --git a/openair1/SCHED_NR/fapi_nr_l1.c b/openair1/SCHED_NR/fapi_nr_l1.c index 8f315ba214..cfe29690b6 100644 --- a/openair1/SCHED_NR/fapi_nr_l1.c +++ b/openair1/SCHED_NR/fapi_nr_l1.c @@ -166,10 +166,9 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){ TX_req->SFN,TX_req->Slot,TX_req->Number_of_PDUs, number_ul_dci_pdu,number_ul_tti_pdu); - int pdcch_received=0; msgTx->num_pdsch_slot=0; - msgTx->pdcch_pdu.pdcch_pdu_rel15.numDlDci = 0; - msgTx->ul_pdcch_pdu.pdcch_pdu.pdcch_pdu_rel15.numDlDci = 0; + msgTx->num_dl_pdcch=0; + msgTx->num_ul_pdcch=number_ul_dci_pdu; msgTx->slot = slot; msgTx->frame = frame; @@ -183,10 +182,9 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){ break; case NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE: - AssertFatal(pdcch_received == 0, "pdcch_received is not 0, we can only handle one PDCCH PDU per slot\n"); - msgTx->pdcch_pdu = dl_tti_pdu->pdcch_pdu; - - pdcch_received = 1; + LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE for %d.%d\n",frame,slot,DL_req->SFN,DL_req->Slot); + msgTx->pdcch_pdu[msgTx->num_dl_pdcch] = dl_tti_pdu->pdcch_pdu; + msgTx->num_dl_pdcch++; break; case NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE: @@ -208,8 +206,9 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){ } } - if (number_ul_dci_pdu > 0) - msgTx->ul_pdcch_pdu = UL_dci_req->ul_dci_pdu_list[number_ul_dci_pdu-1]; // copy the last pdu + for (int i=0; iul_pdcch_pdu[i] = UL_dci_req->ul_dci_pdu_list[i]; + } pushNotifiedFIFO(gNB->resp_L1_tx,res); diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 1685e206ae..c32463b681 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -158,18 +158,16 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_COMMON_TX,0); - int num_dl_dci = msgTx->pdcch_pdu.pdcch_pdu_rel15.numDlDci; - int num_ul_dci = msgTx->ul_pdcch_pdu.pdcch_pdu.pdcch_pdu_rel15.numDlDci; + int num_pdcch_pdus = msgTx->num_ul_pdcch + msgTx->num_dl_pdcch; - if (num_dl_dci > 0 || num_ul_dci > 0) { - LOG_D(PHY, "[gNB %d] Frame %d slot %d Calling nr_generate_dci_top (number of UL/DL DCI %d/%d)\n", - gNB->Mod_id, frame, slot, num_ul_dci, num_dl_dci); + if (num_pdcch_pdus > 0) { + LOG_D(PHY, "[gNB %d] Frame %d slot %d Calling nr_generate_dci_top (number of UL/DL PDCCH PDUs %d/%d)\n", + gNB->Mod_id, frame, slot, msgTx->num_ul_pdcch, msgTx->num_dl_pdcch); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_PDCCH_TX,1); nr_generate_dci_top(gNB, - num_dl_dci > 0 ? &msgTx->pdcch_pdu : NULL, - num_ul_dci > 0 ? &msgTx->ul_pdcch_pdu.pdcch_pdu : NULL, + msgTx, gNB->nr_gold_pdcch_dmrs[slot], &gNB->common_vars.txdataF[0][txdataF_offset], AMP, fp); diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index affa7fd803..28e6379adf 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -1045,7 +1045,7 @@ int main(int argc, char **argv) UE_info->UE_sched_ctrl[0].harq_processes[harq_pid].round = round; for (int i=0; iUE_info.pdcch_cand[i] = 0; + gNB_mac->pdcch_cand[i] = 0; if (css_flag == 0) { nr_schedule_ue_spec(0, frame, slot); From a3cb841b6f8ea2ec1b74058a94f361b5465ad916 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Tue, 14 Dec 2021 09:54:14 +0000 Subject: [PATCH 033/113] Add config file for 162PRBs (60MHz BW) --- ...gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf | 331 ++++++++++++++++++ 1 file changed, 331 insertions(+) create mode 100644 targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf new file mode 100644 index 0000000000..83fd3e0886 --- /dev/null +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf @@ -0,0 +1,331 @@ +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + gNB_name = "gNB-OAI"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ({ + mcc = 208; + mnc = 99; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x1; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + + }); + + nr_cellid = 12345678L; + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 2; +# do_CSIRS = 1; + min_rxtxtime_pdsch = 2; + ul_prbblacklist = "79,80,81,82" + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 11; + searchSpaceZero = 10; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3300.60 MHz + 81*12*30e-3 MHz = 3329.76 + absoluteFrequencySSB = 621984; + # this is 3300.60 MHz + dl_absoluteFrequencyPointA = 620040; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 162; + #initialDownlinkBWP + #genericParameters + # this is RBstart=0,L=162 (275*(275-L+1))+(274-RBstart)) + initialDLBWPlocationAndBandwidth = 31899; + # +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 11; + initialDLBWPsearchSpaceZero = 10; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; + #initialULBWPmappingType + #0=typeA,1=typeB + initialDLBWPmappingType_0 = 0; + #this is SS=1,L=13 + initialDLBWPstartSymbolAndLength_0 = 40; + + initialDLBWPk0_1 = 0; + initialDLBWPmappingType_1 = 0; + #this is SS=1,L=5 + initialDLBWPstartSymbolAndLength_1 = 57; + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 78; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 162; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 31899; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 12; + preambleReceivedTargetPower = -104; +#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) + preambleTransMax = 6; +#powerRampingStep +# 0=dB0,1=dB2,2=dB4,3=dB6 + powerRampingStep = 1; +#ra_ReponseWindow +#1,2,4,8,10,20,40,80 + ra_ResponseWindow = 4; +#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR +#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 3; +#oneHalf (0..15) 4,8,12,16,...60,64 + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15; +#ra_ContentionResolutionTimer +#(0..7) 8,16,24,32,40,48,56,64 + ra_ContentionResolutionTimer = 7; + rsrp_ThresholdSSB = 19; +#prach-RootSequenceIndex_PR +#1 = 839, 2 = 139 + prach_RootSequenceIndex_PR = 2; + prach_RootSequenceIndex = 1; + # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex + # + msg1_SubcarrierSpacing = 1, +# restrictedSetConfig +# 0=unrestricted, 1=restricted type A, 2=restricted type B + restrictedSetConfig = 0, + + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; + initialULBWPmappingType_0 = 1 + # this is SS=2 L=13 + initialULBWPstartSymbolAndLength_0 = 41; + + initialULBWPk2_1 = 2; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=4 + initialULBWPstartSymbolAndLength_1 = 52; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; + + msg3_DeltaPreamble = 1; + p0_NominalWithGrant =-90; + +# pucch-ConfigCommon setup : +# pucchGroupHopping +# 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -70; +# ssb_PositionsInBurs_BitmapPR +# 1=short, 2=medium, 3=long + ssb_PositionsInBurst_PR = 2; + ssb_PositionsInBurst_Bitmap = 1; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 2; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 1; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 1; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 6; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "192.168.70.132"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24"; + GNB_INTERFACE_NAME_FOR_NGU = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 200; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 0; +} +); + +L1s = ( +{ + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 4; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 120; +} +); + +RUs = ( +{ + local_rf = "yes" + nb_tx = 2 + nb_rx = 2 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 75; + sf_extension = 0; + eNB_instances = [0]; + ##beamforming 1x2 matrix: 1 layer x 2 antennas + bf_weights = [0x00007fff, 0x0000]; + #clock_src = "internal"; + sdr_addrs = "mgmt_addr=192.168.10.2,addr=192.168.10.2,clock_source=internal,time_source=internal" +} +); + +THREAD_STRUCT = ( +{ + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; +} +); + +rfsimulator : +{ + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; +}; + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + +log_config : +{ + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; +}; From c33c8aa836d5d2aa1a14ba9bd0b5b2dda0fd20f6 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Tue, 14 Dec 2021 12:52:22 +0100 Subject: [PATCH 034/113] merge develop, some minor code review updates --- common/config/config_load_configmodule.c | 2 +- openair1/PHY/TOOLS/nr_phy_scope.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/common/config/config_load_configmodule.c b/common/config/config_load_configmodule.c index 740c6e240b..8559a5da8a 100644 --- a/common/config/config_load_configmodule.c +++ b/common/config/config_load_configmodule.c @@ -249,7 +249,7 @@ configmodule_interface_t *load_configmodule(int argc, } cfgptr = calloc(sizeof(configmodule_interface_t),1); - cfgptr->argv_info = calloc(sizeof(int32_t), argc); + cfgptr->argv_info = calloc(sizeof(int32_t), argc+10); cfgptr->argv_info[0] |= CONFIG_CMDLINEOPT_PROCESSED; if (OoptIdx >= 0) { diff --git a/openair1/PHY/TOOLS/nr_phy_scope.c b/openair1/PHY/TOOLS/nr_phy_scope.c index 3440e4f28c..bf58c660c8 100644 --- a/openair1/PHY/TOOLS/nr_phy_scope.c +++ b/openair1/PHY/TOOLS/nr_phy_scope.c @@ -33,7 +33,6 @@ #define ScaleZone 4 #define localBuff(NaMe,SiZe) float NaMe[SiZe]; memset(NaMe,0,sizeof(NaMe)); -int otg_enabled; const FL_COLOR rx_antenna_colors[4] = {FL_RED,FL_BLUE,FL_GREEN,FL_YELLOW}; const FL_COLOR water_colors[4] = {FL_BLUE,FL_GREEN,FL_YELLOW,FL_RED}; From b1b6c1862463612113ea02787cb11010e18f51d7 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Tue, 14 Dec 2021 17:28:27 +0100 Subject: [PATCH 035/113] add doc --- doc/SW_archi.md | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/doc/SW_archi.md b/doc/SW_archi.md index e5856d63bc..7242c5c0a3 100644 --- a/doc/SW_archi.md +++ b/doc/SW_archi.md @@ -18,6 +18,69 @@ body { +flowchart TB + A[ru_thread] --> RFin>block rx_rf] --> feprx + feprx --> half-slot --> end_feprx + feprx --> second-thread -- block_end_feprx --> end_feprx>feprx] + end_feprx --> rx_nr_prach_ru +rx_nr_prach_ru -- block_queue --> resp_L1>resp L1] +resp_L1 -- async launch --> rx_func +resp_L1 -- immediate return --> RFin + +subgraph rxfunc +rx_func_implem[rx_func] + subgraph rxfuncbeg + handle_nr_slot_ind + --> rnti_to_remove-mgmt + --> L1_nr_prach_procedures + --> apply_nr_rotation_ul + end + subgraph phy_procedures_gNB_uespec_RX + fill_ul_rb_mask + --> pucch(decode each gNB->pucch) + -->nr_fill_ul_indication + --> nr_ulsch_procedures + --> nr_ulsch_decoding + --> segInParallel[[all segments decode in parallel]] + --> barrier_end_of_ulsch_decoding + end + subgraph NR_UL_indication + handle_nr_rach + --> handle_nr_uci + --> handle_nr_ulsch + --> gNB_dlsch_ulsch_scheduler + --> NR_Schedule_response + end + rx_func_implem --> rxfuncbeg + rxfuncbeg --> phy_procedures_gNB_uespec_RX +phy_procedures_gNB_uespec_RX --> NR_UL_indication +-- block_queue --> L1_tx_free2>L1 tx free] +-- async launch --> tx_func +L1_tx_free2 -- send_msg --> rsp((resp_L1)) +end +rx_func --> rxfunc + + +subgraph tx + direction LR + subgraph tx_func2 + phy_procedures_gNB_TX + --> dcitop[nr_generate dci top] + --> nr_generate_csi_rs + --> apply_nr_rotation + -- send_msg --> end_tx_func((L1_tx_out)) + end + subgraph tx_reorder_thread + L1_tx_out>L1_tx_out] + --> reorder{re order} --> reorder + reorder --> ru_tx_func + reorder --> L1_tx_free((L1_tx_free)) + ru_tx_func --> feptx_prec + --> feptx_ofdm + end + tx_func2 --> tx_reorder_thread +end + This tuto for 5G gNB design, with Open Cells main {: .text-center} From f522cf2b4e9da7ade0074f6bce8f5d569a7bf011 Mon Sep 17 00:00:00 2001 From: Thomas Laurent Date: Tue, 14 Dec 2021 16:30:18 +0000 Subject: [PATCH 036/113] Update SW_archi.md --- doc/SW_archi.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/SW_archi.md b/doc/SW_archi.md index 7242c5c0a3..2a015c1aef 100644 --- a/doc/SW_archi.md +++ b/doc/SW_archi.md @@ -17,7 +17,7 @@ body { - +```mermaid flowchart TB A[ru_thread] --> RFin>block rx_rf] --> feprx feprx --> half-slot --> end_feprx @@ -80,6 +80,7 @@ subgraph tx end tx_func2 --> tx_reorder_thread end +``` This tuto for 5G gNB design, with Open Cells main {: .text-center} From f3fb44f703b78770439f1a67d3ab5ff96c36d937 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Tue, 14 Dec 2021 17:35:19 +0100 Subject: [PATCH 037/113] add sw graph --- doc/SW-archi-graph.md | 64 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 doc/SW-archi-graph.md diff --git a/doc/SW-archi-graph.md b/doc/SW-archi-graph.md new file mode 100644 index 0000000000..8a14c38cfa --- /dev/null +++ b/doc/SW-archi-graph.md @@ -0,0 +1,64 @@ +```mermaid +flowchart TB + A[ru_thread] --> RFin>block rx_rf] --> feprx + feprx --> half-slot --> end_feprx + feprx --> second-thread -- block_end_feprx --> end_feprx>feprx] + end_feprx --> rx_nr_prach_ru +rx_nr_prach_ru -- block_queue --> resp_L1>resp L1] +resp_L1 -- async launch --> rx_func +resp_L1 -- immediate return --> RFin + +subgraph rxfunc +rx_func_implem[rx_func] + subgraph rxfuncbeg + handle_nr_slot_ind + --> rnti_to_remove-mgmt + --> L1_nr_prach_procedures + --> apply_nr_rotation_ul + end + subgraph phy_procedures_gNB_uespec_RX + fill_ul_rb_mask + --> pucch(decode each gNB->pucch) + -->nr_fill_ul_indication + --> nr_ulsch_procedures + --> nr_ulsch_decoding + --> segInParallel[[all segments decode in parallel]] + --> barrier_end_of_ulsch_decoding + end + subgraph NR_UL_indication + handle_nr_rach + --> handle_nr_uci + --> handle_nr_ulsch + --> gNB_dlsch_ulsch_scheduler + --> NR_Schedule_response + end + rx_func_implem --> rxfuncbeg + rxfuncbeg --> phy_procedures_gNB_uespec_RX +phy_procedures_gNB_uespec_RX --> NR_UL_indication +-- block_queue --> L1_tx_free2>L1 tx free] +-- async launch --> tx_func +L1_tx_free2 -- send_msg --> rsp((resp_L1)) +end +rx_func --> rxfunc + + +subgraph tx + direction LR + subgraph tx_func2 + phy_procedures_gNB_TX + --> dcitop[nr_generate dci top] + --> nr_generate_csi_rs + --> apply_nr_rotation + -- send_msg --> end_tx_func((L1_tx_out)) + end + subgraph tx_reorder_thread + L1_tx_out>L1_tx_out] + --> reorder{re order} --> reorder + reorder --> ru_tx_func + reorder --> L1_tx_free((L1_tx_free)) + ru_tx_func --> feptx_prec + --> feptx_ofdm + end + tx_func2 --> tx_reorder_thread +end +``` From bdf5d26b821246c3eb78e7ac7cc9d53b098b7f8b Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 15 Dec 2021 08:44:53 +0100 Subject: [PATCH 038/113] changing the name of a function --- common/utils/nr/nr_common.c | 4 +-- common/utils/nr/nr_common.h | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 8 ++--- .../LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 6 ++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 20 +++++------ .../NR_MAC_gNB/gNB_scheduler_primitives.c | 36 +++++++++---------- 6 files changed, 38 insertions(+), 38 deletions(-) diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c index 42c7ef9c7e..65fecea96f 100644 --- a/common/utils/nr/nr_common.c +++ b/common/utils/nr/nr_common.c @@ -473,8 +473,8 @@ int get_subband_size(int NPRB,int size) { } // from start symbol index and nb or symbols to symbol occupation bitmap in a slot -uint16_t startandlength_to_bitmat(int startSymbolIndex, int nrOfSymbols) { - return (((1<state = WAIT_Msg3; @@ -1609,7 +1609,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra int i = 0; while ((i < rbSize) && (rbStart + rbSize <= BWPSize)) { - if (vrb_map[BWPStart + rbStart + i]&startandlength_to_bitmat(startSymbolIndex, nrOfSymbols)) { + if (vrb_map[BWPStart + rbStart + i]&SL_to_bitmap(startSymbolIndex, nrOfSymbols)) { rbStart += i+1; i = 0; } else { @@ -1790,7 +1790,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra CCEIndex, aggregation_level); for (int rb = 0; rb < pdsch_pdu_rel15->rbSize; rb++) { - vrb_map[BWPStart + rb + pdsch_pdu_rel15->rbStart] |= startandlength_to_bitmat(startSymbolIndex, nrOfSymbols); + vrb_map[BWPStart + rb + pdsch_pdu_rel15->rbStart] |= SL_to_bitmap(startSymbolIndex, nrOfSymbols); } LOG_D(NR_MAC,"BWPSize: %i\n", pdcch_pdu_rel15->BWPSize); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index 7945042ba5..8212cba08d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -314,7 +314,7 @@ void fill_ssb_vrb_map (NR_COMMON_channels_t *cc, int rbStart, uint16_t symStart uint16_t *vrb_map = cc[CC_id].vrb_map; for (int rb = 0; rb < 20; rb++) - vrb_map[rbStart + rb] = startandlength_to_bitmat(symStart, 4); + vrb_map[rbStart + rb] = SL_to_bitmap(symStart, 4); } @@ -392,7 +392,7 @@ uint32_t schedule_control_sib1(module_id_t module_id, int rbSize = 0; uint32_t TBS = 0; do { - if(rbSize < bwpSize && !(vrb_map[rbStart + rbSize]&startandlength_to_bitmat(startSymbolIndex, nrOfSymbols))) + if(rbSize < bwpSize && !(vrb_map[rbStart + rbSize]&SL_to_bitmap(startSymbolIndex, nrOfSymbols))) rbSize++; else{ if (gNB_mac->sched_ctrlCommon->sched_pdsch.mcs<10) @@ -426,7 +426,7 @@ uint32_t schedule_control_sib1(module_id_t module_id, gNB_mac->sched_ctrlCommon->cce_index, gNB_mac->sched_ctrlCommon->aggregation_level); for (int rb = 0; rb < gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize; rb++) { - vrb_map[rb + rbStart] = startandlength_to_bitmat(startSymbolIndex, nrOfSymbols); + vrb_map[rb + rbStart] = SL_to_bitmap(startSymbolIndex, nrOfSymbols); } return TBS; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 1f5eb4af2b..e5e9bf8f18 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -562,14 +562,14 @@ bool allocate_dl_retransmission(module_id_t module_id, rbStart += rbSize; /* last iteration rbSize was not enough, skip it */ rbSize = 0; while (rbStart < bwpSize && - !(rballoc_mask[rbStart]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) + !(rballoc_mask[rbStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) rbStart++; if (rbStart >= bwpSize) { LOG_D(NR_MAC, "cannot allocate retransmission for UE %d/RNTI %04x: no resources\n", UE_id, UE_info->rnti[UE_id]); return false; } while (rbStart + rbSize < bwpSize && - (rballoc_mask[rbStart + rbSize]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols)) && + (rballoc_mask[rbStart + rbSize]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols)) && rbSize < retInfo->rbSize) rbSize++; } @@ -584,10 +584,10 @@ bool allocate_dl_retransmission(module_id_t module_id, temp_ps.nrOfLayers = 1; nr_set_pdsch_semi_static(scc, cg, sched_ctrl->active_bwp, bwpd, tda, f, &temp_ps); while (rbStart < bwpSize && - !(rballoc_mask[rbStart]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) + !(rballoc_mask[rbStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) rbStart++; while (rbStart + rbSize < bwpSize && - (rballoc_mask[rbStart + rbSize]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) + (rballoc_mask[rbStart + rbSize]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) rbSize++; uint32_t new_tbs; uint16_t new_rbSize; @@ -670,7 +670,7 @@ bool allocate_dl_retransmission(module_id_t module_id, /* retransmissions: directly allocate */ *n_rb_sched -= sched_ctrl->sched_pdsch.rbSize; for (int rb = 0; rb < sched_ctrl->sched_pdsch.rbSize; rb++) - rballoc_mask[rb + sched_ctrl->sched_pdsch.rbStart] -= startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols); + rballoc_mask[rb + sched_ctrl->sched_pdsch.rbStart] -= SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); return true; } @@ -832,12 +832,12 @@ void pf_dl(module_id_t module_id, // Freq-demain allocation while (rbStart < bwpSize && - !(rballoc_mask[rbStart]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) + !(rballoc_mask[rbStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) rbStart++; uint16_t max_rbSize = 1; while (rbStart + max_rbSize < bwpSize && - (rballoc_mask[rbStart + max_rbSize]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) + (rballoc_mask[rbStart + max_rbSize]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) max_rbSize++; sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); @@ -861,7 +861,7 @@ void pf_dl(module_id_t module_id, /* transmissions: directly allocate */ n_rb_sched -= sched_pdsch->rbSize; for (int rb = 0; rb < sched_pdsch->rbSize; rb++) - rballoc_mask[rb + sched_pdsch->rbStart] -= startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols); + rballoc_mask[rb + sched_pdsch->rbStart] -= SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); } } @@ -904,8 +904,8 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t // if any RB in vrb_map is blocked (1), the current RBG will be 0 rballoc_mask[i] = (~vrb_map[i+BWPStart])&0x3fff; //bitwise not and 14 symbols // if all the pdsch symbols are free - if((rballoc_mask[i]&startandlength_to_bitmat(startSymbolIndex, nrOfSymbols)) == - startandlength_to_bitmat(startSymbolIndex, nrOfSymbols)) + if((rballoc_mask[i]&SL_to_bitmap(startSymbolIndex, nrOfSymbols)) == + SL_to_bitmap(startSymbolIndex, nrOfSymbols)) n_rb_sched++; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index a5ba558deb..61168994c8 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -380,7 +380,7 @@ void fill_pdcch_vrb_map(gNB_MAC_INST *mac, f = (r*C + c + n_shift)%(N_regs/L); } for(int rb=0; rbBWPStart + f*B_rb + rb] |= startandlength_to_bitmat(pdcch->StartSymbolIndex, N_symb); + vrb_map[pdcch->BWPStart + f*B_rb + rb] |= SL_to_bitmap(pdcch->StartSymbolIndex, N_symb); } } } @@ -2371,20 +2371,20 @@ void nr_csirs_scheduling(int Mod_idP, csirs_pdu_rel15->row = 1; csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row1.buf[0])>>4)&0x0f; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 1); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 1); break; case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2: csirs_pdu_rel15->row = 2; csirs_pdu_rel15->freq_domain = (((resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]>>4)&0x0f) | ((resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]<<8)&0xff0)); for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 1); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 1); break; case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row4: csirs_pdu_rel15->row = 4; csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row4.buf[0])>>5)&0x07; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 1); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 1); break; case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other: csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.other.buf[0])>>2)&0x3f; @@ -2395,18 +2395,18 @@ void nr_csirs_scheduling(int Mod_idP, case NR_CSI_RS_ResourceMapping__nrofPorts_p2: csirs_pdu_rel15->row = 3; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 1); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 1); break; case NR_CSI_RS_ResourceMapping__nrofPorts_p4: csirs_pdu_rel15->row = 5; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2); break; case NR_CSI_RS_ResourceMapping__nrofPorts_p8: if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { csirs_pdu_rel15->row = 8; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2); } else{ int num_k = 0; @@ -2415,12 +2415,12 @@ void nr_csirs_scheduling(int Mod_idP, if(num_k==4) { csirs_pdu_rel15->row = 6; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 1); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 1); } else { csirs_pdu_rel15->row = 7; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2); } } break; @@ -2428,12 +2428,12 @@ void nr_csirs_scheduling(int Mod_idP, if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { csirs_pdu_rel15->row = 10; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2); } else { csirs_pdu_rel15->row = 9; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 1); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 1); } break; case NR_CSI_RS_ResourceMapping__nrofPorts_p16: @@ -2442,24 +2442,24 @@ void nr_csirs_scheduling(int Mod_idP, else csirs_pdu_rel15->row = 11; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2); break; case NR_CSI_RS_ResourceMapping__nrofPorts_p24: if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { csirs_pdu_rel15->row = 14; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2) | startandlength_to_bitmat(csirs_pdu_rel15->symb_l1, 2)); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2) | SL_to_bitmap(csirs_pdu_rel15->symb_l1, 2)); } else{ if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) { csirs_pdu_rel15->row = 15; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 3); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 3); } else { csirs_pdu_rel15->row = 13; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2) | startandlength_to_bitmat(csirs_pdu_rel15->symb_l1, 2)); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2) | SL_to_bitmap(csirs_pdu_rel15->symb_l1, 2)); } } break; @@ -2467,18 +2467,18 @@ void nr_csirs_scheduling(int Mod_idP, if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { csirs_pdu_rel15->row = 17; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2) | startandlength_to_bitmat(csirs_pdu_rel15->symb_l1, 2)); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2) | SL_to_bitmap(csirs_pdu_rel15->symb_l1, 2)); } else{ if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) { csirs_pdu_rel15->row = 18; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 3); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 3); } else { csirs_pdu_rel15->row = 16; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2) | startandlength_to_bitmat(csirs_pdu_rel15->symb_l1, 2)); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2) | SL_to_bitmap(csirs_pdu_rel15->symb_l1, 2)); } } break; From b2b3dd1331ed7821c6d0972035bd511e37b31f66 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Thu, 16 Dec 2021 12:59:17 +0100 Subject: [PATCH 039/113] gNBthread flow update --- doc/SW-archi-graph.md | 29 +++++++++++----- executables/nr-gnb.c | 33 ++++++++----------- .../nfapi/public_inc/fapi_nr_ue_interface.h | 4 +-- openair1/PHY/defs_gNB.h | 3 +- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 4 +-- openair1/SIMULATION/NR_PHY/dlsim.c | 4 +-- openair1/SIMULATION/NR_PHY/ulsim.c | 2 +- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 14 ++++---- 8 files changed, 49 insertions(+), 44 deletions(-) diff --git a/doc/SW-archi-graph.md b/doc/SW-archi-graph.md index 8a14c38cfa..e8b0cdc0d7 100644 --- a/doc/SW-archi-graph.md +++ b/doc/SW-archi-graph.md @@ -4,7 +4,7 @@ flowchart TB feprx --> half-slot --> end_feprx feprx --> second-thread -- block_end_feprx --> end_feprx>feprx] end_feprx --> rx_nr_prach_ru -rx_nr_prach_ru -- block_queue --> resp_L1>resp L1] +rx_nr_prach_ru -- block_queue_singleton --> resp_L1>resp L1] resp_L1 -- async launch --> rx_func resp_L1 -- immediate return --> RFin @@ -29,24 +29,35 @@ rx_func_implem[rx_func] handle_nr_rach --> handle_nr_uci --> handle_nr_ulsch - --> gNB_dlsch_ulsch_scheduler - --> NR_Schedule_response + subgraph gNB_dlsch_ulsch_scheduler + run_pdcp + --> nr_rrc_trigger + --> schedule_xxxx + end + handle_nr_ulsch --> gNB_dlsch_ulsch_scheduler + subgraph NR_Schedule_response + L1_tx_free3>L1_tx_free] + --> handle_dl_fapi + --> sendTxFilled((L1_tx_filled)) + --> handle_ul_nfapi + + end + gNB_dlsch_ulsch_scheduler --> NR_Schedule_response end rx_func_implem --> rxfuncbeg rxfuncbeg --> phy_procedures_gNB_uespec_RX phy_procedures_gNB_uespec_RX --> NR_UL_indication --- block_queue --> L1_tx_free2>L1 tx free] +-- block_queue_block_PNF_monolithic --> L1_tx_free2>L1 tx filled] -- async launch --> tx_func L1_tx_free2 -- send_msg --> rsp((resp_L1)) end rx_func --> rxfunc -subgraph tx +subgraph tx_func direction LR - subgraph tx_func2 - phy_procedures_gNB_TX - --> dcitop[nr_generate dci top] + subgraph phy_procedures_gNB_TX + dcitop[nr_generate dci top] --> nr_generate_csi_rs --> apply_nr_rotation -- send_msg --> end_tx_func((L1_tx_out)) @@ -59,6 +70,6 @@ subgraph tx ru_tx_func --> feptx_prec --> feptx_ofdm end - tx_func2 --> tx_reorder_thread end + ``` diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 60239576e4..ff018b5452 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -303,8 +303,8 @@ void rx_func(void *param) { } static void dump_L1_meas_stats(PHY_VARS_gNB *gNB, RU_t *ru, char *output) { int stroff = 0; - stroff += print_meas_log(gNB->phy_proc_tx_0, "L1 Tx processing thread 0", NULL, NULL, output); - stroff += print_meas_log(gNB->phy_proc_tx_1, "L1 Tx processing thread 1", NULL, NULL, output+stroff); + stroff += print_meas_log(gNB->phy_proc_tx[0], "L1 Tx processing thread 0", NULL, NULL, output); + stroff += print_meas_log(gNB->phy_proc_tx[1], "L1 Tx processing thread 1", NULL, NULL, output+stroff); stroff += print_meas_log(&gNB->dlsch_encoding_stats, "DLSCH encoding", NULL, NULL, output+stroff); stroff += print_meas_log(&gNB->phy_proc_rx, "L1 Rx processing", NULL, NULL, output+stroff); stroff += print_meas_log(&gNB->ul_indication_stats, "UL Indication", NULL, NULL, output+stroff); @@ -339,8 +339,8 @@ void *nrL1_stats_thread(void *param) { fd=fopen("nrL1_stats.log","w"); AssertFatal(fd!=NULL,"Cannot open nrL1_stats.log\n"); - reset_meas(gNB->phy_proc_tx_0); - reset_meas(gNB->phy_proc_tx_1); + reset_meas(gNB->phy_proc_tx[0]); + reset_meas(gNB->phy_proc_tx[1]); reset_meas(&gNB->dlsch_encoding_stats); reset_meas(&gNB->phy_proc_rx); reset_meas(&gNB->ul_indication_stats); @@ -444,22 +444,17 @@ void init_gNB_Tpool(int inst) { initNotifiedFIFO(gNB->L1_tx_free); initNotifiedFIFO(gNB->L1_tx_filled); initNotifiedFIFO(gNB->L1_tx_out); + // we create 2 threads for L1 tx processing - notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->L1_tx_out,tx_func); - processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx); - init_DLSCH_struct(gNB, msgDataTx); - memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t)); - reset_meas(&msgDataTx->phy_proc_tx); - gNB->phy_proc_tx_0 = &msgDataTx->phy_proc_tx; - pushNotifiedFIFO(gNB->L1_tx_free,msgL1Tx); // to unblock the process in the beginning - - msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->L1_tx_out,tx_func); - msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx); - init_DLSCH_struct(gNB, msgDataTx); - memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t)); - reset_meas(&msgDataTx->phy_proc_tx); - gNB->phy_proc_tx_1 = &msgDataTx->phy_proc_tx; - pushNotifiedFIFO(gNB->L1_tx_free,msgL1Tx); // to unblock the process in the beginning + for (int i=0; i < 2; i++) { + notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->L1_tx_out,tx_func); + processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx); + init_DLSCH_struct(gNB, msgDataTx); + memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t)); + reset_meas(&msgDataTx->phy_proc_tx); + gNB->phy_proc_tx[i] = &msgDataTx->phy_proc_tx; + pushNotifiedFIFO(gNB->L1_tx_free,msgL1Tx); // to unblock the process in the beginning + } threadCreate(&proc->L1_stats_thread,nrL1_stats_thread,(void*)gNB,"L1_stats",-1,OAI_PRIORITY_RT_LOW); threadCreate(&proc->pthread_tx_reorder, tx_reorder_thread, (void *)gNB, "thread_tx_reorder", -1, OAI_PRIORITY_RT_MAX); diff --git a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h index 0e923931ad..798141f9ca 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h @@ -346,8 +346,8 @@ typedef struct { } fapi_nr_ul_config_request_pdu_t; typedef struct { - uint16_t sfn; - uint16_t slot; + //uint16_t sfn; + //uint16_t slot; uint8_t number_pdus; fapi_nr_ul_config_request_pdu_t ul_config_list[FAPI_NR_UL_CONFIG_LIST_NUM]; pthread_mutex_t mutex_ul_config; diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 6202cc72cd..a259a0a008 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -860,8 +860,7 @@ typedef struct PHY_VARS_gNB_s { /* time_stats_t phy_proc; */ - time_stats_t *phy_proc_tx_0; - time_stats_t *phy_proc_tx_1; + time_stats_t *phy_proc_tx[2]; time_stats_t phy_proc_rx; time_stats_t rx_prach; /* diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 7cf22db1a9..1df5c84efa 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -235,8 +235,8 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ } if (scheduled_response->tx_request) scheduled_response->tx_request->number_of_pdus = 0; - ul_config->sfn = 0; - ul_config->slot = 0; + //ul_config->sfn = 0; + //ul_config->slot = 0; ul_config->number_pdus = 0; memset(ul_config->ul_config_list, 0, sizeof(ul_config->ul_config_list)); pthread_mutex_unlock(&ul_config->mutex_ul_config); diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 50e21ac02b..df07d8b7d3 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -978,7 +978,7 @@ int main(int argc, char **argv) msgDataTx->frame = frame; memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t)); reset_meas(&msgDataTx->phy_proc_tx); - gNB->phy_proc_tx_0 = &msgDataTx->phy_proc_tx; + gNB->phy_proc_tx[0] = &msgDataTx->phy_proc_tx; pushTpool(gNB->threadPool,msgL1Tx); for (SNR = snr0; SNR < snr1; SNR += .2) { @@ -1294,7 +1294,7 @@ int main(int argc, char **argv) msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3, msgDataTx->dlsch[0][0]->harq_process.K, msgDataTx->dlsch[0][0]->harq_process.K/((msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3)>3824?22:10)); - printDistribution(gNB->phy_proc_tx_0,table_tx,"PHY proc tx"); + printDistribution(gNB->phy_proc_tx[0],table_tx,"PHY proc tx"); printStatIndent2(&gNB->dlsch_encoding_stats,"DLSCH encoding time"); printStatIndent3(&gNB->dlsch_segmentation_stats,"DLSCH segmentation time"); printStatIndent3(&gNB->tinput,"DLSCH LDPC input processing time"); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index a7075eb218..2237f2db2b 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -670,7 +670,7 @@ int main(int argc, char **argv) notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->resp_L1_tx,NULL); processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx); msgDataTx->slot = -1; - gNB->phy_proc_tx_0 = &msgDataTx->phy_proc_tx; + gNB->phy_proc_tx[0] = &msgDataTx->phy_proc_tx; pushNotifiedFIFO(gNB->resp_L1_tx,msgL1Tx); // to unblock the process in the beginning //gNB_config = &gNB->gNB_config; diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 911d051ed5..9a880ecbd8 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -61,11 +61,11 @@ static ssb_list_info_t ssb_list; void fill_ul_config(fapi_nr_ul_config_request_t *ul_config, frame_t frame_tx, int slot_tx, uint8_t pdu_type){ ul_config->ul_config_list[ul_config->number_pdus].pdu_type = pdu_type; - ul_config->slot = slot_tx; - ul_config->sfn = frame_tx; + //ul_config->slot = slot_tx; + //ul_config->sfn = frame_tx; ul_config->number_pdus++; - LOG_D(NR_MAC, "In %s: Set config request for UL transmission in [%d.%d], number of UL PDUs: %d\n", __FUNCTION__, ul_config->sfn, ul_config->slot, ul_config->number_pdus); + LOG_D(NR_MAC, "In %s: Set config request for UL transmission in [%d.%d], number of UL PDUs: %d\n", __FUNCTION__, frame_tx, slot_tx, ul_config->number_pdus); } @@ -947,15 +947,15 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in // AND if a UL grant (UL DCI or Msg3) has been received (as indicated by num_pdus) if (ul_config){ pthread_mutex_lock(&ul_config->mutex_ul_config); - if ((ul_info->slot_tx == ul_config->slot && ul_info->frame_tx == ul_config->sfn) && ul_config->number_pdus > 0){ + if (/*(ul_info->slot_tx == ul_config->slot && ul_info->frame_tx == ul_config->sfn) && */ ul_config->number_pdus > 0){ - LOG_D(NR_MAC, "In %s:[%d.%d]: number of UL PDUs: %d with UL transmission in [%d.%d]\n", __FUNCTION__, frame_tx, slot_tx, ul_config->number_pdus, ul_config->sfn, ul_config->slot); + LOG_D(NR_MAC, "In %s:[%d.%d]: number of UL PDUs: %d with UL transmission\n", __FUNCTION__, frame_tx, slot_tx, ul_config->number_pdus); uint8_t ulsch_input_buffer_array[NFAPI_MAX_NUM_UL_PDU][MAX_ULSCH_PAYLOAD_BYTES]; nr_scheduled_response_t scheduled_response; fapi_nr_tx_request_t tx_req; - tx_req.slot = slot_tx; - tx_req.sfn = frame_tx; + //tx_req.slot = slot_tx; + //tx_req.sfn = frame_tx; tx_req.number_of_pdus = 0; for (int j = 0; j < ul_config->number_pdus; j++) { From e0776377c4fb1142dff594cb25c2258b451e1d29 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Thu, 16 Dec 2021 17:18:50 +0100 Subject: [PATCH 040/113] fix phy simulators with updated threads synchro --- .../nfapi/public_inc/fapi_nr_ue_interface.h | 2 ++ openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 2 ++ openair1/SIMULATION/NR_PHY/dlsim.c | 14 +++++++++----- openair1/SIMULATION/NR_PHY/ulsim.c | 12 ++++++++---- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 10 +++++++--- 5 files changed, 28 insertions(+), 12 deletions(-) diff --git a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h index 798141f9ca..4140c714a2 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h @@ -348,6 +348,8 @@ typedef struct { typedef struct { //uint16_t sfn; //uint16_t slot; + uint16_t sfn; + uint16_t slot; uint8_t number_pdus; fapi_nr_ul_config_request_pdu_t ul_config_list[FAPI_NR_UL_CONFIG_LIST_NUM]; pthread_mutex_t mutex_ul_config; diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 1df5c84efa..9e81531c42 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -237,6 +237,8 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ scheduled_response->tx_request->number_of_pdus = 0; //ul_config->sfn = 0; //ul_config->slot = 0; + ul_config->sfn = 0; + ul_config->slot = 0; ul_config->number_pdus = 0; memset(ul_config->ul_config_list, 0, sizeof(ul_config->ul_config_list)); pthread_mutex_unlock(&ul_config->mutex_ul_config); diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index df07d8b7d3..054d7d2b21 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -968,10 +968,14 @@ int main(int argc, char **argv) gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t)); char tp_param[] = "n"; initTpool(tp_param, gNB->threadPool, true); - gNB->resp_L1_tx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); - initNotifiedFIFO(gNB->resp_L1_tx); - // we create 2 threads for L1 tx processing - notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->resp_L1_tx,processSlotTX); + gNB->L1_tx_free = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); + gNB->L1_tx_filled = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); + gNB->L1_tx_out = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); + initNotifiedFIFO(gNB->L1_tx_free); + initNotifiedFIFO(gNB->L1_tx_filled); + initNotifiedFIFO(gNB->L1_tx_out); + // we create 1 single msg for L1 tx processing (instead of 2 in full gNB) + notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->L1_tx_free,processSlotTX); processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx); init_DLSCH_struct(gNB, msgDataTx); msgDataTx->slot = slot; @@ -979,7 +983,6 @@ int main(int argc, char **argv) memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t)); reset_meas(&msgDataTx->phy_proc_tx); gNB->phy_proc_tx[0] = &msgDataTx->phy_proc_tx; - pushTpool(gNB->threadPool,msgL1Tx); for (SNR = snr0; SNR < snr1; SNR += .2) { @@ -1058,6 +1061,7 @@ int main(int argc, char **argv) Sched_INFO.UL_tti_req = gNB_mac->UL_tti_req_ahead[slot]; Sched_INFO.UL_dci_req = NULL; Sched_INFO.TX_req = &gNB_mac->TX_req[0]; + pushNotifiedFIFO(gNB->L1_tx_free,msgL1Tx); nr_schedule_response(&Sched_INFO); /* PTRS values for DLSIM calculations */ diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 2237f2db2b..43cdb2a068 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -665,13 +665,16 @@ int main(int argc, char **argv) char tp_param[] = "n"; initTpool(tp_param, gNB->threadPool, false); initNotifiedFIFO(gNB->respDecode); - gNB->resp_L1_tx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); - initNotifiedFIFO(gNB->resp_L1_tx); - notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->resp_L1_tx,NULL); + gNB->L1_tx_free = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); + gNB->L1_tx_filled = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); + gNB->L1_tx_out = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); + initNotifiedFIFO(gNB->L1_tx_free); + initNotifiedFIFO(gNB->L1_tx_filled); + initNotifiedFIFO(gNB->L1_tx_out); + notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->L1_tx_free,NULL); processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx); msgDataTx->slot = -1; gNB->phy_proc_tx[0] = &msgDataTx->phy_proc_tx; - pushNotifiedFIFO(gNB->resp_L1_tx,msgL1Tx); // to unblock the process in the beginning //gNB_config = &gNB->gNB_config; //memset((void *)&gNB->UL_INFO,0,sizeof(gNB->UL_INFO)); @@ -1117,6 +1120,7 @@ int main(int argc, char **argv) } // prepare ULSCH/PUSCH reception + pushNotifiedFIFO(gNB->L1_tx_free,msgL1Tx); // to unblock the process in the beginning nr_schedule_response(Sched_INFO); // --------- setting parameters for UE -------- diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 9a880ecbd8..6707a6cd80 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -63,9 +63,11 @@ void fill_ul_config(fapi_nr_ul_config_request_t *ul_config, frame_t frame_tx, in ul_config->ul_config_list[ul_config->number_pdus].pdu_type = pdu_type; //ul_config->slot = slot_tx; //ul_config->sfn = frame_tx; + ul_config->slot = slot_tx; + ul_config->sfn = frame_tx; ul_config->number_pdus++; - LOG_D(NR_MAC, "In %s: Set config request for UL transmission in [%d.%d], number of UL PDUs: %d\n", __FUNCTION__, frame_tx, slot_tx, ul_config->number_pdus); + LOG_D(NR_MAC, "In %s: Set config request for UL transmission in [%d.%d], number of UL PDUs: %d\n", __FUNCTION__, ul_config->sfn, ul_config->slot, ul_config->number_pdus); } @@ -947,15 +949,17 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in // AND if a UL grant (UL DCI or Msg3) has been received (as indicated by num_pdus) if (ul_config){ pthread_mutex_lock(&ul_config->mutex_ul_config); - if (/*(ul_info->slot_tx == ul_config->slot && ul_info->frame_tx == ul_config->sfn) && */ ul_config->number_pdus > 0){ + if ((ul_info->slot_tx == ul_config->slot && ul_info->frame_tx == ul_config->sfn) && ul_config->number_pdus > 0){ - LOG_D(NR_MAC, "In %s:[%d.%d]: number of UL PDUs: %d with UL transmission\n", __FUNCTION__, frame_tx, slot_tx, ul_config->number_pdus); + LOG_D(NR_MAC, "In %s:[%d.%d]: number of UL PDUs: %d with UL transmission in [%d.%d]\n", __FUNCTION__, frame_tx, slot_tx, ul_config->number_pdus, ul_config->sfn, ul_config->slot); uint8_t ulsch_input_buffer_array[NFAPI_MAX_NUM_UL_PDU][MAX_ULSCH_PAYLOAD_BYTES]; nr_scheduled_response_t scheduled_response; fapi_nr_tx_request_t tx_req; //tx_req.slot = slot_tx; //tx_req.sfn = frame_tx; + tx_req.slot = slot_tx; + tx_req.sfn = frame_tx; tx_req.number_of_pdus = 0; for (int j = 0; j < ul_config->number_pdus; j++) { From bc04d7209b19cc827bb3a1415028b0073ce184ba Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 20 Dec 2021 11:54:57 +0100 Subject: [PATCH 041/113] some improvements from review --- nfapi/oai_integration/nfapi_pnf.c | 5 +-- openair2/LAYER2/NR_MAC_gNB/config.c | 14 +++--- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 12 +++--- .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 4 +- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 43 +++++++++++-------- 5 files changed, 43 insertions(+), 35 deletions(-) diff --git a/nfapi/oai_integration/nfapi_pnf.c b/nfapi/oai_integration/nfapi_pnf.c index a0b4a03e04..639b32b08c 100644 --- a/nfapi/oai_integration/nfapi_pnf.c +++ b/nfapi/oai_integration/nfapi_pnf.c @@ -1159,7 +1159,7 @@ int pnf_phy_ul_dci_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, if (req->numPdus > 0) { for (int i=0; inumPdus; i++) { - if (req->ul_dci_pdu_list[i].PDUType == 0) // only possible value 0: PDCCH PDU + if (req->ul_dci_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE) // only possible value 0: PDCCH PDU msgTx->ul_pdcch_pdu[i] = req->ul_dci_pdu_list[i]; else LOG_E(PHY,"[PNF] UL_DCI_REQ sfn_slot:%d PDU[%d] - unknown pdu type:%d\n", NFAPI_SFNSLOT2DEC(req->SFN, req->Slot), req->numPdus-1, req->ul_dci_pdu_list[req->numPdus-1].PDUType); @@ -1243,8 +1243,7 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, processingData_L1tx_t *msgTx = (processingData_L1tx_t *)NotifiedFifoData(res); if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE) { - // we trust the scheduler sends only one PDCCH PDU per slot - msgTx->pdcch_pdu[i] = dl_tti_pdu_list[i].pdcch_pdu; // fills the last received PDCCH PDU + msgTx->pdcch_pdu[i] = dl_tti_pdu_list[i].pdcch_pdu; // copies all the received PDCCH PDUs } else if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_SSB_PDU_TYPE) { //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() PDU:%d BCH: pdu_index:%u pdu_length:%d sdu_length:%d BCH_SDU:%x,%x,%x\n", __FUNCTION__, i, pdu_index, bch_pdu->bch_pdu_rel8.length, tx_request_pdu[sfn][sf][pdu_index]->segments[0].segment_length, sdu[0], sdu[1], sdu[2]); diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index a56206a1d2..7b89e4e993 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -641,14 +641,16 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, bwpd = (void*)CellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP; genericParameters = &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters; } + else + AssertFatal(1==0,"Either initial BWP or active BWP should always be present\n"); sched_ctrl->search_space = get_searchspace(scc, bwpd, target_ss); sched_ctrl->coreset = get_coreset(Mod_idP, scc, bwpd, sched_ctrl->search_space, target_ss); - UE_info->UE_sched_ctrl[UE_id].sched_pdcch = set_pdcch_structure(RC.nrmac[Mod_idP], - sched_ctrl->search_space, - sched_ctrl->coreset, - scc, - genericParameters, - NULL); + sched_ctrl->sched_pdcch = set_pdcch_structure(RC.nrmac[Mod_idP], + sched_ctrl->search_space, + sched_ctrl->coreset, + scc, + genericParameters, + NULL); sched_ctrl->maxL = 2; } } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index e5e9bf8f18..f9a87456f4 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -830,14 +830,15 @@ void pf_dl(module_id_t module_id, if (ps->time_domain_allocation != tda) nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, f, ps); + const uint16_t slbitmap = SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); // Freq-demain allocation while (rbStart < bwpSize && - !(rballoc_mask[rbStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) + !(rballoc_mask[rbStart]&slbitmap)) rbStart++; uint16_t max_rbSize = 1; while (rbStart + max_rbSize < bwpSize && - (rballoc_mask[rbStart + max_rbSize]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) + (rballoc_mask[rbStart + max_rbSize]&slbitmap)) max_rbSize++; sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); @@ -861,7 +862,7 @@ void pf_dl(module_id_t module_id, /* transmissions: directly allocate */ n_rb_sched -= sched_pdsch->rbSize; for (int rb = 0; rb < sched_pdsch->rbSize; rb++) - rballoc_mask[rb + sched_pdsch->rbStart] -= SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); + rballoc_mask[rb + sched_pdsch->rbStart] -= slbitmap; } } @@ -896,6 +897,7 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + const uint16_t slbitmap = SL_to_bitmap(startSymbolIndex, nrOfSymbols); uint16_t *vrb_map = RC.nrmac[module_id]->common_channels[CC_id].vrb_map; uint16_t rballoc_mask[bwpSize]; int n_rb_sched = 0; @@ -904,8 +906,8 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t // if any RB in vrb_map is blocked (1), the current RBG will be 0 rballoc_mask[i] = (~vrb_map[i+BWPStart])&0x3fff; //bitwise not and 14 symbols // if all the pdsch symbols are free - if((rballoc_mask[i]&SL_to_bitmap(startSymbolIndex, nrOfSymbols)) == - SL_to_bitmap(startSymbolIndex, nrOfSymbols)) + if((rballoc_mask[i]&slbitmap) == + slbitmap) n_rb_sched++; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index 2de5117229..9d3d015aae 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -298,12 +298,12 @@ void nr_preprocessor_phytest(module_id_t module_id, while (true) { /* advance to first free RB */ while (rbStart < bwpSize && - (vrb_map[rbStart + BWPStart]&(((1<nrOfSymbols)-1)<startSymbolIndex))) + (vrb_map[rbStart + BWPStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) rbStart++; rbSize = 1; /* iterate until we are at target_dl_bw or no available RBs */ while (rbStart + rbSize < bwpSize && - !(vrb_map[rbStart + rbSize + BWPStart]&(((1<nrOfSymbols)-1)<startSymbolIndex)) && + !(vrb_map[rbStart + rbSize + BWPStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols)) && rbSize < target_dl_bw) rbSize++; /* found target_dl_bw? */ diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 61168994c8..5c82beb0df 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -293,6 +293,19 @@ NR_sched_pdcch_t *set_pdcch_structure(gNB_MAC_INST *gNB_mac, } +int cce_to_reg_interleaving(const int R, int k, int n_shift, const int C, int L, const int N_regs) { + + int f; // interleaving function + if(R==0) + f = k; + else { + int c = k/R; + int r = k%R; + f = (r*C + c + n_shift)%(N_regs/L); + } + return f; +} + uint8_t find_pdcch_candidate(gNB_MAC_INST *mac, int cc_id, int aggregation, @@ -310,34 +323,26 @@ uint8_t find_pdcch_candidate(gNB_MAC_INST *mac, return -1; } - int N_rb = pdcch->n_rb; // nb of rbs of coreset per symbol - int N_symb = coreset->duration; // nb of coreset symbols - int N_regs = N_rb*N_symb; // nb of REGs per coreset - int N_cces = N_regs / NR_NB_REG_PER_CCE; // nb of cces in coreset - - int L = pdcch->RegBundleSize; - int R = pdcch->InterleaverSize; - int n_shift = pdcch->ShiftIndex; - int C = R>0 ? N_regs/(L*R) : 0; - int B_rb = L/N_symb; // nb of RBs occupied by each REG bundle + const int N_rb = pdcch->n_rb; // nb of rbs of coreset per symbol + const int N_symb = coreset->duration; // nb of coreset symbols + const int N_regs = N_rb*N_symb; // nb of REGs per coreset + const int N_cces = N_regs / NR_NB_REG_PER_CCE; // nb of cces in coreset + const int R = pdcch->InterleaverSize; + const int L = pdcch->RegBundleSize; + const int C = R>0 ? N_regs/(L*R) : 0; + const int B_rb = L/N_symb; // nb of RBs occupied by each REG bundle int first_cce; bool taken = false; // flag if the resource for a given candidate are taken // loop over all the available candidates + // this implements TS 38.211 Sec. 7.3.2.2 for(int m=next_cand; mShiftIndex, C, L, N_regs); for(int rb=0; rbBWPStart + f*B_rb + rb]&(((1<StartSymbolIndex)) { + if(vrb_map[pdcch->BWPStart + f*B_rb + rb]&SL_to_bitmap(pdcch->StartSymbolIndex,N_symb)) { taken = true; break; } From 6947202c80e2ea87c8169382e2df4b929f5b1afc Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 20 Dec 2021 15:53:53 +0100 Subject: [PATCH 042/113] sched_pdcch not a pointer in structures --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 18 +++--- .../LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 6 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 10 ++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 8 +-- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 58 +++++++++---------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 14 ++--- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 12 ++-- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 4 +- 8 files changed, 65 insertions(+), 65 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index c622d67c97..5cca08fc93 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -799,7 +799,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t ul_dci_request_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_pdcch_pdu)); pdcch_pdu_rel15 = &ul_dci_request_pdu->pdcch_pdu.pdcch_pdu_rel15; ul_dci_req->numPdus += 1; - nr_configure_pdcch(pdcch_pdu_rel15, coreset, genericParameters, ra->sched_pdcch); + nr_configure_pdcch(pdcch_pdu_rel15, coreset, genericParameters, &ra->sched_pdcch); nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu_rel15; } @@ -815,7 +815,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t CC_id, aggregation_level, nr_of_candidates, - ra->sched_pdcch, + &ra->sched_pdcch, coreset, 0); if (CCEIndex < 0) { @@ -861,7 +861,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t fill_pdcch_vrb_map(nr_mac, CC_id, - ra->sched_pdcch, + &ra->sched_pdcch, CCEIndex, aggregation_level); @@ -1211,7 +1211,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra CC_id, aggregation_level, nr_of_candidates, - ra->sched_pdcch, + &ra->sched_pdcch, coreset, 0); @@ -1236,7 +1236,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra dl_tti_pdcch_pdu->PDUSize = (uint8_t)(2 + sizeof(nfapi_nr_dl_tti_pdcch_pdu)); dl_req->nPDUs += 1; pdcch_pdu_rel15 = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; - nr_configure_pdcch(pdcch_pdu_rel15, coreset, genericParameters, ra->sched_pdcch); + nr_configure_pdcch(pdcch_pdu_rel15, coreset, genericParameters, &ra->sched_pdcch); nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu_rel15; } @@ -1397,7 +1397,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra // Mark the corresponding symbols RBs as used fill_pdcch_vrb_map(nr_mac, CC_id, - ra->sched_pdcch, + &ra->sched_pdcch, CCEIndex, aggregation_level); for (int rb = 0; rb < rbSize; rb++) { @@ -1500,7 +1500,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra CC_id, aggregation_level, nr_of_candidates, - ra->sched_pdcch, + &ra->sched_pdcch, coreset, 0); @@ -1642,7 +1642,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra dl_tti_pdcch_pdu->PDUSize = (uint8_t)(2 + sizeof(nfapi_nr_dl_tti_pdcch_pdu)); dl_req->nPDUs += 1; pdcch_pdu_rel15 = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; - nr_configure_pdcch(pdcch_pdu_rel15, coreset, genericParameters, ra->sched_pdcch); + nr_configure_pdcch(pdcch_pdu_rel15, coreset, genericParameters, &ra->sched_pdcch); nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu_rel15; } @@ -1786,7 +1786,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra // Mark the corresponding symbols and RBs as used fill_pdcch_vrb_map(nr_mac, CC_id, - ra->sched_pdcch, + &ra->sched_pdcch, CCEIndex, aggregation_level); for (int rb = 0; rb < pdsch_pdu_rel15->rbSize; rb++) { diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index 8212cba08d..eca68d8573 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -366,7 +366,7 @@ uint32_t schedule_control_sib1(module_id_t module_id, CC_id, gNB_mac->sched_ctrlCommon->aggregation_level, nr_of_candidates, - gNB_mac->sched_ctrlCommon->sched_pdcch, + &gNB_mac->sched_ctrlCommon->sched_pdcch, gNB_mac->sched_ctrlCommon->coreset, 0); @@ -422,7 +422,7 @@ uint32_t schedule_control_sib1(module_id_t module_id, // Mark the corresponding RBs as used fill_pdcch_vrb_map(gNB_mac, CC_id, - gNB_mac->sched_ctrlCommon->sched_pdcch, + &gNB_mac->sched_ctrlCommon->sched_pdcch, gNB_mac->sched_ctrlCommon->cce_index, gNB_mac->sched_ctrlCommon->aggregation_level); for (int rb = 0; rb < gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize; rb++) { @@ -452,7 +452,7 @@ void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP, nr_configure_pdcch(pdcch_pdu_rel15, gNB_mac->sched_ctrlCommon->coreset, NULL, - gNB_mac->sched_ctrlCommon->sched_pdcch); + &gNB_mac->sched_ctrlCommon->sched_pdcch); nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdsch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; memset((void*)dl_tti_pdsch_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t)); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index f9a87456f4..ed796ef007 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -628,7 +628,7 @@ bool allocate_dl_retransmission(module_id_t module_id, /* CC_id = */ 0, sched_ctrl->aggregation_level, nr_of_candidates, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, sched_ctrl->coreset, Y); @@ -657,7 +657,7 @@ bool allocate_dl_retransmission(module_id_t module_id, fill_pdcch_vrb_map(RC.nrmac[module_id], /* CC_id = */ 0, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, CCEIndex, sched_ctrl->aggregation_level); @@ -785,7 +785,7 @@ void pf_dl(module_id_t module_id, /* CC_id = */ 0, sched_ctrl->aggregation_level, nr_of_candidates, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, sched_ctrl->coreset, Y); @@ -816,7 +816,7 @@ void pf_dl(module_id_t module_id, fill_pdcch_vrb_map(mac, /* CC_id = */ 0, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, CCEIndex, sched_ctrl->aggregation_level); @@ -1073,7 +1073,7 @@ void nr_schedule_ue_spec(module_id_t module_id, pdcch_pdu = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; LOG_D(NR_MAC,"Trying to configure DL pdcch for UE %d, bwp %d, cs %d\n",UE_id,bwpid,coresetid); NR_ControlResourceSet_t *coreset = (bwp||bwpd)? sched_ctrl->coreset:gNB_mac->sched_ctrlCommon->coreset; - nr_configure_pdcch(pdcch_pdu, coreset, genericParameters, sched_ctrl->sched_pdcch); + nr_configure_pdcch(pdcch_pdu, coreset, genericParameters, &sched_ctrl->sched_pdcch); gNB_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index 9d3d015aae..8f32cf136e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -351,7 +351,7 @@ void nr_preprocessor_phytest(module_id_t module_id, CC_id, sched_ctrl->aggregation_level, nr_of_candidates, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, sched_ctrl->coreset, Y); @@ -377,7 +377,7 @@ void nr_preprocessor_phytest(module_id_t module_id, fill_pdcch_vrb_map(RC.nrmac[module_id], CC_id, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, CCEIndex, sched_ctrl->aggregation_level); @@ -517,7 +517,7 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ CC_id, sched_ctrl->aggregation_level, nr_of_candidates, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, sched_ctrl->coreset, Y); @@ -556,7 +556,7 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ /* mark the corresponding RBs as used */ fill_pdcch_vrb_map(nr_mac, CC_id, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, CCEIndex, sched_ctrl->aggregation_level); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 5c82beb0df..4f3e04bd07 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -209,41 +209,41 @@ NR_SearchSpace_t *get_searchspace(NR_ServingCellConfigCommon_t *scc, AssertFatal(0, "Couldn't find an adequate searchspace bwp_Dedicated %p\n",bwp_Dedicated); } -NR_sched_pdcch_t *set_pdcch_structure(gNB_MAC_INST *gNB_mac, - NR_SearchSpace_t *ss, - NR_ControlResourceSet_t *coreset, - NR_ServingCellConfigCommon_t *scc, - NR_BWP_t *bwp, - NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config) { - - NR_sched_pdcch_t *pdcch = calloc(1,sizeof(NR_sched_pdcch_t)); +NR_sched_pdcch_t set_pdcch_structure(gNB_MAC_INST *gNB_mac, + NR_SearchSpace_t *ss, + NR_ControlResourceSet_t *coreset, + NR_ServingCellConfigCommon_t *scc, + NR_BWP_t *bwp, + NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config) { int sps; + NR_sched_pdcch_t pdcch; + AssertFatal(*ss->controlResourceSetId == coreset->controlResourceSetId, "coreset id in SS %ld does not correspond to the one in coreset %ld", *ss->controlResourceSetId, coreset->controlResourceSetId); if (bwp) { // This is not for SIB1 if(coreset->controlResourceSetId == 0){ - pdcch->BWPSize = gNB_mac->cset0_bwp_size; - pdcch->BWPStart = gNB_mac->cset0_bwp_start; + pdcch.BWPSize = gNB_mac->cset0_bwp_size; + pdcch.BWPStart = gNB_mac->cset0_bwp_start; } else { - pdcch->BWPSize = NRRIV2BW(bwp->locationAndBandwidth, MAX_BWP_SIZE); - pdcch->BWPStart = NRRIV2PRBOFFSET(bwp->locationAndBandwidth, MAX_BWP_SIZE); + pdcch.BWPSize = NRRIV2BW(bwp->locationAndBandwidth, MAX_BWP_SIZE); + pdcch.BWPStart = NRRIV2PRBOFFSET(bwp->locationAndBandwidth, MAX_BWP_SIZE); } - pdcch->SubcarrierSpacing = bwp->subcarrierSpacing; - pdcch->CyclicPrefix = (bwp->cyclicPrefix==NULL) ? 0 : *bwp->cyclicPrefix; + pdcch.SubcarrierSpacing = bwp->subcarrierSpacing; + pdcch.CyclicPrefix = (bwp->cyclicPrefix==NULL) ? 0 : *bwp->cyclicPrefix; //AssertFatal(pdcch_scs==kHz15, "PDCCH SCS above 15kHz not allowed if a symbol above 2 is monitored"); sps = bwp->cyclicPrefix == NULL ? 14 : 12; } else { AssertFatal(type0_PDCCH_CSS_config!=NULL,"type0_PDCCH_CSS_config is null,bwp %p\n",bwp); - pdcch->BWPSize = type0_PDCCH_CSS_config->num_rbs; - pdcch->BWPStart = type0_PDCCH_CSS_config->cset_start_rb; - pdcch->SubcarrierSpacing = type0_PDCCH_CSS_config->scs_pdcch; - pdcch->CyclicPrefix = 0; + pdcch.BWPSize = type0_PDCCH_CSS_config->num_rbs; + pdcch.BWPStart = type0_PDCCH_CSS_config->cset_start_rb; + pdcch.SubcarrierSpacing = type0_PDCCH_CSS_config->scs_pdcch; + pdcch.CyclicPrefix = 0; sps = 14; } @@ -256,29 +256,29 @@ NR_sched_pdcch_t *set_pdcch_structure(gNB_MAC_INST *gNB_mac, for (int i=0; i>(sps-1-i))&1) { - pdcch->StartSymbolIndex=i; + pdcch.StartSymbolIndex=i; break; } } - pdcch->DurationSymbols = coreset->duration; + pdcch.DurationSymbols = coreset->duration; //cce-REG-MappingType - pdcch->CceRegMappingType = coreset->cce_REG_MappingType.present == NR_ControlResourceSet__cce_REG_MappingType_PR_interleaved? + pdcch.CceRegMappingType = coreset->cce_REG_MappingType.present == NR_ControlResourceSet__cce_REG_MappingType_PR_interleaved? NFAPI_NR_CCE_REG_MAPPING_INTERLEAVED : NFAPI_NR_CCE_REG_MAPPING_NON_INTERLEAVED; - if (pdcch->CceRegMappingType == NFAPI_NR_CCE_REG_MAPPING_INTERLEAVED) { - pdcch->RegBundleSize = (coreset->cce_REG_MappingType.choice.interleaved->reg_BundleSize == + if (pdcch.CceRegMappingType == NFAPI_NR_CCE_REG_MAPPING_INTERLEAVED) { + pdcch.RegBundleSize = (coreset->cce_REG_MappingType.choice.interleaved->reg_BundleSize == NR_ControlResourceSet__cce_REG_MappingType__interleaved__reg_BundleSize_n6) ? 6 : (2+coreset->cce_REG_MappingType.choice.interleaved->reg_BundleSize); - pdcch->InterleaverSize = (coreset->cce_REG_MappingType.choice.interleaved->interleaverSize == + pdcch.InterleaverSize = (coreset->cce_REG_MappingType.choice.interleaved->interleaverSize == NR_ControlResourceSet__cce_REG_MappingType__interleaved__interleaverSize_n6) ? 6 : (2+coreset->cce_REG_MappingType.choice.interleaved->interleaverSize); AssertFatal(scc->physCellId != NULL,"scc->physCellId is null\n"); - pdcch->ShiftIndex = coreset->cce_REG_MappingType.choice.interleaved->shiftIndex != NULL ? *coreset->cce_REG_MappingType.choice.interleaved->shiftIndex : *scc->physCellId; + pdcch.ShiftIndex = coreset->cce_REG_MappingType.choice.interleaved->shiftIndex != NULL ? *coreset->cce_REG_MappingType.choice.interleaved->shiftIndex : *scc->physCellId; } else { - pdcch->RegBundleSize = 6; - pdcch->InterleaverSize = 0; - pdcch->ShiftIndex = 0; + pdcch.RegBundleSize = 6; + pdcch.InterleaverSize = 0; + pdcch.ShiftIndex = 0; } int N_rb = 0; // nb of rbs of coreset per symbol @@ -287,7 +287,7 @@ NR_sched_pdcch_t *set_pdcch_structure(gNB_MAC_INST *gNB_mac, N_rb+=((coreset->frequencyDomainResources.buf[i]>>t)&1); } } - pdcch->n_rb = N_rb*=6; // each bit of frequencyDomainResources represents 6 PRBs + pdcch.n_rb = N_rb*=6; // each bit of frequencyDomainResources represents 6 PRBs return pdcch; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 7b33e029d8..2fa5a55d0e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1024,7 +1024,7 @@ bool allocate_ul_retransmission(module_id_t module_id, CC_id, sched_ctrl->aggregation_level, nr_of_candidates, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, sched_ctrl->coreset, Y); @@ -1036,7 +1036,7 @@ bool allocate_ul_retransmission(module_id_t module_id, sched_ctrl->cce_index = CCEIndex; fill_pdcch_vrb_map(RC.nrmac[module_id], CC_id, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, CCEIndex, sched_ctrl->aggregation_level); @@ -1170,7 +1170,7 @@ void pf_ul(module_id_t module_id, CC_id, sched_ctrl->aggregation_level, nr_of_candidates, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, sched_ctrl->coreset, Y); @@ -1194,7 +1194,7 @@ void pf_ul(module_id_t module_id, sched_ctrl->cce_index = CCEIndex; fill_pdcch_vrb_map(RC.nrmac[module_id], CC_id, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, CCEIndex, sched_ctrl->aggregation_level); @@ -1280,7 +1280,7 @@ void pf_ul(module_id_t module_id, CC_id, sched_ctrl->aggregation_level, nr_of_candidates, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, sched_ctrl->coreset, Y); if (CCEIndex<0) { @@ -1350,7 +1350,7 @@ void pf_ul(module_id_t module_id, sched_ctrl->cce_index = CCEIndex; fill_pdcch_vrb_map(RC.nrmac[module_id], CC_id, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, CCEIndex, sched_ctrl->aggregation_level); @@ -1754,7 +1754,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) ul_dci_request_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_pdcch_pdu)); pdcch_pdu = &ul_dci_request_pdu->pdcch_pdu.pdcch_pdu_rel15; ul_dci_req->numPdus += 1; - nr_configure_pdcch(pdcch_pdu, coreset, genericParameters, sched_ctrl->sched_pdcch); + nr_configure_pdcch(pdcch_pdu, coreset, genericParameters, &sched_ctrl->sched_pdcch); nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu; } diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 524f4598b3..4b876fcf04 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -253,12 +253,12 @@ void nr_configure_pdcch(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu, NR_BWP_t *bwp, NR_sched_pdcch_t *pdcch); -NR_sched_pdcch_t *set_pdcch_structure(gNB_MAC_INST *gNB_mac, - NR_SearchSpace_t *ss, - NR_ControlResourceSet_t *coreset, - NR_ServingCellConfigCommon_t *scc, - NR_BWP_t *bwp, - NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config); +NR_sched_pdcch_t set_pdcch_structure(gNB_MAC_INST *gNB_mac, + NR_SearchSpace_t *ss, + NR_ControlResourceSet_t *coreset, + NR_ServingCellConfigCommon_t *scc, + NR_BWP_t *bwp, + NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config); uint8_t find_pdcch_candidate(gNB_MAC_INST *mac, int cc_id, diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index c18f4b8bba..1073cef16c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -181,7 +181,7 @@ typedef struct { NR_SearchSpace_t *ra_ss; /// RA Coreset NR_ControlResourceSet_t *coreset; - NR_sched_pdcch_t *sched_pdcch; + NR_sched_pdcch_t sched_pdcch; // Beam index uint8_t beam_id; /// CellGroup for UE that is to come (NSA is non-null, null for SA) @@ -551,7 +551,7 @@ typedef struct { /// CCE index and aggregation, should be coherent with cce_list NR_SearchSpace_t *search_space; NR_ControlResourceSet_t *coreset; - NR_sched_pdcch_t *sched_pdcch; + NR_sched_pdcch_t sched_pdcch; /// CCE index and Aggr. Level are shared for PUSCH/PDSCH allocation decisions /// corresponding to the sched_pusch/sched_pdsch structures below From 624b307355f5bafe6ca0a7ba84748140d35e8c68 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Fri, 24 Dec 2021 12:24:35 +0000 Subject: [PATCH 043/113] Fix warnings after merge with develop --- .../conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf | 2 +- .../conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf | 2 +- openair1/PHY/INIT/nr_init_ue.c | 11 +---------- openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c | 11 +++++------ .../CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 9 ++++++--- .../CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 6 +++++- 6 files changed, 19 insertions(+), 22 deletions(-) diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index ff05aa6e65..a2b4d86dfc 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -11,7 +11,7 @@ gNBs = # cell_type = "CELL_MACRO_GNB"; gNB_name = "gNB-OAI"; - min_rxtxtime_pdsch = 6; + min_rxtxtime = 6; // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf index ff05aa6e65..a2b4d86dfc 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf @@ -11,7 +11,7 @@ gNBs = # cell_type = "CELL_MACRO_GNB"; gNB_name = "gNB-OAI"; - min_rxtxtime_pdsch = 6; + min_rxtxtime = 6; // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1; diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index f664a03ba0..fd5cc962b1 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -20,23 +20,14 @@ */ #include "phy_init.h" -#include "SCHED_UE/sched_UE.h" #include "PHY/phy_extern_nr_ue.h" -//#include "SIMULATION/TOOLS/sim.h" -/*#include "RadioResourceConfigCommonSIB.h" -#include "RadioResourceConfigDedicated.h" -#include "TDD-Config.h" -#include "MBSFN-SubframeConfigList.h"*/ #include "openair1/PHY/defs_RU.h" #include "openair1/PHY/impl_defs_nr.h" #include "common/utils/LOG/vcd_signal_dumper.h" #include "assertions.h" -#include +#include "PHY/MODULATION/nr_modulation.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" -//#include "PHY/LTE_REFSIG/lte_refsig.h" -#include "PHY/CODING/nrPolar_tools/nr_polar_pbch_defs.h" -#include "PHY/INIT/phy_init.h" #include "PHY/NR_REFSIG/pss_nr.h" #include "PHY/NR_REFSIG/ul_ref_seq_nr.h" #include "PHY/NR_REFSIG/refsig_defs_ue.h" diff --git a/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c index 82bb0a2659..66ed4593d8 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c @@ -44,15 +44,14 @@ void pcfich_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, int16_t *d) { - uint32_t i; - uint8_t reset; - uint32_t x1, x2, s=0; + uint8_t reset = 1; + uint32_t x1 = 0; + uint32_t s = 0; - reset = 1; // x1 is set in lte_gold_generic - x2 = ((((2*frame_parms->Nid_cell)+1)*(1+subframe))<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.7.1 + uint32_t x2 = ((((2*frame_parms->Nid_cell)+1)*(1+subframe))<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.7.1 - for (i=0; i<32; i++) { + for (uint32_t i=0; i<32; i++) { if ((i&0x1f)==0) { s = lte_gold_generic(&x1, &x2, reset); //printf("lte_gold[%d]=%x\n",i,s); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 74c8f36e2e..357e4b6acd 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -35,6 +35,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; + min_rxtxtime = 6; sib1_tda = 0; pdcch_ConfigSIB1 = ( @@ -66,7 +67,7 @@ gNBs = #initialDownlinkBWP #genericParameters # this is RBstart=27,L=48 (275*(L-1))+RBstart - initialDLBWPlocationAndBandwidth = 12952; # 6366 12925 12956 28875 12952 + initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952 # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialDLBWPsubcarrierSpacing = 1; @@ -86,7 +87,7 @@ gNBs = pMax = 20; #initialUplinkBWP #genericParameters - initialULBWPlocationAndBandwidth = 12952; + initialULBWPlocationAndBandwidth = 28875; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialULBWPsubcarrierSpacing = 1; @@ -218,7 +219,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + pusch_proc_threads = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 @@ -296,5 +297,7 @@ log_config : rrc_log_verbosity ="medium"; ngap_log_level ="debug"; ngap_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index 053cc2060b..c031651ed2 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -35,7 +35,9 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; + min_rxtxtime = 6; sib1_tda = 0; + do_SRS = 1; pdcch_ConfigSIB1 = ( { @@ -218,7 +220,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + pusch_proc_threads = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 @@ -296,5 +298,7 @@ log_config : rrc_log_verbosity ="medium"; ngap_log_level ="debug"; ngap_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; }; From daf8b950e143948bb7c50ffdc6039a8edf7a2e25 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 24 Dec 2021 18:09:40 +0000 Subject: [PATCH 044/113] Rename pusch_proc_threads to thread_pool_size --- ci-scripts/conf_files/benetel-5g.conf | 6 +++--- .../conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf | 2 +- .../conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf | 4 ++-- .../conf_files/gnb.band261.tm1.32PRB.usrpn300.conf | 6 +++--- .../conf_files/gnb.band66.tm1.106PRB.usrpn300.conf | 2 +- .../gnb.band78.nsa_2x2.106PRB.usrpn310.conf | 8 ++++---- .../gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 2 +- .../gnb.band78.sa.fr1.106PRB.usrpn310.conf | 2 +- .../gnb.band78.sa.fr1.162PRB.usrpn310.conf | 2 +- .../conf_files/gnb.band78.tm1.106PRB.usrpn300.conf | 6 +++--- .../gnb.band78.tm1.fr1.106PRB.usrpb210.conf | 2 +- .../gnb.band78.tm1.fr1.106PRB.usrpn310.conf | 6 +++--- executables/nr-gnb.c | 4 ++-- openair1/PHY/defs_gNB.h | 2 +- openair2/GNB_APP/L1_nr_paramdef.h | 8 ++++---- openair2/GNB_APP/gnb_config.c | 2 +- .../PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf | 6 +++--- .../CONF/gnb.band257.tm1.32PRB.usrpn300.conf | 6 +++--- .../CONF/gnb.band257.tm1.32PRB.usrpx300.conf | 6 +++--- .../CONF/gnb.band257.tm1.66PRB.usrpn300.conf | 6 +++--- .../CONF/gnb.band261.tm1.32PRB.usrpn300.conf | 8 ++++---- .../CONF/gnb.band66.tm1.106PRB.usrpn300.conf | 6 +++--- .../CONF/gnb.band66.tm1.106PRB.usrpx300.conf | 6 +++--- .../CONF/gnb.band78.106PRB.slave.conf | 6 +++--- .../CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf | 10 +++++----- .../CONF/gnb.band78.tm1.106PRB.usrpb210.conf | 6 +++--- .../CONF/gnb.band78.tm1.106PRB.usrpn300.conf | 6 +++--- .../CONF/gnb.band78.tm1.106PRB.usrpx300.conf | 6 +++--- .../CONF/gnb.band78.tm1.217PRB.usrpn300.conf | 12 ++++++------ .../CONF/gnb.band78.tm1.217PRB.usrpx300.conf | 12 ++++++------ .../CONF/gnb.band78.tm1.24PRB.usrpb210.conf | 6 +++--- .../CONF/gnb.band78.tm1.24PRB.usrpn300.conf | 6 +++--- .../CONF/gnb.band78.tm1.24PRB.usrpx300.conf | 12 ++++++------ .../CONF/gnb.band78.tm1.273PRB.usrpn300.conf | 12 ++++++------ .../GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf | 2 +- .../PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf | 6 +++--- .../GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf | 6 +++--- .../GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf | 6 +++--- targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf | 6 +++--- .../CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 2 +- .../CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 2 +- .../CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 2 +- .../gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf | 6 +++--- .../CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf | 2 +- 44 files changed, 121 insertions(+), 121 deletions(-) diff --git a/ci-scripts/conf_files/benetel-5g.conf b/ci-scripts/conf_files/benetel-5g.conf index 79b2f7f877..73b1da8c50 100644 --- a/ci-scripts/conf_files/benetel-5g.conf +++ b/ci-scripts/conf_files/benetel-5g.conf @@ -215,11 +215,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - } + thread_pool_size = 8; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf index 77693d5f72..b4c663b80b 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf @@ -232,7 +232,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 2; + thread_pool_size = 2; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf index c9b369eaff..725522f63a 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf @@ -229,9 +229,9 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 2; + thread_pool_size = 2; prach_dtx_threshold = 120; - } + } ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf index 4338c00b36..dd9c210c0d 100644 --- a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf @@ -211,12 +211,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf index 1c2133bebe..fdb816237d 100644 --- a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf @@ -198,7 +198,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } ); diff --git a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf index b0a757c9d0..b891af747a 100644 --- a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - prach_dtx_threshold = 120; - } + thread_pool_size = 8; + prach_dtx_threshold = 120; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index 093e82d4e6..e6ce5624c0 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -234,7 +234,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 4; + thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index a2b4d86dfc..481613381c 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -239,7 +239,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 4; + thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf index a2b4d86dfc..481613381c 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf @@ -239,7 +239,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 4; + thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf index 6ade355053..7efdf159eb 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf @@ -194,11 +194,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - } + thread_pool_size = 8; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf index b7a04b1f36..98ca9a5791 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf @@ -213,7 +213,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 6; + thread_pool_size = 6; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } ); diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf index 299a19cc4e..5a5f0e9aa6 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf @@ -210,11 +210,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 6; - } + thread_pool_size = 6; +} ); RUs = ( diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index a78750fefa..92a4f9dcd6 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -400,8 +400,8 @@ void init_gNB_Tpool(int inst) { // ULSCH decoding threadpool gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t)); int numCPU = sysconf(_SC_NPROCESSORS_ONLN); - LOG_I(PHY,"Number of threads requested in config file: %d, Number of threads available on this machine: %d\n",gNB->pusch_proc_threads,numCPU); - int threadCnt = min(numCPU, gNB->pusch_proc_threads); + LOG_I(PHY,"Number of threads requested in config file: %d, Number of threads available on this machine: %d\n",gNB->thread_pool_size,numCPU); + int threadCnt = min(numCPU, gNB->thread_pool_size); if (threadCnt < 2) LOG_E(PHY,"Number of threads for gNB should be more than 1. Allocated only %d\n",threadCnt); char pool[80]; sprintf(pool,"-1"); diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 1db4f6328a..7372ea6a9c 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -891,7 +891,7 @@ typedef struct PHY_VARS_gNB_s { notifiedFIFO_t *resp_RU_tx; tpool_t *threadPool; int nbDecode; - uint8_t pusch_proc_threads; + uint8_t thread_pool_size; int number_of_nr_dlsch_max; int number_of_nr_ulsch_max; void * scopeData; diff --git a/openair2/GNB_APP/L1_nr_paramdef.h b/openair2/GNB_APP/L1_nr_paramdef.h index 0306713845..ccff1ca995 100644 --- a/openair2/GNB_APP/L1_nr_paramdef.h +++ b/openair2/GNB_APP/L1_nr_paramdef.h @@ -46,7 +46,7 @@ #define CONFIG_STRING_L1_LOCAL_N_PORTD "local_n_portd" #define CONFIG_STRING_L1_REMOTE_N_PORTD "remote_n_portd" #define CONFIG_STRING_L1_TRANSPORT_N_PREFERENCE "tr_n_preference" -#define CONFIG_STRING_L1_PUSCH_PROC_THREADS "pusch_proc_threads" +#define CONFIG_STRING_L1_THREAD_POOL_SIZE "thread_pool_size" #define CONFIG_STRING_L1_OFDM_OFFSET_DIVISOR "ofdm_offset_divisor" #define CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD "pucch0_dtx_threshold" #define CONFIG_STRING_L1_PRACH_DTX_THRESHOLD "prach_dtx_threshold" @@ -65,8 +65,8 @@ {CONFIG_STRING_L1_REMOTE_N_PORTC, NULL, 0, uptr:NULL, defintval:50030, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_LOCAL_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_REMOTE_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ -{CONFIG_STRING_L1_PUSCH_PROC_THREADS, NULL, 0, uptr:NULL, defintval:3, TYPE_UINT, 0}, \ -{CONFIG_STRING_L1_OFDM_OFFSET_DIVISOR, NULL, 0, uptr:NULL, defuintval:8, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_THREAD_POOL_SIZE, NULL, 0, uptr:NULL, defintval:4, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_OFDM_OFFSET_DIVISOR, NULL, 0, uptr:NULL, defuintval:8, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:100, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PRACH_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:150, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PUSCH_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:50, TYPE_UINT, 0} \ @@ -80,7 +80,7 @@ #define L1_REMOTE_N_PORTC_IDX 6 #define L1_LOCAL_N_PORTD_IDX 7 #define L1_REMOTE_N_PORTD_IDX 8 -#define L1_PUSCH_PROC_THREADS 9 +#define L1_THREAD_POOL_SIZE 9 #define L1_OFDM_OFFSET_DIVISOR 10 #define L1_PUCCH0_DTX_THRESHOLD 11 #define L1_PRACH_DTX_THRESHOLD 12 diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index d069bfe2f4..027be4d3cb 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -653,7 +653,7 @@ void RCconfig_NR_L1(void) { RC.gNB[j]->Mod_id = j; } - RC.gNB[j]->pusch_proc_threads = *(L1_ParamList.paramarray[j][L1_PUSCH_PROC_THREADS].uptr); + RC.gNB[j]->thread_pool_size = *(L1_ParamList.paramarray[j][L1_THREAD_POOL_SIZE].uptr); RC.gNB[j]->ofdm_offset_divisor = *(L1_ParamList.paramarray[j][L1_OFDM_OFFSET_DIVISOR].uptr); RC.gNB[j]->pucch0_thres = *(L1_ParamList.paramarray[j][L1_PUCCH0_DTX_THRESHOLD].uptr); RC.gNB[j]->prach_thres = *(L1_ParamList.paramarray[j][L1_PRACH_DTX_THRESHOLD].uptr); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf index c6a4a90a14..b90acb8e97 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf @@ -216,11 +216,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - } + thread_pool_size = 8; +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf index fd9399f89e..c3faa198dd 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf index 59e71a6225..8fa8fcf992 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf @@ -196,12 +196,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf index 3fc81c0d6c..c2e364b75e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf @@ -193,12 +193,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf index a40a93c789..51c9076fe7 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } + thread_pool_size = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf index 3860aba935..d81655e5d5 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf @@ -194,12 +194,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf index 7c527e07c8..b063989fd2 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf @@ -194,12 +194,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf index 4f8c785baa..856eed4fc2 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf @@ -209,12 +209,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf index b6b9252560..2e4dc540f3 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf @@ -242,12 +242,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf index 0817d7373e..a454af7b21 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf @@ -193,12 +193,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf index fd4c23cfdb..f536fd4d47 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf index 965408332c..375bb5f54c 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf index e36748a3a9..76bc5bf992 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf @@ -209,12 +209,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf index 7b2d369919..7ff9d0ea77 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf @@ -193,12 +193,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf index dbf4f58348..07939f4d95 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf index 6d23726a78..6b5baef5ce 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf index c3fa56f15e..50169f4bce 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf index 15aa368fdf..e217f39b94 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf @@ -193,12 +193,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf index 06ae5af066..97f20c1461 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf @@ -28,7 +28,7 @@ L1s = ( remote_n_portc = 50001; // vnf p5 port local_n_portd = 50010; // pnf p7 port remote_n_portd = 50011; // vnf p7 port - pusch_proc_threads = 8; + thread_pool_size = 8; } ); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf index 8dfcfb2b88..5aade8ab21 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf index d01b0947c0..fd4a722fc7 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf @@ -211,12 +211,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf index 2f4839fd3b..2ecd4b1426 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf @@ -210,11 +210,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - } + thread_pool_size = 8; +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf index 7f9e4d2d44..92e97217b5 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf @@ -208,11 +208,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 2; - } + thread_pool_size = 2; +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 357e4b6acd..39e4d780af 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -219,7 +219,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 4; + thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index a423ee0dd1..44b7a0abc7 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -218,7 +218,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 4; + thread_pool_size = 4; prach_dtx_threshold = 120; #pucch0_dtx_threshold = 120; } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index c031651ed2..e7fb2b3a1b 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -220,7 +220,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 4; + thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf index e9577ee265..564b284f06 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf @@ -225,11 +225,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - } + thread_pool_size = 8; +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf index 83fd3e0886..ae664dc48a 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf @@ -248,7 +248,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 4; + thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 120; } From c1bec3e5bdbb8aec33339387237952a76a293ebd Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 24 Dec 2021 18:09:40 +0000 Subject: [PATCH 045/113] Rename pusch_proc_threads to thread_pool_size --- ci-scripts/conf_files/benetel-5g.conf | 6 +- .../gNB_SA_n78_106PRB.2x2_usrpn310.conf | 2 +- .../gNB_SA_n78_133PRB.2x2_usrpn310.conf | 4 +- .../gnb.band261.tm1.32PRB.usrpn300.conf | 6 +- .../gnb.band66.tm1.106PRB.usrpn300.conf | 2 +- .../gnb.band78.nsa_2x2.106PRB.usrpn310.conf | 8 +- ...gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 2 +- .../gnb.band78.sa.fr1.106PRB.usrpn310.conf | 2 +- .../gnb.band78.sa.fr1.162PRB.usrpn310.conf | 2 +- .../gnb.band78.tm1.106PRB.usrpn300.conf | 6 +- .../gnb.band78.tm1.fr1.106PRB.usrpb210.conf | 2 +- .../gnb.band78.tm1.fr1.106PRB.usrpn310.conf | 6 +- executables/nr-gnb.c | 4 +- openair1/PHY/defs_gNB.h | 2 +- openair2/GNB_APP/L1_nr_paramdef.h | 8 +- openair2/GNB_APP/gnb_config.c | 2 +- .../GENERIC-LTE-EPC/CONF/benetel-5g.conf | 6 +- .../CONF/gnb.band257.tm1.32PRB.usrpn300.conf | 6 +- .../CONF/gnb.band257.tm1.32PRB.usrpx300.conf | 6 +- .../CONF/gnb.band257.tm1.66PRB.usrpn300.conf | 6 +- .../CONF/gnb.band261.tm1.32PRB.usrpn300.conf | 8 +- .../CONF/gnb.band66.tm1.106PRB.usrpn300.conf | 6 +- .../CONF/gnb.band66.tm1.106PRB.usrpx300.conf | 6 +- .../CONF/gnb.band78.106PRB.slave.conf | 6 +- .../gnb.band78.tm1.106PRB.PTRS.usrpx300.conf | 10 +- .../CONF/gnb.band78.tm1.106PRB.usrpb210.conf | 6 +- .../CONF/gnb.band78.tm1.106PRB.usrpn300.conf | 6 +- .../CONF/gnb.band78.tm1.106PRB.usrpx300.conf | 6 +- .../CONF/gnb.band78.tm1.217PRB.usrpn300.conf | 12 +- .../CONF/gnb.band78.tm1.217PRB.usrpx300.conf | 12 +- .../CONF/gnb.band78.tm1.24PRB.usrpb210.conf | 6 +- .../CONF/gnb.band78.tm1.24PRB.usrpn300.conf | 6 +- .../CONF/gnb.band78.tm1.24PRB.usrpx300.conf | 12 +- .../CONF/gnb.band78.tm1.273PRB.usrpn300.conf | 12 +- .../CONF/oaiL1.nfapi.usrpx300.conf | 2 +- .../GENERIC-LTE-EPC/CONF/testing_gnb.conf | 6 +- .../CONF/testing_gnb_24PRB.conf | 6 +- .../CONF/testing_gnb_nsa_n310.conf | 6 +- .../PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf | 6 +- .../gnb.sa.band41.fr1.106PRB.usrpb210.conf | 9 +- ...gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 2 +- .../gnb.sa.band78.fr1.106PRB.usrpb210.conf | 6 +- ...b.sa.band78.fr1.106PRB.usrpb210.sabox.conf | 6 +- ...gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf | 331 ++++++++++++++++++ 44 files changed, 460 insertions(+), 122 deletions(-) create mode 100644 targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf diff --git a/ci-scripts/conf_files/benetel-5g.conf b/ci-scripts/conf_files/benetel-5g.conf index 79b2f7f877..73b1da8c50 100644 --- a/ci-scripts/conf_files/benetel-5g.conf +++ b/ci-scripts/conf_files/benetel-5g.conf @@ -215,11 +215,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - } + thread_pool_size = 8; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf index 77693d5f72..b4c663b80b 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf @@ -232,7 +232,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 2; + thread_pool_size = 2; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf index c9b369eaff..725522f63a 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf @@ -229,9 +229,9 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 2; + thread_pool_size = 2; prach_dtx_threshold = 120; - } + } ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf index 4338c00b36..dd9c210c0d 100644 --- a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf @@ -211,12 +211,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf index 1c2133bebe..fdb816237d 100644 --- a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf @@ -198,7 +198,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } ); diff --git a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf index b0a757c9d0..b891af747a 100644 --- a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - prach_dtx_threshold = 120; - } + thread_pool_size = 8; + prach_dtx_threshold = 120; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index 16456f939c..4bbb5dd7d1 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -234,7 +234,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 4; + thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index ff05aa6e65..9f7ea725d5 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -239,7 +239,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 4; + thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf index ff05aa6e65..9f7ea725d5 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf @@ -239,7 +239,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 4; + thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf index 6ade355053..7efdf159eb 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf @@ -194,11 +194,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - } + thread_pool_size = 8; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf index b7a04b1f36..98ca9a5791 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf @@ -213,7 +213,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 6; + thread_pool_size = 6; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } ); diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf index 299a19cc4e..5a5f0e9aa6 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf @@ -210,11 +210,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 6; - } + thread_pool_size = 6; +} ); RUs = ( diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index dc8960846f..543a679714 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -398,8 +398,8 @@ void init_gNB_Tpool(int inst) { // ULSCH decoding threadpool gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t)); int numCPU = sysconf(_SC_NPROCESSORS_ONLN); - LOG_I(PHY,"Number of threads requested in config file: %d, Number of threads available on this machine: %d\n",gNB->pusch_proc_threads,numCPU); - int threadCnt = min(numCPU, gNB->pusch_proc_threads); + LOG_I(PHY,"Number of threads requested in config file: %d, Number of threads available on this machine: %d\n",gNB->thread_pool_size,numCPU); + int threadCnt = min(numCPU, gNB->thread_pool_size); if (threadCnt < 2) LOG_E(PHY,"Number of threads for gNB should be more than 1. Allocated only %d\n",threadCnt); char pool[80]; sprintf(pool,"-1"); diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index fb4f9a0092..e548432749 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -890,7 +890,7 @@ typedef struct PHY_VARS_gNB_s { notifiedFIFO_t *resp_RU_tx; tpool_t *threadPool; int nbDecode; - uint8_t pusch_proc_threads; + uint8_t thread_pool_size; int number_of_nr_dlsch_max; int number_of_nr_ulsch_max; void * scopeData; diff --git a/openair2/GNB_APP/L1_nr_paramdef.h b/openair2/GNB_APP/L1_nr_paramdef.h index 0306713845..ccff1ca995 100644 --- a/openair2/GNB_APP/L1_nr_paramdef.h +++ b/openair2/GNB_APP/L1_nr_paramdef.h @@ -46,7 +46,7 @@ #define CONFIG_STRING_L1_LOCAL_N_PORTD "local_n_portd" #define CONFIG_STRING_L1_REMOTE_N_PORTD "remote_n_portd" #define CONFIG_STRING_L1_TRANSPORT_N_PREFERENCE "tr_n_preference" -#define CONFIG_STRING_L1_PUSCH_PROC_THREADS "pusch_proc_threads" +#define CONFIG_STRING_L1_THREAD_POOL_SIZE "thread_pool_size" #define CONFIG_STRING_L1_OFDM_OFFSET_DIVISOR "ofdm_offset_divisor" #define CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD "pucch0_dtx_threshold" #define CONFIG_STRING_L1_PRACH_DTX_THRESHOLD "prach_dtx_threshold" @@ -65,8 +65,8 @@ {CONFIG_STRING_L1_REMOTE_N_PORTC, NULL, 0, uptr:NULL, defintval:50030, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_LOCAL_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_REMOTE_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ -{CONFIG_STRING_L1_PUSCH_PROC_THREADS, NULL, 0, uptr:NULL, defintval:3, TYPE_UINT, 0}, \ -{CONFIG_STRING_L1_OFDM_OFFSET_DIVISOR, NULL, 0, uptr:NULL, defuintval:8, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_THREAD_POOL_SIZE, NULL, 0, uptr:NULL, defintval:4, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_OFDM_OFFSET_DIVISOR, NULL, 0, uptr:NULL, defuintval:8, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:100, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PRACH_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:150, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PUSCH_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:50, TYPE_UINT, 0} \ @@ -80,7 +80,7 @@ #define L1_REMOTE_N_PORTC_IDX 6 #define L1_LOCAL_N_PORTD_IDX 7 #define L1_REMOTE_N_PORTD_IDX 8 -#define L1_PUSCH_PROC_THREADS 9 +#define L1_THREAD_POOL_SIZE 9 #define L1_OFDM_OFFSET_DIVISOR 10 #define L1_PUCCH0_DTX_THRESHOLD 11 #define L1_PRACH_DTX_THRESHOLD 12 diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index d069bfe2f4..027be4d3cb 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -653,7 +653,7 @@ void RCconfig_NR_L1(void) { RC.gNB[j]->Mod_id = j; } - RC.gNB[j]->pusch_proc_threads = *(L1_ParamList.paramarray[j][L1_PUSCH_PROC_THREADS].uptr); + RC.gNB[j]->thread_pool_size = *(L1_ParamList.paramarray[j][L1_THREAD_POOL_SIZE].uptr); RC.gNB[j]->ofdm_offset_divisor = *(L1_ParamList.paramarray[j][L1_OFDM_OFFSET_DIVISOR].uptr); RC.gNB[j]->pucch0_thres = *(L1_ParamList.paramarray[j][L1_PUCCH0_DTX_THRESHOLD].uptr); RC.gNB[j]->prach_thres = *(L1_ParamList.paramarray[j][L1_PRACH_DTX_THRESHOLD].uptr); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf index c6a4a90a14..b90acb8e97 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf @@ -216,11 +216,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - } + thread_pool_size = 8; +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf index fd9399f89e..c3faa198dd 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf index 59e71a6225..8fa8fcf992 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf @@ -196,12 +196,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf index 3fc81c0d6c..c2e364b75e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf @@ -193,12 +193,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf index a40a93c789..51c9076fe7 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } + thread_pool_size = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf index 3860aba935..d81655e5d5 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf @@ -194,12 +194,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf index 7c527e07c8..b063989fd2 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf @@ -194,12 +194,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf index 4f8c785baa..856eed4fc2 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf @@ -209,12 +209,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf index b6b9252560..2e4dc540f3 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf @@ -242,12 +242,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf index 0817d7373e..a454af7b21 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf @@ -193,12 +193,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf index fd4c23cfdb..f536fd4d47 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf index 965408332c..375bb5f54c 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf index e36748a3a9..76bc5bf992 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf @@ -209,12 +209,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf index 7b2d369919..7ff9d0ea77 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf @@ -193,12 +193,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf index dbf4f58348..07939f4d95 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf index 6d23726a78..6b5baef5ce 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf index c3fa56f15e..50169f4bce 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf index 15aa368fdf..e217f39b94 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf @@ -193,12 +193,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf index 06ae5af066..97f20c1461 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf @@ -28,7 +28,7 @@ L1s = ( remote_n_portc = 50001; // vnf p5 port local_n_portd = 50010; // pnf p7 port remote_n_portd = 50011; // vnf p7 port - pusch_proc_threads = 8; + thread_pool_size = 8; } ); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf index 8dfcfb2b88..5aade8ab21 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf index d01b0947c0..fd4a722fc7 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf @@ -211,12 +211,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf index 2f4839fd3b..2ecd4b1426 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf @@ -210,11 +210,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - } + thread_pool_size = 8; +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf index 7f9e4d2d44..92e97217b5 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf @@ -208,11 +208,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 2; - } + thread_pool_size = 2; +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 9238ea1809..83c1bb24a9 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -35,6 +35,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; + min_rxtxtime = 6; sib1_tda = 0; pdcch_ConfigSIB1 = ( @@ -66,7 +67,7 @@ gNBs = #initialDownlinkBWP #genericParameters # this is RBstart=27,L=48 (275*(L-1))+RBstart - initialDLBWPlocationAndBandwidth = 12952; # 6366 12925 12956 28875 12952 + initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952 # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialDLBWPsubcarrierSpacing = 1; @@ -86,7 +87,7 @@ gNBs = pMax = 20; #initialUplinkBWP #genericParameters - initialULBWPlocationAndBandwidth = 12952; + initialULBWPlocationAndBandwidth = 28875; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialULBWPsubcarrierSpacing = 1; @@ -218,7 +219,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 @@ -296,5 +297,7 @@ log_config : rrc_log_verbosity ="medium"; ngap_log_level ="debug"; ngap_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index 9717462176..d052e7ad66 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -218,7 +218,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 4; + thread_pool_size = 4; prach_dtx_threshold = 120; #pucch0_dtx_threshold = 120; } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index d9b62064c1..a199e7859c 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -35,7 +35,9 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; + min_rxtxtime = 6; sib1_tda = 0; + do_SRS = 1; pdcch_ConfigSIB1 = ( { @@ -218,7 +220,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 @@ -296,5 +298,7 @@ log_config : rrc_log_verbosity ="medium"; ngap_log_level ="debug"; ngap_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf index e9577ee265..564b284f06 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf @@ -225,11 +225,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - } + thread_pool_size = 8; +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf new file mode 100644 index 0000000000..ae664dc48a --- /dev/null +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf @@ -0,0 +1,331 @@ +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + gNB_name = "gNB-OAI"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ({ + mcc = 208; + mnc = 99; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x1; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + + }); + + nr_cellid = 12345678L; + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 2; +# do_CSIRS = 1; + min_rxtxtime_pdsch = 2; + ul_prbblacklist = "79,80,81,82" + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 11; + searchSpaceZero = 10; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3300.60 MHz + 81*12*30e-3 MHz = 3329.76 + absoluteFrequencySSB = 621984; + # this is 3300.60 MHz + dl_absoluteFrequencyPointA = 620040; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 162; + #initialDownlinkBWP + #genericParameters + # this is RBstart=0,L=162 (275*(275-L+1))+(274-RBstart)) + initialDLBWPlocationAndBandwidth = 31899; + # +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 11; + initialDLBWPsearchSpaceZero = 10; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; + #initialULBWPmappingType + #0=typeA,1=typeB + initialDLBWPmappingType_0 = 0; + #this is SS=1,L=13 + initialDLBWPstartSymbolAndLength_0 = 40; + + initialDLBWPk0_1 = 0; + initialDLBWPmappingType_1 = 0; + #this is SS=1,L=5 + initialDLBWPstartSymbolAndLength_1 = 57; + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 78; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 162; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 31899; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 12; + preambleReceivedTargetPower = -104; +#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) + preambleTransMax = 6; +#powerRampingStep +# 0=dB0,1=dB2,2=dB4,3=dB6 + powerRampingStep = 1; +#ra_ReponseWindow +#1,2,4,8,10,20,40,80 + ra_ResponseWindow = 4; +#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR +#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 3; +#oneHalf (0..15) 4,8,12,16,...60,64 + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15; +#ra_ContentionResolutionTimer +#(0..7) 8,16,24,32,40,48,56,64 + ra_ContentionResolutionTimer = 7; + rsrp_ThresholdSSB = 19; +#prach-RootSequenceIndex_PR +#1 = 839, 2 = 139 + prach_RootSequenceIndex_PR = 2; + prach_RootSequenceIndex = 1; + # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex + # + msg1_SubcarrierSpacing = 1, +# restrictedSetConfig +# 0=unrestricted, 1=restricted type A, 2=restricted type B + restrictedSetConfig = 0, + + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; + initialULBWPmappingType_0 = 1 + # this is SS=2 L=13 + initialULBWPstartSymbolAndLength_0 = 41; + + initialULBWPk2_1 = 2; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=4 + initialULBWPstartSymbolAndLength_1 = 52; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; + + msg3_DeltaPreamble = 1; + p0_NominalWithGrant =-90; + +# pucch-ConfigCommon setup : +# pucchGroupHopping +# 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -70; +# ssb_PositionsInBurs_BitmapPR +# 1=short, 2=medium, 3=long + ssb_PositionsInBurst_PR = 2; + ssb_PositionsInBurst_Bitmap = 1; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 2; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 1; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 1; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 6; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "192.168.70.132"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24"; + GNB_INTERFACE_NAME_FOR_NGU = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 200; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 0; +} +); + +L1s = ( +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 4; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 120; +} +); + +RUs = ( +{ + local_rf = "yes" + nb_tx = 2 + nb_rx = 2 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 75; + sf_extension = 0; + eNB_instances = [0]; + ##beamforming 1x2 matrix: 1 layer x 2 antennas + bf_weights = [0x00007fff, 0x0000]; + #clock_src = "internal"; + sdr_addrs = "mgmt_addr=192.168.10.2,addr=192.168.10.2,clock_source=internal,time_source=internal" +} +); + +THREAD_STRUCT = ( +{ + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; +} +); + +rfsimulator : +{ + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; +}; + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + +log_config : +{ + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; +}; From ba3c2f59cdf9257f24df4964eb6d84a7c8093530 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 24 Dec 2021 18:28:19 +0000 Subject: [PATCH 046/113] Cleanup config files where thread_pool_size is equal to the default value --- ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 1 - ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf | 1 - ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf | 1 - .../GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 1 - .../CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 1 - .../GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 1 - .../CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf | 1 - 7 files changed, 7 deletions(-) diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index 4bbb5dd7d1..cfcdcd44dc 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -234,7 +234,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index 9f7ea725d5..70bcf88efe 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -239,7 +239,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf index 9f7ea725d5..70bcf88efe 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf @@ -239,7 +239,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 83c1bb24a9..4075fefcfe 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -219,7 +219,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index d052e7ad66..1c57d9523f 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -218,7 +218,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; #pucch0_dtx_threshold = 120; } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index a199e7859c..bed5d6e318 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -220,7 +220,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf index ae664dc48a..befceae695 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf @@ -248,7 +248,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 120; } From 4a17e1ec61f2331fa93b44ffb82008bb68ca380b Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 24 Dec 2021 18:43:39 +0000 Subject: [PATCH 047/113] Fix and uniformization of indentation --- .../conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf | 14 +++++++------- .../conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf | 12 ++++++------ .../conf_files/gnb.band66.tm1.106PRB.usrpn300.conf | 4 ++-- .../gnb.band78.tm1.fr1.106PRB.usrpb210.conf | 12 ++++++------ 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf index b4c663b80b..9e9f960124 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf @@ -229,13 +229,13 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 2; - prach_dtx_threshold = 120; - pucch0_dtx_threshold = 150; - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 2; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf index 725522f63a..829d73f854 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf @@ -226,12 +226,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 2; - prach_dtx_threshold = 120; - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 2; + prach_dtx_threshold = 120; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf index fdb816237d..2400136f9f 100644 --- a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf @@ -195,12 +195,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf index 98ca9a5791..249b7e4527 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 6; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 6; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( From bf0c6941788075e60fb9deaebd17ffae28e25dde Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 24 Dec 2021 18:28:19 +0000 Subject: [PATCH 048/113] Cleanup config files where thread_pool_size is equal to the default value --- ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 1 - ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf | 1 - ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf | 1 - .../GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 1 - .../CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 1 - .../GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 1 - .../CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf | 1 - 7 files changed, 7 deletions(-) diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index e6ce5624c0..f4fab7c422 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -234,7 +234,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index 481613381c..9bf8bd20cd 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -239,7 +239,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf index 481613381c..9bf8bd20cd 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf @@ -239,7 +239,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 39e4d780af..0e884d77e5 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -219,7 +219,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index 44b7a0abc7..531f8a34fc 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -218,7 +218,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; #pucch0_dtx_threshold = 120; } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index e7fb2b3a1b..e96c545a4e 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -220,7 +220,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf index ae664dc48a..befceae695 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf @@ -248,7 +248,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 120; } From 692c68e4be139c0d76f5bde2f59a9055b881ff35 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 24 Dec 2021 18:43:39 +0000 Subject: [PATCH 049/113] Fix and uniformization of indentation --- .../conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf | 14 +++++++------- .../conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf | 12 ++++++------ .../conf_files/gnb.band66.tm1.106PRB.usrpn300.conf | 4 ++-- .../gnb.band78.tm1.fr1.106PRB.usrpb210.conf | 12 ++++++------ 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf index b4c663b80b..9e9f960124 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf @@ -229,13 +229,13 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 2; - prach_dtx_threshold = 120; - pucch0_dtx_threshold = 150; - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 2; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf index 725522f63a..829d73f854 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf @@ -226,12 +226,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 2; - prach_dtx_threshold = 120; - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 2; + prach_dtx_threshold = 120; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf index fdb816237d..2400136f9f 100644 --- a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf @@ -195,12 +195,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf index 98ca9a5791..249b7e4527 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 6; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 6; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( From bd8c2013de2f2f8932f8b07f457f4bb6c6001056 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Sat, 25 Dec 2021 12:29:02 +0100 Subject: [PATCH 050/113] fix typo --- openair2/GNB_APP/L1_nr_paramdef.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/GNB_APP/L1_nr_paramdef.h b/openair2/GNB_APP/L1_nr_paramdef.h index 197b2a023b..6545408b9b 100644 --- a/openair2/GNB_APP/L1_nr_paramdef.h +++ b/openair2/GNB_APP/L1_nr_paramdef.h @@ -65,7 +65,7 @@ {CONFIG_STRING_L1_REMOTE_N_PORTC, NULL, 0, uptr:NULL, defintval:50030, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_LOCAL_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_REMOTE_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ -{CONFIG_STRING_L1_PUSCH_PROC_THREADS, NULL, 0, uptr:NULL, defintval:r43, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_PUSCH_PROC_THREADS, NULL, 0, uptr:NULL, defintval:4, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_OFDM_OFFSET_DIVISOR, NULL, 0, uptr:NULL, defuintval:8, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:100, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PRACH_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:150, TYPE_UINT, 0}, \ From 1e3bef7a09f9aa3b7110e1cdb47fe7b32f890454 Mon Sep 17 00:00:00 2001 From: Luis Pereira Date: Wed, 5 Jan 2022 09:26:59 +0000 Subject: [PATCH 051/113] Revert "Fix and uniformization of indentation" This reverts commit 692c68e4be139c0d76f5bde2f59a9055b881ff35 --- .../conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf | 14 +++++++------- .../conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf | 12 ++++++------ .../conf_files/gnb.band66.tm1.106PRB.usrpn300.conf | 4 ++-- .../gnb.band78.tm1.fr1.106PRB.usrpb210.conf | 12 ++++++------ 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf index 9e9f960124..b4c663b80b 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf @@ -229,13 +229,13 @@ MACRLCs = ( ); L1s = ( -{ - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 2; - prach_dtx_threshold = 120; - pucch0_dtx_threshold = 150; -} + { + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 2; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; + } ); RUs = ( diff --git a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf index 829d73f854..725522f63a 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf @@ -226,12 +226,12 @@ MACRLCs = ( ); L1s = ( -{ - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 2; - prach_dtx_threshold = 120; -} + { + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 2; + prach_dtx_threshold = 120; + } ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf index 2400136f9f..fdb816237d 100644 --- a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf @@ -195,12 +195,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf index 249b7e4527..98ca9a5791 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( -{ - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 6; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + { + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 6; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 + } ); RUs = ( From 602ecd1c3e8216804840fad2f729824e6989a847 Mon Sep 17 00:00:00 2001 From: Luis Pereira Date: Wed, 5 Jan 2022 09:27:20 +0000 Subject: [PATCH 052/113] Revert "Cleanup config files where thread_pool_size is equal to the default value" This reverts commit bf0c6941788075e60fb9deaebd17ffae28e25dde --- ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 1 + ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf | 1 + ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf | 1 + .../GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 1 + .../CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 1 + .../GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 1 + .../CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf | 1 + 7 files changed, 7 insertions(+) diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index f4fab7c422..e6ce5624c0 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -234,6 +234,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; + thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index 9bf8bd20cd..481613381c 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -239,6 +239,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; + thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf index 9bf8bd20cd..481613381c 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf @@ -239,6 +239,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; + thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 0e884d77e5..39e4d780af 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -219,6 +219,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; + thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index 531f8a34fc..44b7a0abc7 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -218,6 +218,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; + thread_pool_size = 4; prach_dtx_threshold = 120; #pucch0_dtx_threshold = 120; } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index e96c545a4e..e7fb2b3a1b 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -220,6 +220,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; + thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf index befceae695..ae664dc48a 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf @@ -248,6 +248,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; + thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 120; } From 345c9e38e4b94b2e6aae83bc97ca522e95fa2109 Mon Sep 17 00:00:00 2001 From: Luis Pereira Date: Wed, 5 Jan 2022 09:27:43 +0000 Subject: [PATCH 053/113] Revert "Rename pusch_proc_threads to thread_pool_size" This reverts commit daf8b950e143948bb7c50ffdc6039a8edf7a2e25 --- ci-scripts/conf_files/benetel-5g.conf | 6 +++--- .../conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf | 2 +- .../conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf | 4 ++-- .../conf_files/gnb.band261.tm1.32PRB.usrpn300.conf | 6 +++--- .../conf_files/gnb.band66.tm1.106PRB.usrpn300.conf | 2 +- .../gnb.band78.nsa_2x2.106PRB.usrpn310.conf | 8 ++++---- .../gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 2 +- .../gnb.band78.sa.fr1.106PRB.usrpn310.conf | 2 +- .../gnb.band78.sa.fr1.162PRB.usrpn310.conf | 2 +- .../conf_files/gnb.band78.tm1.106PRB.usrpn300.conf | 6 +++--- .../gnb.band78.tm1.fr1.106PRB.usrpb210.conf | 2 +- .../gnb.band78.tm1.fr1.106PRB.usrpn310.conf | 6 +++--- executables/nr-gnb.c | 4 ++-- openair1/PHY/defs_gNB.h | 2 +- openair2/GNB_APP/L1_nr_paramdef.h | 8 ++++---- openair2/GNB_APP/gnb_config.c | 2 +- .../PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf | 6 +++--- .../CONF/gnb.band257.tm1.32PRB.usrpn300.conf | 6 +++--- .../CONF/gnb.band257.tm1.32PRB.usrpx300.conf | 6 +++--- .../CONF/gnb.band257.tm1.66PRB.usrpn300.conf | 6 +++--- .../CONF/gnb.band261.tm1.32PRB.usrpn300.conf | 8 ++++---- .../CONF/gnb.band66.tm1.106PRB.usrpn300.conf | 6 +++--- .../CONF/gnb.band66.tm1.106PRB.usrpx300.conf | 6 +++--- .../CONF/gnb.band78.106PRB.slave.conf | 6 +++--- .../CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf | 10 +++++----- .../CONF/gnb.band78.tm1.106PRB.usrpb210.conf | 6 +++--- .../CONF/gnb.band78.tm1.106PRB.usrpn300.conf | 6 +++--- .../CONF/gnb.band78.tm1.106PRB.usrpx300.conf | 6 +++--- .../CONF/gnb.band78.tm1.217PRB.usrpn300.conf | 12 ++++++------ .../CONF/gnb.band78.tm1.217PRB.usrpx300.conf | 12 ++++++------ .../CONF/gnb.band78.tm1.24PRB.usrpb210.conf | 6 +++--- .../CONF/gnb.band78.tm1.24PRB.usrpn300.conf | 6 +++--- .../CONF/gnb.band78.tm1.24PRB.usrpx300.conf | 12 ++++++------ .../CONF/gnb.band78.tm1.273PRB.usrpn300.conf | 12 ++++++------ .../GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf | 2 +- .../PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf | 6 +++--- .../GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf | 6 +++--- .../GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf | 6 +++--- targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf | 6 +++--- .../CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 2 +- .../CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 2 +- .../CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 2 +- .../gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf | 6 +++--- .../CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf | 2 +- 44 files changed, 121 insertions(+), 121 deletions(-) diff --git a/ci-scripts/conf_files/benetel-5g.conf b/ci-scripts/conf_files/benetel-5g.conf index 73b1da8c50..79b2f7f877 100644 --- a/ci-scripts/conf_files/benetel-5g.conf +++ b/ci-scripts/conf_files/benetel-5g.conf @@ -215,11 +215,11 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; -} + pusch_proc_threads = 8; + } ); RUs = ( diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf index b4c663b80b..77693d5f72 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf @@ -232,7 +232,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 2; + pusch_proc_threads = 2; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf index 725522f63a..c9b369eaff 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf @@ -229,9 +229,9 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 2; + pusch_proc_threads = 2; prach_dtx_threshold = 120; - } + } ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf index dd9c210c0d..4338c00b36 100644 --- a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf @@ -211,12 +211,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf index fdb816237d..1c2133bebe 100644 --- a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf @@ -198,7 +198,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } ); diff --git a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf index b891af747a..b0a757c9d0 100644 --- a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; - prach_dtx_threshold = 120; -} + pusch_proc_threads = 8; + prach_dtx_threshold = 120; + } ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index e6ce5624c0..093e82d4e6 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -234,7 +234,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; + pusch_proc_threads = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index 481613381c..a2b4d86dfc 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -239,7 +239,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; + pusch_proc_threads = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf index 481613381c..a2b4d86dfc 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf @@ -239,7 +239,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; + pusch_proc_threads = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf index 7efdf159eb..6ade355053 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf @@ -194,11 +194,11 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; -} + pusch_proc_threads = 8; + } ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf index 98ca9a5791..b7a04b1f36 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf @@ -213,7 +213,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 6; + pusch_proc_threads = 6; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } ); diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf index 5a5f0e9aa6..299a19cc4e 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf @@ -210,11 +210,11 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 6; -} + pusch_proc_threads = 6; + } ); RUs = ( diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 92a4f9dcd6..a78750fefa 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -400,8 +400,8 @@ void init_gNB_Tpool(int inst) { // ULSCH decoding threadpool gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t)); int numCPU = sysconf(_SC_NPROCESSORS_ONLN); - LOG_I(PHY,"Number of threads requested in config file: %d, Number of threads available on this machine: %d\n",gNB->thread_pool_size,numCPU); - int threadCnt = min(numCPU, gNB->thread_pool_size); + LOG_I(PHY,"Number of threads requested in config file: %d, Number of threads available on this machine: %d\n",gNB->pusch_proc_threads,numCPU); + int threadCnt = min(numCPU, gNB->pusch_proc_threads); if (threadCnt < 2) LOG_E(PHY,"Number of threads for gNB should be more than 1. Allocated only %d\n",threadCnt); char pool[80]; sprintf(pool,"-1"); diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 7372ea6a9c..1db4f6328a 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -891,7 +891,7 @@ typedef struct PHY_VARS_gNB_s { notifiedFIFO_t *resp_RU_tx; tpool_t *threadPool; int nbDecode; - uint8_t thread_pool_size; + uint8_t pusch_proc_threads; int number_of_nr_dlsch_max; int number_of_nr_ulsch_max; void * scopeData; diff --git a/openair2/GNB_APP/L1_nr_paramdef.h b/openair2/GNB_APP/L1_nr_paramdef.h index ccff1ca995..0306713845 100644 --- a/openair2/GNB_APP/L1_nr_paramdef.h +++ b/openair2/GNB_APP/L1_nr_paramdef.h @@ -46,7 +46,7 @@ #define CONFIG_STRING_L1_LOCAL_N_PORTD "local_n_portd" #define CONFIG_STRING_L1_REMOTE_N_PORTD "remote_n_portd" #define CONFIG_STRING_L1_TRANSPORT_N_PREFERENCE "tr_n_preference" -#define CONFIG_STRING_L1_THREAD_POOL_SIZE "thread_pool_size" +#define CONFIG_STRING_L1_PUSCH_PROC_THREADS "pusch_proc_threads" #define CONFIG_STRING_L1_OFDM_OFFSET_DIVISOR "ofdm_offset_divisor" #define CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD "pucch0_dtx_threshold" #define CONFIG_STRING_L1_PRACH_DTX_THRESHOLD "prach_dtx_threshold" @@ -65,8 +65,8 @@ {CONFIG_STRING_L1_REMOTE_N_PORTC, NULL, 0, uptr:NULL, defintval:50030, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_LOCAL_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_REMOTE_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ -{CONFIG_STRING_L1_THREAD_POOL_SIZE, NULL, 0, uptr:NULL, defintval:4, TYPE_UINT, 0}, \ -{CONFIG_STRING_L1_OFDM_OFFSET_DIVISOR, NULL, 0, uptr:NULL, defuintval:8, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_PUSCH_PROC_THREADS, NULL, 0, uptr:NULL, defintval:3, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_OFDM_OFFSET_DIVISOR, NULL, 0, uptr:NULL, defuintval:8, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:100, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PRACH_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:150, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PUSCH_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:50, TYPE_UINT, 0} \ @@ -80,7 +80,7 @@ #define L1_REMOTE_N_PORTC_IDX 6 #define L1_LOCAL_N_PORTD_IDX 7 #define L1_REMOTE_N_PORTD_IDX 8 -#define L1_THREAD_POOL_SIZE 9 +#define L1_PUSCH_PROC_THREADS 9 #define L1_OFDM_OFFSET_DIVISOR 10 #define L1_PUCCH0_DTX_THRESHOLD 11 #define L1_PRACH_DTX_THRESHOLD 12 diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 027be4d3cb..d069bfe2f4 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -653,7 +653,7 @@ void RCconfig_NR_L1(void) { RC.gNB[j]->Mod_id = j; } - RC.gNB[j]->thread_pool_size = *(L1_ParamList.paramarray[j][L1_THREAD_POOL_SIZE].uptr); + RC.gNB[j]->pusch_proc_threads = *(L1_ParamList.paramarray[j][L1_PUSCH_PROC_THREADS].uptr); RC.gNB[j]->ofdm_offset_divisor = *(L1_ParamList.paramarray[j][L1_OFDM_OFFSET_DIVISOR].uptr); RC.gNB[j]->pucch0_thres = *(L1_ParamList.paramarray[j][L1_PUCCH0_DTX_THRESHOLD].uptr); RC.gNB[j]->prach_thres = *(L1_ParamList.paramarray[j][L1_PRACH_DTX_THRESHOLD].uptr); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf index b90acb8e97..c6a4a90a14 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf @@ -216,11 +216,11 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; -} + pusch_proc_threads = 8; + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf index c3faa198dd..fd9399f89e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf index 8fa8fcf992..59e71a6225 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf @@ -196,12 +196,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf index c2e364b75e..3fc81c0d6c 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf @@ -193,12 +193,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf index 51c9076fe7..a40a93c789 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + pusch_proc_threads = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf index d81655e5d5..3860aba935 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf @@ -194,12 +194,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf index b063989fd2..7c527e07c8 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf @@ -194,12 +194,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf index 856eed4fc2..4f8c785baa 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf @@ -209,12 +209,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf index 2e4dc540f3..b6b9252560 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf @@ -242,12 +242,12 @@ MACRLCs = ( ); L1s = ( -{ - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 8; + { + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf index a454af7b21..0817d7373e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf @@ -193,12 +193,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf index f536fd4d47..fd4c23cfdb 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf index 375bb5f54c..965408332c 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf index 76bc5bf992..e36748a3a9 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf @@ -209,12 +209,12 @@ MACRLCs = ( ); L1s = ( -{ - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + { + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf index 7ff9d0ea77..7b2d369919 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf @@ -193,12 +193,12 @@ MACRLCs = ( ); L1s = ( -{ - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + { + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf index 07939f4d95..dbf4f58348 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf index 6b5baef5ce..6d23726a78 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf index 50169f4bce..c3fa56f15e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( -{ - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + { + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf index e217f39b94..15aa368fdf 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf @@ -193,12 +193,12 @@ MACRLCs = ( ); L1s = ( -{ - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + { + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf index 97f20c1461..06ae5af066 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf @@ -28,7 +28,7 @@ L1s = ( remote_n_portc = 50001; // vnf p5 port local_n_portd = 50010; // pnf p7 port remote_n_portd = 50011; // vnf p7 port - thread_pool_size = 8; + pusch_proc_threads = 8; } ); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf index 5aade8ab21..8dfcfb2b88 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf index fd4a722fc7..d01b0947c0 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf @@ -211,12 +211,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf index 2ecd4b1426..2f4839fd3b 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf @@ -210,11 +210,11 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; -} + pusch_proc_threads = 8; + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf index 92e97217b5..7f9e4d2d44 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf @@ -208,11 +208,11 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 2; -} + pusch_proc_threads = 2; + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 39e4d780af..357e4b6acd 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -219,7 +219,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; + pusch_proc_threads = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index 44b7a0abc7..a423ee0dd1 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -218,7 +218,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; + pusch_proc_threads = 4; prach_dtx_threshold = 120; #pucch0_dtx_threshold = 120; } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index e7fb2b3a1b..c031651ed2 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -220,7 +220,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; + pusch_proc_threads = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf index 564b284f06..e9577ee265 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf @@ -225,11 +225,11 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; -} + pusch_proc_threads = 8; + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf index ae664dc48a..83fd3e0886 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf @@ -248,7 +248,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; + pusch_proc_threads = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 120; } From 370af7bc1054404c459651fb05d1ca6a602280bf Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Thu, 6 Jan 2022 16:20:16 +0100 Subject: [PATCH 054/113] remove L1_tx_free queue pair of threads for a single one --- doc/SW-archi-graph.md | 6 +++--- executables/nr-gnb.c | 7 +++---- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 3 +++ openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 1 + 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/doc/SW-archi-graph.md b/doc/SW-archi-graph.md index e8b0cdc0d7..8f8a6f6e5c 100644 --- a/doc/SW-archi-graph.md +++ b/doc/SW-archi-graph.md @@ -37,10 +37,10 @@ rx_func_implem[rx_func] handle_nr_ulsch --> gNB_dlsch_ulsch_scheduler subgraph NR_Schedule_response L1_tx_free3>L1_tx_free] - --> handle_dl_fapi + --> handle_nr_nfapi_xxx_pdu --> sendTxFilled((L1_tx_filled)) - --> handle_ul_nfapi - + --> nr_fill_ul_xxx + --> nr_fill_prach end gNB_dlsch_ulsch_scheduler --> NR_Schedule_response end diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index c630771599..0319f7f7a3 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -123,7 +123,6 @@ void tx_func(void *param) { } void rx_func(void *param) { - processingData_L1_t *info = (processingData_L1_t *) param; PHY_VARS_gNB *gNB = info->gNB; int frame_rx = info->frame_rx; @@ -303,7 +302,7 @@ void rx_func(void *param) { static void dump_L1_meas_stats(PHY_VARS_gNB *gNB, RU_t *ru, char *output) { int stroff = 0; stroff += print_meas_log(gNB->phy_proc_tx[0], "L1 Tx processing thread 0", NULL, NULL, output); - stroff += print_meas_log(gNB->phy_proc_tx[1], "L1 Tx processing thread 1", NULL, NULL, output+stroff); + //stroff += print_meas_log(gNB->phy_proc_tx[1], "L1 Tx processing thread 1", NULL, NULL, output+stroff); stroff += print_meas_log(&gNB->dlsch_encoding_stats, "DLSCH encoding", NULL, NULL, output+stroff); stroff += print_meas_log(&gNB->phy_proc_rx, "L1 Rx processing", NULL, NULL, output+stroff); stroff += print_meas_log(&gNB->ul_indication_stats, "UL Indication", NULL, NULL, output+stroff); @@ -339,7 +338,7 @@ void *nrL1_stats_thread(void *param) { AssertFatal(fd!=NULL,"Cannot open nrL1_stats.log\n"); reset_meas(gNB->phy_proc_tx[0]); - reset_meas(gNB->phy_proc_tx[1]); + //reset_meas(gNB->phy_proc_tx[1]); reset_meas(&gNB->dlsch_encoding_stats); reset_meas(&gNB->phy_proc_rx); reset_meas(&gNB->ul_indication_stats); @@ -445,7 +444,7 @@ void init_gNB_Tpool(int inst) { initNotifiedFIFO(gNB->L1_tx_out); // we create 2 threads for L1 tx processing - for (int i=0; i < 2; i++) { + for (int i=0; i < 1; i++) { notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->L1_tx_out,tx_func); processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx); init_DLSCH_struct(gNB, msgDataTx); diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 792667d510..3154233243 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -128,6 +128,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, int frame, int slot, int do_meas) { + int aa; PHY_VARS_gNB *gNB = msgTx->gNB; NR_DL_FRAME_PARMS *fp=&gNB->frame_parms; @@ -204,6 +205,8 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_TX+offset,0); + //pthread_mutex_unlock(&mutextest); + } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index ae52f8cc60..87c1dee1e5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -272,6 +272,7 @@ bool is_xlsch_in_slot(uint64_t bitmap, sub_frame_t slot) { void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frame, sub_frame_t slot){ + //pthread_mutex_lock(&mutextest); protocol_ctxt_t ctxt={0}; PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, NOT_A_RNTI, frame, slot,module_idP); From fb7795a0f427bd256883b89dee66b9963bc5354b Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 10 Jan 2022 14:20:41 +0000 Subject: [PATCH 055/113] Fix build warning after merge with develop --- openair2/RRC/LTE/MESSAGES/asn1_msg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c index b1f2e6d9b3..b069591316 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c @@ -4293,7 +4293,7 @@ ssize_t do_nrMeasurementReport(uint8_t *buffer, LTE_MeasResultListEUTRA_t *measResultListEUTRA2=&measResultNeighCells->choice.measResultListEUTRA; asn1cSequenceAdd(measResultListEUTRA2->list, struct LTE_MeasResultEUTRA, measresulteutra_list); measresulteutra_list->physCellId = phy_id; - asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2); + //asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2); //measresult_cgi2->cellGlobalId= {0}; //measresult_cgi2->trackingAreaCode= {0}; struct LTE_MeasResultEUTRA__measResult* measResult= &measresulteutra_list->measResult; From 23b3a18fe8c9db7c2c3a767d3fa270d7d7e09bfa Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Tue, 11 Jan 2022 14:14:44 +0530 Subject: [PATCH 056/113] Removed conflict header and fixed dlsim --- openair1/SIMULATION/NR_PHY/dlsim.c | 31 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 9c0772bf48..6dc8dcfa4a 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -982,17 +982,21 @@ int main(int argc, char **argv) gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t)); initTpool(gNBthreads, gNB->threadPool, true); - gNB->resp_L1_tx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); - initNotifiedFIFO(gNB->resp_L1_tx); - // we create 2 threads for L1 tx processing - notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->resp_L1_tx,processSlotTX); - processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx); + gNB->L1_tx_free = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); + gNB->L1_tx_filled = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); + gNB->L1_tx_out = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); + initNotifiedFIFO(gNB->L1_tx_free); + initNotifiedFIFO(gNB->L1_tx_filled); + initNotifiedFIFO(gNB->L1_tx_out); + // we create 1 threads for L1 tx processing + processingData_L1tx_t *msgDataTx; + notifiedFIFO_elt_t *msgL1Tx; + msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->L1_tx_out,NULL); + msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx); init_DLSCH_struct(gNB, msgDataTx); - msgDataTx->slot = slot; - msgDataTx->frame = frame; memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t)); reset_meas(&msgDataTx->phy_proc_tx); - gNB->phy_proc_tx[0] = &msgDataTx->phy_proc_tx; + gNB->phy_proc_tx[i] = &msgDataTx->phy_proc_tx; for (SNR = snr0; SNR < snr1; SNR += .2) { @@ -1071,7 +1075,7 @@ int main(int argc, char **argv) Sched_INFO.UL_tti_req = gNB_mac->UL_tti_req_ahead[slot]; Sched_INFO.UL_dci_req = NULL; Sched_INFO.TX_req = &gNB_mac->TX_req[0]; - pushNotifiedFIFO(gNB->L1_tx_free,msgL1Tx); + pushNotifiedFIFO(gNB->L1_tx_free,msgL1Tx); nr_schedule_response(&Sched_INFO); /* PTRS values for DLSIM calculations */ @@ -1307,15 +1311,8 @@ int main(int argc, char **argv) if (print_perf==1) { printf("\ngNB TX function statistics (per %d us slot, NPRB %d, mcs %d, TBS %d)\n", 1000>>*scc->ssbSubcarrierSpacing, g_rbSize, g_mcsIndex, -<<<<<<< HEAD - msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3, - msgDataTx->dlsch[0][0]->harq_process.K, - msgDataTx->dlsch[0][0]->harq_process.K/((msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3)>3824?22:10)); - printDistribution(gNB->phy_proc_tx[0],table_tx,"PHY proc tx"); -======= msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3); - printDistribution(gNB->phy_proc_tx_0,table_tx,"PHY proc tx"); ->>>>>>> 264e829922fc68e4caa3611b70d921c131e7ca68 + printDistribution(gNB->phy_proc_tx[0],table_tx,"PHY proc tx"); printStatIndent2(&gNB->dlsch_encoding_stats,"DLSCH encoding time"); printStatIndent3(&gNB->dlsch_segmentation_stats,"DLSCH segmentation time"); printStatIndent3(&gNB->tinput,"DLSCH LDPC input processing time"); From 6c7b71bbd4474ce35a875cf4484bee5e81ff982b Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Sat, 8 Jan 2022 20:39:14 +0530 Subject: [PATCH 057/113] Removed global variables --- openair1/PHY/NR_TRANSPORT/nr_dci.c | 39 +++++++++---------- openair1/PHY/NR_TRANSPORT/nr_dci.h | 4 +- openair1/PHY/NR_TRANSPORT/nr_dci_tools.c | 4 +- openair1/PHY/NR_TRANSPORT/nr_pbch.c | 5 ++- openair1/PHY/NR_TRANSPORT/nr_pss.c | 4 +- openair1/PHY/NR_TRANSPORT/nr_sss.c | 4 +- .../PHY/NR_TRANSPORT/nr_transport_proto.h | 9 ++--- openair1/PHY/defs_gNB.h | 4 -- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 9 ++--- 9 files changed, 37 insertions(+), 45 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.c b/openair1/PHY/NR_TRANSPORT/nr_dci.c index f26464fd70..523a86b99d 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.c @@ -66,12 +66,11 @@ void nr_pdcch_scrambling(uint32_t *in, } } -void nr_generate_dci(PHY_VARS_gNB *gNB, - nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15, - uint32_t **gold_pdcch_dmrs, - int32_t *txdataF, - int16_t amp, - NR_DL_FRAME_PARMS *frame_parms) { +void nr_generate_dci(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15, + uint32_t **gold_pdcch_dmrs, + int32_t *txdataF, + int16_t amp, + NR_DL_FRAME_PARMS *frame_parms) { int16_t mod_dmrs[NR_MAX_CSET_DURATION][NR_MAX_PDCCH_DMRS_LENGTH>>1] __attribute__((aligned(16))); // 3 for the max coreset duration uint16_t cset_start_sc; @@ -84,7 +83,8 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, int n_rb; // compute rb_offset and n_prb based on frequency allocation - nr_fill_cce_list(gNB,0,pdcch_pdu_rel15); + nr_cce_t cce_list[MAX_DCI_CORESET][NR_MAX_PDCCH_AGG_LEVEL]; + nr_fill_cce_list(cce_list,0,pdcch_pdu_rel15); get_coreset_rballoc(pdcch_pdu_rel15->FreqDomainResource,&n_rb,&rb_offset); cset_start_sc = frame_parms->first_carrier_offset + (pdcch_pdu_rel15->BWPStart + rb_offset) * NR_NB_SC_PER_RB; @@ -175,7 +175,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, int reg_list_order[NR_MAX_PDCCH_AGG_LEVEL] = {}; for (int p = 0; p < NR_MAX_PDCCH_AGG_LEVEL; p++) { for(int p2 = 0; p2 < dci_pdu->AggregationLevel; p2++) { - if(gNB->cce_list[d][p2].reg_list[0].reg_idx == p * NR_NB_REG_PER_CCE) { + if(cce_list[d][p2].reg_list[0].reg_idx == p * NR_NB_REG_PER_CCE) { reg_list_order[reg_list_index] = p2; reg_list_index++; break; @@ -191,7 +191,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, for (int reg_in_cce_idx = 0; reg_in_cce_idx < NR_NB_REG_PER_CCE; reg_in_cce_idx++) { - k = cset_start_sc + gNB->cce_list[d][cce_idx].reg_list[reg_in_cce_idx].start_sc_idx; + k = cset_start_sc + cce_list[d][cce_idx].reg_list[reg_in_cce_idx].start_sc_idx; if (k >= frame_parms->ofdm_symbol_size) k -= frame_parms->ofdm_symbol_size; @@ -200,9 +200,9 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, // dmrs index depends on reference point for k according to 38.211 7.4.1.3.2 if (pdcch_pdu_rel15->CoreSetType == NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG) - dmrs_idx = (gNB->cce_list[d][cce_idx].reg_list[reg_in_cce_idx].reg_idx) * 3; + dmrs_idx = (cce_list[d][cce_idx].reg_list[reg_in_cce_idx].reg_idx) * 3; else - dmrs_idx = (gNB->cce_list[d][cce_idx].reg_list[reg_in_cce_idx].reg_idx + rb_offset) * 3; + dmrs_idx = (cce_list[d][cce_idx].reg_list[reg_in_cce_idx].reg_idx + rb_offset) * 3; k_prime = 0; @@ -250,21 +250,20 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, } // for (int d=0;dnumDlDci;d++) } -void nr_generate_dci_top(PHY_VARS_gNB *gNB, - nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu, - nfapi_nr_dl_tti_pdcch_pdu *ul_dci_pdu, - uint32_t **gold_pdcch_dmrs, - int32_t *txdataF, - int16_t amp, - NR_DL_FRAME_PARMS *frame_parms) { +void nr_generate_dci_top(nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu, + nfapi_nr_dl_tti_pdcch_pdu *ul_dci_pdu, + uint32_t **gold_pdcch_dmrs, + int32_t *txdataF, + int16_t amp, + NR_DL_FRAME_PARMS *frame_parms) { AssertFatal(pdcch_pdu!=NULL || ul_dci_pdu!=NULL,"At least one pointer has to be !NULL\n"); if (pdcch_pdu) { - nr_generate_dci(gNB,&pdcch_pdu->pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms); + nr_generate_dci(&pdcch_pdu->pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms); } if (ul_dci_pdu) { - nr_generate_dci(gNB,&ul_dci_pdu->pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms); + nr_generate_dci(&ul_dci_pdu->pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms); } } diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.h b/openair1/PHY/NR_TRANSPORT/nr_dci.h index 07baaf2728..d763891f28 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.h +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.h @@ -29,7 +29,7 @@ uint16_t nr_get_dci_size(nfapi_nr_dci_format_e format, nfapi_nr_rnti_type_e rnti_type, uint16_t N_RB); -void nr_generate_dci_top(PHY_VARS_gNB *gNB, +void nr_generate_dci_top( nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu, nfapi_nr_dl_tti_pdcch_pdu *ul_pdcch_pdu, uint32_t **gold_pdcch_dmrs, @@ -57,6 +57,6 @@ void nr_fill_ul_dci(PHY_VARS_gNB *gNB, int slot, nfapi_nr_ul_dci_request_pdus_t *pdcch_pdu); -void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint8_t m,nfapi_nr_dl_tti_pdcch_pdu_rel15_t *); +void nr_fill_cce_list(nr_cce_t cce_list[MAX_DCI_CORESET][NR_MAX_PDCCH_AGG_LEVEL], uint8_t m,nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15); #endif //__PHY_NR_TRANSPORT_DCI__H diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c b/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c index 1675045443..8d5eb4a660 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c @@ -119,7 +119,7 @@ void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint16_t n_shift, uint8_t m) { */ -void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint8_t m, nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15) { +void nr_fill_cce_list(nr_cce_t cce_list[MAX_DCI_CORESET][NR_MAX_PDCCH_AGG_LEVEL], uint8_t m, nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15) { nr_cce_t* cce; nr_reg_t* reg; @@ -156,7 +156,7 @@ void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint8_t m, nfapi_nr_dl_tti_pdcch_pdu_r if (pdcch_pdu_rel15->dci_pdu[d].RNTI != 0xFFFF) LOG_D(PHY, "CCE list generation for candidate %d: bundle size %d ilv size %d CceIndex %d\n", m, bsize, R, pdcch_pdu_rel15->dci_pdu[d].CceIndex); for (uint8_t cce_idx=0; cce_idxcce_list[d][cce_idx]; + cce = &cce_list[d][cce_idx]; cce->cce_idx = pdcch_pdu_rel15->dci_pdu[d].CceIndex + cce_idx; LOG_D(PHY, "cce_idx %d\n", cce->cce_idx); diff --git a/openair1/PHY/NR_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_TRANSPORT/nr_pbch.c index a4cec432de..bf5edccb1b 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_pbch.c @@ -219,8 +219,7 @@ void nr_init_pbch_interleaver(uint8_t *interleaver) { *(interleaver+i) = *(nr_pbch_payload_interleaving_pattern+j_ssb++); } -int nr_generate_pbch(NR_gNB_PBCH *pbch, - nfapi_nr_dl_tti_ssb_pdu *ssb_pdu, +int nr_generate_pbch(nfapi_nr_dl_tti_ssb_pdu *ssb_pdu, uint8_t *interleaver, int32_t *txdataF, int16_t amp, @@ -239,6 +238,8 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch, uint64_t a_reversed=0; LOG_D(PHY, "PBCH generation started\n"); ///Payload generation + NR_gNB_PBCH m_pbch; + NR_gNB_PBCH *pbch = &m_pbch; memset((void *)pbch, 0, sizeof(NR_gNB_PBCH)); pbch->pbch_a=0; uint8_t ssb_index = ssb_pdu->ssb_pdu_rel15.SsbBlockIndex; diff --git a/openair1/PHY/NR_TRANSPORT/nr_pss.c b/openair1/PHY/NR_TRANSPORT/nr_pss.c index 535ce99143..44f74f1230 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_pss.c +++ b/openair1/PHY/NR_TRANSPORT/nr_pss.c @@ -24,8 +24,7 @@ //#define NR_PSS_DEBUG -int nr_generate_pss( int16_t *d_pss, - int32_t *txdataF, +int nr_generate_pss( int32_t *txdataF, int16_t amp, uint8_t ssb_start_symbol, nfapi_nr_config_request_scf_t* config, @@ -33,6 +32,7 @@ int nr_generate_pss( int16_t *d_pss, { int i,k,l,m; int16_t a; + int16_t d_pss[NR_PSS_LENGTH]; int16_t x[NR_PSS_LENGTH]; const int x_initial[7] = {0, 1, 1 , 0, 1, 1, 1}; diff --git a/openair1/PHY/NR_TRANSPORT/nr_sss.c b/openair1/PHY/NR_TRANSPORT/nr_sss.c index de92237f6c..12f89ba36f 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_sss.c +++ b/openair1/PHY/NR_TRANSPORT/nr_sss.c @@ -23,8 +23,7 @@ //#define NR_SSS_DEBUG -int nr_generate_sss( int16_t *d_sss, - int32_t *txdataF, +int nr_generate_sss( int32_t *txdataF, int16_t amp, uint8_t ssb_start_symbol, nfapi_nr_config_request_scf_t* config, @@ -34,6 +33,7 @@ int nr_generate_sss( int16_t *d_sss, int m0, m1; int Nid, Nid1, Nid2; //int16_t a; + int16_t d_sss[NR_SSS_LENGTH]; int16_t x0[NR_SSS_LENGTH], x1[NR_SSS_LENGTH]; const int x0_initial[7] = { 1, 0, 0, 0, 0, 0, 0 }; const int x1_initial[7] = { 1, 0, 0, 0, 0, 0, 0 }; diff --git a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h index 4fed3a468f..5cc246fd29 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h +++ b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h @@ -44,8 +44,7 @@ @param @returns 0 on success */ -int nr_generate_pss(int16_t *d_pss, - int32_t *txdataF, +int nr_generate_pss(int32_t *txdataF, int16_t amp, uint8_t ssb_start_symbol, nfapi_nr_config_request_scf_t *config, @@ -57,8 +56,7 @@ int nr_generate_pss(int16_t *d_pss, @param @returns 0 on success */ -int nr_generate_sss(int16_t *d_sss, - int32_t *txdataF, +int nr_generate_sss(int32_t *txdataF, int16_t amp, uint8_t ssb_start_symbol, nfapi_nr_config_request_scf_t *config, @@ -83,8 +81,7 @@ int nr_generate_pbch_dmrs(uint32_t *gold_pbch_dmrs, @param @returns 0 on success */ -int nr_generate_pbch(NR_gNB_PBCH *pbch, - nfapi_nr_dl_tti_ssb_pdu *ssb_pdu, +int nr_generate_pbch(nfapi_nr_dl_tti_ssb_pdu *ssb_pdu, uint8_t *interleaver, int32_t *txdataF, int16_t amp, diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index edcac7a91d..e0a67f29e7 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -753,7 +753,6 @@ typedef struct PHY_VARS_gNB_s { // nfapi_nr_ul_dci_request_pdus_t *ul_dci_pdu; uint16_t num_pdsch_rnti[80]; NR_gNB_PBCH pbch; - nr_cce_t cce_list[MAX_DCI_CORESET][NR_MAX_PDCCH_AGG_LEVEL]; NR_gNB_COMMON common_vars; NR_gNB_PRACH prach_vars; NR_gNB_PUSCH *pusch_vars[NUMBER_OF_NR_ULSCH_MAX]; @@ -776,9 +775,6 @@ typedef struct PHY_VARS_gNB_s { // PUCCH0 Look-up table for cyclic-shifts NR_gNB_PUCCH0_LUT_t pucch0_lut; - /// NR synchronization sequences - int16_t d_pss[NR_PSS_LENGTH]; - int16_t d_sss[NR_SSS_LENGTH]; /// PBCH DMRS sequence uint32_t nr_gold_pbch_dmrs[2][64][NR_PBCH_DMRS_LENGTH_DWORD]; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index c86f5bd682..4086a3227c 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -91,8 +91,8 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_ nr_set_ssb_first_subcarrier(cfg, fp); // setting the first subcarrier LOG_D(PHY,"SS TX: frame %d, slot %d, start_symbol %d\n",frame,slot, ssb_start_symbol); - nr_generate_pss(gNB->d_pss, &txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); - nr_generate_sss(gNB->d_sss, &txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); + nr_generate_pss(&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); + nr_generate_sss(&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); if (cfg->carrier_config.num_tx_ant.value <= 4) nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[n_hf][ssb_index&7],&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); @@ -114,8 +114,7 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_ gNB->common_vars.beam_id[0][slot*fp->symbols_per_slot+j] = cfg->ssb_table.ssb_beam_id_list[ssb_index].beam_id.value; } - nr_generate_pbch(&gNB->pbch, - &ssb_pdu, + nr_generate_pbch(&ssb_pdu, gNB->nr_pbch_interleaver, &txdataF[0][txdataF_offset], AMP, @@ -168,7 +167,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_PDCCH_TX,1); - nr_generate_dci_top(gNB, + nr_generate_dci_top( num_dl_dci > 0 ? &msgTx->pdcch_pdu : NULL, num_ul_dci > 0 ? &msgTx->ul_pdcch_pdu.pdcch_pdu : NULL, gNB->nr_gold_pdcch_dmrs[slot], From 391a5eee71c12d4604e30634c60105ee9906bfa6 Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Wed, 12 Jan 2022 14:50:33 +0530 Subject: [PATCH 058/113] Removed reuse of txdataF buffer on 2 slot basis --- openair1/PHY/NR_TRANSPORT/nr_csi_rs.c | 2 +- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 54 +++++++++++------------ openair1/SCHED_NR/nr_ru_procedures.c | 6 +-- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 4 +- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_csi_rs.c b/openair1/PHY/NR_TRANSPORT/nr_csi_rs.c index ac0eac8a79..4f5baacc34 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_csi_rs.c +++ b/openair1/PHY/NR_TRANSPORT/nr_csi_rs.c @@ -35,7 +35,7 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB, NR_DL_FRAME_PARMS frame_parms=gNB->frame_parms; int32_t **txdataF = gNB->common_vars.txdataF; - int txdataF_offset = (slot%2)*frame_parms.samples_per_slot_wCP; + int txdataF_offset = slot*frame_parms.samples_per_slot_wCP; uint32_t **gold_csi_rs = gNB->nr_gold_csi_rs[slot]; int16_t mod_csi[frame_parms.symbols_per_slot][NR_MAX_CSI_RS_LENGTH>>1] __attribute__((aligned(16)));; uint16_t b = csi_params.freq_domain; diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index 9bbc61d4b6..2e8813cbd2 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -276,7 +276,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, if (start_sc >= frame_parms->ofdm_symbol_size) start_sc -= frame_parms->ofdm_symbol_size; - int txdataF_offset = (slot%2)*frame_parms->samples_per_slot_wCP; + int txdataF_offset = slot*frame_parms->samples_per_slot_wCP; #ifdef DEBUG_DLSCH_MAPPING printf("PDSCH resource mapping started (start SC %d\tstart symbol %d\tN_PRB %d\tnb_re %d,nb_layers %d)\n", @@ -375,12 +375,12 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, /* Map DMRS Symbol */ if ( (dmrs_symbol_map & (1 << l)) && (k == ((start_sc+get_dmrs_freq_idx(n, k_prime, delta, dmrs_Type))%(frame_parms->ofdm_symbol_size)))) { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 ] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15; #ifdef DEBUG_DLSCH_MAPPING printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n", - dmrs_idx, l, k, k_prime, n, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); + dmrs_idx, l, k, k_prime, n, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1)], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1]); #endif dmrs_idx++; k_prime++; @@ -388,8 +388,8 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, n+=(k_prime)?0:1; } else if(is_ptrs_re){ - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[ptrs_idx<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[(ptrs_idx<<1) + 1])>> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = (beta_ptrs*amp*mod_ptrs[ptrs_idx<<1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = (beta_ptrs*amp*mod_ptrs[(ptrs_idx<<1) + 1])>> 15; #ifdef DEBUG_DLSCH_MAPPING printf("ptrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d, mod_ptrs: %d %d\n", ptrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], @@ -399,19 +399,19 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } /* Map DATA Symbol */ else if( ptrs_symbol || allowed_xlsch_re_in_dmrs_symbol(k,start_sc,frame_parms->ofdm_symbol_size,rel15->numDmrsCdmGrpsNoData,dmrs_Type)) { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (amp * tx_layers[ap][m<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = (amp * tx_layers[ap][m<<1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15; #ifdef DEBUG_DLSCH_MAPPING printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", - m, l, k, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); + m, l, k, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1)], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1]); #endif m++; } /* mute RE */ else { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = 0; } if (++k >= frame_parms->ofdm_symbol_size) k -= frame_parms->ofdm_symbol_size; @@ -427,7 +427,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } // fix the alignment issues later, use 64-bit SIMD below instead of 128. if (0/*(frame_parms->N_RB_DL&1)==0*/) { - __m128i *txF=(__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc+txdataF_offset)<<1)]; + __m128i *txF=(__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc)<<1)]; __m128i *txl = (__m128i*)&tx_layers[ap][m<<1]; __m128i amp128=_mm_set1_epi16(amp); @@ -436,7 +436,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } //RE loop, first part m+=upper_limit; if (remaining_re > 0) { - txF = (__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+txdataF_offset)<<1)]; + txF = (__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size)<<1)]; txl = (__m128i*)&tx_layers[ap][m<<1]; for (int i=0; i<(remaining_re>>2); i++) { txF[i] = _mm_mulhrs_epi16(amp128,txl[i]); @@ -444,7 +444,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } } else { - __m64 *txF=(__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc+txdataF_offset)<<1)]; + __m64 *txF=(__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc)<<1)]; __m64 *txl = (__m64*)&tx_layers[ap][m<<1]; __m64 amp64=_mm_set1_pi16(amp); @@ -454,31 +454,31 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, #ifdef DEBUG_DLSCH_MAPPING if ((i&1) > 0) printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", - m, l, start_sc+(i>>1), txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1) + 1 + (2*txdataF_offset)]); + m, l, start_sc+(i>>1), txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1)], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1) + 1]); #endif /* handle this, mute RE */ /*else { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = 0; }*/ } //RE loop, first part m+=upper_limit; if (remaining_re > 0) { - txF = (__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+txdataF_offset)<<1)]; + txF = (__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size)<<1)]; txl = (__m64*)&tx_layers[ap][m<<1]; for (int i=0; i<(remaining_re>>1); i++) { txF[i] = _mm_mulhrs_pi16(amp64,txl[i]); #ifdef DEBUG_DLSCH_MAPPING if ((i&1) > 0) printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", - m, l, i>>1, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) + 1 + (2*txdataF_offset)]); + m, l, i>>1, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) ], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) + 1]); #endif /* handle this, mute RE */ /*else { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = 0; }*/ } //RE loop, second part } // @@ -515,7 +515,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, if (pmi == 0) {//unitary Precoding if(apnrOfLayers) memcpy((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k], - (void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size + txdataF_offset+ k)], + (void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size + k)], NR_NB_SC_PER_RB*sizeof(int32_t)); else memset((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k], @@ -556,7 +556,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } for (int i=0; iofdm_symbol_size + k; - int32_t precodatatx_F = nr_layer_precoder(txdataF_precoding, W_prec, rel15->nrOfLayers, re_offset+txdataF_offset); + int32_t precodatatx_F = nr_layer_precoder(txdataF_precoding, W_prec, rel15->nrOfLayers, re_offset); ((int16_t*)txdataF[ap])[(re_offset<<1) + (2*txdataF_offset)] = ((int16_t *) &precodatatx_F)[0]; ((int16_t*)txdataF[ap])[(re_offset<<1) + 1 + (2*txdataF_offset)] = ((int16_t *) &precodatatx_F)[1]; #ifdef DEBUG_DLSCH_MAPPING diff --git a/openair1/SCHED_NR/nr_ru_procedures.c b/openair1/SCHED_NR/nr_ru_procedures.c index 3f4c2f71fb..4d3174007a 100644 --- a/openair1/SCHED_NR/nr_ru_procedures.c +++ b/openair1/SCHED_NR/nr_ru_procedures.c @@ -155,7 +155,7 @@ void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx) { int aa = 0;//physical antenna number int ret = 0; int ofdm_mask_full = (1<<(ru->nb_tx*2))-1; - int txdataF_offset = ((tti_tx%2)*fp->samples_per_slot_wCP); + int txdataF_offset = (tti_tx*fp->samples_per_slot_wCP); if (nr_slot_select(cfg,frame_tx,slot) == NR_UPLINK_SLOT) return; for (aa=0; aanb_tx; aa++) memset(ru->common.txdataF[aa],0,fp->samples_per_slot_wCP*sizeof(int32_t)); @@ -300,7 +300,7 @@ static void *nr_feptx_thread(void *param) { ofdm_mask_full = (1<<(ru->nb_tx*2))-1; if(ru->num_gNB != 0){ - txdataF_offset = ((slot%2)*fp->samples_per_slot_wCP); + txdataF_offset = (slot*fp->samples_per_slot_wCP); ////////////precoding//////////// VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+feptx->index+1 , 1); @@ -464,7 +464,7 @@ void nr_feptx_prec(RU_t *ru,int frame_tx,int tti_tx) { int32_t ***bw; int i=0; int slot_tx = tti_tx; - int txdataF_offset = ((tti_tx%2)*fp->samples_per_slot_wCP); + int txdataF_offset = (tti_tx*fp->samples_per_slot_wCP); start_meas(&ru->precoding_stats); AssertFatal(ru->nb_log_antennas > 0,"ru->nb_log_antennas is 0!\n"); diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 4086a3227c..4a916593c3 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -74,7 +74,7 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_ int **txdataF = gNB->common_vars.txdataF; uint8_t ssb_index, n_hf; uint16_t ssb_start_symbol; - int txdataF_offset = (slot%2)*fp->samples_per_slot_wCP; + int txdataF_offset = slot*fp->samples_per_slot_wCP; uint16_t slots_per_hf = (fp->slots_per_frame)>>1; if (slotframe_parms; nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; int offset = gNB->CC_id; - int txdataF_offset = (slot%2)*fp->samples_per_slot_wCP; + int txdataF_offset = slot*fp->samples_per_slot_wCP; if ((cfg->cell_config.frame_duplex_type.value == TDD) && (nr_slot_select(cfg,frame,slot) == NR_UPLINK_SLOT)) return; diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 6dc8dcfa4a..1d134a50d2 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -1102,7 +1102,7 @@ int main(int argc, char **argv) else phy_procedures_gNB_TX(msgDataTx,frame,slot,1); - int txdataF_offset = (slot%2) * frame_parms->samples_per_slot_wCP; + int txdataF_offset = slot * frame_parms->samples_per_slot_wCP; if (n_trials==1) { LOG_M("txsigF0.m","txsF0=", &gNB->common_vars.txdataF[0][txdataF_offset+2*frame_parms->ofdm_symbol_size],frame_parms->ofdm_symbol_size,1,1); From d318f09142a6081020e3e36c6691e3cb49dc29d4 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 13 Jan 2022 09:37:53 +0000 Subject: [PATCH 059/113] Fix L1s indentation in config files --- ci-scripts/conf_files/benetel-5g.conf | 4 ++-- ...sci_gnb.band78.sa.fr1.106PRB.usrpn310.conf | 14 +++++------ ...oxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf | 14 +++++------ ci-scripts/conf_files/gNB_SA_DU.conf | 16 ++++++------- .../gnb.band78.nsa_2x2.106PRB.usrpn310.conf | 4 ++-- ...gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 12 +++++----- .../gnb.band78.sa.fr1.106PRB.usrpn310.conf | 12 +++++----- ...gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf | 12 +++++----- .../gnb.band78.tm1.106PRB.usrpn300.conf | 4 ++-- .../GENERIC-LTE-EPC/CONF/benetel-5g.conf | 4 ++-- .../CONF/gnb.band261.tm1.32PRB.usrpn300.conf | 4 ++-- .../CONF/gnb.band78.tm1.106PRB.usrpn300.conf | 4 ++-- .../CONF/gnb.band78.tm1.106PRB.usrpx300.conf | 4 ++-- .../CONF/gnb.band78.tm1.24PRB.usrpb210.conf | 4 ++-- .../CONF/gnb.band78.tm1.24PRB.usrpn300.conf | 4 ++-- .../CONF/oaiL1.nfapi.usrpx300.conf | 24 +++++++++---------- .../GENERIC-LTE-EPC/CONF/testing_gnb.conf | 4 ++-- .../CONF/testing_gnb_24PRB.conf | 4 ++-- .../CONF/testing_gnb_nsa_n310.conf | 4 ++-- .../PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf | 4 ++-- ...b.sa.band78.fr1.106PRB.usrpb210.sabox.conf | 4 ++-- 21 files changed, 80 insertions(+), 80 deletions(-) diff --git a/ci-scripts/conf_files/benetel-5g.conf b/ci-scripts/conf_files/benetel-5g.conf index 73b1da8c50..dc86567c1f 100644 --- a/ci-scripts/conf_files/benetel-5g.conf +++ b/ci-scripts/conf_files/benetel-5g.conf @@ -216,8 +216,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 8; } ); diff --git a/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf index 01add06e3a..234050a8a5 100644 --- a/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -241,13 +241,13 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - prach_dtx_threshold = 120; - pucch0_dtx_threshold = 150; - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; +} ); RUs = ( diff --git a/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf index ab0cf5f469..2f8c621526 100644 --- a/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -242,13 +242,13 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - prach_dtx_threshold = 120; - pucch0_dtx_threshold = 150; - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gNB_SA_DU.conf b/ci-scripts/conf_files/gNB_SA_DU.conf index b03758a006..adcbcd45d0 100644 --- a/ci-scripts/conf_files/gNB_SA_DU.conf +++ b/ci-scripts/conf_files/gNB_SA_DU.conf @@ -227,14 +227,14 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - prach_dtx_threshold = 120; - pucch0_dtx_threshold = 150; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf index b891af747a..adb79ceb8d 100644 --- a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf @@ -211,8 +211,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 8; prach_dtx_threshold = 120; } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index cfcdcd44dc..e718112199 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -231,12 +231,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - prach_dtx_threshold = 120; -# pucch0_dtx_threshold = 150; - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + prach_dtx_threshold = 120; +# pucch0_dtx_threshold = 150; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index 4c3d25b33d..11931d1700 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -236,12 +236,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - prach_dtx_threshold = 120; -# pucch0_dtx_threshold = 150; - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + prach_dtx_threshold = 120; +# pucch0_dtx_threshold = 150; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf index 4c3d25b33d..11931d1700 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf @@ -236,12 +236,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - prach_dtx_threshold = 120; -# pucch0_dtx_threshold = 150; - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + prach_dtx_threshold = 120; +# pucch0_dtx_threshold = 150; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf index 7efdf159eb..9cc8f554e8 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf @@ -195,8 +195,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 8; } ); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf index b90acb8e97..575fddda2b 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf @@ -217,8 +217,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 8; } ); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf index 51c9076fe7..813a0e58e3 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf @@ -211,8 +211,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf index f536fd4d47..af26091260 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf @@ -193,8 +193,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf index 375bb5f54c..928c70113f 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf @@ -193,8 +193,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf index 07939f4d95..5c0434b57e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf @@ -193,8 +193,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf index 6b5baef5ce..4b1476a76d 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf @@ -193,8 +193,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf index 97f20c1461..0b384958ae 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf @@ -18,18 +18,18 @@ log_config = { L1s = ( - { - num_cc = 1; - tr_n_preference = "nfapi"; - local_n_if_name = "lo"; - remote_n_address = "127.0.0.2"; // vnf addr - local_n_address = "127.0.0.1"; // pnf addr - local_n_portc = 50000; // pnf p5 port [!] - remote_n_portc = 50001; // vnf p5 port - local_n_portd = 50010; // pnf p7 port - remote_n_portd = 50011; // vnf p7 port - thread_pool_size = 8; - } +{ + num_cc = 1; + tr_n_preference = "nfapi"; + local_n_if_name = "lo"; + remote_n_address = "127.0.0.2"; // vnf addr + local_n_address = "127.0.0.1"; // pnf addr + local_n_portc = 50000; // pnf p5 port [!] + remote_n_portc = 50001; // vnf p5 port + local_n_portd = 50010; // pnf p7 port + remote_n_portd = 50011; // vnf p7 port + thread_pool_size = 8; +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf index 5aade8ab21..5591ed082d 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf @@ -211,8 +211,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf index fd4a722fc7..dd8113e059 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf @@ -212,8 +212,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf index 2ecd4b1426..96335f23ca 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf @@ -211,8 +211,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 8; } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf index db4bf5e167..1de2a1bd4f 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf @@ -211,8 +211,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 2; } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf index 564b284f06..c8a0bace37 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf @@ -226,8 +226,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 8; } ); From 24ebf98ebfa731f69f282a1e8f6acea6b7e72f34 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 13 Jan 2022 09:55:11 +0000 Subject: [PATCH 060/113] Add descriptive help string for CONFIG_STRING_L1_THREAD_POOL_SIZE --- openair2/GNB_APP/L1_nr_paramdef.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/GNB_APP/L1_nr_paramdef.h b/openair2/GNB_APP/L1_nr_paramdef.h index ccff1ca995..90cd9aae29 100644 --- a/openair2/GNB_APP/L1_nr_paramdef.h +++ b/openair2/GNB_APP/L1_nr_paramdef.h @@ -65,7 +65,7 @@ {CONFIG_STRING_L1_REMOTE_N_PORTC, NULL, 0, uptr:NULL, defintval:50030, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_LOCAL_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_REMOTE_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ -{CONFIG_STRING_L1_THREAD_POOL_SIZE, NULL, 0, uptr:NULL, defintval:4, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_THREAD_POOL_SIZE, "Maximum number of CPU cores for L1 processing (either max HW CPU cores or this value is used)", 0, uptr:NULL, defintval:4, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_OFDM_OFFSET_DIVISOR, NULL, 0, uptr:NULL, defuintval:8, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:100, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PRACH_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:150, TYPE_UINT, 0}, \ From 2ccc7188e50a3efc73d693d418109ecd50ca2018 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Thu, 13 Jan 2022 14:39:56 +0100 Subject: [PATCH 061/113] fix regression in merge develop and some warnings --- .../install_external_packages.ubuntu20 | 3 ++- openair1/PHY/INIT/nr_init_ue.c | 1 + openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c | 2 +- openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c | 4 ++-- openair1/SIMULATION/NR_PHY/dlsim.c | 22 +++++++++---------- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/cmake_targets/install_external_packages.ubuntu20 b/cmake_targets/install_external_packages.ubuntu20 index f0314ca575..f8b64980f6 100755 --- a/cmake_targets/install_external_packages.ubuntu20 +++ b/cmake_targets/install_external_packages.ubuntu20 @@ -24,6 +24,7 @@ # authors Laurent Thomas # ####################################### + if [ ! -f /etc/os-release ]; then echo "No /etc/os-release file found. You're likely on an unsupported distro." exit 1 @@ -483,7 +484,7 @@ if ! check_supported_distribution; then echo_error "Your distribution $(get_distribution_release) is not supported by oai !" exit 1 fi - +set_openair_env echo_info "Installing packages" check_install_ubuntu_packages diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index f664a03ba0..c193733aef 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -41,6 +41,7 @@ #include "PHY/NR_REFSIG/ul_ref_seq_nr.h" #include "PHY/NR_REFSIG/refsig_defs_ue.h" #include "PHY/NR_REFSIG/nr_refsig.h" +#include #if 0 void phy_config_harq_ue(module_id_t Mod_id, diff --git a/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c index 82bb0a2659..e0cf694fff 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c @@ -46,7 +46,7 @@ void pcfich_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, uint32_t i; uint8_t reset; - uint32_t x1, x2, s=0; + uint32_t x1=0, x2=0, s=0; reset = 1; // x1 is set in lte_gold_generic diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c index afd1fc6e0d..819fccc588 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c @@ -294,8 +294,8 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ENCODING, VCD_FUNCTION_IN); uint32_t A = rel15->TBSize[0]<<3; - if ( dlsch->rnti != SI_RNTI ) - trace_NRpdu(DIRECTION_DOWNLINK, a, rel15->TBSize[0], 0, WS_C_RNTI, dlsch->rnti, frame, slot,0, 0); + if ( rel15->rnti != SI_RNTI) + trace_NRpdu(DIRECTION_DOWNLINK, a, rel15->TBSize[0], 0, WS_C_RNTI, rel15->rnti, frame, slot,0, 0); NR_gNB_SCH_STATS_t *stats=NULL; int first_free=-1; diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 9c0772bf48..5c64affd14 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -982,10 +982,15 @@ int main(int argc, char **argv) gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t)); initTpool(gNBthreads, gNB->threadPool, true); - gNB->resp_L1_tx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); - initNotifiedFIFO(gNB->resp_L1_tx); + // L1 TX result FIFO + gNB->L1_tx_free = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); + gNB->L1_tx_filled = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); + gNB->L1_tx_out = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); + initNotifiedFIFO(gNB->L1_tx_free); + initNotifiedFIFO(gNB->L1_tx_filled); + initNotifiedFIFO(gNB->L1_tx_out); // we create 2 threads for L1 tx processing - notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->resp_L1_tx,processSlotTX); + notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->L1_tx_free,processSlotTX); processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx); init_DLSCH_struct(gNB, msgDataTx); msgDataTx->slot = slot; @@ -1305,17 +1310,10 @@ int main(int argc, char **argv) printf("\n"); if (print_perf==1) { - printf("\ngNB TX function statistics (per %d us slot, NPRB %d, mcs %d, TBS %d)\n", + printf("\ngNB TX function statistics (per %d us slot, NPRB %d, mcs %d, block %d)\n", 1000>>*scc->ssbSubcarrierSpacing, g_rbSize, g_mcsIndex, -<<<<<<< HEAD - msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3, - msgDataTx->dlsch[0][0]->harq_process.K, - msgDataTx->dlsch[0][0]->harq_process.K/((msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3)>3824?22:10)); - printDistribution(gNB->phy_proc_tx[0],table_tx,"PHY proc tx"); -======= msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3); - printDistribution(gNB->phy_proc_tx_0,table_tx,"PHY proc tx"); ->>>>>>> 264e829922fc68e4caa3611b70d921c131e7ca68 + printDistribution(gNB->phy_proc_tx[0],table_tx,"PHY proc tx"); printStatIndent2(&gNB->dlsch_encoding_stats,"DLSCH encoding time"); printStatIndent3(&gNB->dlsch_segmentation_stats,"DLSCH segmentation time"); printStatIndent3(&gNB->tinput,"DLSCH LDPC input processing time"); From 26ce5a7236e90ff5af9d455e1ca6c3496593c0c2 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Sat, 13 Nov 2021 15:49:12 +0100 Subject: [PATCH 062/113] NR_UE: fix PDSCH HARQ round calculation --- openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 1 - openair1/SCHED_NR_UE/harq_nr.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index b8cd59eead..0eb5addbf0 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -271,7 +271,6 @@ bool nr_ue_postDecode(PHY_VARS_NR_UE *phy_vars_ue, notifiedFIFO_elt_t *req, bool //LOG_D(PHY,"[UE %d] DLSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d) Kr %d r %d harq_process->round %d\n", // phy_vars_ue->Mod_id, frame, nr_slot_rx, harq_pid,harq_process->status, harq_process->round,harq_process->TBS,harq_process->mcs,Kr,r,harq_process->round); harq_process->ack = 0; - harq_process->round++; if (harq_process->round >= dlsch->Mlimit) { harq_process->status = SCH_IDLE; harq_process->round = 0; diff --git a/openair1/SCHED_NR_UE/harq_nr.c b/openair1/SCHED_NR_UE/harq_nr.c index 5b65131934..4d92509d48 100644 --- a/openair1/SCHED_NR_UE/harq_nr.c +++ b/openair1/SCHED_NR_UE/harq_nr.c @@ -349,7 +349,7 @@ void downlink_harq_process(NR_DL_UE_HARQ_t *dl_harq, int harq_pid, int ndi, int dl_harq->DCINdi = ndi; break; case 1: - dl_harq->round = 2; + dl_harq->round = 3; dl_harq->status = ACTIVE; dl_harq->first_rx = 0; if (dl_harq->DCINdi != ndi) { @@ -373,7 +373,7 @@ void downlink_harq_process(NR_DL_UE_HARQ_t *dl_harq, int harq_pid, int ndi, int dl_harq->status = SCH_IDLE; break; case 3: - dl_harq->round = 3; + dl_harq->round = 2; dl_harq->status = ACTIVE; dl_harq->first_rx = 0; if (dl_harq->DCINdi != ndi) { From 9e2b05a0aad3fa6238a2f0f4eaa5df0a6de417cd Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Sat, 13 Nov 2021 15:50:31 +0100 Subject: [PATCH 063/113] gNB: fix PUSCH HARQ round calculation --- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index 5286fe8780..d5c13777ec 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -463,7 +463,12 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_ULSCH_DECODING,1); harq_process->TBS = pusch_pdu->pusch_data.tb_size; - harq_process->round = nr_rv_round_map[pusch_pdu->pusch_data.rv_index]; + for (int round = 0; round < 4; round++) { + if (nr_rv_round_map[round] == pusch_pdu->pusch_data.rv_index) { + harq_process->round = round; + break; + } + } harq_process->new_rx = false; // flag to indicate if this is a new reception for this harq (initialized to false) if (harq_process->round == 0) { From ca5512594b75d82b11bd564c46d759b1557fdc04 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Tue, 18 Jan 2022 18:55:23 +0100 Subject: [PATCH 064/113] refactor open-coded conversion of rv_index to HARQ round into new function nr_rv_to_round() --- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 7 +------ openair1/PHY/defs_nr_common.h | 10 ++++++++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index d5c13777ec..33071e4070 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -463,12 +463,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_ULSCH_DECODING,1); harq_process->TBS = pusch_pdu->pusch_data.tb_size; - for (int round = 0; round < 4; round++) { - if (nr_rv_round_map[round] == pusch_pdu->pusch_data.rv_index) { - harq_process->round = round; - break; - } - } + harq_process->round = nr_rv_to_round(pusch_pdu->pusch_data.rv_index); harq_process->new_rx = false; // flag to indicate if this is a new reception for this harq (initialized to false) if (harq_process->round == 0) { diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index c385d323e3..d487616f91 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -115,6 +115,16 @@ extern const uint8_t nr_rv_round_map[4]; extern const uint8_t nr_rv_round_map_ue[4]; +static inline +uint8_t nr_rv_to_round(uint8_t rv) +{ + for (uint8_t round = 0; round < 4; round++) { + if (nr_rv_round_map[round] == rv) + return round; + } + return 0; +} + typedef enum { NR_MU_0=0, NR_MU_1, From 7ef0da0143802128ad1f448c2604128faaeb566b Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Tue, 18 Jan 2022 18:58:58 +0100 Subject: [PATCH 065/113] remove unused array nr_rv_round_map_ue --- openair1/PHY/defs_nr_common.h | 1 - openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 2 -- openair1/SIMULATION/NR_PHY/dlschsim.c | 1 - openair1/SIMULATION/NR_PHY/pbchsim.c | 1 - openair1/SIMULATION/NR_PHY/pucchsim.c | 1 - openair1/SIMULATION/NR_PHY/ulschsim.c | 1 - 6 files changed, 7 deletions(-) diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index d487616f91..979b98e536 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -113,7 +113,6 @@ #define NR_NB_TH_SLOT 2 extern const uint8_t nr_rv_round_map[4]; -extern const uint8_t nr_rv_round_map_ue[4]; static inline uint8_t nr_rv_to_round(uint8_t rv) diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index e403c7410b..1cfcaab4ec 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -78,8 +78,6 @@ fifo_dump_emos_UE emos_dump_UE; char nr_mode_string[NUM_UE_MODE][20] = {"NOT SYNCHED","PRACH","RAR","RA_WAIT_CR", "PUSCH", "RESYNCH"}; -const uint8_t nr_rv_round_map_ue[4] = {0, 2, 1, 3}; - #if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) extern uint64_t downlink_frequency[MAX_NUM_CCs][4]; #endif diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index ff07422c6b..959fbf67e9 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -60,7 +60,6 @@ double cpuf; uint16_t NB_UE_INST = 1; uint8_t const nr_rv_round_map[4] = {0, 2, 1, 3}; -uint8_t const nr_rv_round_map_ue[4] = {0, 2, 1, 3}; // needed for some functions PHY_VARS_NR_UE *PHY_vars_UE_g[1][1] = { { NULL } }; diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 2413a86912..ca2e1f4c57 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -64,7 +64,6 @@ uint16_t NB_UE_INST = 1; openair0_config_t openair0_cfg[MAX_CARDS]; uint8_t const nr_rv_round_map[4] = {0, 2, 1, 3}; -uint8_t const nr_rv_round_map_ue[4] = {0, 2, 1, 3}; uint64_t get_softmodem_optmask(void) {return 0;} softmodem_params_t *get_softmodem_params(void) {return 0;} diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index 213924e5fd..f4d9b3f9f5 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -57,7 +57,6 @@ double cpuf; //uint8_t nfapi_mode = 0; uint16_t NB_UE_INST = 1; uint8_t const nr_rv_round_map[4] = {0, 2, 1, 3}; -uint8_t const nr_rv_round_map_ue[4] = {0, 2, 1, 3}; // needed for some functions PHY_VARS_NR_UE * PHY_vars_UE_g[1][1]={{NULL}}; diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c index 94aea36a67..556f787d70 100644 --- a/openair1/SIMULATION/NR_PHY/ulschsim.c +++ b/openair1/SIMULATION/NR_PHY/ulschsim.c @@ -57,7 +57,6 @@ int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq) {} uint8_t const nr_rv_round_map[4] = {0, 2, 1, 3}; -uint8_t const nr_rv_round_map_ue[4] = {0, 2, 1, 3}; double cpuf; //uint8_t nfapi_mode = 0; From 38d5b38910832f5ee5938c8c2c852816d2de8f17 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Tue, 18 Jan 2022 18:02:07 +0000 Subject: [PATCH 066/113] Revert ulsch scheduler min_rb to 5 --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index af756844e4..c3a5d0b957 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1081,7 +1081,7 @@ void pf_ul(module_id_t module_id, gNB_MAC_INST *nrmac = RC.nrmac[module_id]; NR_ServingCellConfigCommon_t *scc = nrmac->common_channels[CC_id].ServingCellConfigCommon; NR_UE_info_t *UE_info = &nrmac->UE_info; - const int min_rb = 40; + const int min_rb = 5; float coeff_ue[MAX_MOBILES_PER_GNB]; // UEs that could be scheduled int ue_array[MAX_MOBILES_PER_GNB]; From eb14a6a45f7ba7d9c2adfb216734f2ed922dfbd9 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Wed, 19 Jan 2022 14:43:01 +0100 Subject: [PATCH 067/113] consistently make nr_rv_round_map[4] = {0, 2, 3, 1} --- openair1/SIMULATION/NR_PHY/dlschsim.c | 2 +- openair1/SIMULATION/NR_PHY/pbchsim.c | 2 +- openair1/SIMULATION/NR_PHY/pucchsim.c | 2 +- openair1/SIMULATION/NR_PHY/ulschsim.c | 2 +- openair1/SIMULATION/NR_PHY/ulsim.c | 1 - 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index 959fbf67e9..ee1eca1e06 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -59,7 +59,7 @@ double cpuf; //uint8_t nfapi_mode = 0; uint16_t NB_UE_INST = 1; -uint8_t const nr_rv_round_map[4] = {0, 2, 1, 3}; +uint8_t const nr_rv_round_map[4] = {0, 2, 3, 1}; // needed for some functions PHY_VARS_NR_UE *PHY_vars_UE_g[1][1] = { { NULL } }; diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index ca2e1f4c57..8baaf62416 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -63,7 +63,7 @@ uint16_t NB_UE_INST = 1; // needed for some functions openair0_config_t openair0_cfg[MAX_CARDS]; -uint8_t const nr_rv_round_map[4] = {0, 2, 1, 3}; +uint8_t const nr_rv_round_map[4] = {0, 2, 3, 1}; uint64_t get_softmodem_optmask(void) {return 0;} softmodem_params_t *get_softmodem_params(void) {return 0;} diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index f4d9b3f9f5..d07469a4b7 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -56,7 +56,7 @@ int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; double cpuf; //uint8_t nfapi_mode = 0; uint16_t NB_UE_INST = 1; -uint8_t const nr_rv_round_map[4] = {0, 2, 1, 3}; +uint8_t const nr_rv_round_map[4] = {0, 2, 3, 1}; // needed for some functions PHY_VARS_NR_UE * PHY_vars_UE_g[1][1]={{NULL}}; diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c index 556f787d70..931a63a77e 100644 --- a/openair1/SIMULATION/NR_PHY/ulschsim.c +++ b/openair1/SIMULATION/NR_PHY/ulschsim.c @@ -56,7 +56,7 @@ int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq) {} -uint8_t const nr_rv_round_map[4] = {0, 2, 1, 3}; +uint8_t const nr_rv_round_map[4] = {0, 2, 3, 1}; double cpuf; //uint8_t nfapi_mode = 0; diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index db8d54f86d..74f6256353 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -243,7 +243,6 @@ nrUE_params_t *get_nrUE_params(void) { // needed for some functions uint16_t n_rnti = 0x1234; openair0_config_t openair0_cfg[MAX_CARDS]; -//const uint8_t nr_rv_round_map[4] = {0, 2, 1, 3}; channel_desc_t *UE2gNB[NUMBER_OF_UE_MAX][NUMBER_OF_gNB_MAX]; From df98bdb372093712356ead399066b9dbbbd6a866 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Wed, 19 Jan 2022 15:17:26 +0100 Subject: [PATCH 068/113] move nr_rv_round_map from gNB_scheduler_phytest.c to gNB_scheduler.c --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 1 + openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index ae52f8cc60..f24d6e686b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -55,6 +55,7 @@ #include #include +const uint8_t nr_rv_round_map[4] = { 0, 2, 3, 1 }; uint16_t nr_pdcch_order_table[6] = { 31, 31, 511, 2047, 2047, 8191 }; uint8_t vnf_first_sched_entry = 1; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index c0107c5fc6..9ec126d429 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -53,7 +53,6 @@ //#define UL_HARQ_PRINT extern RAN_CONTEXT_t RC; -const uint8_t nr_rv_round_map[4] = {0, 2, 3, 1}; //#define ENABLE_MAC_PAYLOAD_DEBUG 1 //uint8_t mac_pdu[MAX_NR_DLSCH_PAYLOAD_BYTES]; From f157b06a01127ff11d52f57d57ce19cb86e5d407 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 19 Jan 2022 15:59:34 +0100 Subject: [PATCH 069/113] Revert changes in cqi_to_mcs Revert the changes to the cqi_to_mcs table introduced in 9fa09f530f96d23a9e417993ff513af6ec9232db. Also, take out cqi_to_mcs form NR UE, as it is not used in there. --- openair1/PHY/phy_vars.h | 3 +-- openair1/PHY/phy_vars_nr_ue.h | 3 --- openair1/PHY/phy_vars_ue.h | 3 +-- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/openair1/PHY/phy_vars.h b/openair1/PHY/phy_vars.h index 9fd186ec4f..d99a3016ba 100644 --- a/openair1/PHY/phy_vars.h +++ b/openair1/PHY/phy_vars.h @@ -82,8 +82,7 @@ const double sinr_to_cqi[4][16]= { {-2.5051, -2.5051, -1.7451, -0.3655, 1.0812, { -4.1057, -4.1057, -3.3768, -2.2916, -1.1392, 0.1236, 1.2849, 3.1933, 5.9298, 6.4052, 9.6245, 10.9414, 13.5166, 14.9545, 14.9545, 14.9545} }; -//int cqi_to_mcs[16]={0, 0, 1, 3, 5, 7, 9, 13, 15, 16, 20, 23, 25, 27, 27, 27}; -const int cqi_to_mcs[16]= {0, 0, 1, 2, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 27, 27}; +const int cqi_to_mcs[16]= {0, 0, 1, 2, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 27, 28}; //for SNR to MI conversion 7 th order Polynomial coeff const double q_qam16[8]= {3.21151853033897e-10,5.55435952230651e-09,-2.30760065362117e-07,-6.25587743817859e-06,4.62251036452795e-06,0.00224150813158937,0.0393723140344367,0.245486379182639}; diff --git a/openair1/PHY/phy_vars_nr_ue.h b/openair1/PHY/phy_vars_nr_ue.h index 303853add2..550a2f0394 100644 --- a/openair1/PHY/phy_vars_nr_ue.h +++ b/openair1/PHY/phy_vars_nr_ue.h @@ -83,9 +83,6 @@ const double sinr_to_cqi[4][16]= { {-2.5051, -2.5051, -1.7451, -0.3655, 1.0812, { -4.1057, -4.1057, -3.3768, -2.2916, -1.1392, 0.1236, 1.2849, 3.1933, 5.9298, 6.4052, 9.6245, 10.9414, 13.5166, 14.9545, 14.9545, 14.9545} }; -//int cqi_to_mcs[16]={0, 0, 1, 3, 5, 7, 9, 13, 15, 16, 20, 23, 25, 27, 27, 27}; -const int cqi_to_mcs[16]= {0, 0, 1, 2, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 27, 27}; - //for SNR to MI conversion 7 th order Polynomial coeff const double q_qam16[8]= {3.21151853033897e-10,5.55435952230651e-09,-2.30760065362117e-07,-6.25587743817859e-06,4.62251036452795e-06,0.00224150813158937,0.0393723140344367,0.245486379182639}; const double q_qpsk[8]= {1.94491167814437e-09,8.40494123817774e-08,4.75527131198034e-07,-2.48946285301621e-05,-0.000347614016158364,0.00209252225437100,0.0742986115462510,0.488297879889425}; diff --git a/openair1/PHY/phy_vars_ue.h b/openair1/PHY/phy_vars_ue.h index 2c1334b80b..2cdec82f0f 100644 --- a/openair1/PHY/phy_vars_ue.h +++ b/openair1/PHY/phy_vars_ue.h @@ -72,8 +72,7 @@ const double sinr_to_cqi[4][16]= { {-2.5051, -2.5051, -1.7451, -0.3655, 1.0812, { -4.1057, -4.1057, -3.3768, -2.2916, -1.1392, 0.1236, 1.2849, 3.1933, 5.9298, 6.4052, 9.6245, 10.9414, 13.5166, 14.9545, 14.9545, 14.9545} }; -//int cqi_to_mcs[16]={0, 0, 1, 3, 5, 7, 9, 13, 15, 16, 20, 23, 25, 27, 27, 27}; -const int cqi_to_mcs[16]= {0, 0, 1, 2, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 27, 27}; +const int cqi_to_mcs[16]= {0, 0, 1, 2, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 27, 28}; //for SNR to MI conversion 7 th order Polynomial coeff const double q_qam16[8]= {3.21151853033897e-10,5.55435952230651e-09,-2.30760065362117e-07,-6.25587743817859e-06,4.62251036452795e-06,0.00224150813158937,0.0393723140344367,0.245486379182639}; From 6aa7eea09fcdecfed91b06fd0f4f1872e1730b49 Mon Sep 17 00:00:00 2001 From: hardy Date: Thu, 20 Jan 2022 14:04:51 +0100 Subject: [PATCH 070/113] update lte 2x2 for tm2 --- ...nb.band38.lte_2x2_tm2.100PRB.usrpn310.conf | 281 ++++++++++++++++++ ...x2_quectel.xml => lte_2x2_tm1_quectel.xml} | 4 +- ci-scripts/xml_files/lte_2x2_tm2_quectel.xml | 145 +++++++++ 3 files changed, 428 insertions(+), 2 deletions(-) create mode 100644 ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf rename ci-scripts/xml_files/{fr1_lte_2x2_quectel.xml => lte_2x2_tm1_quectel.xml} (97%) create mode 100644 ci-scripts/xml_files/lte_2x2_tm2_quectel.xml diff --git a/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf new file mode 100644 index 0000000000..15a2e6ac1d --- /dev/null +++ b/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf @@ -0,0 +1,281 @@ +Active_eNBs = ( "eNB-Eurecom-B38"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe02; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB-Eurecom-B38"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ( { mcc = 208; mnc = 97; mnc_length = 2; } ); + + tr_s_preference = "local_mac" + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "3GPP_eNODEB"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "TDD"; + tdd_config = 1; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 38; + downlink_frequency = 2605000000L; + nr_scg_ssb_freq = 624608; + uplink_frequency_offset = 0; + Nid_cell = 0; + N_RB_DL = 100; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 2; + nb_antennas_rx = 2; + tx_gain = 90; + rx_gain = 125; + pbch_repetition = "FALSE"; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 0; + pucch_nCS_AN = 0; + pucch_n1_AN = 0; + pdsch_referenceSignalPower = -29; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -96; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -104; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -108; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + ue_TransmissionMode = 2; + + //Parameters for SIB18 + rxPool_sc_CP_Len = "normal"; + rxPool_sc_Period = "sf40"; + rxPool_data_CP_Len = "normal"; + rxPool_ResourceConfig_prb_Num = 20; + rxPool_ResourceConfig_prb_Start = 5; + rxPool_ResourceConfig_prb_End = 44; + rxPool_ResourceConfig_offsetIndicator_present = "prSmall"; + rxPool_ResourceConfig_offsetIndicator_choice = 0; + rxPool_ResourceConfig_subframeBitmap_present = "prBs40"; + rxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "00000000000000000000"; + rxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5; + rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0; +/* rxPool_dataHoppingConfig_hoppingParameter = 0; + rxPool_dataHoppingConfig_numSubbands = "ns1"; + rxPool_dataHoppingConfig_rbOffset = 0; + rxPool_commTxResourceUC-ReqAllowed = "TRUE"; +*/ + // Parameters for SIB19 + discRxPool_cp_Len = "normal" + discRxPool_discPeriod = "rf32" + discRxPool_numRetx = 1; + discRxPool_numRepetition = 2; + discRxPool_ResourceConfig_prb_Num = 5; + discRxPool_ResourceConfig_prb_Start = 3; + discRxPool_ResourceConfig_prb_End = 21; + discRxPool_ResourceConfig_offsetIndicator_present = "prSmall"; + discRxPool_ResourceConfig_offsetIndicator_choice = 0; + discRxPool_ResourceConfig_subframeBitmap_present = "prBs40"; + discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "f0ffffffff"; + discRxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5; + discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0; + + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + enable_measurement_reports = "no"; + + ///X2 + enable_x2 = "yes"; + t_reloc_prep = 1000; /* unit: millisecond */ + tx2_reloc_overall = 2000; /* unit: millisecond */ + t_dc_prep = 1000; /* unit: millisecond */ + t_dc_overall = 2000; /* unit: millisecond */ + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "eno1"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "CI_ENB_IP_ADDR"; + ENB_INTERFACE_NAME_FOR_S1U = "eno1"; + ENB_IPV4_ADDRESS_FOR_S1U = "CI_ENB_IP_ADDR"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + ENB_IPV4_ADDRESS_FOR_X2C = "CI_ENB_IP_ADDR"; + ENB_PORT_FOR_X2C = 36422; # Spec 36422 + }; + } +); + +MACRLCs = ( + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + phy_test_mode = 0; + scheduler_mode = "fairRR"; + bler_target_upper = 20.0; + bler_target_lower = 10.0; + max_ul_rb_index = 27; + puSch10xSnr = 200; + puCch10xSnr = 150; + } +); + +L1s = ( + { + num_cc = 1; + tr_n_preference = "local_mac"; + prach_dtx_threshold = 200; + pucch1_dtx_threshold = 5 + pucch1ab_dtx_threshold =0; + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 2 + nb_rx = 2 + att_tx = 0 + att_rx = 0; + bands = [38]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 75; + eNB_instances = [0]; + sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.2"; + + } +); + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + +NETWORK_CONTROLLER : +{ + FLEXRAN_ENABLED = "no"; + FLEXRAN_INTERFACE_NAME = "lo"; + FLEXRAN_IPV4_ADDRESS = "127.0.0.1"; + FLEXRAN_PORT = 2210; + FLEXRAN_CACHE = "/mnt/oai_agent_cache"; + FLEXRAN_AWAIT_RECONF = "no"; +}; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + diff --git a/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml b/ci-scripts/xml_files/lte_2x2_tm1_quectel.xml similarity index 97% rename from ci-scripts/xml_files/fr1_lte_2x2_quectel.xml rename to ci-scripts/xml_files/lte_2x2_tm1_quectel.xml index 57a66ece76..6cb7b2883b 100644 --- a/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml +++ b/ci-scripts/xml_files/lte_2x2_tm1_quectel.xml @@ -21,8 +21,8 @@ --> - TEST-LTE-TM2 - LTE 2x2 Ping DL UL with QUECTEL + TEST-LTE-TM1-Tab1 + LTE 2x2 TM1 Ping DL UL with QUECTEL tasks 1 diff --git a/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml b/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml new file mode 100644 index 0000000000..fcc772b8f4 --- /dev/null +++ b/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml @@ -0,0 +1,145 @@ + + + TEST-LTE-TM2-Tab2 + LTE 2x2 TM2 Ping DL UL with QUECTEL + tasks + 1 + + 030001 + 000002 + 010000 + 000001 + 050002 + 050003 + 000002 + 070002 + 070003 + 000001 + 010002 + 080000 + + + + + Initialize_UE + Initialize Quectel + nrmodule2_quectel + yes + + + + + Terminate_UE + Terminate Quectel + nrmodule2_quectel + + + + + Initialize_eNB + Initialize eNB + -O ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf --usrp-tx-thread-config 1 --thread-pool 0,2,4,6 --log_config.global_log_options level,nocolor,time + 0 + 0 + lte + yes + yes + 192.168.18.241 + + + + + IdleSleep + Sleep + 5 + + + + IdleSleep + Sleep + 20 + + + + + Ping + Ping: 20 pings + nrmodule2_quectel + -c 20 + 1 + 40 + + + Ping + Ping: 100 pings, size 1024 + nrmodule2_quectel + -c 100 -s 1024 -i 0,2 + 1 + 30 + + + + + Iperf + iperf (DL/26Mbps/UDP)(60 sec)(single-ue profile) + -u -b 26M -t 60 + DL + nrmodule2_quectel + 5 + 95 + single-ue + + + + Iperf + iperf (UL/7Mbps/UDP)(60 sec)(single-ue profile) + -u -b 7M -t 60 + UL + nrmodule2_quectel + 5 + 95 + single-ue + + + + + + + Terminate_eNB + Terminate eNB + 0 + 0 + lte + + + + Terminate_eNB + Terminate gNB + 1 + 1 + nr + + + + From a859c8810f8418c2e5873257df7b1bc95215eadf Mon Sep 17 00:00:00 2001 From: hardy Date: Wed, 19 Jan 2022 16:40:36 +0100 Subject: [PATCH 071/113] make real time monitor cfg PER test (called in xml) + update 2x2 tests requirements --- ci-scripts/constants.py | 1 + ci-scripts/datalog_rt_stats.2x2.yaml | 35 +++++++++++++++++++ ...ats.yaml => datalog_rt_stats.default.yaml} | 0 ci-scripts/main.py | 5 +++ ci-scripts/ran.py | 15 +++++--- ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml | 1 + .../fr1_nsa_2x2_quectel_attach_detach.xml | 1 + ci-scripts/xml_files/fr1_sa_quectel.xml | 1 + .../xml_files/fr1_sa_quectel_162prb.xml | 1 + .../xml_files/fr1_sa_quectel_stages.xml | 1 + .../fr1_sa_quectel_stages_162prb.xml | 1 + 11 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 ci-scripts/datalog_rt_stats.2x2.yaml rename ci-scripts/{datalog_rt_stats.yaml => datalog_rt_stats.default.yaml} (100%) diff --git a/ci-scripts/constants.py b/ci-scripts/constants.py index bb110bc0e8..3c05675928 100644 --- a/ci-scripts/constants.py +++ b/ci-scripts/constants.py @@ -44,6 +44,7 @@ ENB_PROCESS_ASSERTION = -12 ENB_PROCESS_REALTIME_ISSUE = -13 ENB_PROCESS_NOLOGFILE_TO_ANALYZE = -14 ENB_PROCESS_SLAVE_RRU_NOT_SYNCED = -15 +ENB_REAL_TIME_PROCESSING_ISSUE = -16 HSS_PROCESS_FAILED = -2 HSS_PROCESS_OK = +2 MME_PROCESS_FAILED = -3 diff --git a/ci-scripts/datalog_rt_stats.2x2.yaml b/ci-scripts/datalog_rt_stats.2x2.yaml new file mode 100644 index 0000000000..9e2b66862d --- /dev/null +++ b/ci-scripts/datalog_rt_stats.2x2.yaml @@ -0,0 +1,35 @@ +#this is a configuration file +#used to build real time processing statistics +#for 5G NR phy test (gNB terminate) +Title : Processing Time (us) +ColNames : + - Metric + - Average + - Max + - Average vs Reference Deviation (Reference Value ; Acceptability Threshold) +Ref : + feprx : 120.0 + feptx_prec : 8.0 + feptx_ofdm : 50.0 + feptx_total : 75.0 + L1 Tx processing thread 0 : 300.0 + L1 Tx processing thread 1 : 300.0 + DLSCH encoding : 230.0 + L1 Rx processing : 175.0 + PUSCH inner-receiver : 100.0 + PUSCH decoding : 180.0 + DL & UL scheduling timing stats : 37.0 + UL Indication : 38.0 +Threshold : + feprx : 1.25 + feptx_prec : 1.25 + feptx_ofdm : 1.25 + feptx_total : 1.25 + L1 Tx processing thread 0 : 1.25 + L1 Tx processing thread 1 : 1.25 + DLSCH encoding : 1.25 + L1 Rx processing : 1.25 + PUSCH inner-receiver : 1.25 + PUSCH decoding : 1.25 + DL & UL scheduling timing stats : 1.25 + UL Indication : 1.25 diff --git a/ci-scripts/datalog_rt_stats.yaml b/ci-scripts/datalog_rt_stats.default.yaml similarity index 100% rename from ci-scripts/datalog_rt_stats.yaml rename to ci-scripts/datalog_rt_stats.default.yaml diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 3a5a69573d..7a6b743d63 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -155,6 +155,11 @@ def GetParametersFromXML(action): elif action == 'Initialize_eNB': RAN.eNB_Trace=test.findtext('eNB_Trace') RAN.eNB_Stats=test.findtext('eNB_Stats') + datalog_rt_stats_file=test.findtext('rt_stats_cfg') + if datalog_rt_stats_file is None: + RAN.datalog_rt_stats_file='datalog_rt_stats.default.yaml' + else: + RAN.datalog_rt_stats_file=datalog_rt_stats_file RAN.Initialize_eNB_args=test.findtext('Initialize_eNB_args') eNB_instance=test.findtext('eNB_instance') USRPIPAddress=test.findtext('USRP_IPAddress') diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 4caa876719..f296ee368c 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -92,6 +92,7 @@ class RANManagement(): self.epcPcapFile = '' self.runtime_stats= '' self.datalog_rt_stats={} + self.datalog_rt_stats_file='datalog_rt_stats.default.yaml' self.eNB_Trace = '' #if 'yes', Tshark will be launched at initialization self.eNB_Stats = '' #if 'yes', Statistics Monitor will be launched at initialization self.USRPIPAddress = '' @@ -717,6 +718,9 @@ class RANManagement(): logStatus = self.AnalyzeLogFile_eNB(fileToAnalyze, HTML) if (logStatus < 0): HTML.CreateHtmlTestRow('N/A', 'KO', logStatus) + #display rt stats for gNB only + if len(self.datalog_rt_stats)!=0 and nodeB_prefix == 'g': + HTML.CreateHtmlDataLogTable(self.datalog_rt_stats) self.prematureExit = True self.eNBmbmsEnables[int(self.eNB_instance)] = False return @@ -802,6 +806,7 @@ class RANManagement(): #NSA specific log markers nsa_markers ={'SgNBReleaseRequestAcknowledge': [],'FAILURE': [], 'scgFailureInformationNR-r15': [], 'SgNBReleaseRequest': []} nodeB_prefix_found = False + RealTimeProcessingIssue = False line_cnt=0 #log file line counter for line in enb_log_file.readlines(): @@ -1003,7 +1008,7 @@ class RANManagement(): #the following part takes the *_stats.log files as source (not the stdout log file) #the datalog config file has to be loaded - datalog_rt_stats_file='datalog_rt_stats.yaml' + datalog_rt_stats_file=self.datalog_rt_stats_file if (os.path.isfile(datalog_rt_stats_file)): yaml_file=datalog_rt_stats_file elif (os.path.isfile('ci-scripts/'+datalog_rt_stats_file)): @@ -1120,8 +1125,7 @@ class RANManagement(): #check if there is a fail => will render the test as failed for k in datalog_rt_stats['Data']: if float(datalog_rt_stats['Data'][k][2])> datalog_rt_stats['Threshold'][k]: #condition for fail : avg/ref is greater than the fixed threshold - #setting prematureExit is ok although not the best option - self.prematureExit=False #temp for debug : do not stop the test if RT stats are excedeed + RealTimeProcessingIssue = True else: statMsg = 'No real time stats found in the log file\n' logging.debug('No real time stats found in the log file') @@ -1155,7 +1159,10 @@ class RANManagement(): logging.debug(statMsg) htmleNBFailureMsg += htmlMsg - + if RealTimeProcessingIssue: + logging.debug('\u001B[1;37;41m ' + nodeB_prefix + 'NB ended with real time processing issue! \u001B[0m') + htmleNBFailureMsg += 'Fail due to real time processing issue\n' + global_status = CONST.ENB_REAL_TIME_PROCESSING_ISSUE if uciStatMsgCount > 0: statMsg = nodeB_prefix + 'NB showed ' + str(uciStatMsgCount) + ' "uci->stat" message(s)' logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml index 045466a8ad..5c53bf5eed 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml @@ -79,6 +79,7 @@ 1 nr yes + datalog_rt_stats.2x2.yaml 192.168.18.240 diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml index 6fe23e022b..02544f273b 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml @@ -99,6 +99,7 @@ 1 nr yes + datalog_rt_stats.2x2.yaml 192.168.18.240 diff --git a/ci-scripts/xml_files/fr1_sa_quectel.xml b/ci-scripts/xml_files/fr1_sa_quectel.xml index 72b4c0a273..28c6b2e9e0 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel.xml @@ -64,6 +64,7 @@ nr yes yes + datalog_rt_stats.2x2.yaml 192.168.18.240 diff --git a/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml b/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml index f465b320b6..696ec790ff 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml @@ -64,6 +64,7 @@ nr yes yes + datalog_rt_stats.2x2.yaml 192.168.18.240 diff --git a/ci-scripts/xml_files/fr1_sa_quectel_stages.xml b/ci-scripts/xml_files/fr1_sa_quectel_stages.xml index dabe53f233..edc4440612 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel_stages.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel_stages.xml @@ -71,6 +71,7 @@ nr yes yes + datalog_rt_stats.2x2.yaml 192.168.18.240 diff --git a/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml b/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml index c28791e555..5feed75586 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml @@ -73,6 +73,7 @@ nr yes yes + datalog_rt_stats.2x2.yaml 192.168.18.240 From b2b95bb9ffafc932fd4baf31983fa5a77faa566a Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Fri, 21 Jan 2022 11:49:55 +0100 Subject: [PATCH 072/113] feat(ci): adding more 4G RF sim tests -- currently TDD not working Signed-off-by: Raphael Defosseux --- ci-scripts/cls_containerize.py | 43 ++- ci-scripts/main.py | 6 +- ...m.xml => container_4g_rfsim_fdd_05MHz.xml} | 19 +- ... => container_4g_rfsim_fdd_05MHz_down.xml} | 6 +- .../container_4g_rfsim_fdd_05MHz_noS1.xml | 109 +++++++ ...container_4g_rfsim_fdd_05MHz_noS1_down.xml | 38 +++ .../container_4g_rfsim_fdd_10MHz.xml | 129 +++++++++ .../container_4g_rfsim_fdd_10MHz_down.xml | 38 +++ .../container_4g_rfsim_fdd_20MHz.xml | 129 +++++++++ .../container_4g_rfsim_fdd_20MHz_down.xml | 38 +++ .../container_4g_rfsim_tdd_05MHz.xml | 130 +++++++++ .../container_4g_rfsim_tdd_05MHz_down.xml | 38 +++ .../README.md | 0 .../docker-compose.yml | 0 .../oai_db.cql | 0 .../docker-compose.yml | 75 +++++ .../docker-compose.yml | 272 ++++++++++++++++++ .../docker-compose.yml | 272 ++++++++++++++++++ .../docker-compose.yml | 271 +++++++++++++++++ 19 files changed, 1586 insertions(+), 27 deletions(-) rename ci-scripts/xml_files/{container_4g_rfsim.xml => container_4g_rfsim_fdd_05MHz.xml} (87%) rename ci-scripts/xml_files/{container_4g_rfsim_down.xml => container_4g_rfsim_fdd_05MHz_down.xml} (87%) create mode 100644 ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml create mode 100644 ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1_down.xml create mode 100644 ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml create mode 100644 ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz_down.xml create mode 100644 ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml create mode 100644 ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz_down.xml create mode 100644 ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml create mode 100644 ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz_down.xml rename ci-scripts/yaml_files/{4g_rfsimulator => 4g_rfsimulator_fdd_05MHz}/README.md (100%) rename ci-scripts/yaml_files/{4g_rfsimulator => 4g_rfsimulator_fdd_05MHz}/docker-compose.yml (100%) rename ci-scripts/yaml_files/{4g_rfsimulator => 4g_rfsimulator_fdd_05MHz}/oai_db.cql (100%) create mode 100644 ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz_noS1/docker-compose.yml create mode 100644 ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml create mode 100644 ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml create mode 100644 ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index ba5ce49e8d..37e22acc3c 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -715,7 +715,7 @@ class Containerize(): logging.debug(cmd) networkNames = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) - def UndeployGenObject(self, HTML, RAN): + def UndeployGenObject(self, HTML, RAN, UE): self.exitStatus = 0 ymlPath = self.yamlPath[0].split('/') logPath = '../cmake_targets/log/' + ymlPath[1] @@ -751,7 +751,7 @@ class Containerize(): logging.debug(cmd) deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) - # Analyzing log file! + # Analyzing log file(s)! listOfPossibleRanContainers = ['enb', 'gnb', 'cu', 'du'] for container in listOfPossibleRanContainers: filename = self.yamlPath[0] + '/rfsim?g-oai-' + container + '.log' @@ -766,7 +766,6 @@ class Containerize(): continue logging.debug('\u001B[1m Analyzing xNB logfile ' + filename + ' \u001B[0m') - # For the moment just assume this exists logStatus = RAN.AnalyzeLogFile_eNB(filename, HTML) if (logStatus < 0): fullStatus = False @@ -774,6 +773,27 @@ class Containerize(): else: HTML.CreateHtmlTestRow(RAN.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK) + listOfPossibleUeContainers = ['lte-ue*', 'nr-ue*'] + for container in listOfPossibleUeContainers: + filename = self.yamlPath[0] + '/rfsim?g-oai-' + container + '.log' + cmd = 'ls ' + filename + containerStatus = True + try: + lsStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) + filename = str(lsStatus).strip() + except: + containerStatus = False + if not containerStatus: + continue + + logging.debug('\u001B[1m Analyzing UE logfile ' + filename + ' \u001B[0m') + logStatus = UE.AnalyzeLogFile_UE(filename, HTML, RAN) + if (logStatus < 0): + fullStatus = False + HTML.CreateHtmlTestRow('UE log Analysis', 'KO', logStatus) + else: + HTML.CreateHtmlTestRow('UE log Analysis', 'OK', CONST.ALL_PROCESSES_OK) + cmd = 'rm ' + self.yamlPath[0] + '/*.log' logging.debug(cmd) deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) @@ -789,6 +809,7 @@ class Containerize(): cmd = 'sudo rm /tmp/capture_' + ymlPath[1] + '.pcap' logging.debug(cmd) copyStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) + self.tsharkStarted = False logging.debug('\u001B[1m Undeploying \u001B[0m') cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml down' @@ -814,7 +835,7 @@ class Containerize(): HTML.CreateHtmlTestRow('n/a', 'KO', CONST.ALL_PROCESSES_OK) logging.info('\u001B[1m Undeploying OAI Object(s) FAIL\u001B[0m') - def PingFromContainer(self, HTML): + def PingFromContainer(self, HTML, RAN, UE): self.exitStatus = 0 ymlPath = self.yamlPath[0].split('/') logPath = '../cmake_targets/log/' + ymlPath[1] @@ -828,17 +849,17 @@ class Containerize(): result = re.search(', (?P[0-9\.]+)% packet loss, time [0-9\.]+ms', deployStatus) if result is None: - self.PingExit(HTML, False, 'Packet Loss Not Found') + self.PingExit(HTML, RAN, UE, False, 'Packet Loss Not Found') return packetloss = result.group('packetloss') if float(packetloss) == 100: - self.PingExit(HTML, False, 'Packet Loss is 100%') + self.PingExit(HTML, RAN, UE, False, 'Packet Loss is 100%') return result = re.search('rtt min\/avg\/max\/mdev = (?P[0-9\.]+)\/(?P[0-9\.]+)\/(?P[0-9\.]+)\/[0-9\.]+ ms', deployStatus) if result is None: - self.PingExit(HTML, False, 'Ping RTT_Min RTT_Avg RTT_Max Not Found!') + self.PingExit(HTML, RAN, UE, False, 'Ping RTT_Min RTT_Avg RTT_Max Not Found!') return rtt_min = result.group('rtt_min') @@ -860,7 +881,7 @@ class Containerize(): packetLossOK = False elif float(packetloss) > 0: message += '\nPacket Loss is not 0%' - self.PingExit(HTML, packetLossOK, message) + self.PingExit(HTML, RAN, UE, packetLossOK, message) if packetLossOK: logging.debug('\u001B[1;37;44m ping result \u001B[0m') @@ -870,7 +891,7 @@ class Containerize(): logging.debug('\u001B[1;34m ' + max_msg + '\u001B[0m') logging.info('\u001B[1m Ping Test PASS\u001B[0m') - def PingExit(self, HTML, status, message): + def PingExit(self, HTML, RAN, UE, status, message): html_queue = SimpleQueue() html_cell = '
UE\n' + message + '
' html_queue.put(html_cell) @@ -885,10 +906,10 @@ class Containerize(): logging.debug('----------------------------------------') HTML.testCase_id = 'AUTO-UNDEPLOY' HTML.desc = 'Automatic Un-Deployment' - self.UndeployGenObject(HTML) + self.UndeployGenObject(HTML, RAN, UE) self.exitStatus = 1 - def IperfFromContainer(self, HTML): + def IperfFromContainer(self, HTML, RAN): self.exitStatus = 0 ymlPath = self.yamlPath[0].split('/') diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 5b5eec285c..b5a5e4db92 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -909,15 +909,15 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re if CONTAINERS.exitStatus==1: RAN.prematureExit = True elif action == 'UndeployGenObject': - CONTAINERS.UndeployGenObject(HTML, RAN) + CONTAINERS.UndeployGenObject(HTML, RAN, CiTestObj) if CONTAINERS.exitStatus==1: RAN.prematureExit = True elif action == 'PingFromContainer': - CONTAINERS.PingFromContainer(HTML) + CONTAINERS.PingFromContainer(HTML, RAN, CiTestObj) if CONTAINERS.exitStatus==1: RAN.prematureExit = True elif action == 'IperfFromContainer': - CONTAINERS.IperfFromContainer(HTML) + CONTAINERS.IperfFromContainer(HTML, RAN) if CONTAINERS.exitStatus==1: RAN.prematureExit = True else: diff --git a/ci-scripts/xml_files/container_4g_rfsim.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml similarity index 87% rename from ci-scripts/xml_files/container_4g_rfsim.xml rename to ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml index 2466f55800..fd254f1856 100644 --- a/ci-scripts/xml_files/container_4g_rfsim.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml @@ -21,10 +21,9 @@ --> - rfsim-4glte - Testing 4G LTE RF sim - Monolithic eNB + rfsim-4glte-fdd05mhz + Monolithic eNB - FDD 05MHz wrench - 2 100011 000011 @@ -46,7 +45,7 @@ DeployGenObject Deploy Cassandra Database - yaml_files/4g_rfsimulator + yaml_files/4g_rfsimulator_fdd_05MHz cassandra db_init 1 @@ -66,23 +65,23 @@ DeployGenObject Deploy OAI 4G CoreNetwork - yaml_files/4g_rfsimulator + yaml_files/4g_rfsimulator_fdd_05MHz oai_hss oai_mme oai_spgwc oai_spgwu trf_gen 6 DeployGenObject - Deploy OAI 4G eNB RF sim - yaml_files/4g_rfsimulator + Deploy OAI 4G eNB RF sim (FDD 05MHz) + yaml_files/4g_rfsimulator_fdd_05MHz enb 7 DeployGenObject - Deploy OAI 4G NR-UE RF sim - yaml_files/4g_rfsimulator + Deploy OAI 4G NR-UE RF sim (FDD 05MHz) + yaml_files/4g_rfsimulator_fdd_05MHz oai_ue0 8 @@ -124,7 +123,7 @@ UndeployGenObject Undeploy all OAI 4G stack - yaml_files/4g_rfsimulator + yaml_files/4g_rfsimulator_fdd_05MHz diff --git a/ci-scripts/xml_files/container_4g_rfsim_down.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_down.xml similarity index 87% rename from ci-scripts/xml_files/container_4g_rfsim_down.xml rename to ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_down.xml index 651447a9ca..1c3b1d5a7c 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_down.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_down.xml @@ -21,8 +21,8 @@ --> - rfsim-4glte-down - CleanUp 4G RF - Monolithic eNB + rfsim-4glte-fdd05mhz-down + CleanUp 4G RF trash 100011 @@ -32,7 +32,7 @@ UndeployGenObject Undeploy all OAI 4G stack - yaml_files/4g_rfsimulator + yaml_files/4g_rfsimulator_fdd_05MHz diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml new file mode 100644 index 0000000000..2ff9461b93 --- /dev/null +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml @@ -0,0 +1,109 @@ + + + rfsim-4glte-fdd05mhz-noS1 + Monolithic eNB - FDD 05MHz - noS1 + wrench + + 100011 + 000013 + 000001 + 000014 + 000002 + 020011 + 020012 + 030011 + 030012 + 100011 + + + + + IdleSleep + Sleep + 30 + + + + IdleSleep + Sleep + 10 + + + + DeployGenObject + Deploy OAI 4G eNB RF sim (FDD 05MHz) + yaml_files/4g_rfsimulator_fdd_05MHz_noS1 + enb + 1 + + + + DeployGenObject + Deploy OAI 4G NR-UE RF sim (FDD 05MHz) + yaml_files/4g_rfsimulator_fdd_05MHz_noS1 + oai_ue0 + 2 + + + + PingFromContainer + Ping Traffic-Gen from LTE-UE + rfsim4g-oai-lte-ue0 + -I oaitun_ue1 -c 20 10.0.1.1 + 5 + + + + PingFromContainer + Ping LTE-UE from eNB + rfsim4g-oai-enb + -I oaitun_enb1 -c 20 10.0.1.2 + 5 + + + + IperfFromContainer + Iperf UDP Downlink + rfsim4g-oai-lte-ue0 + rfsim4g-oai-enb + -B 10.0.1.2 -u -i 1 -s + -B 10.0.1.1 -c 10.0.1.2 -u -i 1 -t 30 -b 2M + + + + IperfFromContainer + Iperf UDP Uplink + rfsim4g-oai-enb + rfsim4g-oai-lte-ue0 + -B 10.0.1.1 -u -i 1 -s + -B 10.0.1.2 -c 10.0.1.1 -u -i 1 -t 30 -b 1M + + + + UndeployGenObject + Undeploy all OAI 4G stack + yaml_files/4g_rfsimulator_fdd_05MHz_noS1 + + + diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1_down.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1_down.xml new file mode 100644 index 0000000000..6db1dfd9de --- /dev/null +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1_down.xml @@ -0,0 +1,38 @@ + + + rfsim-4glte-fdd05mhz-nos1-down + CleanUp 4G RF + trash + + 100011 + + + + + UndeployGenObject + Undeploy all OAI 4G stack + yaml_files/4g_rfsimulator_fdd_05MHz_noS1 + + + diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml new file mode 100644 index 0000000000..f00e277c36 --- /dev/null +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml @@ -0,0 +1,129 @@ + + + rfsim-4glte-fdd10mhz + Monolithic eNB - FDD 10MHz + wrench + + 100011 + 000011 + 000001 + 000012 + 000002 + 000013 + 000001 + 000014 + 000002 + 020011 + 020012 + 030011 + 030012 + 100011 + + + + + DeployGenObject + Deploy Cassandra Database + yaml_files/4g_rfsimulator_fdd_10MHz + cassandra db_init + 1 + + + + IdleSleep + Sleep + 30 + + + + IdleSleep + Sleep + 10 + + + + DeployGenObject + Deploy OAI 4G CoreNetwork + yaml_files/4g_rfsimulator_fdd_10MHz + oai_hss oai_mme oai_spgwc oai_spgwu trf_gen + 6 + + + + DeployGenObject + Deploy OAI 4G eNB RF sim (FDD 10MHz) + yaml_files/4g_rfsimulator_fdd_10MHz + enb + 7 + + + + DeployGenObject + Deploy OAI 4G NR-UE RF sim (FDD 10MHz) + yaml_files/4g_rfsimulator_fdd_10MHz + oai_ue0 + 8 + + + + PingFromContainer + Ping Traffic-Gen from LTE-UE + rfsim4g-oai-lte-ue0 + -I oaitun_ue1 -c 20 192.168.61.11 + 5 + + + + PingFromContainer + Ping LTE-UE from Traffic-Gen + rfsim4g-trf-gen + -c 20 12.0.0.2 + 5 + + + + IperfFromContainer + Iperf UDP Downlink + rfsim4g-oai-lte-ue0 + rfsim4g-trf-gen + -B 12.0.0.2 -u -i 1 -s + -c 12.0.0.2 -u -i 1 -t 30 -b 2M + + + + IperfFromContainer + Iperf UDP Uplink + rfsim4g-trf-gen + rfsim4g-oai-lte-ue0 + -u -i 1 -s + -B 12.0.0.2 -c 192.168.61.11 -u -i 1 -t 30 -b 1M + + + + UndeployGenObject + Undeploy all OAI 4G stack + yaml_files/4g_rfsimulator_fdd_10MHz + + + diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz_down.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz_down.xml new file mode 100644 index 0000000000..7d03d56ff4 --- /dev/null +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz_down.xml @@ -0,0 +1,38 @@ + + + rfsim-4glte-fdd10mhz-down + CleanUp 4G RF + trash + + 100011 + + + + + UndeployGenObject + Undeploy all OAI 4G stack + yaml_files/4g_rfsimulator_fdd_10MHz + + + diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml new file mode 100644 index 0000000000..52e1ac7de1 --- /dev/null +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml @@ -0,0 +1,129 @@ + + + rfsim-4glte-fdd20mhz + Monolithic eNB - FDD 20MHz + wrench + + 100011 + 000011 + 000001 + 000012 + 000002 + 000013 + 000001 + 000014 + 000002 + 020011 + 020012 + 030011 + 030012 + 100011 + + + + + DeployGenObject + Deploy Cassandra Database + yaml_files/4g_rfsimulator_fdd_20MHz + cassandra db_init + 1 + + + + IdleSleep + Sleep + 30 + + + + IdleSleep + Sleep + 10 + + + + DeployGenObject + Deploy OAI 4G CoreNetwork + yaml_files/4g_rfsimulator_fdd_20MHz + oai_hss oai_mme oai_spgwc oai_spgwu trf_gen + 6 + + + + DeployGenObject + Deploy OAI 4G eNB RF sim (FDD 20MHz) + yaml_files/4g_rfsimulator_fdd_20MHz + enb + 7 + + + + DeployGenObject + Deploy OAI 4G NR-UE RF sim (FDD 20MHz) + yaml_files/4g_rfsimulator_fdd_20MHz + oai_ue0 + 8 + + + + PingFromContainer + Ping Traffic-Gen from LTE-UE + rfsim4g-oai-lte-ue0 + -I oaitun_ue1 -c 20 192.168.61.11 + 5 + + + + PingFromContainer + Ping LTE-UE from Traffic-Gen + rfsim4g-trf-gen + -c 20 12.0.0.2 + 5 + + + + IperfFromContainer + Iperf UDP Downlink + rfsim4g-oai-lte-ue0 + rfsim4g-trf-gen + -B 12.0.0.2 -u -i 1 -s + -c 12.0.0.2 -u -i 1 -t 30 -b 2M + + + + IperfFromContainer + Iperf UDP Uplink + rfsim4g-trf-gen + rfsim4g-oai-lte-ue0 + -u -i 1 -s + -B 12.0.0.2 -c 192.168.61.11 -u -i 1 -t 30 -b 1M + + + + UndeployGenObject + Undeploy all OAI 4G stack + yaml_files/4g_rfsimulator_fdd_20MHz + + + diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz_down.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz_down.xml new file mode 100644 index 0000000000..0a721c5091 --- /dev/null +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz_down.xml @@ -0,0 +1,38 @@ + + + rfsim-4glte-fdd20mhz-down + CleanUp 4G RF + trash + + 100011 + + + + + UndeployGenObject + Undeploy all OAI 4G stack + yaml_files/4g_rfsimulator_fdd_20MHz + + + diff --git a/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml new file mode 100644 index 0000000000..cdaee430ef --- /dev/null +++ b/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml @@ -0,0 +1,130 @@ + + + rfsim-4glte-tdd05mhz + Monolithic eNB - TDD 05MHz + wrench + 2 + + 100011 + 000011 + 000001 + 000012 + 000002 + 000013 + 000001 + 000014 + 000002 + 020011 + 020012 + 030011 + 030012 + 100011 + + + + + DeployGenObject + Deploy Cassandra Database + yaml_files/4g_rfsimulator_tdd_05MHz + cassandra db_init + 1 + + + + IdleSleep + Sleep + 30 + + + + IdleSleep + Sleep + 10 + + + + DeployGenObject + Deploy OAI 4G CoreNetwork + yaml_files/4g_rfsimulator_tdd_05MHz + oai_hss oai_mme oai_spgwc oai_spgwu trf_gen + 6 + + + + DeployGenObject + Deploy OAI 4G eNB RF sim (TDD 05MHz) + yaml_files/4g_rfsimulator_tdd_05MHz + enb + 7 + + + + DeployGenObject + Deploy OAI 4G NR-UE RF sim (TDD 05MHz) + yaml_files/4g_rfsimulator_tdd_05MHz + oai_ue0 + 8 + + + + PingFromContainer + Ping Traffic-Gen from LTE-UE + rfsim4g-oai-lte-ue0 + -I oaitun_ue1 -c 20 192.168.61.11 + 5 + + + + PingFromContainer + Ping LTE-UE from Traffic-Gen + rfsim4g-trf-gen + -c 20 12.0.0.2 + 5 + + + + IperfFromContainer + Iperf UDP Downlink + rfsim4g-oai-lte-ue0 + rfsim4g-trf-gen + -B 12.0.0.2 -u -i 1 -s + -c 12.0.0.2 -u -i 1 -t 30 -b 2M + + + + IperfFromContainer + Iperf UDP Uplink + rfsim4g-trf-gen + rfsim4g-oai-lte-ue0 + -u -i 1 -s + -B 12.0.0.2 -c 192.168.61.11 -u -i 1 -t 30 -b 1M + + + + UndeployGenObject + Undeploy all OAI 4G stack + yaml_files/4g_rfsimulator_tdd_05MHz + + + diff --git a/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz_down.xml b/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz_down.xml new file mode 100644 index 0000000000..7e27bac73c --- /dev/null +++ b/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz_down.xml @@ -0,0 +1,38 @@ + + + rfsim-4glte-tdd05mhz-down + CleanUp 4G RF + trash + + 100011 + + + + + UndeployGenObject + Undeploy all OAI 4G stack + yaml_files/4g_rfsimulator_tdd_05MHz + + + diff --git a/ci-scripts/yaml_files/4g_rfsimulator/README.md b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md similarity index 100% rename from ci-scripts/yaml_files/4g_rfsimulator/README.md rename to ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md diff --git a/ci-scripts/yaml_files/4g_rfsimulator/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml similarity index 100% rename from ci-scripts/yaml_files/4g_rfsimulator/docker-compose.yml rename to ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml diff --git a/ci-scripts/yaml_files/4g_rfsimulator/oai_db.cql b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/oai_db.cql similarity index 100% rename from ci-scripts/yaml_files/4g_rfsimulator/oai_db.cql rename to ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/oai_db.cql diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz_noS1/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz_noS1/docker-compose.yml new file mode 100644 index 0000000000..6e3916b8ca --- /dev/null +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz_noS1/docker-compose.yml @@ -0,0 +1,75 @@ +version: '3.8' + +services: + enb: + image: oai-enb:develop + privileged: true + container_name: rfsim4g-oai-enb + networks: + public_net: + ipv4_address: 192.168.61.20 + environment: + TZ: Europe/Paris + USE_FDD_MONO: 'yes' + RFSIMULATOR: enb + ENB_NAME: eNB-rf-sim + MCC: '208' + MNC: '96' + MNC_LENGTH: 2 + TAC: 1 + UTRA_BAND_ID: 7 + DL_FREQUENCY_IN_MHZ: 2680 + UL_FREQUENCY_OFFSET_IN_MHZ: 120 + NID_CELL: 10 + NB_PRB: 25 + MME_S1C_IP_ADDRESS: 192.168.61.3 + ENB_S1C_IF_NAME: eth0 + ENB_S1C_IP_ADDRESS: 192.168.61.20 + ENB_S1U_IF_NAME: eth0 + ENB_S1U_IP_ADDRESS: 192.168.61.20 + ENB_X2_IP_ADDRESS: 192.168.61.20 + FLEXRAN_ENABLED: 'no' + FLEXRAN_INTERFACE_NAME: eth0 + FLEXRAN_IPV4_ADDRESS: 192.168.61.10 + USE_ADDITIONAL_OPTIONS: --rfsim --log_config.global_log_options level,nocolor,time --noS1 + healthcheck: + test: /bin/bash -c "pgrep lte-softmodem" + interval: 10s + timeout: 5s + retries: 5 + + oai_ue0: + image: oai-lte-ue:develop + privileged: true + container_name: rfsim4g-oai-lte-ue0 + networks: + public_net: + ipv4_address: 192.168.61.30 + expose: + - "10000" + environment: + TZ: Europe/Paris + HOSTNAME: oai_ue0 + RFSIMULATOR: 192.168.61.20 + MCC: '208' + MNC: '96' + SHORT_IMSI: '0100000001' + LTE_KEY: 'fec86ba6eb707ed08905757b1bb44b8f' + OPC: 'c42449363bbad02b66d16bc975d77cc1' + MSISDN: '001011234561010' + HPLMN: 20896 + USE_ADDITIONAL_OPTIONS: --rfsim -C 2680000000 -r 25 --ue-rxgain 140 --ue-txgain 120 --nokrnmod 1 --log_config.global_log_options level,nocolor,time --noS1 + healthcheck: + test: /bin/bash -c "pgrep lte-uesoftmodem" + interval: 10s + timeout: 5s + retries: 5 + +networks: + public_net: + name: rfsim4g-oai-public-net + ipam: + config: + - subnet: 192.168.61.0/26 + driver_opts: + com.docker.network.bridge.name: "rfsim4g-public" diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml new file mode 100644 index 0000000000..4c1ceb424a --- /dev/null +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml @@ -0,0 +1,272 @@ +version: '3.8' + +services: + cassandra: + image: cassandra:2.1 + container_name: rfsim4g-cassandra + networks: + private_net: + ipv4_address: 192.168.68.2 + environment: + CASSANDRA_CLUSTER_NAME: "OAI HSS Cluster" + CASSANDRA_ENDPOINT_SNITCH: GossipingPropertyFileSnitch + healthcheck: + test: /bin/bash -c "nodetool status" + interval: 10s + timeout: 5s + retries: 5 + + db_init: + image: cassandra:2.1 + container_name: rfsim4g-db-init + depends_on: [cassandra] + deploy: + restart_policy: + condition: on-failure + max_attempts: 10 + networks: + private_net: + ipv4_address: 192.168.68.4 + volumes: + - ../4g_rfsimulator_fdd_05MHz/oai_db.cql:/home/oai_db.cql + entrypoint: /bin/bash -c "cqlsh --file /home/oai_db.cql 192.168.68.2 && echo 'OK'" + + oai_hss: + image: oai-hss:latest + container_name: rfsim4g-oai-hss + privileged: true + depends_on: [cassandra] + networks: + private_net: + ipv4_address: 192.168.68.3 + public_net: + ipv4_address: 192.168.61.2 + environment: + REALM: openairinterface.org + HSS_FQDN: hss.openairinterface.org + PREFIX: /openair-hss/etc + cassandra_Server_IP: 192.168.68.2 + OP_KEY: 1006020f0a478bf6b699f15c062e42b3 + LTE_K: fec86ba6eb707ed08905757b1bb44b8f + APN1: oai.ipv4 + APN2: internet + FIRST_IMSI: 208960100000001 + NB_USERS: 10 + healthcheck: + test: /bin/bash -c "pgrep oai_hss" + interval: 10s + timeout: 5s + retries: 5 + + oai_mme: + image: oai-mme:latest + container_name: rfsim4g-oai-mme + privileged: true + depends_on: [oai_hss] + networks: + public_net: + ipv4_address: 192.168.61.3 + environment: + REALM: openairinterface.org + PREFIX: /openair-mme/etc + INSTANCE: 1 + PID_DIRECTORY: /var/run + HSS_IP_ADDR: 192.168.61.2 + HSS_HOSTNAME: hss + HSS_FQDN: hss.openairinterface.org + HSS_REALM: openairinterface.org + MCC: '208' + MNC: '96' + MME_GID: 32768 + MME_CODE: 3 + TAC_0: 1 + TAC_1: 2 + TAC_2: 3 + MME_FQDN: mme.openairinterface.org + MME_S6A_IP_ADDR: 192.168.61.3 + MME_INTERFACE_NAME_FOR_S1_MME: eth0 + MME_IPV4_ADDRESS_FOR_S1_MME: 192.168.61.3 + MME_INTERFACE_NAME_FOR_S11: eth0 + MME_IPV4_ADDRESS_FOR_S11: 192.168.61.3 + MME_INTERFACE_NAME_FOR_S10: lo + MME_IPV4_ADDRESS_FOR_S10: 127.0.0.10 + OUTPUT: CONSOLE + SGW_IPV4_ADDRESS_FOR_S11_0: 192.168.61.4 + PEER_MME_IPV4_ADDRESS_FOR_S10_0: 0.0.0.0 + PEER_MME_IPV4_ADDRESS_FOR_S10_1: 0.0.0.0 + MCC_SGW_0: '208' + MNC3_SGW_0: '096' + TAC_LB_SGW_0: '01' + TAC_HB_SGW_0: '00' + MCC_MME_0: '208' + MNC3_MME_0: '096' + TAC_LB_MME_0: '02' + TAC_HB_MME_0: '00' + MCC_MME_1: '208' + MNC3_MME_1: '096' + TAC_LB_MME_1: '03' + TAC_HB_MME_1: '00' + TAC_LB_SGW_TEST_0: '03' + TAC_HB_SGW_TEST_0: '00' + SGW_IPV4_ADDRESS_FOR_S11_TEST_0: 0.0.0.0 + healthcheck: + test: /bin/bash -c "pgrep oai_mme" + interval: 10s + timeout: 5s + retries: 5 + + oai_spgwc: + image: oai-spgwc:latest + privileged: true + depends_on: [oai_mme] + container_name: rfsim4g-oai-spgwc + networks: + public_net: + ipv4_address: 192.168.61.4 + environment: + TZ: Europe/Paris + SGW_INTERFACE_NAME_FOR_S11: eth0 + PGW_INTERFACE_NAME_FOR_SX: eth0 + DEFAULT_DNS_IPV4_ADDRESS: 192.168.18.129 + DEFAULT_DNS_SEC_IPV4_ADDRESS: 8.8.4.4 + PUSH_PROTOCOL_OPTION: 'true' + APN_NI_1: oai.ipv4 + APN_NI_2: oai.ipv4_2 + DEFAULT_APN_NI_1: oai.ipv4 + UE_IP_ADDRESS_POOL_1: '12.0.0.2 - 12.0.0.254' + UE_IP_ADDRESS_POOL_2: '12.1.1.2 - 12.1.1.254' + MCC: '208' + MNC: '96' + MNC03: '096' + TAC: 1 + GW_ID: 1 + REALM: openairinterface.org + healthcheck: + test: /bin/bash -c "pgrep oai_spgwc" + interval: 10s + timeout: 5s + retries: 5 + + oai_spgwu: + image: oai-spgwu-tiny:latest + privileged: true + container_name: rfsim4g-oai-spgwu-tiny + depends_on: [oai_spgwc] + networks: + public_net: + ipv4_address: 192.168.61.5 + environment: + TZ: Europe/Paris + PID_DIRECTORY: /var/run + INSTANCE: 1 + SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP: eth0 + PGW_INTERFACE_NAME_FOR_SGI: eth0 + SGW_INTERFACE_NAME_FOR_SX: eth0 + SPGWC0_IP_ADDRESS: 192.168.61.4 + NETWORK_UE_IP: '12.0.0.0/24' + NETWORK_UE_NAT_OPTION: 'yes' + MCC: '208' + MNC: '96' + MNC03: '096' + TAC: 1 + GW_ID: 1 + REALM: openairinterface.org + healthcheck: + test: /bin/bash -c "pgrep oai_spgwu" + interval: 10s + timeout: 5s + retries: 5 + + trf_gen: + image: trf-gen:production + privileged: true + container_name: rfsim4g-trf-gen + networks: + public_net: + ipv4_address: 192.168.61.11 + entrypoint: /bin/bash -c "ip route add 12.0.0.0/24 via 192.168.61.5 dev eth0; sleep infinity" + healthcheck: + test: /bin/bash -c "ping -c 2 192.168.61.5" + interval: 10s + timeout: 5s + retries: 5 + + enb: + image: oai-enb:develop + privileged: true + container_name: rfsim4g-oai-enb + networks: + public_net: + ipv4_address: 192.168.61.20 + environment: + TZ: Europe/Paris + USE_FDD_MONO: 'yes' + RFSIMULATOR: enb + ENB_NAME: eNB-rf-sim + MCC: '208' + MNC: '96' + MNC_LENGTH: 2 + TAC: 1 + UTRA_BAND_ID: 7 + DL_FREQUENCY_IN_MHZ: 2680 + UL_FREQUENCY_OFFSET_IN_MHZ: 120 + NID_CELL: 10 + NB_PRB: 50 + MME_S1C_IP_ADDRESS: 192.168.61.3 + ENB_S1C_IF_NAME: eth0 + ENB_S1C_IP_ADDRESS: 192.168.61.20 + ENB_S1U_IF_NAME: eth0 + ENB_S1U_IP_ADDRESS: 192.168.61.20 + ENB_X2_IP_ADDRESS: 192.168.61.20 + FLEXRAN_ENABLED: 'no' + FLEXRAN_INTERFACE_NAME: eth0 + FLEXRAN_IPV4_ADDRESS: 192.168.61.10 + USE_ADDITIONAL_OPTIONS: --rfsim --log_config.global_log_options level,nocolor,time + healthcheck: + test: /bin/bash -c "pgrep lte-softmodem" + interval: 10s + timeout: 5s + retries: 5 + + oai_ue0: + image: oai-lte-ue:develop + privileged: true + container_name: rfsim4g-oai-lte-ue0 + networks: + public_net: + ipv4_address: 192.168.61.30 + expose: + - "10000" + environment: + TZ: Europe/Paris + HOSTNAME: oai_ue0 + RFSIMULATOR: 192.168.61.20 + MCC: '208' + MNC: '96' + SHORT_IMSI: '0100000001' + LTE_KEY: 'fec86ba6eb707ed08905757b1bb44b8f' + OPC: 'c42449363bbad02b66d16bc975d77cc1' + MSISDN: '001011234561010' + HPLMN: 20896 + USE_ADDITIONAL_OPTIONS: --rfsim -C 2680000000 -r 50 --ue-rxgain 140 --ue-txgain 120 --nokrnmod 1 --log_config.global_log_options level,nocolor,time + healthcheck: + test: /bin/bash -c "pgrep lte-uesoftmodem" + interval: 10s + timeout: 5s + retries: 5 + +networks: + private_net: + name: rfsim4g-oai-private-net + ipam: + config: + - subnet: 192.168.68.0/26 + driver_opts: + com.docker.network.bridge.name: "rfsim4g-private" + public_net: + name: rfsim4g-oai-public-net + ipam: + config: + - subnet: 192.168.61.0/26 + driver_opts: + com.docker.network.bridge.name: "rfsim4g-public" diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml new file mode 100644 index 0000000000..4a61181afb --- /dev/null +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml @@ -0,0 +1,272 @@ +version: '3.8' + +services: + cassandra: + image: cassandra:2.1 + container_name: rfsim4g-cassandra + networks: + private_net: + ipv4_address: 192.168.68.2 + environment: + CASSANDRA_CLUSTER_NAME: "OAI HSS Cluster" + CASSANDRA_ENDPOINT_SNITCH: GossipingPropertyFileSnitch + healthcheck: + test: /bin/bash -c "nodetool status" + interval: 10s + timeout: 5s + retries: 5 + + db_init: + image: cassandra:2.1 + container_name: rfsim4g-db-init + depends_on: [cassandra] + deploy: + restart_policy: + condition: on-failure + max_attempts: 10 + networks: + private_net: + ipv4_address: 192.168.68.4 + volumes: + - ../4g_rfsimulator_fdd_05MHz/oai_db.cql:/home/oai_db.cql + entrypoint: /bin/bash -c "cqlsh --file /home/oai_db.cql 192.168.68.2 && echo 'OK'" + + oai_hss: + image: oai-hss:latest + container_name: rfsim4g-oai-hss + privileged: true + depends_on: [cassandra] + networks: + private_net: + ipv4_address: 192.168.68.3 + public_net: + ipv4_address: 192.168.61.2 + environment: + REALM: openairinterface.org + HSS_FQDN: hss.openairinterface.org + PREFIX: /openair-hss/etc + cassandra_Server_IP: 192.168.68.2 + OP_KEY: 1006020f0a478bf6b699f15c062e42b3 + LTE_K: fec86ba6eb707ed08905757b1bb44b8f + APN1: oai.ipv4 + APN2: internet + FIRST_IMSI: 208960100000001 + NB_USERS: 10 + healthcheck: + test: /bin/bash -c "pgrep oai_hss" + interval: 10s + timeout: 5s + retries: 5 + + oai_mme: + image: oai-mme:latest + container_name: rfsim4g-oai-mme + privileged: true + depends_on: [oai_hss] + networks: + public_net: + ipv4_address: 192.168.61.3 + environment: + REALM: openairinterface.org + PREFIX: /openair-mme/etc + INSTANCE: 1 + PID_DIRECTORY: /var/run + HSS_IP_ADDR: 192.168.61.2 + HSS_HOSTNAME: hss + HSS_FQDN: hss.openairinterface.org + HSS_REALM: openairinterface.org + MCC: '208' + MNC: '96' + MME_GID: 32768 + MME_CODE: 3 + TAC_0: 1 + TAC_1: 2 + TAC_2: 3 + MME_FQDN: mme.openairinterface.org + MME_S6A_IP_ADDR: 192.168.61.3 + MME_INTERFACE_NAME_FOR_S1_MME: eth0 + MME_IPV4_ADDRESS_FOR_S1_MME: 192.168.61.3 + MME_INTERFACE_NAME_FOR_S11: eth0 + MME_IPV4_ADDRESS_FOR_S11: 192.168.61.3 + MME_INTERFACE_NAME_FOR_S10: lo + MME_IPV4_ADDRESS_FOR_S10: 127.0.0.10 + OUTPUT: CONSOLE + SGW_IPV4_ADDRESS_FOR_S11_0: 192.168.61.4 + PEER_MME_IPV4_ADDRESS_FOR_S10_0: 0.0.0.0 + PEER_MME_IPV4_ADDRESS_FOR_S10_1: 0.0.0.0 + MCC_SGW_0: '208' + MNC3_SGW_0: '096' + TAC_LB_SGW_0: '01' + TAC_HB_SGW_0: '00' + MCC_MME_0: '208' + MNC3_MME_0: '096' + TAC_LB_MME_0: '02' + TAC_HB_MME_0: '00' + MCC_MME_1: '208' + MNC3_MME_1: '096' + TAC_LB_MME_1: '03' + TAC_HB_MME_1: '00' + TAC_LB_SGW_TEST_0: '03' + TAC_HB_SGW_TEST_0: '00' + SGW_IPV4_ADDRESS_FOR_S11_TEST_0: 0.0.0.0 + healthcheck: + test: /bin/bash -c "pgrep oai_mme" + interval: 10s + timeout: 5s + retries: 5 + + oai_spgwc: + image: oai-spgwc:latest + privileged: true + depends_on: [oai_mme] + container_name: rfsim4g-oai-spgwc + networks: + public_net: + ipv4_address: 192.168.61.4 + environment: + TZ: Europe/Paris + SGW_INTERFACE_NAME_FOR_S11: eth0 + PGW_INTERFACE_NAME_FOR_SX: eth0 + DEFAULT_DNS_IPV4_ADDRESS: 192.168.18.129 + DEFAULT_DNS_SEC_IPV4_ADDRESS: 8.8.4.4 + PUSH_PROTOCOL_OPTION: 'true' + APN_NI_1: oai.ipv4 + APN_NI_2: oai.ipv4_2 + DEFAULT_APN_NI_1: oai.ipv4 + UE_IP_ADDRESS_POOL_1: '12.0.0.2 - 12.0.0.254' + UE_IP_ADDRESS_POOL_2: '12.1.1.2 - 12.1.1.254' + MCC: '208' + MNC: '96' + MNC03: '096' + TAC: 1 + GW_ID: 1 + REALM: openairinterface.org + healthcheck: + test: /bin/bash -c "pgrep oai_spgwc" + interval: 10s + timeout: 5s + retries: 5 + + oai_spgwu: + image: oai-spgwu-tiny:latest + privileged: true + container_name: rfsim4g-oai-spgwu-tiny + depends_on: [oai_spgwc] + networks: + public_net: + ipv4_address: 192.168.61.5 + environment: + TZ: Europe/Paris + PID_DIRECTORY: /var/run + INSTANCE: 1 + SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP: eth0 + PGW_INTERFACE_NAME_FOR_SGI: eth0 + SGW_INTERFACE_NAME_FOR_SX: eth0 + SPGWC0_IP_ADDRESS: 192.168.61.4 + NETWORK_UE_IP: '12.0.0.0/24' + NETWORK_UE_NAT_OPTION: 'yes' + MCC: '208' + MNC: '96' + MNC03: '096' + TAC: 1 + GW_ID: 1 + REALM: openairinterface.org + healthcheck: + test: /bin/bash -c "pgrep oai_spgwu" + interval: 10s + timeout: 5s + retries: 5 + + trf_gen: + image: trf-gen:production + privileged: true + container_name: rfsim4g-trf-gen + networks: + public_net: + ipv4_address: 192.168.61.11 + entrypoint: /bin/bash -c "ip route add 12.0.0.0/24 via 192.168.61.5 dev eth0; sleep infinity" + healthcheck: + test: /bin/bash -c "ping -c 2 192.168.61.5" + interval: 10s + timeout: 5s + retries: 5 + + enb: + image: oai-enb:develop + privileged: true + container_name: rfsim4g-oai-enb + networks: + public_net: + ipv4_address: 192.168.61.20 + environment: + TZ: Europe/Paris + USE_FDD_MONO: 'yes' + RFSIMULATOR: enb + ENB_NAME: eNB-rf-sim + MCC: '208' + MNC: '96' + MNC_LENGTH: 2 + TAC: 1 + UTRA_BAND_ID: 7 + DL_FREQUENCY_IN_MHZ: 2680 + UL_FREQUENCY_OFFSET_IN_MHZ: 120 + NID_CELL: 10 + NB_PRB: 100 + MME_S1C_IP_ADDRESS: 192.168.61.3 + ENB_S1C_IF_NAME: eth0 + ENB_S1C_IP_ADDRESS: 192.168.61.20 + ENB_S1U_IF_NAME: eth0 + ENB_S1U_IP_ADDRESS: 192.168.61.20 + ENB_X2_IP_ADDRESS: 192.168.61.20 + FLEXRAN_ENABLED: 'no' + FLEXRAN_INTERFACE_NAME: eth0 + FLEXRAN_IPV4_ADDRESS: 192.168.61.10 + USE_ADDITIONAL_OPTIONS: --rfsim --log_config.global_log_options level,nocolor,time + healthcheck: + test: /bin/bash -c "pgrep lte-softmodem" + interval: 10s + timeout: 5s + retries: 5 + + oai_ue0: + image: oai-lte-ue:develop + privileged: true + container_name: rfsim4g-oai-lte-ue0 + networks: + public_net: + ipv4_address: 192.168.61.30 + expose: + - "10000" + environment: + TZ: Europe/Paris + HOSTNAME: oai_ue0 + RFSIMULATOR: 192.168.61.20 + MCC: '208' + MNC: '96' + SHORT_IMSI: '0100000001' + LTE_KEY: 'fec86ba6eb707ed08905757b1bb44b8f' + OPC: 'c42449363bbad02b66d16bc975d77cc1' + MSISDN: '001011234561010' + HPLMN: 20896 + USE_ADDITIONAL_OPTIONS: --rfsim -C 2680000000 -r 100 --ue-rxgain 140 --ue-txgain 120 --nokrnmod 1 --log_config.global_log_options level,nocolor,time + healthcheck: + test: /bin/bash -c "pgrep lte-uesoftmodem" + interval: 10s + timeout: 5s + retries: 5 + +networks: + private_net: + name: rfsim4g-oai-private-net + ipam: + config: + - subnet: 192.168.68.0/26 + driver_opts: + com.docker.network.bridge.name: "rfsim4g-private" + public_net: + name: rfsim4g-oai-public-net + ipam: + config: + - subnet: 192.168.61.0/26 + driver_opts: + com.docker.network.bridge.name: "rfsim4g-public" diff --git a/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml new file mode 100644 index 0000000000..3424780791 --- /dev/null +++ b/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml @@ -0,0 +1,271 @@ +version: '3.8' + +services: + cassandra: + image: cassandra:2.1 + container_name: rfsim4g-cassandra + networks: + private_net: + ipv4_address: 192.168.68.2 + environment: + CASSANDRA_CLUSTER_NAME: "OAI HSS Cluster" + CASSANDRA_ENDPOINT_SNITCH: GossipingPropertyFileSnitch + healthcheck: + test: /bin/bash -c "nodetool status" + interval: 10s + timeout: 5s + retries: 5 + + db_init: + image: cassandra:2.1 + container_name: rfsim4g-db-init + depends_on: [cassandra] + deploy: + restart_policy: + condition: on-failure + max_attempts: 10 + networks: + private_net: + ipv4_address: 192.168.68.4 + volumes: + - ../4g_rfsimulator_fdd_05MHz/oai_db.cql:/home/oai_db.cql + entrypoint: /bin/bash -c "cqlsh --file /home/oai_db.cql 192.168.68.2 && echo 'OK'" + + oai_hss: + image: oai-hss:latest + container_name: rfsim4g-oai-hss + privileged: true + depends_on: [cassandra] + networks: + private_net: + ipv4_address: 192.168.68.3 + public_net: + ipv4_address: 192.168.61.2 + environment: + REALM: openairinterface.org + HSS_FQDN: hss.openairinterface.org + PREFIX: /openair-hss/etc + cassandra_Server_IP: 192.168.68.2 + OP_KEY: 1006020f0a478bf6b699f15c062e42b3 + LTE_K: fec86ba6eb707ed08905757b1bb44b8f + APN1: oai.ipv4 + APN2: internet + FIRST_IMSI: 208960100000001 + NB_USERS: 10 + healthcheck: + test: /bin/bash -c "pgrep oai_hss" + interval: 10s + timeout: 5s + retries: 5 + + oai_mme: + image: oai-mme:latest + container_name: rfsim4g-oai-mme + privileged: true + depends_on: [oai_hss] + networks: + public_net: + ipv4_address: 192.168.61.3 + environment: + REALM: openairinterface.org + PREFIX: /openair-mme/etc + INSTANCE: 1 + PID_DIRECTORY: /var/run + HSS_IP_ADDR: 192.168.61.2 + HSS_HOSTNAME: hss + HSS_FQDN: hss.openairinterface.org + HSS_REALM: openairinterface.org + MCC: '208' + MNC: '96' + MME_GID: 32768 + MME_CODE: 3 + TAC_0: 1 + TAC_1: 2 + TAC_2: 3 + MME_FQDN: mme.openairinterface.org + MME_S6A_IP_ADDR: 192.168.61.3 + MME_INTERFACE_NAME_FOR_S1_MME: eth0 + MME_IPV4_ADDRESS_FOR_S1_MME: 192.168.61.3 + MME_INTERFACE_NAME_FOR_S11: eth0 + MME_IPV4_ADDRESS_FOR_S11: 192.168.61.3 + MME_INTERFACE_NAME_FOR_S10: lo + MME_IPV4_ADDRESS_FOR_S10: 127.0.0.10 + OUTPUT: CONSOLE + SGW_IPV4_ADDRESS_FOR_S11_0: 192.168.61.4 + PEER_MME_IPV4_ADDRESS_FOR_S10_0: 0.0.0.0 + PEER_MME_IPV4_ADDRESS_FOR_S10_1: 0.0.0.0 + MCC_SGW_0: '208' + MNC3_SGW_0: '096' + TAC_LB_SGW_0: '01' + TAC_HB_SGW_0: '00' + MCC_MME_0: '208' + MNC3_MME_0: '096' + TAC_LB_MME_0: '02' + TAC_HB_MME_0: '00' + MCC_MME_1: '208' + MNC3_MME_1: '096' + TAC_LB_MME_1: '03' + TAC_HB_MME_1: '00' + TAC_LB_SGW_TEST_0: '03' + TAC_HB_SGW_TEST_0: '00' + SGW_IPV4_ADDRESS_FOR_S11_TEST_0: 0.0.0.0 + healthcheck: + test: /bin/bash -c "pgrep oai_mme" + interval: 10s + timeout: 5s + retries: 5 + + oai_spgwc: + image: oai-spgwc:latest + privileged: true + depends_on: [oai_mme] + container_name: rfsim4g-oai-spgwc + networks: + public_net: + ipv4_address: 192.168.61.4 + environment: + TZ: Europe/Paris + SGW_INTERFACE_NAME_FOR_S11: eth0 + PGW_INTERFACE_NAME_FOR_SX: eth0 + DEFAULT_DNS_IPV4_ADDRESS: 192.168.18.129 + DEFAULT_DNS_SEC_IPV4_ADDRESS: 8.8.4.4 + PUSH_PROTOCOL_OPTION: 'true' + APN_NI_1: oai.ipv4 + APN_NI_2: oai.ipv4_2 + DEFAULT_APN_NI_1: oai.ipv4 + UE_IP_ADDRESS_POOL_1: '12.0.0.2 - 12.0.0.254' + UE_IP_ADDRESS_POOL_2: '12.1.1.2 - 12.1.1.254' + MCC: '208' + MNC: '96' + MNC03: '096' + TAC: 1 + GW_ID: 1 + REALM: openairinterface.org + healthcheck: + test: /bin/bash -c "pgrep oai_spgwc" + interval: 10s + timeout: 5s + retries: 5 + + oai_spgwu: + image: oai-spgwu-tiny:latest + privileged: true + container_name: rfsim4g-oai-spgwu-tiny + depends_on: [oai_spgwc] + networks: + public_net: + ipv4_address: 192.168.61.5 + environment: + TZ: Europe/Paris + PID_DIRECTORY: /var/run + INSTANCE: 1 + SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP: eth0 + PGW_INTERFACE_NAME_FOR_SGI: eth0 + SGW_INTERFACE_NAME_FOR_SX: eth0 + SPGWC0_IP_ADDRESS: 192.168.61.4 + NETWORK_UE_IP: '12.0.0.0/24' + NETWORK_UE_NAT_OPTION: 'yes' + MCC: '208' + MNC: '96' + MNC03: '096' + TAC: 1 + GW_ID: 1 + REALM: openairinterface.org + healthcheck: + test: /bin/bash -c "pgrep oai_spgwu" + interval: 10s + timeout: 5s + retries: 5 + + trf_gen: + image: trf-gen:production + privileged: true + container_name: rfsim4g-trf-gen + networks: + public_net: + ipv4_address: 192.168.61.11 + entrypoint: /bin/bash -c "ip route add 12.0.0.0/24 via 192.168.61.5 dev eth0; sleep infinity" + healthcheck: + test: /bin/bash -c "ping -c 2 192.168.61.5" + interval: 10s + timeout: 5s + retries: 5 + + enb: + image: oai-enb:develop + privileged: true + container_name: rfsim4g-oai-enb + networks: + public_net: + ipv4_address: 192.168.61.20 + environment: + TZ: Europe/Paris + USE_TDD_MONO: 'yes' + RFSIMULATOR: enb + ENB_NAME: eNB-rf-sim + MCC: '208' + MNC: '96' + MNC_LENGTH: 2 + TAC: 1 + UTRA_BAND_ID: 38 + DL_FREQUENCY_IN_MHZ: 2605 + UL_FREQUENCY_OFFSET_IN_MHZ: 0 + NID_CELL: 10 + NB_PRB: 25 + MME_S1C_IP_ADDRESS: 192.168.61.3 + S1C_IF_NAME: eth0 + F1_CU_IP_ADDRESS: 192.168.61.20 + S1U_IF_NAME: eth0 + F1_CU_IP_ADDRESS: 192.168.61.20 + FLEXRAN_ENABLED: 'no' + FLEXRAN_INTERFACE_NAME: eth0 + FLEXRAN_IPV4_ADDRESS: 192.168.61.10 + USE_ADDITIONAL_OPTIONS: --rfsim --log_config.global_log_options level,nocolor,time + healthcheck: + test: /bin/bash -c "pgrep lte-softmodem" + interval: 10s + timeout: 5s + retries: 5 + + oai_ue0: + image: oai-lte-ue:develop + privileged: true + container_name: rfsim4g-oai-lte-ue0 + networks: + public_net: + ipv4_address: 192.168.61.30 + expose: + - "10000" + environment: + TZ: Europe/Paris + HOSTNAME: oai_ue0 + RFSIMULATOR: 192.168.61.20 + MCC: '208' + MNC: '96' + SHORT_IMSI: '0100000001' + LTE_KEY: 'fec86ba6eb707ed08905757b1bb44b8f' + OPC: 'c42449363bbad02b66d16bc975d77cc1' + MSISDN: '001011234561010' + HPLMN: 20896 + USE_ADDITIONAL_OPTIONS: --rfsim -T -C 2605000000 -r 25 --ue-rxgain 140 --ue-txgain 120 --nokrnmod 1 --log_config.global_log_options level,nocolor,time + healthcheck: + test: /bin/bash -c "pgrep lte-uesoftmodem" + interval: 10s + timeout: 5s + retries: 5 + +networks: + private_net: + name: rfsim4g-oai-private-net + ipam: + config: + - subnet: 192.168.68.0/26 + driver_opts: + com.docker.network.bridge.name: "rfsim4g-private" + public_net: + name: rfsim4g-oai-public-net + ipam: + config: + - subnet: 192.168.61.0/26 + driver_opts: + com.docker.network.bridge.name: "rfsim4g-public" From 70b93d0901ff6258890b9c0f3a5e11abea99bdb3 Mon Sep 17 00:00:00 2001 From: hardy Date: Thu, 20 Jan 2022 14:55:14 +0100 Subject: [PATCH 073/113] fix git post in one block for NSA test seq --- ci-scripts/Jenkinsfile-trig-nsa | 49 ++++++++++++++------------------- 1 file changed, 20 insertions(+), 29 deletions(-) diff --git a/ci-scripts/Jenkinsfile-trig-nsa b/ci-scripts/Jenkinsfile-trig-nsa index bf2797572e..69391a5a5f 100644 --- a/ci-scripts/Jenkinsfile-trig-nsa +++ b/ci-scripts/Jenkinsfile-trig-nsa @@ -28,7 +28,6 @@ def pythonExecutor = params.pythonExecutor def TARGET_BRANCH = "develop" def ALLOW_MERGE = true def GitPostArgs = '' -def DataBaseHost = params.DataBaseHost def jobStatus pipeline { @@ -72,7 +71,7 @@ pipeline { //calling NSA B200 jobName = "RAN-NSA-B200-Module-LTEBOX" jobStatus = build job: jobName, wait : true, propagate : false, parameters: [ - string(name: 'eNB_MR', value: String.valueOf(MR)), + string(name: 'eNB_MR', value: String.valueOf(MR)), string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), @@ -116,21 +115,21 @@ pipeline { //calling OAIUE B200 - //build job: "RAN-SA-OAIUE-B200-CN5G", wait : true, propagate : false, parameters: [ - // string(name: 'eNB_MR', value: String.valueOf(MR)), - // string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), - // string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), - // string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), - // booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) - //] + build job: "RAN-SA-OAIUE-B200-CN5G", wait : true, propagate : false, parameters: [ + string(name: 'eNB_MR', value: String.valueOf(MR)), + string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), + string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), + string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), + booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) + ] //calling OAIUE N310 - //build job: "RAN-SA-OAIUE-N310-CN5G", wait : true, propagate : false, parameters: [ - // string(name: 'eNB_MR', value: String.valueOf(MR)), - // string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), - // string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), - // string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), - // booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) - //] + build job: "RAN-SA-OAIUE-N310-CN5G", wait : true, propagate : false, parameters: [ + string(name: 'eNB_MR', value: String.valueOf(MR)), + string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), + string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), + string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), + booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) + ] //calling OAIUE N310-X300 jobName = "RAN-SA-OAIUE-N310-X300-CN5G" @@ -146,23 +145,15 @@ pipeline { build_id = jobStatus.getNumber().toString() GitPostArgs += jobName + ' ' + build_url + ' ' + build_id + ' ' + jobResult + ' ' echo GitPostArgs + + //git report the test results in 1 block, at the end of the test sequence of one MR + dir ('ci-scripts/ran_dashboard') { + sh "python3 Hdashboard.py gitpost ${GitPostArgs}" + } } } } } - stage ('Git Post') { - when { - expression { params.DataBaseHost != "none" } - } - agent {label DataBaseHost} - steps { - script { - dir ('ci-scripts/ran_dashboard') { - sh "python3 Hdashboard.py gitpost ${GitPostArgs}" - } - } - } - } } } From 4fb330e4cc2fee53bda96c63a144600ec9bec5db Mon Sep 17 00:00:00 2001 From: Sofia Pison Date: Fri, 21 Jan 2022 14:27:40 +0100 Subject: [PATCH 074/113] Modified CMakeLists to enable the run with address sanitizer without specifying LD_LIBRARY_PATH --- cmake_targets/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index f2eda66fc0..7160a52620 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -343,8 +343,8 @@ set(CMAKE_CXX_FLAGS if (SANITIZE_ADDRESS) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-common") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-common") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer -static-libasan -fno-common") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -static-libasan -fno-common") endif () add_definitions("-DASN_DISABLE_OER_SUPPORT") From ecdb8ee05fbfbab32c7e69528f65bd7cafb0c08e Mon Sep 17 00:00:00 2001 From: hardy Date: Sat, 22 Jan 2022 09:07:46 +0100 Subject: [PATCH 075/113] clean/remove unused tests from scheduled tests (2x2) sequence --- ci-scripts/Jenkinsfile-trig-nsa | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/ci-scripts/Jenkinsfile-trig-nsa b/ci-scripts/Jenkinsfile-trig-nsa index 69391a5a5f..772b34231a 100644 --- a/ci-scripts/Jenkinsfile-trig-nsa +++ b/ci-scripts/Jenkinsfile-trig-nsa @@ -113,24 +113,6 @@ pipeline { GitPostArgs += jobName + ' ' + build_url + ' ' + build_id + ' ' + jobResult + ' ' echo GitPostArgs - - //calling OAIUE B200 - build job: "RAN-SA-OAIUE-B200-CN5G", wait : true, propagate : false, parameters: [ - string(name: 'eNB_MR', value: String.valueOf(MR)), - string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), - string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), - string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), - booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) - ] - //calling OAIUE N310 - build job: "RAN-SA-OAIUE-N310-CN5G", wait : true, propagate : false, parameters: [ - string(name: 'eNB_MR', value: String.valueOf(MR)), - string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), - string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), - string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), - booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) - ] - //calling OAIUE N310-X300 jobName = "RAN-SA-OAIUE-N310-X300-CN5G" jobStatus = build job: jobName, wait : true, propagate : false, parameters: [ From cb06ce6a3bb0e5e18038bf4cc474985a83a3a0ee Mon Sep 17 00:00:00 2001 From: hardy Date: Mon, 24 Jan 2022 10:53:22 +0100 Subject: [PATCH 076/113] fix conf file for LTE 2x2 TM2 --- .../conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf index 15a2e6ac1d..f116c3708d 100644 --- a/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf @@ -36,7 +36,7 @@ eNBs = Nid_cell = 0; N_RB_DL = 100; Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; + nb_antenna_ports = 2; nb_antennas_tx = 2; nb_antennas_rx = 2; tx_gain = 90; From 13a16bc29f4a89252eb7af74756c89aaa1ee028e Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Mon, 24 Jan 2022 14:59:12 +0100 Subject: [PATCH 077/113] remove separate dir from phy_simulators binaries and compile options --- ci-scripts/cls_physim.py | 2 +- cmake_targets/build_oai | 17 +++++++-------- .../install_external_packages.ubuntu20 | 1 - cmake_targets/phy_simulators | 1 + cmake_targets/phy_simulators/CMakeLists.txt | 21 ------------------- cmake_targets/tools/build_helper | 2 +- doc/BUILD.md | 2 +- docker/Dockerfile.phySim.rhel8.2 | 8 +++---- 8 files changed, 15 insertions(+), 39 deletions(-) create mode 120000 cmake_targets/phy_simulators delete mode 100755 cmake_targets/phy_simulators/CMakeLists.txt diff --git a/ci-scripts/cls_physim.py b/ci-scripts/cls_physim.py index e825b2f7bd..33792f6ca4 100644 --- a/ci-scripts/cls_physim.py +++ b/ci-scripts/cls_physim.py @@ -183,7 +183,7 @@ class PhySim: mySSH.open(self.eNBIpAddr, self.eNBUserName, self.eNBPassWord) mySSH.command('cd '+self.__workSpacePath,'\$',5) #run and redirect the results to a log file - mySSH.command(self.__workSpacePath+'phy_simulators/build/ldpctest ' + self.runargs + ' >> '+self.__runLogFile, '\$', 30) + mySSH.command(self.__workSpacePath+'ran_build/build/ldpctest ' + self.runargs + ' >> '+self.__runLogFile, '\$', 30) mySSH.close() #return updated HTML to main lHTML = html.HTMLManagement() diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 68aef48c6b..2ffc4a7a08 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -57,7 +57,7 @@ BUILD_DOXYGEN=0 BUILD_COVERITY_SCAN=0 T_TRACER="True" DISABLE_HARDWARE_DEPENDENCY="False" -CMAKE_BUILD_TYPE="" +CMAKE_BUILD_TYPE="RelWithDebInfo" CMAKE_CMD="$CMAKE" UE_AUTOTEST_TRACE="False" UE_DEBUG_TRACE="False" @@ -585,15 +585,12 @@ function main() { echo_info "3. building the compilation directives ..." DIR=$OPENAIR_DIR/cmake_targets - if [ "$SIMUS_PHY" = "1" -o "$SIMUS_CORE" = "1" ] ; then - build_dir=phy_simulators - else - if [ "$T_TRACER" = "False" ] ; then + if [ "$T_TRACER" = "False" ] ; then build_dir=ran_build_noLOG - else + else build_dir=ran_build - fi fi + [ "$CLEAN" = "1" ] && rm -rf $DIR/$build_dir/build mkdir -p $DIR/$build_dir/build @@ -742,11 +739,11 @@ function main() { # simlist="ldpctest" for f in $simlist ; do compilations \ - phy_simulators $f \ + ran_build $f \ $f $dbin/$f.$REL done compilations \ - phy_simulators coding \ + ran_build coding \ libcoding.so $dbin/libcoding.so # compilations \ # lte-simulators $config_libconfig_shlib \ @@ -761,7 +758,7 @@ function main() { simlist="secu_knas_encrypt_eia1 secu_kenb aes128_ctr_encrypt aes128_ctr_decrypt secu_knas_encrypt_eea2 secu_knas secu_knas_encrypt_eea1 kdf aes128_cmac_encrypt secu_knas_encrypt_eia2" for f in $simlist ; do compilations \ - phy_simulators test_$f \ + ran_build test_$f \ test_$f $dbin/test_$f.$REL done fi diff --git a/cmake_targets/install_external_packages.ubuntu20 b/cmake_targets/install_external_packages.ubuntu20 index 0023c8d3c8..ebbfb5ada9 100755 --- a/cmake_targets/install_external_packages.ubuntu20 +++ b/cmake_targets/install_external_packages.ubuntu20 @@ -134,7 +134,6 @@ clean_all_files() { rm -rf "$dir"/ran_build/build rm -rf "$dir"/ran_build_noLOG/build rm -rf "$dir"/lte-simulators/build - rm -rf "$dir"/phy_simulators/build rm -rf "$dir"/nas_sim_tools/build rm -rf "$dir"/oaisim_build_oai/build rm -rf "$dir"/oaisim_build_oai/CMakeLists.txt diff --git a/cmake_targets/phy_simulators b/cmake_targets/phy_simulators new file mode 120000 index 0000000000..2a12e92f3e --- /dev/null +++ b/cmake_targets/phy_simulators @@ -0,0 +1 @@ +ran_build/ \ No newline at end of file diff --git a/cmake_targets/phy_simulators/CMakeLists.txt b/cmake_targets/phy_simulators/CMakeLists.txt deleted file mode 100755 index f8c659959f..0000000000 --- a/cmake_targets/phy_simulators/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -project (OpenAirInterface) -set ( CMAKE_BUILD_TYPE ) -set ( CFLAGS_PROCESSOR_USER "" ) -set ( UE_EXPANSION False ) -set ( PRE_SCD_THREAD False ) -set ( ENABLE_VCD_FIFO False ) -set ( RF_BOARD "None") -set ( TRANSP_PRO "None") -set ( PACKAGE_NAME "") -set ( DEADLINE_SCHEDULER "False" ) -set ( CPU_AFFINITY "False" ) -set ( T_TRACER True ) -set ( UE_AUTOTEST_TRACE False ) -set ( UE_DEBUG_TRACE False ) -set ( UE_TIMING_TRACE False ) -set ( USRP_REC_PLAY False ) -set ( SKIP_SHARED_LIB_FLAG False ) -set ( PHYSIM True) -set ( RU 0) -include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 1df7808b0f..ec5de6a0d1 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -168,7 +168,7 @@ clean_all_files() { rm -rf $dir/log $OPENAIR_DIR/targets/bin/* rm -rf $dir/ran_build $dir/ran_build_noLOG rm -rf $dir/lte-simulators/build - rm -rf $dir/phy_simulators/build $dir/nas_sim_tools/build + rm -rf $dir/nas_sim_tools/build rm -rf $dir/oaisim_build_oai/build $dir/oaisim_build_oai/CMakeLists.txt rm -rf $dir/autotests/bin $dir/autotests/log $dir/autotests/*/build } diff --git a/doc/BUILD.md b/doc/BUILD.md index 40b63ac697..852a248659 100644 --- a/doc/BUILD.md +++ b/doc/BUILD.md @@ -60,7 +60,7 @@ cd cmake_targets/ ./build_oai -I --phy_simulators ``` -After completing the build, the binaries are available in the cmake_targets/phy_simulators/build directory. +After completing the build, the binaries are available in the cmake_targets/ran_build/build directory. A copy is also available in the target/bin directory, with all binaries suffixed by the 3GPP release number, today **.Rel15**. diff --git a/docker/Dockerfile.phySim.rhel8.2 b/docker/Dockerfile.phySim.rhel8.2 index 141a80cb50..9f4b27ec0e 100644 --- a/docker/Dockerfile.phySim.rhel8.2 +++ b/docker/Dockerfile.phySim.rhel8.2 @@ -85,10 +85,10 @@ COPY --from=phy-sim-build \ /lib64/liblapack.so.3 \ /lib64/libexslt.so.0 \ /lib64/libxslt.so.1 \ - /oai-ran/cmake_targets/phy_simulators/build/libdfts.so \ - /oai-ran/cmake_targets/phy_simulators/build/libSIMU.so \ - /oai-ran/cmake_targets/phy_simulators/build/libldpc.so \ - /oai-ran/cmake_targets/phy_simulators/build/libldpc_orig.so \ + /oai-ran/cmake_targets/ran_build/build/libdfts.so \ + /oai-ran/cmake_targets/ran_build/build/libSIMU.so \ + /oai-ran/cmake_targets/ran_build/build/libldpc.so \ + /oai-ran/cmake_targets/ran_build/build/libldpc_orig.so \ /usr/local/lib/ RUN ldconfig From 504c529c205ebf15fd773ef708b05654d0a4bd7a Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Mon, 24 Jan 2022 15:27:08 +0100 Subject: [PATCH 078/113] small optimisation in build_oai script --- cmake_targets/build_oai | 130 +++++++++++++++++++--------------------- 1 file changed, 62 insertions(+), 68 deletions(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 2ffc4a7a08..92bcfd88e2 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -598,84 +598,81 @@ function main() { config_libconfig_shlib=params_libconfig # first generate the CMakefile in the right directory - if [ "$eNB" = "1" -o "$eNBocp" = "1" -o "$UE" = "1" -o "$gNB" = "1" -o "$RU" = "1" -o "$nrUE" = "1" -o "$HW" = "EXMIMO" -o "$ittiSIM" = "1" -o "$rfsimNas" = "1" ] ; then + # softmodem compilation + + cmake_file=$DIR/$build_dir/CMakeLists.txt + echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file + echo "project (OpenAirInterface)" >> $cmake_file + echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file + echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file + echo "set ( UE_EXPANSION $UE_EXPANSION )" >> $cmake_file + # echo "set ( PHY_TX_THREAD $UE_EXPANSION )" >> $cmake_file + echo "set ( PRE_SCD_THREAD $UE_EXPANSION )" >> $cmake_file + echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file + echo "set ( RF_BOARD \"${HW}\")" >> $cmake_file + echo "set ( TRANSP_PRO \"${TP}\")" >> $cmake_file + echo "set ( PACKAGE_NAME \"${exec}\")" >> $cmake_file + echo "set ( DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )" >> $cmake_file + echo "set ( CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >> $cmake_file + echo "set ( T_TRACER $T_TRACER )" >> $cmake_file + echo "set ( UE_AUTOTEST_TRACE $UE_AUTOTEST_TRACE )" >> $cmake_file + echo "set ( UE_DEBUG_TRACE $UE_DEBUG_TRACE )" >> $cmake_file + echo "set ( UE_TIMING_TRACE $UE_TIMING_TRACE )" >> $cmake_file + echo "set ( USRP_REC_PLAY $USRP_REC_PLAY )" >> $cmake_file + echo "set ( SKIP_SHARED_LIB_FLAG $SKIP_SHARED_LIB_FLAG )" >> $cmake_file + echo "set ( ITTI_SIM $ITTI_SIM )" >> $cmake_file + echo "set ( SANITIZE_ADDRESS $SANITIZE_ADDRESS )" >> $cmake_file + echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file + cd $DIR/$build_dir/build + eval $CMAKE_CMD - # softmodem compilation - - cmake_file=$DIR/$build_dir/CMakeLists.txt - echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file - echo "project (OpenAirInterface)" >> $cmake_file - echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file - echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file - echo "set ( UE_EXPANSION $UE_EXPANSION )" >> $cmake_file -# echo "set ( PHY_TX_THREAD $UE_EXPANSION )" >> $cmake_file - echo "set ( PRE_SCD_THREAD $UE_EXPANSION )" >> $cmake_file - echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file - echo "set ( RF_BOARD \"${HW}\")" >> $cmake_file - echo "set ( TRANSP_PRO \"${TP}\")" >> $cmake_file - echo "set ( PACKAGE_NAME \"${exec}\")" >> $cmake_file - echo "set ( DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )" >> $cmake_file - echo "set ( CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >> $cmake_file - echo "set ( T_TRACER $T_TRACER )" >> $cmake_file - echo "set ( UE_AUTOTEST_TRACE $UE_AUTOTEST_TRACE )" >> $cmake_file - echo "set ( UE_DEBUG_TRACE $UE_DEBUG_TRACE )" >> $cmake_file - echo "set ( UE_TIMING_TRACE $UE_TIMING_TRACE )" >> $cmake_file - echo "set ( USRP_REC_PLAY $USRP_REC_PLAY )" >> $cmake_file - echo "set ( SKIP_SHARED_LIB_FLAG $SKIP_SHARED_LIB_FLAG )" >> $cmake_file - echo "set ( ITTI_SIM $ITTI_SIM )" >> $cmake_file - echo "set ( SANITIZE_ADDRESS $SANITIZE_ADDRESS )" >> $cmake_file - echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file - cd $DIR/$build_dir/build - eval $CMAKE_CMD - - execlist="" - if [ "$eNB" = "1" ] ; then + execlist="" + if [ "$eNB" = "1" ] ; then execlist="$execlist lte-softmodem" - fi - if [ "$eNBocp" = "1" ] ; then + fi + if [ "$eNBocp" = "1" ] ; then execlist="$execlist ocp-enb" - fi - if [ "$gNB" = "1" ] ; then + fi + if [ "$gNB" = "1" ] ; then execlist="$execlist nr-softmodem" - fi - if [ "$RU" = "1" ] ; then + fi + if [ "$RU" = "1" ] ; then execlist="$execlist oairu" - fi - if [ "$UE" = 1 ] ; then + fi + if [ "$UE" = 1 ] ; then execlist="$execlist lte-uesoftmodem" - fi - if [ "$nrUE" = 1 ] ; then + fi + if [ "$nrUE" = 1 ] ; then execlist="$execlist nr-uesoftmodem" - fi - - if [ "$ittiSIM" = "1" ] ; then + fi + + if [ "$ittiSIM" = "1" ] ; then execlist="$execlist nr-ittisim" - fi - - for f in $execlist ; do + fi + + for f in $execlist ; do echo_info "Compiling $f..." compilations \ - $build_dir $f \ - $f $dbin/$f.$REL - done - - -# mandatory shared libraries common to UE and (e/g)NB - - if [ "$SKIP_SHARED_LIB_FLAG" = "False" ]; then + $build_dir $f \ + $f $dbin/$f.$REL + done + + + # mandatory shared libraries common to UE and (e/g)NB + + if [ "$SKIP_SHARED_LIB_FLAG" = "False" ]; then echo_info "Building shared libraries common to UE and gNB" - + + compilations \ + $build_dir $config_libconfig_shlib \ + lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so + compilations \ - $build_dir $config_libconfig_shlib \ - lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so - - compilations \ $build_dir coding \ libcoding.so $dbin/libcoding.so - - fi + fi - + if [ "$UE" = 1 ] ; then echo_info "Compiling UE specific part" @@ -724,11 +721,8 @@ function main() { fi fi - if [ "$SIMUS_PHY" = "1" -o "$SIMUS_CORE" = "1" ] ; then - cd $DIR/$build_dir/build - eval $CMAKE_CMD - fi - + cd $DIR/$build_dir/build + ################## # PHY simulators # ################## From fe4c988c977990b2433c4e95f9b7a31b7a358915 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Mon, 24 Jan 2022 15:54:39 +0100 Subject: [PATCH 079/113] nr ue: fix security setting of DRB Maybe this fix won't work for non-openair gNB. We use the same keys and algorithms as for SRBs, which is what openair gNB does. (I hope I'm right there.) To be changed if needed. --- openair2/RRC/NR_UE/rrc_UE.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index bc209afd02..f910ff68d4 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -2180,7 +2180,8 @@ nr_rrc_ue_establish_srb2( NULL, radioBearerConfig->drb_ToAddModList, NULL, - 0, + NR_UE_rrc_inst[ctxt_pP->module_id].cipheringAlgorithm + | (NR_UE_rrc_inst[ctxt_pP->module_id].integrityProtAlgorithm << 4), NULL, NULL, kUPenc, From 918862475cf82f07bc68684aa7c2281af1bd1107 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 25 Jan 2022 05:53:41 -0800 Subject: [PATCH 080/113] Removing log_minimal and adding new run-time logging opts --- common/utils/LOG/log.c | 123 ++++++++++++++++++++--------------------- common/utils/LOG/log.h | 43 +++++--------- 2 files changed, 72 insertions(+), 94 deletions(-) diff --git a/common/utils/LOG/log.c b/common/utils/LOG/log.c index 28134d6db1..0679e0b521 100644 --- a/common/utils/LOG/log.c +++ b/common/utils/LOG/log.c @@ -65,6 +65,7 @@ char logmem_filename[1024] = {0}; mapping log_level_names[] = { {"error", OAILOG_ERR}, {"warn", OAILOG_WARNING}, + {"analysis", OAILOG_ANALYSIS}, {"info", OAILOG_INFO}, {"debug", OAILOG_DEBUG}, {"trace", OAILOG_TRACE}, @@ -78,6 +79,7 @@ mapping log_options[] = { {"line_num", FLAG_FILE_LINE }, {"function", FLAG_FUNCT}, {"time", FLAG_TIME}, + {"thread_id", FLAG_THREAD_ID}, {NULL,-1} }; @@ -501,6 +503,7 @@ int logInit (void) return 0; } +#include static inline int log_header(log_component_t *c, char *log_buffer, int buffsize, @@ -514,32 +517,43 @@ static inline int log_header(log_component_t *c, char threadname[64]; if (flag & FLAG_THREAD ) { threadname[0]='{'; - if ( pthread_getname_np(pthread_self(), threadname+1,61) != 0) + if (pthread_getname_np(pthread_self(), threadname + 1, sizeof(threadname) - 3) != 0) strcpy(threadname+1, "?thread?"); - strcat(threadname,"}"); + strcat(threadname,"} "); } else { threadname[0]=0; } - + char l[32]; if (flag & FLAG_FILE_LINE && flag & FLAG_FUNCT ) - snprintf(l, sizeof l," (%s:%d) ", func, line); + snprintf(l, sizeof l, "(%s:%d) ", func, line); else if (flag & FLAG_FILE_LINE) - sprintf(l," (%d) ", line); + snprintf(l, sizeof l, "(%d) ", line); else - l[0]=0; + l[0] = 0; char timeString[32]; if ( flag & FLAG_TIME ) { struct timespec t; - clock_gettime(CLOCK_MONOTONIC, &t); - snprintf(timeString, sizeof t,"%05.3f",t.tv_sec+t.tv_nsec/1.0e9); + if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) + abort(); + snprintf(timeString, sizeof(timeString), "%lu.%06lu ", + t.tv_sec, + t.tv_nsec / 1000); } else { - timeString[0]=0; + timeString[0] = 0; } - return snprintf(log_buffer, buffsize, "%s%s[%s]%c%s %s ", + + char threadIdString[32]; + if (flag & FLAG_THREAD_ID) { + snprintf(threadIdString, sizeof(threadIdString), "%08lx ", syscall(__NR_gettid)); + } else { + threadIdString[0] = 0; + } + return snprintf(log_buffer, buffsize, "%s%s%s[%s] %c %s%s", timeString, flag & FLAG_NOCOLOR ? "" : log_level_highlight_start[level], + threadIdString, c->name, flag & FLAG_LEVEL ? g_log->level2string[level] : ' ', l, @@ -547,53 +561,6 @@ static inline int log_header(log_component_t *c, ); } -#if LOG_MINIMAL -#include -void logMinimal(int comp, int level, const char *format, ...) -{ - struct timespec ts; - if (clock_gettime(CLOCK_MONOTONIC, &ts) == -1) - abort(); - - char buf[MAX_LOG_TOTAL]; - int n = snprintf(buf, sizeof(buf), "%lu.%06lu %08lx [%s] %c ", - ts.tv_sec, - ts.tv_nsec / 1000, - syscall(__NR_gettid), - g_log->log_component[comp].name, - level); - if (n < 0 || n >= sizeof(buf)) - { - fprintf(stderr, "%s: n=%d\n", __func__, n); - return; - } - - va_list args; - va_start(args, format); - int m = vsnprintf(buf + n, sizeof(buf) - n, format, args); - va_end(args); - - if (m < 0) - { - fprintf(stderr, "%s: n=%d m=%d\n", __func__, n, m); - return; - } - - int len = n + m; - if (len > sizeof(buf) - 1) - { - len = sizeof(buf) - 1; - } - if (buf[len - 1] != '\n') - { - buf[len++] = '\n'; - } - - __attribute__((unused)) - int unused = write(STDOUT_FILENO, buf, len); -} -#endif // LOG_MINIMAL - void logRecord_mt(const char *file, const char *func, int line, @@ -864,7 +831,14 @@ void flush_mem_to_file(void) } } -char logmem_log_level[NUM_LOG_LEVEL]={'E','W','I','D','T'}; +const char logmem_log_level[NUM_LOG_LEVEL] = { + [OAILOG_ERR] = 'E', + [OAILOG_WARNING] = 'W', + [OAILOG_ANALYSIS] = 'A', + [OAILOG_INFO] = 'I', + [OAILOG_DEBUG] = 'D', + [OAILOG_TRACE] = 'T', +}; static void log_output_memory(log_component_t *c, const char *file, const char *func, int line, int comp, int level, const char* format,va_list args) { @@ -878,12 +852,32 @@ static void log_output_memory(log_component_t *c, const char *file, const char * char log_buffer[MAX_LOG_TOTAL]; // make sure that for log trace the extra info is only printed once, reset when the level changes - if (level < OAILOG_TRACE) - len += log_header(c, log_buffer, MAX_LOG_TOTAL, file, func, line, level); - len += vsnprintf(log_buffer+len, MAX_LOG_TOTAL-len, format, args); - if ( !((g_log->flag | c->flag) & FLAG_NOCOLOR) ) - len+=snprintf(log_buffer+len, MAX_LOG_TOTAL-len, "%s", log_level_highlight_end[level]); - + if (level < OAILOG_TRACE) { + int n = log_header(c, log_buffer+len, MAX_LOG_TOTAL, file, func, line, level); + if (n > 0) { + len += n; + if (len > MAX_LOG_TOTAL) { + len = MAX_LOG_TOTAL; + } + } + } + int n = vsnprintf(log_buffer+len, MAX_LOG_TOTAL-len, format, args); + if (n > 0) { + len += n; + if (len > MAX_LOG_TOTAL) { + len = MAX_LOG_TOTAL; + } + } + if ( !((g_log->flag | c->flag) & FLAG_NOCOLOR) ) { + int n = snprintf(log_buffer+len, MAX_LOG_TOTAL-len, "%s", log_level_highlight_end[level]); + if (n > 0) { + len += n; + if (len > MAX_LOG_TOTAL) { + len = MAX_LOG_TOTAL; + } + } + } + // OAI printf compatibility if(log_mem_flag==1){ if(log_mem_d[log_mem_side].enable_flag==1){ @@ -919,6 +913,7 @@ static void log_output_memory(log_component_t *c, const char *file, const char * } } }else{ + AssertFatal(len >= 0 && len <= MAX_LOG_TOTAL, "Bad len %d\n", len); if (write(fileno(c->stream), log_buffer, len)) {}; } } diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h index 350337b61b..42e49747a1 100644 --- a/common/utils/LOG/log.h +++ b/common/utils/LOG/log.h @@ -90,11 +90,12 @@ extern "C" { # define OAILOG_DISABLE -1 /*!< \brief disable all LOG messages, cannot be used in LOG macros, use only in LOG module */ # define OAILOG_ERR 0 /*!< \brief critical error conditions, impact on "must have" functionalities */ # define OAILOG_WARNING 1 /*!< \brief warning conditions, shouldn't happen but doesn't impact "must have" functionalities */ -# define OAILOG_INFO 2 /*!< \brief informational messages most people don't need, shouldn't impact real-time behavior */ -# define OAILOG_DEBUG 3 /*!< \brief first level debug-level messages, for developers, may impact real-time behavior */ -# define OAILOG_TRACE 4 /*!< \brief second level debug-level messages, for developers, likely impact real-time behavior*/ +# define OAILOG_ANALYSIS 2 /*!< \brief informational messages most people don't need, shouldn't impact real-time behavior */ +# define OAILOG_INFO 3 /*!< \brief informational messages most people don't need, shouldn't impact real-time behavior */ +# define OAILOG_DEBUG 4 /*!< \brief first level debug-level messages, for developers, may impact real-time behavior */ +# define OAILOG_TRACE 5 /*!< \brief second level debug-level messages, for developers, likely impact real-time behavior*/ -#define NUM_LOG_LEVEL 5 /*!< \brief the number of message levels users have with LOG (OAILOG_DISABLE is not available to user as a level, so it is not included)*/ +#define NUM_LOG_LEVEL 6 /*!< \brief the number of message levels users have with LOG (OAILOG_DISABLE is not available to user as a level, so it is not included)*/ /* @}*/ @@ -127,6 +128,7 @@ extern "C" { #define FLAG_FUNCT 0x0020 #define FLAG_FILE_LINE 0x0040 #define FLAG_TIME 0x0100 +#define FLAG_THREAD_ID 0x0200 #define FLAG_INITIALIZED 0x8000 #define SET_LOG_OPTION(O) g_log->flag = (g_log->flag | O) @@ -408,32 +410,14 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int // debugging macros #define LOG_F LOG_I /* because LOG_F was originaly to dump a message or buffer but is also used as a regular level...., to dump use LOG_DUMPMSG */ -#if LOG_MINIMAL - - void logMinimal(int component, int level, const char *format, ...) __attribute__((format(printf, 3, 4))); -# define LOG_E(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'E', __VA_ARGS__); while (0) -# define LOG_W(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'W', __VA_ARGS__); while (0) -# define LOG_A(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'A', __VA_ARGS__); while (0) /* logs intended for analysis */ -# define LOG_I(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'I', __VA_ARGS__); while (0) -# define LOG_D(COMPONENT, ...) do if (0) logMinimal(COMPONENT, 'D', __VA_ARGS__); while (0) -# define LOG_T(COMPONENT, ...) do if (0) logMinimal(COMPONENT, 'T', __VA_ARGS__); while (0) - -# define LOG_M(FILE, VECTOR, DATA, LEN, DEC, FORMAT) ((void) 0) -# define LOG_DUMPFLAG(D) 0 -# define LOG_DEBUGFLAG(D) 0 -# define LOG_DUMPMSG(C, B, S, X...) ((void) 0) -# define VLOG(C, L, F, ARGS) ((void) 0) - -#else // LOG_MINIMAL - # if T_TRACER /* per component, level dependent macros */ -# define LOG_E(c, x...) do { T(T_LEGACY_ ## c ## _ERROR, T_PRINTF(x)) ; if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_ERR ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ERR, x) ;} } while (0) -# define LOG_W(c, x...) do { T(T_LEGACY_ ## c ## _WARNING, T_PRINTF(x)); if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_WARNING) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_WARNING, x);} } while (0) -# define LOG_A LOG_I -# define LOG_I(c, x...) do { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ; if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} } while (0) -# define LOG_D(c, x...) do { T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x)) ; if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_DEBUG ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ;} } while (0) -# define LOG_T(c, x...) do { T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x)) ; if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_TRACE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_TRACE, x) ;} } while (0) +# define LOG_E(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_ERR ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ERR, x) ;} else { T(T_LEGACY_ ## c ## _ERROR, T_PRINTF(x)) ;}} while (0) +# define LOG_W(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_WARNING) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_WARNING, x) ;} else { T(T_LEGACY_ ## c ## _WARNING, T_PRINTF(x)) ;}} while (0) +# define LOG_A(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_ANALYSIS) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ANALYSIS, x) ;} else { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ;}} while (0) +# define LOG_I(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} else { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ;}} while (0) +# define LOG_D(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_DEBUG ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ;} else { T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x)) ;}} while (0) +# define LOG_T(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_TRACE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_TRACE, x) ;} else { T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x)) ;}} while (0) # define VLOG(c,l, f, args) do { if (T_stdout) { if( g_log->log_component[c].level >= l ) vlogRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, l, f, args) ;} } while (0) /* macro used to dump a buffer or a message as in openair2/RRC/LTE/RRC_eNB.c, replaces LOG_F macro */ # define LOG_DUMPMSG(c, f, b, s, x...) do { if(g_log->dump_mask & f) log_dump(c, b, s, LOG_DUMP_CHAR, x) ;} while (0) /* */ @@ -449,8 +433,8 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int # define LOG_E(c, x...) do { if( g_log->log_component[c].level >= OAILOG_ERR ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ERR, x) ;} while (0) # define LOG_W(c, x...) do { if( g_log->log_component[c].level >= OAILOG_WARNING) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_WARNING, x) ;} while (0) +# define LOG_A(c, x...) do { if( g_log->log_component[c].level >= OAILOG_ANALYSIS) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ANALYSIS, x);} while (0) # define LOG_I(c, x...) do { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} while (0) -# define LOG_A LOG_I # define LOG_D(c, x...) do { if( g_log->log_component[c].level >= OAILOG_DEBUG ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ;} while (0) # define LOG_T(c, x...) do { if( g_log->log_component[c].level >= OAILOG_TRACE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_TRACE, x) ;} while (0) # define VLOG(c,l, f, args) do { if( g_log->log_component[c].level >= l ) vlogRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, l, f, args) ; } while (0) @@ -464,7 +448,6 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int # define LOG_VAR(A,B) A B # define T_ACTIVE(a) (0) # endif /* T_TRACER */ -#endif // LOG_MINIMAL /* avoid warnings for variables only used in LOG macro's but set outside debug section */ #define GCC_NOTUSED __attribute__((unused)) From fd54f2cf760716fcc4871e81de205d61f07f70fd Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Wed, 12 Jan 2022 16:05:24 -0800 Subject: [PATCH 081/113] This commit includes several nfapi bug fixes -cell_config.phy_cell_id is a uint16 and was being push/pulled as a uint8_t -several members of the p5 message we not push/pulled -the second member of the ssb_mask_list is causing invalid tag length -the error code of the push response was push8 when it should have been a push32 -packing vendor extension causes invalid tag id(0x000) --- nfapi/open-nFAPI/nfapi/src/nfapi_p5.c | 81 ++++++++++++++++----------- 1 file changed, 49 insertions(+), 32 deletions(-) diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi_p5.c b/nfapi/open-nFAPI/nfapi/src/nfapi_p5.c index 32b87f80e0..ce9c22f7f7 100644 --- a/nfapi/open-nFAPI/nfapi/src/nfapi_p5.c +++ b/nfapi/open-nFAPI/nfapi/src/nfapi_p5.c @@ -263,8 +263,8 @@ static uint8_t pack_nr_pnf_config_request(void *msg, uint8_t **ppWritePackedMsg, static uint8_t pack_pnf_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *config) { nfapi_pnf_config_request_t *pNfapiMsg = (nfapi_pnf_config_request_t *)msg; - return (pack_tlv(NFAPI_PNF_PHY_RF_TAG, &pNfapiMsg->pnf_phy_rf_config, ppWritePackedMsg, end, &pack_pnf_phy_rf_config_value) && - push8(pNfapiMsg->num_tlvs,ppWritePackedMsg,end) && + return (push8(pNfapiMsg->num_tlvs,ppWritePackedMsg,end) && + pack_tlv(NFAPI_PNF_PHY_RF_TAG, &pNfapiMsg->pnf_phy_rf_config, ppWritePackedMsg, end, &pack_pnf_phy_rf_config_value) && pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); } @@ -697,8 +697,7 @@ static uint8_t pack_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_ pack_tlv(NFAPI_NFAPI_NMM_GSM_FREQUENCY_BANDS_TAG, &(pNfapiMsg->nfapi_config.nmm_gsm_frequency_bands), ppWritePackedMsg, end, &pack_nmm_frequency_bands_value) && pack_tlv(NFAPI_NFAPI_NMM_UMTS_FREQUENCY_BANDS_TAG, &(pNfapiMsg->nfapi_config.nmm_umts_frequency_bands), ppWritePackedMsg, end, &pack_nmm_frequency_bands_value) && pack_tlv(NFAPI_NFAPI_NMM_LTE_FREQUENCY_BANDS_TAG, &(pNfapiMsg->nfapi_config.nmm_lte_frequency_bands), ppWritePackedMsg, end, &pack_nmm_frequency_bands_value) && - pack_tlv(NFAPI_NFAPI_NMM_UPLINK_RSSI_SUPPORTED_TAG, &(pNfapiMsg->nfapi_config.nmm_uplink_rssi_supported), ppWritePackedMsg, end, &pack_uint8_tlv_value) && - pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config) ); + pack_tlv(NFAPI_NFAPI_NMM_UPLINK_RSSI_SUPPORTED_TAG, &(pNfapiMsg->nfapi_config.nmm_uplink_rssi_supported), ppWritePackedMsg, end, &pack_uint8_tlv_value)); } @@ -724,47 +723,50 @@ static uint8_t pack_nr_config_request(void *msg, uint8_t **ppWritePackedMsg, uin pack_tlv(NFAPI_NR_CONFIG_UL_K0_TAG, &(pNfapiMsg->carrier_config.ul_k0[1]), ppWritePackedMsg, end, &pack_uint16_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_UPLINK_BANDWIDTH_TAG, &(pNfapiMsg->carrier_config.uplink_bandwidth), ppWritePackedMsg, end, &pack_uint16_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_UPLINK_FREQUENCY_TAG, &(pNfapiMsg->carrier_config.uplink_frequency), ppWritePackedMsg, end, &pack_uint32_tlv_value) && - + pack_tlv(NFAPI_NR_CONFIG_FREQUENCY_SHIFT_7P5KHZ_TAG, &(pNfapiMsg->carrier_config.frequency_shift_7p5khz), ppWritePackedMsg, end, &pack_uint8_tlv_value) && + pack_tlv(NFAPI_NR_CONFIG_FRAME_DUPLEX_TYPE_TAG, &(pNfapiMsg->cell_config.frame_duplex_type), ppWritePackedMsg, end, &pack_uint8_tlv_value) && - pack_tlv(NFAPI_NR_CONFIG_PHY_CELL_ID_TAG, &(pNfapiMsg->cell_config.phy_cell_id), ppWritePackedMsg, end, &pack_uint8_tlv_value) && - + pack_tlv(NFAPI_NR_CONFIG_PHY_CELL_ID_TAG, &(pNfapiMsg->cell_config.phy_cell_id), ppWritePackedMsg, end, &pack_uint16_tlv_value) && + + pack_tlv(NFAPI_NR_CONFIG_PRACH_MULTIPLE_CARRIERS_IN_A_BAND_TAG, &(pNfapiMsg->prach_config.prach_multiple_carriers_in_a_band), ppWritePackedMsg, end, &pack_uint8_tlv_value) && + pack_tlv(NFAPI_NR_CONFIG_PRACH_CONFIG_INDEX_TAG, &(pNfapiMsg->prach_config.prach_ConfigurationIndex), ppWritePackedMsg, end, &pack_uint8_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_NUM_PRACH_FD_OCCASIONS_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions), ppWritePackedMsg, end, &pack_uint8_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_PRACH_SEQUENCE_LENGTH_TAG, &(pNfapiMsg->prach_config.prach_sequence_length), ppWritePackedMsg, end, &pack_uint8_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_RESTRICTED_SET_CONFIG_TAG, &(pNfapiMsg->prach_config.restricted_set_config), ppWritePackedMsg, end, &pack_uint8_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_SSB_PER_RACH_TAG, &(pNfapiMsg->prach_config.ssb_per_rach), ppWritePackedMsg, end, &pack_uint8_tlv_value) && - pack_tlv(NFAPI_NR_CONFIG_PRACH_SUB_C_SPACING_TAG, &(pNfapiMsg->prach_config.prach_sub_c_spacing), ppWritePackedMsg, end, &pack_uint8_tlv_value) && - pack_tlv(NFAPI_NR_CONFIG_PRACH_ROOT_SEQUENCE_INDEX_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions_list[0].prach_root_sequence_index), ppWritePackedMsg, end, &pack_uint16_tlv_value) && - pack_tlv(NFAPI_NR_CONFIG_K1_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions_list[0].k1), ppWritePackedMsg, end, &pack_uint16_tlv_value) && - pack_tlv(NFAPI_NR_CONFIG_PRACH_ZERO_CORR_CONF_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions_list[0].prach_zero_corr_conf), ppWritePackedMsg, end, &pack_uint8_tlv_value) && + pack_tlv(NFAPI_NR_CONFIG_PRACH_SUB_C_SPACING_TAG, &(pNfapiMsg->prach_config.prach_sub_c_spacing), ppWritePackedMsg, end, &pack_uint8_tlv_value) && + pack_tlv(NFAPI_NR_CONFIG_PRACH_ROOT_SEQUENCE_INDEX_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions_list[0].prach_root_sequence_index), ppWritePackedMsg, end, &pack_uint16_tlv_value) && + pack_tlv(NFAPI_NR_CONFIG_K1_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions_list[0].k1), ppWritePackedMsg, end, &pack_uint16_tlv_value) && + pack_tlv(NFAPI_NR_CONFIG_PRACH_ZERO_CORR_CONF_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions_list[0].prach_zero_corr_conf), ppWritePackedMsg, end, &pack_uint8_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_NUM_ROOT_SEQUENCES_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions_list[0].num_root_sequences), ppWritePackedMsg, end, &pack_uint8_tlv_value) && - pack_tlv(NFAPI_NR_CONFIG_SCS_COMMON_TAG, &(pNfapiMsg->ssb_config.scs_common), ppWritePackedMsg, end, &pack_uint8_tlv_value) && + pack_tlv(NFAPI_NR_CONFIG_BCH_PAYLOAD_TAG, &(pNfapiMsg->ssb_config.bch_payload), ppWritePackedMsg, end, &pack_uint8_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_SS_PBCH_POWER_TAG, &(pNfapiMsg->ssb_config.ss_pbch_power), ppWritePackedMsg, end, &pack_uint32_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_BETA_PSS_TAG, &(pNfapiMsg->ssb_table.beta_pss), ppWritePackedMsg, end, &pack_uint8_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_MIB_TAG, &(pNfapiMsg->ssb_table.MIB), ppWritePackedMsg, end, &pack_uint32_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_SSB_MASK_TAG, &(pNfapiMsg->ssb_table.ssb_mask_list[0].ssb_mask), ppWritePackedMsg, end, &pack_uint32_tlv_value) && - pack_tlv(NFAPI_NR_CONFIG_SSB_MASK_TAG, &(pNfapiMsg->ssb_table.ssb_mask_list[1].ssb_mask), ppWritePackedMsg, end, &pack_uint32_tlv_value) && - + // TODO: Not sure what's going on, ssb_mask_list[1] packing below seems to match unpack, but is causing problems + // pack_tlv(NFAPI_NR_CONFIG_SSB_MASK_TAG, &(pNfapiMsg->ssb_table.ssb_mask_list[1].ssb_mask), ppWritePackedMsg, end, &pack_uint32_tlv_value) && + pack_tlv(NFAPI_NR_CONFIG_BEAM_ID_TAG, &(pNfapiMsg->ssb_table.ssb_beam_id_list[0].beam_id), ppWritePackedMsg, end, &pack_uint8_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_SSB_OFFSET_POINT_A_TAG, &(pNfapiMsg->ssb_table.ssb_offset_point_a), ppWritePackedMsg, end, &pack_uint16_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_SSB_PERIOD_TAG, &(pNfapiMsg->ssb_table.ssb_period), ppWritePackedMsg, end, &pack_uint8_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_SSB_SUBCARRIER_OFFSET_TAG, &(pNfapiMsg->ssb_table.ssb_subcarrier_offset), ppWritePackedMsg, end, &pack_uint8_tlv_value) && + pack_tlv(NFAPI_NR_CONFIG_SS_PBCH_MULTIPLE_CARRIERS_IN_A_BAND_TAG, &(pNfapiMsg->ssb_table.ss_pbch_multiple_carriers_in_a_band), ppWritePackedMsg, end, &pack_uint8_tlv_value) && + pack_tlv(NFAPI_NR_CONFIG_MULTIPLE_CELLS_SS_PBCH_IN_A_CARRIER_TAG, &(pNfapiMsg->ssb_table.multiple_cells_ss_pbch_in_a_carrier), ppWritePackedMsg, end, &pack_uint8_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_TDD_PERIOD_TAG, &(pNfapiMsg->tdd_table.tdd_period), ppWritePackedMsg, end, &pack_uint8_tlv_value) && - pack_tlv(NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV4_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_address_ipv4), ppWritePackedMsg, end, &pack_ipv4_address_value) && - pack_tlv(NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV6_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_address_ipv6), ppWritePackedMsg, end, &pack_ipv6_address_value) && - pack_tlv(NFAPI_NR_NFAPI_P7_PNF_PORT_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_port), ppWritePackedMsg, end, &pack_uint16_tlv_value) && + pack_tlv(NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV4_TAG, &(pNfapiMsg->nfapi_config.p7_vnf_address_ipv4), ppWritePackedMsg, end, &pack_ipv4_address_value) && pack_tlv(NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV6_TAG, &(pNfapiMsg->nfapi_config.p7_vnf_address_ipv6), ppWritePackedMsg, end, &pack_ipv6_address_value) && pack_tlv(NFAPI_NR_NFAPI_P7_VNF_PORT_TAG, &(pNfapiMsg->nfapi_config.p7_vnf_port), ppWritePackedMsg, end, &pack_uint16_tlv_value) && - //pack_tlv(NFAPI_NR_NFAPI_RF_BANDS_TAG, &(pNfapiMsg->nfapi_config.rf_bands), ppWritePackedMsg, end, &pack_rf_bands_value) && - pack_tlv(NFAPI_NR_NFAPI_TIMING_INFO_MODE_TAG, &(pNfapiMsg->nfapi_config.timing_info_mode), ppWritePackedMsg, end, &pack_uint8_tlv_value) && - pack_tlv(NFAPI_NR_NFAPI_TIMING_INFO_PERIOD_TAG, &(pNfapiMsg->nfapi_config.timing_info_period), ppWritePackedMsg, end, &pack_uint8_tlv_value) && + pack_tlv(NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV4_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_address_ipv4), ppWritePackedMsg, end, &pack_ipv4_address_value) && + pack_tlv(NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV6_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_address_ipv6), ppWritePackedMsg, end, &pack_ipv6_address_value) && + pack_tlv(NFAPI_NR_NFAPI_P7_PNF_PORT_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_port), ppWritePackedMsg, end, &pack_uint16_tlv_value) && pack_tlv(NFAPI_NR_NFAPI_TIMING_WINDOW_TAG, &(pNfapiMsg->nfapi_config.timing_window), ppWritePackedMsg, end, &pack_uint8_tlv_value) && - //pack_tlv(NFAPI_NR_NFAPI_UPLINK_UES_PER_SUBFRAME_TAG, &(pNfapiMsg->nfapi_config.ul_ue_per_sf), ppWritePackedMsg, end, &pack_uint8_tlv_value) && - - pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config) ); + pack_tlv(NFAPI_NR_NFAPI_TIMING_INFO_MODE_TAG, &(pNfapiMsg->nfapi_config.timing_info_mode), ppWritePackedMsg, end, &pack_uint8_tlv_value) && + pack_tlv(NFAPI_NR_NFAPI_TIMING_INFO_PERIOD_TAG, &(pNfapiMsg->nfapi_config.timing_info_period), ppWritePackedMsg, end, &pack_uint8_tlv_value)); } static uint8_t pack_nr_config_response(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *config) { @@ -775,7 +777,7 @@ static uint8_t pack_nr_config_response(void *msg, uint8_t **ppWritePackedMsg, ui static uint8_t pack_config_response(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *config) { nfapi_config_response_t *pNfapiMsg = (nfapi_config_response_t *)msg; - return ( push8(pNfapiMsg->error_code, ppWritePackedMsg, end) && + return ( push32(pNfapiMsg->error_code, ppWritePackedMsg, end) && pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config) ); } @@ -1346,7 +1348,8 @@ static uint8_t unpack_pnf_config_request(uint8_t **ppReadPackedMsg, uint8_t *end unpack_tlv_t unpack_fns[] = { { NFAPI_PNF_PHY_RF_TAG, &pNfapiMsg->pnf_phy_rf_config, &unpack_pnf_phy_rf_config_value}, }; - return unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension); + return (pull8(ppReadPackedMsg, &pNfapiMsg->num_tlvs, end) && + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); } @@ -1722,13 +1725,14 @@ static uint8_t unpack_nr_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, for(int i=0;i<40;i++) pNfapiMsg->tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list = (nfapi_nr_max_num_of_symbol_per_slot_t*) malloc(14*sizeof(nfapi_nr_max_num_of_symbol_per_slot_t)); - pNfapiMsg->prach_config.num_prach_fd_occasions_list=(nfapi_nr_num_prach_fd_occasions_t *) malloc(sizeof(nfapi_nr_num_prach_fd_occasions_t)); for(int i = 0; i < 40; i++){ //unpacking tdd slot config for(int symbol = 0; symbol<14;symbol++){ pull8(ppReadPackedMsg,&pNfapiMsg->tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list[symbol].slot_config.value, end); } } + pNfapiMsg->prach_config.num_prach_fd_occasions_list=(nfapi_nr_num_prach_fd_occasions_t *) malloc(sizeof(nfapi_nr_num_prach_fd_occasions_t)); + unpack_tlv_t unpack_fns[] = { { NFAPI_NR_CONFIG_DL_BANDWIDTH_TAG, &(pNfapiMsg->carrier_config.dl_bandwidth), &unpack_uint16_tlv_value}, @@ -1741,8 +1745,13 @@ static uint8_t unpack_nr_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, { NFAPI_NR_CONFIG_UL_K0_TAG, &(pNfapiMsg->carrier_config.ul_k0[1]), &unpack_uint16_tlv_value}, { NFAPI_NR_CONFIG_UPLINK_BANDWIDTH_TAG, &(pNfapiMsg->carrier_config.uplink_bandwidth), &unpack_uint16_tlv_value}, { NFAPI_NR_CONFIG_UPLINK_FREQUENCY_TAG, &(pNfapiMsg->carrier_config.uplink_frequency), &unpack_uint32_tlv_value}, + { NFAPI_NR_CONFIG_FREQUENCY_SHIFT_7P5KHZ_TAG, &(pNfapiMsg->carrier_config.frequency_shift_7p5khz), &unpack_uint8_tlv_value}, + { NFAPI_NR_CONFIG_FRAME_DUPLEX_TYPE_TAG, &(pNfapiMsg->cell_config.frame_duplex_type), &unpack_uint8_tlv_value}, - { NFAPI_NR_CONFIG_PHY_CELL_ID_TAG, &(pNfapiMsg->cell_config.phy_cell_id), &unpack_uint8_tlv_value}, + { NFAPI_NR_CONFIG_PHY_CELL_ID_TAG, &(pNfapiMsg->cell_config.phy_cell_id), &unpack_uint16_tlv_value}, + + { NFAPI_NR_CONFIG_PRACH_MULTIPLE_CARRIERS_IN_A_BAND_TAG, &(pNfapiMsg->prach_config.prach_multiple_carriers_in_a_band), &unpack_uint8_tlv_value}, + { NFAPI_NR_CONFIG_PRACH_CONFIG_INDEX_TAG, &(pNfapiMsg->prach_config.prach_ConfigurationIndex), &unpack_uint8_tlv_value}, { NFAPI_NR_CONFIG_NUM_PRACH_FD_OCCASIONS_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions), &unpack_uint8_tlv_value}, { NFAPI_NR_CONFIG_PRACH_SEQUENCE_LENGTH_TAG, &(pNfapiMsg->prach_config.prach_sequence_length), &unpack_uint8_tlv_value}, { NFAPI_NR_CONFIG_RESTRICTED_SET_CONFIG_TAG, &(pNfapiMsg->prach_config.restricted_set_config), &unpack_uint8_tlv_value}, @@ -1754,24 +1763,32 @@ static uint8_t unpack_nr_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, { NFAPI_NR_CONFIG_NUM_ROOT_SEQUENCES_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions_list[0].num_root_sequences), &unpack_uint8_tlv_value}, { NFAPI_NR_CONFIG_SCS_COMMON_TAG, &(pNfapiMsg->ssb_config.scs_common), &unpack_uint8_tlv_value}, + { NFAPI_NR_CONFIG_BCH_PAYLOAD_TAG, &(pNfapiMsg->ssb_config.bch_payload), &unpack_uint8_tlv_value}, { NFAPI_NR_CONFIG_SS_PBCH_POWER_TAG, &(pNfapiMsg->ssb_config.ss_pbch_power), &unpack_uint32_tlv_value}, + { NFAPI_NR_CONFIG_BETA_PSS_TAG, &(pNfapiMsg->ssb_table.beta_pss), &unpack_uint8_tlv_value}, { NFAPI_NR_CONFIG_MIB_TAG, &(pNfapiMsg->ssb_table.MIB), &unpack_uint32_tlv_value}, { NFAPI_NR_CONFIG_SSB_MASK_TAG, &(pNfapiMsg->ssb_table.ssb_mask_list[0].ssb_mask), &unpack_uint32_tlv_value}, - { NFAPI_NR_CONFIG_SSB_MASK_TAG, &(pNfapiMsg->ssb_table.ssb_mask_list[1].ssb_mask), &unpack_uint32_tlv_value}, - + // TODO: Not sure what's going on, ssb_mask_list[1] unpacking below seems to match pack, but is causing problems + // { NFAPI_NR_CONFIG_SSB_MASK_TAG, &(pNfapiMsg->ssb_table.ssb_mask_list[1].ssb_mask), &unpack_uint32_tlv_value}, + { NFAPI_NR_CONFIG_BEAM_ID_TAG, &(pNfapiMsg->ssb_table.ssb_beam_id_list[0].beam_id), &unpack_uint8_tlv_value}, { NFAPI_NR_CONFIG_SSB_OFFSET_POINT_A_TAG, &(pNfapiMsg->ssb_table.ssb_offset_point_a), &unpack_uint16_tlv_value}, { NFAPI_NR_CONFIG_SSB_PERIOD_TAG, &(pNfapiMsg->ssb_table.ssb_period), &unpack_uint8_tlv_value}, { NFAPI_NR_CONFIG_SSB_SUBCARRIER_OFFSET_TAG, &(pNfapiMsg->ssb_table.ssb_subcarrier_offset), &unpack_uint8_tlv_value}, + { NFAPI_NR_CONFIG_SS_PBCH_MULTIPLE_CARRIERS_IN_A_BAND_TAG, &(pNfapiMsg->ssb_table.ss_pbch_multiple_carriers_in_a_band), &unpack_uint8_tlv_value}, + { NFAPI_NR_CONFIG_MULTIPLE_CELLS_SS_PBCH_IN_A_CARRIER_TAG, &(pNfapiMsg->ssb_table.multiple_cells_ss_pbch_in_a_carrier), &unpack_uint8_tlv_value}, + { NFAPI_NR_CONFIG_TDD_PERIOD_TAG, &(pNfapiMsg->tdd_table.tdd_period), &unpack_uint8_tlv_value}, - { NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV6_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_address_ipv6), &unpack_ipv6_address_value}, - { NFAPI_NR_NFAPI_P7_PNF_PORT_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_port), &unpack_uint16_tlv_value}, + { NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV4_TAG, &(pNfapiMsg->nfapi_config.p7_vnf_address_ipv4), &unpack_ipv4_address_value}, { NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV6_TAG, &(pNfapiMsg->nfapi_config.p7_vnf_address_ipv6), &unpack_ipv6_address_value}, { NFAPI_NR_NFAPI_P7_VNF_PORT_TAG, &(pNfapiMsg->nfapi_config.p7_vnf_port), &unpack_uint16_tlv_value}, + { NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV4_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_address_ipv4), &unpack_ipv4_address_value}, + { NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV6_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_address_ipv6), &unpack_ipv6_address_value}, + { NFAPI_NR_NFAPI_P7_PNF_PORT_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_port), &unpack_uint16_tlv_value}, + { NFAPI_NR_NFAPI_TIMING_WINDOW_TAG, &(pNfapiMsg->nfapi_config.timing_window), &unpack_uint8_tlv_value}, { NFAPI_NR_NFAPI_TIMING_INFO_MODE_TAG, &(pNfapiMsg->nfapi_config.timing_info_mode), &unpack_uint8_tlv_value}, { NFAPI_NR_NFAPI_TIMING_INFO_PERIOD_TAG, &(pNfapiMsg->nfapi_config.timing_info_period), &unpack_uint8_tlv_value}, - { NFAPI_NR_NFAPI_TIMING_WINDOW_TAG, &(pNfapiMsg->nfapi_config.timing_window), &unpack_uint8_tlv_value}, }; return ( pull8(ppReadPackedMsg, &pNfapiMsg->num_tlv, end) && From 4c4d317822d7f462494d6bc6aaf0eff05d0f25fe Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Mon, 24 Jan 2022 12:28:29 -0800 Subject: [PATCH 082/113] Removing commented code that causes SEG_FAULT in NSA mode --- openair2/RRC/LTE/MESSAGES/asn1_msg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c index b069591316..b1f2e6d9b3 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c @@ -4293,7 +4293,7 @@ ssize_t do_nrMeasurementReport(uint8_t *buffer, LTE_MeasResultListEUTRA_t *measResultListEUTRA2=&measResultNeighCells->choice.measResultListEUTRA; asn1cSequenceAdd(measResultListEUTRA2->list, struct LTE_MeasResultEUTRA, measresulteutra_list); measresulteutra_list->physCellId = phy_id; - //asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2); + asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2); //measresult_cgi2->cellGlobalId= {0}; //measresult_cgi2->trackingAreaCode= {0}; struct LTE_MeasResultEUTRA__measResult* measResult= &measresulteutra_list->measResult; From 5eb9e1f421d30155dc57a2b8d56a34e70764a86f Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 26 Jan 2022 10:31:10 +0100 Subject: [PATCH 083/113] compute Y every time --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 4 ++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 4 ++-- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 18 ++++++++---------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 6 +++--- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 2 ++ openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 1 - 6 files changed, 17 insertions(+), 18 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 8c3b839f5a..0e98f4d3c9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -613,7 +613,7 @@ bool allocate_dl_retransmission(module_id_t module_id, /* Find a free CCE */ const int cid = sched_ctrl->coreset->controlResourceSetId; - const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid%3][slot]; + const uint16_t Y = get_Y(cid%3, slot, UE_info->rnti[UE_id]); uint8_t nr_of_candidates; for (int i=0; i<5; i++) { // for now taking the lowest value among the available aggregation levels @@ -775,7 +775,7 @@ void pf_dl(module_id_t module_id, /* Find a free CCE */ const int cid = sched_ctrl->coreset->controlResourceSetId; - const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid%3][slot]; + const uint16_t Y = get_Y(cid%3, slot, UE_info->rnti[UE_id]); uint8_t nr_of_candidates; for (int i=0; i<5; i++) { // for now taking the lowest value among the available aggregation levels diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index 8f32cf136e..c447708125 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -345,7 +345,7 @@ void nr_preprocessor_phytest(module_id_t module_id, AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n"); const int cid = sched_ctrl->coreset->controlResourceSetId; - const uint16_t Y = UE_info->Y[UE_id][cid%3][slot]; + const uint16_t Y = get_Y(cid%3, slot, UE_info->rnti[UE_id]); int CCEIndex = find_pdcch_candidate(RC.nrmac[module_id], CC_id, @@ -511,7 +511,7 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n"); const int cid = sched_ctrl->coreset->controlResourceSetId; - const uint16_t Y = UE_info->Y[UE_id][cid%3][slot]; + const uint16_t Y = get_Y(cid%3, slot, UE_info->rnti[UE_id]); int CCEIndex = find_pdcch_candidate(nr_mac, CC_id, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 4f3e04bd07..89e8d344ed 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -1936,19 +1936,18 @@ int find_nr_UE_id(module_id_t mod_idP, rnti_t rntiP) return -1; } -void set_Y(int Y[3][160], rnti_t rnti) { +uint16_t get_Y(int cid, int slot, rnti_t rnti) { + const int A[3] = {39827, 39829, 39839}; const int D = 65537; + int Y; - Y[0][0] = (A[0] * rnti) % D; - Y[1][0] = (A[1] * rnti) % D; - Y[2][0] = (A[2] * rnti) % D; + Y = (A[cid] * rnti) % D; - for (int s = 1; s < 160; s++) { - Y[0][s] = (A[0] * Y[0][s - 1]) % D; - Y[1][s] = (A[1] * Y[1][s - 1]) % D; - Y[2][s] = (A[2] * Y[2][s - 1]) % D; - } + for (int s = 0; s < slot; s++) + Y = (A[cid] * Y) % D; + + return Y; } int find_nr_RA_id(module_id_t mod_idP, int CC_idP, rnti_t rntiP) { @@ -2032,7 +2031,6 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG UE_info->CellGroup[UE_id] = CellGroup; add_nr_list(&UE_info->list, UE_id); memset(&UE_info->mac_stats[UE_id], 0, sizeof(NR_mac_stats_t)); - set_Y(UE_info->Y[UE_id], rntiP); if (CellGroup && CellGroup->spCellConfig && CellGroup->spCellConfig && CellGroup->spCellConfig->spCellConfigDedicated) compute_csi_bitlen (CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup, UE_info, UE_id, mod_idP); NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 8db8062280..e4fcecf059 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1012,7 +1012,7 @@ bool allocate_ul_retransmission(module_id_t module_id, /* Find a free CCE */ const int cid = sched_ctrl->coreset->controlResourceSetId; - const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid%3][slot]; + const uint16_t Y = get_Y(cid%3, slot, UE_info->rnti[UE_id]); uint8_t nr_of_candidates; for (int i=0; i<5; i++) { // for now taking the lowest value among the available aggregation levels @@ -1158,7 +1158,7 @@ void pf_ul(module_id_t module_id, /* if no data, pre-allocate 5RB */ /* Find a free CCE */ const int cid = sched_ctrl->coreset->controlResourceSetId; - const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid%3][slot]; + const uint16_t Y = get_Y(cid%3, slot, UE_info->rnti[UE_id]); uint8_t nr_of_candidates; for (int i=0; i<5; i++) { // for now taking the lowest value among the available aggregation levels @@ -1268,7 +1268,7 @@ void pf_ul(module_id_t module_id, NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; const int cid = sched_ctrl->coreset->controlResourceSetId; - const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid%3][slot]; + const uint16_t Y = get_Y(cid%3, slot, UE_info->rnti[UE_id]); uint8_t nr_of_candidates; for (int i=0; i<5; i++) { // for now taking the lowest value among the available aggregation levels diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 4b876fcf04..ed125fddb0 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -318,6 +318,8 @@ void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc, uint8_t num_dmrs_cdm_grps_no_data, NR_pusch_semi_static_t *ps); +uint16_t get_Y(int cid, int slot, rnti_t rnti); + uint8_t nr_get_tpc(int target, uint8_t cqi, int incr); int get_spf(nfapi_nr_config_request_scf_t *cfg); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 1073cef16c..ac0711e936 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -669,7 +669,6 @@ typedef struct { rnti_t rnti[MAX_MOBILES_PER_GNB]; NR_CellGroupConfig_t *CellGroup[MAX_MOBILES_PER_GNB]; /// CCE indexing - int Y[MAX_MOBILES_PER_GNB][3][160]; int m[MAX_MOBILES_PER_GNB]; // UE selected beam index uint8_t UE_beam_index[MAX_MOBILES_PER_GNB]; From aec56c9a860c177b37ccdff94fdd593c0897b4ca Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 27 Jan 2022 12:22:03 +0100 Subject: [PATCH 084/113] additional review comments --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index c447708125..30e1d2cc3d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -408,7 +408,7 @@ void nr_preprocessor_phytest(module_id_t module_id, /* mark the corresponding RBs as used */ for (int rb = 0; rb < sched_pdsch->rbSize; rb++) - vrb_map[rb + sched_pdsch->rbStart + BWPStart] = ((1<nrOfSymbols)-1)<startSymbolIndex; + vrb_map[rb + sched_pdsch->rbStart + BWPStart] = SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); if ((frame&127) == 0) LOG_D(MAC,"phytest: %d.%d DL mcs %d, DL rbStart %d, DL rbSize %d\n", frame, slot, sched_pdsch->mcs, rbStart,rbSize); } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 89e8d344ed..8f1bc986fe 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -376,14 +376,7 @@ void fill_pdcch_vrb_map(gNB_MAC_INST *mac, for (int j=first_cce; jBWPStart + f*B_rb + rb] |= SL_to_bitmap(pdcch->StartSymbolIndex, N_symb); } From a3d9d50eb9d30bbcbf77356f5736e8c7388433c7 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 27 Jan 2022 14:23:47 +0100 Subject: [PATCH 085/113] fix(ci): Updating the 5G RF simulator tutorial with CN5G v1.3.0 release Also remove an obsolete sub-pipeline Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-gitlab | 22 --- .../5g_f1_rfsimulator/docker-compose.yaml | 4 +- .../yaml_files/5g_f1_rfsimulator/oai-smf.conf | 133 ------------------ .../yaml_files/5g_rfsimulator/README.md | 6 +- .../5g_rfsimulator/docker-compose.yaml | 4 +- .../yaml_files/5g_rfsimulator/oai-smf.conf | 133 ------------------ 6 files changed, 7 insertions(+), 295 deletions(-) delete mode 100644 ci-scripts/yaml_files/5g_f1_rfsimulator/oai-smf.conf delete mode 100644 ci-scripts/yaml_files/5g_rfsimulator/oai-smf.conf diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab index 8f1955f265..3042ada815 100644 --- a/ci-scripts/Jenkinsfile-gitlab +++ b/ci-scripts/Jenkinsfile-gitlab @@ -529,28 +529,6 @@ pipeline { } } } - stage ("Test IF4p5 - TDD - Band 38 - B210 - MultiRRU") { - when { - expression {doFullTestsuite} - } - steps { - script { - triggerSlaveJob ('eNB-CI-IF4p5-TDD-Band38-MultiRRU-B210', 'Test-IF4p5-TDD-Band38-Multi-RRU') - } - } - post { - always { - script { - finalizeSlaveJob('eNB-CI-IF4p5-TDD-Band38-MultiRRU-B210') - } - } - failure { - script { - currentBuild.result = 'FAILURE' - } - } - } - } stage ("Test OAI UE - FDD - Band 20 - B200") { when { expression {doFullTestsuite} diff --git a/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml index eb15aef0d8..6a39f2147e 100644 --- a/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml @@ -111,7 +111,6 @@ services: oai-smf: container_name: "rfsim5g-oai-smf" image: oai-smf:latest - entrypoint: /bin/bash -c "/openair-smf/bin/oai_smf -c /openair-smf/bin/oai-smf.conf -o" environment: - TZ=Europe/Paris - INSTANCE=0 @@ -140,12 +139,13 @@ services: - REGISTER_NRF=yes - DISCOVER_UPF=yes - USE_FQDN_DNS=yes + - DNN_NI0=oai + - DNN_NI2=oai.ipv4 depends_on: - oai-nrf - oai-amf volumes: - ./smf-healthcheck.sh:/openair-smf/bin/smf-healthcheck.sh - - ./oai-smf.conf:/openair-smf/bin/oai-smf.conf healthcheck: test: /bin/bash -c "/openair-smf/bin/smf-healthcheck.sh" interval: 10s diff --git a/ci-scripts/yaml_files/5g_f1_rfsimulator/oai-smf.conf b/ci-scripts/yaml_files/5g_f1_rfsimulator/oai-smf.conf deleted file mode 100644 index 0c83ab8be9..0000000000 --- a/ci-scripts/yaml_files/5g_f1_rfsimulator/oai-smf.conf +++ /dev/null @@ -1,133 +0,0 @@ -################################################################################ -# Licensed to the OpenAirInterface (OAI) Software Alliance under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The OpenAirInterface Software Alliance licenses this file to You under -# the OAI Public License, Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.openairinterface.org/?page_id=698 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#------------------------------------------------------------------------------- -# For more information about the OpenAirInterface (OAI) Software Alliance: -# contact@openairinterface.org -################################################################################ - -SMF = -{ - FQDN = "oai-smf-svc"; - INSTANCE = 0; # 0 is the default - PID_DIRECTORY = "/var/run"; # /var/run is the default - - INTERFACES : - { - N4 : - { - # SMF binded interface for N4 communication (UPF) - INTERFACE_NAME = "eth0"; # YOUR NETWORK CONFIG HERE - IPV4_ADDRESS = "read"; - }; - - SBI : - { - # SMF binded interface for SBI interface (e.g., communication with AMF, UDM) - INTERFACE_NAME = "eth0"; # YOUR NETWORK CONFIG HERE - IPV4_ADDRESS = "read"; - PORT = 80; # YOUR NETWORK CONFIG HERE (default: 80) - HTTP2_PORT = 9090; # YOUR NETWORK CONFIG HERE - API_VERSION = "v1"; # YOUR SMF API VERSION CONFIG HERE - }; - - }; - - - # Pool of UE assigned IP addresses - # Do not make IP pools overlap - # first IPv4 address X.Y.Z.1 is reserved for GTP network device on UPF - IP_ADDRESS_POOL : - { - IPV4_LIST = ( - {RANGE = "12.1.1.2 - 12.1.1.128";}, # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE. - {RANGE = "12.1.1.129 - 12.1.1.224";}, # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE. - {RANGE = "10.10.10.2 - 10.10.10.253";} # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE. - - ); - IPV6_LIST = ( - {PREFIX = "2001:1:2::/64";}, # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE. - {PREFIX = "3001:1:2::/64";}, # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE. - {PREFIX = "4001:1:2::/64";} # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE. - ); - }; - - DNN_LIST = ( - # IPV4_POOL, IPV6_POOL are index in IPV4_LIST, IPV6_LIST, PDU_SESSION_TYPE choice in {IPv4, IPv6, IPv4v6} - {DNN_NI = "default"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 2; IPV6_POOL = -1}, - {DNN_NI = "carrier.com"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 1; IPV6_POOL = -1}, - {DNN_NI = "oai"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 0; IPV6_POOL = -1} - ); - - # DNS address communicated to UEs - DEFAULT_DNS_IPV4_ADDRESS = "192.168.18.129"; # YOUR DNS CONFIG HERE - DEFAULT_DNS_SEC_IPV4_ADDRESS = "192.168.18.129"; # YOUR DNS CONFIG HERE - DEFAULT_DNS_IPV6_ADDRESS = "2001:4860:4860::8888"; # YOUR DNS CONFIG HERE - DEFAULT_DNS_SEC_IPV6_ADDRESS = "2001:4860:4860::8844"; # YOUR DNS CONFIG HERE - - SUPPORT_FEATURES: - { - # STRING, {"yes", "no"}, - REGISTER_NRF = "yes"; # Set to yes if SMF resgisters to an NRF - DISCOVER_UPF = "yes"; # Set to yes to enable UPF discovery and selection - FORCE_PUSH_PROTOCOL_CONFIGURATION_OPTIONS = "no"; # Non standard feature, normally should be set to "no", - # but you may need to set to yes for UE that do not explicitly request a PDN address through NAS signalling - USE_LOCAL_SUBSCRIPTION_INFO = "yes"; # Set to yes if SMF uses local subscription information instead of from an UDM - USE_FQDN_DNS = "yes"; # Set to yes if AMF/UDM/NRF/UPF will relying on a DNS to resolve FQDN - } - - AMF : - { - IPV4_ADDRESS = "0.0.0.0"; # YOUR AMF CONFIG HERE - PORT = 80; # YOUR AMF CONFIG HERE (default: 80) - API_VERSION = "v1"; # YOUR AMF API VERSION FOR SBI CONFIG HERE - FQDN = "oai-amf" # YOUR AMF FQDN CONFIG HERE - }; - - UDM : - { - IPV4_ADDRESS = "127.0.0.1"; # YOUR UDM CONFIG HERE - PORT = 80; # YOUR UDM CONFIG HERE (default: 80) - API_VERSION = "v1"; # YOUR UDM API VERSION FOR SBI CONFIG HERE - FQDN = "localhost" # YOUR UDM FQDN CONFIG HERE - }; - - NRF : - { - IPV4_ADDRESS = "192.168.71.130"; # YOUR NRF CONFIG HERE - PORT = 80; # YOUR NRF CONFIG HERE (default: 80) - API_VERSION = "v1"; # YOUR NRF API VERSION FOR SBI CONFIG HERE - FQDN = "oai-nrf" # YOUR NRF FQDN CONFIG HERE - }; - - UPF_LIST = ( - {IPV4_ADDRESS = "192.168.71.134" ; FQDN = "oai-spgwu"} # YOUR UPF CONFIG HERE - ); - - LOCAL_CONFIGURATION : - { - SESSION_MANAGEMENT_SUBSCRIPTION_LIST = ( - { NSSAI_SST = 222, NSSAI_SD = "123", DNN = "default", DEFAULT_SESSION_TYPE = "IPV4", DEFAULT_SSC_MODE = 1, - QOS_PROFILE_5QI = 7, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT", - QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "20Mbps", SESSION_AMBR_DL = "22Mbps"}, - { NSSAI_SST = 1; NSSAI_SD = "1", DNN = "oai", DEFAULT_SESSION_TYPE = "IPV4", DEFAULT_SSC_MODE = 1, - QOS_PROFILE_5QI = 6, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT", - QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "20Mbps", SESSION_AMBR_DL = "22Mbps"} - ); - }; - -}; - diff --git a/ci-scripts/yaml_files/5g_rfsimulator/README.md b/ci-scripts/yaml_files/5g_rfsimulator/README.md index 5c384b3202..fc562dd1eb 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator/README.md +++ b/ci-scripts/yaml_files/5g_rfsimulator/README.md @@ -14,7 +14,7 @@ This page is only valid for an `Ubuntu18` host. -**NOTE: this version (2021-10-05) is valid for the `v1.1.0` and `v1.2.0` versions of the `OAI 5G CN`.** +**NOTE: this version (2022-01-27) has been updated for the `v1.3.0` version of the `OAI 5G CN`.** **TABLE OF CONTENTS** @@ -76,9 +76,9 @@ $ docker image tag rdefosseoai/oai-nr-ue:develop oai-nr-ue:develop $ docker logout ``` -**CAUTION: 2021/10/05 with the release `v1.2.0` of the `CN5G`, the previous version was not compatible any-more.** +**CAUTION: 2022/01/27 with the release `v1.3.0` of the `CN5G`, the previous version was not compatible any-more.** -**This new version is working for both the `v1.1.0` and `v1.2.0` of the `CN5G`.** +**This new version is working only with the `v1.3.0` of the `CN5G`.** # 2. Deploy containers # diff --git a/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml index 952da8087d..f0476b0a1e 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml @@ -111,7 +111,6 @@ services: oai-smf: container_name: "rfsim5g-oai-smf" image: oai-smf:latest - entrypoint: /bin/bash -c "/openair-smf/bin/oai_smf -c /openair-smf/bin/oai-smf.conf -o" environment: - TZ=Europe/Paris - INSTANCE=0 @@ -140,12 +139,13 @@ services: - REGISTER_NRF=yes - DISCOVER_UPF=yes - USE_FQDN_DNS=yes + - DNN_NI0=oai + - DNN_NI2=oai.ipv4 depends_on: - oai-nrf - oai-amf volumes: - ./smf-healthcheck.sh:/openair-smf/bin/smf-healthcheck.sh - - ./oai-smf.conf:/openair-smf/bin/oai-smf.conf healthcheck: test: /bin/bash -c "/openair-smf/bin/smf-healthcheck.sh" interval: 10s diff --git a/ci-scripts/yaml_files/5g_rfsimulator/oai-smf.conf b/ci-scripts/yaml_files/5g_rfsimulator/oai-smf.conf deleted file mode 100644 index 0c83ab8be9..0000000000 --- a/ci-scripts/yaml_files/5g_rfsimulator/oai-smf.conf +++ /dev/null @@ -1,133 +0,0 @@ -################################################################################ -# Licensed to the OpenAirInterface (OAI) Software Alliance under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The OpenAirInterface Software Alliance licenses this file to You under -# the OAI Public License, Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.openairinterface.org/?page_id=698 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#------------------------------------------------------------------------------- -# For more information about the OpenAirInterface (OAI) Software Alliance: -# contact@openairinterface.org -################################################################################ - -SMF = -{ - FQDN = "oai-smf-svc"; - INSTANCE = 0; # 0 is the default - PID_DIRECTORY = "/var/run"; # /var/run is the default - - INTERFACES : - { - N4 : - { - # SMF binded interface for N4 communication (UPF) - INTERFACE_NAME = "eth0"; # YOUR NETWORK CONFIG HERE - IPV4_ADDRESS = "read"; - }; - - SBI : - { - # SMF binded interface for SBI interface (e.g., communication with AMF, UDM) - INTERFACE_NAME = "eth0"; # YOUR NETWORK CONFIG HERE - IPV4_ADDRESS = "read"; - PORT = 80; # YOUR NETWORK CONFIG HERE (default: 80) - HTTP2_PORT = 9090; # YOUR NETWORK CONFIG HERE - API_VERSION = "v1"; # YOUR SMF API VERSION CONFIG HERE - }; - - }; - - - # Pool of UE assigned IP addresses - # Do not make IP pools overlap - # first IPv4 address X.Y.Z.1 is reserved for GTP network device on UPF - IP_ADDRESS_POOL : - { - IPV4_LIST = ( - {RANGE = "12.1.1.2 - 12.1.1.128";}, # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE. - {RANGE = "12.1.1.129 - 12.1.1.224";}, # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE. - {RANGE = "10.10.10.2 - 10.10.10.253";} # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE. - - ); - IPV6_LIST = ( - {PREFIX = "2001:1:2::/64";}, # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE. - {PREFIX = "3001:1:2::/64";}, # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE. - {PREFIX = "4001:1:2::/64";} # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE. - ); - }; - - DNN_LIST = ( - # IPV4_POOL, IPV6_POOL are index in IPV4_LIST, IPV6_LIST, PDU_SESSION_TYPE choice in {IPv4, IPv6, IPv4v6} - {DNN_NI = "default"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 2; IPV6_POOL = -1}, - {DNN_NI = "carrier.com"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 1; IPV6_POOL = -1}, - {DNN_NI = "oai"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 0; IPV6_POOL = -1} - ); - - # DNS address communicated to UEs - DEFAULT_DNS_IPV4_ADDRESS = "192.168.18.129"; # YOUR DNS CONFIG HERE - DEFAULT_DNS_SEC_IPV4_ADDRESS = "192.168.18.129"; # YOUR DNS CONFIG HERE - DEFAULT_DNS_IPV6_ADDRESS = "2001:4860:4860::8888"; # YOUR DNS CONFIG HERE - DEFAULT_DNS_SEC_IPV6_ADDRESS = "2001:4860:4860::8844"; # YOUR DNS CONFIG HERE - - SUPPORT_FEATURES: - { - # STRING, {"yes", "no"}, - REGISTER_NRF = "yes"; # Set to yes if SMF resgisters to an NRF - DISCOVER_UPF = "yes"; # Set to yes to enable UPF discovery and selection - FORCE_PUSH_PROTOCOL_CONFIGURATION_OPTIONS = "no"; # Non standard feature, normally should be set to "no", - # but you may need to set to yes for UE that do not explicitly request a PDN address through NAS signalling - USE_LOCAL_SUBSCRIPTION_INFO = "yes"; # Set to yes if SMF uses local subscription information instead of from an UDM - USE_FQDN_DNS = "yes"; # Set to yes if AMF/UDM/NRF/UPF will relying on a DNS to resolve FQDN - } - - AMF : - { - IPV4_ADDRESS = "0.0.0.0"; # YOUR AMF CONFIG HERE - PORT = 80; # YOUR AMF CONFIG HERE (default: 80) - API_VERSION = "v1"; # YOUR AMF API VERSION FOR SBI CONFIG HERE - FQDN = "oai-amf" # YOUR AMF FQDN CONFIG HERE - }; - - UDM : - { - IPV4_ADDRESS = "127.0.0.1"; # YOUR UDM CONFIG HERE - PORT = 80; # YOUR UDM CONFIG HERE (default: 80) - API_VERSION = "v1"; # YOUR UDM API VERSION FOR SBI CONFIG HERE - FQDN = "localhost" # YOUR UDM FQDN CONFIG HERE - }; - - NRF : - { - IPV4_ADDRESS = "192.168.71.130"; # YOUR NRF CONFIG HERE - PORT = 80; # YOUR NRF CONFIG HERE (default: 80) - API_VERSION = "v1"; # YOUR NRF API VERSION FOR SBI CONFIG HERE - FQDN = "oai-nrf" # YOUR NRF FQDN CONFIG HERE - }; - - UPF_LIST = ( - {IPV4_ADDRESS = "192.168.71.134" ; FQDN = "oai-spgwu"} # YOUR UPF CONFIG HERE - ); - - LOCAL_CONFIGURATION : - { - SESSION_MANAGEMENT_SUBSCRIPTION_LIST = ( - { NSSAI_SST = 222, NSSAI_SD = "123", DNN = "default", DEFAULT_SESSION_TYPE = "IPV4", DEFAULT_SSC_MODE = 1, - QOS_PROFILE_5QI = 7, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT", - QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "20Mbps", SESSION_AMBR_DL = "22Mbps"}, - { NSSAI_SST = 1; NSSAI_SD = "1", DNN = "oai", DEFAULT_SESSION_TYPE = "IPV4", DEFAULT_SSC_MODE = 1, - QOS_PROFILE_5QI = 6, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT", - QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "20Mbps", SESSION_AMBR_DL = "22Mbps"} - ); - }; - -}; - From c77a4eb7671e09b73f03e91ec4c49016efb0d120 Mon Sep 17 00:00:00 2001 From: hardy Date: Wed, 26 Jan 2022 17:23:10 +0100 Subject: [PATCH 086/113] create aws clean function to get rid of closed MR results --- ci-scripts/ran_dashboard/Hdashboard.py | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/ci-scripts/ran_dashboard/Hdashboard.py b/ci-scripts/ran_dashboard/Hdashboard.py index 864e31fc1f..1b65c7af4f 100644 --- a/ci-scripts/ran_dashboard/Hdashboard.py +++ b/ci-scripts/ran_dashboard/Hdashboard.py @@ -544,6 +544,30 @@ class Dashboard: }) editable_mr.save() + def AWSCleanup(self,mode): + #first build MR list from aws S3 bucket + if mode != 'report' and mode !='delete': + print("incorrect mode for awsclean") + return + aws_mr_list=[] + s3 = boto3.resource('s3') + my_bucket = s3.Bucket('oaitestdashboard') + for my_bucket_object in my_bucket.objects.all(): + #MR objects are like MR1407/index.html + res=re.search(r'^MR([0-9]+)',my_bucket_object.key) + if res!=None: + aws_mr_list.append(res.group(1))#store MR number as a string + #open MR list from GIt already exists as an attribute of this class self.mr_list + #parse aws MR list and delete those MR that are no longer open + for aws_mr in aws_mr_list: + if aws_mr not in self.mr_list: + if mode=="report": + print(aws_mr+' can be deleted from AWS S3') + else : + awspath="MR"+aws_mr+"/" + print('deleting ' + aws_mr) + my_bucket.objects.filter(Prefix=awspath).delete() + @@ -579,6 +603,10 @@ def main(): htmlDash.PostGitNote(mr,commit, args) else: print("Not a Merge Request => this build is for testing/debug purpose, no report to git") + elif sys.argv[1]=="awsclean": + mode=sys.argv[2]#report or delete + htmlDash=Dashboard() + htmlDash.AWSCleanup(mode) else: print("Wrong argument at position 1") From a3123aae290cb4233eb9f4537b82292a878fe99d Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Sat, 8 Jan 2022 20:39:14 +0530 Subject: [PATCH 087/113] Removed global variables --- openair1/PHY/NR_TRANSPORT/nr_dci.c | 39 +++++++++---------- openair1/PHY/NR_TRANSPORT/nr_dci.h | 4 +- openair1/PHY/NR_TRANSPORT/nr_dci_tools.c | 4 +- openair1/PHY/NR_TRANSPORT/nr_pbch.c | 5 ++- openair1/PHY/NR_TRANSPORT/nr_pss.c | 4 +- openair1/PHY/NR_TRANSPORT/nr_sss.c | 4 +- .../PHY/NR_TRANSPORT/nr_transport_proto.h | 9 ++--- openair1/PHY/defs_gNB.h | 4 -- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 9 ++--- 9 files changed, 37 insertions(+), 45 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.c b/openair1/PHY/NR_TRANSPORT/nr_dci.c index f26464fd70..523a86b99d 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.c @@ -66,12 +66,11 @@ void nr_pdcch_scrambling(uint32_t *in, } } -void nr_generate_dci(PHY_VARS_gNB *gNB, - nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15, - uint32_t **gold_pdcch_dmrs, - int32_t *txdataF, - int16_t amp, - NR_DL_FRAME_PARMS *frame_parms) { +void nr_generate_dci(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15, + uint32_t **gold_pdcch_dmrs, + int32_t *txdataF, + int16_t amp, + NR_DL_FRAME_PARMS *frame_parms) { int16_t mod_dmrs[NR_MAX_CSET_DURATION][NR_MAX_PDCCH_DMRS_LENGTH>>1] __attribute__((aligned(16))); // 3 for the max coreset duration uint16_t cset_start_sc; @@ -84,7 +83,8 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, int n_rb; // compute rb_offset and n_prb based on frequency allocation - nr_fill_cce_list(gNB,0,pdcch_pdu_rel15); + nr_cce_t cce_list[MAX_DCI_CORESET][NR_MAX_PDCCH_AGG_LEVEL]; + nr_fill_cce_list(cce_list,0,pdcch_pdu_rel15); get_coreset_rballoc(pdcch_pdu_rel15->FreqDomainResource,&n_rb,&rb_offset); cset_start_sc = frame_parms->first_carrier_offset + (pdcch_pdu_rel15->BWPStart + rb_offset) * NR_NB_SC_PER_RB; @@ -175,7 +175,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, int reg_list_order[NR_MAX_PDCCH_AGG_LEVEL] = {}; for (int p = 0; p < NR_MAX_PDCCH_AGG_LEVEL; p++) { for(int p2 = 0; p2 < dci_pdu->AggregationLevel; p2++) { - if(gNB->cce_list[d][p2].reg_list[0].reg_idx == p * NR_NB_REG_PER_CCE) { + if(cce_list[d][p2].reg_list[0].reg_idx == p * NR_NB_REG_PER_CCE) { reg_list_order[reg_list_index] = p2; reg_list_index++; break; @@ -191,7 +191,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, for (int reg_in_cce_idx = 0; reg_in_cce_idx < NR_NB_REG_PER_CCE; reg_in_cce_idx++) { - k = cset_start_sc + gNB->cce_list[d][cce_idx].reg_list[reg_in_cce_idx].start_sc_idx; + k = cset_start_sc + cce_list[d][cce_idx].reg_list[reg_in_cce_idx].start_sc_idx; if (k >= frame_parms->ofdm_symbol_size) k -= frame_parms->ofdm_symbol_size; @@ -200,9 +200,9 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, // dmrs index depends on reference point for k according to 38.211 7.4.1.3.2 if (pdcch_pdu_rel15->CoreSetType == NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG) - dmrs_idx = (gNB->cce_list[d][cce_idx].reg_list[reg_in_cce_idx].reg_idx) * 3; + dmrs_idx = (cce_list[d][cce_idx].reg_list[reg_in_cce_idx].reg_idx) * 3; else - dmrs_idx = (gNB->cce_list[d][cce_idx].reg_list[reg_in_cce_idx].reg_idx + rb_offset) * 3; + dmrs_idx = (cce_list[d][cce_idx].reg_list[reg_in_cce_idx].reg_idx + rb_offset) * 3; k_prime = 0; @@ -250,21 +250,20 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, } // for (int d=0;dnumDlDci;d++) } -void nr_generate_dci_top(PHY_VARS_gNB *gNB, - nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu, - nfapi_nr_dl_tti_pdcch_pdu *ul_dci_pdu, - uint32_t **gold_pdcch_dmrs, - int32_t *txdataF, - int16_t amp, - NR_DL_FRAME_PARMS *frame_parms) { +void nr_generate_dci_top(nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu, + nfapi_nr_dl_tti_pdcch_pdu *ul_dci_pdu, + uint32_t **gold_pdcch_dmrs, + int32_t *txdataF, + int16_t amp, + NR_DL_FRAME_PARMS *frame_parms) { AssertFatal(pdcch_pdu!=NULL || ul_dci_pdu!=NULL,"At least one pointer has to be !NULL\n"); if (pdcch_pdu) { - nr_generate_dci(gNB,&pdcch_pdu->pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms); + nr_generate_dci(&pdcch_pdu->pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms); } if (ul_dci_pdu) { - nr_generate_dci(gNB,&ul_dci_pdu->pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms); + nr_generate_dci(&ul_dci_pdu->pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms); } } diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.h b/openair1/PHY/NR_TRANSPORT/nr_dci.h index 07baaf2728..d763891f28 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.h +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.h @@ -29,7 +29,7 @@ uint16_t nr_get_dci_size(nfapi_nr_dci_format_e format, nfapi_nr_rnti_type_e rnti_type, uint16_t N_RB); -void nr_generate_dci_top(PHY_VARS_gNB *gNB, +void nr_generate_dci_top( nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu, nfapi_nr_dl_tti_pdcch_pdu *ul_pdcch_pdu, uint32_t **gold_pdcch_dmrs, @@ -57,6 +57,6 @@ void nr_fill_ul_dci(PHY_VARS_gNB *gNB, int slot, nfapi_nr_ul_dci_request_pdus_t *pdcch_pdu); -void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint8_t m,nfapi_nr_dl_tti_pdcch_pdu_rel15_t *); +void nr_fill_cce_list(nr_cce_t cce_list[MAX_DCI_CORESET][NR_MAX_PDCCH_AGG_LEVEL], uint8_t m,nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15); #endif //__PHY_NR_TRANSPORT_DCI__H diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c b/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c index 1675045443..8d5eb4a660 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c @@ -119,7 +119,7 @@ void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint16_t n_shift, uint8_t m) { */ -void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint8_t m, nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15) { +void nr_fill_cce_list(nr_cce_t cce_list[MAX_DCI_CORESET][NR_MAX_PDCCH_AGG_LEVEL], uint8_t m, nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15) { nr_cce_t* cce; nr_reg_t* reg; @@ -156,7 +156,7 @@ void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint8_t m, nfapi_nr_dl_tti_pdcch_pdu_r if (pdcch_pdu_rel15->dci_pdu[d].RNTI != 0xFFFF) LOG_D(PHY, "CCE list generation for candidate %d: bundle size %d ilv size %d CceIndex %d\n", m, bsize, R, pdcch_pdu_rel15->dci_pdu[d].CceIndex); for (uint8_t cce_idx=0; cce_idxcce_list[d][cce_idx]; + cce = &cce_list[d][cce_idx]; cce->cce_idx = pdcch_pdu_rel15->dci_pdu[d].CceIndex + cce_idx; LOG_D(PHY, "cce_idx %d\n", cce->cce_idx); diff --git a/openair1/PHY/NR_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_TRANSPORT/nr_pbch.c index a4cec432de..bf5edccb1b 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_pbch.c @@ -219,8 +219,7 @@ void nr_init_pbch_interleaver(uint8_t *interleaver) { *(interleaver+i) = *(nr_pbch_payload_interleaving_pattern+j_ssb++); } -int nr_generate_pbch(NR_gNB_PBCH *pbch, - nfapi_nr_dl_tti_ssb_pdu *ssb_pdu, +int nr_generate_pbch(nfapi_nr_dl_tti_ssb_pdu *ssb_pdu, uint8_t *interleaver, int32_t *txdataF, int16_t amp, @@ -239,6 +238,8 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch, uint64_t a_reversed=0; LOG_D(PHY, "PBCH generation started\n"); ///Payload generation + NR_gNB_PBCH m_pbch; + NR_gNB_PBCH *pbch = &m_pbch; memset((void *)pbch, 0, sizeof(NR_gNB_PBCH)); pbch->pbch_a=0; uint8_t ssb_index = ssb_pdu->ssb_pdu_rel15.SsbBlockIndex; diff --git a/openair1/PHY/NR_TRANSPORT/nr_pss.c b/openair1/PHY/NR_TRANSPORT/nr_pss.c index 535ce99143..44f74f1230 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_pss.c +++ b/openair1/PHY/NR_TRANSPORT/nr_pss.c @@ -24,8 +24,7 @@ //#define NR_PSS_DEBUG -int nr_generate_pss( int16_t *d_pss, - int32_t *txdataF, +int nr_generate_pss( int32_t *txdataF, int16_t amp, uint8_t ssb_start_symbol, nfapi_nr_config_request_scf_t* config, @@ -33,6 +32,7 @@ int nr_generate_pss( int16_t *d_pss, { int i,k,l,m; int16_t a; + int16_t d_pss[NR_PSS_LENGTH]; int16_t x[NR_PSS_LENGTH]; const int x_initial[7] = {0, 1, 1 , 0, 1, 1, 1}; diff --git a/openair1/PHY/NR_TRANSPORT/nr_sss.c b/openair1/PHY/NR_TRANSPORT/nr_sss.c index de92237f6c..12f89ba36f 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_sss.c +++ b/openair1/PHY/NR_TRANSPORT/nr_sss.c @@ -23,8 +23,7 @@ //#define NR_SSS_DEBUG -int nr_generate_sss( int16_t *d_sss, - int32_t *txdataF, +int nr_generate_sss( int32_t *txdataF, int16_t amp, uint8_t ssb_start_symbol, nfapi_nr_config_request_scf_t* config, @@ -34,6 +33,7 @@ int nr_generate_sss( int16_t *d_sss, int m0, m1; int Nid, Nid1, Nid2; //int16_t a; + int16_t d_sss[NR_SSS_LENGTH]; int16_t x0[NR_SSS_LENGTH], x1[NR_SSS_LENGTH]; const int x0_initial[7] = { 1, 0, 0, 0, 0, 0, 0 }; const int x1_initial[7] = { 1, 0, 0, 0, 0, 0, 0 }; diff --git a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h index 4fed3a468f..5cc246fd29 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h +++ b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h @@ -44,8 +44,7 @@ @param @returns 0 on success */ -int nr_generate_pss(int16_t *d_pss, - int32_t *txdataF, +int nr_generate_pss(int32_t *txdataF, int16_t amp, uint8_t ssb_start_symbol, nfapi_nr_config_request_scf_t *config, @@ -57,8 +56,7 @@ int nr_generate_pss(int16_t *d_pss, @param @returns 0 on success */ -int nr_generate_sss(int16_t *d_sss, - int32_t *txdataF, +int nr_generate_sss(int32_t *txdataF, int16_t amp, uint8_t ssb_start_symbol, nfapi_nr_config_request_scf_t *config, @@ -83,8 +81,7 @@ int nr_generate_pbch_dmrs(uint32_t *gold_pbch_dmrs, @param @returns 0 on success */ -int nr_generate_pbch(NR_gNB_PBCH *pbch, - nfapi_nr_dl_tti_ssb_pdu *ssb_pdu, +int nr_generate_pbch(nfapi_nr_dl_tti_ssb_pdu *ssb_pdu, uint8_t *interleaver, int32_t *txdataF, int16_t amp, diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index edcac7a91d..e0a67f29e7 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -753,7 +753,6 @@ typedef struct PHY_VARS_gNB_s { // nfapi_nr_ul_dci_request_pdus_t *ul_dci_pdu; uint16_t num_pdsch_rnti[80]; NR_gNB_PBCH pbch; - nr_cce_t cce_list[MAX_DCI_CORESET][NR_MAX_PDCCH_AGG_LEVEL]; NR_gNB_COMMON common_vars; NR_gNB_PRACH prach_vars; NR_gNB_PUSCH *pusch_vars[NUMBER_OF_NR_ULSCH_MAX]; @@ -776,9 +775,6 @@ typedef struct PHY_VARS_gNB_s { // PUCCH0 Look-up table for cyclic-shifts NR_gNB_PUCCH0_LUT_t pucch0_lut; - /// NR synchronization sequences - int16_t d_pss[NR_PSS_LENGTH]; - int16_t d_sss[NR_SSS_LENGTH]; /// PBCH DMRS sequence uint32_t nr_gold_pbch_dmrs[2][64][NR_PBCH_DMRS_LENGTH_DWORD]; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index c86f5bd682..4086a3227c 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -91,8 +91,8 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_ nr_set_ssb_first_subcarrier(cfg, fp); // setting the first subcarrier LOG_D(PHY,"SS TX: frame %d, slot %d, start_symbol %d\n",frame,slot, ssb_start_symbol); - nr_generate_pss(gNB->d_pss, &txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); - nr_generate_sss(gNB->d_sss, &txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); + nr_generate_pss(&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); + nr_generate_sss(&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); if (cfg->carrier_config.num_tx_ant.value <= 4) nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[n_hf][ssb_index&7],&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); @@ -114,8 +114,7 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_ gNB->common_vars.beam_id[0][slot*fp->symbols_per_slot+j] = cfg->ssb_table.ssb_beam_id_list[ssb_index].beam_id.value; } - nr_generate_pbch(&gNB->pbch, - &ssb_pdu, + nr_generate_pbch(&ssb_pdu, gNB->nr_pbch_interleaver, &txdataF[0][txdataF_offset], AMP, @@ -168,7 +167,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_PDCCH_TX,1); - nr_generate_dci_top(gNB, + nr_generate_dci_top( num_dl_dci > 0 ? &msgTx->pdcch_pdu : NULL, num_ul_dci > 0 ? &msgTx->ul_pdcch_pdu.pdcch_pdu : NULL, gNB->nr_gold_pdcch_dmrs[slot], From f43a69c5dc0b60568d61ce1514a4c82e0b7bef89 Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Wed, 12 Jan 2022 14:50:33 +0530 Subject: [PATCH 088/113] Removed reuse of txdataF buffer on 2 slot basis --- openair1/PHY/NR_TRANSPORT/nr_csi_rs.c | 2 +- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 54 +++++++++++------------ openair1/SCHED_NR/nr_ru_procedures.c | 6 +-- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 4 +- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_csi_rs.c b/openair1/PHY/NR_TRANSPORT/nr_csi_rs.c index ac0eac8a79..4f5baacc34 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_csi_rs.c +++ b/openair1/PHY/NR_TRANSPORT/nr_csi_rs.c @@ -35,7 +35,7 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB, NR_DL_FRAME_PARMS frame_parms=gNB->frame_parms; int32_t **txdataF = gNB->common_vars.txdataF; - int txdataF_offset = (slot%2)*frame_parms.samples_per_slot_wCP; + int txdataF_offset = slot*frame_parms.samples_per_slot_wCP; uint32_t **gold_csi_rs = gNB->nr_gold_csi_rs[slot]; int16_t mod_csi[frame_parms.symbols_per_slot][NR_MAX_CSI_RS_LENGTH>>1] __attribute__((aligned(16)));; uint16_t b = csi_params.freq_domain; diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index 9bbc61d4b6..2e8813cbd2 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -276,7 +276,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, if (start_sc >= frame_parms->ofdm_symbol_size) start_sc -= frame_parms->ofdm_symbol_size; - int txdataF_offset = (slot%2)*frame_parms->samples_per_slot_wCP; + int txdataF_offset = slot*frame_parms->samples_per_slot_wCP; #ifdef DEBUG_DLSCH_MAPPING printf("PDSCH resource mapping started (start SC %d\tstart symbol %d\tN_PRB %d\tnb_re %d,nb_layers %d)\n", @@ -375,12 +375,12 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, /* Map DMRS Symbol */ if ( (dmrs_symbol_map & (1 << l)) && (k == ((start_sc+get_dmrs_freq_idx(n, k_prime, delta, dmrs_Type))%(frame_parms->ofdm_symbol_size)))) { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 ] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15; #ifdef DEBUG_DLSCH_MAPPING printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n", - dmrs_idx, l, k, k_prime, n, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); + dmrs_idx, l, k, k_prime, n, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1)], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1]); #endif dmrs_idx++; k_prime++; @@ -388,8 +388,8 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, n+=(k_prime)?0:1; } else if(is_ptrs_re){ - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[ptrs_idx<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[(ptrs_idx<<1) + 1])>> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = (beta_ptrs*amp*mod_ptrs[ptrs_idx<<1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = (beta_ptrs*amp*mod_ptrs[(ptrs_idx<<1) + 1])>> 15; #ifdef DEBUG_DLSCH_MAPPING printf("ptrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d, mod_ptrs: %d %d\n", ptrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], @@ -399,19 +399,19 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } /* Map DATA Symbol */ else if( ptrs_symbol || allowed_xlsch_re_in_dmrs_symbol(k,start_sc,frame_parms->ofdm_symbol_size,rel15->numDmrsCdmGrpsNoData,dmrs_Type)) { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (amp * tx_layers[ap][m<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = (amp * tx_layers[ap][m<<1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15; #ifdef DEBUG_DLSCH_MAPPING printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", - m, l, k, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); + m, l, k, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1)], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1]); #endif m++; } /* mute RE */ else { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = 0; } if (++k >= frame_parms->ofdm_symbol_size) k -= frame_parms->ofdm_symbol_size; @@ -427,7 +427,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } // fix the alignment issues later, use 64-bit SIMD below instead of 128. if (0/*(frame_parms->N_RB_DL&1)==0*/) { - __m128i *txF=(__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc+txdataF_offset)<<1)]; + __m128i *txF=(__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc)<<1)]; __m128i *txl = (__m128i*)&tx_layers[ap][m<<1]; __m128i amp128=_mm_set1_epi16(amp); @@ -436,7 +436,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } //RE loop, first part m+=upper_limit; if (remaining_re > 0) { - txF = (__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+txdataF_offset)<<1)]; + txF = (__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size)<<1)]; txl = (__m128i*)&tx_layers[ap][m<<1]; for (int i=0; i<(remaining_re>>2); i++) { txF[i] = _mm_mulhrs_epi16(amp128,txl[i]); @@ -444,7 +444,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } } else { - __m64 *txF=(__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc+txdataF_offset)<<1)]; + __m64 *txF=(__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc)<<1)]; __m64 *txl = (__m64*)&tx_layers[ap][m<<1]; __m64 amp64=_mm_set1_pi16(amp); @@ -454,31 +454,31 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, #ifdef DEBUG_DLSCH_MAPPING if ((i&1) > 0) printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", - m, l, start_sc+(i>>1), txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1) + 1 + (2*txdataF_offset)]); + m, l, start_sc+(i>>1), txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1)], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1) + 1]); #endif /* handle this, mute RE */ /*else { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = 0; }*/ } //RE loop, first part m+=upper_limit; if (remaining_re > 0) { - txF = (__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+txdataF_offset)<<1)]; + txF = (__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size)<<1)]; txl = (__m64*)&tx_layers[ap][m<<1]; for (int i=0; i<(remaining_re>>1); i++) { txF[i] = _mm_mulhrs_pi16(amp64,txl[i]); #ifdef DEBUG_DLSCH_MAPPING if ((i&1) > 0) printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", - m, l, i>>1, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) + 1 + (2*txdataF_offset)]); + m, l, i>>1, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) ], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) + 1]); #endif /* handle this, mute RE */ /*else { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = 0; }*/ } //RE loop, second part } // @@ -515,7 +515,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, if (pmi == 0) {//unitary Precoding if(apnrOfLayers) memcpy((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k], - (void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size + txdataF_offset+ k)], + (void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size + k)], NR_NB_SC_PER_RB*sizeof(int32_t)); else memset((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k], @@ -556,7 +556,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } for (int i=0; iofdm_symbol_size + k; - int32_t precodatatx_F = nr_layer_precoder(txdataF_precoding, W_prec, rel15->nrOfLayers, re_offset+txdataF_offset); + int32_t precodatatx_F = nr_layer_precoder(txdataF_precoding, W_prec, rel15->nrOfLayers, re_offset); ((int16_t*)txdataF[ap])[(re_offset<<1) + (2*txdataF_offset)] = ((int16_t *) &precodatatx_F)[0]; ((int16_t*)txdataF[ap])[(re_offset<<1) + 1 + (2*txdataF_offset)] = ((int16_t *) &precodatatx_F)[1]; #ifdef DEBUG_DLSCH_MAPPING diff --git a/openair1/SCHED_NR/nr_ru_procedures.c b/openair1/SCHED_NR/nr_ru_procedures.c index 3f4c2f71fb..4d3174007a 100644 --- a/openair1/SCHED_NR/nr_ru_procedures.c +++ b/openair1/SCHED_NR/nr_ru_procedures.c @@ -155,7 +155,7 @@ void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx) { int aa = 0;//physical antenna number int ret = 0; int ofdm_mask_full = (1<<(ru->nb_tx*2))-1; - int txdataF_offset = ((tti_tx%2)*fp->samples_per_slot_wCP); + int txdataF_offset = (tti_tx*fp->samples_per_slot_wCP); if (nr_slot_select(cfg,frame_tx,slot) == NR_UPLINK_SLOT) return; for (aa=0; aanb_tx; aa++) memset(ru->common.txdataF[aa],0,fp->samples_per_slot_wCP*sizeof(int32_t)); @@ -300,7 +300,7 @@ static void *nr_feptx_thread(void *param) { ofdm_mask_full = (1<<(ru->nb_tx*2))-1; if(ru->num_gNB != 0){ - txdataF_offset = ((slot%2)*fp->samples_per_slot_wCP); + txdataF_offset = (slot*fp->samples_per_slot_wCP); ////////////precoding//////////// VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+feptx->index+1 , 1); @@ -464,7 +464,7 @@ void nr_feptx_prec(RU_t *ru,int frame_tx,int tti_tx) { int32_t ***bw; int i=0; int slot_tx = tti_tx; - int txdataF_offset = ((tti_tx%2)*fp->samples_per_slot_wCP); + int txdataF_offset = (tti_tx*fp->samples_per_slot_wCP); start_meas(&ru->precoding_stats); AssertFatal(ru->nb_log_antennas > 0,"ru->nb_log_antennas is 0!\n"); diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 4086a3227c..4a916593c3 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -74,7 +74,7 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_ int **txdataF = gNB->common_vars.txdataF; uint8_t ssb_index, n_hf; uint16_t ssb_start_symbol; - int txdataF_offset = (slot%2)*fp->samples_per_slot_wCP; + int txdataF_offset = slot*fp->samples_per_slot_wCP; uint16_t slots_per_hf = (fp->slots_per_frame)>>1; if (slotframe_parms; nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; int offset = gNB->CC_id; - int txdataF_offset = (slot%2)*fp->samples_per_slot_wCP; + int txdataF_offset = slot*fp->samples_per_slot_wCP; if ((cfg->cell_config.frame_duplex_type.value == TDD) && (nr_slot_select(cfg,frame,slot) == NR_UPLINK_SLOT)) return; diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 6a2aba5944..6dc770f0ed 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -1104,7 +1104,7 @@ int main(int argc, char **argv) else phy_procedures_gNB_TX(msgDataTx,frame,slot,1); - int txdataF_offset = (slot%2) * frame_parms->samples_per_slot_wCP; + int txdataF_offset = slot * frame_parms->samples_per_slot_wCP; if (n_trials==1) { LOG_M("txsigF0.m","txsF0=", &gNB->common_vars.txdataF[0][txdataF_offset+2*frame_parms->ofdm_symbol_size],frame_parms->ofdm_symbol_size,1,1); From b48bae761f1318de3cc7f5c6bcbdafbaef458ad7 Mon Sep 17 00:00:00 2001 From: hardy Date: Fri, 28 Jan 2022 09:04:43 +0100 Subject: [PATCH 089/113] add stats for multiple tests + fix stat files concatenation --- ci-scripts/ran.py | 4 ++-- ci-scripts/stats_monitor.py | 22 ++++++++++++++-------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index baf3a00725..da20998297 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -493,9 +493,9 @@ class RANManagement(): conf_file='../ci-scripts/stats_monitor_conf.yaml' if self.eNB_Stats=='yes': if (self.air_interface[self.eNB_instance] == 'lte-softmodem') or (self.air_interface[self.eNB_instance] == 'ocp-enb'): - mySSH.command('echo $USER; nohup python3 ' + monitor_file + ' ' + conf_file + ' enb 2>&1 > enb_stats_monitor_execution.log &', '\$', 5) + mySSH.command('echo $USER; nohup python3 ' + monitor_file + ' ' + conf_file + ' ' + self.testCase_id + ' enb 2>&1 > enb_stats_monitor_execution.log &', '\$', 5) else: - mySSH.command('echo $USER; nohup python3 ' + monitor_file + ' ' + conf_file + ' gnb 2>&1 > gnb_stats_monitor_execution.log &', '\$', 5) + mySSH.command('echo $USER; nohup python3 ' + monitor_file + ' ' + conf_file + ' ' + self.testCase_id + ' gnb 2>&1 > gnb_stats_monitor_execution.log &', '\$', 5) diff --git a/ci-scripts/stats_monitor.py b/ci-scripts/stats_monitor.py index e732325fa1..e4dcc53bc2 100755 --- a/ci-scripts/stats_monitor.py +++ b/ci-scripts/stats_monitor.py @@ -11,6 +11,7 @@ import pickle import matplotlib.pyplot as plt import numpy as np import yaml +import os class StatMonitor(): @@ -66,11 +67,15 @@ class StatMonitor(): files = ["nrL1_stats.log", "nrMAC_stats.log", "nrPDCP_stats.log", "nrRRC_stats.log"] # append each file's contents to another file (prepended with CI-) for # post-mortem/debugging analysis - for f in files: - cmd = rf'cat {f} >> CI-{f}' - subprocess.Popen(shlex.split(cmd)) + #for f in files: + # cmd = 'cat '+ f + ' >> CI-' + f + # if os.path.isfile(f): + # subprocess.Popen(cmd,shell=True) # join the files for further processing - cmd = rf'cat {shlex.join(files)}' + cmd='cat ' + for f in files: + if os.path.isfile(f): + cmd += f+' ' process=subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE) output = process.stdout.readlines() if node_type=='enb': @@ -79,7 +84,7 @@ class StatMonitor(): self.process_gnb(node_type,output) - def graph(self,node_type): + def graph(self,testcase_id, node_type): for page in self.d[node_type]['graph']:#work out a set a graphs per page col = 1 figure, axis = plt.subplots(len(self.d[node_type]['graph'][page]), col ,figsize=(10, 10)) @@ -110,13 +115,14 @@ class StatMonitor(): plt.tight_layout() #save as png - plt.savefig(node_type+'_stats_monitor_'+page+'.png') + plt.savefig(node_type+'_stats_monitor_'+testcase_id+'_'+page+'.png') if __name__ == "__main__": cfg_filename = sys.argv[1] #yaml file as metrics config - node = sys.argv[2]#enb or gnb + testcase_id = sys.argv[2] #test case id to name files accordingly, especially if we have several tests in a sequence + node = sys.argv[3]#enb or gnb mon=StatMonitor(cfg_filename) #collecting stats when modem process is stopped @@ -131,4 +137,4 @@ if __name__ == "__main__": print('Process stopped') with open(node+'_stats_monitor.pickle', 'wb') as handle: pickle.dump(mon.d, handle, protocol=pickle.HIGHEST_PROTOCOL) - mon.graph(node) + mon.graph(testcase_id, node) From 3c1c6e3cb18fcaa2e7191b04a2f023aa2a098eae Mon Sep 17 00:00:00 2001 From: hardy Date: Fri, 7 Jan 2022 16:24:15 +0100 Subject: [PATCH 090/113] adding tcp bidir option to CI tests --- ci-scripts/cls_oaicitest.py | 96 +++++++++++++++++++++++- ci-scripts/main.py | 2 +- ci-scripts/xml_files/fr1_nsa_quectel.xml | 10 +++ ci-scripts/xml_files/fr1_sa_quectel.xml | 10 +++ 4 files changed, 114 insertions(+), 4 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index b8b99a053b..a249bc2ee8 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -2009,6 +2009,35 @@ class OaiCiTest(): else: return -2 + + def Iperf_analyzeV2BIDIR(self, lock, UE_IPAddress, device_id, statusQueue,server_filename,client_filename): + #server file is unused for the moment + if (not os.path.isfile(client_filename)): + self.ping_iperf_wrong_exit(lock, UE_IPAddress, device_id, statusQueue, 'Bidir TCP : Could not analyze from client log') + return + report=[] + report_msg='Client Report:\n' + with open(client_filename, 'r') as f_client: + for line in f_client.readlines(): + result = re.search(rf'^\[\s+\d+\](?P\[.+\]).*\s+(?P[0-9\.]+ [KMG]bits\/sec).*\s+(?P\bsender|receiver\b)', str(line)) + if result is not None: + report.append(str(line)) + report_msg+=result.group('role') + ' ' + result.group('direction')+ '\t = ' +result.group('bitrate')+'\n' + + if len(report)>0: + lock.acquire() + statusQueue.put(0) + statusQueue.put(device_id) + statusQueue.put(UE_IPAddress) + statusQueue.put(report_msg) + logging.debug('\u001B[1;37;45m TCP Bidir Iperf Result (' + UE_IPAddress + ') \u001B[0m') + logging.debug('\u001B[1;35m ' + report_msg + '\u001B[0m') + lock.release() + else: + self.ping_iperf_wrong_exit(lock, UE_IPAddress, device_id, statusQueue, 'Bidir TCP : Could not analyze from client log') + + + def Iperf_analyzeV2Server(self, lock, UE_IPAddress, device_id, statusQueue, iperf_real_options, filename,type): if (not os.path.isfile(filename)): self.ping_iperf_wrong_exit(lock, UE_IPAddress, device_id, statusQueue, 'Could not analyze from server log') @@ -2297,14 +2326,19 @@ class OaiCiTest(): result = re.search('TRF_IP_ADDR = (?P[0-9\.]+)', SSH.getBefore()) if result is not None: trf_gen_IP = result.group('trf_ip_addr') + #kill iperf processes on EPC side + SSH.command('docker exec -it prod-trf-gen /bin/bash -c "killall --signal SIGKILL iperf"', '\$', 5) + SSH.command('docker exec -it prod-trf-gen /bin/bash -c "killall --signal SIGKILL iperf3"', '\$', 5) SSH.close() #kill iperf processes on UE side before (in case there are still some remaining) SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword) cmd = 'killall --signal=SIGKILL iperf' SSH.command(cmd,'\$',5) + cmd = 'killall --signal=SIGKILL iperf3' + SSH.command(cmd,'\$',5) SSH.close() - iperf_time = self.Iperf_ComputeTime() + iperf_time = self.Iperf_ComputeTime() if self.iperf_direction=="DL": logging.debug("Iperf for Module in DL mode detected") #server side UE @@ -2318,7 +2352,7 @@ class OaiCiTest(): #client side EPC SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) client_filename = 'iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log' - SSH.command('docker exec -it prod-trf-gen /bin/bash -c "killall --signal SIGKILL iperf"', '\$', 5) + iperf_cmd = 'bin/iperf -c ' + UE_IPAddress + ' ' + self.iperf_args + ' 2>&1 > ' + client_filename cmd = 'docker exec -it prod-trf-gen /bin/bash -c \"' + iperf_cmd + '\"' SSH.command(cmd,'\$',int(iperf_time)*5.0) @@ -2337,7 +2371,7 @@ class OaiCiTest(): #server side EPC SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) server_filename = 'iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log' - SSH.command('docker exec -it prod-trf-gen /bin/bash -c "killall --signal SIGKILL iperf"', '\$', 5) + iperf_cmd = 'echo $USER; nohup bin/iperf -s -u 2>&1 > ' + server_filename cmd = 'docker exec -d prod-trf-gen /bin/bash -c \"' + iperf_cmd + '\"' SSH.command(cmd,'\$',5) @@ -2362,6 +2396,38 @@ class OaiCiTest(): SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, server_filename, '.') #send for analysis self.Iperf_analyzeV2Server(lock, UE_IPAddress, device_id, statusQueue, self.iperf_args,server_filename,1) + + elif self.iperf_direction=="BIDIR": + logging.debug("Iperf for Module in BIDIR mode detected") + #server side EPC + SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) + server_filename = 'iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log' + + iperf_cmd = 'echo $USER; nohup /usr/local/bin/iperf3 -s 2>&1 > ' + server_filename + cmd = 'docker exec -d prod-trf-gen /bin/bash -c \"' + iperf_cmd + '\"' + SSH.command(cmd,'\$',5) + SSH.close() + + #client side UE + SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword) + client_filename = 'iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log' + cmd = 'rm '+ client_filename + SSH.command(cmd,'\$',5) + SSH.command('iperf3 -B ' + UE_IPAddress + ' -c ' + trf_gen_IP + ' ' + self.iperf_args + ' 2>&1 > ' + client_filename, '\$', int(iperf_time)*5.0) + SSH.close() + + #once client is done, retrieve the server file from container to EPC Host + SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) + SSH.command('docker cp prod-trf-gen:/iperf-2.0.13/' + server_filename + ' ' + EPC.SourceCodePath, '\$', 5) + SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, EPC.SourceCodePath + '/' + server_filename, '.') + SSH.close() + + #copy the 2 resulting files locally + SSH.copyin(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword, client_filename, '.') + SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, server_filename, '.') + #send for analysis + self.Iperf_analyzeV2BIDIR(lock, UE_IPAddress, device_id, statusQueue, server_filename, client_filename) + else : logging.debug("Incorrect or missing IPERF direction in XML") @@ -2427,6 +2493,30 @@ class OaiCiTest(): #send for analysis filename='iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log' self.Iperf_analyzeV2Server(lock, UE_IPAddress, device_id, statusQueue, self.iperf_args,filename,1) + elif self.iperf_direction=="BIDIR": + logging.debug("Iperf for Module in BIDIR mode detected") + #server side EPC + SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) + server_filename = 'iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log' + cmd = 'rm ' + server_filename + SSH.command(cmd,'\$',5) + cmd = 'echo $USER; nohup iperf3 -s 2>&1 > '+server_filename+' &' + SSH.command(cmd,'\$',5) + SSH.close() + + #client side UE + SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword) + client_filename = 'iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log' + cmd = 'rm ' + client_filename + SSH.command(cmd,'\$',5) + SSH.command('iperf3 -c 192.172.0.1 ' + self.iperf_args + ' 2>&1 > '+client_filename, '\$', int(iperf_time)*5.0) + SSH.close() + + #copy the 2 resulting files locally + SSH.copyin(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword, client_filename, '.') + SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, server_filename, '.') + #send for analysis + self.Iperf_analyzeV2BIDIR(lock, UE_IPAddress, device_id, statusQueue, server_filename, client_filename) else : logging.debug("Incorrect or missing IPERF direction in XML") diff --git a/ci-scripts/main.py b/ci-scripts/main.py index ddf9bb531e..e711931078 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -308,7 +308,7 @@ def GetParametersFromXML(action): CiTestObj.ue_id = "" else: CiTestObj.ue_id = ue_id - CiTestObj.iperf_direction = test.findtext('direction')#used for modules only + CiTestObj.iperf_direction = test.findtext('direction')#used for modules only CiTestObj.iperf_packetloss_threshold = test.findtext('iperf_packetloss_threshold') CiTestObj.iperf_profile = test.findtext('iperf_profile') if (CiTestObj.iperf_profile is None): diff --git a/ci-scripts/xml_files/fr1_nsa_quectel.xml b/ci-scripts/xml_files/fr1_nsa_quectel.xml index 6414f09b6b..e4faff706b 100644 --- a/ci-scripts/xml_files/fr1_nsa_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_quectel.xml @@ -38,6 +38,8 @@ 000001 070001 000001 + 070002 + 000001 050000 050001 010002 @@ -132,6 +134,14 @@ single-ue + + Iperf + iperf (BIDIR TCP)(10 sec)(single-ue profile) + -t 10 --bidir + BIDIR + idefix + single-ue + Terminate_eNB diff --git a/ci-scripts/xml_files/fr1_sa_quectel.xml b/ci-scripts/xml_files/fr1_sa_quectel.xml index 4db5bb64a5..169564d734 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel.xml @@ -34,6 +34,7 @@ 050001 070000 070001 + 070002 000001 010002 080000 @@ -118,6 +119,15 @@ single-ue + + Iperf + iperf (BIDIR TCP)(10 sec)(single-ue profile) + -t 10 --bidir + BIDIR + nrmodule2_quectel + single-ue + + Terminate_eNB From a2b0f455cd92066f327ff07878921f7cbd1536e1 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Mon, 24 Jan 2022 12:35:22 -0800 Subject: [PATCH 091/113] Updating config file for min_rxtxtime --- .../episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf | 2 +- .../episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf index 01add06e3a..43d3a4d298 100644 --- a/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -36,7 +36,7 @@ gNBs = pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; ul_prbblacklist = "51,52,53,54" - min_rxtxtime_pdsch = 6; + min_rxtxtime = 6; pdcch_ConfigSIB1 = ( { controlResourceSetZero = 12; diff --git a/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf index ab0cf5f469..a6e124bf6a 100644 --- a/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -36,7 +36,7 @@ gNBs = pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; ul_prbblacklist = "51,52,53,54" - min_rxtxtime_pdsch = 6; + min_rxtxtime = 6; pdcch_ConfigSIB1 = ( { From f211d26d6f1f436aeec2785ed1edf2d931a67226 Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Mon, 31 Jan 2022 22:27:27 +0530 Subject: [PATCH 092/113] Code cleanup --- openair1/PHY/NR_TRANSPORT/nr_dci.c | 2 +- openair1/PHY/NR_TRANSPORT/nr_pss.c | 40 +++++++++++--------------- openair1/PHY/NR_TRANSPORT/nr_sss.c | 45 +++++++++++++----------------- 3 files changed, 36 insertions(+), 51 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.c b/openair1/PHY/NR_TRANSPORT/nr_dci.c index 523a86b99d..945d8ca909 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.c @@ -251,7 +251,7 @@ void nr_generate_dci(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15, } void nr_generate_dci_top(nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu, - nfapi_nr_dl_tti_pdcch_pdu *ul_dci_pdu, + nfapi_nr_dl_tti_pdcch_pdu *ul_dci_pdu, uint32_t **gold_pdcch_dmrs, int32_t *txdataF, int16_t amp, diff --git a/openair1/PHY/NR_TRANSPORT/nr_pss.c b/openair1/PHY/NR_TRANSPORT/nr_pss.c index 44f74f1230..8564efe3de 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_pss.c +++ b/openair1/PHY/NR_TRANSPORT/nr_pss.c @@ -30,49 +30,41 @@ int nr_generate_pss( int32_t *txdataF, nfapi_nr_config_request_scf_t* config, NR_DL_FRAME_PARMS *frame_parms) { - int i,k,l,m; - int16_t a; - int16_t d_pss[NR_PSS_LENGTH]; int16_t x[NR_PSS_LENGTH]; const int x_initial[7] = {0, 1, 1 , 0, 1, 1, 1}; - uint8_t Nid2 = config->cell_config.phy_cell_id.value % 3; - /// Sequence generation - for (i=0; i < 7; i++) + for (int i=0; i < 7; i++) x[i] = x_initial[i]; - for (i=0; i < (NR_PSS_LENGTH - 7); i++) { + for (int i=0; i < (NR_PSS_LENGTH - 7); i++) { x[i+7] = (x[i + 4] + x[i]) %2; } - for (i=0; i < NR_PSS_LENGTH; i++) { - m = (i + 43*Nid2)%(NR_PSS_LENGTH); - d_pss[i] = (1 - 2*x[m]) * 23170; - } - #ifdef NR_PSS_DEBUG write_output("d_pss.m", "d_pss", (void*)d_pss, NR_PSS_LENGTH, 1, 0); printf("PSS: ofdm_symbol_size %d, first_carrier_offset %d\n",frame_parms->ofdm_symbol_size,frame_parms->first_carrier_offset); #endif /// Resource mapping - a = amp; - // PSS occupies a predefined position (subcarriers 56-182, symbol 0) within the SSB block starting from - k = frame_parms->first_carrier_offset + frame_parms->ssb_start_subcarrier + 56; //and - if (k>= frame_parms->ofdm_symbol_size) k-=frame_parms->ofdm_symbol_size; + // PSS occupies a predefined position (subcarriers 56-182, symbol 0) within the SSB block starting from + int k = frame_parms->first_carrier_offset + frame_parms->ssb_start_subcarrier + 56; //and + if (k>= frame_parms->ofdm_symbol_size) k-=frame_parms->ofdm_symbol_size; - l = ssb_start_symbol; + int l = ssb_start_symbol; - for (m = 0; m < NR_PSS_LENGTH; m++) { - // printf("pss: writing position k %d / %d\n",k,frame_parms->ofdm_symbol_size); - ((int16_t*)txdataF)[2*(l*frame_parms->ofdm_symbol_size + k)] = (a * d_pss[m]) >> 15; - k++; + uint8_t Nid2 = config->cell_config.phy_cell_id.value % 3; + for (int i = 0; i < NR_PSS_LENGTH; i++) { + int m = (i + 43*Nid2)%(NR_PSS_LENGTH); + int16_t d_pss = (1 - 2*x[m]) * 23170; + // printf("pss: writing position k %d / %d\n",k,frame_parms->ofdm_symbol_size); + ((int16_t*)txdataF)[2*(l*frame_parms->ofdm_symbol_size + k)] = (((int16_t)amp) * d_pss) >> 15; + k++; - if (k >= frame_parms->ofdm_symbol_size) - k-=frame_parms->ofdm_symbol_size; - } + if (k >= frame_parms->ofdm_symbol_size) + k-=frame_parms->ofdm_symbol_size; + } #ifdef NR_PSS_DEBUG LOG_M("pss_0.m", "pss_0", diff --git a/openair1/PHY/NR_TRANSPORT/nr_sss.c b/openair1/PHY/NR_TRANSPORT/nr_sss.c index 12f89ba36f..5181f6bac1 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_sss.c +++ b/openair1/PHY/NR_TRANSPORT/nr_sss.c @@ -29,36 +29,28 @@ int nr_generate_sss( int32_t *txdataF, nfapi_nr_config_request_scf_t* config, NR_DL_FRAME_PARMS *frame_parms) { - int i,k,l; - int m0, m1; - int Nid, Nid1, Nid2; - //int16_t a; - int16_t d_sss[NR_SSS_LENGTH]; - int16_t x0[NR_SSS_LENGTH], x1[NR_SSS_LENGTH]; + int16_t x0[NR_SSS_LENGTH]; + int16_t x1[NR_SSS_LENGTH]; const int x0_initial[7] = { 1, 0, 0, 0, 0, 0, 0 }; const int x1_initial[7] = { 1, 0, 0, 0, 0, 0, 0 }; /// Sequence generation - Nid = config->cell_config.phy_cell_id.value; - Nid2 = Nid % 3; - Nid1 = (Nid - Nid2)/3; + int Nid = config->cell_config.phy_cell_id.value; + int Nid2 = Nid % 3; + int Nid1 = (Nid - Nid2)/3; - for ( i=0 ; i < 7 ; i++) { + for (int i=0; i < 7; i++) { x0[i] = x0_initial[i]; x1[i] = x1_initial[i]; } - for ( i=0 ; i < NR_SSS_LENGTH - 7 ; i++) { + for (int i=0; i < NR_SSS_LENGTH - 7; i++) { x0[i+7] = (x0[i + 4] + x0[i]) % 2; x1[i+7] = (x1[i + 1] + x1[i]) % 2; } - m0 = 15*(Nid1/112) + (5*Nid2); - m1 = Nid1 % 112; - - for (i = 0; i < NR_SSS_LENGTH ; i++) { - d_sss[i] = (1 - 2*x0[(i + m0) % NR_SSS_LENGTH] ) * (1 - 2*x1[(i + m1) % NR_SSS_LENGTH] ) * 23170; - } + int m0 = 15*(Nid1/112) + (5*Nid2); + int m1 = Nid1 % 112; #ifdef NR_SSS_DEBUG write_output("d_sss.m", "d_sss", (void*)d_sss, NR_SSS_LENGTH, 1, 1); @@ -66,17 +58,18 @@ int nr_generate_sss( int32_t *txdataF, /// Resource mapping - // SSS occupies a predefined position (subcarriers 56-182, symbol 2) within the SSB block starting from - k = frame_parms->first_carrier_offset + frame_parms->ssb_start_subcarrier + 56; //and - l = ssb_start_symbol + 2; + // SSS occupies a predefined position (subcarriers 56-182, symbol 2) within the SSB block starting from + int k = frame_parms->first_carrier_offset + frame_parms->ssb_start_subcarrier + 56; //and + int l = ssb_start_symbol + 2; - for (int m = 0; m < NR_SSS_LENGTH; m++) { - ((int16_t*)txdataF)[2*(l*frame_parms->ofdm_symbol_size + k)] = (amp * d_sss[m]) >> 15; - k++; + for (int i = 0; i < NR_SSS_LENGTH; i++) { + int16_t d_sss = (1 - 2*x0[(i + m0) % NR_SSS_LENGTH] ) * (1 - 2*x1[(i + m1) % NR_SSS_LENGTH] ) * 23170; + ((int16_t*)txdataF)[2*(l*frame_parms->ofdm_symbol_size + k)] = (((int16_t)amp) * d_sss) >> 15; + k++; - if (k >= frame_parms->ofdm_symbol_size) - k-=frame_parms->ofdm_symbol_size; - } + if (k >= frame_parms->ofdm_symbol_size) + k-=frame_parms->ofdm_symbol_size; + } #ifdef NR_SSS_DEBUG // write_output("sss_0.m", "sss_0", (void*)txdataF[0][l*frame_parms->ofdm_symbol_size], frame_parms->ofdm_symbol_size, 1, 1); #endif From d263f199358cdd6416f39748da4760ca9c5da573 Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Mon, 31 Jan 2022 22:27:47 +0530 Subject: [PATCH 093/113] Making Tx thread count to 2 --- executables/nr-gnb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 9551a71921..8009bc58dc 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -443,7 +443,7 @@ void init_gNB_Tpool(int inst) { initNotifiedFIFO(gNB->L1_tx_out); // we create 2 threads for L1 tx processing - for (int i=0; i < 1; i++) { + for (int i=0; i < 2; i++) { notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->L1_tx_out,tx_func); processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx); init_DLSCH_struct(gNB, msgDataTx); From e4acf7e21df69669cb708909a48004df7fe9cbf5 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 31 Jan 2022 19:21:06 +0100 Subject: [PATCH 094/113] bugfix for pdu_index in sib1 sched function --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index eca68d8573..0af340725a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -433,6 +433,7 @@ uint32_t schedule_control_sib1(module_id_t module_id, void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP, nfapi_nr_dl_tti_request_body_t *dl_req, + int pdu_index, NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config, uint32_t TBS, int StartSymbolIndex, @@ -465,7 +466,7 @@ void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP, pdsch_pdu_rel15->pduBitmap = 0; pdsch_pdu_rel15->rnti = SI_RNTI; - pdsch_pdu_rel15->pduIndex = gNB_mac->pdu_index[0]++; + pdsch_pdu_rel15->pduIndex = pdu_index; pdsch_pdu_rel15->BWPSize = type0_PDCCH_CSS_config->num_rbs; pdsch_pdu_rel15->BWPStart = type0_PDCCH_CSS_config->cset_start_rb; @@ -632,7 +633,8 @@ void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP) candidate_idx, sib1_sdu_length); nfapi_nr_dl_tti_request_body_t *dl_req = &gNB_mac->DL_req[CC_id].dl_tti_request_body; - nr_fill_nfapi_dl_sib1_pdu(module_idP, dl_req, type0_PDCCH_CSS_config, TBS, startSymbolIndex, nrOfSymbols, dlDmrsSymbPos); + int pdu_index = gNB_mac->pdu_index[0]++; + nr_fill_nfapi_dl_sib1_pdu(module_idP, dl_req, pdu_index, type0_PDCCH_CSS_config, TBS, startSymbolIndex, nrOfSymbols, dlDmrsSymbPos); const int ntx_req = gNB_mac->TX_req[CC_id].Number_of_PDUs; nfapi_nr_pdu_t *tx_req = &gNB_mac->TX_req[CC_id].pdu_list[ntx_req]; @@ -642,7 +644,7 @@ void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP) memcpy(tx_req->TLVs[0].value.direct, sib1_payload, sib1_sdu_length); tx_req->PDU_length = TBS; - tx_req->PDU_index = gNB_mac->pdu_index[0]++; + tx_req->PDU_index = pdu_index; tx_req->num_TLV = 1; tx_req->TLVs[0].length = TBS + 2; gNB_mac->TX_req[CC_id].Number_of_PDUs++; From e346608b048eb41ae2788eefbb584e1faf9de770 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 31 Jan 2022 19:28:08 +0100 Subject: [PATCH 095/113] bugfix after nr_set_pdsch_semi_static --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 0e98f4d3c9..89fccece07 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -584,10 +584,10 @@ bool allocate_dl_retransmission(module_id_t module_id, temp_ps.nrOfLayers = 1; nr_set_pdsch_semi_static(scc, cg, sched_ctrl->active_bwp, bwpd, tda, f, &temp_ps); while (rbStart < bwpSize && - !(rballoc_mask[rbStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) + !(rballoc_mask[rbStart]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols))) rbStart++; while (rbStart + rbSize < bwpSize && - (rballoc_mask[rbStart + rbSize]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) + (rballoc_mask[rbStart + rbSize]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols))) rbSize++; uint32_t new_tbs; uint16_t new_rbSize; From 50e7f379d00933234e4068c48b11ccc253605cf2 Mon Sep 17 00:00:00 2001 From: hardy Date: Mon, 31 Jan 2022 11:16:39 +0100 Subject: [PATCH 096/113] fix results HTML conf file to see OAIUE results --- ci-scripts/ran_dashboard/ran_dashboard_cfg.yaml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/ci-scripts/ran_dashboard/ran_dashboard_cfg.yaml b/ci-scripts/ran_dashboard/ran_dashboard_cfg.yaml index 144fcd25a5..8b311cf6ac 100644 --- a/ci-scripts/ran_dashboard/ran_dashboard_cfg.yaml +++ b/ci-scripts/ran_dashboard/ran_dashboard_cfg.yaml @@ -2,7 +2,7 @@ LTE-2x2 : #short name used in the dashboard job : 'RAN-LTE-2x2-Module-OAIEPC' #job name from Jenkins, used in the database link : 'https://jenkins-oai.eurecom.fr/view/RAN/job/RAN-LTE-2x2-Module-OAIEPC' bench : 'Obelix-N310-OAIEPC-Quectel(nrmodule2)' - test : 'TDD, 40MHz, MCS9, 26Mb DL, 7Mb UL' + test : 'TM1 + TM2, TDD, 40MHz, MCS9, 26Mb DL, 7Mb UL' NSA-B200 : job : 'RAN-NSA-B200-Module-LTEBOX' link : 'https://jenkins-oai.eurecom.fr/view/RAN/job/RAN-NSA-B200-Module-LTEBOX' @@ -18,14 +18,9 @@ SA-N310 : link : 'https://jenkins-oai.eurecom.fr/view/RAN/job/RAN-SA-Module-CN5G' bench : 'Asterix-N310-OAICN5G-Quectel(nrmodule2)' test : 'TDD, 40MHz, 60Mb DL, 3Mb UL' -SA-OAIUE-B200 : - job : 'RAN-SA-OAIUE-B200-CN5G' - link : 'https://jenkins-oai.eurecom.fr/view/RAN/job/RAN-SA-OAIUE-B200-CN5G/' - bench : 'Asterix-N310-OAICN5G-OAIUE-B200' - test : 'TDD, 40MHz, Ping, (to be implemented : iperf)' -SA-OAIUE-N310 : - job : 'RAN-SA-OAIUE-N310-CN5G' - link : 'https://jenkins-oai.eurecom.fr/view/RAN/job/RAN-SA-OAIUE-N310-CN5G/' +SA-OAIUE-N310-X300 : + job : 'RAN-SA-OAIUE-N310-X300-CN5G' + link : 'https://jenkins-oai.eurecom.fr/view/RAN/job/RAN-SA-OAIUE-N310-X300-CN5G/' bench : 'Asterix-N310-OAICN5G-OAIUE-N310' test : 'TDD, 40MHz, Ping, (to be implemented : iperf)' From c4a3f569650375f903904210fb9e6b6a954c65d6 Mon Sep 17 00:00:00 2001 From: hardy Date: Mon, 31 Jan 2022 11:35:44 +0100 Subject: [PATCH 097/113] fix stats logs concatenation --- ci-scripts/stats_monitor.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/ci-scripts/stats_monitor.py b/ci-scripts/stats_monitor.py index e4dcc53bc2..d7cad7ae55 100755 --- a/ci-scripts/stats_monitor.py +++ b/ci-scripts/stats_monitor.py @@ -60,18 +60,17 @@ class StatMonitor(): self.d[node_type]['mcs'].append(int(result.group(4))) - def collect(self,node_type): + def collect(self,testcase_id,node_type): if node_type=='enb': files = ["L1_stats.log", "MAC_stats.log", "PDCP_stats.log", "RRC_stats.log"] else: #'gnb' files = ["nrL1_stats.log", "nrMAC_stats.log", "nrPDCP_stats.log", "nrRRC_stats.log"] - # append each file's contents to another file (prepended with CI-) for - # post-mortem/debugging analysis - #for f in files: - # cmd = 'cat '+ f + ' >> CI-' + f - # if os.path.isfile(f): - # subprocess.Popen(cmd,shell=True) - # join the files for further processing + #append each file's contents to another file (prepended with CI-) for debug + for f in files: + if os.path.isfile(f): + cmd = 'cat '+ f + ' >> CI-'+testcase_id+'-'+f + subprocess.Popen(cmd,shell=True) + #join the files for further processing cmd='cat ' for f in files: if os.path.isfile(f): @@ -130,7 +129,7 @@ if __name__ == "__main__": process=subprocess.Popen(CMD, shell=True, stdout=subprocess.PIPE) output = process.stdout.readlines() while len(output)!=0 : - mon.collect(node) + mon.collect(testcase_id,node) process=subprocess.Popen(CMD, shell=True, stdout=subprocess.PIPE) output = process.stdout.readlines() time.sleep(1) From 57c77a47817c440e8860320a55443d540e192a13 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 1 Feb 2022 11:22:06 +0100 Subject: [PATCH 098/113] Update log level colors after adding analysis level Analysis level is green. --- common/utils/LOG/log.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/utils/LOG/log.c b/common/utils/LOG/log.c index 0679e0b521..e014cfbcf6 100644 --- a/common/utils/LOG/log.c +++ b/common/utils/LOG/log.c @@ -86,8 +86,8 @@ mapping log_options[] = { mapping log_maskmap[] = LOG_MASKMAP_INIT; -char *log_level_highlight_start[] = {LOG_RED, LOG_ORANGE, "", LOG_BLUE, LOG_CYBL}; /*!< \brief Optional start-format strings for highlighting */ -char *log_level_highlight_end[] = {LOG_RESET,LOG_RESET,LOG_RESET, LOG_RESET,LOG_RESET}; /*!< \brief Optional end-format strings for highlighting */ +char *log_level_highlight_start[] = {LOG_RED, LOG_ORANGE, LOG_GREEN, "", LOG_BLUE, LOG_CYBL}; /*!< \brief Optional start-format strings for highlighting */ +char *log_level_highlight_end[] = {LOG_RESET, LOG_RESET, LOG_RESET, LOG_RESET, LOG_RESET, LOG_RESET}; /*!< \brief Optional end-format strings for highlighting */ static void log_output_memory(log_component_t *c, const char *file, const char *func, int line, int comp, int level, const char* format,va_list args); From 5edcbc91fc31e5586ce9ab4a5c0e9c4452f13319 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 1 Feb 2022 12:06:36 +0100 Subject: [PATCH 099/113] Write first color code, enable function name only --- common/utils/LOG/log.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/utils/LOG/log.c b/common/utils/LOG/log.c index e014cfbcf6..29e4f718c6 100644 --- a/common/utils/LOG/log.c +++ b/common/utils/LOG/log.c @@ -529,6 +529,8 @@ static inline int log_header(log_component_t *c, snprintf(l, sizeof l, "(%s:%d) ", func, line); else if (flag & FLAG_FILE_LINE) snprintf(l, sizeof l, "(%d) ", line); + else if (flag & FLAG_FUNCT) + snprintf(l, sizeof l, "(%s) ", func); else l[0] = 0; @@ -551,8 +553,8 @@ static inline int log_header(log_component_t *c, threadIdString[0] = 0; } return snprintf(log_buffer, buffsize, "%s%s%s[%s] %c %s%s", - timeString, flag & FLAG_NOCOLOR ? "" : log_level_highlight_start[level], + timeString, threadIdString, c->name, flag & FLAG_LEVEL ? g_log->level2string[level] : ' ', From 0a8c037735518680abf8e31cb7f35b816b3a10d0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 1 Feb 2022 13:14:48 +0100 Subject: [PATCH 100/113] Set default log level to info --- common/utils/LOG/log.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h index 42e49747a1..46c73427c1 100644 --- a/common/utils/LOG/log.h +++ b/common/utils/LOG/log.h @@ -392,7 +392,7 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int /* optname help paramflags XXXptr defXXXval type numelt */ /*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ #define LOG_GLOBALPARAMS_DESC { \ - {LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL, "Default log level for all componemts\n", 0, strptr:(char **)&gloglevel, defstrval:log_level_names[2].name, TYPE_STRING, 0}, \ + {LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL, "Default log level for all componemts\n", 0, strptr:(char **)&gloglevel, defstrval:log_level_names[3].name, TYPE_STRING, 0}, \ {LOG_CONFIG_STRING_GLOBAL_LOG_ONLINE, "Default console output option, for all components\n", 0, iptr:&(consolelog), defintval:1, TYPE_INT, 0}, \ {LOG_CONFIG_STRING_GLOBAL_LOG_OPTIONS, LOG_CONFIG_HELP_OPTIONS, 0, strlistptr:NULL, defstrlistval:NULL, TYPE_STRINGLIST, 0} \ } From 761d154fe7534caa1b192a3166375ba276e8c25f Mon Sep 17 00:00:00 2001 From: Melissa Date: Tue, 1 Feb 2022 13:33:17 +0000 Subject: [PATCH 101/113] Update addconsoletrace.md --- common/utils/LOG/DOC/addconsoletrace.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/common/utils/LOG/DOC/addconsoletrace.md b/common/utils/LOG/DOC/addconsoletrace.md index 9ab90cf120..d5ede8c57d 100644 --- a/common/utils/LOG/DOC/addconsoletrace.md +++ b/common/utils/LOG/DOC/addconsoletrace.md @@ -3,6 +3,7 @@ ```C LOG_E(,,,...) LOG_W(,,,...) +LOG_A(,,,...) LOG_I(,,,...) LOG_D(,,,...) LOG_T(,,,...) @@ -14,9 +15,10 @@ these macros are used in place of the printf C function. The additionnal ***comp |:---------|:---------------|:---------------|----------------:| | LOG_E | E | 0 | error | | LOG_W | W | 1 | warning | -| LOG_I | I | 2 | informational | -| LOG_D | D | 3 | debug | -| LOG_T | T | 4 | trace | +| LOG_A | A | 2 | analysis | +| LOG_I | I | 3 | informational | +| LOG_D | D | 4 | debug | +| LOG_T | T | 5 | trace | component list is defined as an `enum` in [log.h](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/utils/LOG/log.h). A new component can be defined by adding an item in this type, it must also be defined in the T tracer [T_messages.txt ](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/utils/T/T_messages.txt). From cfa636ce5f745484ffaf46534519fbc6d416e9c5 Mon Sep 17 00:00:00 2001 From: Melissa Date: Tue, 1 Feb 2022 13:36:30 +0000 Subject: [PATCH 102/113] Update rtusage.md --- common/utils/LOG/DOC/rtusage.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/utils/LOG/DOC/rtusage.md b/common/utils/LOG/DOC/rtusage.md index d7c748952d..349045b65f 100644 --- a/common/utils/LOG/DOC/rtusage.md +++ b/common/utils/LOG/DOC/rtusage.md @@ -7,9 +7,9 @@ All logging facility parameters are defined in the log_config section. Some para | name | type | default | description | |:---:|:---:|:---:|:----| -| `global_log_level` | `pre-defined string of char` | `info` | Allows printing of messages up to the specified level. Available levels, from lower to higher are `error`,`warn`,`info`,`debug`,`trace` | +| `global_log_level` | `pre-defined string of char` | `info` | Allows printing of messages up to the specified level. Available levels, from lower to higher are `error`,`warn`,`analysis`,`info`,`debug`,`trace` | | `global_log_online` | `boolean` | 1 (=true) | If false, all console messages are discarded, whatever their level | -| `global_log_options` | `list of pre-defined string of char` | | 3 options can be specified to trigger the information added in the header of the message: `nocolor`, disable color usage in log messages, usefull when redirecting logs to a file, where escape sequences used for color selection can be annoying, `level`, add a one letter level id in the message header (T,D,I,W,E for trace, debug, info, warning, error),`thread`, add the thread name in the message header, `function`, adds the function name, `line_num`, adds the line number, `time` adds the time since process starts| +| `global_log_options` | `list of pre-defined string of char` | | 5 options can be specified to trigger the information added in the header of the message: `nocolor`, disable color usage in log messages, usefull when redirecting logs to a file, where escape sequences used for color selection can be annoying, `level`, add a one letter level id in the message header (T,D,I,A,W,E for trace, debug, info, analysis, warning, error),`thread`, add the thread name in the message header, thread_id, adds the thread ID in the message header, `function`, adds the function name, `line_num`, adds the line number, `time` adds the time since process starts| ### Component specific parameters | name | type | default | description | From af6d95a3484c4f809e417055e64d6e552c0c4600 Mon Sep 17 00:00:00 2001 From: Melissa Date: Tue, 1 Feb 2022 13:37:06 +0000 Subject: [PATCH 103/113] Update rtusage.md --- common/utils/LOG/DOC/rtusage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/utils/LOG/DOC/rtusage.md b/common/utils/LOG/DOC/rtusage.md index 349045b65f..041c29e688 100644 --- a/common/utils/LOG/DOC/rtusage.md +++ b/common/utils/LOG/DOC/rtusage.md @@ -9,7 +9,7 @@ All logging facility parameters are defined in the log_config section. Some para |:---:|:---:|:---:|:----| | `global_log_level` | `pre-defined string of char` | `info` | Allows printing of messages up to the specified level. Available levels, from lower to higher are `error`,`warn`,`analysis`,`info`,`debug`,`trace` | | `global_log_online` | `boolean` | 1 (=true) | If false, all console messages are discarded, whatever their level | -| `global_log_options` | `list of pre-defined string of char` | | 5 options can be specified to trigger the information added in the header of the message: `nocolor`, disable color usage in log messages, usefull when redirecting logs to a file, where escape sequences used for color selection can be annoying, `level`, add a one letter level id in the message header (T,D,I,A,W,E for trace, debug, info, analysis, warning, error),`thread`, add the thread name in the message header, thread_id, adds the thread ID in the message header, `function`, adds the function name, `line_num`, adds the line number, `time` adds the time since process starts| +| `global_log_options` | `list of pre-defined string of char` | | 5 options can be specified to trigger the information added in the header of the message: `nocolor`, disable color usage in log messages, usefull when redirecting logs to a file, where escape sequences used for color selection can be annoying, `level`, add a one letter level id in the message header (T,D,I,A,W,E for trace, debug, info, analysis, warning, error),`thread`, add the thread name in the message header, `thread_id`, adds the thread ID in the message header, `function`, adds the function name, `line_num`, adds the line number, `time` adds the time since process starts| ### Component specific parameters | name | type | default | description | From 5e182c4e50ccaccda53cecd20f9717528b86a37e Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 1 Feb 2022 05:41:24 -0800 Subject: [PATCH 104/113] Adding a few more LOG_A's for critical milestones --- openair2/RRC/NR/rrc_gNB.c | 4 ++-- openair3/NAS/NR_UE/nr_nas_msg_sim.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 2c2020412d..3708e188a8 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -617,7 +617,7 @@ rrc_gNB_process_RRCSetupComplete( ) //----------------------------------------------------------------------------- { - LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel UL-DCCH, " "processing NR_RRCSetupComplete from UE (SRB1 Active)\n", + LOG_A(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel UL-DCCH, " "processing NR_RRCSetupComplete from UE (SRB1 Active)\n", PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP)); ue_context_pP->ue_context.Srb1.Active = 1; ue_context_pP->ue_context.Srb1.Srb_info.Srb_id = 1; @@ -1347,7 +1347,7 @@ rrc_gNB_process_RRCReconfigurationComplete( for (int i = 0; i < DRB_configList->list.count; i++) { if (DRB_configList->list.array[i]) { drb_id = (int)DRB_configList->list.array[i]->drb_Identity; - LOG_I(NR_RRC, "[gNB %d] Frame %d : Logical Channel UL-DCCH, Received NR_RRCReconfigurationComplete from UE rnti %x, reconfiguring DRB %d\n", + LOG_A(NR_RRC, "[gNB %d] Frame %d : Logical Channel UL-DCCH, Received NR_RRCReconfigurationComplete from UE rnti %x, reconfiguring DRB %d\n", ctxt_pP->module_id, ctxt_pP->frame, ctxt_pP->rnti, diff --git a/openair3/NAS/NR_UE/nr_nas_msg_sim.c b/openair3/NAS/NR_UE/nr_nas_msg_sim.c index 2628c5b0b2..7cf1378d8b 100644 --- a/openair3/NAS/NR_UE/nr_nas_msg_sim.c +++ b/openair3/NAS/NR_UE/nr_nas_msg_sim.c @@ -674,7 +674,7 @@ void decodeDownlinkNASTransport(as_nas_info_t *initialNasMsg, uint8_t * pdu_buff sprintf(baseNetAddress, "%d.%d", *(pdu_buffer + 39),*(pdu_buffer + 40)); int third_octet = *(pdu_buffer + 41); int fourth_octet = *(pdu_buffer + 42); - LOG_I(NAS, "Received PDU Session Establishment Accept\n"); + LOG_A(NAS, "Received PDU Session Establishment Accept\n"); nas_config(1,third_octet,fourth_octet,"ue"); } else { LOG_E(NAS, "Received unexpected message in DLinformationTransfer %d\n", msg_type); From 01f2b5a16c1754ff33e8e59eb791fde3ee1879f6 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 2 Feb 2022 10:23:01 +0100 Subject: [PATCH 105/113] Reset B200 device before a new run --- ci-scripts/cls_containerize.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 37e22acc3c..e606513935 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -506,6 +506,7 @@ class Containerize(): # mySSH.command('sed -i -e "s/FLEXRAN_ENABLED:.*$/FLEXRAN_ENABLED: \'no\'/" ci-docker-compose.yml', '\$', 2) # mySSH.command('sed -i -e "s/CI_FLEXRAN_CTL_IP_ADDR/127.0.0.1/" ci-docker-compose.yml', '\$', 2) # Currently support only one + mySSH.command('echo ' + lPassWord + ' | sudo -S b2xx_fx3_utils --reset-device', '\$', 15) mySSH.command('docker-compose --file ci-docker-compose.yml config --services | sed -e "s@^@service=@" 2>&1', '\$', 10) result = re.search('service=(?P[a-zA-Z0-9\_]+)', mySSH.getBefore()) if result is not None: From 8564ed55aba214e5f7e97861f51407d119716e07 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 2 Feb 2022 15:11:20 +0100 Subject: [PATCH 106/113] fix(ci): dummy commit to retrigger CI after ubuntu access issues Signed-off-by: Raphael Defosseux --- ci-scripts/cls_static_code_analysis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/cls_static_code_analysis.py b/ci-scripts/cls_static_code_analysis.py index 1680f3e560..c899a9aabd 100644 --- a/ci-scripts/cls_static_code_analysis.py +++ b/ci-scripts/cls_static_code_analysis.py @@ -121,7 +121,7 @@ class StaticCodeAnalysis(): mySSH.command('docker build --tag oai-cppcheck:xenial --file ci-scripts/docker/Dockerfile.cppcheck.xenial . > cmake_targets/log/cppcheck-xenial.txt 2>&1', '\$', 600) mySSH.command('sed -e "s@xenial@bionic@" ci-scripts/docker/Dockerfile.cppcheck.xenial > ci-scripts/docker/Dockerfile.cppcheck.bionic', '\$', 6) mySSH.command('docker build --tag oai-cppcheck:bionic --file ci-scripts/docker/Dockerfile.cppcheck.bionic . > cmake_targets/log/cppcheck-bionic.txt 2>&1', '\$', 600) - mySSH.command('docker image rm oai-cppcheck:bionic oai-cppcheck:xenial || true', '\$', 60) + mySSH.command('docker image rm oai-cppcheck:bionic oai-cppcheck:xenial || true', '\$', 30) # Analyzing the logs mySSH.command('cd ' + lSourcePath + '/cmake_targets', '\$', 5) From 92c5115f13b3b514b0644a686f611f714d0668c5 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Fri, 4 Feb 2022 16:23:46 +0100 Subject: [PATCH 107/113] lte: fixes in EpsNetworkFeatureSupport.c We have to eat all the bytes, not only one. We have to get the bit we want from the right buffer position. Note: only one bit is supported from this "EPS network feature support", not sure how to properly deal with it, so let's keep the code as it is. This commit was made because the MAGMA MME sends "EPS network feature support" to the UE in the NAS message "Attach Accept". OAI MME does not send this. So the bug about size was not seen. --- openair3/NAS/COMMON/IES/EpsNetworkFeatureSupport.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/openair3/NAS/COMMON/IES/EpsNetworkFeatureSupport.c b/openair3/NAS/COMMON/IES/EpsNetworkFeatureSupport.c index 3a842406f0..2ef36d7595 100644 --- a/openair3/NAS/COMMON/IES/EpsNetworkFeatureSupport.c +++ b/openair3/NAS/COMMON/IES/EpsNetworkFeatureSupport.c @@ -41,8 +41,11 @@ int decode_eps_network_feature_support(EpsNetworkFeatureSupport *epsnetworkfeatu ielen = *(buffer + decoded); decoded++; CHECK_LENGTH_DECODER(len - decoded, ielen); - *epsnetworkfeaturesupport = *buffer & 0x1; - decoded++; + /* note: only the bit "IMS voice over PS session in S1 mode" is processed + * TODO: deal with other bits? + */ + *epsnetworkfeaturesupport = (*(buffer + decoded)) & 0x1; + decoded += ielen; #if defined (NAS_DEBUG) dump_eps_network_feature_support_xml(epsnetworkfeaturesupport, iei); #endif From f92cfbaf12b929c30f6a3a67b24b15b66ea6b86a Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 4 Feb 2022 18:28:07 +0100 Subject: [PATCH 108/113] LTE 2x2 TM2: DL 1Mbps, modulation not optimized --- ci-scripts/xml_files/lte_2x2_tm2_quectel.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml b/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml index fcc772b8f4..e6520fc5fc 100644 --- a/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml +++ b/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml @@ -102,8 +102,8 @@ Iperf - iperf (DL/26Mbps/UDP)(60 sec)(single-ue profile) - -u -b 26M -t 60 + iperf (DL/1Mbps/UDP)(60 sec)(single-ue profile) + -u -b 1M -t 60 DL nrmodule2_quectel 5 From da6b91d83265047e46ec64c3400b659938cbdd0d Mon Sep 17 00:00:00 2001 From: hardy Date: Thu, 3 Feb 2022 14:23:08 +0100 Subject: [PATCH 109/113] updating SA testcases (162PRB + testcase id) --- ...gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf | 8 +-- ci-scripts/xml_files/fr1_sa_quectel.xml | 6 ++- .../xml_files/fr1_sa_quectel_162prb.xml | 50 +++++++++++-------- .../xml_files/fr1_sa_quectel_stages.xml | 34 ++++++------- 4 files changed, 55 insertions(+), 43 deletions(-) diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf index 11931d1700..f28c3167b6 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf @@ -82,11 +82,11 @@ gNBs = # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 dl_subcarrierSpacing = 1; - dl_carrierBandwidth = 106; + dl_carrierBandwidth = 162; #initialDownlinkBWP #genericParameters # this is RBstart=0,L=106 (275*(L-1))+RBstart - initialDLBWPlocationAndBandwidth = 28875; + initialDLBWPlocationAndBandwidth = 31889; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialDLBWPsubcarrierSpacing = 1; @@ -104,11 +104,11 @@ gNBs = # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 ul_subcarrierSpacing = 1; - ul_carrierBandwidth = 106; + ul_carrierBandwidth = 162; pMax = 20; #initialUplinkBWP #genericParameters - initialULBWPlocationAndBandwidth = 28875; + initialULBWPlocationAndBandwidth = 31889; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialULBWPsubcarrierSpacing = 1; diff --git a/ci-scripts/xml_files/fr1_sa_quectel.xml b/ci-scripts/xml_files/fr1_sa_quectel.xml index 8b0fc3b541..cd67637ec0 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel.xml @@ -31,9 +31,13 @@ 010000 000001 050000 + 000001 050001 + 000001 070000 + 000001 070001 + 000001 070002 000001 010002 @@ -84,7 +88,7 @@ Ping - Ping: 20pings in 20sec + Ping: 40pings in 40sec nrmodule2_quectel -c 40 1 diff --git a/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml b/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml index 696ec790ff..23cc6d25b8 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml @@ -22,18 +22,21 @@ --> TEST-SA-FR1-Tab3 - SA Ping DL UL with QUECTEL + SA 162PRB tasks 1 - 040000 + 042000 000002 010000 000001 - 050000 - 050001 - 070000 - 070001 + 052000 + 000001 + 072000 + 000001 + 072001 + 000001 + 072002 000001 010002 080000 @@ -55,7 +58,7 @@ - + Initialize_eNB Initialize gNB -O ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf --sa -q --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time @@ -81,39 +84,44 @@ - + Ping - Ping: 20pings in 20sec + Ping: 40pings in 40sec nrmodule2_quectel - -c 20 - 5 + -c 40 + 1 + 20 - - Ping - Ping: 100pings in 20sec - nrmodule2_quectel - -c 100 -i 0,2 - 5 - - + Iperf iperf (DL/140Mbps/UDP)(60 sec)(single-ue profile) -u -b 140M -t 60 DL nrmodule2_quectel - 5 + 50 + 50 single-ue - + Iperf iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile) -u -b 3M -t 60 UL nrmodule2_quectel 5 + 95 + single-ue + + + + Iperf + iperf (BIDIR TCP)(10 sec)(single-ue profile) + -t 10 --bidir + BIDIR + nrmodule2_quectel single-ue diff --git a/ci-scripts/xml_files/fr1_sa_quectel_stages.xml b/ci-scripts/xml_files/fr1_sa_quectel_stages.xml index edc4440612..1e10d02180 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel_stages.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel_stages.xml @@ -26,21 +26,21 @@ tasks 1 - 040000 + 041000 000002 010000 000001 - 050000 + 051000 000001 - 070000 + 071000 000001 - 070001 + 071001 000001 - 070002 + 071002 000001 - 070003 + 071003 000001 - 070004 + 071004 000001 010002 080000 @@ -62,7 +62,7 @@ - + Initialize_eNB Initialize gNB -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf --sa -q --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time @@ -88,9 +88,9 @@ - + Ping - Ping: 20pings in 20sec + Ping: 40pings in 40sec nrmodule2_quectel -c 40 1 @@ -98,7 +98,7 @@ - + Iperf iperf (DL/10Mbps/UDP)(30 sec)(single-ue profile) -u -b 10M -t 30 @@ -108,7 +108,7 @@ 95 single-ue - + Iperf iperf (DL/20Mbps/UDP)(30 sec)(single-ue profile) -u -b 20M -t 30 @@ -118,7 +118,7 @@ 95 single-ue - + Iperf iperf (DL/40Mbps/UDP)(30 sec)(single-ue profile) -u -b 40M -t 30 @@ -128,7 +128,7 @@ 95 single-ue - + Iperf iperf (DL/60Mbps/UDP)(30 sec)(single-ue profile) -u -b 60M -t 30 @@ -138,14 +138,14 @@ 95 single-ue - + Iperf iperf (DL/90Mbps/UDP)(30 sec)(single-ue profile) -u -b 90M -t 30 DL nrmodule2_quectel - 5 - 95 + 10 + 90 single-ue From 3a902ad0d132f7cf40cd3c33478c742146344990 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sat, 5 Feb 2022 12:53:33 +0100 Subject: [PATCH 110/113] (Partially) revert "minor changes in dlschsim, still doesn't work :-(" This partially reverts commit bac8bc569c6a9ea073a17bff7fa487c8129cc114 and fixes nr_dlschsim, which did not compile without this commit. --- openair1/SIMULATION/NR_PHY/dlschsim.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index 4d4195f15e..f566b93d9c 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -67,7 +67,6 @@ uint16_t n_rnti = 0x1234; openair0_config_t openair0_cfg[MAX_CARDS]; void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq) {} -void processSlotTX(void *arg) {} int main(int argc, char **argv) { @@ -437,22 +436,9 @@ int main(int argc, char **argv) UE->dlsch_SI[0] = new_nr_ue_dlsch(1, 1, Nsoft, 5, N_RB_DL, 0); UE->dlsch_ra[0] = new_nr_ue_dlsch(1, 1, Nsoft, 5, N_RB_DL, 0); unsigned char harq_pid = 0; //dlsch->harq_ids[subframe]; - - gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t)); - initTpool(gNBthreads, gNB->threadPool, true); - gNB->resp_L1_tx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); - initNotifiedFIFO(gNB->resp_L1_tx); - // we create 2 threads for L1 tx processing - notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->resp_L1_tx,processSlotTX); - processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx); - init_DLSCH_struct(gNB, msgDataTx); - msgDataTx->slot = slot; - msgDataTx->frame = frame; - memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t)); - reset_meas(&msgDataTx->phy_proc_tx); - gNB->phy_proc_tx_0 = &msgDataTx->phy_proc_tx; - pushTpool(gNB->threadPool,msgL1Tx); - NR_gNB_DLSCH_t *dlsch = msgDataTx->dlsch[0][0]; + processingData_L1tx_t msgDataTx; + init_DLSCH_struct(gNB, &msgDataTx); + NR_gNB_DLSCH_t *dlsch = msgDataTx.dlsch[0][0]; nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &dlsch->harq_process.pdsch_pdu.pdsch_pdu_rel15; //time_stats_t *rm_stats, *te_stats, *i_stats; uint8_t is_crnti = 0, llr8_flag = 0; @@ -526,8 +512,8 @@ int main(int argc, char **argv) //printf("crc32: [0]->0x%08x\n",crc24c(test_input, 32)); // generate signal - unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS] __attribute__((aligned(32))); - bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); + unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS] __attribute__((aligned(32))); + bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); if (input_fd == NULL) { nr_dlsch_encoding(gNB, test_input, frame, slot, dlsch, frame_parms,output,NULL,NULL,NULL,NULL,NULL,NULL,NULL); } @@ -657,7 +643,7 @@ int main(int argc, char **argv) for (i = 0; i < 2; i++) { printf("gNB %d\n", i); - free_gNB_dlsch(&(msgDataTx->dlsch[0][i]),N_RB_DL); + free_gNB_dlsch(&(msgDataTx.dlsch[0][i]),N_RB_DL); printf("UE %d\n", i); free_nr_ue_dlsch(&(UE->dlsch[0][0][i]),N_RB_DL); } From 8dcf0d011d4d65af34cfa3fce29d400fdc0b8681 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 7 Feb 2022 13:40:15 +0100 Subject: [PATCH 111/113] two bugfixes: local pdcch_pdu in ul and wrong initialization place in find_candidate --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 1 + .../NR_MAC_gNB/gNB_scheduler_primitives.c | 19 +++++++++---------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 9 +++++++-- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 14 +++++++------- 4 files changed, 24 insertions(+), 19 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 89fccece07..499ceb859b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -1163,6 +1163,7 @@ void nr_schedule_ue_spec(module_id_t module_id, pdsch_pdu->pduBitmap |= 0x1; // Bit 0: pdschPtrs - Indicates PTRS included (FR2) } + LOG_D(NR_MAC,"Configuring DCI/PDCCH in %d.%d at CCE %d, rnti %x\n", frame,slot,sched_ctrl->cce_index,rnti); /* Fill PDCCH DL DCI PDU */ nfapi_nr_dl_dci_pdu_t *dci_pdu = &pdcch_pdu->dci_pdu[pdcch_pdu->numDlDci]; pdcch_pdu->numDlDci++; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 8f1bc986fe..f42fda5092 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -306,13 +306,13 @@ int cce_to_reg_interleaving(const int R, int k, int n_shift, const int C, int L, return f; } -uint8_t find_pdcch_candidate(gNB_MAC_INST *mac, - int cc_id, - int aggregation, - int nr_of_candidates, - NR_sched_pdcch_t *pdcch, - NR_ControlResourceSet_t *coreset, - uint16_t Y){ +int find_pdcch_candidate(gNB_MAC_INST *mac, + int cc_id, + int aggregation, + int nr_of_candidates, + NR_sched_pdcch_t *pdcch, + NR_ControlResourceSet_t *coreset, + uint16_t Y){ uint16_t *vrb_map = mac->common_channels[cc_id].vrb_map; const int next_cand = mac->pdcch_cand[coreset->controlResourceSetId]; @@ -332,12 +332,11 @@ uint8_t find_pdcch_candidate(gNB_MAC_INST *mac, const int C = R>0 ? N_regs/(L*R) : 0; const int B_rb = L/N_symb; // nb of RBs occupied by each REG bundle - int first_cce; - bool taken = false; // flag if the resource for a given candidate are taken // loop over all the available candidates // this implements TS 38.211 Sec. 7.3.2.2 for(int m=next_cand; mShiftIndex, C, L, N_regs); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index e4fcecf059..ccefe94cd6 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1512,6 +1512,11 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) nfapi_nr_ul_dci_request_t *ul_dci_req = &RC.nrmac[module_id]->UL_dci_req[CC_id]; ul_dci_req->SFN = frame; ul_dci_req->Slot = slot; + /* a PDCCH PDU groups DCIs per BWP and CORESET. Save a pointer to each + * allocated PDCCH so we can easily allocate UE's DCIs independent of any + * CORESET order */ + nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_coreset[MAX_NUM_CORESET] = {0}; + NR_ServingCellConfigCommon_t *scc = RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon; NR_UE_info_t *UE_info = &RC.nrmac[module_id]->UE_info; @@ -1750,7 +1755,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) NR_SearchSpace_t *ss = (sched_ctrl->active_bwp || ubwpd) ? sched_ctrl->search_space: RC.nrmac[module_id]->sched_ctrlCommon->search_space; NR_ControlResourceSet_t *coreset = (sched_ctrl->active_bwp || ubwpd) ? sched_ctrl->coreset: RC.nrmac[module_id]->sched_ctrlCommon->coreset; const int coresetid = coreset->controlResourceSetId; - nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu = nr_mac->pdcch_pdu_idx[CC_id][coresetid]; + nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu = pdcch_pdu_coreset[coresetid]; if (!pdcch_pdu) { nfapi_nr_ul_dci_request_pdus_t *ul_dci_request_pdu = &ul_dci_req->ul_dci_pdu_list[ul_dci_req->numPdus]; memset(ul_dci_request_pdu, 0, sizeof(nfapi_nr_ul_dci_request_pdus_t)); @@ -1759,7 +1764,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) pdcch_pdu = &ul_dci_request_pdu->pdcch_pdu.pdcch_pdu_rel15; ul_dci_req->numPdus += 1; nr_configure_pdcch(pdcch_pdu, coreset, genericParameters, &sched_ctrl->sched_pdcch); - nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu; + pdcch_pdu_coreset[coresetid] = pdcch_pdu; } LOG_D(NR_MAC,"Configuring ULDCI/PDCCH in %d.%d at CCE %d, rnti %x\n", frame,slot,sched_ctrl->cce_index,rnti); diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index ed125fddb0..2dbb924d7b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -260,13 +260,13 @@ NR_sched_pdcch_t set_pdcch_structure(gNB_MAC_INST *gNB_mac, NR_BWP_t *bwp, NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config); -uint8_t find_pdcch_candidate(gNB_MAC_INST *mac, - int cc_id, - int aggregation, - int nr_of_candidates, - NR_sched_pdcch_t *pdcch, - NR_ControlResourceSet_t *coreset, - uint16_t Y); +int find_pdcch_candidate(gNB_MAC_INST *mac, + int cc_id, + int aggregation, + int nr_of_candidates, + NR_sched_pdcch_t *pdcch, + NR_ControlResourceSet_t *coreset, + uint16_t Y); void fill_pdcch_vrb_map(gNB_MAC_INST *mac, int CC_id, From b13ea677a22e29055d52f47608353c780aadaaf9 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 7 Feb 2022 14:22:20 +0100 Subject: [PATCH 112/113] Give warning when UL Failure on NR link --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index ccefe94cd6..843b8678fd 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -711,7 +711,8 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, UE_info->mac_stats[UE_id].ulsch_DTX++; } if (UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt >= pusch_failure_thres) { - LOG_D(NR_MAC,"Detected UL Failure on PUSCH, stopping scheduling\n"); + LOG_W(NR_MAC,"Detected UL Failure on PUSCH after %d PUSCH DTX, stopping scheduling\n", + UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt); UE_info->UE_sched_ctrl[UE_id].ul_failure = 1; nr_mac_gNB_rrc_ul_failure(gnb_mod_idP,CC_idP,frameP,slotP,rntiP); } From ce9d1bd7c542d3e5f85f203978d13932cd6e09ad Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 7 Feb 2022 14:23:05 +0100 Subject: [PATCH 113/113] Always schedule PUCCH to prevent stale PUCCH config --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 1 - 1 file changed, 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index ca641ed1ba..9a1841d088 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -141,7 +141,6 @@ void nr_schedule_pucch(int Mod_idP, for (int UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) { NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; - if (sched_ctrl->ul_failure==1 && get_softmodem_params()->phy_test==0) continue; const int n = sizeof(sched_ctrl->sched_pucch) / sizeof(*sched_ctrl->sched_pucch); for (int i = 0; i < n; i++) { NR_sched_pucch_t *curr_pucch = &UE_info->UE_sched_ctrl[UE_id].sched_pucch[i];