Implement CW swap and TB to CW mapping for TM4

This commit is contained in:
Ismael Gomez 2017-10-29 10:29:53 -07:00
parent 1d095b006a
commit be0b832927
2 changed files with 28 additions and 7 deletions

View File

@ -32,6 +32,7 @@
#include <stdbool.h>
#include <assert.h>
#include <math.h>
#include <srslte/phy/phch/ra.h>
#include "srslte/phy/phch/dci.h"
#include "srslte/phy/common/phy_common.h"
@ -1159,7 +1160,32 @@ int dci_format2AB_unpack(srslte_dci_msg_t *msg, srslte_ra_dl_dci_t *data, uint32
} else if (msg->format == SRSLTE_DCI_FORMAT2A) {
data->pinfo = srslte_bit_pack(&y, precoding_bits_f2a(nof_ports));
}
// Table 5.3.3.1.5-1
if (SRSLTE_RA_DL_GRANT_NOF_TB(data) == 2) {
if (data->tb_cw_swap) {
uint32_t tmp = data->rv_idx;
data->rv_idx = data->rv_idx_1;
data->rv_idx_1 = tmp;
tmp = data->mcs_idx;
data->mcs_idx = data->mcs_idx_1;
data->mcs_idx_1 = tmp;
bool tmp_ndi = data->ndi;
data->ndi = data->ndi_1;
data->ndi_1 = tmp_ndi;
}
}
// Table 5.3.3.1.5-2
if (!data->tb_en[0]) {
data->rv_idx = data->rv_idx_1;
data->mcs_idx = data->mcs_idx_1;
data->ndi = data->ndi_1;
data->tb_en[1] = false;
}
return SRSLTE_SUCCESS;
}

View File

@ -504,11 +504,6 @@ bool phch_worker::decode_pdcch_dl(srsue::mac_interface_phy::mac_grant_t* grant)
grant->tb_en[1] = dci_unpacked.tb_en[1];
grant->tb_cw_swap = dci_unpacked.tb_cw_swap; // FIXME: tb_cw_swap not supported
if (grant->tb_cw_swap) {
Info("tb_cw_swap = true\n");
printf("tb_cw_swap = true\n");
}
last_dl_pdcch_ncce = srslte_ue_dl_get_ncce(&ue_dl);
char hexstr[16];
@ -633,7 +628,7 @@ int phch_worker::decode_pdsch(srslte_ra_dl_grant_t *grant, uint8_t *payload[SRSL
for (int i=0;i<SRSLTE_MAX_CODEWORDS;i++) {
if (grant->tb_en[i]) {
snprintf(tbstr[i], 128, ", TB%d: tbs=%d, mcs=%d, rv=%d, crc=%s, it=%d",
snprintf(tbstr[i], 128, ", CW%d: tbs=%d, mcs=%d, rv=%d, crc=%s, it=%d",
i, grant->mcs[i].tbs/8, grant->mcs[i].idx, rv[i], acks[i] ? "OK" : "KO",
srslte_pdsch_last_noi_cw(&ue_dl.pdsch, i));
}