Fix ODR issue detected by ASAN in arch for the srsran_verbose global variable.

master
faluco 3 years ago committed by Andre Puschmann
parent fa8e8ddf1f
commit dc31fb05a3

@ -97,7 +97,7 @@ void parse_args(int argc, char** argv)
rf_gain = strtof(argv[optind], NULL); rf_gain = strtof(argv[optind], NULL);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -97,7 +97,7 @@ void parse_args(int argc, char** argv)
scan_raster_offset = true; scan_raster_offset = true;
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -161,7 +161,7 @@ void parse_args(int argc, char** argv)
cell.nbiot_prb = (uint32_t)strtol(argv[optind], NULL, 10); cell.nbiot_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -219,7 +219,7 @@ void parse_args(prog_args_t* args, int argc, char** argv)
args->disable_plots_except_constellation = true; args->disable_plots_except_constellation = true;
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(args, argv[0]); usage(args, argv[0]);

@ -57,7 +57,7 @@ static int net_port = -1; // -1 generates random dataThat means there is so
static uint32_t cfi = 2; static uint32_t cfi = 2;
static uint32_t mcs_idx = 1, last_mcs_idx = 1; static uint32_t mcs_idx = 1, last_mcs_idx = 1;
static int nof_frames = -1; static int nof_frames = -1;
static srsran_tm_t transmission_mode = SRSRAN_TM1; static srsran_tm_t transmission_mode = SRSRAN_TM1;
static uint32_t nof_tb = 1; static uint32_t nof_tb = 1;
static uint32_t multiplex_pmi = 0; static uint32_t multiplex_pmi = 0;
static uint32_t multiplex_nof_layers = 1; static uint32_t multiplex_nof_layers = 1;
@ -189,7 +189,7 @@ static void parse_args(int argc, char** argv)
mbsfn_area_id = (int)strtol(argv[optind], NULL, 10); mbsfn_area_id = (int)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
case 's': case 's':
output_file_snr = strtof(argv[optind], NULL); output_file_snr = strtof(argv[optind], NULL);

@ -277,8 +277,8 @@ void parse_args(prog_args_t* args, int argc, char** argv)
args->disable_plots_except_constellation = true; args->disable_plots_except_constellation = true;
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
args->verbose = srsran_verbose; args->verbose = get_srsran_verbose_level();
break; break;
case 'Z': case 'Z':
args->decimate = (int)strtol(argv[optind], NULL, 10); args->decimate = (int)strtol(argv[optind], NULL, 10);
@ -690,16 +690,16 @@ int main(int argc, char** argv)
to.tv_usec = 0; to.tv_usec = 0;
/* Set default verbose level */ /* Set default verbose level */
srsran_verbose = prog_args.verbose; set_srsran_verbose_level(prog_args.verbose);
int n = select(1, &set, NULL, NULL, &to); int n = select(1, &set, NULL, NULL, &to);
if (n == 1) { if (n == 1) {
/* If a new line is detected set verbose level to Debug */ /* If a new line is detected set verbose level to Debug */
if (fgets(input, sizeof(input), stdin)) { if (fgets(input, sizeof(input), stdin)) {
srsran_verbose = SRSRAN_VERBOSE_DEBUG; set_srsran_verbose_level(SRSRAN_VERBOSE_DEBUG);
pkt_errors = 0; pkt_errors = 0;
pkt_total = 0; pkt_total = 0;
nof_detected = 0; nof_detected = 0;
nof_trials = 0; nof_trials = 0;
} }
} }

@ -179,7 +179,7 @@ void parse_args(prog_args_t* args, int argc, char** argv)
args->nof_rx_antennas = (int32_t)strtol(argv[optind], NULL, 10); args->nof_rx_antennas = (int32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
case 'w': case 'w':
args->disable_plots = true; args->disable_plots = true;

@ -74,7 +74,7 @@ void parse_args(int argc, char** argv)
force_cfo = strtof(argv[optind], NULL); force_cfo = strtof(argv[optind], NULL);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -75,7 +75,7 @@ void parse_args(int argc, char** argv)
nof_rx_antennas = (int)strtol(argv[optind], NULL, 10); nof_rx_antennas = (int)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -96,7 +96,7 @@ void parse_args(int argc, char** argv)
nof_rx_antennas = (uint32_t)strtol(argv[optind], NULL, 10); nof_rx_antennas = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -68,7 +68,7 @@ void parse_args(int argc, char** argv)
nof_subframes = (int)strtol(argv[optind], NULL, 10); nof_subframes = (int)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -114,7 +114,7 @@ int main(int argc, char** argv)
ERROR("Error receiving samples"); ERROR("Error receiving samples");
exit(-1); exit(-1);
} }
if (srsran_verbose == SRSRAN_VERBOSE_INFO) { if (get_srsran_verbose_level() == SRSRAN_VERBOSE_INFO) {
printf("Received %d samples from radio\n", n); printf("Received %d samples from radio\n", n);
} }
@ -127,7 +127,7 @@ int main(int argc, char** argv)
print_cnt = 0; print_cnt = 0;
} }
} else { } else {
if (srsran_verbose == SRSRAN_VERBOSE_INFO) { if (get_srsran_verbose_level() == SRSRAN_VERBOSE_INFO) {
printf("Transmitted %d bytes to ZMQ\n", n); printf("Transmitted %d bytes to ZMQ\n", n);
} }
} }
@ -230,7 +230,7 @@ static void parse_args(int argc, char** argv)
rf_freq = strtof(argv[optind], NULL); rf_freq = strtof(argv[optind], NULL);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
case 'z': case 'z':
zmq_args = argv[optind]; zmq_args = argv[optind];

