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
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user