Added SSB different SCS combination unit test

master
Xavier Arteaga 3 years ago committed by Andre Puschmann
parent 55f5f74ff3
commit d0ce17f736

@ -129,11 +129,21 @@ add_test(cfo_test_2 cfo_test -f 0.99849 -n 1000)
add_executable(ssb_measure_test ssb_measure_test.c)
target_link_libraries(ssb_measure_test srsran_phy)
add_nr_test(ssb_measure_test ssb_measure_test)
add_executable(ssb_decode_test ssb_decode_test.c)
target_link_libraries(ssb_decode_test srsran_phy)
add_nr_test(ssb_decode_test ssb_decode_test)
# For each supported SSB subcarrier spacing
foreach (SSB_SCS 15 30)
# For each supported Cell/Carrier subcarrier spacing
foreach (CELL_SCS 15 30)
# Test SSB measurements
add_nr_test(ssb_measure_test_${SSB_SCS}_${CELL_SCS} ssb_measure_test -s ${SSB_SCS} -S ${CELL_SCS})
# Test SSB PBCH decoding
add_nr_test(ssb_decode_test_${SSB_SCS}_${CELL_SCS} ssb_decode_test -s ${SSB_SCS} -S ${CELL_SCS})
endforeach ()
endforeach ()
add_executable(ssb_file_test ssb_file_test.c)
target_link_libraries(ssb_file_test srsran_phy)

@ -41,14 +41,30 @@ static cf_t* buffer = NULL; // Base-band buffer
static void usage(char* prog)
{
printf("Usage: %s [v]\n", prog);
printf("\t-s SSB subcarrier spacing [default, %s kHz]\n", srsran_subcarrier_spacing_to_str(ssb_scs));
printf("\t-S cell/carrier subcarrier spacing [default, %s kHz]\n", srsran_subcarrier_spacing_to_str(carrier_scs));
printf("\t-v [set srsran_verbose to debug, default none]\n");
}
static void parse_args(int argc, char** argv)
{
int opt;
while ((opt = getopt(argc, argv, "v")) != -1) {
while ((opt = getopt(argc, argv, "Ssv")) != -1) {
switch (opt) {
case 's':
ssb_scs = srsran_subcarrier_spacing_from_str(argv[optind]);
if (ssb_scs == srsran_subcarrier_spacing_invalid) {
ERROR("Invalid SSB subcarrier spacing %s\n", argv[optind]);
exit(-1);
}
break;
case 'S':
carrier_scs = srsran_subcarrier_spacing_from_str(argv[optind]);
if (carrier_scs == srsran_subcarrier_spacing_invalid) {
ERROR("Invalid Cell/Carrier subcarrier spacing %s\n", argv[optind]);
exit(-1);
}
break;
case 'v':
srsran_verbose++;
break;

@ -45,14 +45,30 @@ static cf_t* buffer = NULL; // Base-band buffer
static void usage(char* prog)
{
printf("Usage: %s [v]\n", prog);
printf("\t-s SSB subcarrier spacing [default, %s kHz]\n", srsran_subcarrier_spacing_to_str(ssb_scs));
printf("\t-S cell/carrier subcarrier spacing [default, %s kHz]\n", srsran_subcarrier_spacing_to_str(carrier_scs));
printf("\t-v [set srsran_verbose to debug, default none]\n");
}
static void parse_args(int argc, char** argv)
{
int opt;
while ((opt = getopt(argc, argv, "v")) != -1) {
while ((opt = getopt(argc, argv, "Ssv")) != -1) {
switch (opt) {
case 's':
ssb_scs = srsran_subcarrier_spacing_from_str(argv[optind]);
if (ssb_scs == srsran_subcarrier_spacing_invalid) {
ERROR("Invalid SSB subcarrier spacing %s\n", argv[optind]);
exit(-1);
}
break;
case 'S':
carrier_scs = srsran_subcarrier_spacing_from_str(argv[optind]);
if (carrier_scs == srsran_subcarrier_spacing_invalid) {
ERROR("Invalid Cell/Carrier subcarrier spacing %s\n", argv[optind]);
exit(-1);
}
break;
case 'v':
srsran_verbose++;
break;

Loading…
Cancel
Save