|
|
@ -33,6 +33,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
#include "srslte/srslte.h"
|
|
|
|
#include "srslte/srslte.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Enable to measure execution time
|
|
|
|
|
|
|
|
//#define DO_OFDM
|
|
|
|
|
|
|
|
|
|
|
|
srslte_cell_t cell = {
|
|
|
|
srslte_cell_t cell = {
|
|
|
|
6, // nof_prb
|
|
|
|
6, // nof_prb
|
|
|
|
1, // nof_ports
|
|
|
|
1, // nof_ports
|
|
|
@ -116,7 +119,9 @@ srslte_pdsch_t pdsch;
|
|
|
|
srslte_ofdm_t ofdm_tx, ofdm_rx;
|
|
|
|
srslte_ofdm_t ofdm_tx, ofdm_rx;
|
|
|
|
|
|
|
|
|
|
|
|
int dummy_function() {
|
|
|
|
int dummy_function() {
|
|
|
|
|
|
|
|
#ifdef DO_OFDM
|
|
|
|
srslte_ofdm_rx_sf(&ofdm_rx, sf_symbols, slot_symbols[1]);
|
|
|
|
srslte_ofdm_rx_sf(&ofdm_rx, sf_symbols, slot_symbols[1]);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
srslte_softbuffer_rx_reset_tbs(&softbuffer_rx, grant.mcs.tbs);
|
|
|
|
srslte_softbuffer_rx_reset_tbs(&softbuffer_rx, grant.mcs.tbs);
|
|
|
|
return srslte_pdsch_decode(&pdsch, &pdsch_cfg, &softbuffer_rx, slot_symbols[0], ce, 0, data);
|
|
|
|
return srslte_pdsch_decode(&pdsch, &pdsch_cfg, &softbuffer_rx, slot_symbols[0], ce, 0, data);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -153,7 +158,7 @@ int main(int argc, char **argv) {
|
|
|
|
sf_symbols=srslte_vec_malloc(sizeof(cf_t)*SRSLTE_SF_LEN_PRB(cell.nof_prb));
|
|
|
|
sf_symbols=srslte_vec_malloc(sizeof(cf_t)*SRSLTE_SF_LEN_PRB(cell.nof_prb));
|
|
|
|
|
|
|
|
|
|
|
|
/* Configure PDSCH */
|
|
|
|
/* Configure PDSCH */
|
|
|
|
if (srslte_pdsch_cfg(&pdsch_cfg, cell, &grant, cfi, subframe, 0)) {
|
|
|
|
if (srslte_pdsch_cfg(&pdsch_cfg, cell, &grant, cfi, subframe, rv_idx)) {
|
|
|
|
fprintf(stderr, "Error configuring PDSCH\n");
|
|
|
|
fprintf(stderr, "Error configuring PDSCH\n");
|
|
|
|
exit(-1);
|
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -188,11 +193,6 @@ int main(int argc, char **argv) {
|
|
|
|
|
|
|
|
|
|
|
|
srslte_pdsch_set_rnti(&pdsch, rnti);
|
|
|
|
srslte_pdsch_set_rnti(&pdsch, rnti);
|
|
|
|
|
|
|
|
|
|
|
|
if (srslte_softbuffer_tx_init(&softbuffer_tx, cell.nof_prb)) {
|
|
|
|
|
|
|
|
fprintf(stderr, "Error initiating TX soft buffer\n");
|
|
|
|
|
|
|
|
goto quit;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (srslte_softbuffer_rx_init(&softbuffer_rx, cell.nof_prb)) {
|
|
|
|
if (srslte_softbuffer_rx_init(&softbuffer_rx, cell.nof_prb)) {
|
|
|
|
fprintf(stderr, "Error initiating RX soft buffer\n");
|
|
|
|
fprintf(stderr, "Error initiating RX soft buffer\n");
|
|
|
|
goto quit;
|
|
|
|
goto quit;
|
|
|
@ -204,18 +204,30 @@ int main(int argc, char **argv) {
|
|
|
|
fprintf(stderr, "Error opening file %s\n", input_file);
|
|
|
|
fprintf(stderr, "Error opening file %s\n", input_file);
|
|
|
|
exit(-1);
|
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef DO_OFDM
|
|
|
|
|
|
|
|
srslte_filesource_read(&fsrc, sf_symbols, SRSLTE_SF_LEN_PRB(cell.nof_prb));
|
|
|
|
|
|
|
|
#else
|
|
|
|
srslte_filesource_read(&fsrc, slot_symbols[0], SRSLTE_SF_LEN_RE(cell.nof_prb, cell.cp));
|
|
|
|
srslte_filesource_read(&fsrc, slot_symbols[0], SRSLTE_SF_LEN_RE(cell.nof_prb, cell.cp));
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
srslte_filesource_free(&fsrc);
|
|
|
|
srslte_chest_dl_t chest;
|
|
|
|
|
|
|
|
if (srslte_chest_dl_init(&chest, cell)) {
|
|
|
|
|
|
|
|
printf("Error initializing equalizer\n");
|
|
|
|
|
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
srslte_chest_dl_estimate(&chest, slot_symbols[0], ce, subframe);
|
|
|
|
|
|
|
|
srslte_chest_dl_free(&chest);
|
|
|
|
|
|
|
|
|
|
|
|
if (SRSLTE_VERBOSE_ISNONE()) {
|
|
|
|
srslte_filesource_free(&fsrc);
|
|
|
|
printf("Decoding TBS: %d\r",grant.mcs.tbs);
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (srslte_softbuffer_tx_init(&softbuffer_tx, cell.nof_prb)) {
|
|
|
|
|
|
|
|
fprintf(stderr, "Error initiating TX soft buffer\n");
|
|
|
|
|
|
|
|
goto quit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (i=0;i<grant.mcs.tbs/8;i++) {
|
|
|
|
for (i=0;i<grant.mcs.tbs/8;i++) {
|
|
|
|
data[i] = rand()%256;
|
|
|
|
data[i] = rand()%256;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (rv=0;rv<=rv_idx;rv++) {
|
|
|
|
for (rv=0;rv<=rv_idx;rv++) {
|
|
|
|
|
|
|
|
|
|
|
|
pdsch_cfg.rv = rv;
|
|
|
|
pdsch_cfg.rv = rv;
|
|
|
@ -237,11 +249,14 @@ int main(int argc, char **argv) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef DO_OFDM
|
|
|
|
srslte_ofdm_tx_sf(&ofdm_tx, slot_symbols[0], sf_symbols);
|
|
|
|
srslte_ofdm_tx_sf(&ofdm_tx, slot_symbols[0], sf_symbols);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
int M=1;
|
|
|
|
int M=1;
|
|
|
|
int r=0;
|
|
|
|
int r=0;
|
|
|
|
srslte_sch_set_max_noi(&pdsch.dl_sch, 1);
|
|
|
|
srslte_sch_set_max_noi(&pdsch.dl_sch, 10);
|
|
|
|
gettimeofday(&t[1], NULL);
|
|
|
|
gettimeofday(&t[1], NULL);
|
|
|
|
for (i=0;i<M;i++) {
|
|
|
|
for (i=0;i<M;i++) {
|
|
|
|
r = dummy_function();
|
|
|
|
r = dummy_function();
|
|
|
@ -254,7 +269,7 @@ int main(int argc, char **argv) {
|
|
|
|
ret = -1;
|
|
|
|
ret = -1;
|
|
|
|
goto quit;
|
|
|
|
goto quit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = 0;
|
|
|
|
ret = 0;
|
|
|
|
quit:
|
|
|
|
quit:
|
|
|
|
srslte_pdsch_free(&pdsch);
|
|
|
|
srslte_pdsch_free(&pdsch);
|
|
|
|