From 72e6fa40fc6679e42b1d2f05229d6b5c5f754c2f Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Sun, 16 Feb 2020 23:16:51 +0100 Subject: [PATCH] Fix multiple issues with DCI sizes when using CA. --- lib/src/phy/phch/dci.c | 21 ++++------------ lib/src/phy/ue/ue_dl.c | 51 ++++++++++++++++++++++++-------------- srsue/hdr/phy/cc_worker.h | 1 + srsue/src/phy/cc_worker.cc | 5 ++++ srsue/src/phy/sf_worker.cc | 5 ++++ 5 files changed, 49 insertions(+), 34 deletions(-) diff --git a/lib/src/phy/phch/dci.c b/lib/src/phy/phch/dci.c index e7f1c6e3d..1c43c498d 100644 --- a/lib/src/phy/phch/dci.c +++ b/lib/src/phy/phch/dci.c @@ -148,8 +148,10 @@ static uint32_t dci_format0_sizeof_(srslte_cell_t* cell, srslte_dl_sf_cfg_t* sf, /* SRS request – 0 or 1 bit */ n += (cfg->srs_request_enabled) ? 1 : 0; - /* Resource allocation type – 1 bit (N^UL_RB ≤ N^DL_RB) */ - n += (cfg->ra_format_enabled) ? 1 : 0; + /* Resource allocation type – 1 bit (N^UL_RB ≤ N^DL_RB) + * This is a release10 field only, but it is backwards compatible to release 8 because a padding bit will be added. + */ + n++; return n; } @@ -484,13 +486,6 @@ static int dci_format0_unpack(srslte_cell_t* cell, uint8_t* y = msg->payload; uint32_t n_ul_hop; - /* Make sure it's a SRSLTE_DCI_FORMAT0 message */ - uint32_t msg_len = srslte_dci_format_sizeof(cell, sf, cfg, SRSLTE_DCI_FORMAT0); - if (msg->nof_bits != msg_len) { - ERROR("Invalid message length for format 0 (%d != %d)\n", msg->nof_bits, msg_len); - return SRSLTE_ERROR; - } - if (cfg->cif_enabled) { dci->cif = srslte_bit_pack(&y, 3); dci->cif_present = true; @@ -624,7 +619,7 @@ static int dci_format1_pack(srslte_cell_t* cell, msg->nof_bits = (y - msg->payload); if (msg->nof_bits != dci_format1_sizeof(cell, sf, cfg)) { - ERROR("Invalid message length for format 1A (Cross scheduling %s)\n", dci->cif_present ? "enabled" : "disabled"); + ERROR("Invalid message length for format 1 (Cross scheduling %s)\n", dci->cif_present ? "enabled" : "disabled"); } return SRSLTE_SUCCESS; @@ -782,12 +777,6 @@ static int dci_format1As_unpack(srslte_cell_t* cell, /* pack bits */ uint8_t* y = msg->payload; - /* Make sure it's a SRSLTE_DCI_FORMAT0 message */ - if (msg->nof_bits != srslte_dci_format_sizeof(cell, sf, cfg, SRSLTE_DCI_FORMAT1A)) { - ERROR("Invalid message length for format 1A (Cross scheduling %s)\n", cfg->cif_enabled ? "enabled" : "disabled"); - return SRSLTE_ERROR; - } - if (cfg->cif_enabled) { dci->cif = srslte_bit_pack(&y, 3); dci->cif_present = true; diff --git a/lib/src/phy/ue/ue_dl.c b/lib/src/phy/ue/ue_dl.c index d5bdb5f17..6f44d8352 100644 --- a/lib/src/phy/ue/ue_dl.c +++ b/lib/src/phy/ue/ue_dl.c @@ -539,7 +539,7 @@ static int find_dl_dci_type_siprarnti(srslte_ue_dl_t* q, { int ret = 0; - srslte_dci_cfg_t* dci_cfg = &dl_cfg->cfg.dci; + srslte_dci_cfg_t dci_cfg = dl_cfg->cfg.dci; // Configure and run DCI blind search dci_blind_search_t search_space; @@ -550,11 +550,16 @@ static int find_dl_dci_type_siprarnti(srslte_ue_dl_t* q, sf->tti, sf->cfi, rnti); + + // Disable extended CSI request and SRS request for non C-RNTI + dci_cfg.multiple_csi_request_enabled = false; + dci_cfg.srs_request_enabled = false; + // Search for RNTI only if there is room for the common search space if (search_space.nof_locations > 0) { for (uint32_t f = 0; f < nof_common_formats; f++) { search_space.format = common_formats[f]; - if ((ret = dci_blind_search(q, sf, rnti, &search_space, dci_cfg, dci_msg))) { + if ((ret = dci_blind_search(q, sf, rnti, &search_space, &dci_cfg, dci_msg))) { return ret; } } @@ -575,9 +580,33 @@ static int find_dl_dci_type_crnti(srslte_ue_dl_t* q, uint32_t sf_idx = sf->tti % 10; uint32_t cfi = sf->cfi; - srslte_dci_cfg_t* dci_cfg = &cfg->cfg.dci; + srslte_dci_cfg_t dci_cfg = cfg->cfg.dci; + + // Search first Common SS + + // Disable extended CSI request and SRS request in common SS + dci_cfg.multiple_csi_request_enabled = false; + dci_cfg.srs_request_enabled = false; + + // Search Format 1A in the Common SS also + if (q->pregen_rnti == rnti) { + current_ss = &q->current_ss_common[MI_IDX(sf_idx)][cfi - 1]; + } else { + // If locations are not pre-generated, generate them now + current_ss->nof_locations = srslte_pdcch_common_locations(&q->pdcch, current_ss->loc, MAX_CANDIDATES_COM, cfi); + } + + // Search for RNTI only if there is room for the common search space + if (current_ss->nof_locations > 0) { + current_ss->format = SRSLTE_DCI_FORMAT1A; + INFO("Searching DL C-RNTI in %d ue locations, format 1A\n", current_ss->nof_locations); + if ((ret = dci_blind_search(q, sf, rnti, current_ss, &dci_cfg, dci_msg))) { + return ret; + } + } // Search UE-specific search space + dci_cfg = cfg->cfg.dci; if (q->pregen_rnti == rnti) { current_ss = &q->current_ss_ue[MI_IDX(sf_idx)][cfi - 1][sf_idx]; } else { @@ -595,25 +624,11 @@ static int find_dl_dci_type_crnti(srslte_ue_dl_t* q, INFO("Searching DL C-RNTI %s in %d ue locations\n", srslte_dci_format_string(format), current_ss->nof_locations); current_ss->format = format; - if ((ret = dci_blind_search(q, sf, rnti, current_ss, dci_cfg, dci_msg))) { + if ((ret = dci_blind_search(q, sf, rnti, current_ss, &dci_cfg, dci_msg))) { return ret; } } - // Search Format 1A in the Common SS also - if (q->pregen_rnti == rnti) { - current_ss = &q->current_ss_common[MI_IDX(sf_idx)][cfi - 1]; - } else { - // If locations are not pre-generated, generate them now - current_ss->nof_locations = srslte_pdcch_common_locations(&q->pdcch, current_ss->loc, MAX_CANDIDATES_COM, cfi); - } - - // Search for RNTI only if there is room for the common search space - if (current_ss->nof_locations > 0) { - current_ss->format = SRSLTE_DCI_FORMAT1A; - INFO("Searching DL C-RNTI in %d ue locations, format 1A\n", current_ss->nof_locations); - return dci_blind_search(q, sf, rnti, current_ss, dci_cfg, dci_msg); - } return SRSLTE_SUCCESS; } diff --git a/srsue/hdr/phy/cc_worker.h b/srsue/hdr/phy/cc_worker.h index a34889da5..75028876a 100644 --- a/srsue/hdr/phy/cc_worker.h +++ b/srsue/hdr/phy/cc_worker.h @@ -48,6 +48,7 @@ public: void set_tdd_config(srslte_tdd_config_t config); void set_config(srslte::phy_cfg_t& phy_cfg); + void upd_config_dci(srslte_dci_cfg_t& dci_cfg); void set_crnti(uint16_t rnti); void enable_pregen_signals(bool enabled); diff --git a/srsue/src/phy/cc_worker.cc b/srsue/src/phy/cc_worker.cc index 618ee8df4..11b3033d0 100644 --- a/srsue/src/phy/cc_worker.cc +++ b/srsue/src/phy/cc_worker.cc @@ -916,6 +916,11 @@ void cc_worker::set_config(srslte::phy_cfg_t& phy_cfg) } } +void cc_worker::upd_config_dci(srslte_dci_cfg_t &dci_cfg) +{ + ue_dl_cfg.cfg.dci = dci_cfg; +} + int cc_worker::read_ce_abs(float* ce_abs, uint32_t tx_antenna, uint32_t rx_antenna) { int sz = srslte_symbol_sz(cell.nof_prb); diff --git a/srsue/src/phy/sf_worker.cc b/srsue/src/phy/sf_worker.cc index 1a102be17..e0314ba3b 100644 --- a/srsue/src/phy/sf_worker.cc +++ b/srsue/src/phy/sf_worker.cc @@ -186,6 +186,11 @@ void sf_worker::set_config(uint32_t cc_idx, srslte::phy_cfg_t& phy_cfg) if (cc_idx < cc_workers.size()) { Info("Setting configuration for cc_worker=%d, cc=%d\n", get_id(), cc_idx); cc_workers[cc_idx]->set_config(phy_cfg); + if (cc_idx > 0) { + // Update DCI config for PCell + srslte_dci_cfg_t dci_cfg = phy_cfg.dl_cfg.dci; + cc_workers[0]->upd_config_dci(dci_cfg); + } } else { Error("Setting config for cc=%d; Invalid cc_idx\n", cc_idx); }