@ -38,22 +38,24 @@ SRSRAN_API void get_time_interval(struct timeval* tdata);
#define SRSRAN_DEBUG_ENABLED 1 #define SRSRAN_DEBUG_ENABLED 1
SRSRAN_API extern int srsran_verbose; SRSRAN_API int get_srsran_verbose_level(void);
SRSRAN_API void set_srsran_verbose_level(int level);
SRSRAN_API void increase_srsran_verbose_level(void);
SRSRAN_API bool is_handler_registered(void); SRSRAN_API bool is_handler_registered(void);
SRSRAN_API void set_handler_enabled(bool enable); SRSRAN_API void set_handler_enabled(bool enable);
#define SRSRAN_VERBOSE_ISINFO() (srsran_verbose >= SRSRAN_VERBOSE_INFO) #define SRSRAN_VERBOSE_ISINFO() (get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO)
#define SRSRAN_VERBOSE_ISDEBUG() (srsran_verbose >= SRSRAN_VERBOSE_DEBUG) #define SRSRAN_VERBOSE_ISDEBUG() (get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG)
#define SRSRAN_VERBOSE_ISNONE() (srsran_verbose == SRSRAN_VERBOSE_NONE) #define SRSRAN_VERBOSE_ISNONE() (get_srsran_verbose_level() == SRSRAN_VERBOSE_NONE)
#define PRINT_DEBUG srsran_verbose = SRSRAN_VERBOSE_DEBUG #define PRINT_DEBUG set_srsran_verbose_level(SRSRAN_VERBOSE_DEBUG)
#define PRINT_INFO srsran_verbose = SRSRAN_VERBOSE_INFO #define PRINT_INFO set_srsran_verbose_level(SRSRAN_VERBOSE_INFO)
#define PRINT_NONE srsran_verbose = SRSRAN_VERBOSE_NONE #define PRINT_NONE set_srsran_verbose_level(SRSRAN_VERBOSE_NONE)
#define DEBUG(_fmt, ...) \ #define DEBUG(_fmt, ...) \
do { \ do { \
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { \ if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { \
fprintf(stdout, "[DEBUG]: " _fmt "\n", ##__VA_ARGS__); \ fprintf(stdout, "[DEBUG]: " _fmt "\n", ##__VA_ARGS__); \
} else { \ } else { \
srsran_phy_log_print(LOG_LEVEL_DEBUG_S, _fmt, ##__VA_ARGS__); \ srsran_phy_log_print(LOG_LEVEL_DEBUG_S, _fmt, ##__VA_ARGS__); \
@ -62,7 +64,7 @@ SRSRAN_API void set_handler_enabled(bool enable);
#define INFO(_fmt, ...) \ #define INFO(_fmt, ...) \
do { \ do { \
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { \ if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { \
fprintf(stdout, "[INFO]: " _fmt "\n", ##__VA_ARGS__); \ fprintf(stdout, "[INFO]: " _fmt "\n", ##__VA_ARGS__); \
} else { \ } else { \
srsran_phy_log_print(LOG_LEVEL_INFO_S, _fmt, ##__VA_ARGS__); \ srsran_phy_log_print(LOG_LEVEL_INFO_S, _fmt, ##__VA_ARGS__); \

@ -440,7 +440,7 @@ int srsran_dmrs_pdcch_get_measure(const srsran_dmrs_pdcch_estimator_t* q,
nof_pilots += NOF_PILOTS_X_RB; nof_pilots += NOF_PILOTS_X_RB;
} }
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) {
DMRS_PDCCH_DEBUG_RX("Measuring PDCCH l=%d; lse=", l); DMRS_PDCCH_DEBUG_RX("Measuring PDCCH l=%d; lse=", l);
srsran_vec_fprint_c(stdout, tmp, nof_pilots); srsran_vec_fprint_c(stdout, tmp, nof_pilots);
} }

@ -79,7 +79,7 @@ void parse_args(int argc, char** argv)
snr_db = strtof(argv[optind], NULL); snr_db = strtof(argv[optind], NULL);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -59,7 +59,7 @@ void parse_args(int argc, char** argv)
output_matlab = argv[optind]; output_matlab = argv[optind];
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -67,7 +67,7 @@ void parse_args(int argc, char** argv)
} }
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -176,7 +176,7 @@ void parse_args(int argc, char** argv)
cell.id = (uint32_t)strtol(argv[optind], NULL, 10); cell.id = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -62,7 +62,7 @@ void parse_args(int argc, char** argv)
output_matlab = argv[optind]; output_matlab = argv[optind];
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -46,7 +46,7 @@ static int nzp_test_case(const srsran_slot_cfg_t* slot_cfg,
srsran_convert_power_to_dB(srsran_convert_dB_to_power(rsrp_dB_gold) + awgn->std_dev * awgn->std_dev); srsran_convert_power_to_dB(srsran_convert_dB_to_power(rsrp_dB_gold) + awgn->std_dev * awgn->std_dev);
const float n0_dB_gold = srsran_convert_amplitude_to_dB(awgn->std_dev); const float n0_dB_gold = srsran_convert_amplitude_to_dB(awgn->std_dev);
if (srsran_verbose >= SRSRAN_VERBOSE_INFO) { if (get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO) {
char str[128] = {}; char str[128] = {};
srsran_csi_rs_measure_info(&measure, str, sizeof(str)); srsran_csi_rs_measure_info(&measure, str, sizeof(str));
INFO("Measure: %s", str); INFO("Measure: %s", str);
@ -361,7 +361,7 @@ static void parse_args(int argc, char** argv)
first_symbol = (uint32_t)strtol(argv[optind], NULL, 10); first_symbol = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -49,7 +49,7 @@ static void parse_args(int argc, char** argv)
interleaved ^= true; interleaved ^= true;
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -141,7 +141,7 @@ static void parse_args(int argc, char** argv)
carrier.pci = (uint32_t)strtol(argv[optind], NULL, 10); carrier.pci = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -57,7 +57,7 @@ void parse_args(int argc, char** argv)
cell.id = (uint32_t)strtol(argv[optind], NULL, 10); cell.id = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -32,7 +32,7 @@ void usage(char* prog)
printf("Usage: %s [Rv]\n", prog); printf("Usage: %s [Rv]\n", prog);
printf("\t-R Number of repetitions [Default %d]\n", nof_repetitions); printf("\t-R Number of repetitions [Default %d]\n", nof_repetitions);
printf("\t-E Number of encoded bits [Default %d]\n", E); printf("\t-E Number of encoded bits [Default %d]\n", E);
printf("\t-v increase verbose [Default %d]\n", srsran_verbose); printf("\t-v increase verbose [Default %d]\n", get_srsran_verbose_level());
} }
void parse_args(int argc, char** argv) void parse_args(int argc, char** argv)
@ -47,7 +47,7 @@ void parse_args(int argc, char** argv)
E = (uint32_t)strtol(argv[optind], NULL, 10); E = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -53,7 +53,7 @@ void parse_args(int argc, char** argv)
seed = (uint32_t)strtoul(argv[optind], NULL, 0); seed = (uint32_t)strtoul(argv[optind], NULL, 0);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);
@ -87,7 +87,7 @@ int main(int argc, char** argv)
data[i] = rand() % 2; data[i] = rand() % 2;
} }
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
INFO("data="); INFO("data=");
srsran_vec_fprint_b(stdout, data, num_bits); srsran_vec_fprint_b(stdout, data, num_bits);
} }

@ -35,7 +35,7 @@ void parse_args(int argc, char** argv)
long_cb = (uint32_t)strtol(argv[optind], NULL, 10); long_cb = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -94,7 +94,7 @@ void parse_args(int argc, char** argv)
seed = (uint32_t)strtoul(argv[optind], NULL, 0); seed = (uint32_t)strtoul(argv[optind], NULL, 0);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -45,7 +45,7 @@ void parse_args(int argc, char** argv)
nof_frames = (uint32_t)strtol(argv[optind], NULL, 10); nof_frames = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
case 'm': case 'm':
switch (strtol(argv[optind], NULL, 10)) { switch (strtol(argv[optind], NULL, 10)) {

@ -222,7 +222,7 @@ pbch_nr_pbch_msg_pack(const srsran_pbch_nr_cfg_t* cfg, const srsran_pbch_msg_nr_
a[G[13]] = 0; // Reserved a[G[13]] = 0; // Reserved
} }
if (srsran_verbose >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { if (get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) {
PBCH_NR_DEBUG_TX("Packed PBCH bits: "); PBCH_NR_DEBUG_TX("Packed PBCH bits: ");
srsran_vec_fprint_byte(stdout, a, PBCH_NR_A); srsran_vec_fprint_byte(stdout, a, PBCH_NR_A);
} }
@ -230,7 +230,7 @@ pbch_nr_pbch_msg_pack(const srsran_pbch_nr_cfg_t* cfg, const srsran_pbch_msg_nr_
static void static void
pbch_nr_pbch_msg_unpack(const srsran_pbch_nr_cfg_t* cfg, const uint8_t a[PBCH_NR_A], srsran_pbch_msg_nr_t* msg) pbch_nr_pbch_msg_unpack(const srsran_pbch_nr_cfg_t* cfg, const uint8_t a[PBCH_NR_A], srsran_pbch_msg_nr_t* msg)
{ {
if (srsran_verbose >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { if (get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) {
PBCH_NR_DEBUG_RX("Packed PBCH bits: "); PBCH_NR_DEBUG_RX("Packed PBCH bits: ");
srsran_vec_fprint_byte(stdout, a, PBCH_NR_A); srsran_vec_fprint_byte(stdout, a, PBCH_NR_A);
} }
@ -330,7 +330,7 @@ static int pbch_nr_polar_encode(srsran_pbch_nr_t* q, const uint8_t c[PBCH_NR_K],
return SRSRAN_ERROR; return SRSRAN_ERROR;
} }
if (srsran_verbose >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { if (get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) {
PBCH_NR_DEBUG_TX("Allocated: "); PBCH_NR_DEBUG_TX("Allocated: ");
srsran_vec_fprint_byte(stdout, allocated, PBCH_NR_N); srsran_vec_fprint_byte(stdout, allocated, PBCH_NR_N);
} }
@ -347,7 +347,7 @@ static int pbch_nr_polar_decode(srsran_pbch_nr_t* q, const int8_t d[PBCH_NR_N],
return SRSRAN_ERROR; return SRSRAN_ERROR;
} }
if (srsran_verbose >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { if (get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) {
PBCH_NR_DEBUG_RX("Allocated: "); PBCH_NR_DEBUG_RX("Allocated: ");
srsran_vec_fprint_byte(stdout, allocated, PBCH_NR_N); srsran_vec_fprint_byte(stdout, allocated, PBCH_NR_N);
} }
@ -369,7 +369,7 @@ static int pbch_nr_polar_rm_tx(srsran_pbch_nr_t* q, const uint8_t d[PBCH_NR_N],
return SRSRAN_ERROR; return SRSRAN_ERROR;
} }
if (srsran_verbose >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { if (get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) {
PBCH_NR_DEBUG_TX("d: "); PBCH_NR_DEBUG_TX("d: ");
srsran_vec_fprint_byte(stdout, d, PBCH_NR_N); srsran_vec_fprint_byte(stdout, d, PBCH_NR_N);
} }
@ -389,7 +389,7 @@ static int pbch_nr_polar_rm_rx(srsran_pbch_nr_t* q, const int8_t llr[PBCH_NR_E],
d[i] *= -1; d[i] *= -1;
} }
if (srsran_verbose >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { if (get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) {
PBCH_NR_DEBUG_RX("d: "); PBCH_NR_DEBUG_RX("d: ");
srsran_vec_fprint_bs(stdout, d, PBCH_NR_N); srsran_vec_fprint_bs(stdout, d, PBCH_NR_N);
} }

@ -521,7 +521,7 @@ int srsran_pdcch_nr_encode(srsran_pdcch_nr_t* q, const srsran_dci_msg_nr_t* dci_
srsran_polar_interleaver_run_u8(c, c_prime, q->K, true); srsran_polar_interleaver_run_u8(c, c_prime, q->K, true);
// Print c and c_prime (after interleaving) // Print c and c_prime (after interleaving)
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
PDCCH_INFO_TX("c="); PDCCH_INFO_TX("c=");
srsran_vec_fprint_hex(stdout, c, q->K); srsran_vec_fprint_hex(stdout, c, q->K);
PDCCH_INFO_TX("c_prime="); PDCCH_INFO_TX("c_prime=");
@ -537,7 +537,7 @@ int srsran_pdcch_nr_encode(srsran_pdcch_nr_t* q, const srsran_dci_msg_nr_t* dci_
} }
// Print d // Print d
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
PDCCH_INFO_TX("d="); PDCCH_INFO_TX("d=");
srsran_vec_fprint_byte(stdout, q->d, q->code.N); srsran_vec_fprint_byte(stdout, q->d, q->code.N);
} }
@ -564,7 +564,7 @@ int srsran_pdcch_nr_encode(srsran_pdcch_nr_t* q, const srsran_dci_msg_nr_t* dci_
q->meas_time_us = (uint32_t)t[0].tv_usec; q->meas_time_us = (uint32_t)t[0].tv_usec;
} }
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
char str[128] = {}; char str[128] = {};
srsran_pdcch_nr_info(q, NULL, str, sizeof(str)); srsran_pdcch_nr_info(q, NULL, str, sizeof(str));
PDCCH_INFO_TX("%s", str); PDCCH_INFO_TX("%s", str);
@ -613,7 +613,7 @@ int srsran_pdcch_nr_decode(srsran_pdcch_nr_t* q,
} }
// Print channel estimates if enabled // Print channel estimates if enabled
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) {
PDCCH_DEBUG_RX("ce="); PDCCH_DEBUG_RX("ce=");
srsran_vec_fprint_c(stdout, ce->ce, q->M); srsran_vec_fprint_c(stdout, ce->ce, q->M);
} }
@ -622,7 +622,7 @@ int srsran_pdcch_nr_decode(srsran_pdcch_nr_t* q,
srsran_predecoding_single(q->symbols, ce->ce, q->symbols, NULL, q->M, 1.0f, ce->noise_var); srsran_predecoding_single(q->symbols, ce->ce, q->symbols, NULL, q->M, 1.0f, ce->noise_var);
// Print symbols if enabled // Print symbols if enabled
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) {
PDCCH_DEBUG_RX("symbols="); PDCCH_DEBUG_RX("symbols=");
srsran_vec_fprint_c(stdout, q->symbols, q->M); srsran_vec_fprint_c(stdout, q->symbols, q->M);
} }
@ -653,7 +653,7 @@ int srsran_pdcch_nr_decode(srsran_pdcch_nr_t* q,
} }
// Print d // Print d
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) {
PDCCH_DEBUG_RX("d="); PDCCH_DEBUG_RX("d=");
srsran_vec_fprint_bs(stdout, d, q->K); srsran_vec_fprint_bs(stdout, d, q->K);
} }
@ -676,7 +676,7 @@ int srsran_pdcch_nr_decode(srsran_pdcch_nr_t* q,
srsran_polar_interleaver_run_u8(c_prime, c, q->K, false); srsran_polar_interleaver_run_u8(c_prime, c, q->K, false);
// Print c // Print c
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
PDCCH_INFO_RX("c_prime="); PDCCH_INFO_RX("c_prime=");
srsran_vec_fprint_hex(stdout, c_prime, q->K); srsran_vec_fprint_hex(stdout, c_prime, q->K);
PDCCH_INFO_RX("c="); PDCCH_INFO_RX("c=");
@ -697,7 +697,7 @@ int srsran_pdcch_nr_decode(srsran_pdcch_nr_t* q,
uint32_t checksum2 = srsran_bit_pack(&ptr, 24); uint32_t checksum2 = srsran_bit_pack(&ptr, 24);
res->crc = checksum1 == checksum2; res->crc = checksum1 == checksum2;
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
PDCCH_INFO_RX("CRC={%06x, %06x}; msg=", checksum1, checksum2); PDCCH_INFO_RX("CRC={%06x, %06x}; msg=", checksum1, checksum2);
srsran_vec_fprint_hex(stdout, c, dci_msg->nof_bits); srsran_vec_fprint_hex(stdout, c, dci_msg->nof_bits);
} }
@ -711,7 +711,7 @@ int srsran_pdcch_nr_decode(srsran_pdcch_nr_t* q,
q->meas_time_us = (uint32_t)t[0].tv_usec; q->meas_time_us = (uint32_t)t[0].tv_usec;
} }
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
char str[128] = {}; char str[128] = {};
srsran_pdcch_nr_info(q, res, str, sizeof(str)); srsran_pdcch_nr_info(q, res, str, sizeof(str));
PDCCH_INFO_RX("%s", str); PDCCH_INFO_RX("%s", str);

