Fixed Aperiodic reporting RM31 for TM4 (Amarisoft proof)

master
Xavier Arteaga 7 years ago
parent 808e3a532b
commit 0299e9aae1

@ -43,6 +43,7 @@
#define SRSLTE_CQI_MAX_BITS 64 #define SRSLTE_CQI_MAX_BITS 64
#define SRSLTE_DIF_CQI_MAX_BITS 3 #define SRSLTE_DIF_CQI_MAX_BITS 3
#define SRSLTE_PMI_MAX_BITS 4 #define SRSLTE_PMI_MAX_BITS 4
#define SRSLTE_CQI_STR_MAX_CHAR 32
typedef struct { typedef struct {
bool configured; bool configured;

@ -456,8 +456,16 @@ int srslte_cqi_hl_get_no_subbands(int nof_prb)
void srslte_cqi_to_str(const uint8_t *cqi_value, int cqi_len, char *str, int str_len) { void srslte_cqi_to_str(const uint8_t *cqi_value, int cqi_len, char *str, int str_len) {
int i = 0; int i = 0;
for (i = 0; i < cqi_len && i < (str_len - 1); i++) {
for (i = 0; i < cqi_len && i < (str_len - 5); i++) {
str[i] = (cqi_value[i] == 0)?(char)'0':(char)'1'; str[i] = (cqi_value[i] == 0)?(char)'0':(char)'1';
} }
if (i == (str_len - 5)) {
str[i++] = '.';
str[i++] = '.';
str[i++] = '.';
str[i++] = (cqi_value[cqi_len - 1] == 0)?(char)'0':(char)'1';
}
str[i] = '\0'; str[i] = '\0';
} }

@ -551,7 +551,7 @@ int phch_worker::decode_pusch(srslte_enb_ul_pusch_t *grants, uint32_t nof_pusch)
ue_db[rnti].phich_info.n_prb_lowest = enb_ul.pusch_cfg.grant.n_prb_tilde[0]; ue_db[rnti].phich_info.n_prb_lowest = enb_ul.pusch_cfg.grant.n_prb_tilde[0];
ue_db[rnti].phich_info.n_dmrs = phy_grant.ncs_dmrs; ue_db[rnti].phich_info.n_dmrs = phy_grant.ncs_dmrs;
char cqi_str[64]; char cqi_str[SRSLTE_CQI_STR_MAX_CHAR];
if (cqi_enabled) { if (cqi_enabled) {
if (ue_db[rnti].cqi_en) { if (ue_db[rnti].cqi_en) {
wideband_cqi_value = cqi_value.wideband.wideband_cqi; wideband_cqi_value = cqi_value.wideband.wideband_cqi;
@ -578,7 +578,7 @@ int phch_worker::decode_pusch(srslte_enb_ul_pusch_t *grants, uint32_t nof_pusch)
cqi_value.subband_hl.wideband_cqi_cw0, cqi_value.subband_hl.N); cqi_value.subband_hl.wideband_cqi_cw0, cqi_value.subband_hl.N);
} }
} }
srslte_cqi_to_str(uci_data.uci_cqi, uci_data.uci_cqi_len, cqi_str, 64); srslte_cqi_to_str(uci_data.uci_cqi, uci_data.uci_cqi_len, cqi_str, SRSLTE_CQI_STR_MAX_CHAR);
//snprintf(cqi_str, 64, ", cqi=%s", wideband_cqi_value); //snprintf(cqi_str, 64, ", cqi=%s", wideband_cqi_value);
} }

