Added more checks in PUSCH NR test

master
Xavier Arteaga 4 years ago committed by Andre Puschmann
parent ef865b81a3
commit 04aca98e5f

@ -277,25 +277,43 @@ int main(int argc, char** argv)
goto clean_exit; goto clean_exit;
} }
float mse = 0.0f; // Check symbols Mean Square Error (MSE)
uint32_t nof_re = srsran_ra_dl_nr_slot_nof_re(&pusch_cfg, &pusch_cfg.grant); uint32_t nof_re = srsran_ra_dl_nr_slot_nof_re(&pusch_cfg, &pusch_cfg.grant);
for (uint32_t i = 0; i < pusch_cfg.grant.nof_layers; i++) {
for (uint32_t j = 0; j < nof_re; j++) {
mse += cabsf(pusch_tx.d[i][j] - pusch_rx.d[i][j]);
}
}
if (nof_re * pusch_cfg.grant.nof_layers > 0) { if (nof_re * pusch_cfg.grant.nof_layers > 0) {
float mse = 0.0f;
for (uint32_t i = 0; i < pusch_cfg.grant.nof_layers; i++) {
for (uint32_t j = 0; j < nof_re; j++) {
mse += cabsf(pusch_tx.d[i][j] - pusch_rx.d[i][j]);
}
}
mse = mse / (nof_re * pusch_cfg.grant.nof_layers); mse = mse / (nof_re * pusch_cfg.grant.nof_layers);
if (mse > 0.001) {
ERROR("MSE error (%f) is too high", mse);
for (uint32_t i = 0; i < pusch_cfg.grant.nof_layers; i++) {
printf("d_tx[%d]=", i);
srsran_vec_fprint_c(stdout, pusch_tx.d[i], nof_re);
printf("d_rx[%d]=", i);
srsran_vec_fprint_c(stdout, pusch_rx.d[i], nof_re);
}
goto clean_exit;
}
} }
if (mse > 0.001) {
ERROR("MSE error (%f) is too high", mse); // Check Received SCH LLR match
for (uint32_t i = 0; i < pusch_cfg.grant.nof_layers; i++) { if (pusch_rx.G_ulsch > 0) {
printf("d_tx[%d]=", i); for (uint32_t i = 0; i < pusch_rx.G_ulsch; i++) {
srsran_vec_fprint_c(stdout, pusch_tx.d[i], nof_re); uint8_t rx_bit = (((int8_t*)pusch_rx.g_ulsch)[i]) < 0 ? 1 : 0;
printf("d_rx[%d]=", i); pusch_rx.g_ulsch[i] = rx_bit;
srsran_vec_fprint_c(stdout, pusch_rx.d[i], nof_re); }
if (memcmp(pusch_tx.g_ulsch, pusch_rx.g_ulsch, pusch_tx.G_ulsch) != 0) {
printf("g_ulsch_tx=");
srsran_vec_fprint_byte(stdout, pusch_tx.g_ulsch, pusch_tx.G_ulsch);
printf("g_ulsch_rx=");
srsran_vec_fprint_byte(stdout, pusch_rx.g_ulsch, pusch_tx.G_ulsch);
// srsran_vec_fprint_bs(stdout, (int8_t*)pusch_rx.g_ulsch, pusch_rx.G_ulsch);
goto clean_exit;
} }
goto clean_exit;
} }
// Validate UL-SCH CRC check // Validate UL-SCH CRC check

Loading…
Cancel
Save