Commit a7fc22c8 authored by Khalid Ahmed's avatar Khalid Ahmed Committed by Thomas Schlichter

Adding harq_pid as an input to nr_ulsch_encoding

parent ea2bc826
...@@ -1007,7 +1007,23 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, ...@@ -1007,7 +1007,23 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
uint8_t llr8_flag); uint8_t llr8_flag);
int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch, 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, uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
UE_nr_rxtx_proc_t *proc, UE_nr_rxtx_proc_t *proc,
......
...@@ -189,14 +189,14 @@ NR_UE_ULSCH_t *new_nr_ue_ulsch(unsigned char N_RB_UL, int number_of_harq_pids, u ...@@ -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, 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///////////////////////// /////////////////////////parameters and variables declaration/////////////////////////
/////////// ///////////
unsigned int G,crc; unsigned int G,crc;
uint8_t harq_pid;
NR_UL_UE_HARQ_t *harq_process; NR_UL_UE_HARQ_t *harq_process;
uint16_t nb_rb ; uint16_t nb_rb ;
uint8_t nb_symb_sch ; uint8_t nb_symb_sch ;
...@@ -221,7 +221,6 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch, ...@@ -221,7 +221,6 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
/////////// ///////////
crc = 1; crc = 1;
harq_pid = 0;
harq_process = ulsch->harq_processes[harq_pid]; harq_process = ulsch->harq_processes[harq_pid];
nb_rb = harq_process->nb_rb; nb_rb = harq_process->nb_rb;
nb_symb_sch = harq_process->nb_symbols; nb_symb_sch = harq_process->nb_symbols;
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
//#include "UTIL/LISTS/list.h" //#include "UTIL/LISTS/list.h"
//#include "common/ran_context.h" //#include "common/ran_context.h"
//#define DEBUG_DLSCHSIM //#define DEBUG_ULSCHSIM
PHY_VARS_gNB *gNB; PHY_VARS_gNB *gNB;
PHY_VARS_NR_UE *UE; PHY_VARS_NR_UE *UE;
...@@ -544,7 +544,7 @@ int main(int argc, char **argv) { ...@@ -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]); for (i = 0; i < TBS / 8; i++) printf("test_input[i]=%d \n",test_input[i]);
#endif #endif
...@@ -553,9 +553,13 @@ int main(int argc, char **argv) { ...@@ -553,9 +553,13 @@ int main(int argc, char **argv) {
//printf("crc32: [0]->0x%08x\n",crc24c(test_input, 32)); //printf("crc32: [0]->0x%08x\n",crc24c(test_input, 32));
// generate signal // generate signal
/////////////////////////[adk] ULSCH coding/////////////////////////
///////////
if (input_fd == NULL) { if (input_fd == NULL) {
nr_dlsch_encoding(test_input, subframe, dlsch, frame_parms); 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) { for (SNR = snr0; SNR < snr1; SNR += snr_step) {
......
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