SRSUE: NR CSI report fixes

master
Xavier Arteaga 4 years ago committed by Xavier Arteaga
parent 4679e9f871
commit 784f4be72e

@ -599,8 +599,16 @@ struct phy_cfg_nr_t {
// disabled
// cqi-Table: table2 (1)
// subbandSize: value1 (0)
csi.reports[0].type = SRSLTE_CSI_REPORT_TYPE_PERIODIC;
csi.reports[0].periodic.resource = pucch_res_17;
csi.reports[0].type = SRSLTE_CSI_REPORT_TYPE_PERIODIC;
csi.reports[0].channel_meas_id = 0;
csi.reports[0].interf_meas_present = true;
csi.reports[0].interf_meas_id = 1;
csi.reports[0].periodic.period = 80;
csi.reports[0].periodic.offset = 9;
csi.reports[0].periodic.resource = pucch_res_17;
csi.reports[0].quantity = SRSLTE_CSI_REPORT_QUANTITY_CRI_RI_PMI_CQI;
csi.reports[0].freq_cfg = SRSLTE_CSI_REPORT_FREQ_WIDEBAND;
csi.reports[0].cqi_table = SRSLTE_CSI_CQI_TABLE_2;
}
};
} // namespace srslte

@ -289,8 +289,8 @@ static uint32_t dmrs_pucch_format2_cinit(const srslte_carrier_nr_t* car
const srslte_slot_cfg_t* slot,
uint32_t l)
{
uint32_t n = SRSLTE_SLOT_NR_MOD(slot->idx, carrier->numerology);
uint32_t n_id = (cfg->scrambling_id_present) ? cfg->scambling_id : carrier->id;
uint64_t n = slot->idx;
uint64_t n_id = (cfg->scrambling_id_present) ? cfg->scambling_id : carrier->id;
return SRSLTE_SEQUENCE_MOD((((SRSLTE_NSYMB_PER_SLOT_NR * n + l + 1UL) * (2UL * n_id + 1UL)) << 17UL) + 2UL * n_id);
}

