Added NR case to prach_test

master
Xavier Arteaga 3 years ago committed by Andre Puschmann
parent 3c4efba418
commit 8bab12fb00

@ -573,6 +573,8 @@ add_lte_test(prach_zc0 prach_test -z 0)
add_lte_test(prach_zc2 prach_test -z 2) add_lte_test(prach_zc2 prach_test -z 2)
add_lte_test(prach_zc3 prach_test -z 3) add_lte_test(prach_zc3 prach_test -z 3)
add_nr_test(prach_nr prach_test -n 50 -f 0 -r 0 -z 0 -N 1)
add_executable(prach_test_multi prach_test_multi.c) add_executable(prach_test_multi prach_test_multi.c)
target_link_libraries(prach_test_multi srsran_phy) target_link_libraries(prach_test_multi srsran_phy)

@ -23,6 +23,7 @@
#define MAX_LEN 70176 #define MAX_LEN 70176
static bool is_nr = false;
static uint32_t nof_prb = 50; static uint32_t nof_prb = 50;
static uint32_t config_idx = 3; static uint32_t config_idx = 3;
static uint32_t root_seq_idx = 0; static uint32_t root_seq_idx = 0;
@ -36,12 +37,13 @@ static void usage(char* prog)
printf("\t-f Preamble format [Default 0]\n"); printf("\t-f Preamble format [Default 0]\n");
printf("\t-r Root sequence index [Default 0]\n"); printf("\t-r Root sequence index [Default 0]\n");
printf("\t-z Zero correlation zone config [Default 1]\n"); printf("\t-z Zero correlation zone config [Default 1]\n");
printf("\t-N Toggle LTE/NR operation, zero for LTE, non-zero for NR [Default %s]\n", is_nr ? "NR" : "LTE");
} }
static void parse_args(int argc, char** argv) static void parse_args(int argc, char** argv)
{ {
int opt; int opt;
while ((opt = getopt(argc, argv, "nfrz")) != -1) { while ((opt = getopt(argc, argv, "nfrzN")) != -1) {
switch (opt) { switch (opt) {
case 'n': case 'n':
nof_prb = (uint32_t)strtol(argv[optind], NULL, 10); nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
@ -55,6 +57,9 @@ static void parse_args(int argc, char** argv)
case 'z': case 'z':
zero_corr_zone = (uint32_t)strtol(argv[optind], NULL, 10); zero_corr_zone = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'N':
is_nr = (uint32_t)strtol(argv[optind], NULL, 10) > 0;
break;
default: default:
usage(argv[0]); usage(argv[0]);
exit(-1); exit(-1);
@ -74,6 +79,7 @@ int main(int argc, char** argv)
srsran_prach_cfg_t prach_cfg; srsran_prach_cfg_t prach_cfg;
ZERO_OBJECT(prach_cfg); ZERO_OBJECT(prach_cfg);
prach_cfg.is_nr = is_nr;
prach_cfg.config_idx = config_idx; prach_cfg.config_idx = config_idx;
prach_cfg.hs_flag = high_speed_flag; prach_cfg.hs_flag = high_speed_flag;
prach_cfg.freq_offset = 0; prach_cfg.freq_offset = 0;

Loading…
Cancel
Save