|
|
|
@ -101,6 +101,7 @@ typedef struct {
|
|
|
|
|
int net_port_signal;
|
|
|
|
|
char *net_address_signal;
|
|
|
|
|
int decimate;
|
|
|
|
|
int verbose;
|
|
|
|
|
}prog_args_t;
|
|
|
|
|
|
|
|
|
|
void args_default(prog_args_t *args) {
|
|
|
|
@ -313,7 +314,6 @@ int main(int argc, char **argv) {
|
|
|
|
|
srslte_rf_t rf;
|
|
|
|
|
#endif
|
|
|
|
|
uint32_t nof_trials = 0;
|
|
|
|
|
int n;
|
|
|
|
|
uint8_t bch_payload[SRSLTE_BCH_PAYLOAD_LEN];
|
|
|
|
|
int sfn_offset;
|
|
|
|
|
float cfo = 0;
|
|
|
|
@ -392,8 +392,8 @@ int main(int argc, char **argv) {
|
|
|
|
|
srslte_rf_set_master_clock_rate(&rf, 30.72e6);
|
|
|
|
|
|
|
|
|
|
/* set receiver frequency */
|
|
|
|
|
printf("Tunning receiver to %.3f MHz\n", prog_args.rf_freq/1000000);
|
|
|
|
|
srslte_rf_set_rx_freq(&rf, prog_args.rf_freq);
|
|
|
|
|
printf("Tunning receiver to %.3f MHz\n", (prog_args.rf_freq + prog_args.file_offset_freq)/1000000);
|
|
|
|
|
srslte_rf_set_rx_freq(&rf, prog_args.rf_freq + prog_args.file_offset_freq);
|
|
|
|
|
srslte_rf_rx_wait_lo_locked(&rf);
|
|
|
|
|
|
|
|
|
|
uint32_t ntrial=0;
|
|
|
|
@ -541,6 +541,26 @@ int main(int argc, char **argv) {
|
|
|
|
|
/* Main loop */
|
|
|
|
|
while (!go_exit && (sf_cnt < prog_args.nof_subframes || prog_args.nof_subframes == -1)) {
|
|
|
|
|
bool acks [SRSLTE_MAX_CODEWORDS] = {false};
|
|
|
|
|
char input[128];
|
|
|
|
|
|
|
|
|
|
fd_set set;
|
|
|
|
|
FD_ZERO(&set);
|
|
|
|
|
FD_SET(0, &set);
|
|
|
|
|
|
|
|
|
|
struct timeval to;
|
|
|
|
|
to.tv_sec = 0;
|
|
|
|
|
to.tv_usec = 0;
|
|
|
|
|
|
|
|
|
|
/* Set default verbose level */
|
|
|
|
|
srslte_verbose = prog_args.verbose;
|
|
|
|
|
int n = select(1, &set, NULL, NULL, &to);
|
|
|
|
|
if (n == 1) {
|
|
|
|
|
/* If a new line is detected set verbose level to Debug */
|
|
|
|
|
if (fgets(input, sizeof(input), stdin)) {
|
|
|
|
|
srslte_verbose = SRSLTE_VERBOSE_DEBUG;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ret = srslte_ue_sync_zerocopy_multi(&ue_sync, sf_buffer);
|
|
|
|
|
if (ret < 0) {
|
|
|
|
@ -586,7 +606,8 @@ int main(int argc, char **argv) {
|
|
|
|
|
n = srslte_ue_dl_decode_multi(&ue_dl,
|
|
|
|
|
sf_buffer,
|
|
|
|
|
data,
|
|
|
|
|
sfn*10+srslte_ue_sync_get_sfidx(&ue_sync), acks);
|
|
|
|
|
sfn*10+srslte_ue_sync_get_sfidx(&ue_sync),
|
|
|
|
|
acks);
|
|
|
|
|
|
|
|
|
|
if (n < 0) {
|
|
|
|
|
// fprintf(stderr, "Error decoding UE DL\n");fflush(stdout);
|
|
|
|
@ -666,7 +687,12 @@ int main(int argc, char **argv) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Print Results */
|
|
|
|
|
printf("\033[K Tx scheme: %-10s\n", srslte_mimotype2str(ue_dl.pdsch_cfg.mimo_type));
|
|
|
|
|
if (ue_dl.pdsch_cfg.mimo_type == SRSLTE_MIMO_TYPE_SPATIAL_MULTIPLEX) {
|
|
|
|
|
printf("\033[K Tx scheme: %s (codebook_idx=%d)\n", srslte_mimotype2str(ue_dl.pdsch_cfg.mimo_type),
|
|
|
|
|
ue_dl.pdsch_cfg.codebook_idx);
|
|
|
|
|
} else {
|
|
|
|
|
printf("\033[K Tx scheme: %s\n", srslte_mimotype2str(ue_dl.pdsch_cfg.mimo_type));
|
|
|
|
|
}
|
|
|
|
|
printf("\033[K nof layers: %d \n", ue_dl.pdsch_cfg.nof_layers);
|
|
|
|
|
printf("\033[Knof codewords: %d \n", ue_dl.pdsch_cfg.grant.nof_tb);
|
|
|
|
|
printf("\033[K CFO: %+5.2f kHz\n", srslte_ue_sync_get_cfo(&ue_sync) / 1000);
|
|
|
|
@ -674,9 +700,11 @@ int main(int argc, char **argv) {
|
|
|
|
|
printf("\033[K Rb: %6.2f / %6.2f Mbps (net/maximum)\n", uerate, enodebrate);
|
|
|
|
|
printf("\033[K PDCCH-Miss: %5.2f%%\n", 100 * (1 - (float) ue_dl.nof_detected / nof_trials));
|
|
|
|
|
printf("\033[K PDSCH-BLER: %5.2f%%\n", (float) 100 * ue_dl.pkt_errors / ue_dl.pkts_total);
|
|
|
|
|
printf("\033[K PDSCH-BLER: %5.2f%%\n\n", (float) 100 * ue_dl.pkt_errors / ue_dl.pkts_total);
|
|
|
|
|
printf("\033[K PDSCH-BLER: %5.2f%%\n", (float) 100 * ue_dl.pkt_errors / ue_dl.pkts_total);
|
|
|
|
|
printf("\033[K TB 0: mcs=%d; tbs=%d\n", ue_dl.pdsch_cfg.grant.mcs[0].idx, ue_dl.pdsch_cfg.grant.mcs[0].tbs);
|
|
|
|
|
printf("\033[K TB 1: mcs=%d; tbs=%d\n", ue_dl.pdsch_cfg.grant.mcs[1].idx, ue_dl.pdsch_cfg.grant.mcs[1].tbs);
|
|
|
|
|
printf("\033[K\n");
|
|
|
|
|
printf("\033[KSINR (dB) Vs RI and PMI:\n");
|
|
|
|
|
printf("\033[KSINR (dB) Vs RI and PMI (for TM4, close loop MIMO only):\n");
|
|
|
|
|
printf("\033[K | RI | 1 | 2 |\n");
|
|
|
|
|
printf("\033[K -------+-------+-------+\n");
|
|
|
|
|
printf("\033[K P | 0 | %5.2f%c| %5.2f%c|\n", 10 * log10(sinr[0][0]), (ri == 1 && pmi == 0)?'*':' ', 10 * log10(sinr[1][0]), (ri == 2 && pmi == 0)?'*':' ');
|
|
|
|
@ -684,7 +712,7 @@ int main(int argc, char **argv) {
|
|
|
|
|
printf("\033[K I | 2 | %5.2f%c|-------+ \n", 10 * log10(sinr[0][2]), (ri == 1 && pmi == 2)?'*':' ');
|
|
|
|
|
printf("\033[K | 3 | %5.2f%c| \n", 10 * log10(sinr[0][3]), (ri == 1 && pmi == 3)?'*':' ');
|
|
|
|
|
printf("\033[K\n\n");
|
|
|
|
|
printf("\033[20A");
|
|
|
|
|
printf("\033[21A");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
@ -693,7 +721,7 @@ int main(int argc, char **argv) {
|
|
|
|
|
sfn++;
|
|
|
|
|
if (sfn == 1024) {
|
|
|
|
|
sfn = 0;
|
|
|
|
|
printf("\033[20B");
|
|
|
|
|
printf("\033[21B");
|
|
|
|
|
ue_dl.pkt_errors = 0;
|
|
|
|
|
ue_dl.pkts_total = 0;
|
|
|
|
|
ue_dl.nof_detected = 0;
|
|
|
|
@ -725,7 +753,7 @@ int main(int argc, char **argv) {
|
|
|
|
|
|
|
|
|
|
sf_cnt++;
|
|
|
|
|
} // Main loop
|
|
|
|
|
printf("\033[20B");
|
|
|
|
|
printf("\033[21B\n");
|
|
|
|
|
|
|
|
|
|
#ifndef DISABLE_GRAPHICS
|
|
|
|
|
if (!prog_args.disable_plots) {
|
|
|
|
|