@ -321,7 +321,7 @@ static inline int pdsch_nr_encode_codeword(srsran_pdsch_nr_t* q,
return SRSRAN_ERROR; return SRSRAN_ERROR;
} }
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) {
DEBUG("b="); DEBUG("b=");
srsran_vec_fprint_b(stdout, q->b[tb->cw_idx], tb->nof_bits); srsran_vec_fprint_b(stdout, q->b[tb->cw_idx], tb->nof_bits);
} }
@ -333,7 +333,7 @@ static inline int pdsch_nr_encode_codeword(srsran_pdsch_nr_t* q,
// 7.3.1.2 Modulation // 7.3.1.2 Modulation
srsran_mod_modulate(&q->modem_tables[tb->mod], q->b[tb->cw_idx], q->d[tb->cw_idx], tb->nof_bits); srsran_mod_modulate(&q->modem_tables[tb->mod], q->b[tb->cw_idx], q->d[tb->cw_idx], tb->nof_bits);
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) {
DEBUG("d="); DEBUG("d=");
srsran_vec_fprint_c(stdout, q->d[tb->cw_idx], tb->nof_re); srsran_vec_fprint_c(stdout, q->d[tb->cw_idx], tb->nof_re);
} }
@ -437,7 +437,7 @@ static inline int pdsch_nr_decode_codeword(srsran_pdsch_nr_t* q,
return SRSRAN_ERROR_OUT_OF_BOUNDS; return SRSRAN_ERROR_OUT_OF_BOUNDS;
} }
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) {
DEBUG("d="); DEBUG("d=");
srsran_vec_fprint_c(stdout, q->d[tb->cw_idx], tb->nof_re); srsran_vec_fprint_c(stdout, q->d[tb->cw_idx], tb->nof_re);
} }
@ -460,7 +460,7 @@ static inline int pdsch_nr_decode_codeword(srsran_pdsch_nr_t* q,
// Descrambling // Descrambling
srsran_sequence_apply_c(llr, llr, tb->nof_bits, pdsch_nr_cinit(&q->carrier, cfg, rnti, tb->cw_idx)); srsran_sequence_apply_c(llr, llr, tb->nof_bits, pdsch_nr_cinit(&q->carrier, cfg, rnti, tb->cw_idx));
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) {
DEBUG("b="); DEBUG("b=");
srsran_vec_fprint_b(stdout, q->b[tb->cw_idx], tb->nof_bits); srsran_vec_fprint_b(stdout, q->b[tb->cw_idx], tb->nof_bits);
} }
@ -516,7 +516,7 @@ int srsran_pdsch_nr_decode(srsran_pdsch_nr_t* q,
return SRSRAN_ERROR; return SRSRAN_ERROR;
} }
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) {
DEBUG("ce="); DEBUG("ce=");
srsran_vec_fprint_c(stdout, channel->ce[0][0], nof_re); srsran_vec_fprint_c(stdout, channel->ce[0][0], nof_re);
DEBUG("x="); DEBUG("x=");

@ -643,7 +643,7 @@ static int pucch_nr_format2_decode(srsran_pucch_nr_t* q,
} }
} }
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
INFO("d="); INFO("d=");
srsran_vec_fprint_c(stdout, q->d, resource->nof_symbols * resource->nof_prb * (SRSRAN_NRE - 4)); srsran_vec_fprint_c(stdout, q->d, resource->nof_symbols * resource->nof_prb * (SRSRAN_NRE - 4));
INFO("ce="); INFO("ce=");

