Fix minor issues for TDD

master
Ismael Gomez 6 years ago
parent e8b2be378d
commit 786830daf3

@ -59,6 +59,7 @@ typedef struct SRSLTE_API {
srslte_cell_t cell;
uint32_t max_ctrl_symbols;
uint32_t ngroups_phich;
uint32_t ngroups_phich_m1;
srslte_phich_r_t phich_res;
srslte_phich_length_t phich_len;
@ -107,6 +108,9 @@ SRSLTE_API int srslte_regs_phich_get(srslte_regs_t *h,
uint32_t ngroup);
SRSLTE_API uint32_t srslte_regs_phich_ngroups(srslte_regs_t *h);
SRSLTE_API uint32_t srslte_regs_phich_ngroups_m1(srslte_regs_t* h);
SRSLTE_API int srslte_regs_phich_reset(srslte_regs_t *h,
cf_t *slot_symbols);

@ -1204,6 +1204,10 @@ int srslte_dci_msg_unpack_pdsch(
dci->nof_bits = msg->nof_bits;
#endif
// Set dwpts flag
dci->is_dwpts =
cell->frame_type == SRSLTE_TDD && srslte_sfidx_tdd_type(sf->tdd_config, sf->tti % 10) == SRSLTE_TDD_SF_S;
switch (msg->format) {
case SRSLTE_DCI_FORMAT1:
return dci_format1_unpack(cell, sf, cfg, msg, dci);

@ -130,7 +130,7 @@ int srslte_phich_set_cell(srslte_phich_t *q, srslte_regs_t *regs, srslte_cell_t
/* Computes n_group and n_seq according to Section 9.1.2 in 36.213 */
void srslte_phich_calc(srslte_phich_t* q, srslte_phich_grant_t* grant, srslte_phich_resource_t* n_phich)
{
uint32_t Ngroups = srslte_phich_ngroups(q);
uint32_t Ngroups = srslte_regs_phich_ngroups_m1(q->regs);
if (Ngroups) {
if (n_phich) {
n_phich->ngroup = (grant->n_prb_lowest + grant->n_dmrs) % Ngroups + grant->I_phich * Ngroups;

@ -270,7 +270,8 @@ int regs_phich_init(srslte_regs_t* h, uint32_t phich_mi, bool mbsfn_or_sf1_6_tdd
ng = 0;
break;
}
h->ngroups_phich = (int)phich_mi * ceilf(ng * ((float)h->cell.nof_prb / 8));
h->ngroups_phich_m1 = (int)ceilf(ng * ((float)h->cell.nof_prb / 8));
h->ngroups_phich = (int)phich_mi * h->ngroups_phich_m1;
h->phich = malloc(sizeof(srslte_regs_ch_t) * h->ngroups_phich);
if (!h->phich) {
perror("malloc");
@ -397,6 +398,11 @@ uint32_t srslte_regs_phich_ngroups(srslte_regs_t *h) {
return h->ngroups_phich;
}
uint32_t srslte_regs_phich_ngroups_m1(srslte_regs_t* h)
{
return h->ngroups_phich_m1;
}
/**
* Adds the PHICH symbols to the resource grid pointed by slot_symbols.
*

Loading…
Cancel
Save