From 3fad800ef6fc3aebc7faa0e04a211cd947b00970 Mon Sep 17 00:00:00 2001 From: dvdgrgrtt Date: Tue, 7 Dec 2021 15:45:29 +0100 Subject: [PATCH] Fix various typos and minor issues Some typos in the comments/error messages. A couple of minor bugs (should not have any impact in the performance). --- lib/src/phy/phch/phch_cfg_nr.c | 2 +- lib/src/phy/phch/ra_nr.c | 1 + lib/src/phy/phch/test/pusch_nr_test.c | 10 ++++++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/src/phy/phch/phch_cfg_nr.c b/lib/src/phy/phch/phch_cfg_nr.c index cb34a4d8e..380d74c28 100644 --- a/lib/src/phy/phch/phch_cfg_nr.c +++ b/lib/src/phy/phch/phch_cfg_nr.c @@ -251,7 +251,7 @@ uint32_t srsran_sch_cfg_nr_info(const srsran_sch_cfg_nr_t* sch_cfg, char* str, u // Append SCH information len += phch_cfg_sch_to_str(&sch_cfg->sch_cfg, &str[len], str_len - len); - // Append SCH information + // Append reserved RE information len += phch_cfg_rvd_to_str(&sch_cfg->rvd_re, &str[len], str_len - len); // UCI configuration diff --git a/lib/src/phy/phch/ra_nr.c b/lib/src/phy/phch/ra_nr.c index 415fab60f..167cb4457 100644 --- a/lib/src/phy/phch/ra_nr.c +++ b/lib/src/phy/phch/ra_nr.c @@ -626,6 +626,7 @@ int srsran_ra_nr_fill_tb(const srsran_sch_cfg_nr_t* pdsch_cfg, uint32_t N_re_rvd = srsran_re_pattern_list_count(&pdsch_cfg->rvd_re, grant->S, grant->S + grant->L, grant->prb_idx); // Steps 2,3,4 + tb->mcs = mcs_idx; tb->tbs = (int)srsran_ra_nr_tbs(N_re, S, R, Qm, tb->N_L); tb->R = R; tb->mod = m; diff --git a/lib/src/phy/phch/test/pusch_nr_test.c b/lib/src/phy/phch/test/pusch_nr_test.c index eedae8a0c..3bdc5217f 100644 --- a/lib/src/phy/phch/test/pusch_nr_test.c +++ b/lib/src/phy/phch/test/pusch_nr_test.c @@ -156,7 +156,7 @@ int main(int argc, char** argv) goto clean_exit; } - // Set PDSCH grant without considering any procedure + // Set PUSCH grant without considering any procedure pusch_cfg.grant.nof_dmrs_cdm_groups_without_data = 1; // No need for MIMO pusch_cfg.grant.nof_layers = carrier.max_mimo_layers; pusch_cfg.grant.dci_format = srsran_dci_format_nr_1_0; @@ -196,7 +196,7 @@ int main(int argc, char** argv) pusch_cfg.grant.dci_format = srsran_dci_format_nr_0_0; if (srsran_ra_nr_fill_tb(&pusch_cfg, &pusch_cfg.grant, mcs, &pusch_cfg.grant.tb[0]) < SRSRAN_SUCCESS) { - ERROR("Error filing tb"); + ERROR("Error filling tb"); goto clean_exit; } @@ -270,10 +270,12 @@ int main(int argc, char** argv) // Check symbols Mean Square Error (MSE) uint32_t nof_re = srsran_ra_dl_nr_slot_nof_re(&pusch_cfg, &pusch_cfg.grant); if (nof_re * pusch_cfg.grant.nof_layers > 0) { - float mse = 0.0f; + float mse = 0.0f; + float mse_tmp = 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_tmp = cabsf(pusch_tx.d[i][j] - pusch_rx.d[i][j]); + mse += mse_tmp * mse_tmp; } } mse = mse / (nof_re * pusch_cfg.grant.nof_layers);