@ -556,7 +556,7 @@ static int pusch_nr_gen_mux_uci(srsran_pusch_nr_t* q, const srsran_uci_cfg_nr_t*
} }
// Print debug information if configured for ity // Print debug information if configured for ity
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) {
if (m_ulsch_count != 0) { if (m_ulsch_count != 0) {
DEBUG("UL-SCH bit positions:"); DEBUG("UL-SCH bit positions:");
srsran_vec_fprint_i(stdout, (int*)pos_ulsch, m_ulsch_count); srsran_vec_fprint_i(stdout, (int*)pos_ulsch, m_ulsch_count);
@ -662,7 +662,7 @@ static inline int pusch_nr_encode_codeword(srsran_pusch_nr_t* q,
} }
} }
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) {
DEBUG("b="); DEBUG("b=");
srsran_vec_fprint_b(stdout, b, nof_bits); srsran_vec_fprint_b(stdout, b, nof_bits);
} }
@ -688,7 +688,7 @@ static inline int pusch_nr_encode_codeword(srsran_pusch_nr_t* q,
// 7.3.1.2 Modulation // 7.3.1.2 Modulation
srsran_mod_modulate(&q->modem_tables[tb->mod], q->b[tb->cw_idx], q->d[tb->cw_idx], nof_bits); srsran_mod_modulate(&q->modem_tables[tb->mod], q->b[tb->cw_idx], q->d[tb->cw_idx], nof_bits);
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) {
DEBUG("d="); DEBUG("d=");
srsran_vec_fprint_c(stdout, q->d[tb->cw_idx], tb->nof_re); srsran_vec_fprint_c(stdout, q->d[tb->cw_idx], tb->nof_re);
} }
@ -794,7 +794,7 @@ static inline int pusch_nr_decode_codeword(srsran_pusch_nr_t* q,
return SRSRAN_ERROR_OUT_OF_BOUNDS; return SRSRAN_ERROR_OUT_OF_BOUNDS;
} }
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) {
DEBUG("d="); DEBUG("d=");
srsran_vec_fprint_c(stdout, q->d[tb->cw_idx], tb->nof_re); srsran_vec_fprint_c(stdout, q->d[tb->cw_idx], tb->nof_re);
} }
@ -842,7 +842,7 @@ static inline int pusch_nr_decode_codeword(srsran_pusch_nr_t* q,
// Descrambling // Descrambling
srsran_sequence_apply_c(llr, llr, nof_bits, pusch_nr_cinit(&q->carrier, cfg, rnti, tb->cw_idx)); srsran_sequence_apply_c(llr, llr, nof_bits, pusch_nr_cinit(&q->carrier, cfg, rnti, tb->cw_idx));
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) {
DEBUG("b="); DEBUG("b=");
srsran_vec_fprint_bs(stdout, llr, nof_bits); srsran_vec_fprint_bs(stdout, llr, nof_bits);
} }
@ -968,7 +968,7 @@ int srsran_pusch_nr_decode(srsran_pusch_nr_t* q,
return SRSRAN_ERROR; return SRSRAN_ERROR;
} }
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) {
DEBUG("ce="); DEBUG("ce=");
srsran_vec_fprint_c(stdout, channel->ce[0][0], nof_re); srsran_vec_fprint_c(stdout, channel->ce[0][0], nof_re);
DEBUG("x="); DEBUG("x=");

@ -454,7 +454,7 @@ static inline int sch_nr_encode(srsran_sch_nr_t* q,
// Calculate TB CRC // Calculate TB CRC
uint32_t checksum_tb = srsran_crc_checksum_byte(crc_tb, data, tb->tbs); uint32_t checksum_tb = srsran_crc_checksum_byte(crc_tb, data, tb->tbs);
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) {
DEBUG("tb="); DEBUG("tb=");
srsran_vec_fprint_byte(stdout, data, tb->tbs / 8); srsran_vec_fprint_byte(stdout, data, tb->tbs / 8);
} }
@ -489,7 +489,7 @@ static inline int sch_nr_encode(srsran_sch_nr_t* q,
srsran_bit_unpack_vector(input_ptr, q->temp_cb, (int)cb_len); srsran_bit_unpack_vector(input_ptr, q->temp_cb, (int)cb_len);
} }
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) {
DEBUG("cb%d=", r); DEBUG("cb%d=", r);
srsran_vec_fprint_byte(stdout, input_ptr, cb_len / 8); srsran_vec_fprint_byte(stdout, input_ptr, cb_len / 8);
} }
@ -510,7 +510,7 @@ static inline int sch_nr_encode(srsran_sch_nr_t* q,
// Encode code block // Encode code block
srsran_ldpc_encoder_encode(encoder, q->temp_cb, rm_buffer, cfg.Kr); srsran_ldpc_encoder_encode(encoder, q->temp_cb, rm_buffer, cfg.Kr);
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) {
DEBUG("encoded="); DEBUG("encoded=");
srsran_vec_fprint_b(stdout, rm_buffer, encoder->liftN - 2 * encoder->ls); srsran_vec_fprint_b(stdout, rm_buffer, encoder->liftN - 2 * encoder->ls);
} }
@ -668,7 +668,7 @@ static int sch_nr_decode(srsran_sch_nr_t* q,
SCH_INFO_RX("CB %d/%d iter=%d CRC=%s", r, cfg.C, n_iter_cb, tb->softbuffer.rx->cb_crc[r] ? "OK" : "KO"); SCH_INFO_RX("CB %d/%d iter=%d CRC=%s", r, cfg.C, n_iter_cb, tb->softbuffer.rx->cb_crc[r] ? "OK" : "KO");
// CB Debug trace // CB Debug trace
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) {
DEBUG("CB %d/%d:", r, cfg.C); DEBUG("CB %d/%d:", r, cfg.C);
srsran_vec_fprint_hex(stdout, q->temp_cb, cb_len); srsran_vec_fprint_hex(stdout, q->temp_cb, cb_len);
} }
@ -731,7 +731,7 @@ static int sch_nr_decode(srsran_sch_nr_t* q,
SCH_INFO_RX("TB: TBS=%d; CRC={%06x, %06x}", tb->tbs, checksum1, checksum2); SCH_INFO_RX("TB: TBS=%d; CRC={%06x, %06x}", tb->tbs, checksum1, checksum2);
} }
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_DEBUG && !is_handler_registered()) {
DEBUG("Decode: "); DEBUG("Decode: ");
srsran_vec_fprint_byte(stdout, res->payload, tb->tbs / 8); srsran_vec_fprint_byte(stdout, res->payload, tb->tbs / 8);
} }

