From 0b048dd6012d8e6359016ae4b5e99311d22854ac Mon Sep 17 00:00:00 2001 From: ismagom Date: Sat, 26 Sep 2015 12:49:36 +0200 Subject: [PATCH] Fixed not computing DCI size for 100 prb --- srslte/lib/phch/src/dci.c | 2 +- srslte/lib/phch/src/dci_sz_table.h | 3 ++- srslte/lib/phch/src/pdcch.c | 4 +++- srslte/lib/phch/test/pdcch_test.c | 6 +++--- srslte/lib/ue/src/ue_dl.c | 16 +++++++++------- 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/srslte/lib/phch/src/dci.c b/srslte/lib/phch/src/dci.c index dc5f8ef00..5c8cd9b7c 100644 --- a/srslte/lib/phch/src/dci.c +++ b/srslte/lib/phch/src/dci.c @@ -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) { - if (nof_prb < 100 && format < 4) { + if (nof_prb <= 100 && format < 4) { return dci_sz_table[nof_prb][format]; } else { return 0; diff --git a/srslte/lib/phch/src/dci_sz_table.h b/srslte/lib/phch/src/dci_sz_table.h index e104e11e6..b9d4de353 100644 --- a/srslte/lib/phch/src/dci_sz_table.h +++ b/srslte/lib/phch/src/dci_sz_table.h @@ -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, 17, 15, 5}, {17, 15, 17, 5}, @@ -127,6 +127,7 @@ static uint32_t dci_sz_table[100][4] = { {28, 38, 28, 15}, {28, 39, 28, 15}, {28, 39, 28, 15}, + {28, 39, 28, 15}, {28, 39, 28, 15} }; diff --git a/srslte/lib/phch/src/pdcch.c b/srslte/lib/phch/src/pdcch.c index b31ecfadb..1702efd85 100644 --- a/srslte/lib/phch/src/pdcch.c +++ b/srslte/lib/phch/src/pdcch.c @@ -352,6 +352,8 @@ int srslte_pdcch_decode_msg(srslte_pdcch_t *q, 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. * 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 @@ -422,7 +424,7 @@ int srslte_pdcch_extract_llr(srslte_pdcch_t *q, cf_t *sf_symbols, cf_t *ce[SRSLT /* descramble */ srslte_scrambling_f_offset(&q->seq[nsubframe], q->llr, 0, e_bits); - + ret = SRSLTE_SUCCESS; } return ret; diff --git a/srslte/lib/phch/test/pdcch_test.c b/srslte/lib/phch/test/pdcch_test.c index d89736c98..39e4d62b7 100644 --- a/srslte/lib/phch/test/pdcch_test.c +++ b/srslte/lib/phch/test/pdcch_test.c @@ -109,8 +109,8 @@ int test_dci_payload_size() { printf("Ok\n"); if (print_dci_table) { - printf("dci_sz_table[100][4] = {\n"); - for (i=0;i<100;i++) { + printf("dci_sz_table[101][4] = {\n"); + for (i=0;i<=100;i++) { printf(" {"); for (int j=0;j<4;j++) { printf("%d",srslte_dci_format_sizeof(formats[j], i)); @@ -118,7 +118,7 @@ int test_dci_payload_size() { printf(", "); } } - if (i<99) { + if (i<100) { printf("},\n"); } else { printf("}\n"); diff --git a/srslte/lib/ue/src/ue_dl.c b/srslte/lib/ue/src/ue_dl.c index 3981e2f3d..fa18775f6 100644 --- a/srslte/lib/ue/src/ue_dl.c +++ b/srslte/lib/ue/src/ue_dl.c @@ -40,6 +40,13 @@ #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, 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)); } -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: * - OFDM demodulation * - 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; for (int f=0;fcell.nof_prb), locations[i].L, 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)) { fprintf(stderr, "Error decoding DCI msg\n");