diff --git a/lib/include/srslte/phy/common/phy_common_nr.h b/lib/include/srslte/phy/common/phy_common_nr.h index af1bcad48..01fda2042 100644 --- a/lib/include/srslte/phy/common/phy_common_nr.h +++ b/lib/include/srslte/phy/common/phy_common_nr.h @@ -295,8 +295,6 @@ typedef struct SRSLTE_API { uint32_t id; uint32_t coreset_id; uint32_t duration; // in slots - uint32_t periodicity; - uint32_t offset; srslte_search_space_type_t type; uint32_t nof_candidates[SRSLTE_SEARCH_SPACE_NOF_AGGREGATION_LEVELS_NR]; } srslte_search_space_t; diff --git a/lib/include/srslte/phy/phch/pucch_cfg_nr.h b/lib/include/srslte/phy/phch/pucch_cfg_nr.h index 30079dda3..68a234d64 100644 --- a/lib/include/srslte/phy/phch/pucch_cfg_nr.h +++ b/lib/include/srslte/phy/phch/pucch_cfg_nr.h @@ -77,11 +77,6 @@ */ #define SRSLTE_PUCCH_NR_MAX_NOF_SETS 4 -/** - * Maximum numer of NR-PUCCH CS indexes (TS 38.213 Table 9.2.1-1: PUCCH resource sets...) - */ -#define SRSLTE_PUCCH_NR_MAX_NOF_CS_INDEXES 4 - typedef enum SRSLTE_API { SRSLTE_PUCCH_NR_FORMAT_0 = 0, SRSLTE_PUCCH_NR_FORMAT_1, diff --git a/lib/include/srslte/phy/phch/uci_cfg_nr.h b/lib/include/srslte/phy/phch/uci_cfg_nr.h index 6d0cedb11..28919b913 100644 --- a/lib/include/srslte/phy/phch/uci_cfg_nr.h +++ b/lib/include/srslte/phy/phch/uci_cfg_nr.h @@ -49,11 +49,16 @@ * @brief Uplink Control Information (UCI) message configuration */ typedef struct SRSLTE_API { + /// Common Parameters uint32_t o_ack; ///< Number of HARQ-ACK bits uint32_t o_sr; ///< Number of SR bits uint32_t o_csi1; ///< Number of CSI1 report number of bits uint32_t o_csi2; ///< Number of CSI2 report number of bits - srslte_mod_t modulation; ///< Modulation (PUSCH only) + + /// PUSCH only parameters + srslte_mod_t modulation; ///< Modulation + + /// PUCCH only parameters uint16_t rnti; ///< RNTI uint32_t pucch_resource_id; ///< PUCCH resource indicator field in the DCI format 1_0 or DCI format 1_1 uint32_t n_cce_0; ///< index of a first CCE for the PDCCH reception diff --git a/lib/include/srslte/phy/phch/uci_nr.h b/lib/include/srslte/phy/phch/uci_nr.h index 78ae55554..114c95aeb 100644 --- a/lib/include/srslte/phy/phch/uci_nr.h +++ b/lib/include/srslte/phy/phch/uci_nr.h @@ -114,6 +114,11 @@ SRSLTE_API int srslte_uci_nr_decode_pucch(srslte_uci_nr_t* q, int8_t* llr, srslte_uci_value_nr_t* value); +/** + * @brief Calculates the total number of UCI bits + * @param uci_cfg UCI configuration + * @return The number of total bits carrying HARQ ACK, CSI reports and SR bits + */ SRSLTE_API uint32_t srslte_uci_nr_total_bits(const srslte_uci_cfg_nr_t* uci_cfg); /** diff --git a/lib/include/srslte/phy/ue/ue_dl_nr.h b/lib/include/srslte/phy/ue/ue_dl_nr.h index dcfc568b3..218a4487e 100644 --- a/lib/include/srslte/phy/ue/ue_dl_nr.h +++ b/lib/include/srslte/phy/ue/ue_dl_nr.h @@ -19,7 +19,7 @@ #include "srslte/phy/phch/dci_nr.h" #include "srslte/phy/phch/pdcch_nr.h" #include "srslte/phy/phch/pdsch_nr.h" -#include +#include "srslte/phy/phch/uci_cfg_nr.h" /** * Maximum number of CORESET @@ -89,7 +89,7 @@ typedef struct { typedef struct { srslte_pdsch_ack_cc_nr_t cc[SRSLTE_MAX_CARRIERS]; uint32_t nof_cc; - bool use_pusch; // Ser to true, if UCI bits are carried by PUSCH + bool use_pusch; // Set to true, if UCI bits are carried by PUSCH } srslte_pdsch_ack_nr_t; typedef struct SRSLTE_API { diff --git a/lib/src/phy/phch/pucch_nr.c b/lib/src/phy/phch/pucch_nr.c index db9cbf7c4..6b2a2e57b 100644 --- a/lib/src/phy/phch/pucch_nr.c +++ b/lib/src/phy/phch/pucch_nr.c @@ -557,8 +557,7 @@ static int pucch_nr_format2_encode(srslte_pucch_nr_t* q, uint32_t l_end = resource->start_symbol_idx + resource->nof_symbols; uint32_t k_start = SRSLTE_MIN(carrier->nof_prb - 1, resource->starting_prb) * SRSLTE_NRE; uint32_t k_end = SRSLTE_MIN(carrier->nof_prb, resource->starting_prb + resource->nof_prb) * SRSLTE_NRE; - uint32_t i = 0; - for (uint32_t l = l_start; l < l_end; l++) { + for (uint32_t l = l_start, i = 0; l < l_end; l++) { cf_t* symbol_ptr = &slot_symbols[l * carrier->nof_prb * SRSLTE_NRE]; for (uint32_t k = k_start; k < k_end; k += 3) { symbol_ptr[k] = q->d[i++]; @@ -566,17 +565,6 @@ static int pucch_nr_format2_encode(srslte_pucch_nr_t* q, } } - if (i * 2 != E) { - ERROR("Unmatched number of channel bits (%d!=%d); rb=(%d,%d); sym=(%d,%d)\n", - E, - 2 * i, - k_start, - k_end, - l_start, - l_end); - return SRSLTE_ERROR; - } - return SRSLTE_SUCCESS; } diff --git a/lib/src/phy/ue/ue_dl_nr.c b/lib/src/phy/ue/ue_dl_nr.c index e2787c886..fa1d38177 100644 --- a/lib/src/phy/ue/ue_dl_nr.c +++ b/lib/src/phy/ue/ue_dl_nr.c @@ -639,7 +639,7 @@ int ue_dl_nr_pdsch_k1(const srslte_ue_dl_nr_harq_ack_cfg_t* cfg, const srslte_dc return SRSLTE_ERROR; } - return cfg->dl_data_to_ul_ack[dci_dl->harq_feedback]; + return (int)cfg->dl_data_to_ul_ack[dci_dl->harq_feedback]; } int srslte_ue_dl_nr_pdsch_ack_resource(const srslte_ue_dl_nr_harq_ack_cfg_t* cfg, @@ -684,8 +684,8 @@ int srslte_ue_dl_nr_gen_ack(const srslte_ue_dl_nr_harq_ack_cfg_t* cfg, } // According TS 38.213 9.1.3 Type-2 HARQ-ACK codebook determination - // This clause applies if the UE is configured with pdsch-HARQ-ACK-Codebook = dynamic. if (cfg->pdsch_harq_ack_codebook == srslte_pdsch_harq_ack_codebook_dynamic) { + // This clause applies if the UE is configured with pdsch-HARQ-ACK-Codebook = dynamic. return ue_dl_nr_gen_ack_type2(cfg, ack_info, uci_data); } diff --git a/srsue/src/phy/nr/cc_worker.cc b/srsue/src/phy/nr/cc_worker.cc index c7d8fef2c..9c194a152 100644 --- a/srsue/src/phy/nr/cc_worker.cc +++ b/srsue/src/phy/nr/cc_worker.cc @@ -333,6 +333,9 @@ bool cc_worker::work_ul() srslte_ue_ul_nr_pucch_info(&resource, &uci_data, str.data(), str.size()); logger.info("PUCCH: cc=%d, %s, tti_tx=%d", cc_idx, str.data(), ul_slot_cfg.idx); } + } else { + // No NR signal shall be transmitted + srslte_vec_cf_zero(tx_buffer[0], ue_ul.ifft.sf_sz); } return true;