NR Added CSI measurement channel processing

This commit is contained in:
Xavier Arteaga 2021-05-04 20:50:25 +02:00 committed by Xavier Arteaga
parent c51ff0c9f9
commit e68c822505
6 changed files with 123 additions and 7 deletions

View File

@ -15,12 +15,18 @@
#include "uci_cfg_nr.h"
SRSRAN_API int
srsran_csi_new_nzp_csi_rs_measurement(const srsran_csi_hl_resource_cfg_t csi_resources[SRSRAN_CSI_MAX_NOF_RESOURCES],
srsran_csi_measurements_t measurements[SRSRAN_CSI_MAX_NOF_RESOURCES],
const srsran_csi_measurements_t* new_measure,
uint32_t nzp_csi_rs_id);
/**
* @brief Fills Uplink Control Information data with triggered reports for the given slot
* @param cfg CSI report configuration
* @brief Generates CSI report configuration and values from the higher layer configuration and a list of measurements
* @param cfg Higher layer report configuration
* @param slot_idx Slot index within the radio frame
* @param measurements CSI measurements
* @param[out] uci_data Uplink Control Information data
* @param measurements Filtered CSI measurements
* @param[out] report_cfg Report configuration re
* @return The number CSI reports for transmission if the provided data is valid, SRSRAN_ERROR code otherwise
*/
SRSRAN_API int srsran_csi_generate_reports(const srsran_csi_hl_cfg_t* cfg,

View File

@ -27,6 +27,22 @@
*/
#define SRSRAN_CSI_MAX_NOF_RESOURCES 112
/**
* @brief Maximum number of NZP-CSI-RS resources sets per config, defined in TS 38.331
* maxNrofNZP-CSI-RS-ResourceSetsPerConfig
*/
#define SRSRAN_CSI_MAX_NOF_NZP_CSI_RS_RESOURCE_SETS_X_CONFIG 16
/**
* @brief Maximum number of CSI-SSB resources sets per config, defined in TS 38.331 maxNrofCSI-SSB-ResourceSetsPerConfig
*/
#define SRSRAN_CSI_MAX_NOF_CSI_SSB_RESOURCE_SETS_X_CONFIG 1
/**
* @brief Maximum number of CSI-SSB resources sets per config, defined in TS 38.331 maxNrofCSI-IM-ResourceSetsPerConfig
*/
#define SRSRAN_CSI_MAX_NOF_CSI_IM_RESOURCE_SETS_X_CONFIG 12
/**
* @brief CSI report types defined in TS 38.331 CSI-ReportConfig
*/
@ -97,16 +113,41 @@ typedef struct SRSRAN_API {
srsran_csi_report_freq_t freq_cfg; ///< Determine whether it is wideband or subband
} srsran_csi_hl_report_cfg_t;
/**
* @brief CSI Resource configuration
*/
typedef struct SRSRAN_API {
enum {
SRSRAN_CSI_HL_RESOURCE_CFG_TYPE_NONE = 0,
SRSRAN_CSI_HL_RESOURCE_CFG_TYPE_NZP_CSI_RS_SSB,
SRSRAN_CSI_HL_RESOURCE_CFG_TYPE_IM
} type;
union {
struct {
uint32_t nzp_csi_rs_resource_set_id_list[SRSRAN_CSI_MAX_NOF_NZP_CSI_RS_RESOURCE_SETS_X_CONFIG];
uint32_t nzp_csi_rs_resource_set_id_list_count;
uint32_t csi_ssb_rs_resource_set_id_list[SRSRAN_CSI_MAX_NOF_CSI_SSB_RESOURCE_SETS_X_CONFIG];
uint32_t csi_ssb_rs_resource_set_id_list_count;
} nzp_csi_rs_ssb;
struct {
uint32_t resource_set_id_list[SRSRAN_CSI_MAX_NOF_CSI_IM_RESOURCE_SETS_X_CONFIG];
uint32_t resource_set_id_list_count;
} csi_im;
};
} srsran_csi_hl_resource_cfg_t;
/**
* @brief General CSI configuration provided by higher layers
*/
typedef struct SRSRAN_API {
srsran_csi_hl_report_cfg_t reports[SRSRAN_CSI_MAX_NOF_REPORT]; ///< CSI report configuration
// ... add here physical CSI measurement sets
srsran_csi_hl_report_cfg_t reports[SRSRAN_CSI_MAX_NOF_REPORT]; ///< CSI report configuration indexed by
///< reportConfigId
srsran_csi_hl_resource_cfg_t csi_resources[SRSRAN_CSI_MAX_NOF_RESOURCES]; ///< Configured CSI resource settings,
///< indexed by csi-ResourceConfigId
} srsran_csi_hl_cfg_t;
/**
* @brief Generic measurement structure
* @brief Generic CSI measurement structure
*/
typedef struct SRSRAN_API {
uint32_t cri; ///< CSI-RS Resource Indicator

View File

@ -13,9 +13,11 @@
#ifndef SRSRAN_UE_DL_NR_H
#define SRSRAN_UE_DL_NR_H
#include "srsran/phy/ch_estimation/csi_rs.h"
#include "srsran/phy/ch_estimation/dmrs_pdcch.h"
#include "srsran/phy/common/phy_common_nr.h"
#include "srsran/phy/dft/ofdm.h"
#include "srsran/phy/phch/csi.h"
#include "srsran/phy/phch/dci_nr.h"
#include "srsran/phy/phch/pdcch_cfg_nr.h"
#include "srsran/phy/phch/pdcch_nr.h"
@ -171,4 +173,10 @@ SRSRAN_API int srsran_ue_dl_nr_ack_insert_m(srsran_pdsch_ack_nr_t* ack_info, srs
SRSRAN_API uint32_t srsran_ue_dl_nr_ack_info(const srsran_pdsch_ack_nr_t* ack_info, char* str, uint32_t str_len);
SRSRAN_API
int srsran_ue_dl_nr_csi_measure(const srsran_ue_dl_nr_t* q,
const srsran_slot_cfg_t* slot_cfg,
const srsran_csi_rs_nzp_set_t* csi_rs_nzp_set,
srsran_csi_measurements_t* measurement);
#endif // SRSRAN_UE_DL_NR_H

View File

@ -39,6 +39,7 @@ extern "C" {
#include "srsran/phy/ch_estimation/chest_dl.h"
#include "srsran/phy/ch_estimation/chest_ul.h"
#include "srsran/phy/ch_estimation/csi_rs.h"
#include "srsran/phy/ch_estimation/dmrs_pdcch.h"
#include "srsran/phy/ch_estimation/dmrs_sch.h"
#include "srsran/phy/ch_estimation/refsignal_dl.h"

View File

@ -17,6 +17,8 @@
#define CSI_WIDEBAND_CSI_NOF_BITS 4
#define CSI_DEFAULT_ALPHA 0.5f
/// Implements SNRI to CQI conversion
uint32_t csi_snri_db_to_cqi(srsran_csi_cqi_table_t table, float snri_db)
{
@ -142,6 +144,52 @@ csi_none_unpack(const srsran_csi_report_cfg_t* cfg, const uint8_t* o_csi1, srsra
return cfg->K_csi_rs;
}
int srsran_csi_new_nzp_csi_rs_measurement(
const srsran_csi_hl_resource_cfg_t csi_resources[SRSRAN_CSI_MAX_NOF_RESOURCES],
srsran_csi_measurements_t measurements[SRSRAN_CSI_MAX_NOF_RESOURCES],
const srsran_csi_measurements_t* new_measure,
uint32_t nzp_csi_rs_id)
{
if (csi_resources == NULL || measurements == NULL || new_measure == NULL) {
return SRSRAN_ERROR_INVALID_INPUTS;
}
// Iterate all resources
for (uint32_t res_idx = 0; res_idx < SRSRAN_CSI_MAX_NOF_RESOURCES; res_idx++) {
// Skip resource is set to none
if (csi_resources[res_idx].type != SRSRAN_CSI_HL_RESOURCE_CFG_TYPE_NZP_CSI_RS_SSB) {
continue;
}
// Look for the NZP-CSI reource set
bool present = false;
for (uint32_t i = 0; i < SRSRAN_CSI_MAX_NOF_NZP_CSI_RS_RESOURCE_SETS_X_CONFIG && !present; i++) {
if (csi_resources[res_idx].nzp_csi_rs_ssb.nzp_csi_rs_resource_set_id_list[i] == nzp_csi_rs_id) {
present = true;
}
}
// Skip Resource if it does not contain the NZP-CSI-RS set
if (!present) {
continue;
}
// Filter measurements
measurements[res_idx].wideband_rsrp_dBm =
SRSRAN_VEC_SAFE_EMA(new_measure->wideband_rsrp_dBm, measurements[res_idx].wideband_rsrp_dBm, CSI_DEFAULT_ALPHA);
measurements[res_idx].wideband_epre_dBm =
SRSRAN_VEC_SAFE_EMA(new_measure->wideband_epre_dBm, measurements[res_idx].wideband_epre_dBm, CSI_DEFAULT_ALPHA);
measurements[res_idx].wideband_snr_db =
SRSRAN_VEC_SAFE_EMA(new_measure->wideband_snr_db, measurements[res_idx].wideband_snr_db, CSI_DEFAULT_ALPHA);
// Force rest
measurements[res_idx].cri = new_measure->cri;
measurements[res_idx].K_csi_rs = new_measure->K_csi_rs;
}
return SRSRAN_SUCCESS;
}
int srsran_csi_generate_reports(const srsran_csi_hl_cfg_t* cfg,
uint32_t slot_idx,
const srsran_csi_measurements_t measurements[SRSRAN_CSI_MAX_NOF_RESOURCES],

View File

@ -838,3 +838,15 @@ uint32_t srsran_ue_dl_nr_ack_info(const srsran_pdsch_ack_nr_t* ack_info, char* s
return len;
}
int srsran_ue_dl_nr_csi_measure(const srsran_ue_dl_nr_t* q,
const srsran_slot_cfg_t* slot_cfg,
const srsran_csi_rs_nzp_set_t* csi_rs_nzp_set,
srsran_csi_measurements_t* measurement)
{
if (q == NULL || slot_cfg == NULL || csi_rs_nzp_set == NULL || measurement == NULL) {
return SRSRAN_ERROR_INVALID_INPUTS;
}
return srsran_csi_rs_nzp_measure_channel(&q->carrier, slot_cfg, csi_rs_nzp_set, q->sf_symbols[0], measurement);
}