@ -19,7 +19,7 @@
/// Implements SNRI to CQI conversion
uint32_t csi_snri_db_to_cqi(srslte_csi_cqi_table_t table, float snri_db)
{
return 15;
return 6;
}
// Implements CSI report triggers
@ -67,18 +67,15 @@ static void csi_wideband_cri_ri_pmi_cqi_quantify(const srslte_csi_hl_report_cfg_
static uint32_t csi_wideband_cri_ri_pmi_cqi_nof_bits(const srslte_csi_report_cfg_t* cfg)
{
// Avoid K_csi_rs invalid value
if (cfg->K_csi_rs == 0) {
ERROR("Invalid K_csi_rs=%d", cfg->K_csi_rs);
return 0;
}
// Compute number of bits for CRI
uint32_t nof_bits_cri = (uint32_t)ceilf(log2f((float)cfg->K_csi_rs));
uint32_t nof_bits_cri = 0;
if (cfg->K_csi_rs > 0) {
nof_bits_cri = (uint32_t)ceilf(log2f((float)cfg->K_csi_rs));
}
switch (cfg->nof_ports) {
case 1:
return SRSLTE_CSI_REPORT_FREQ_WIDEBAND + nof_bits_cri;
return CSI_WIDEBAND_CSI_NOF_BITS + nof_bits_cri;
default:
ERROR("Invalid or not implemented number of ports (%d)", cfg->nof_ports);
}
@ -89,17 +86,16 @@ static int csi_wideband_cri_ri_pmi_cqi_pack(const srslte_csi_report_cfg_t* cfg
const srslte_csi_report_value_t* value,
uint8_t* o_csi1)
{
// Avoid K_csi_rs invalid value
if (cfg->K_csi_rs == 0) {
ERROR("Invalid K_csi_rs=%d", cfg->K_csi_rs);
return SRSLTE_ERROR;
// Compute number of bits for CRI
uint32_t nof_bits_cri = 0;
if (cfg->K_csi_rs > 0) {
nof_bits_cri = (uint32_t)ceilf(log2f((float)cfg->K_csi_rs));
}
// Write wideband CQI
srslte_bit_unpack(value->wideband_cri_ri_pmi_cqi.cqi, &o_csi1, CSI_WIDEBAND_CSI_NOF_BITS);
// Compute number of bits for CRI and write
uint32_t nof_bits_cri = (uint32_t)ceilf(log2f((float)cfg->K_csi_rs));
srslte_bit_unpack(value->cri, &o_csi1, nof_bits_cri);
return nof_bits_cri + CSI_WIDEBAND_CSI_NOF_BITS;
@ -214,5 +210,12 @@ uint32_t srslte_csi_str(const srslte_csi_report_cfg_t* report_cfg,
char* str,
uint32_t str_len)
{
return srslte_print_check(str, str_len, 0, "cqi=%s", report_value->wideband_cri_ri_pmi_cqi.cqi);
uint32_t len = 0;
for (uint32_t i = 0; i < nof_reports; i++) {
if (report_cfg[i].freq_cfg == SRSLTE_CSI_REPORT_FREQ_WIDEBAND &&
report_cfg[i].quantity == SRSLTE_CSI_REPORT_QUANTITY_CRI_RI_PMI_CQI) {
len = srslte_print_check(str, str_len, len, ", cqi=%d", report_value[i].wideband_cri_ri_pmi_cqi.cqi);
}
}
return len;
}

@ -482,13 +482,22 @@ int srslte_ra_ul_nr_pucch_resource(const srslte_pucch_nr_hl_cfg_t* pucch_cfg,
}
// Use format 2, 3 or 4 resource from higher layers
// - K SR opportunities
// - Irrelevant SR opportunities
// - More than 2 HARQ-ACK
// - No CSI report
if (uci_cfg->o_sr > 0 && uci_cfg->o_ack > SRSLTE_PUCCH_NR_FORMAT1_MAX_NOF_BITS && uci_cfg->nof_csi == 0) {
return ra_ul_nr_pucch_resource_hl(pucch_cfg, O_uci, uci_cfg->pucch_resource_id, resource);
}
// Use format 2, 3 or 4 CSI report resource from higher layers
// - Irrelevant SR opportunities
// - No HARQ-ACK
// - Single periodic CSI report
if (uci_cfg->o_ack == 0 && uci_cfg->nof_csi == 1 && uci_cfg->csi[0].type == SRSLTE_CSI_REPORT_TYPE_PERIODIC) {
*resource = uci_cfg->csi[0].pucch_resource;
return SRSLTE_SUCCESS;
}
// 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.

@ -798,7 +798,7 @@ uint32_t srslte_uci_nr_total_bits(const srslte_uci_cfg_nr_t* uci_cfg)
return 0;
}
return uci_cfg->o_ack + srslte_csi_nof_bits(uci_cfg->csi, uci_cfg->nof_csi);
return uci_cfg->o_ack + uci_cfg->o_sr + srslte_csi_nof_bits(uci_cfg->csi, uci_cfg->nof_csi);
}
uint32_t srslte_uci_nr_info(const srslte_uci_data_nr_t* uci_data, char* str, uint32_t str_len)

@ -56,8 +56,12 @@ private:
public:
mac_interface_phy_nr* stack = nullptr;
srslte_carrier_nr_t carrier = {};
srslte::phy_cfg_nr_t cfg;
phy_args_nr_t args;
/// Physical layer user configuration
phy_args_nr_t args = {};
/// Physical layer higher layer configuration, provided by higher layers through configuration messages
srslte::phy_cfg_nr_t cfg = {};
uint16_t ra_rnti = 0;
uint32_t rar_grant_tti = 0;
@ -70,7 +74,9 @@ public:
// Hard-coded values, this should be set when the measurements take place
csi_measurements[0].K_csi_rs = 1;
csi_measurements[0].nof_ports = 1;
csi_measurements[1].K_csi_rs = 4;
csi_measurements[0].nof_ports = 1;
}
/**
@ -262,10 +268,17 @@ public:
// Calculate all SR opportunities in the given TTI
uint32_t sr_resource_id[SRSLTE_PUCCH_MAX_NOF_SR_RESOURCES] = {};
int sr_count_all = srslte_ue_ul_nr_sr_send_slot(cfg.pucch.sr_resources, tti, sr_resource_id);
int n = srslte_ue_ul_nr_sr_send_slot(cfg.pucch.sr_resources, tti, sr_resource_id);
if (n < SRSLTE_SUCCESS) {
ERROR("Calculating SR opportunities");
return;
}
// Initialise counters
uint32_t sr_count_all = (uint32_t)n;
uint32_t sr_count_positive = 0;
// Iterate all opportunities
// Iterate all opportunities and check if there is a pending SR
for (uint32_t i = 0; i < sr_count_all; i++) {
// Extract SR identifier
uint32_t sr_id = cfg.pucch.sr_resources[sr_resource_id[i]].sr_id;
@ -293,6 +306,8 @@ public:
if (n > SRSLTE_SUCCESS) {
uci_data.cfg.nof_csi = n;
}
uci_data.cfg.rnti = stack->get_ul_sched_rnti_nr(tti).id;
}
};
} // namespace nr

Loading…
Cancel
Save