@ -30,7 +30,7 @@ void parse_args(int argc, char** argv)
while ((opt = getopt(argc, argv, "cpndv")) != -1) { while ((opt = getopt(argc, argv, "cpndv")) != -1) {
switch (opt) { switch (opt) {
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -365,7 +365,7 @@ static void parse_args(int argc, char** argv)
while ((opt = getopt(argc, argv, "vR")) != -1) { while ((opt = getopt(argc, argv, "vR")) != -1) {
switch (opt) { switch (opt) {
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
case 'R': case 'R':
nof_repetitions = (uint32_t)strtol(argv[optind], NULL, 10); nof_repetitions = (uint32_t)strtol(argv[optind], NULL, 10);

@ -78,7 +78,7 @@ static void parse_args(int argc, char** argv)
while ((opt = getopt(argc, argv, "vR")) != -1) { while ((opt = getopt(argc, argv, "vR")) != -1) {
switch (opt) { switch (opt) {
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
case 'R': case 'R':
nof_repetitions = (uint32_t)strtol(argv[optind], NULL, 10); nof_repetitions = (uint32_t)strtol(argv[optind], NULL, 10);

@ -83,7 +83,7 @@ void parse_args(int argc, char** argv)
sf_idx = (int)(strtol(argv[optind], NULL, 10) % 10); sf_idx = (int)(strtol(argv[optind], NULL, 10) % 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
case 'r': case 'r':
nf = (int)strtol(argv[optind], NULL, 10); nf = (int)strtol(argv[optind], NULL, 10);

@ -49,7 +49,7 @@ void parse_args(int argc, char** argv)
cell.base.id = (uint32_t)strtol(argv[optind], NULL, 10); cell.base.id = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -83,7 +83,7 @@ void parse_args(int argc, char** argv)
tti = (uint32_t)strtol(argv[optind], NULL, 10); tti = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -65,7 +65,7 @@ void parse_args(int argc, char** argv)
} }
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -117,7 +117,7 @@ void parse_args(int argc, char** argv)
snr = strtof(argv[optind], NULL); snr = strtof(argv[optind], NULL);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -103,7 +103,7 @@ void parse_args(int argc, char** argv)
expected_nof_re = (uint32_t)strtol(argv[optind], NULL, 10); expected_nof_re = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -74,7 +74,7 @@ void parse_args(int argc, char** argv)
nof_frames = (int)strtol(argv[optind], NULL, 10); nof_frames = (int)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
case 'e': case 'e':
cell.cp = SRSRAN_CP_EXT; cell.cp = SRSRAN_CP_EXT;

@ -54,7 +54,7 @@ void parse_args(int argc, char** argv)
cell.id = (uint32_t)strtol(argv[optind], NULL, 10); cell.id = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -77,7 +77,7 @@ void parse_args(int argc, char** argv)
matlab_file_name = argv[optind]; matlab_file_name = argv[optind];
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
case 'e': case 'e':
cell.cp = SRSRAN_CP_EXT; cell.cp = SRSRAN_CP_EXT;

@ -53,7 +53,7 @@ void parse_args(int argc, char** argv)
cell.id = (uint32_t)strtol(argv[optind], NULL, 10); cell.id = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -93,7 +93,7 @@ void parse_args(int argc, char** argv)
} }
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
case 'e': case 'e':
cell.cp = SRSRAN_CP_EXT; cell.cp = SRSRAN_CP_EXT;

@ -83,7 +83,7 @@ static int parse_args(int argc, char** argv)
interleaved ^= true; interleaved ^= true;
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -81,7 +81,7 @@ static void parse_args(int argc, char** argv)
snr_dB = (float)strtof(argv[optind], NULL); snr_dB = (float)strtof(argv[optind], NULL);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);
@ -298,13 +298,13 @@ static int test_case1()
} }
} }
if (srsran_verbose >= SRSRAN_VERBOSE_INFO || !payload_match) { if (get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO || !payload_match) {
// If payload is not match and there is no logging, set logging to info and run the decoder again // If payload is not match and there is no logging, set logging to info and run the decoder again
if (srsran_verbose < SRSRAN_VERBOSE_INFO) { if (get_srsran_verbose_level() < SRSRAN_VERBOSE_INFO) {
printf("-- Detected payload was not matched, repeating decode with INFO logs (n0: %+.1f dB, corr: %f)\n", printf("-- Detected payload was not matched, repeating decode with INFO logs (n0: %+.1f dB, corr: %f)\n",
n0_dB, n0_dB,
corr); corr);
srsran_verbose = SRSRAN_VERBOSE_INFO; set_srsran_verbose_level(SRSRAN_VERBOSE_INFO);
srsran_pdcch_decode_msg(&pdcch_rx, &dl_sf_cfg, &dci_cfg, &dci_rx); srsran_pdcch_decode_msg(&pdcch_rx, &dl_sf_cfg, &dci_cfg, &dci_rx);
} }
print_dci_msg("Tx: ", &dci_tx); print_dci_msg("Tx: ", &dci_tx);

@ -56,7 +56,7 @@ int parse_args(int argc, char** argv)
carrier.max_mimo_layers = (uint32_t)strtol(argv[optind], NULL, 10); carrier.max_mimo_layers = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -96,7 +96,7 @@ void parse_args(int argc, char** argv)
} }
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
case 'e': case 'e':
cell.cp = SRSRAN_CP_EXT; cell.cp = SRSRAN_CP_EXT;

@ -128,7 +128,7 @@ void parse_args(int argc, char** argv)
enable_coworker = true; enable_coworker = true;
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
case 'q': case 'q':
enable_256qam ^= true; enable_256qam ^= true;

@ -100,7 +100,7 @@ void parse_args(int argc, char** argv)
cell.nof_ports = (uint32_t)strtol(argv[optind], NULL, 10); cell.nof_ports = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
case 'l': case 'l':
cell.cp = SRSRAN_CP_EXT; cell.cp = SRSRAN_CP_EXT;

@ -78,7 +78,7 @@ void parse_args(int argc, char** argv)
cell.cp = SRSRAN_CP_EXT; cell.cp = SRSRAN_CP_EXT;
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -86,7 +86,7 @@ void parse_args(int argc, char** argv)
mbsfn_area_id = (int)strtol(argv[optind], NULL, 10); mbsfn_area_id = (int)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
case 'e': case 'e':
cell.cp = SRSRAN_CP_EXT; cell.cp = SRSRAN_CP_EXT;

@ -103,7 +103,7 @@ void parse_args(int argc, char** argv)
nof_rx_antennas = (uint32_t)strtol(argv[optind], NULL, 10); nof_rx_antennas = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -47,9 +47,6 @@ static float uhd_rx_gain = 40, uhd_tx_gain = 60, uhd_freq = 2.4e9;
static char* uhd_args = ""; static char* uhd_args = "";
static char* device_name = ""; static char* device_name = "";
// SRSRAN Verbose
SRSRAN_API extern int srsran_verbose;
void usage(char* prog) void usage(char* prog)
{ {
printf("Usage: %s \n", prog); printf("Usage: %s \n", prog);
@ -136,7 +133,7 @@ void parse_args(int argc, char** argv)
seq_idx = (uint32_t)strtol(argv[optind], NULL, 10); seq_idx = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
case 'z': case 'z':
zero_corr_zone = (uint32_t)strtol(argv[optind], NULL, 10); zero_corr_zone = (uint32_t)strtol(argv[optind], NULL, 10);

@ -89,7 +89,7 @@ void parse_args(int argc, char** argv)
} }
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -67,7 +67,7 @@ void parse_args(int argc, char** argv)
} }
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -65,7 +65,7 @@ void parse_args(int argc, char** argv)
} }
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -104,7 +104,7 @@ void parse_args(int argc, char** argv)
} }
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -56,7 +56,7 @@ void parse_args(int argc, char** argv)
} }
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -270,7 +270,7 @@ static void parse_args(int argc, char** argv)
snr_db = strtof(argv[optind], NULL); snr_db = strtof(argv[optind], NULL);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -66,7 +66,7 @@ void parse_args(int argc, char** argv)
snr_db = strtof(argv[optind], NULL); snr_db = strtof(argv[optind], NULL);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);
@ -107,7 +107,7 @@ int test_uci_cqi_pucch(void)
if (recv != cqi) { if (recv != cqi) {
printf("Error! cqi = %d (len: %d), %X!=%X \n", cqi, nof_bits, cqi, recv); printf("Error! cqi = %d (len: %d), %X!=%X \n", cqi, nof_bits, cqi, recv);
if (srsran_verbose) { if (get_srsran_verbose_level()) {
printf("original: "); printf("original: ");
srsran_vec_fprint_b(stdout, o_bits, nof_bits); srsran_vec_fprint_b(stdout, o_bits, nof_bits);
printf(" decoded: "); printf(" decoded: ");

@ -64,7 +64,7 @@ int parse_args(int argc, char** argv)
nof_csi_bits = (uint32_t)strtol(argv[optind], NULL, 10); nof_csi_bits = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);
@ -358,7 +358,7 @@ int main(int argc, char** argv)
} }
} }
if (srsran_verbose >= SRSRAN_VERBOSE_INFO) { if (get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO) {
char str[512]; char str[512];
srsran_pusch_nr_rx_info(&pusch_rx, &pusch_cfg, &pusch_cfg.grant, &data_rx, str, (uint32_t)sizeof(str)); srsran_pusch_nr_rx_info(&pusch_rx, &pusch_cfg, &pusch_cfg.grant, &data_rx, str, (uint32_t)sizeof(str));

@ -161,7 +161,7 @@ void parse_args(int argc, char** argv)
optind++; optind++;
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);
@ -349,7 +349,7 @@ int main(int argc, char** argv)
ret = SRSRAN_ERROR; ret = SRSRAN_ERROR;
} else { } else {
INFO("Rx ACK (%d bits) is Ok: ", uci_data_tx.cfg.ack[0].nof_acks); INFO("Rx ACK (%d bits) is Ok: ", uci_data_tx.cfg.ack[0].nof_acks);
if (srsran_verbose >= SRSRAN_VERBOSE_INFO) { if (get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO) {
srsran_vec_fprint_byte(stdout, uci_data_tx.value.ack.ack_value, uci_data_tx.cfg.ack[0].nof_acks); srsran_vec_fprint_byte(stdout, uci_data_tx.value.ack.ack_value, uci_data_tx.cfg.ack[0].nof_acks);
} }
} }

