Adding new command line parameters
This commit is contained in:
committed by
Thomas Schlichter
parent
b0f5f5f864
commit
61a1b1c5a8
@@ -84,7 +84,7 @@ int main(int argc, char **argv)
|
|||||||
int slot = 0;
|
int slot = 0;
|
||||||
FILE *output_fd = NULL;
|
FILE *output_fd = NULL;
|
||||||
//uint8_t write_output_file = 0;
|
//uint8_t write_output_file = 0;
|
||||||
int trial, n_trials = 1, n_errors = 0, n_false_positive = 0;
|
int trial, n_trials = 1, n_errors = 0, n_false_positive = 0, delay = 0;
|
||||||
uint8_t n_tx = 1, n_rx = 1;
|
uint8_t n_tx = 1, n_rx = 1;
|
||||||
//uint8_t transmission_mode = 1;
|
//uint8_t transmission_mode = 1;
|
||||||
uint16_t Nid_cell = 0;
|
uint16_t Nid_cell = 0;
|
||||||
@@ -113,7 +113,6 @@ int main(int argc, char **argv)
|
|||||||
int start_rb = 0;
|
int start_rb = 0;
|
||||||
int UE_id =0; // [hna] only works for UE_id = 0 because NUMBER_OF_NR_UE_MAX is set to 1 (phy_init_nr_gNB causes segmentation fault)
|
int UE_id =0; // [hna] only works for UE_id = 0 because NUMBER_OF_NR_UE_MAX is set to 1 (phy_init_nr_gNB causes segmentation fault)
|
||||||
|
|
||||||
|
|
||||||
cpuf = get_cpu_freq_GHz();
|
cpuf = get_cpu_freq_GHz();
|
||||||
|
|
||||||
|
|
||||||
@@ -127,8 +126,21 @@ int main(int argc, char **argv)
|
|||||||
//logInit();
|
//logInit();
|
||||||
randominit(0);
|
randominit(0);
|
||||||
|
|
||||||
while ((c = getopt(argc, argv, "df:hpg:i:j:n:l:m:r:s:S:y:z:M:N:F:R:P:")) != -1) {
|
while ((c = getopt(argc, argv, "d:f:g:h:i:j:l:m:n:p:r:s:y:z:F:M:N:P:R:S:")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
|
|
||||||
|
/*case 'd':
|
||||||
|
frame_type = 1;
|
||||||
|
break;*/
|
||||||
|
|
||||||
|
case 'd':
|
||||||
|
delay = atoi(optarg);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'f':
|
||||||
|
number_of_frames = atoi(optarg);
|
||||||
|
break;
|
||||||
|
|
||||||
/*case 'f':
|
/*case 'f':
|
||||||
write_output_file = 1;
|
write_output_file = 1;
|
||||||
output_fd = fopen(optarg, "w");
|
output_fd = fopen(optarg, "w");
|
||||||
@@ -140,10 +152,6 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
break;*/
|
break;*/
|
||||||
|
|
||||||
/*case 'd':
|
|
||||||
frame_type = 1;
|
|
||||||
break;*/
|
|
||||||
|
|
||||||
case 'g':
|
case 'g':
|
||||||
switch ((char) *optarg) {
|
switch ((char) *optarg) {
|
||||||
case 'A':
|
case 'A':
|
||||||
@@ -189,8 +197,24 @@ int main(int argc, char **argv)
|
|||||||
interf2 = atoi(optarg);
|
interf2 = atoi(optarg);
|
||||||
break;*/
|
break;*/
|
||||||
|
|
||||||
|
case 'l':
|
||||||
|
nb_symb_sch = atoi(optarg);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'm':
|
||||||
|
Imcs = atoi(optarg);
|
||||||
|
break;
|
||||||
|
|
||||||
case 'n':
|
case 'n':
|
||||||
number_of_frames = atoi(optarg);
|
n_trials = atoi(optarg);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'p':
|
||||||
|
extended_prefix_flag = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'r':
|
||||||
|
nb_rb = atoi(optarg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 's':
|
case 's':
|
||||||
@@ -198,16 +222,6 @@ int main(int argc, char **argv)
|
|||||||
printf("Setting SNR0 to %f\n", snr0);
|
printf("Setting SNR0 to %f\n", snr0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'S':
|
|
||||||
snr1 = atof(optarg);
|
|
||||||
snr1set = 1;
|
|
||||||
printf("Setting SNR1 to %f\n", snr1);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'p':
|
|
||||||
extended_prefix_flag = 1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
case 'r':
|
case 'r':
|
||||||
ricean_factor = pow(10,-.1*atof(optarg));
|
ricean_factor = pow(10,-.1*atof(optarg));
|
||||||
@@ -218,6 +232,10 @@ int main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*case 'x':
|
||||||
|
transmission_mode = atoi(optarg);
|
||||||
|
break;*/
|
||||||
|
|
||||||
case 'y':
|
case 'y':
|
||||||
n_tx = atoi(optarg);
|
n_tx = atoi(optarg);
|
||||||
|
|
||||||
@@ -238,6 +256,16 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'F':
|
||||||
|
input_fd = fopen(optarg, "r");
|
||||||
|
|
||||||
|
if (input_fd == NULL) {
|
||||||
|
printf("Problem with filename %s\n", optarg);
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
case 'M':
|
case 'M':
|
||||||
SSB_positions = atoi(optarg);
|
SSB_positions = atoi(optarg);
|
||||||
break;
|
break;
|
||||||
@@ -251,56 +279,39 @@ int main(int argc, char **argv)
|
|||||||
N_RB_UL = N_RB_DL;
|
N_RB_UL = N_RB_DL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'F':
|
case 'S':
|
||||||
input_fd = fopen(optarg, "r");
|
snr1 = atof(optarg);
|
||||||
|
snr1set = 1;
|
||||||
if (input_fd == NULL) {
|
printf("Setting SNR1 to %f\n", snr1);
|
||||||
printf("Problem with filename %s\n", optarg);
|
|
||||||
exit(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'm':
|
|
||||||
Imcs = atoi(optarg);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'l':
|
|
||||||
nb_symb_sch = atoi(optarg);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'r':
|
|
||||||
nb_rb = atoi(optarg);
|
|
||||||
break;
|
|
||||||
|
|
||||||
/*case 'x':
|
|
||||||
transmission_mode = atoi(optarg);
|
|
||||||
break;*/
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
case 'h':
|
case 'h':
|
||||||
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]);
|
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]);
|
||||||
printf("-h This message\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("-d Introduce delay in terms of number of samples\n");
|
||||||
printf("-s Starting SNR, runs from SNR0 to SNR0 + 5 dB. If n_frames is 1 then just SNR is simulated\n");
|
printf("-f Number of frames to simulate\n");
|
||||||
printf("-S Ending SNR, runs from SNR0 to SNR1\n");
|
|
||||||
printf("-t Delay spread for multipath channel\n");
|
|
||||||
printf("-g [A,B,C,D,E,F,G] Use 3GPP SCM (A,B,C,D) or 36-101 (E-EPA,F-EVA,G-ETU) models (ignores delay spread and Ricean factor)\n");
|
printf("-g [A,B,C,D,E,F,G] Use 3GPP SCM (A,B,C,D) or 36-101 (E-EPA,F-EVA,G-ETU) models (ignores delay spread and Ricean factor)\n");
|
||||||
|
printf("-h This message\n");
|
||||||
|
//printf("-i Relative strength of first intefering eNB (in dB) - cell_id mod 3 = 1\n");
|
||||||
|
//printf("-j Relative strength of second intefering eNB (in dB) - cell_id mod 3 = 2\n");
|
||||||
|
printf("-s Starting SNR, runs from SNR0 to SNR0 + 10 dB if ending SNR isn't given\n");
|
||||||
|
printf("-m MCS value\n");
|
||||||
|
printf("-n Number of trials to simulate\n");
|
||||||
|
printf("-p Use extended prefix mode\n");
|
||||||
|
printf("-t Delay spread for multipath channel\n");
|
||||||
//printf("-x Transmission mode (1,2,6 for the moment)\n");
|
//printf("-x Transmission mode (1,2,6 for the moment)\n");
|
||||||
printf("-y Number of TX antennas used in eNB\n");
|
printf("-y Number of TX antennas used in eNB\n");
|
||||||
printf("-z Number of RX antennas used in UE\n");
|
printf("-z Number of RX antennas used in UE\n");
|
||||||
//printf("-i Relative strength of first intefering eNB (in dB) - cell_id mod 3 = 1\n");
|
|
||||||
//printf("-j Relative strength of second intefering eNB (in dB) - cell_id mod 3 = 2\n");
|
|
||||||
printf("-M Multiple SSB positions in burst\n");
|
|
||||||
printf("-N Nid_cell\n");
|
|
||||||
printf("-R N_RB_DL\n");
|
|
||||||
printf("-O oversampling factor (1,2,4,8,16)\n");
|
|
||||||
printf("-A Interpolation_filname Run with Abstraction to generate Scatter plot using interpolation polynomial in file\n");
|
printf("-A Interpolation_filname Run with Abstraction to generate Scatter plot using interpolation polynomial in file\n");
|
||||||
//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 Output filename (.txt format) for Pe/SNR results\n");
|
|
||||||
printf("-F Input filename (.txt format) for RX conformance testing\n");
|
printf("-F Input filename (.txt format) for RX conformance testing\n");
|
||||||
|
printf("-M Multiple SSB positions in burst\n");
|
||||||
|
printf("-N Nid_cell\n");
|
||||||
|
printf("-O oversampling factor (1,2,4,8,16)\n");
|
||||||
|
printf("-R N_RB_DL\n");
|
||||||
|
printf("-S Ending SNR, runs from SNR0 to SNR1\n");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -492,8 +503,8 @@ int main(int argc, char **argv)
|
|||||||
//----------------------------------------------------------
|
//----------------------------------------------------------
|
||||||
for (i=0; i<frame_length_complex_samples; i++) {
|
for (i=0; i<frame_length_complex_samples; i++) {
|
||||||
for (ap=0; ap<frame_parms->nb_antennas_rx; ap++) {
|
for (ap=0; ap<frame_parms->nb_antennas_rx; ap++) {
|
||||||
((short*) gNB->common_vars.rxdata[ap])[2*i] = (((int16_t *)UE->common_vars.txdata[ap])[(i<<1)]) + (int16_t)(sqrt(sigma/2)*gaussdouble(0.0,1.0)*(double)AMP); // convert to fixed point
|
((short*) gNB->common_vars.rxdata[ap])[(2*i) + (delay*2)] = (((int16_t *)UE->common_vars.txdata[ap])[(i<<1)]) + (int16_t)(sqrt(sigma/2)*gaussdouble(0.0,1.0)*(double)AMP); // convert to fixed point
|
||||||
((short*) gNB->common_vars.rxdata[ap])[2*i+1] = (((int16_t *)UE->common_vars.txdata[ap])[(i<<1)+1]) + (int16_t)(sqrt(sigma/2)*gaussdouble(0.0,1.0)*(double)AMP);
|
((short*) gNB->common_vars.rxdata[ap])[2*i+1 + (delay*2)] = (((int16_t *)UE->common_vars.txdata[ap])[(i<<1)+1]) + (int16_t)(sqrt(sigma/2)*gaussdouble(0.0,1.0)*(double)AMP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
|
|||||||
Reference in New Issue
Block a user