Commit 7e0757fb authored by Melissa Elkadi's avatar Melissa Elkadi

Addressing MR review comments

- OPENAIR_DIR replaced with AWGN_RESULTS_DIR
- Copying UCI_2_3_4 PDU with rx'd PDU from proxy
- Reverting hacks/whitespace changes
parent 7683014c
...@@ -156,7 +156,7 @@ uint32_t N_RB_DL = 106; ...@@ -156,7 +156,7 @@ uint32_t N_RB_DL = 106;
/* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed /* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed
* this is very hackish - find a proper solution * 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]; nr_bler_struct nr_bler_data[NR_NUM_MCS];
...@@ -552,50 +552,43 @@ int main( int argc, char **argv ) { ...@@ -552,50 +552,43 @@ int main( int argc, char **argv ) {
} }
// Read in each MCS file and build BLER-SINR-TB table // Read in each MCS file and build BLER-SINR-TB table
static void init_bler_table(void) static void init_bler_table(void) {
{ memset(nr_bler_data, 0, sizeof(nr_bler_data));
const char *openair_dir = getenv("OPENAIR_DIR");
if (!openair_dir) const char *awgn_results_dir = getenv("AWGN_RESULTS_DIR");
{ if (!awgn_results_dir) {
LOG_E(MAC, "No $OPENAIR_DIR\n"); LOG_W(NR_MAC, "No $AWGN_RESULTS_DIR\n");
abort(); return;
} }
for (unsigned int i = 0; i < NR_NUM_MCS; i++) for (unsigned int i = 0; i < NR_NUM_MCS; i++) {
{
char fName[1024]; 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"); FILE *pFile = fopen(fName, "r");
if (!pFile) if (!pFile) {
{ LOG_E(NR_MAC, "%s: open %s: %s\n", __func__, fName, strerror(errno));
LOG_E(MAC, "Bler File ERROR! - fopen(), file: %s\n", fName); continue;
abort();
} }
size_t bufSize = 1024; size_t bufSize = 1024;
char * line = NULL; char * line = NULL;
char * token; char * token;
char * temp = NULL; char * temp = NULL;
int nlines = 0; int nlines = 0;
while (getline(&line, &bufSize, pFile) > 0) while (getline(&line, &bufSize, pFile) > 0) {
{ if (!strncmp(line, "SNR", 3)) {
if (!strncmp(line, "SNR", 3))
{
continue; continue;
} }
if (nlines > NUM_SINR) if (nlines > NUM_SINR) {
{ LOG_E(NR_MAC, "BLER FILE ERROR - num lines greater than expected - file: %s\n", fName);
LOG_E(MAC, "BLER FILE ERROR - num lines greater than expected - file: %s\n", fName);
abort(); abort();
} }
token = strtok_r(line, ";", &temp); token = strtok_r(line, ";", &temp);
int ncols = 0; int ncols = 0;
while (token != NULL) while (token != NULL) {
{ if (ncols > NUM_BLER_COL) {
if (ncols > NUM_BLER_COL) LOG_E(NR_MAC, "BLER FILE ERROR - num of cols greater than expected\n");
{
LOG_E(MAC, "BLER FILE ERROR - num of cols greater than expected\n");
abort(); abort();
} }
......
...@@ -787,8 +787,8 @@ int phy_nr_uci_indication(nfapi_nr_uci_indication_t *ind) ...@@ -787,8 +787,8 @@ int phy_nr_uci_indication(nfapi_nr_uci_indication_t *ind)
if (ind_pdu->harq) { if (ind_pdu->harq) {
uci_ind_pdu->harq = CALLOC(1, sizeof(*uci_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."); 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 = *ind_pdu->harq;
uci_ind_pdu->harq->harq_list = CALLOC(uci_ind_pdu->harq->num_harq, sizeof(*uci_ind_pdu->harq->harq_list)); 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."); 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++) 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) ...@@ -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: { 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 *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; 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) { if (ind_pdu->harq.harq_payload) {
uci_ind_pdu->harq.harq_payload = CALLOC(1, sizeof(*uci_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."); AssertFatal(uci_ind_pdu->harq.harq_payload != NULL, "Memory not allocated for uci_ind_pdu->harq.harq_payload in phy_nr_uci_indication.");
......
export OPENAIR_HOME=$(pwd) export OPENAIR_HOME=$(pwd)
export OPENAIR_DIR=$(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 OPENAIR1_DIR=$OPENAIR_HOME/openair1
export OPENAIR2_DIR=$OPENAIR_HOME/openair2 export OPENAIR2_DIR=$OPENAIR_HOME/openair2
export OPENAIR3_DIR=$OPENAIR_HOME/openair3 export OPENAIR3_DIR=$OPENAIR_HOME/openair3
......
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
...@@ -1650,13 +1650,9 @@ int nr_acknack_scheduling(int mod_id, ...@@ -1650,13 +1650,9 @@ int nr_acknack_scheduling(int mod_id,
/* we need to find a new PUCCH occasion */ /* we need to find a new PUCCH occasion */
/*(Re)Inizialization of timing information*/ /*(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) || if ((pucch->frame == 0 && pucch->ul_slot == 0) ||
((pucch->frame*n_slots_frame + pucch->ul_slot) < ((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, 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", "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); UE_id, frame, slot, pucch->sr_flag, pucch->dai_c, pucch->frame, pucch->ul_slot);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment