Fixed errors for phy_dl_test and pdsch test

master
Guillem Foreman 6 years ago
parent 4627737c87
commit 46724c336d

@ -67,7 +67,7 @@ option(ENABLE_SRSENB "Build srsENB application" ON)
option(ENABLE_SRSEPC "Build srsEPC application" ON)
option(DISABLE_SIMD "disable simd instructions" OFF)
option(ENABLE_GUI "Enable GUI (using srsGUI)" ON)
option(ENABLE_GUI "Enable GUI (using srsGUI)" OFF)
option(ENABLE_UHD "Enable UHD" ON)
option(ENABLE_BLADERF "Enable BladeRF" ON)
option(ENABLE_SOAPYSDR "Enable SoapySDR" ON)

@ -152,33 +152,32 @@ static int check_softbits(
{
int ret = SRSLTE_SUCCESS;
// Generate sequence
srslte_sequence_pdsch(&pdsch_ue->tmp_seq,
rnti,
pdsch_cfg->grant.tb[tb].cw_idx,
2 * (sf_idx % 10),
cell.id,
pdsch_cfg->grant.tb[tb].nof_bits);
// Scramble
if (pdsch_ue->llr_is_8bit) {
srslte_scrambling_sb_offset(&pdsch_ue->tmp_seq, pdsch_ue->e[tb], 0, pdsch_cfg->grant.tb[tb].nof_bits);
} else {
if (!pdsch_ue->llr_is_8bit && !tb_cw_swap) {
// Generate sequence
srslte_sequence_pdsch(&pdsch_ue->tmp_seq,
rnti,
pdsch_cfg->grant.tb[tb].cw_idx,
2 * (sf_idx % 10),
cell.id,
pdsch_cfg->grant.tb[tb].nof_bits);
// Scramble
srslte_scrambling_s_offset(&pdsch_ue->tmp_seq, pdsch_ue->e[tb], 0, pdsch_cfg->grant.tb[tb].nof_bits);
}
int16_t* rx = pdsch_ue->e[tb];
uint8_t* rx_bytes = pdsch_ue->e[tb];
for (int i = 0, k = 0; i < pdsch_cfg->grant.tb[tb].nof_bits / 8; i++) {
uint8_t w = 0;
for (int j = 0; j < 8; j++, k++) {
w |= (rx[k] > 0) ? (1 << (7 - j)) : 0;
int16_t* rx = pdsch_ue->e[tb];
uint8_t* rx_bytes = pdsch_ue->e[tb];
for (int i = 0, k = 0; i < pdsch_cfg->grant.tb[tb].nof_bits / 8; i++) {
uint8_t w = 0;
for (int j = 0; j < 8; j++, k++) {
w |= (rx[k] > 0) ? (1 << (7 - j)) : 0;
}
rx_bytes[i] = w;
}
if (memcmp(pdsch_ue->e[tb], pdsch_enb->e[tb], pdsch_cfg->grant.tb[tb].nof_bits / 8) != 0) {
ret = SRSLTE_ERROR;
}
rx_bytes[i] = w;
}
if (memcmp(pdsch_ue->e[tb], pdsch_enb->e[tb], pdsch_cfg->grant.tb[tb].nof_bits / 8) != 0) {
ret = SRSLTE_ERROR;
}
return ret;
}
@ -514,8 +513,6 @@ int main(int argc, char **argv) {
tb,
subframe,
pdsch_res[tb].crc);
srslte_vec_fprint_byte(stdout, (uint8_t*)pdsch_tx.e[tb], pdsch_cfg.grant.tb[tb].nof_bits / 8);
srslte_vec_fprint_byte(stdout, (uint8_t*)pdsch_rx.e[tb], pdsch_cfg.grant.tb[tb].nof_bits / 8);
} else {
for (int byte = 0; byte < pdsch_cfg.grant.tb[tb].tbs / 8; byte++) {
if (data_tx[tb][byte] != data_rx[tb][byte]) {

@ -686,6 +686,12 @@ int main(int argc, char **argv) {
free(data_rx[i]);
}
}
if (enb_dl) {
free(enb_dl);
}
if (ue_dl) {
free(ue_dl);
}
if (ret) {
printf("Error\n");

Loading…
Cancel
Save