Fixed not computing DCI size for 100 prb

master
ismagom 9 years ago
parent 7306d88f83
commit 0b048dd601

@ -303,7 +303,7 @@ uint32_t srslte_dci_format_sizeof(srslte_dci_format_t format, uint32_t nof_prb)
} }
uint32_t srslte_dci_format_sizeof_lut(srslte_dci_format_t format, uint32_t nof_prb) { uint32_t srslte_dci_format_sizeof_lut(srslte_dci_format_t format, uint32_t nof_prb) {
if (nof_prb < 100 && format < 4) { if (nof_prb <= 100 && format < 4) {
return dci_sz_table[nof_prb][format]; return dci_sz_table[nof_prb][format];
} else { } else {
return 0; return 0;

@ -27,7 +27,7 @@
static uint32_t dci_sz_table[100][4] = { static uint32_t dci_sz_table[101][4] = {
{15, 13, 15, 5}, {15, 13, 15, 5},
{15, 17, 15, 5}, {15, 17, 15, 5},
{17, 15, 17, 5}, {17, 15, 17, 5},
@ -127,6 +127,7 @@ static uint32_t dci_sz_table[100][4] = {
{28, 38, 28, 15}, {28, 38, 28, 15},
{28, 39, 28, 15}, {28, 39, 28, 15},
{28, 39, 28, 15}, {28, 39, 28, 15},
{28, 39, 28, 15},
{28, 39, 28, 15} {28, 39, 28, 15}
}; };

@ -352,6 +352,8 @@ int srslte_pdcch_decode_msg(srslte_pdcch_t *q,
return ret; return ret;
} }
int cnt=0;
/** Extracts the LLRs from srslte_dci_location_t location of the subframe and stores them in the srslte_pdcch_t structure. /** Extracts the LLRs from srslte_dci_location_t location of the subframe and stores them in the srslte_pdcch_t structure.
* DCI messages can be extracted from this location calling the function srslte_pdcch_decode_msg(). * DCI messages can be extracted from this location calling the function srslte_pdcch_decode_msg().
* Every time this function is called (with a different location), the last demodulated symbols are overwritten and * Every time this function is called (with a different location), the last demodulated symbols are overwritten and

@ -109,8 +109,8 @@ int test_dci_payload_size() {
printf("Ok\n"); printf("Ok\n");
if (print_dci_table) { if (print_dci_table) {
printf("dci_sz_table[100][4] = {\n"); printf("dci_sz_table[101][4] = {\n");
for (i=0;i<100;i++) { for (i=0;i<=100;i++) {
printf(" {"); printf(" {");
for (int j=0;j<4;j++) { for (int j=0;j<4;j++) {
printf("%d",srslte_dci_format_sizeof(formats[j], i)); printf("%d",srslte_dci_format_sizeof(formats[j], i));
@ -118,7 +118,7 @@ int test_dci_payload_size() {
printf(", "); printf(", ");
} }
} }
if (i<99) { if (i<100) {
printf("},\n"); printf("},\n");
} else { } else {
printf("}\n"); printf("}\n");

@ -40,6 +40,13 @@
#define PDSCH_DO_ZF #define PDSCH_DO_ZF
srslte_dci_format_t ue_formats[] = {SRSLTE_DCI_FORMAT1A, SRSLTE_DCI_FORMAT1}; // SRSLTE_DCI_FORMAT1B should go here also
const uint32_t nof_ue_formats = 2;
srslte_dci_format_t common_formats[] = {SRSLTE_DCI_FORMAT1A,SRSLTE_DCI_FORMAT1C};
const uint32_t nof_common_formats = 2;
int srslte_ue_dl_init(srslte_ue_dl_t *q, int srslte_ue_dl_init(srslte_ue_dl_t *q,
srslte_cell_t cell) srslte_cell_t cell)
{ {
@ -152,12 +159,6 @@ void srslte_ue_dl_reset(srslte_ue_dl_t *q) {
bzero(&q->pdsch_cfg, sizeof(srslte_pdsch_cfg_t)); bzero(&q->pdsch_cfg, sizeof(srslte_pdsch_cfg_t));
} }
srslte_dci_format_t ue_formats[] = {SRSLTE_DCI_FORMAT1A, SRSLTE_DCI_FORMAT1}; // SRSLTE_DCI_FORMAT1B should go here also
const uint32_t nof_ue_formats = 2;
srslte_dci_format_t common_formats[] = {SRSLTE_DCI_FORMAT1A,SRSLTE_DCI_FORMAT1C};
const uint32_t nof_common_formats = 2;
/** Applies the following operations to a subframe of synchronized samples: /** Applies the following operations to a subframe of synchronized samples:
* - OFDM demodulation * - OFDM demodulation
* - Channel estimation * - Channel estimation
@ -313,8 +314,9 @@ int srslte_ue_dl_find_dl_dci_type(srslte_ue_dl_t *q, srslte_dci_msg_t *dci_msg,
uint16_t crc_rem = 0; uint16_t crc_rem = 0;
for (int f=0;f<nof_formats && crc_rem != rnti;f++) { for (int f=0;f<nof_formats && crc_rem != rnti;f++) {
INFO("Trying format %s\n", srslte_dci_format_string(formats[f]));
for (int i=0;i<nof_locations && crc_rem != rnti;i++) { for (int i=0;i<nof_locations && crc_rem != rnti;i++) {
INFO("Trying format %s (nbits=%d), location L=%d, ncce=%d\n", srslte_dci_format_string(formats[f]),
srslte_dci_format_sizeof_lut(formats[f], q->cell.nof_prb), locations[i].L, locations[i].ncce);
q->last_n_cce = locations[i].ncce; q->last_n_cce = locations[i].ncce;
if (srslte_pdcch_decode_msg(&q->pdcch, dci_msg, &locations[i], formats[f], &crc_rem)) { if (srslte_pdcch_decode_msg(&q->pdcch, dci_msg, &locations[i], formats[f], &crc_rem)) {
fprintf(stderr, "Error decoding DCI msg\n"); fprintf(stderr, "Error decoding DCI msg\n");

Loading…
Cancel
Save