@ -62,7 +62,7 @@ int parse_args(int argc, char** argv)
carrier.max_mimo_layers = (uint32_t)strtol(argv[optind], NULL, 10); carrier.max_mimo_layers = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -198,7 +198,7 @@ static int uci_nr_pack_ack_sr(const srsran_uci_cfg_nr_t* cfg, const srsran_uci_v
srsran_bit_unpack(value->sr, &bits, cfg->o_sr); srsran_bit_unpack(value->sr, &bits, cfg->o_sr);
A += cfg->o_sr; A += cfg->o_sr;
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
UCI_NR_INFO_TX("Packed UCI bits: "); UCI_NR_INFO_TX("Packed UCI bits: ");
srsran_vec_fprint_byte(stdout, sequence, A); srsran_vec_fprint_byte(stdout, sequence, A);
} }
@ -219,7 +219,7 @@ static int uci_nr_unpack_ack_sr(const srsran_uci_cfg_nr_t* cfg, uint8_t* sequenc
value->sr = srsran_bit_pack(&bits, cfg->o_sr); value->sr = srsran_bit_pack(&bits, cfg->o_sr);
A += cfg->o_sr; A += cfg->o_sr;
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
UCI_NR_INFO_RX("Unpacked UCI bits: "); UCI_NR_INFO_RX("Unpacked UCI bits: ");
srsran_vec_fprint_byte(stdout, sequence, A); srsran_vec_fprint_byte(stdout, sequence, A);
} }
@ -248,7 +248,7 @@ static int uci_nr_pack_ack_sr_csi(const srsran_uci_cfg_nr_t* cfg, const srsran_u
} }
A += n; A += n;
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
UCI_NR_INFO_TX("Packed UCI bits: "); UCI_NR_INFO_TX("Packed UCI bits: ");
srsran_vec_fprint_byte(stdout, sequence, A); srsran_vec_fprint_byte(stdout, sequence, A);
} }
@ -269,7 +269,7 @@ static int uci_nr_unpack_ack_sr_csi(const srsran_uci_cfg_nr_t* cfg, uint8_t* seq
value->sr = srsran_bit_pack(&bits, cfg->o_sr); value->sr = srsran_bit_pack(&bits, cfg->o_sr);
A += cfg->o_sr; A += cfg->o_sr;
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
UCI_NR_INFO_RX("Unpacked UCI bits: "); UCI_NR_INFO_RX("Unpacked UCI bits: ");
srsran_vec_fprint_byte(stdout, sequence, A); srsran_vec_fprint_byte(stdout, sequence, A);
} }
@ -393,7 +393,7 @@ static int uci_nr_encode_1bit(srsran_uci_nr_t* q, const srsran_uci_cfg_nr_t* cfg
return SRSRAN_ERROR; return SRSRAN_ERROR;
} }
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
UCI_NR_INFO_TX("One bit encoded NR-UCI; o="); UCI_NR_INFO_TX("One bit encoded NR-UCI; o=");
srsran_vec_fprint_b(stdout, o, E); srsran_vec_fprint_b(stdout, o, E);
} }
@ -434,7 +434,7 @@ static int uci_nr_decode_1_bit(srsran_uci_nr_t* q,
// Save decoded bit // Save decoded bit
q->bit_sequence[0] = (corr < 0) ? 0 : 1; q->bit_sequence[0] = (corr < 0) ? 0 : 1;
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
UCI_NR_INFO_RX("One bit decoding NR-UCI llr="); UCI_NR_INFO_RX("One bit decoding NR-UCI llr=");
srsran_vec_fprint_bs(stdout, llr, E); srsran_vec_fprint_bs(stdout, llr, E);
UCI_NR_INFO_RX("One bit decoding NR-UCI A=%d; E=%d; pwr=%f; corr=%f; norm=%f; thr=%f; %s", UCI_NR_INFO_RX("One bit decoding NR-UCI A=%d; E=%d; pwr=%f; corr=%f; norm=%f; thr=%f; %s",
@ -539,7 +539,7 @@ static int uci_nr_encode_2bit(srsran_uci_nr_t* q, const srsran_uci_cfg_nr_t* cfg
return SRSRAN_ERROR; return SRSRAN_ERROR;
} }
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
UCI_NR_INFO_TX("Two bit encoded NR-UCI; E=%d; o=", E); UCI_NR_INFO_TX("Two bit encoded NR-UCI; E=%d; o=", E);
srsran_vec_fprint_b(stdout, o, E); srsran_vec_fprint_b(stdout, o, E);
} }
@ -585,7 +585,7 @@ static int uci_nr_decode_2_bit(srsran_uci_nr_t* q,
q->bit_sequence[0] = c0 ? 1 : 0; q->bit_sequence[0] = c0 ? 1 : 0;
q->bit_sequence[1] = c1 ? 1 : 0; q->bit_sequence[1] = c1 ? 1 : 0;
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
UCI_NR_INFO_RX("Two bit decoding NR-UCI llr="); UCI_NR_INFO_RX("Two bit decoding NR-UCI llr=");
srsran_vec_fprint_bs(stdout, llr, E); srsran_vec_fprint_bs(stdout, llr, E);
UCI_NR_INFO_RX("Two bit decoding NR-UCI A=%d; E=%d; Qm=%d; c0=%d; c1=%d; c2=%d %s", UCI_NR_INFO_RX("Two bit decoding NR-UCI A=%d; E=%d; Qm=%d; c0=%d; c1=%d; c2=%d %s",
@ -606,7 +606,7 @@ uci_nr_encode_3_11_bit(srsran_uci_nr_t* q, const srsran_uci_cfg_nr_t* cfg, uint3
{ {
srsran_block_encode(q->bit_sequence, A, o, E); srsran_block_encode(q->bit_sequence, A, o, E);
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
UCI_NR_INFO_TX("Block encoded UCI bits; o="); UCI_NR_INFO_TX("Block encoded UCI bits; o=");
srsran_vec_fprint_b(stdout, o, E); srsran_vec_fprint_b(stdout, o, E);
} }
@ -649,7 +649,7 @@ static int uci_nr_decode_3_11_bit(srsran_uci_nr_t* q,
// Take decoded decision with threshold // Take decoded decision with threshold
*decoded_ok = (corr > q->block_code_threshold); *decoded_ok = (corr > q->block_code_threshold);
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
UCI_NR_INFO_RX("Block decoding NR-UCI llr="); UCI_NR_INFO_RX("Block decoding NR-UCI llr=");
srsran_vec_fprint_bs(stdout, llr, E); srsran_vec_fprint_bs(stdout, llr, E);
UCI_NR_INFO_RX("Block decoding NR-UCI A=%d; E=%d; pwr=%f; corr=%f; norm=%f; thr=%f; %s", UCI_NR_INFO_RX("Block decoding NR-UCI A=%d; E=%d; pwr=%f; corr=%f; norm=%f; thr=%f; %s",
@ -713,7 +713,7 @@ uci_nr_encode_11_1706_bit(srsran_uci_nr_t* q, const srsran_uci_cfg_nr_t* cfg, ui
srsran_crc_attach(crc, q->c, A_prime / C); srsran_crc_attach(crc, q->c, A_prime / C);
UCI_NR_INFO_TX("Attaching %d/%d CRC%d=%" PRIx64, r, C, L, srsran_crc_checksum_get(crc)); UCI_NR_INFO_TX("Attaching %d/%d CRC%d=%" PRIx64, r, C, L, srsran_crc_checksum_get(crc));
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
UCI_NR_INFO_TX("Polar cb %d/%d c=", r, C); UCI_NR_INFO_TX("Polar cb %d/%d c=", r, C);
srsran_vec_fprint_byte(stdout, q->c, K_r); srsran_vec_fprint_byte(stdout, q->c, K_r);
} }
@ -721,7 +721,7 @@ uci_nr_encode_11_1706_bit(srsran_uci_nr_t* q, const srsran_uci_cfg_nr_t* cfg, ui
// Allocate channel // Allocate channel
srsran_polar_chanalloc_tx(q->c, q->allocated, q->code.N, q->code.K, q->code.nPC, q->code.K_set, q->code.PC_set); srsran_polar_chanalloc_tx(q->c, q->allocated, q->code.N, q->code.K, q->code.nPC, q->code.K_set, q->code.PC_set);
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
UCI_NR_INFO_TX("Polar alloc %d/%d ", r, C); UCI_NR_INFO_TX("Polar alloc %d/%d ", r, C);
srsran_vec_fprint_byte(stdout, q->allocated, q->code.N); srsran_vec_fprint_byte(stdout, q->allocated, q->code.N);
} }
@ -731,7 +731,7 @@ uci_nr_encode_11_1706_bit(srsran_uci_nr_t* q, const srsran_uci_cfg_nr_t* cfg, ui
return SRSRAN_ERROR; return SRSRAN_ERROR;
} }
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
UCI_NR_INFO_TX("Polar encoded %d/%d ", r, C); UCI_NR_INFO_TX("Polar encoded %d/%d ", r, C);
srsran_vec_fprint_byte(stdout, q->d, q->code.N); srsran_vec_fprint_byte(stdout, q->d, q->code.N);
} }
@ -739,7 +739,7 @@ uci_nr_encode_11_1706_bit(srsran_uci_nr_t* q, const srsran_uci_cfg_nr_t* cfg, ui
// Rate matching // Rate matching
srsran_polar_rm_tx(&q->rm_tx, q->d, &o[E_r * r], q->code.n, E_r, K_r, UCI_NR_POLAR_RM_IBIL); srsran_polar_rm_tx(&q->rm_tx, q->d, &o[E_r * r], q->code.n, E_r, K_r, UCI_NR_POLAR_RM_IBIL);
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
UCI_NR_INFO_TX("Polar RM cw %d/%d ", r, C); UCI_NR_INFO_TX("Polar RM cw %d/%d ", r, C);
srsran_vec_fprint_byte(stdout, &o[E_r * r], E_r); srsran_vec_fprint_byte(stdout, &o[E_r * r], E_r);
} }
@ -790,7 +790,7 @@ static int uci_nr_decode_11_1706_bit(srsran_uci_nr_t* q,
for (uint32_t r = 0, s = 0; r < C; r++) { for (uint32_t r = 0, s = 0; r < C; r++) {
uint32_t k = 0; uint32_t k = 0;
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
UCI_NR_INFO_RX("Polar LLR %d/%d ", r, C); UCI_NR_INFO_RX("Polar LLR %d/%d ", r, C);
srsran_vec_fprint_bs(stdout, &llr[E_r * r], q->code.N); srsran_vec_fprint_bs(stdout, &llr[E_r * r], q->code.N);
} }
@ -805,7 +805,7 @@ static int uci_nr_decode_11_1706_bit(srsran_uci_nr_t* q,
return SRSRAN_ERROR; return SRSRAN_ERROR;
} }
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
UCI_NR_INFO_RX("Polar alloc %d/%d ", r, C); UCI_NR_INFO_RX("Polar alloc %d/%d ", r, C);
srsran_vec_fprint_byte(stdout, q->allocated, q->code.N); srsran_vec_fprint_byte(stdout, q->allocated, q->code.N);
} }
@ -813,7 +813,7 @@ static int uci_nr_decode_11_1706_bit(srsran_uci_nr_t* q,
// Undo channel allocation // Undo channel allocation
srsran_polar_chanalloc_rx(q->allocated, q->c, q->code.K, q->code.nPC, q->code.K_set, q->code.PC_set); srsran_polar_chanalloc_rx(q->allocated, q->c, q->code.K, q->code.nPC, q->code.K_set, q->code.PC_set);
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
UCI_NR_INFO_RX("Polar cb %d/%d c=", r, C); UCI_NR_INFO_RX("Polar cb %d/%d c=", r, C);
srsran_vec_fprint_byte(stdout, q->c, K_r); srsran_vec_fprint_byte(stdout, q->c, K_r);
} }

