From d80146e657efe1d35fe5447c03f3b1aa0fdd352a Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Tue, 30 Aug 2016 19:49:50 +0200 Subject: [PATCH] Fixed blind search --- srslte/lib/phch/pdcch.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/srslte/lib/phch/pdcch.c b/srslte/lib/phch/pdcch.c index 2ac4ba115..5881e2b17 100644 --- a/srslte/lib/phch/pdcch.c +++ b/srslte/lib/phch/pdcch.c @@ -187,7 +187,7 @@ uint32_t srslte_pdcch_ue_locations_ncce(uint32_t nof_cce, srslte_dci_location_t int l; // this must be int because of the for(;;--) loop uint32_t i, k, L, m; uint32_t Yk, ncce; - const int S[4] = { 6, 12, 8, 16 }; + const int M[4] = { 6, 6, 2, 2 }; // Compute Yk for this subframe Yk = rnti; @@ -200,7 +200,7 @@ uint32_t srslte_pdcch_ue_locations_ncce(uint32_t nof_cce, srslte_dci_location_t for (l = 3; l >= 0; l--) { L = (1 << l); // For all possible ncce offset - for (i = 0; i < SRSLTE_MIN(nof_cce / L, S[l]/PDCCH_FORMAT_NOF_CCE(l)); i++) { + for (i = 0; i < M[l]; i++) { ncce = L * ((Yk + i) % (nof_cce / L)); if (k < max_candidates && ncce + PDCCH_FORMAT_NOF_CCE(l) <= nof_cce) @@ -239,14 +239,18 @@ uint32_t srslte_pdcch_common_locations(srslte_pdcch_t *q, srslte_dci_location_t uint32_t srslte_pdcch_common_locations_ncce(uint32_t nof_cce, srslte_dci_location_t *c, uint32_t max_candidates) { uint32_t i, l, L, k; - + const int M[4] = { 0, 0, 4, 2 }; + k = 0; for (l = 3; l > 1; l--) { L = (1 << l); - for (i = 0; i < SRSLTE_MIN(nof_cce, 16) / (L); i++) { - if (k < max_candidates) { + for (i = 0; i < M[l]; i++) { + uint32_t ncce = L * (i % (nof_cce / L)); + if (k < max_candidates && + ncce + PDCCH_FORMAT_NOF_CCE(l) <= nof_cce) + { c[k].L = l; - c[k].ncce = (L) * (i % (nof_cce / (L))); + c[k].ncce = ncce; DEBUG("Common SS Candidate %d: nCCE: %d, L: %d\n", k, c[k].ncce, c[k].L); k++;