From a53e7c9673f9733efe117391525d02fa97a1afe5 Mon Sep 17 00:00:00 2001 From: Carlo Galiotto Date: Fri, 14 Jan 2022 17:49:42 +0100 Subject: [PATCH] TMP WIP Signed-off-by: Carlo Galiotto --- lib/src/phy/phch/ra_ul_nr.c | 4 ++++ srsenb/src/phy/nr/slot_worker.cc | 4 ++++ srsgnb/src/stack/rrc/cell_asn1_config.cc | 7 +++++-- srsgnb/src/stack/rrc/rrc_nr.cc | 4 ++++ test/phy/nr_phy_test.cc | 11 +++++++++++ 5 files changed, 28 insertions(+), 2 deletions(-) diff --git a/lib/src/phy/phch/ra_ul_nr.c b/lib/src/phy/phch/ra_ul_nr.c index 92ff87088..443725ab6 100644 --- a/lib/src/phy/phch/ra_ul_nr.c +++ b/lib/src/phy/phch/ra_ul_nr.c @@ -619,6 +619,10 @@ int srsran_ra_ul_nr_pucch_resource(const srsran_pucch_nr_hl_cfg_t* pucch_cfg, return SRSRAN_SUCCESS; } + if (uci_cfg->ack.count > 0 && uci_cfg->nof_csi == 1 && uci_cfg->csi[0].cfg.type == SRSRAN_CSI_REPORT_TYPE_PERIODIC) { + printf("This is point where we fail"); + } + // If a UE does not have dedicated PUCCH resource configuration, provided by PUCCH-ResourceSet in PUCCH-Config, // a PUCCH resource set is provided by pucch-ResourceCommon through an index to a row of Table 9.2.1-1 for size // transmission of HARQ-ACK information on PUCCH in an initial UL BWP of N BWP PRBs. diff --git a/srsenb/src/phy/nr/slot_worker.cc b/srsenb/src/phy/nr/slot_worker.cc index 0dba28c1b..8735243b6 100644 --- a/srsenb/src/phy/nr/slot_worker.cc +++ b/srsenb/src/phy/nr/slot_worker.cc @@ -182,6 +182,10 @@ bool slot_worker::work_ul() for (uint32_t i = 0; i < (uint32_t)pucch.candidates.size(); i++) { pucch_info[i].uci_data.cfg = pucch.candidates[i].uci_cfg; + if (pucch_info[i].uci_data.cfg.nof_csi == 1 && pucch_info[i].uci_data.cfg.ack.count > 0) { + printf("Stop here"); + } + // Decode PUCCH if (srsran_gnb_ul_get_pucch(&gnb_ul, &ul_slot_cfg, diff --git a/srsgnb/src/stack/rrc/cell_asn1_config.cc b/srsgnb/src/stack/rrc/cell_asn1_config.cc index 812764660..a231b8267 100644 --- a/srsgnb/src/stack/rrc/cell_asn1_config.cc +++ b/srsgnb/src/stack/rrc/cell_asn1_config.cc @@ -641,8 +641,8 @@ void fill_pucch_cfg_from_enb_cfg(const rrc_nr_cfg_t& cfg, uint32_t cc, pucch_cfg uint32_t j = 0, j2 = 0; for (uint32_t i = 0; i < out.res_to_add_mod_list.size(); ++i) { out.res_to_add_mod_list[i].pucch_res_id = i; - out.res_to_add_mod_list[i].intra_slot_freq_hop_present = true; - out.res_to_add_mod_list[i].second_hop_prb_present = true; + out.res_to_add_mod_list[i].intra_slot_freq_hop_present = false; + out.res_to_add_mod_list[i].second_hop_prb_present = false; if (i < 8 or i == 16) { out.res_to_add_mod_list[i].start_prb = 51; out.res_to_add_mod_list[i].second_hop_prb = 0; @@ -675,6 +675,9 @@ void fill_pucch_cfg_from_enb_cfg(const rrc_nr_cfg_t& cfg, uint32_t cc, pucch_cfg out.format2.set_setup(); out.format2.setup().max_code_rate_present = true; out.format2.setup().max_code_rate = pucch_max_code_rate_opts::zero_dot25; + // NOTE: IMPORTANT!! The gNB expects the CSI to be reported along with HARQ-ACK + // If simul_harq_ack_csi_present = false, PUCCH might not be decoded properly when CSI is reported + out.format2.setup().simul_harq_ack_csi_present = true; // SR resources out.sched_request_res_to_add_mod_list.resize(1); diff --git a/srsgnb/src/stack/rrc/rrc_nr.cc b/srsgnb/src/stack/rrc/rrc_nr.cc index 676ba17b7..30371d011 100644 --- a/srsgnb/src/stack/rrc/rrc_nr.cc +++ b/srsgnb/src/stack/rrc/rrc_nr.cc @@ -342,10 +342,14 @@ void rrc_nr::config_mac() cell.ssb_scs = serv_cell.ssb_subcarrier_spacing; } else { cell.bwps[0].pdsch.p_zp_csi_rs_set = {}; + bzero(cell.bwps[0].pdsch.nzp_csi_rs_sets, sizeof(cell.bwps[0].pdsch.nzp_csi_rs_sets)); cell.ssb_positions_in_burst = du_cfg->cell(cc).serv_cell_cfg_common().ssb_positions_in_burst; cell.ssb_periodicity_ms = du_cfg->cell(cc).serv_cell_cfg_common().ssb_periodicity_serving_cell.to_number(); cell.ssb_scs.value = (subcarrier_spacing_e::options)cfg.cell_list[0].phy_cell.carrier.scs; + // bzero(cell.bwps[0].pdsch.nzp_csi_rs_sets, sizeof(cell.bwps[0].pdsch.nzp_csi_rs_sets)); + bool valid_cfg = srsran::make_pdsch_cfg_from_serv_cell(base_sp_cell_cfg.sp_cell_cfg_ded, &cell.bwps[0].pdsch); + srsran_assert(valid_cfg, "Invalid NR cell configuration."); } // Set SIB1 and SI messages diff --git a/test/phy/nr_phy_test.cc b/test/phy/nr_phy_test.cc index 2d163128e..bf9247106 100644 --- a/test/phy/nr_phy_test.cc +++ b/test/phy/nr_phy_test.cc @@ -171,6 +171,17 @@ test_bench::args_t::args_t(int argc, char** argv) // Load default reference configuration phy_cfg = srsran::phy_cfg_nr_default_t(srsran::phy_cfg_nr_default_t::reference_cfg_t(reference_cfg_str)); +#if 0 + // configure nzp + auto& uecfg_set_0 = phy_cfg.pdsch.nzp_csi_rs_sets[0]; + uecfg_set_0.trs_info = true; + uecfg_set_0.count = 1; + + auto& res_0 = uecfg_set_0.data[0]; + res_0.id = 0; + res_0.resource_mapping.row = srsran_csi_rs_resource_mapping_row_2; +#endif + // Calculate the DL signal power from the number of PRBs dl_channel.awgn_signal_power_dBfs = srsran_gnb_dl_get_maximum_signal_power_dBfs(phy_cfg.carrier.nof_prb);