Fix bug in SRS using the previous grant to compute collision with PUSCH (#958)

master
Ismael Gomez 5 years ago committed by GitHub
parent 4fb83ae26d
commit d8d10daebe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -61,6 +61,10 @@ SRSLTE_API int srslte_ra_ul_dci_to_grant(srslte_cell_t* cell,
srslte_dci_ul_t* dci,
srslte_pusch_grant_t* grant);
SRSLTE_API void srslte_ra_ul_compute_nof_re(srslte_pusch_grant_t* grant,
srslte_cp_t cp,
uint32_t N_srs);
/** Others */
SRSLTE_API uint32_t srslte_ra_ul_info(srslte_pusch_grant_t* grant, char* info_str, uint32_t len);

@ -229,7 +229,7 @@ static void ul_fill_ra_mcs(srslte_ra_tb_t* tb, srslte_ra_tb_t* last_tb, uint32_t
}
}
static void compute_nof_re(srslte_pusch_grant_t* grant, srslte_cp_t cp, uint32_t N_srs)
void srslte_ra_ul_compute_nof_re(srslte_pusch_grant_t* grant, srslte_cp_t cp, uint32_t N_srs)
{
grant->nof_symb = 2 * (SRSLTE_CP_NSYMB(cp) - 1) - N_srs;
grant->nof_re = grant->nof_symb * grant->L_prb * SRSLTE_NRE;
@ -299,10 +299,11 @@ int srslte_ra_ul_dci_to_grant(srslte_cell_t* cell,
// copy RV
grant->tb.rv = dci->tb.rv;
/* Compute final number of bits and RE */
compute_nof_re(grant, cell->cp, sf->shortened ? 1 : 0);
/* Compute RE assuming shortened is false*/
srslte_ra_ul_compute_nof_re(grant, cell->cp, 0);
// Assume hopping is the same
// TODO: Need to compute hopping here before determining if there is collision with SRS, but only MAC knows if it's a
// new tx or a retx. Need to split MAC interface in 2 calls. For now, assume hopping is the same
for (uint32_t i = 0; i < 2; i++) {
grant->n_prb_tilde[i] = grant->n_prb[i];
}

@ -207,10 +207,19 @@ int srslte_ue_ul_dci_to_pusch_grant(srslte_ue_ul_t* q,
srslte_dci_ul_t* dci,
srslte_pusch_grant_t* grant)
{
if (srslte_ra_ul_dci_to_grant(&q->cell, sf, &cfg->ul_cfg.hopping, dci, grant)) {
ERROR("Converting DCI to UL grant\n");
return SRSLTE_ERROR;
}
// Update shortened before computing grant
srslte_refsignal_srs_pusch_shortened(&q->signals, sf, &cfg->ul_cfg.srs, &cfg->ul_cfg.pusch);
return srslte_ra_ul_dci_to_grant(&q->cell, sf, &cfg->ul_cfg.hopping, dci, grant);
/* Update RE assuming if shortened is true */
if (sf->shortened) {
srslte_ra_ul_compute_nof_re(grant, q->cell.cp, true);
}
return SRSLTE_SUCCESS;
}
void srslte_ue_ul_pusch_hopping(srslte_ue_ul_t* q,
@ -218,6 +227,9 @@ void srslte_ue_ul_pusch_hopping(srslte_ue_ul_t* q,
srslte_ue_ul_cfg_t* cfg,
srslte_pusch_grant_t* grant)
{
if (cfg->ul_cfg.srs.configured && cfg->ul_cfg.hopping.hopping_enabled) {
ERROR("UL SRS and frequency hopping not currently supported\n");
}
return srslte_ra_ul_pusch_hopping(&q->hopping, sf, &cfg->ul_cfg.hopping, grant);
}

Loading…
Cancel
Save