Optimised RI/PMI calculation call

master
Xavier Arteaga 7 years ago
parent 96a6d6ae9f
commit f9e428ef68

@ -73,6 +73,7 @@ typedef struct SRSLTE_API {
uint8_t uci_ack; // 1st codeword bit for HARQ-ACK uint8_t uci_ack; // 1st codeword bit for HARQ-ACK
uint8_t uci_ack_2; // 2st codeword bit for HARQ-ACK uint8_t uci_ack_2; // 2st codeword bit for HARQ-ACK
uint32_t uci_ack_len; uint32_t uci_ack_len;
bool ri_periodic_report;
bool scheduling_request; bool scheduling_request;
bool channel_selection; bool channel_selection;
bool cqi_ack; bool cqi_ack;

@ -282,12 +282,11 @@ void pucch_encode_bits(srslte_uci_data_t *uci_data, srslte_pucch_format_t format
pucch_bits[1] = uci_data->uci_ack_2; // this will be ignored in format 1a pucch_bits[1] = uci_data->uci_ack_2; // this will be ignored in format 1a
} }
if (format >= SRSLTE_PUCCH_FORMAT_2) { if (format >= SRSLTE_PUCCH_FORMAT_2) {
/* Append RI */ /* Put RI (goes alone) */
if (uci_data->uci_ri_len) { if (uci_data->ri_periodic_report) {
uci_data->uci_ri = uci_buffer[0]; // It assumes only 1 bit of RI uci_buffer[0] = uci_data->uci_ri; // It assumes only 1 bit of RI
}
uci_buffer_len += uci_data->uci_ri_len; uci_buffer_len += uci_data->uci_ri_len;
} else {
/* Append CQI */ /* Append CQI */
memcpy(&uci_buffer[uci_buffer_len], uci_data->uci_cqi, uci_data->uci_cqi_len); memcpy(&uci_buffer[uci_buffer_len], uci_data->uci_cqi, uci_data->uci_cqi_len);
uci_buffer_len += uci_data->uci_cqi_len; uci_buffer_len += uci_data->uci_cqi_len;
@ -299,7 +298,7 @@ void pucch_encode_bits(srslte_uci_data_t *uci_data, srslte_pucch_format_t format
/* Append PMI */ /* Append PMI */
memcpy(&uci_buffer[uci_buffer_len], uci_data->uci_pmi, uci_data->uci_pmi_len); memcpy(&uci_buffer[uci_buffer_len], uci_data->uci_pmi, uci_data->uci_pmi_len);
uci_buffer_len += uci_data->uci_pmi_len; uci_buffer_len += uci_data->uci_pmi_len;
}
srslte_uci_encode_cqi_pucch(uci_buffer, uci_buffer_len, pucch_bits); srslte_uci_encode_cqi_pucch(uci_buffer, uci_buffer_len, pucch_bits);
if (format > SRSLTE_PUCCH_FORMAT_2) { if (format > SRSLTE_PUCCH_FORMAT_2) {
pucch2_bits[0] = uci_data->uci_ack; pucch2_bits[0] = uci_data->uci_ack;

@ -256,8 +256,6 @@ void phch_worker::work_imp()
if (dl_action.generate_ack) { if (dl_action.generate_ack) {
set_uci_ack(dl_ack, dl_mac_grant.tb_en); set_uci_ack(dl_ack, dl_mac_grant.tb_en);
} }
compute_ri();
} }
} }
@ -306,6 +304,8 @@ void phch_worker::work_imp()
/* Transmit PUSCH, PUCCH or SRS */ /* Transmit PUSCH, PUCCH or SRS */
bool signal_ready = false; bool signal_ready = false;
if (ul_action.tx_enabled) { if (ul_action.tx_enabled) {
compute_ri();
encode_pusch(&ul_action.phy_grant.ul, ul_action.payload_ptr[0], ul_action.current_tx_nb, encode_pusch(&ul_action.phy_grant.ul, ul_action.payload_ptr[0], ul_action.current_tx_nb,
&ul_action.softbuffers[0], ul_action.rv[0], ul_action.rnti, ul_mac_grant.is_from_rar); &ul_action.softbuffers[0], ul_action.rv[0], ul_action.rnti, ul_mac_grant.is_from_rar);
signal_ready = true; signal_ready = true;
@ -363,8 +363,9 @@ void phch_worker::work_imp()
} }
void phch_worker::compute_ri() { void phch_worker::compute_ri() {
/* Select Rank Indicator by computing Condition Number */ if (uci_data.uci_ri_len > 0) {
if (phy->config->dedicated.antenna_info_explicit_value.tx_mode == LIBLTE_RRC_TRANSMISSION_MODE_3) { /* Do nothing */
} else if (phy->config->dedicated.antenna_info_explicit_value.tx_mode == LIBLTE_RRC_TRANSMISSION_MODE_3) {
if (ue_dl.nof_rx_antennas > 1) { if (ue_dl.nof_rx_antennas > 1) {
/* If 2 ort more receiving antennas, select RI */ /* If 2 ort more receiving antennas, select RI */
float cn = 0.0f; float cn = 0.0f;
@ -834,13 +835,8 @@ void phch_worker::set_uci_periodic_cqi()
if (period_cqi.configured && rnti_is_set) { if (period_cqi.configured && rnti_is_set) {
if (period_cqi.ri_idx_present && srslte_ri_send(period_cqi.pmi_idx, period_cqi.ri_idx, TTI_TX(tti))) { if (period_cqi.ri_idx_present && srslte_ri_send(period_cqi.pmi_idx, period_cqi.ri_idx, TTI_TX(tti))) {
/* If the RI is not computed, compute it */
if (uci_data.uci_ri_len < 1) {
compute_ri(); compute_ri();
} uci_data.ri_periodic_report = true;
uci_data.uci_cqi_len = 0;
uci_data.uci_dif_cqi_len = 0;
uci_data.uci_pmi_len = 0;
Info("PUCCH: Periodic RI=%d\n", uci_data.uci_ri); Info("PUCCH: Periodic RI=%d\n", uci_data.uci_ri);
} else if (srslte_cqi_send(period_cqi.pmi_idx, TTI_TX(tti))) { } else if (srslte_cqi_send(period_cqi.pmi_idx, TTI_TX(tti))) {
srslte_cqi_value_t cqi_report; srslte_cqi_value_t cqi_report;

Loading…
Cancel
Save