From 121937ad4c86d1a19c40eb6cde9deb7ff54c13d3 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 23 Jun 2025 10:38:05 +0200 Subject: [PATCH] input simplification in nr_pdsch_channel_estimation --- .../nr_dl_channel_estimation.c | 39 ++++++++----------- openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h | 29 ++++++-------- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 9 +---- 3 files changed, 29 insertions(+), 48 deletions(-) diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c index 8703c1c774..515e0f5ff5 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -1253,30 +1253,24 @@ void NFAPI_NR_DMRS_TYPE2_average_prb(NR_DL_FRAME_PARMS *frame_parms, #endif } -int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, - const UE_nr_rxtx_proc_t *proc, - int nl, - unsigned short p, - unsigned char symbol, - unsigned char nscid, - unsigned short scrambling_id, - unsigned short BWPStart, - uint8_t config_type, - int n_dmrs_cdm_groups, - uint16_t rb_offset, - unsigned short bwp_start_subcarrier, - unsigned short nb_rb_pdsch, - uint32_t pdsch_est_size, - int32_t dl_ch_estimates[][pdsch_est_size], - int rxdataFsize, - c16_t rxdataF[][rxdataFsize], - uint32_t *nvar) +void nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, + const UE_nr_rxtx_proc_t *proc, + const fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch, + int nl, + unsigned short p, + unsigned char symbol, + uint32_t pdsch_est_size, + int32_t dl_ch_estimates[][pdsch_est_size], + int rxdataFsize, + c16_t rxdataF[][rxdataFsize], + uint32_t *nvar) { // int gNB_id = proc->gNB_id; int slot = proc->nr_slot_rx; NR_DL_FRAME_PARMS *fp = &ue->frame_parms; const int ch_offset = fp->ofdm_symbol_size * symbol; const int symbol_offset = fp->ofdm_symbol_size * symbol; + int bwp_start_subcarrier = ue->frame_parms.first_carrier_offset + (dlsch->BWPStart + dlsch->start_rb) * 12; #ifdef DEBUG_PDSCH printf( @@ -1292,13 +1286,15 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, #endif // generate pilot for gNB port number 1000+p + int config_type = dlsch->dmrsConfigType; + int rb_offset = dlsch->rb_offset; + int nb_rb_pdsch = dlsch->number_rbs; int8_t delta = get_delta(p, config_type); - c16_t pilot[3280] __attribute__((aligned(16))); // Note: pilot returned by the following function is already the complex conjugate of the transmitted DMRS - float beta_dmrs_pdsch = get_beta_dmrs(n_dmrs_cdm_groups, config_type == NFAPI_NR_DMRS_TYPE2); + float beta_dmrs_pdsch = get_beta_dmrs(dlsch->n_dmrs_cdm_groups, config_type == NFAPI_NR_DMRS_TYPE2); int16_t dmrs_scaling = (int16_t)((1 / beta_dmrs_pdsch) * (1 << 14)); - const uint32_t *gold = nr_gold_pdsch(fp->N_RB_DL, fp->symbols_per_slot, scrambling_id, nscid, slot, symbol); + const uint32_t *gold = nr_gold_pdsch(fp->N_RB_DL, fp->symbols_per_slot, dlsch->dlDmrsScramblingId, dlsch->nscid, slot, symbol); nr_pdsch_dmrs_rx(ue, slot, gold, pilot, 1000 + p, 0, nb_rb_pdsch + rb_offset, config_type, dmrs_scaling); delay_t delay = {0}; @@ -1351,7 +1347,6 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, } #endif } - return 0; } /******************************************************************* diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h index b1bc3ca8e1..09ed452830 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h @@ -78,24 +78,17 @@ int nr_pbch_channel_estimation(const NR_DL_FRAME_PARMS *fp, bool sidelink, uint Nid); -int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, - const UE_nr_rxtx_proc_t *proc, - int nl, - unsigned short p, - unsigned char symbol, - unsigned char nscid, - unsigned short scrambling_id, - unsigned short BWPStart, - uint8_t config_type, - int n_dmrs_cdm_groups, - uint16_t rb_offset, - unsigned short bwp_start_subcarrier, - unsigned short nb_rb_pdsch, - uint32_t pdsch_est_size, - int32_t dl_ch_estimates[][pdsch_est_size], - int rxdataFsize, - c16_t rxdataF[][rxdataFsize], - uint32_t *nvar); +void nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, + const UE_nr_rxtx_proc_t *proc, + const fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch, + int nl, + unsigned short p, + unsigned char symbol, + uint32_t pdsch_est_size, + int32_t dl_ch_estimates[][pdsch_est_size], + int rxdataFsize, + c16_t rxdataF[][rxdataFsize], + uint32_t *nvar); int nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms, PHY_VARS_NR_UE *ue, diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 89b8ed91a7..8d56cf65ff 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -641,17 +641,10 @@ static int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, uint32_t nvar_tmp = 0; nr_pdsch_channel_estimation(ue, proc, + dlschCfg, nl, get_dmrs_port(nl, dlschCfg->dmrs_ports), m, - dlschCfg->nscid, - dlschCfg->dlDmrsScramblingId, - dlschCfg->BWPStart, - dlschCfg->dmrsConfigType, - dlschCfg->n_dmrs_cdm_groups, - dlschCfg->rb_offset, - ue->frame_parms.first_carrier_offset + (dlschCfg->BWPStart + dlschCfg->start_rb) * 12, - dlschCfg->number_rbs, pdsch_est_size, pdsch_dl_ch_estimates, ue->frame_parms.samples_per_slot_wCP,