Commit fefa42c8 authored by Raymond Knopp's avatar Raymond Knopp Committed by frtabu

phy simulators remove measurments printf and check/allow log level config

parent 683072f4
...@@ -514,7 +514,7 @@ int main(int argc, char *argv[]) ...@@ -514,7 +514,7 @@ int main(int argc, char *argv[])
unsigned char qbits=8; unsigned char qbits=8;
unsigned int decoded_errors[10000]; // initiate the size of matrix equivalent to size of SNR unsigned int decoded_errors[10000]; // initiate the size of matrix equivalent to size of SNR
int c,i=0, i1 = 0; int c,i=0, i1 = 0;
int loglvl=OAILOG_WARNING;
int n_trials = 1; int n_trials = 1;
double SNR_step = 0.1; double SNR_step = 0.1;
...@@ -525,8 +525,11 @@ int main(int argc, char *argv[]) ...@@ -525,8 +525,11 @@ int main(int argc, char *argv[])
n_iter_stats_t dec_iter[3]; n_iter_stats_t dec_iter[3];
short BG=0,Zc,Kb=0; short BG=0,Zc,Kb=0;
if ( load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) == 0) {
exit_fun(" Error, configuration module init failed\n");
} // must be done before specific options parsing to prevent errasing them
while ((c = getopt (argc, argv, "q:r:s:S:l:G:n:d:i:t:u:hv:")) != -1) while ((c = getopt (argc, argv, "q:r:s:S:l:L:G:n:d:i:t:u:hv:")) != -1)
switch (c) switch (c)
{ {
case 'q': case 'q':
...@@ -545,6 +548,10 @@ int main(int argc, char *argv[]) ...@@ -545,6 +548,10 @@ int main(int argc, char *argv[])
block_length = atoi(optarg); block_length = atoi(optarg);
break; break;
case 'L':
loglvl = atoi(optarg);
break;
case 'G': case 'G':
ldpc_version="_cuda"; ldpc_version="_cuda";
break; break;
...@@ -581,6 +588,7 @@ int main(int argc, char *argv[]) ...@@ -581,6 +588,7 @@ int main(int argc, char *argv[])
printf("BG1 (blocklength > 3840): 1/3, 2/3, 22/25 (8/9) \n"); printf("BG1 (blocklength > 3840): 1/3, 2/3, 22/25 (8/9) \n");
printf("BG2 (blocklength <= 3840): 1/5, 1/3, 2/3 \n\n"); printf("BG2 (blocklength <= 3840): 1/5, 1/3, 2/3 \n\n");
printf("-h This message\n"); printf("-h This message\n");
printf("-L <log level, 0(errors), 1(warning), 2(info) 3(debug) 4 (trace)>\n");
printf("-q Quantization bits, Default: 8\n"); printf("-q Quantization bits, Default: 8\n");
printf("-r Nominator rate, (1, 2, 22), Default: 1\n"); printf("-r Nominator rate, (1, 2, 22), Default: 1\n");
printf("-d Denominator rate, (3, 5, 25), Default: 1\n"); printf("-d Denominator rate, (3, 5, 25), Default: 1\n");
...@@ -603,6 +611,8 @@ int main(int argc, char *argv[]) ...@@ -603,6 +611,8 @@ int main(int argc, char *argv[])
printf("n_trials %d: \n", n_trials); printf("n_trials %d: \n", n_trials);
printf("SNR0 %f: \n", SNR0); printf("SNR0 %f: \n", SNR0);
logInit();
set_glog(loglvl);
if (ldpc_version != NULL) if (ldpc_version != NULL)
load_nrLDPClib(ldpc_version); load_nrLDPClib(ldpc_version);
......
...@@ -509,7 +509,6 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, ...@@ -509,7 +509,6 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]);
if (cpumeas(CPUMEAS_GETSTATE)) if (cpumeas(CPUMEAS_GETSTATE))
LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); start_meas(&ue->generic_stat_bis[proc->thread_id][slot]);
if (frame_parms->nb_antennas_rx > 1) { if (frame_parms->nb_antennas_rx > 1) {
...@@ -566,6 +565,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, ...@@ -566,6 +565,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]);
if (cpumeas(CPUMEAS_GETSTATE)) if (cpumeas(CPUMEAS_GETSTATE))
LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); start_meas(&ue->generic_stat_bis[proc->thread_id][slot]);
/* Store the valid DL RE's */ /* Store the valid DL RE's */
pdsch_vars[gNB_id]->dl_valid_re[symbol-1] = len; pdsch_vars[gNB_id]->dl_valid_re[symbol-1] = len;
......
...@@ -1025,7 +1025,6 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, ...@@ -1025,7 +1025,6 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]);
if (cpumeas(CPUMEAS_GETSTATE)) { if (cpumeas(CPUMEAS_GETSTATE)) {
LOG_D(PHY, " --> Unscrambling for CW0 %5.3f\n", LOG_D(PHY, " --> Unscrambling for CW0 %5.3f\n",
(ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0));
...@@ -1859,7 +1858,6 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, ...@@ -1859,7 +1858,6 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
LOG_D(PHY, "[SFN %d] Slot1: Pdsch Proc %5.2f\n",nr_slot_rx,ue->pdsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); LOG_D(PHY, "[SFN %d] Slot1: Pdsch Proc %5.2f\n",nr_slot_rx,ue->pdsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0));
LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",nr_slot_rx,ue->dlsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",nr_slot_rx,ue->dlsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0));
} }
// deactivate dlsch once dlsch proc is done // deactivate dlsch once dlsch proc is done
ue->dlsch[proc->thread_id][gNB_id][0]->active = 0; ue->dlsch[proc->thread_id][gNB_id][0]->active = 0;
...@@ -1933,6 +1931,8 @@ if (nr_slot_rx==9) { ...@@ -1933,6 +1931,8 @@ if (nr_slot_rx==9) {
} }
stop_meas(&ue->generic_stat); stop_meas(&ue->generic_stat);
if (cpumeas(CPUMEAS_GETSTATE))
LOG_D(PHY,"after tubo until end of Rx %5.2f \n",ue->generic_stat.p_time/(cpuf*1000.0));
#ifdef EMOS #ifdef EMOS
phy_procedures_emos_UE_RX(ue,slot,gNB_id); phy_procedures_emos_UE_RX(ue,slot,gNB_id);
...@@ -1944,6 +1944,7 @@ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDUR ...@@ -1944,6 +1944,7 @@ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDUR
stop_meas(&ue->phy_proc_rx[proc->thread_id]); stop_meas(&ue->phy_proc_rx[proc->thread_id]);
if (cpumeas(CPUMEAS_GETSTATE)) if (cpumeas(CPUMEAS_GETSTATE))
LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",nr_slot_rx,ue->phy_proc_rx[proc->thread_id].p_time/(cpuf*1000.0)); LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",nr_slot_rx,ue->phy_proc_rx[proc->thread_id].p_time/(cpuf*1000.0));
//#endif //pdsch //#endif //pdsch
LOG_D(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, nr_slot_rx); LOG_D(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, nr_slot_rx);
......
...@@ -645,6 +645,7 @@ int main(int argc, char **argv) ...@@ -645,6 +645,7 @@ int main(int argc, char **argv)
printf("%s -h(elp) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -n n_frames -t Delayspread -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant -i Intefrence0 -j Interference1 -A interpolation_file -C(alibration offset dB) -N CellId\n", printf("%s -h(elp) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -n n_frames -t Delayspread -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant -i Intefrence0 -j Interference1 -A interpolation_file -C(alibration offset dB) -N CellId\n",
argv[0]); argv[0]);
printf("-h This message\n"); printf("-h This message\n");
printf("-L <log level, 0(errors), 1(warning), 2(info) 3(debug) 4 (trace)>\n");
//printf("-p Use extended prefix mode\n"); //printf("-p Use extended prefix mode\n");
//printf("-d Use TDD\n"); //printf("-d Use TDD\n");
printf("-n Number of frames to simulate\n"); printf("-n Number of frames to simulate\n");
......
...@@ -600,6 +600,7 @@ int main(int argc, char **argv) ...@@ -600,6 +600,7 @@ int main(int argc, char **argv)
//printf("-C Generate Calibration information for Abstraction (effective SNR adjustment to remove Pe bias w.r.t. AWGN)\n"); //printf("-C Generate Calibration information for Abstraction (effective SNR adjustment to remove Pe bias w.r.t. AWGN)\n");
printf("-F Input filename (.txt format) for RX conformance testing\n"); printf("-F Input filename (.txt format) for RX conformance testing\n");
printf("-G Offset of samples to read from file (0 default)\n"); printf("-G Offset of samples to read from file (0 default)\n");
printf("-L <log level, 0(errors), 1(warning), 2(info) 3(debug) 4 (trace)>\n");
printf("-M Multiple SSB positions in burst\n"); printf("-M Multiple SSB positions in burst\n");
printf("-N Nid_cell\n"); printf("-N Nid_cell\n");
printf("-O oversampling factor (1,2,4,8,16)\n"); printf("-O oversampling factor (1,2,4,8,16)\n");
...@@ -640,7 +641,7 @@ int main(int argc, char **argv) ...@@ -640,7 +641,7 @@ int main(int argc, char **argv)
else if (N_RB_UL == 106) bandwidth = 40; else if (N_RB_UL == 106) bandwidth = 40;
else if (N_RB_UL == 32) bandwidth = 50; else if (N_RB_UL == 32) bandwidth = 50;
else { printf("Add N_RB_UL %d\n",N_RB_UL); exit(-1); } else { printf("Add N_RB_UL %d\n",N_RB_UL); exit(-1); }
LOG_I( PHY,"++++++++++++++++++++++++++++++++++++++++++++++%i+++++++++++++++++++++++++++++++++++++++++",loglvl);
if (openair0_cfg[0].threequarter_fs == 1) sampling_frequency*=.75; if (openair0_cfg[0].threequarter_fs == 1) sampling_frequency*=.75;
UE2gNB = new_channel_desc_scm(n_tx, n_rx, channel_model, UE2gNB = new_channel_desc_scm(n_tx, n_rx, channel_model,
......
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