|
|
@ -544,17 +544,37 @@ static int cqi_hl_get_bwp_J(int nof_prb)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (nof_prb < 7) {
|
|
|
|
if (nof_prb < 7) {
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
} else if (nof_prb <= 10) {
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
} else if (nof_prb <= 26) {
|
|
|
|
} else if (nof_prb <= 26) {
|
|
|
|
return 4;
|
|
|
|
return 2;
|
|
|
|
} else if (nof_prb <= 63) {
|
|
|
|
} else if (nof_prb <= 63) {
|
|
|
|
return 6;
|
|
|
|
return 3;
|
|
|
|
} else if (nof_prb <= 110) {
|
|
|
|
} else if (nof_prb <= 63) {
|
|
|
|
return 8;
|
|
|
|
return 4;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Returns the number of subbands in the j-th bandwidth part
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
int srsran_cqi_sb_get_Nj(uint32_t j, uint32_t nof_prb)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
uint32_t J = cqi_hl_get_bwp_J(nof_prb);
|
|
|
|
|
|
|
|
if (J == 1) {
|
|
|
|
|
|
|
|
return (uint32_t)ceil((float)nof_prb / cqi_hl_get_subband_size(nof_prb));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// all bw parts have the same number of subbands except the last one
|
|
|
|
|
|
|
|
uint32_t Nj = (uint32_t)ceil((float)nof_prb / cqi_hl_get_subband_size(nof_prb) / J);
|
|
|
|
|
|
|
|
if (j < J - 1) {
|
|
|
|
|
|
|
|
return Nj;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return Nj - 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Returns the number of bits to index a bandwidth part (L)
|
|
|
|
/* Returns the number of bits to index a bandwidth part (L)
|
|
|
|
* L = ceil(log2(nof_prb/k/J))
|
|
|
|
* L = ceil(log2(nof_prb/k/J))
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -574,19 +594,51 @@ bool srsran_cqi_periodic_send(const srsran_cqi_report_cfg_t* cfg, uint32_t tti,
|
|
|
|
return cfg->periodic_configured && cqi_send(cfg->pmi_idx, tti, frame_type == SRSRAN_FDD, 1);
|
|
|
|
return cfg->periodic_configured && cqi_send(cfg->pmi_idx, tti, frame_type == SRSRAN_FDD, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t cqi_sb_get_H(const srsran_cqi_report_cfg_t* cfg, uint32_t nof_prb)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
uint32_t K = cfg->subband_wideband_ratio;
|
|
|
|
|
|
|
|
uint32_t J = cqi_hl_get_bwp_J(nof_prb);
|
|
|
|
|
|
|
|
uint32_t H = J * K + 1;
|
|
|
|
|
|
|
|
return H;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool srsran_cqi_periodic_is_subband(const srsran_cqi_report_cfg_t* cfg,
|
|
|
|
bool srsran_cqi_periodic_is_subband(const srsran_cqi_report_cfg_t* cfg,
|
|
|
|
uint32_t tti,
|
|
|
|
uint32_t tti,
|
|
|
|
uint32_t nof_prb,
|
|
|
|
uint32_t nof_prb,
|
|
|
|
srsran_frame_type_t frame_type)
|
|
|
|
srsran_frame_type_t frame_type)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
uint32_t K = cfg->subband_wideband_ratio;
|
|
|
|
uint32_t H = cqi_sb_get_H(cfg, nof_prb);
|
|
|
|
uint32_t J = cqi_hl_get_bwp_J(nof_prb);
|
|
|
|
|
|
|
|
uint32_t H = J * K + 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// A periodic report is subband if it's a CQI opportunity and is not wideband
|
|
|
|
// A periodic report is subband if it's a CQI opportunity and is not wideband
|
|
|
|
return srsran_cqi_periodic_send(cfg, tti, frame_type) && !cqi_send(cfg->pmi_idx, tti, frame_type == SRSRAN_FDD, H);
|
|
|
|
return srsran_cqi_periodic_send(cfg, tti, frame_type) && !cqi_send(cfg->pmi_idx, tti, frame_type == SRSRAN_FDD, H);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t srsran_cqi_periodic_sb_bw_part_idx(const srsran_cqi_report_cfg_t* cfg,
|
|
|
|
|
|
|
|
uint32_t tti,
|
|
|
|
|
|
|
|
uint32_t nof_prb,
|
|
|
|
|
|
|
|
srsran_frame_type_t frame_type)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
uint32_t H = cqi_sb_get_H(cfg, nof_prb);
|
|
|
|
|
|
|
|
uint32_t N_p = 0, N_offset = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (frame_type == SRSRAN_FDD) {
|
|
|
|
|
|
|
|
if (!cqi_get_N_fdd(cfg->pmi_idx, &N_p, &N_offset)) {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (!cqi_get_N_tdd(cfg->pmi_idx, &N_p, &N_offset)) {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t x = ((tti - N_offset) / N_p) % H;
|
|
|
|
|
|
|
|
if (x > 0) {
|
|
|
|
|
|
|
|
return (x - 1) % cqi_hl_get_bwp_J(nof_prb);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// CQI-to-Spectral Efficiency: 36.213 Table 7.2.3-1
|
|
|
|
// CQI-to-Spectral Efficiency: 36.213 Table 7.2.3-1
|
|
|
|
static float cqi_to_coderate[16] = {0,
|
|
|
|
static float cqi_to_coderate[16] = {0,
|
|
|
|
0.1523,
|
|
|
|
0.1523,
|
|
|
|