@ -145,7 +145,7 @@ int srsran_resampler_fft_init(srsran_resampler_fft_t* q, srsran_resampler_mode_t
q->in_buffer[i] = (float)h; q->in_buffer[i] = (float)h;
} }
if (srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
printf("h_%s=", q->mode == SRSRAN_RESAMPLER_MODE_INTERPOLATE ? "interp" : "decimate"); printf("h_%s=", q->mode == SRSRAN_RESAMPLER_MODE_INTERPOLATE ? "interp" : "decimate");
srsran_vec_fprint_c(stdout, q->in_buffer, high_size); srsran_vec_fprint_c(stdout, q->in_buffer, high_size);
} }

@ -53,7 +53,7 @@ static void parse_args(int argc, char** argv)
repetitions = (uint32_t)strtol(argv[optind], NULL, 10); repetitions = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
case 'w': case 'w':
if (strcmp(argv[optind], "sine") == 0) { if (strcmp(argv[optind], "sine") == 0) {
@ -129,7 +129,7 @@ int main(int argc, char** argv)
break; break;
} }
if (srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
printf("signal="); printf("signal=");
srsran_vec_fprint_c(stdout, src, buffer_size); srsran_vec_fprint_c(stdout, src, buffer_size);
} }
@ -143,7 +143,7 @@ int main(int argc, char** argv)
get_time_interval(t); get_time_interval(t);
uint64_t duration_us = (uint64_t)(t[0].tv_sec * 1000000UL + t[0].tv_usec); uint64_t duration_us = (uint64_t)(t[0].tv_sec * 1000000UL + t[0].tv_usec);
if (srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
printf("interp="); printf("interp=");
srsran_vec_fprint_c(stdout, interpolated, buffer_size * factor); srsran_vec_fprint_c(stdout, interpolated, buffer_size * factor);
printf("decim="); printf("decim=");
@ -156,7 +156,7 @@ int main(int argc, char** argv)
srsran_vec_sub_ccc(src, &decimated[delay], interpolated, nsamples); srsran_vec_sub_ccc(src, &decimated[delay], interpolated, nsamples);
float mse = sqrtf(srsran_vec_avg_power_cf(interpolated, nsamples)); float mse = sqrtf(srsran_vec_avg_power_cf(interpolated, nsamples));
if (srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
printf("recovered="); printf("recovered=");
srsran_vec_fprint_c(stdout, &decimated[delay], nsamples); srsran_vec_fprint_c(stdout, &decimated[delay], nsamples);
} }

@ -81,7 +81,7 @@ void parse_args(int argc, char** argv)
nof_frames = (int)strtol(argv[optind], NULL, 10); nof_frames = (int)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -45,7 +45,7 @@ void parse_args(int argc, char** argv)
input_len = (int)strtol(argv[optind], NULL, 10); input_len = (int)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose = SRSRAN_VERBOSE_DEBUG; set_srsran_verbose_level(SRSRAN_VERBOSE_DEBUG);
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -100,7 +100,7 @@ void parse_args(int argc, char** argv)
disable_plots = true; disable_plots = true;
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -66,7 +66,7 @@ void parse_args(int argc, char** argv)
max_num_sf = (int)strtol(argv[optind], NULL, 10); max_num_sf = (int)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose = SRSRAN_VERBOSE_DEBUG; set_srsran_verbose_level(SRSRAN_VERBOSE_DEBUG);
break; break;
default: default:
usage(argv[0]); usage(argv[0]);
@ -215,7 +215,6 @@ exit:
free(fft_buffer); free(fft_buffer);
} }
return ret; return ret;
} }

