Alignement with cherry pick

master
Xavier Arteaga 7 years ago
commit 0b83ff7d68

@ -101,6 +101,7 @@ typedef struct {
int net_port_signal; int net_port_signal;
char *net_address_signal; char *net_address_signal;
int decimate; int decimate;
int verbose;
}prog_args_t; }prog_args_t;
void args_default(prog_args_t *args) { void args_default(prog_args_t *args) {
@ -313,7 +314,6 @@ int main(int argc, char **argv) {
srslte_rf_t rf; srslte_rf_t rf;
#endif #endif
uint32_t nof_trials = 0; uint32_t nof_trials = 0;
int n;
uint8_t bch_payload[SRSLTE_BCH_PAYLOAD_LEN]; uint8_t bch_payload[SRSLTE_BCH_PAYLOAD_LEN];
int sfn_offset; int sfn_offset;
float cfo = 0; float cfo = 0;
@ -392,8 +392,8 @@ int main(int argc, char **argv) {
srslte_rf_set_master_clock_rate(&rf, 30.72e6); srslte_rf_set_master_clock_rate(&rf, 30.72e6);
/* set receiver frequency */ /* set receiver frequency */
printf("Tunning receiver to %.3f MHz\n", prog_args.rf_freq/1000000); 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); srslte_rf_set_rx_freq(&rf, prog_args.rf_freq + prog_args.file_offset_freq);
srslte_rf_rx_wait_lo_locked(&rf); srslte_rf_rx_wait_lo_locked(&rf);
uint32_t ntrial=0; uint32_t ntrial=0;
@ -541,6 +541,26 @@ int main(int argc, char **argv) {
/* Main loop */ /* Main loop */
while (!go_exit && (sf_cnt < prog_args.nof_subframes || prog_args.nof_subframes == -1)) { while (!go_exit && (sf_cnt < prog_args.nof_subframes || prog_args.nof_subframes == -1)) {
bool acks [SRSLTE_MAX_CODEWORDS] = {false}; 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); ret = srslte_ue_sync_zerocopy_multi(&ue_sync, sf_buffer);
if (ret < 0) { if (ret < 0) {
@ -586,7 +606,8 @@ int main(int argc, char **argv) {
n = srslte_ue_dl_decode_multi(&ue_dl, n = srslte_ue_dl_decode_multi(&ue_dl,
sf_buffer, sf_buffer,
data, data,
sfn*10+srslte_ue_sync_get_sfidx(&ue_sync), acks); sfn*10+srslte_ue_sync_get_sfidx(&ue_sync),
acks);
if (n < 0) { if (n < 0) {
// fprintf(stderr, "Error decoding UE DL\n");fflush(stdout); // fprintf(stderr, "Error decoding UE DL\n");fflush(stdout);
@ -666,7 +687,12 @@ int main(int argc, char **argv) {
} }
/* Print Results */ /* 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[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[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); 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 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 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", (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[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 | RI | 1 | 2 |\n");
printf("\033[K -------+-------+-------+\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)?'*':' '); 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 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 | 3 | %5.2f%c| \n", 10 * log10(sinr[0][3]), (ri == 1 && pmi == 3)?'*':' ');
printf("\033[K\n\n"); printf("\033[K\n\n");
printf("\033[20A"); printf("\033[21A");
} }
} }
break; break;
@ -693,7 +721,7 @@ int main(int argc, char **argv) {
sfn++; sfn++;
if (sfn == 1024) { if (sfn == 1024) {
sfn = 0; sfn = 0;
printf("\033[20B"); printf("\033[21B");
ue_dl.pkt_errors = 0; ue_dl.pkt_errors = 0;
ue_dl.pkts_total = 0; ue_dl.pkts_total = 0;
ue_dl.nof_detected = 0; ue_dl.nof_detected = 0;
@ -725,7 +753,7 @@ int main(int argc, char **argv) {
sf_cnt++; sf_cnt++;
} // Main loop } // Main loop
printf("\033[20B"); printf("\033[21B\n");
#ifndef DISABLE_GRAPHICS #ifndef DISABLE_GRAPHICS
if (!prog_args.disable_plots) { if (!prog_args.disable_plots) {

@ -322,7 +322,7 @@ int main(int argc, char **argv) {
#ifdef DO_OFDM #ifdef DO_OFDM
srslte_filesource_read(&fsrc, rx_slot_symbols, SRSLTE_SF_LEN_PRB(cell.nof_prb)); srslte_filesource_read(&fsrc, rx_slot_symbols, SRSLTE_SF_LEN_PRB(cell.nof_prb));
#else #else
srslte_filesource_read(&fsrc, rx_slot_symbols[0], SRSLTE_SF_LEN_RE(cell.nof_prb, cell.cp)); srslte_filesource_read_multi(&fsrc, (void*) rx_slot_symbols, SRSLTE_SF_LEN_RE(cell.nof_prb, cell.cp), pdsch_cfg.nof_layers);
#endif #endif
srslte_chest_dl_t chest; srslte_chest_dl_t chest;
@ -330,7 +330,7 @@ int main(int argc, char **argv) {
fprintf(stderr, "Error initializing equalizer\n"); fprintf(stderr, "Error initializing equalizer\n");
exit(-1); exit(-1);
} }
srslte_chest_dl_estimate(&chest, rx_slot_symbols[0], ce[0], subframe); srslte_chest_dl_estimate_multi(&chest, rx_slot_symbols, ce, subframe, nof_rx_antennas);
srslte_chest_dl_free(&chest); srslte_chest_dl_free(&chest);
srslte_filesource_free(&fsrc); srslte_filesource_free(&fsrc);

@ -391,7 +391,11 @@ int srslte_ue_dl_decode_rnti_multi(srslte_ue_dl_t *q, cf_t *input[SRSLTE_MAX_POR
switch(dci_msg.format) { switch(dci_msg.format) {
case SRSLTE_DCI_FORMAT1: case SRSLTE_DCI_FORMAT1:
case SRSLTE_DCI_FORMAT1A: case SRSLTE_DCI_FORMAT1A:
mimo_type = SRSLTE_MIMO_TYPE_SINGLE_ANTENNA; if (q->cell.nof_ports == 1) {
mimo_type = SRSLTE_MIMO_TYPE_SINGLE_ANTENNA;
} else {
mimo_type = SRSLTE_MIMO_TYPE_TX_DIVERSITY;
}
break; break;
case SRSLTE_DCI_FORMAT2: case SRSLTE_DCI_FORMAT2:
if (grant.nof_tb == 1 && dci_unpacked.pinfo == 0) { if (grant.nof_tb == 1 && dci_unpacked.pinfo == 0) {
@ -468,7 +472,10 @@ int srslte_ue_dl_ri_pmi_select(srslte_ue_dl_t *q, uint32_t *ri, uint32_t *pmi, f
float best_sinr = -INFINITY; float best_sinr = -INFINITY;
uint32_t best_pmi = 0, best_ri = 0; uint32_t best_pmi = 0, best_ri = 0;
if (q->cell.nof_ports == 2 && q->nof_rx_antennas == 2) { if (q->cell.nof_ports < 2 || q->nof_rx_antennas < 2) {
/* Do nothing */
return SRSLTE_SUCCESS;
} else if (q->cell.nof_ports == 2 && q->nof_rx_antennas == 2) {
if (srslte_pdsch_pmi_select(&q->pdsch, &q->pdsch_cfg, q->ce_m, noise_estimate, if (srslte_pdsch_pmi_select(&q->pdsch, &q->pdsch_cfg, q->ce_m, noise_estimate,
SRSLTE_SF_LEN_RE(q->cell.nof_prb, q->cell.cp), q->pmi, q->sinr)) { SRSLTE_SF_LEN_RE(q->cell.nof_prb, q->cell.cp), q->pmi, q->sinr)) {
ERROR("SINR calculation error"); ERROR("SINR calculation error");
@ -501,7 +508,7 @@ int srslte_ue_dl_ri_pmi_select(srslte_ue_dl_t *q, uint32_t *ri, uint32_t *pmi, f
} else if (q->pdsch_cfg.nof_layers == 2) { } else if (q->pdsch_cfg.nof_layers == 2) {
*current_sinr = q->sinr[1][q->pdsch_cfg.codebook_idx - 1]; *current_sinr = q->sinr[1][q->pdsch_cfg.codebook_idx - 1];
} else { } else {
ERROR("Not implemented number of layers"); ERROR("Not implemented number of layers (%d)", q->pdsch_cfg.nof_layers);
return SRSLTE_ERROR; return SRSLTE_ERROR;
} }
} }

Loading…
Cancel
Save