diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index c1c64ef913..bbe10b3d6d 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -156,7 +156,7 @@ uint32_t N_RB_DL = 106; /* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed * this is very hackish - find a proper solution */ -uint8_t abstraction_flag = 0; +uint8_t abstraction_flag=0; nr_bler_struct nr_bler_data[NR_NUM_MCS]; @@ -552,50 +552,43 @@ int main( int argc, char **argv ) { } // Read in each MCS file and build BLER-SINR-TB table -static void init_bler_table(void) -{ - const char *openair_dir = getenv("OPENAIR_DIR"); - if (!openair_dir) - { - LOG_E(MAC, "No $OPENAIR_DIR\n"); - abort(); +static void init_bler_table(void) { + memset(nr_bler_data, 0, sizeof(nr_bler_data)); + + const char *awgn_results_dir = getenv("AWGN_RESULTS_DIR"); + if (!awgn_results_dir) { + LOG_W(NR_MAC, "No $AWGN_RESULTS_DIR\n"); + return; } - for (unsigned int i = 0; i < NR_NUM_MCS; i++) - { + for (unsigned int i = 0; i < NR_NUM_MCS; i++) { char fName[1024]; - snprintf(fName, sizeof(fName), "%s/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs%d_awgn_5G.csv", openair_dir, i); + snprintf(fName, sizeof(fName), "%s/mcs%d_awgn_5G.csv", awgn_results_dir, i); FILE *pFile = fopen(fName, "r"); - if (!pFile) - { - LOG_E(MAC, "Bler File ERROR! - fopen(), file: %s\n", fName); - abort(); + if (!pFile) { + LOG_E(NR_MAC, "%s: open %s: %s\n", __func__, fName, strerror(errno)); + continue; } size_t bufSize = 1024; char * line = NULL; char * token; char * temp = NULL; int nlines = 0; - while (getline(&line, &bufSize, pFile) > 0) - { - if (!strncmp(line, "SNR", 3)) - { + while (getline(&line, &bufSize, pFile) > 0) { + if (!strncmp(line, "SNR", 3)) { continue; } - if (nlines > NUM_SINR) - { - LOG_E(MAC, "BLER FILE ERROR - num lines greater than expected - file: %s\n", fName); + if (nlines > NUM_SINR) { + LOG_E(NR_MAC, "BLER FILE ERROR - num lines greater than expected - file: %s\n", fName); abort(); } token = strtok_r(line, ";", &temp); int ncols = 0; - while (token != NULL) - { - if (ncols > NUM_BLER_COL) - { - LOG_E(MAC, "BLER FILE ERROR - num of cols greater than expected\n"); + while (token != NULL) { + if (ncols > NUM_BLER_COL) { + LOG_E(NR_MAC, "BLER FILE ERROR - num of cols greater than expected\n"); abort(); } diff --git a/nfapi/oai_integration/nfapi_vnf.c b/nfapi/oai_integration/nfapi_vnf.c index 56ad438e0e..d19d2db597 100644 --- a/nfapi/oai_integration/nfapi_vnf.c +++ b/nfapi/oai_integration/nfapi_vnf.c @@ -787,8 +787,8 @@ int phy_nr_uci_indication(nfapi_nr_uci_indication_t *ind) if (ind_pdu->harq) { uci_ind_pdu->harq = CALLOC(1, sizeof(*uci_ind_pdu->harq)); AssertFatal(uci_ind_pdu->harq != NULL, "Memory not allocated for uci_ind_pdu->harq in phy_nr_uci_indication."); - *uci_ind_pdu->harq = *ind_pdu->harq; + uci_ind_pdu->harq->harq_list = CALLOC(uci_ind_pdu->harq->num_harq, sizeof(*uci_ind_pdu->harq->harq_list)); AssertFatal(uci_ind_pdu->harq->harq_list != NULL, "Memory not allocated for uci_ind_pdu->harq->harq_list in phy_nr_uci_indication."); for (int j = 0; j < uci_ind_pdu->harq->num_harq; j++) @@ -800,6 +800,7 @@ int phy_nr_uci_indication(nfapi_nr_uci_indication_t *ind) case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: { nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_ind_pdu = &uci_ind->uci_list[i].pucch_pdu_format_2_3_4; nfapi_nr_uci_pucch_pdu_format_2_3_4_t *ind_pdu = &ind->uci_list[i].pucch_pdu_format_2_3_4; + *uci_ind_pdu = *ind_pdu; if (ind_pdu->harq.harq_payload) { uci_ind_pdu->harq.harq_payload = CALLOC(1, sizeof(*uci_ind_pdu->harq.harq_payload)); AssertFatal(uci_ind_pdu->harq.harq_payload != NULL, "Memory not allocated for uci_ind_pdu->harq.harq_payload in phy_nr_uci_indication."); diff --git a/oaienv b/oaienv index f8ef707c12..bb24469703 100644 --- a/oaienv +++ b/oaienv @@ -1,6 +1,7 @@ export OPENAIR_HOME=$(pwd) export OPENAIR_DIR=$(pwd) +export AWGN_RESULTS_DIR=$OPENAIR_DIR/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results export OPENAIR1_DIR=$OPENAIR_HOME/openair1 export OPENAIR2_DIR=$OPENAIR_HOME/openair2 export OPENAIR3_DIR=$OPENAIR_HOME/openair3 diff --git a/openair1/SIMULATION/LTE_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/bler_tx1_chan18_nrx1_mcs28.csv b/openair1/SIMULATION/LTE_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/bler_tx1_chan18_nrx1_mcs28.csv new file mode 100644 index 0000000000..11771acc87 --- /dev/null +++ b/openair1/SIMULATION/LTE_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/bler_tx1_chan18_nrx1_mcs28.csv @@ -0,0 +1,21 @@ +SNR; MCS; TBS; rate; err0; trials0; err1; trials1; err2; trials2; err3; trials3; dci_err +16.000000;27;15840;0.704000;5002;5002;0;0;0;0;0;0;0 +16.100000;27;15840;0.704000;5002;5002;0;0;0;0;0;0;0 +16.200000;27;15840;0.704000;5002;5002;0;0;0;0;0;0;0 +16.300000;27;15840;0.704000;5002;5002;0;0;0;0;0;0;0 +16.400000;27;15840;0.704000;4999;5002;0;0;0;0;0;0;0 +16.500000;27;15840;0.704000;4981;5002;0;0;0;0;0;0;0 +16.600000;27;15840;0.704000;4887;5002;0;0;0;0;0;0;0 +16.700000;27;15840;0.704000;4688;5002;0;0;0;0;0;0;0 +16.800000;27;15840;0.704000;4176;5002;0;0;0;0;0;0;0 +16.900000;27;15840;0.704000;3340;5002;0;0;0;0;0;0;0 +17.000000;27;15840;0.704000;2386;5002;0;0;0;0;0;0;0 +17.100000;27;15840;0.704000;1510;5002;0;0;0;0;0;0;0 +17.200000;27;15840;0.704000;1000;5552;0;0;0;0;0;0;0 +17.300000;27;15840;0.704000;926;10000;0;0;0;0;0;0;0 +17.400000;27;15840;0.704000;516;10000;0;0;0;0;0;0;0 +17.500000;27;15840;0.704000;287;10000;0;0;0;0;0;0;0 +17.600000;27;15840;0.704000;198;10000;0;0;0;0;0;0;0 +17.700000;27;15840;0.704000;135;10000;0;0;0;0;0;0;0 +17.800000;27;15840;0.704000;102;10000;0;0;0;0;0;0;0 +17.900000;27;15840;0.704000;94;10000;0;0;0;0;0;0;0 diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 94b8aadcfb..cfff41a6ad 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1650,13 +1650,9 @@ int nr_acknack_scheduling(int mod_id, /* we need to find a new PUCCH occasion */ /*(Re)Inizialization of timing information*/ - /* TODO: This is something of a hack. The last condition in the - if statement below was added. OAI is looking into this and is - expected to provide a solution. Without the hack, the gNB will - incorrectly schedule more than 2 ACK/nACKs in a single SFN/Slot. */ if ((pucch->frame == 0 && pucch->ul_slot == 0) || ((pucch->frame*n_slots_frame + pucch->ul_slot) < - (frame * n_slots_frame + slot)) && (frame != 1023)) { + (frame*n_slots_frame + slot))) { AssertFatal(pucch->sr_flag + pucch->dai_c == 0, "expected no SR/AckNack for UE %d in %4d.%2d, but has %d/%d for %4d.%2d\n", UE_id, frame, slot, pucch->sr_flag, pucch->dai_c, pucch->frame, pucch->ul_slot);