Merge branch 'episys/master' into episys/david/episys-merge-2nd-x2c
This commit is contained in:
@@ -761,6 +761,7 @@ int main ( int argc, char **argv )
|
||||
LOG_I(ENB_APP,"oai_exit=%d\n",oai_exit);
|
||||
// stop threads
|
||||
|
||||
#if 0 //Disable clean up because this tends to crash (and unnecessary)
|
||||
if (RC.nb_inst == 0 || !NODE_IS_CU(node_type)) {
|
||||
if(IS_SOFTMODEM_DOFORMS)
|
||||
end_forms();
|
||||
@@ -802,6 +803,7 @@ int main ( int argc, char **argv )
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
pdcp_module_cleanup();
|
||||
terminate_opt();
|
||||
|
||||
@@ -216,4 +216,6 @@ extern void init_UE_standalone_thread(int ue_idx);
|
||||
|
||||
extern PHY_VARS_UE *init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms, uint8_t UE_id, uint8_t abstraction_flag);
|
||||
|
||||
extern void init_bler_table(void);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1040,16 +1040,16 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg)
|
||||
UE = rtd->UE;
|
||||
|
||||
UL_INFO = (UL_IND_t *)calloc(1, sizeof(UL_IND_t));
|
||||
UL_INFO->rx_ind.rx_indication_body.rx_pdu_list = calloc(NUMBER_OF_UE_MAX, sizeof(nfapi_rx_indication_pdu_t));
|
||||
UL_INFO->rx_ind.rx_indication_body.rx_pdu_list = calloc(NFAPI_RX_IND_MAX_PDU, sizeof(nfapi_rx_indication_pdu_t));
|
||||
UL_INFO->rx_ind.rx_indication_body.number_of_pdus = 0;
|
||||
UL_INFO->crc_ind.crc_indication_body.crc_pdu_list = calloc(NUMBER_OF_UE_MAX, sizeof(nfapi_crc_indication_pdu_t));
|
||||
UL_INFO->crc_ind.crc_indication_body.crc_pdu_list = calloc(NFAPI_CRC_IND_MAX_PDU, sizeof(nfapi_crc_indication_pdu_t));
|
||||
UL_INFO->crc_ind.crc_indication_body.number_of_crcs = 0;
|
||||
UL_INFO->harq_ind.harq_indication_body.harq_pdu_list = calloc(NUMBER_OF_UE_MAX, sizeof(nfapi_harq_indication_pdu_t));
|
||||
UL_INFO->harq_ind.harq_indication_body.harq_pdu_list = calloc(NFAPI_HARQ_IND_MAX_PDU, sizeof(nfapi_harq_indication_pdu_t));
|
||||
UL_INFO->harq_ind.harq_indication_body.number_of_harqs = 0;
|
||||
UL_INFO->sr_ind.sr_indication_body.sr_pdu_list = calloc(NUMBER_OF_UE_MAX, sizeof(nfapi_sr_indication_pdu_t));
|
||||
UL_INFO->sr_ind.sr_indication_body.sr_pdu_list = calloc(NFAPI_SR_IND_MAX_PDU, sizeof(nfapi_sr_indication_pdu_t));
|
||||
UL_INFO->sr_ind.sr_indication_body.number_of_srs = 0;
|
||||
UL_INFO->cqi_ind.cqi_indication_body.cqi_pdu_list = calloc(NUMBER_OF_UE_MAX, sizeof(nfapi_cqi_indication_pdu_t));
|
||||
UL_INFO->cqi_ind.cqi_indication_body.cqi_raw_pdu_list = calloc(NUMBER_OF_UE_MAX, sizeof(nfapi_cqi_indication_raw_pdu_t));
|
||||
UL_INFO->cqi_ind.cqi_indication_body.cqi_pdu_list = calloc(NFAPI_CQI_IND_MAX_PDU, sizeof(nfapi_cqi_indication_pdu_t));
|
||||
UL_INFO->cqi_ind.cqi_indication_body.cqi_raw_pdu_list = calloc(NFAPI_CQI_IND_MAX_PDU, sizeof(nfapi_cqi_indication_raw_pdu_t));
|
||||
UL_INFO->cqi_ind.cqi_indication_body.number_of_cqis = 0;
|
||||
|
||||
proc->subframe_rx = proc->sub_frame_start;
|
||||
@@ -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;
|
||||
|
||||
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",
|
||||
NFAPI_SFNSF2SFN(dl_config_req->sfn_sf), NFAPI_SFNSF2SF(dl_config_req->sfn_sf),
|
||||
dl_num_pdus);
|
||||
@@ -1281,7 +1281,8 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg)
|
||||
send_standalone_msg(UL_INFO, UL_INFO->rx_ind.header.message_id);
|
||||
sent_any = true;
|
||||
|
||||
for (uint8_t num_pdu = 0; num_pdu < UL_INFO->rx_ind.rx_indication_body.number_of_pdus; num_pdu++) {
|
||||
assert(UL_INFO->rx_ind.rx_indication_body.number_of_pdus <= NFAPI_RX_IND_MAX_PDU);
|
||||
for (size_t num_pdu = 0; num_pdu < UL_INFO->rx_ind.rx_indication_body.number_of_pdus; num_pdu++) {
|
||||
free(UL_INFO->rx_ind.rx_indication_body.rx_pdu_list[num_pdu].data);
|
||||
}
|
||||
|
||||
|
||||
@@ -193,6 +193,8 @@ int oaisim_flag=0;
|
||||
*/
|
||||
uint8_t abstraction_flag=0;
|
||||
|
||||
bler_struct bler_data[NUM_MCS];
|
||||
|
||||
/* forward declarations */
|
||||
void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]);
|
||||
|
||||
@@ -756,6 +758,8 @@ int main( int argc, char **argv ) {
|
||||
init_queue(&hi_dci0_req_queue);
|
||||
init_queue(&ul_config_req_queue);
|
||||
|
||||
init_bler_table();
|
||||
|
||||
config_sync_var=0;
|
||||
if (sem_init(&sfn_semaphore, 0, 0) != 0)
|
||||
{
|
||||
@@ -845,3 +849,68 @@ int main( int argc, char **argv ) {
|
||||
printf("Bye.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// Read in each MCS file and build BLER-SINR-TB table
|
||||
void init_bler_table(void)
|
||||
{
|
||||
size_t bufSize = 1024;
|
||||
char * line = NULL;
|
||||
char * token;
|
||||
char * temp = NULL;
|
||||
const char *openair_dir = getenv("OPENAIR_DIR");
|
||||
if (!openair_dir)
|
||||
{
|
||||
LOG_E(MAC, "No $OPENAIR_DIR\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
// Maybe not needed... and may not work.
|
||||
memset(bler_data, 0, sizeof(bler_data));
|
||||
|
||||
for (unsigned int i = 0; i < NUM_MCS; i++)
|
||||
{
|
||||
// Filename needs to be changed to dynamic name
|
||||
char fName[1024];
|
||||
snprintf(fName, sizeof(fName), "%s/openair1/SIMULATION/LTE_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/bler_tx1_chan18_nrx1_mcs%d.csv", openair_dir, i);
|
||||
FILE *pFile = fopen(fName, "r");
|
||||
if (!pFile)
|
||||
{
|
||||
LOG_E(MAC, "Bler File ERROR! - fopen(), file: %s\n", fName);
|
||||
abort();
|
||||
}
|
||||
int nlines = 0;
|
||||
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);
|
||||
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");
|
||||
abort();
|
||||
}
|
||||
|
||||
bler_data[i].bler_table[nlines][ncols] = strtof(token, NULL);
|
||||
ncols++;
|
||||
|
||||
token = strtok_r(NULL, ";", &temp);
|
||||
}
|
||||
nlines++;
|
||||
}
|
||||
bler_data[i].length = nlines;
|
||||
fclose(pFile);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user