@ -84,7 +84,7 @@ void parse_args(int argc, char** argv)
nof_frames = (int)strtol(argv[optind], NULL, 10); nof_frames = (int)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -89,7 +89,7 @@ void parse_args(int argc, char** argv)
disable_plots = true; disable_plots = true;
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -98,7 +98,7 @@ void parse_args(int argc, char** argv)
disable_plots = true; disable_plots = true;
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -87,7 +87,7 @@ void parse_args(int argc, char** argv)
} }
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -81,7 +81,7 @@ static void parse_args(int argc, char** argv)
ssb_pattern = srsran_ssb_pattern_fom_str(argv[optind]); ssb_pattern = srsran_ssb_pattern_fom_str(argv[optind]);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -81,7 +81,7 @@ static void parse_args(int argc, char** argv)
assert_hrf = (uint32_t)strtol(argv[optind], NULL, 10); assert_hrf = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -86,7 +86,7 @@ static void parse_args(int argc, char** argv)
ssb_pattern = srsran_ssb_pattern_fom_str(argv[optind]); ssb_pattern = srsran_ssb_pattern_fom_str(argv[optind]);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -63,7 +63,7 @@ void parse_args(int argc, char** argv)
offset = (int)strtol(argv[optind], NULL, 10); offset = (int)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose = SRSRAN_VERBOSE_DEBUG; set_srsran_verbose_level(SRSRAN_VERBOSE_DEBUG);
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -101,7 +101,7 @@ void parse_args(int argc, char** argv)
} }
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -56,7 +56,7 @@ void parse_args(int argc, char** argv)
cp = SRSRAN_CP_EXT; cp = SRSRAN_CP_EXT;
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -136,7 +136,7 @@ static void parse_args(int argc, char** argv)
while ((opt = getopt(argc, argv, "v")) != -1) { while ((opt = getopt(argc, argv, "v")) != -1) {
switch (opt) { switch (opt) {
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -40,7 +40,7 @@ void parse_args(int argc, char** argv)
cell.n_id_ncell = (uint32_t)strtol(argv[optind], NULL, 10); cell.n_id_ncell = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -57,7 +57,7 @@ static int parse_args(int argc, char** argv)
carrier.pci = (uint32_t)strtol(argv[optind], NULL, 10); carrier.pci = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
case 'n': case 'n':
slot_cfg.idx = (uint32_t)strtol(argv[optind], NULL, 10); slot_cfg.idx = (uint32_t)strtol(argv[optind], NULL, 10);

@ -77,7 +77,7 @@ void parse_args(int argc, char** argv)
nof_frames = (int)strtol(argv[optind], NULL, 10); nof_frames = (int)strtol(argv[optind], NULL, 10);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -52,7 +52,7 @@ static void parse_args(int argc, char** argv)
while ((opt = getopt(argc, argv, "v")) != -1) { while ((opt = getopt(argc, argv, "v")) != -1) {
switch (opt) { switch (opt) {
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -96,7 +96,7 @@ void parse_args(int argc, char** argv)
disable_plots = true; disable_plots = true;
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);

@ -1439,7 +1439,7 @@ int srsran_ue_dl_find_and_decode(srsran_ue_dl_t* q,
if (ret == 1) { if (ret == 1) {
// Logging // Logging
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO) {
char str[512]; char str[512];
srsran_dci_dl_info(&dci_dl[0], str, 512); srsran_dci_dl_info(&dci_dl[0], str, 512);
INFO("PDCCH: %s, snr=%.1f dB", str, q->chest_res.snr_db); INFO("PDCCH: %s, snr=%.1f dB", str, q->chest_res.snr_db);

@ -567,7 +567,7 @@ int srsran_ue_dl_nr_decode_pdsch(srsran_ue_dl_nr_t* q,
return SRSRAN_ERROR; return SRSRAN_ERROR;
} }
if (SRSRAN_DEBUG_ENABLED && srsran_verbose >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) { if (SRSRAN_DEBUG_ENABLED && get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO && !is_handler_registered()) {
char str[512]; char str[512];
srsran_ue_dl_nr_pdsch_info(q, cfg, res, str, sizeof(str)); srsran_ue_dl_nr_pdsch_info(q, cfg, res, str, sizeof(str));
INFO("PDSCH: %s", str); INFO("PDSCH: %s", str);

@ -13,9 +13,24 @@
#include "srsran/phy/utils/debug.h" #include "srsran/phy/utils/debug.h"
#include <stdlib.h> #include <stdlib.h>
int srsran_verbose = 0; static int srsran_verbose = 0;
static bool handler_registered = false; static bool handler_registered = false;
int get_srsran_verbose_level(void)
{
return srsran_verbose;
}
void set_srsran_verbose_level(int level)
{
srsran_verbose = level;
}
void increase_srsran_verbose_level(void)
{
srsran_verbose++;
}
bool is_handler_registered(void) bool is_handler_registered(void)
{ {
return handler_registered; return handler_registered;

@ -146,7 +146,7 @@ void parse_args(int argc, char** argv)
fft_plot_enable ^= true; fft_plot_enable ^= true;
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
case 'h': case 'h':
default: default:

@ -130,7 +130,7 @@ static int parse_args(int argc, char** argv)
cfo_hz = strtof(argv[optind], NULL); cfo_hz = strtof(argv[optind], NULL);
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
default: default:
usage(argv[0]); usage(argv[0]);
@ -478,7 +478,7 @@ int main(int argc, char** argv)
} }
} }
if (srsran_verbose >= SRSRAN_VERBOSE_INFO) { if (get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO) {
char str[512]; char str[512];
srsran_pdsch_res_nr_t pdsch_res_vec[SRSRAN_MAX_CODEWORDS] = {}; srsran_pdsch_res_nr_t pdsch_res_vec[SRSRAN_MAX_CODEWORDS] = {};
pdsch_res_vec[0] = pdsch_res; pdsch_res_vec[0] = pdsch_res;

@ -128,7 +128,7 @@ void parse_args(int argc, char** argv)
optind++; optind++;
break; break;
case 'v': case 'v':
srsran_verbose++; increase_srsran_verbose_level();
break; break;
case 'q': case 'q':
enable_256qam = (enable_256qam) ? false : true; enable_256qam = (enable_256qam) ? false : true;
@ -220,7 +220,7 @@ int work_ue(srsran_ue_dl_t* ue_dl,
ue_dl_cfg->cfg.pdsch.csi_enable = false; ue_dl_cfg->cfg.pdsch.csi_enable = false;
ue_dl_cfg->cfg.pdsch.meas_evm_en = false; ue_dl_cfg->cfg.pdsch.meas_evm_en = false;
if (srsran_verbose >= SRSRAN_VERBOSE_INFO) { if (get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO) {
char str[512]; char str[512];
srsran_dci_dl_info(&dci_dl[0], str, 512); srsran_dci_dl_info(&dci_dl[0], str, 512);
INFO("UE PDCCH: rnti=0x%x, %s", rnti, str); INFO("UE PDCCH: rnti=0x%x, %s", rnti, str);
@ -244,7 +244,7 @@ int work_ue(srsran_ue_dl_t* ue_dl,
return SRSRAN_ERROR; return SRSRAN_ERROR;
} }
if (srsran_verbose >= SRSRAN_VERBOSE_INFO) { if (get_srsran_verbose_level() >= SRSRAN_VERBOSE_INFO) {
char str[512]; char str[512];
srsran_pdsch_rx_info(&ue_dl_cfg->cfg.pdsch, pdsch_res, str, 512); srsran_pdsch_rx_info(&ue_dl_cfg->cfg.pdsch, pdsch_res, str, 512);
INFO("eNb PDSCH: rnti=0x%x, %s", rnti, str); INFO("eNb PDSCH: rnti=0x%x, %s", rnti, str);

@ -131,7 +131,7 @@ static int test_pucch_ca(srsran_ack_nack_feedback_mode_t ack_nack_feedback_mode,
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
// Set PHY lib verbose to INFO // Set PHY lib verbose to INFO
srsran_verbose = SRSRAN_VERBOSE_INFO; set_srsran_verbose_level(SRSRAN_VERBOSE_INFO);
uint32_t nof_tb_1[SRSRAN_MAX_CARRIERS] = {1, 1, 1, 1, 1}; uint32_t nof_tb_1[SRSRAN_MAX_CARRIERS] = {1, 1, 1, 1, 1};
uint32_t nof_tb_2[SRSRAN_MAX_CARRIERS] = {2, 1, 1, 1, 1}; uint32_t nof_tb_2[SRSRAN_MAX_CARRIERS] = {2, 1, 1, 1, 1};

@ -482,7 +482,7 @@ int main(int argc, char** argv)
phy_args.rx_gain_offset = rx_gain + 62.0f; phy_args.rx_gain_offset = rx_gain + 62.0f;
// Set phy-lib logging level // Set phy-lib logging level
srsran_verbose = phy_lib_log_level; set_srsran_verbose_level(phy_lib_log_level);
// Allocate PDSCH data and tx-soft-buffers only if pdsch is enabled and radio is not available // Allocate PDSCH data and tx-soft-buffers only if pdsch is enabled and radio is not available
for (int i = 0; i < SRSRAN_MAX_TB && serving_cell_pdsch_enable && radio == nullptr; i++) { for (int i = 0; i < SRSRAN_MAX_TB && serving_cell_pdsch_enable && radio == nullptr; i++) {

@ -113,11 +113,11 @@ public:
// Make sure PHY log is not set by UE or gNb PHY // Make sure PHY log is not set by UE or gNb PHY
set_handler_enabled(false); set_handler_enabled(false);
if (args.phy_lib_log_level == "info") { if (args.phy_lib_log_level == "info") {
srsran_verbose = SRSRAN_VERBOSE_INFO; set_srsran_verbose_level(SRSRAN_VERBOSE_INFO);
} else if (args.phy_lib_log_level == "debug") { } else if (args.phy_lib_log_level == "debug") {
srsran_verbose = SRSRAN_VERBOSE_DEBUG; set_srsran_verbose_level(SRSRAN_VERBOSE_DEBUG);
} else { } else {
srsran_verbose = SRSRAN_VERBOSE_NONE; set_srsran_verbose_level(SRSRAN_VERBOSE_NONE);
} }
// Configure channel // Configure channel

Loading…
Cancel
Save