diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h index d3e7dd0621..3db43237a0 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -1007,7 +1007,23 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, uint8_t llr8_flag); int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch, - NR_DL_FRAME_PARMS* frame_parms); + 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 + @param[in] Nid cell id + @param[in] n_RNTI CRNTI + @param[out] out the scrambled bits +*/ + +void nr_pusch_codeword_scrambling(uint8_t *in, + uint16_t size, + uint32_t Nid, + uint32_t n_RNTI, + uint32_t* out); + uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue, UE_nr_rxtx_proc_t *proc, diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c index 6b17eff585..4e46903ebf 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c @@ -189,14 +189,14 @@ NR_UE_ULSCH_t *new_nr_ue_ulsch(unsigned char N_RB_UL, int number_of_harq_pids, u int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch, - NR_DL_FRAME_PARMS* frame_parms) + NR_DL_FRAME_PARMS* frame_parms, + uint8_t harq_pid) { /////////////////////////parameters and variables declaration///////////////////////// /////////// unsigned int G,crc; - uint8_t harq_pid; NR_UL_UE_HARQ_t *harq_process; uint16_t nb_rb ; uint8_t nb_symb_sch ; @@ -221,7 +221,6 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch, /////////// crc = 1; - harq_pid = 0; harq_process = ulsch->harq_processes[harq_pid]; nb_rb = harq_process->nb_rb; nb_symb_sch = harq_process->nb_symbols; diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c index 80121b3d7f..de3bd2fe62 100644 --- a/openair1/SIMULATION/NR_PHY/ulschsim.c +++ b/openair1/SIMULATION/NR_PHY/ulschsim.c @@ -52,7 +52,7 @@ //#include "UTIL/LISTS/list.h" //#include "common/ran_context.h" -//#define DEBUG_DLSCHSIM +//#define DEBUG_ULSCHSIM PHY_VARS_gNB *gNB; PHY_VARS_NR_UE *UE; @@ -544,7 +544,7 @@ int main(int argc, char **argv) { //////////////////////////////////////////////////////////////////////////////////////////// -#ifdef DEBUG_DLSCHSIM +#ifdef DEBUG_ULSCHSIM for (i = 0; i < TBS / 8; i++) printf("test_input[i]=%d \n",test_input[i]); #endif @@ -553,9 +553,13 @@ int main(int argc, char **argv) { //printf("crc32: [0]->0x%08x\n",crc24c(test_input, 32)); // generate signal + + /////////////////////////[adk] ULSCH coding///////////////////////// + /////////// + if (input_fd == NULL) { nr_dlsch_encoding(test_input, subframe, dlsch, frame_parms); - nr_ulsch_encoding(ulsch, frame_parms); + nr_ulsch_encoding(ulsch, frame_parms, harq_pid); } for (SNR = snr0; SNR < snr1; SNR += snr_step) {