Commit 78341d9d authored by Melissa Elkadi's avatar Melissa Elkadi

Updated bler table lookup mechanism and logs

parent 02571e63
...@@ -1321,7 +1321,7 @@ void *ue_standalone_pnf_task(void *context) ...@@ -1321,7 +1321,7 @@ void *ue_standalone_pnf_task(void *context)
abort(); abort();
} }
sf_rnti_mcs[sf].sinr = ch_info->sinr; sf_rnti_mcs[sf].sinr = ch_info->sinr;
LOG_A(MAC, "Received_SINR = %f\n",ch_info->sinr); LOG_D(MAC, "Received_SINR = %f\n",ch_info->sinr);
} }
else else
{ {
...@@ -2050,15 +2050,20 @@ static bool did_drop_transport_block(int sf, uint16_t rnti) ...@@ -2050,15 +2050,20 @@ static bool did_drop_transport_block(int sf, uint16_t rnti)
static float get_bler_val(uint8_t mcs, int sinr) static float get_bler_val(uint8_t mcs, int sinr)
{ {
// 4th col = dropped packets, 5th col = total packets
float bler_val = 0.0;
CHECK_INDEX(bler_data, mcs);
if (sinr < (int)(bler_data[mcs].bler_table[0][0] * 10)) if (sinr < (int)(bler_data[mcs].bler_table[0][0] * 10))
{ {
LOG_I(MAC, "MCS %d table. SINR is smaller than lowest SINR, bler_val is set based on lowest SINR in table\n", mcs); LOG_I(MAC, "MCS %d table. SINR is smaller than lowest SINR, bler_val is set based on lowest SINR in table\n", mcs);
return bler_data[mcs].bler_table[0][3]; bler_val = bler_data[mcs].bler_table[0][4] / bler_data[mcs].bler_table[0][5];
return bler_val;
} }
if (sinr > (int)(bler_data[mcs].bler_table[bler_data[mcs].length - 1][0] * 10)) if (sinr > (int)(bler_data[mcs].bler_table[bler_data[mcs].length - 1][0] * 10))
{ {
LOG_I(MAC, "MCS %d table. SINR is greater than largest SINR. bler_val is set based on largest SINR in table\n", mcs); LOG_I(MAC, "MCS %d table. SINR is greater than largest SINR. bler_val is set based on largest SINR in table\n", mcs);
return bler_data[mcs].bler_table[(bler_data[mcs].length - 1)][3]; bler_val = bler_data[mcs].bler_table[(bler_data[mcs].length - 1)][4] / bler_data[mcs].bler_table[(bler_data[mcs].length - 1)][5];
return bler_val;
} }
// Loop through bler table to find sinr_index // Loop through bler table to find sinr_index
for (int i = 0; i < bler_data[mcs].length; i++) for (int i = 0; i < bler_data[mcs].length; i++)
...@@ -2066,12 +2071,15 @@ static float get_bler_val(uint8_t mcs, int sinr) ...@@ -2066,12 +2071,15 @@ static float get_bler_val(uint8_t mcs, int sinr)
int temp_sinr = (int)(bler_data[mcs].bler_table[i][0] * 10); int temp_sinr = (int)(bler_data[mcs].bler_table[i][0] * 10);
if (temp_sinr == sinr) if (temp_sinr == sinr)
{ {
return bler_data[mcs].bler_table[i][3]; // 3rd column containers bler value bler_val = bler_data[mcs].bler_table[i][4] / bler_data[mcs].bler_table[i][5];
return bler_val;
} }
// Linear interpolation when SINR is between indices // Linear interpolation when SINR is between indices
if (temp_sinr > sinr) if (temp_sinr > sinr)
{ {
return ((bler_data[mcs].bler_table[i - 1][3] + bler_data[mcs].bler_table[i][3]) / 2); float bler_val1 = bler_data[mcs].bler_table[i - 1][4] / bler_data[mcs].bler_table[i - 1][5];
float bler_val2 = bler_data[mcs].bler_table[i][4] / bler_data[mcs].bler_table[i][5];
return ((bler_val1 + bler_val2) / 2);
} }
} }
LOG_E(MAC, "NO SINR INDEX FOUND!\n"); LOG_E(MAC, "NO SINR INDEX FOUND!\n");
...@@ -2107,7 +2115,7 @@ static bool should_drop_transport_block(int sf, uint16_t rnti) ...@@ -2107,7 +2115,7 @@ static bool should_drop_transport_block(int sf, uint16_t rnti)
float bler_val = get_bler_val(mcs, ((int)(sf_rnti_mcs[sf].sinr * 10))); float bler_val = get_bler_val(mcs, ((int)(sf_rnti_mcs[sf].sinr * 10)));
double drop_cutoff = ((double) rand() / (RAND_MAX)); double drop_cutoff = ((double) rand() / (RAND_MAX));
assert(drop_cutoff <= 1); assert(drop_cutoff <= 1);
LOG_I(MAC, "SINR = %f, Bler_val = %f, MCS = %"PRIu8"\n", sf_rnti_mcs[sf].sinr, bler_val, sf_rnti_mcs[sf].mcs[n]);
if (drop_cutoff <= bler_val) if (drop_cutoff <= bler_val)
{ {
sf_rnti_mcs[sf].drop_flag[n] = true; sf_rnti_mcs[sf].drop_flag[n] = true;
......
...@@ -1112,7 +1112,7 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg) ...@@ -1112,7 +1112,7 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg)
nfapi_dl_config_request_t *dl_config_req = dl_config_req_tx_req->dl_config_req; nfapi_dl_config_request_t *dl_config_req = dl_config_req_tx_req->dl_config_req;
uint16_t dl_num_pdus = dl_config_req->dl_config_request_body.number_pdu; uint16_t dl_num_pdus = dl_config_req->dl_config_request_body.number_pdu;
LOG_A(MAC, "(OAI UE) Received dl_config_req from proxy at Frame: %d, Subframe: %d," LOG_I(MAC, "(OAI UE) Received dl_config_req from proxy at Frame: %d, Subframe: %d,"
" with number of PDUs: %u\n", " with number of PDUs: %u\n",
NFAPI_SFNSF2SFN(dl_config_req->sfn_sf), NFAPI_SFNSF2SF(dl_config_req->sfn_sf), NFAPI_SFNSF2SFN(dl_config_req->sfn_sf), NFAPI_SFNSF2SF(dl_config_req->sfn_sf),
dl_num_pdus); dl_num_pdus);
......
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