Commit 1104cf04 authored by Ahmed Hussein's avatar Ahmed Hussein

Removing DMRS parameters from "nr_ulsch_encoding"

parent 9a857e44
......@@ -1051,10 +1051,6 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
uint8_t is_crnti,
uint8_t llr8_flag);
int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
NR_DL_FRAME_PARMS* frame_parms,
uint8_t harq_pid);
/*! \brief Perform PUSCH scrambling. TS 38.211 V15.4.0 subclause 6.3.1.1
@param[in] in Pointer to input bits
@param[in] size of input bits
......
......@@ -1053,7 +1053,8 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
NR_DL_FRAME_PARMS* frame_parms,
uint8_t harq_pid);
uint8_t harq_pid,
unsigned int G);
/*! \brief Perform PUSCH scrambling. TS 38.211 V15.4.0 subclause 6.3.1.1
@param[in] in, Pointer to input bits
......
......@@ -217,12 +217,13 @@ NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL,
int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
NR_DL_FRAME_PARMS* frame_parms,
uint8_t harq_pid)
uint8_t harq_pid,
unsigned int G)
{
/////////////////////////parameters and variables declaration/////////////////////////
///////////
unsigned int G,crc;
unsigned int crc;
NR_UL_UE_HARQ_t *harq_process;
uint16_t nb_rb ;
uint8_t nb_symb_sch ;
......@@ -235,8 +236,6 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
uint32_t E,Kb;
uint8_t Ilbrm;
uint32_t Tbslbrm;
uint8_t nb_re_dmrs;
uint16_t length_dmrs;
uint16_t R;
float Coderate;
......@@ -250,7 +249,6 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
crc = 1;
harq_process = ulsch->harq_processes[harq_pid];
nb_rb = harq_process->nb_rb;
nb_symb_sch = harq_process->number_of_symbols;
A = harq_process->TBS;
pz = &Z;
mod_order = nr_get_Qm_ul(harq_process->mcs,0);
......@@ -261,8 +259,6 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
F=0;
Ilbrm = 0;
Tbslbrm = 950984; //max tbs
nb_re_dmrs = ulsch->nb_re_dmrs;
length_dmrs = ulsch->length_dmrs;
Coderate = 0.0;
///////////
......@@ -271,10 +267,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ENCODING, VCD_FUNCTION_IN);
LOG_D(PHY,"ulsch coding nb_rb %d nb_symb_sch %d nb_re_dmrs %d, length_dmrs %d, harq_process->Nl = %d\n", nb_rb,nb_symb_sch, nb_re_dmrs,length_dmrs, harq_process->Nl);
G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs,mod_order,harq_process->Nl);
LOG_D(PHY,"ulsch coding nb_rb %d, Nl = %d\n", nb_rb, harq_process->Nl);
LOG_D(PHY,"ulsch coding A %d G %d mod_order %d\n", A,G, mod_order);
// if (harq_process->Ndi == 1) { // this is a new packet
......
......@@ -152,7 +152,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
ulsch_ue->Nid_cell = Nid_cell;
ulsch_ue->nb_re_dmrs = ((UE->pusch_config.dmrs_UplinkConfig.pusch_dmrs_type == pusch_dmrs_type1)?6:4);
N_RE_prime = NR_NB_SC_PER_RB*harq_process_ul_ue->number_of_symbols - ulsch_ue->nb_re_dmrs*number_dmrs_symbols - N_PRB_oh;
N_RE_prime = NR_NB_SC_PER_RB*harq_process_ul_ue->number_of_symbols - ulsch_ue->nb_re_dmrs*ulsch_ue->length_dmrs - N_PRB_oh;
harq_process_ul_ue->num_of_mod_symbols = N_RE_prime*harq_process_ul_ue->nb_rb*num_of_codewords;
......@@ -217,8 +217,10 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
/////////////////////////ULSCH coding/////////////////////////
///////////
unsigned int G = nr_get_G(harq_process_ul_ue->nb_rb, harq_process_ul_ue->number_of_symbols,
ulsch_ue->nb_re_dmrs, ulsch_ue->length_dmrs, mod_order, harq_process_ul_ue->Nl);
nr_ulsch_encoding(ulsch_ue, frame_parms, harq_pid);
nr_ulsch_encoding(ulsch_ue, frame_parms, harq_pid, G);
///////////
////////////////////////////////////////////////////////////////////
......@@ -226,8 +228,6 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
/////////////////////////ULSCH scrambling/////////////////////////
///////////
mod_order = nr_get_Qm_ul(harq_process_ul_ue->mcs, 0);
available_bits = nr_get_G(harq_process_ul_ue->nb_rb,
harq_process_ul_ue->number_of_symbols,
ulsch_ue->nb_re_dmrs,
......
......@@ -461,9 +461,10 @@ int main(int argc, char **argv)
/////////////////////////ULSCH coding/////////////////////////
///////////
unsigned int G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, mod_order, Nl);
if (input_fd == NULL) {
nr_ulsch_encoding(ulsch_ue, frame_parms, harq_pid);
nr_ulsch_encoding(ulsch_ue, frame_parms, harq_pid, G);
}
printf("\n");
......
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