Commit 117362eb authored by Ahmed Hussein's avatar Ahmed Hussein Committed by Francesco Mani

Fixed bug regarding TBS calculation and G calculation

  - The number of nb_dmrs_re at gNB side was set to 6, but here it is assumed
    that there will be no data allocation in OFDM symbols that carry DMRS
  - nb_dmrs_re that is being given as an input to the TBS calculation,
    should be multiplied by the number of DMRS symbols in order to get the total
    number of DMRS REs per RB
  - In the calculation of G, only the number of DMRS per RB in 1 OFDM symbol should
    be given as an input, because inside the function of the G calculation, this
    number is being multiplied by the number of OFDM symbols that carry DMRS
parent 802a63ed
...@@ -230,7 +230,7 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH ...@@ -230,7 +230,7 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
number_dmrs_symbols += ((pusch_pdu->ul_dmrs_symb_pos)>>l)&0x01; number_dmrs_symbols += ((pusch_pdu->ul_dmrs_symb_pos)>>l)&0x01;
if (nodata_dmrs) if (nodata_dmrs)
nb_re_dmrs = 12*number_dmrs_symbols; nb_re_dmrs = 12;
else else
nb_re_dmrs = ((pusch_pdu->dmrs_config_type == pusch_dmrs_type1)?6:4); nb_re_dmrs = ((pusch_pdu->dmrs_config_type == pusch_dmrs_type1)?6:4);
...@@ -245,7 +245,6 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH ...@@ -245,7 +245,6 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
//---------------------------------------------------------- //----------------------------------------------------------
//------------------- ULSCH unscrambling ------------------- //------------------- ULSCH unscrambling -------------------
//---------------------------------------------------------- //----------------------------------------------------------
start_meas(&gNB->ulsch_unscrambling_stats); start_meas(&gNB->ulsch_unscrambling_stats);
nr_ulsch_unscrambling(gNB->pusch_vars[ULSCH_id]->llr, nr_ulsch_unscrambling(gNB->pusch_vars[ULSCH_id]->llr,
G, G,
......
...@@ -1452,7 +1452,7 @@ void nr_get_tbs_dl(nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu, ...@@ -1452,7 +1452,7 @@ void nr_get_tbs_dl(nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu,
R, R,
pdsch_rel15->rbSize, pdsch_rel15->rbSize,
N_sh_symb, N_sh_symb,
N_PRB_DMRS, N_PRB_DMRS, // FIXME // This should be multiplied by the number of dmrs symbols
N_PRB_oh, N_PRB_oh,
tb_scaling, tb_scaling,
pdsch_rel15->nrOfLayers)>>3; pdsch_rel15->nrOfLayers)>>3;
......
...@@ -818,11 +818,18 @@ void nr_schedule_uss_ulsch_phytest(int Mod_idP, ...@@ -818,11 +818,18 @@ void nr_schedule_uss_ulsch_phytest(int Mod_idP,
pusch_pdu->pusch_data.rv_index = 0; pusch_pdu->pusch_data.rv_index = 0;
pusch_pdu->pusch_data.harq_process_id = 0; pusch_pdu->pusch_data.harq_process_id = 0;
pusch_pdu->pusch_data.new_data_indicator = 0; pusch_pdu->pusch_data.new_data_indicator = 0;
uint8_t no_data_in_dmrs = 1; // temp implementation
uint8_t num_dmrs_symb = 0;
for(int dmrs_counter = pusch_pdu->start_symbol_index; dmrs_counter < pusch_pdu->start_symbol_index + pusch_pdu->nr_of_symbols; dmrs_counter++)
num_dmrs_symb += ((pusch_pdu->ul_dmrs_symb_pos >> dmrs_counter) & 1);
pusch_pdu->pusch_data.tb_size = nr_compute_tbs(pusch_pdu->qam_mod_order, pusch_pdu->pusch_data.tb_size = nr_compute_tbs(pusch_pdu->qam_mod_order,
pusch_pdu->target_code_rate, pusch_pdu->target_code_rate,
pusch_pdu->rb_size, pusch_pdu->rb_size,
pusch_pdu->nr_of_symbols, pusch_pdu->nr_of_symbols,
6, //nb_re_dmrs - not sure where this is coming from - its not in the FAPI ( no_data_in_dmrs ? 12 : ((pusch_pdu->dmrs_config_type == pusch_dmrs_type1) ? 6 : 4) ) * num_dmrs_symb,
0, //nb_rb_oh 0, //nb_rb_oh
0, 0,
pusch_pdu->nrOfLayers)>>3; pusch_pdu->nrOfLayers)>>3;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment