srsRAN_4G icon indicating copy to clipboard operation
srsRAN_4G copied to clipboard

DCI Format1C Length Error

Open SKRAMACE opened this issue 3 years ago • 1 comments
trafficstars

Issue Description

DCI Format 1C does not properly encode when Ngap == 2. This is because the length calculation should not be dependent on the Ngap. According to 36.212 Section 5.3.3.1.4, the length is always calculated using Ngap == 1.

This is properly reflected on dci.c:228: uint32_t n_vrb_dl_gap1 = srslte_ra_type2_n_vrb_dl(cell->nof_prb, true);

However, on dci.c:889 & dci.c:920, the value is dependent on the Ngap: uint32_t n_vrb_dl = srslte_ra_type2_n_vrb_dl(nof_prb, dci->type2_alloc.n_gap == SRSLTE_RA_TYPE2_NG1);

Setup Details

#include <srslte/srslte.h>

srslte_cell_t cell;
memset(&cell, 0, sizeof(srslte_cell_t));
cell.nof_prb = 50;
cell.nof_ports = 2;
cell.id = 1;
cell.cp = SRSLTE_CP_NORM;
cell.phich_length = SRSLTE_PHICH_NORM;
cell.phich_resources = SRSLTE_PHICH_R_1;
cell.frame_type = SRSLTE_FDD;

srslte_dci_dl_t dci;
memset(&dci, 0, sizeof(srslte_dci_dl_t));
dci.rnti = 0xffff;
dci.format = SRSLTE_DCI_FORMAT1C;
dci.location.L = 2;
dci.alloc_type = SRSLTE_RA_ALLOC_TYPE2;
dci.type2_alloc.riv = 23;
dci.type2_alloc.mode = SRSLTE_RA_TYPE2_DIST;
dci.type2_alloc.n_prb1a = SRSLTE_RA_TYPE2_NPRB1A_2;
dci.type2_alloc.n_gap = SRSLTE_RA_TYPE2_NG2;
dci.tb[0].mcs_idx = 7;

srslte_dci_msg_t dci_msg;
memset(&dci_msg, 0, sizeof(srslte_dci_msg_t));
srslte_dci_msg_pack_pdsch(&cell, &sf_cfg_dl, NULL, &dci, &dci_msg);

srslte_dci_dl_t test_dci;
memset(&test_dci, 0, sizeof(srslte_dci_dl_t));
srslte_dci_msg_unpack_pdsch(&cell, &sf_cfg_dl, NULL, &dci_msg, &test_dci);

Expected Behavior

test_dci should match dci

Actual Behaviour

srslte_dci_msg_unpack_pdsch returns an error

SKRAMACE avatar Dec 17 '21 17:12 SKRAMACE

Thanks for letting us know. We are looking into it.

andrepuschmann avatar Dec 20 '21 09:12 andrepuschmann