@ -399,13 +399,14 @@ void phch_worker::compute_ri(uint8_t *ri, uint8_t *pmi, float *sinr) {
Debug("TM3 RI select %d layers, κ=%fdB\n", (*ri) + 1, cn); Debug("TM3 RI select %d layers, κ=%fdB\n", (*ri) + 1, cn);
} else { } else {
/* If only one receiving antenna, force RI for 1 layer */ /* If only one receiving antenna, force RI for 1 layer */
uci_data.uci_ri = 0; if (ri) {
*ri = 0;
}
} }
uci_data.uci_ri_len = 1; uci_data.uci_ri_len = 1;
} else if (phy->config->dedicated.antenna_info_explicit_value.tx_mode == LIBLTE_RRC_TRANSMISSION_MODE_4) { } else if (phy->config->dedicated.antenna_info_explicit_value.tx_mode == LIBLTE_RRC_TRANSMISSION_MODE_4) {
srslte_ue_dl_ri_pmi_select(&ue_dl, ri, pmi, sinr); srslte_ue_dl_ri_pmi_select(&ue_dl, ri, pmi, sinr);
Debug("TM4 ri=%d; pmi=%d; SINR=%.1fdB\n", ue_dl.ri, ue_dl.pmi[ue_dl.ri], 10*log10f(ue_dl.sinr[ue_dl.ri][ue_dl.pmi[ue_dl.ri]])); Debug("TM4 ri=%d; pmi=%d; SINR=%.1fdB\n", ue_dl.ri, ue_dl.pmi[ue_dl.ri], 10*log10f(ue_dl.sinr[ue_dl.ri][ue_dl.pmi[ue_dl.ri]]));
uci_data.uci_ri_len = 1;
} }
} }
@ -906,11 +907,11 @@ void phch_worker::set_uci_aperiodic_cqi()
{ {
uint8_t ri = (uint8_t) ue_dl.ri; uint8_t ri = (uint8_t) ue_dl.ri;
uint8_t pmi = (uint8_t) ue_dl.pmi[ri]; uint8_t pmi = (uint8_t) ue_dl.pmi[ri];
float sinr = ue_dl.sinr[ri][pmi]; float sinr_db = ue_dl.sinr[ri][pmi];
if (phy->config->dedicated.cqi_report_cnfg.report_mode_aperiodic_present) { if (phy->config->dedicated.cqi_report_cnfg.report_mode_aperiodic_present) {
/* Compute RI, PMI and SINR */ /* Compute RI, PMI and SINR */
compute_ri(&ri, &pmi, &sinr); compute_ri(&ri, &pmi, &sinr_db);
switch(phy->config->dedicated.cqi_report_cnfg.report_mode_aperiodic) { switch(phy->config->dedicated.cqi_report_cnfg.report_mode_aperiodic) {
case LIBLTE_RRC_CQI_REPORT_MODE_APERIODIC_RM30: case LIBLTE_RRC_CQI_REPORT_MODE_APERIODIC_RM30:
@ -930,18 +931,24 @@ void phch_worker::set_uci_aperiodic_cqi()
// TODO: implement subband CQI properly // TODO: implement subband CQI properly
cqi_report.subband_hl.subband_diff_cqi_cw0 = 0; // Always report zero offset on all subbands cqi_report.subband_hl.subband_diff_cqi_cw0 = 0; // Always report zero offset on all subbands
cqi_report.subband_hl.N = (cell.nof_prb > 7) ? srslte_cqi_hl_get_no_subbands(cell.nof_prb) : 0; cqi_report.subband_hl.N = (cell.nof_prb > 7) ? (uint32_t) srslte_cqi_hl_get_no_subbands(cell.nof_prb) : 0;
uci_data.uci_cqi_len = srslte_cqi_value_pack(&cqi_report, uci_data.uci_cqi); int cqi_len = srslte_cqi_value_pack(&cqi_report, uci_data.uci_cqi);
if (cqi_len < 0) {
Error("Error packing CQI value (Aperiodic reporting mode RM31).");
return;
}
uci_data.uci_cqi_len = (uint32_t) cqi_len;
char cqi_str[64] = {0}; char cqi_str[SRSLTE_CQI_STR_MAX_CHAR] = {0};
srslte_cqi_to_str(uci_data.uci_cqi, uci_data.uci_cqi_len, cqi_str, 64); srslte_cqi_to_str(uci_data.uci_cqi, uci_data.uci_cqi_len, cqi_str, SRSLTE_CQI_STR_MAX_CHAR);
Info("PUSCH: Aperiodic CQI=%s, SNR=%.1f dB, for %d subbands\n", cqi_str, phy->avg_snr_db, cqi_report.subband_hl.N); /* Set RI = 1 */
uci_data.uci_ri = ri;
uci_data.uci_ri_len = 1;
/* Fake RI = 1 */ Info("PUSCH: Aperiodic RM30 ri%s, CQI=%s, SNR=%.1f dB, for %d subbands\n",
uci_data.uci_ri = 0; (uci_data.uci_ri == 0)?"=1":"~1", cqi_str, phy->avg_snr_db, cqi_report.subband_hl.N);
uci_data.uci_ri_len = 0;
} }
break; break;
case LIBLTE_RRC_CQI_REPORT_MODE_APERIODIC_RM31: case LIBLTE_RRC_CQI_REPORT_MODE_APERIODIC_RM31:
@ -957,11 +964,6 @@ void phch_worker::set_uci_aperiodic_cqi()
other transmission modes they are reported conditioned on rank 1. other transmission modes they are reported conditioned on rank 1.
*/ */
if (rnti_is_set) { if (rnti_is_set) {
/* Select RI, PMI and SINR */
uint32_t ri = ue_dl.ri; // Select RI (0: 1 layer, 1: 2 layer, otherwise: not implemented)
uint32_t pmi = ue_dl.pmi[ri]; // Select PMI
float sinr_db = 10 * log10(ue_dl.sinr[ri][pmi]);
/* Fill CQI Report */ /* Fill CQI Report */
srslte_cqi_value_t cqi_report = {0}; srslte_cqi_value_t cqi_report = {0};
cqi_report.type = SRSLTE_CQI_TYPE_SUBBAND_HL; cqi_report.type = SRSLTE_CQI_TYPE_SUBBAND_HL;
@ -982,17 +984,24 @@ void phch_worker::set_uci_aperiodic_cqi()
// TODO: implement subband CQI properly // TODO: implement subband CQI properly
cqi_report.subband_hl.N = (uint32_t) ((cell.nof_prb > 7) ? srslte_cqi_hl_get_no_subbands(cell.nof_prb) : 0); cqi_report.subband_hl.N = (uint32_t) ((cell.nof_prb > 7) ? srslte_cqi_hl_get_no_subbands(cell.nof_prb) : 0);
uci_data.uci_cqi_len = srslte_cqi_value_pack(&cqi_report, uci_data.uci_cqi); int cqi_len = srslte_cqi_value_pack(&cqi_report, uci_data.uci_cqi);
if (cqi_len < 0) {
Error("Error packing CQI value (Aperiodic reporting mode RM31).");
return;
}
uci_data.uci_cqi_len = (uint32_t) cqi_len;
uci_data.uci_ri_len = 1;
uci_data.uci_ri = ri;
char cqi_str[64] = {0}; char cqi_str[SRSLTE_CQI_STR_MAX_CHAR] = {0};
srslte_cqi_to_str(uci_data.uci_cqi, uci_data.uci_cqi_len, cqi_str, 64); srslte_cqi_to_str(uci_data.uci_cqi, uci_data.uci_cqi_len, cqi_str, SRSLTE_CQI_STR_MAX_CHAR);
if (cqi_report.subband_hl.rank_is_not_one) { if (cqi_report.subband_hl.rank_is_not_one) {
Info("PUSCH: Aperiodic ri~1, CQI=%02d/%02d, SINR=%2.1f/%2.1fdB, pmi=%d for %d subbands\n", Info("PUSCH: Aperiodic RM31 ri~1, CQI=%02d/%02d, SINR=%2.1f/%2.1fdB, pmi=%d for %d subbands\n",
cqi_report.subband_hl.wideband_cqi_cw0, cqi_report.subband_hl.wideband_cqi_cw1, cqi_report.subband_hl.wideband_cqi_cw0, cqi_report.subband_hl.wideband_cqi_cw1,
sinr_db, sinr_db, pmi, cqi_report.subband_hl.N); sinr_db, sinr_db, pmi, cqi_report.subband_hl.N);
} else { } else {
Info("PUSCH: Aperiodic ri=1, CQI=%02d, SINR=%2.1f, pmi=%d for %d subbands\n", Info("PUSCH: Aperiodic RM31 ri=1, CQI=%02d, SINR=%2.1f, pmi=%d for %d subbands\n",
cqi_report.subband_hl.wideband_cqi_cw0, cqi_report.subband_hl.wideband_cqi_cw0,
sinr_db, pmi, cqi_report.subband_hl.N); sinr_db, pmi, cqi_report.subband_hl.N);
} }
@ -1060,8 +1069,8 @@ void phch_worker::encode_pusch(srslte_ra_ul_grant_t *grant, uint8_t *payload, ui
snprintf(timestr, 64, ", tot_time=%4d us", (int) logtime_start[0].tv_usec); snprintf(timestr, 64, ", tot_time=%4d us", (int) logtime_start[0].tv_usec);
#endif #endif
char cqi_str[32] = ""; char cqi_str[SRSLTE_CQI_STR_MAX_CHAR] = "";
srslte_cqi_to_str(uci_data.uci_cqi, uci_data.uci_cqi_len, cqi_str, 32); srslte_cqi_to_str(uci_data.uci_cqi, uci_data.uci_cqi_len, cqi_str, SRSLTE_CQI_STR_MAX_CHAR);
uint8_t dummy[2] = {0,0}; uint8_t dummy[2] = {0,0};
log_h->info("PUSCH: tti_tx=%d, alloc=(%d,%d), tbs=%d, mcs=%d, rv=%d%s%s%s, cfo=%.1f KHz%s%s%s\n", log_h->info("PUSCH: tti_tx=%d, alloc=(%d,%d), tbs=%d, mcs=%d, rv=%d%s%s%s, cfo=%.1f KHz%s%s%s\n",
@ -1114,8 +1123,8 @@ void phch_worker::encode_pucch()
float tx_power = srslte_ue_ul_pucch_power(&ue_ul, phy->pathloss, ue_ul.last_pucch_format, uci_data.uci_cqi_len, uci_data.uci_ack_len); float tx_power = srslte_ue_ul_pucch_power(&ue_ul, phy->pathloss, ue_ul.last_pucch_format, uci_data.uci_cqi_len, uci_data.uci_ack_len);
float gain = set_power(tx_power); float gain = set_power(tx_power);
char str_cqi[32] = ""; char str_cqi[SRSLTE_CQI_STR_MAX_CHAR] = "";
srslte_cqi_to_str(uci_data.uci_cqi, uci_data.uci_cqi_len, str_cqi, 32); srslte_cqi_to_str(uci_data.uci_cqi, uci_data.uci_cqi_len, str_cqi, SRSLTE_CQI_STR_MAX_CHAR);
Info("PUCCH: tti_tx=%d, n_pucch=%d, n_prb=%d, ack=%s%s%s%s%s, sr=%s, cfo=%.1f KHz%s\n", Info("PUCCH: tti_tx=%d, n_pucch=%d, n_prb=%d, ack=%s%s%s%s%s, sr=%s, cfo=%.1f KHz%s\n",
(tti + 4) % 10240, (tti + 4) % 10240,

Loading…
Cancel
Save