mirror of https://github.com/PentHertz/srsLTE.git
Implement CW swap and TB to CW mapping for TM4
This commit is contained in:
parent
1d095b006a
commit
be0b832927
|
@ -32,6 +32,7 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <srslte/phy/phch/ra.h>
|
||||||
|
|
||||||
#include "srslte/phy/phch/dci.h"
|
#include "srslte/phy/phch/dci.h"
|
||||||
#include "srslte/phy/common/phy_common.h"
|
#include "srslte/phy/common/phy_common.h"
|
||||||
|
@ -1160,6 +1161,31 @@ int dci_format2AB_unpack(srslte_dci_msg_t *msg, srslte_ra_dl_dci_t *data, uint32
|
||||||
data->pinfo = srslte_bit_pack(&y, precoding_bits_f2a(nof_ports));
|
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;
|
return SRSLTE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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_en[1] = dci_unpacked.tb_en[1];
|
||||||
grant->tb_cw_swap = dci_unpacked.tb_cw_swap; // FIXME: tb_cw_swap not supported
|
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);
|
last_dl_pdcch_ncce = srslte_ue_dl_get_ncce(&ue_dl);
|
||||||
|
|
||||||
char hexstr[16];
|
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++) {
|
for (int i=0;i<SRSLTE_MAX_CODEWORDS;i++) {
|
||||||
if (grant->tb_en[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",
|
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));
|
srslte_pdsch_last_noi_cw(&ue_dl.pdsch, i));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue