Commit 36190b1c authored by Sakthivel Velumani's avatar Sakthivel Velumani

Logging changes to ulsim

parent ac58460b
...@@ -983,7 +983,6 @@ int main(int argc, char **argv) ...@@ -983,7 +983,6 @@ int main(int argc, char **argv)
int slot_length = slot_offset - frame_parms->get_samples_slot_timestamp(slot-1,frame_parms,0); int slot_length = slot_offset - frame_parms->get_samples_slot_timestamp(slot-1,frame_parms,0);
if (input_fd != NULL) { if (input_fd != NULL) {
AssertFatal(frame_parms->nb_antennas_rx == 1, "nb_ant != 1\n");
// 800 samples is N_TA_OFFSET for FR1 @ 30.72 Ms/s, // 800 samples is N_TA_OFFSET for FR1 @ 30.72 Ms/s,
AssertFatal(frame_parms->subcarrier_spacing==30000,"only 30 kHz for file input for now (%d)\n",frame_parms->subcarrier_spacing); AssertFatal(frame_parms->subcarrier_spacing==30000,"only 30 kHz for file input for now (%d)\n",frame_parms->subcarrier_spacing);
...@@ -1011,7 +1010,9 @@ int main(int argc, char **argv) ...@@ -1011,7 +1010,9 @@ int main(int argc, char **argv)
printf("harq_pid %d\n",harq_pid); printf("harq_pid %d\n",harq_pid);
} }
fseek(input_fd,file_offset*sizeof(int16_t)*2,SEEK_SET); fseek(input_fd,file_offset*sizeof(int16_t)*2,SEEK_SET);
read_errors+=fread((void*)&gNB->common_vars.rxdata[0][slot_offset-delay], for (int irx=0; irx<frame_parms->nb_antennas_rx; irx++) {
fseek(input_fd,irx*(slot_length+15)*sizeof(int16_t)*2,SEEK_SET); // matlab adds samlples to the end to emulate channel delay
read_errors+=fread((void*)&gNB->common_vars.rxdata[irx][slot_offset-delay],
sizeof(int16_t), sizeof(int16_t),
slot_length<<1, slot_length<<1,
input_fd); input_fd);
...@@ -1021,8 +1022,9 @@ int main(int argc, char **argv) ...@@ -1021,8 +1022,9 @@ int main(int argc, char **argv)
} }
for (int i=0;i<16;i+=2) printf("slot_offset %d : %d,%d\n", for (int i=0;i<16;i+=2) printf("slot_offset %d : %d,%d\n",
slot_offset, slot_offset,
((int16_t*)&gNB->common_vars.rxdata[0][slot_offset])[i], ((int16_t*)&gNB->common_vars.rxdata[irx][slot_offset])[i],
((int16_t*)&gNB->common_vars.rxdata[0][slot_offset])[1+i]); ((int16_t*)&gNB->common_vars.rxdata[irx][slot_offset])[1+i]);
}
mod_order = nr_get_Qm_ul(Imcs, mcs_table); mod_order = nr_get_Qm_ul(Imcs, mcs_table);
code_rate = nr_get_code_rate_ul(Imcs, mcs_table); code_rate = nr_get_code_rate_ul(Imcs, mcs_table);
...@@ -1613,17 +1615,19 @@ int main(int argc, char **argv) ...@@ -1613,17 +1615,19 @@ int main(int argc, char **argv)
length_dmrs, length_dmrs,
num_dmrs_cdm_grps_no_data); num_dmrs_cdm_grps_no_data);
LOG_M("ulsimStats.m","SNR",snrStats,snrRun,1,7); char opStatsFile[50];
LOG_MM("ulsimStats.m","BLER_round0",blerStats[0],snrRun,1,7); sprintf(opStatsFile, "ulsimStats_z%d.m", n_rx);
LOG_MM("ulsimStats.m","BLER_round1",blerStats[1],snrRun,1,7); LOG_M(opStatsFile,"SNR",snrStats,snrRun,1,7);
LOG_MM("ulsimStats.m","BLER_round2",blerStats[2],snrRun,1,7); LOG_MM(opStatsFile,"BLER_round0",blerStats[0],snrRun,1,7);
LOG_MM("ulsimStats.m","BLER_round3",blerStats[3],snrRun,1,7); LOG_MM(opStatsFile,"BLER_round1",blerStats[1],snrRun,1,7);
LOG_MM("ulsimStats.m","BER_round0",berStats[0],snrRun,1,7); LOG_MM(opStatsFile,"BLER_round2",blerStats[2],snrRun,1,7);
LOG_MM("ulsimStats.m","BER_round1",berStats[1],snrRun,1,7); LOG_MM(opStatsFile,"BLER_round3",blerStats[3],snrRun,1,7);
LOG_MM("ulsimStats.m","BER_round2",berStats[2],snrRun,1,7); LOG_MM(opStatsFile,"BER_round0",berStats[0],snrRun,1,7);
LOG_MM("ulsimStats.m","BER_round3",berStats[3],snrRun,1,7); LOG_MM(opStatsFile,"BER_round1",berStats[1],snrRun,1,7);
LOG_MM("ulsimStats.m","EffRate",effRate,snrRun,1,7); LOG_MM(opStatsFile,"BER_round2",berStats[2],snrRun,1,7);
LOG_MM("ulsimStats.m","EffTP",effTP,snrRun,1,7); LOG_MM(opStatsFile,"BER_round3",berStats[3],snrRun,1,7);
LOG_MM(opStatsFile,"EffRate",effRate,snrRun,1,7);
LOG_MM(opStatsFile,"EffTP",effTP,snrRun,1,7);
free(test_input_bit); free(test_input_bit);
free(estimated_output_bit); free(estimated_output_bit);
......
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