Fix UE/ENB DL NR

master
Xavier Arteaga 4 years ago committed by Andre Puschmann
parent 8de2870788
commit 0396ebae17

@ -725,7 +725,7 @@ int srslte_dmrs_pdsch_estimate(srslte_dmrs_pdsch_t* q,
// Time domain hold, extract resource elements estimates for PDSCH
uint32_t symbol_idx = 0;
uint32_t count = 0;
for (uint32_t l = grant->S; l < grant->L; l++) {
for (uint32_t l = grant->S; l < grant->S + grant->L; l++) {
while (symbols[symbol_idx] < l && symbol_idx < nof_symbols) {
symbol_idx++;
}

@ -119,7 +119,7 @@ int srslte_pdsch_nr_set_carrier(srslte_pdsch_nr_t* q,
for (uint32_t i = 0; i < max_cw; i++) {
if (q->b[i] == NULL) {
q->b[i] = srslte_vec_u8_malloc(SRSLTE_SLOT_MAX_LEN_RE_NR);
q->b[i] = srslte_vec_u8_malloc(SRSLTE_SLOT_MAX_NOF_BITS_NR);
if (q->b[i] == NULL) {
ERROR("Malloc");
return SRSLTE_ERROR;
@ -210,9 +210,9 @@ static uint32_t srslte_pdsch_nr_cp_dmrs_type1(const srslte_pdsch_nr_t* q,
if (grant->prb_idx[i]) {
for (uint32_t j = 0; j < SRSLTE_NRE; j += 2) {
if (put) {
sf_symbols[i * SRSLTE_NRE + delta + j] = symbols[count++];
sf_symbols[i * SRSLTE_NRE + delta + j + 1] = symbols[count++];
} else {
symbols[count++] = sf_symbols[i * SRSLTE_NRE + delta + j];
symbols[count++] = sf_symbols[i * SRSLTE_NRE + delta + j + 1];
}
}
}
@ -562,20 +562,32 @@ int srslte_pdsch_nr_decode(srslte_pdsch_nr_t* q,
uint32_t nof_re = srslte_ra_dl_nr_slot_nof_re(cfg, grant);
if (channel->nof_re != nof_re) {
ERROR("Inconsistent number of RE (%d!=%d)\n", channel->nof_re, nof_re);
return SRSLTE_ERROR;
}
// Demapping from virtual to physical resource blocks
cf_t** x = (grant->nof_layers > 1) ? q->x : q->d;
uint32_t nof_re_get = srslte_pdsch_nr_get(q, cfg, grant, x[0], sf_symbols[0]);
uint32_t nof_re_get = srslte_pdsch_nr_get(q, cfg, grant, q->x[0], sf_symbols[0]);
if (nof_re_get != nof_re) {
ERROR("Inconsistent number of RE (%d!=%d)\n", nof_re_get, nof_re);
return SRSLTE_ERROR;
}
if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) {
INFO("ce=");
srslte_vec_fprint_c(stdout, channel->ce[0][0], nof_re);
INFO("x=");
srslte_vec_fprint_c(stdout, q->x[0], nof_re);
}
// Demapping to virtual resource blocks
// ... Not implemented
// Antenna port demapping
// ... Not implemented
srslte_predecoding_single(x[0], channel->ce[0][0], x[0], NULL, nof_re, 1.0f, channel->noise_estimate);
srslte_predecoding_type(
q->x, channel->ce, q->d, NULL, 1, 1, 1, 0, nof_re, SRSLTE_TXSCHEME_PORT0, 1.0f, channel->noise_estimate);
// Layer demapping
if (grant->nof_layers > 1) {

@ -628,4 +628,4 @@ add_test(dlsch_nr_test dlsch_nr_test -m 0 -n 1)
add_executable(pdsch_nr_test pdsch_nr_test.c)
target_link_libraries(pdsch_nr_test srslte_phy)
add_test(pdsch_nr_test pdsch_nr_test -n 6 -m 20)
add_test(pdsch_nr_test pdsch_nr_test -p 6 -m 20)

@ -103,14 +103,14 @@ int main(int argc, char** argv)
goto clean_exit;
}
if (srslte_sch_nr_init_tx(&sch_nr_tx) < SRSLTE_SUCCESS) {
srslte_sch_nr_args_t args = {};
args.disable_simd = false;
if (srslte_sch_nr_init_tx(&sch_nr_tx, &args) < SRSLTE_SUCCESS) {
ERROR("Error initiating SCH NR for Tx\n");
goto clean_exit;
}
srslte_sch_nr_args_t decoder_cfg = {};
decoder_cfg.disable_simd = false;
if (srslte_sch_nr_init_rx(&sch_nr_rx, &decoder_cfg) < SRSLTE_SUCCESS) {
if (srslte_sch_nr_init_rx(&sch_nr_rx, &args) < SRSLTE_SUCCESS) {
ERROR("Error initiating SCH NR for Rx\n");
goto clean_exit;
}

@ -158,18 +158,9 @@ int srslte_ue_dl_nr_pdsch_get(srslte_ue_dl_nr_t* q,
return SRSLTE_ERROR;
}
if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) {
printf("ce[0][0]=");
srslte_vec_fprint_c(stdout, q->chest.ce[0][0], q->chest.nof_re);
}
for (uint32_t i = 0; i < grant->tb->nof_re; i++) {
q->chest.ce[0][0][i] = (1536);
}
if (srslte_pdsch_nr_decode(&q->pdsch, cfg, grant, &q->chest, q->sf_symbols, res) < SRSLTE_SUCCESS) {
return SRSLTE_ERROR;
}
return SRSLTE_SUCCESS;
}
}

@ -64,4 +64,4 @@ set_tests_properties(pucch_ca_test PROPERTIES LABELS "long;phy")
add_executable(phy_dl_nr_test phy_dl_nr_test.c)
target_link_libraries(phy_dl_nr_test srslte_phy srslte_common srslte_phy ${SEC_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
add_test(phy_dl_nr_test phy_dl_nr_test)
add_test(phy_dl_nr_test phy_dl_nr_test -p 100 -m 28)
Loading…
Cancel
Save