Commit ebab3325 authored by Matthieu Kanj's avatar Matthieu Kanj

adding UL indication for NPUSCH channel

parent 6d5e60f3
...@@ -327,7 +327,7 @@ void rx_ulsch_NB_IoT(PHY_VARS_eNB *phy_vars_eNB, ...@@ -327,7 +327,7 @@ void rx_ulsch_NB_IoT(PHY_VARS_eNB *phy_vars_eNB,
uint8_t cooperation_flag); uint8_t cooperation_flag);
void rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB, uint8_t rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc, eNB_rxtx_proc_t *proc,
uint8_t eNB_id, // this is the effective sector id uint8_t eNB_id, // this is the effective sector id
uint8_t UE_id, uint8_t UE_id,
......
...@@ -2053,7 +2053,7 @@ void rx_ulsch_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -2053,7 +2053,7 @@ void rx_ulsch_NB_IoT(PHY_VARS_eNB *eNB,
int32_t llr_msg5[16]; int32_t llr_msg5[16];
int32_t y_msg5[16]; int32_t y_msg5[16];
void rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB, uint8_t rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc, eNB_rxtx_proc_t *proc,
uint8_t eNB_id, // this is the effective sector id uint8_t eNB_id, // this is the effective sector id
uint8_t UE_id, uint8_t UE_id,
...@@ -2089,7 +2089,8 @@ void rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -2089,7 +2089,8 @@ void rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
// uint8_t log2_maxh = 0,aarx; // uint8_t log2_maxh = 0,aarx;
//uint8_t harq_pid; //uint8_t harq_pid;
uint8_t Qm; uint8_t Qm;
//int subframe = proc->subframe_rx; int subframe = proc->subframe_rx;
int frame = proc->frame_rx;
//uint8_t npusch_format = 1; // NB-IoT: format 1 (data), or 2: ack. Should be defined in higher layer //uint8_t npusch_format = 1; // NB-IoT: format 1 (data), or 2: ack. Should be defined in higher layer
//uint8_t subcarrier_spacing = frame_parms->subcarrier_spacing; // 15 kHz or 3.75 kHz //uint8_t subcarrier_spacing = frame_parms->subcarrier_spacing; // 15 kHz or 3.75 kHz
uint8_t pilot_pos1_format1_15k = 3, pilot_pos2_format1_15k = 10; // holds for npusch format 1, and 15 kHz subcarrier bandwidth uint8_t pilot_pos1_format1_15k = 3, pilot_pos2_format1_15k = 10; // holds for npusch format 1, and 15 kHz subcarrier bandwidth
...@@ -2492,7 +2493,7 @@ void rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -2492,7 +2493,7 @@ void rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
&eNB->ulsch_tc_intl1_stats, &eNB->ulsch_tc_intl1_stats,
&eNB->ulsch_tc_intl2_stats); &eNB->ulsch_tc_intl2_stats);
if (ret != (1+ulsch_NB_IoT[UE_id]->max_turbo_iterations)) if (ret != (1+ulsch_NB_IoT[UE_id]->max_turbo_iterations))
{ {
//printf("\n in last cdn \n"); //printf("\n in last cdn \n");
if (r<ulsch_harq->Cminus) if (r<ulsch_harq->Cminus)
...@@ -2513,11 +2514,18 @@ void rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -2513,11 +2514,18 @@ void rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
ulsch_harq->c[r], ulsch_harq->c[r],
Kr_bytes - ((ulsch_harq->C>1)?3:0)); Kr_bytes - ((ulsch_harq->C>1)?3:0));
offset += (Kr_bytes- ((ulsch_harq->C>1)?3:0)); offset += (Kr_bytes- ((ulsch_harq->C>1)?3:0));
} }
fill_crc_indication_NB_IoT(eNB,0,frame,subframe,0); // indicate ACK to MAC
//fill_rx_indication_NB_IoT(eNB,i,frame,subframe); // indicate SDU to MAC
fill_rx_indication_NB_IoT(eNB,proc,option);
} else { } else {
//printf("\n in last cdn break \n");
break; fill_crc_indication_NB_IoT(eNB,0,frame,subframe,1); // indicate NAK to MAC
//fill_rx_indication_NB_IoT(eNB,i,frame,subframe); // indicate SDU to MAC
fill_rx_indication_NB_IoT(eNB,proc,option);
break;
} }
} // r loop end } // r loop end
...@@ -2564,10 +2572,16 @@ void rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -2564,10 +2572,16 @@ void rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
if (counter_ack>8) //hard decision if (counter_ack>8) //hard decision
{ {
printf(" decoded msg5: ACK "); printf(" decoded msg5: ACK ");
fill_crc_indication_NB_IoT(eNB,0,frame,subframe,0); // indicate ACK to MAC
//fill_rx_indication_NB_IoT(eNB,i,frame,subframe); // indicate SDU to MAC
fill_rx_indication_NB_IoT(eNB,proc,option);
} else if (counter_ack<8) { //hard decision } else if (counter_ack<8) { //hard decision
printf(" decoded msg5: NACK "); printf(" decoded msg5: NACK ");
fill_crc_indication_NB_IoT(eNB,0,frame,subframe,1); // indicate NAK to MAC
//fill_rx_indication_NB_IoT(eNB,i,frame,subframe); // indicate SDU to MAC
fill_rx_indication_NB_IoT(eNB,proc,option);
} else { //when equality (8 bits 0 vs 8 bits 1), soft decision } else { //when equality (8 bits 0 vs 8 bits 1), soft decision
...@@ -2581,10 +2595,16 @@ void rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -2581,10 +2595,16 @@ void rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
{ {
printf(" decoded msg5 (soft): ACK "); printf(" decoded msg5 (soft): ACK ");
fill_crc_indication_NB_IoT(eNB,0,frame,subframe,0); // indicate ACK to MAC
//fill_rx_indication_NB_IoT(eNB,i,frame,subframe); // indicate SDU to MAC
fill_rx_indication_NB_IoT(eNB,proc,option);
} else { } else {
printf(" decoded msg5 (soft): NACK "); printf(" decoded msg5 (soft): NACK ");
fill_crc_indication_NB_IoT(eNB,0,frame,subframe,1); // indicate NAK to MAC
//fill_rx_indication_NB_IoT(eNB,i,frame,subframe); // indicate SDU to MAC
fill_rx_indication_NB_IoT(eNB,proc,option);
} }
} }
printf("\n\n\n"); printf("\n\n\n");
......
...@@ -527,6 +527,8 @@ int is_srs_occasion_common(LTE_DL_FRAME_PARMS *frame_parms,int frame_tx,int subf ...@@ -527,6 +527,8 @@ int is_srs_occasion_common(LTE_DL_FRAME_PARMS *frame_parms,int frame_tx,int subf
void compute_srs_pos(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset); void compute_srs_pos(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset);
void fill_crc_indication_NB_IoT(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe,uint8_t crc_flag);
/*@}*/ /*@}*/
......
...@@ -22,7 +22,7 @@ void process_schedule_rsp_NB_IoT(Sched_Rsp_NB_IoT_t *sched_rsp, ...@@ -22,7 +22,7 @@ void process_schedule_rsp_NB_IoT(Sched_Rsp_NB_IoT_t *sched_rsp,
eNB_rxtx_proc_t *proc); eNB_rxtx_proc_t *proc);
/*Processing the ue-specific resources for uplink in NB-IoT*/ /*Processing the ue-specific resources for uplink in NB-IoT*/
void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_t *proc, UL_IND_NB_IoT_t *UL_INFO); void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc); // UL_IND_NB_IoT_t *UL_INFO);
/* For NB-IoT, we put NPBCH in later part, since it would be scheduled by MAC scheduler,this generates NRS/NPSS/NSSS*/ /* For NB-IoT, we put NPBCH in later part, since it would be scheduled by MAC scheduler,this generates NRS/NPSS/NSSS*/
void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc); void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc);
...@@ -50,6 +50,11 @@ uint32_t is_SIB1_NB_IoT(const frame_t frameP, ...@@ -50,6 +50,11 @@ uint32_t is_SIB1_NB_IoT(const frame_t frameP,
uint32_t rx_nprach_NB_IoT(PHY_VARS_eNB *eNB,int frame, uint8_t subframe, uint16_t *rnti, uint16_t *preamble_index, uint16_t *timing_advance); uint32_t rx_nprach_NB_IoT(PHY_VARS_eNB *eNB,int frame, uint8_t subframe, uint16_t *rnti, uint16_t *preamble_index, uint16_t *timing_advance);
void npusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t data_or_control);
////////////////// NB-IoT testing ////////////////////
void fill_rx_indication_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t data_or_control);
#endif #endif
...@@ -613,7 +613,6 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { ...@@ -613,7 +613,6 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) {
/////////////////////////////////////////////////// NPUSH DEMOD //////////////////////////////////// /////////////////////////////////////////////////// NPUSH DEMOD ////////////////////////////////////
// LTE_eNB_COMMON *common_vars = &eNB->common_vars; // LTE_eNB_COMMON *common_vars = &eNB->common_vars;
rx_ulsch_Gen_NB_IoT(eNB, rx_ulsch_Gen_NB_IoT(eNB,
proc, proc,
0,//eNB_id, // this is the effective sector id 0,//eNB_id, // this is the effective sector id
...@@ -2922,8 +2921,8 @@ void prach_procedures_NB_IoT(PHY_VARS_eNB *eNB) { ...@@ -2922,8 +2921,8 @@ void prach_procedures_NB_IoT(PHY_VARS_eNB *eNB) {
UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.rnti);*/ UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.rnti);*/
pthread_mutex_lock(&eNB->UL_INFO_mutex); pthread_mutex_lock(&eNB->UL_INFO_mutex);
//////////////////////////////////////////////////////////
eNB->UL_INFO.nrach_ind.number_of_initial_scs_detected = 1; // should be set to zero in every call of UL_indication eNB->UL_INFO.nrach_ind.number_of_initial_scs_detected = 1; //!!!!!!!!!!!!! // should be set to zero in every call of UL_indication !!!!!!!!!!!!!!!!!!!!!!!
eNB->UL_INFO.nrach_ind.nrach_pdu_list[0].nrach_indication_rel13.rnti = rnti[0]; eNB->UL_INFO.nrach_ind.nrach_pdu_list[0].nrach_indication_rel13.rnti = rnti[0];
eNB->UL_INFO.nrach_ind.nrach_pdu_list[0].nrach_indication_rel13.initial_sc = preamble_index[0]; eNB->UL_INFO.nrach_ind.nrach_pdu_list[0].nrach_indication_rel13.initial_sc = preamble_index[0];
eNB->UL_INFO.nrach_ind.nrach_pdu_list[0].nrach_indication_rel13.timing_advance = timing_advance_preamble[0]; eNB->UL_INFO.nrach_ind.nrach_pdu_list[0].nrach_indication_rel13.timing_advance = timing_advance_preamble[0];
...@@ -2931,7 +2930,7 @@ void prach_procedures_NB_IoT(PHY_VARS_eNB *eNB) { ...@@ -2931,7 +2930,7 @@ void prach_procedures_NB_IoT(PHY_VARS_eNB *eNB) {
eNB->UL_INFO.frame = frame; eNB->UL_INFO.frame = frame;
eNB->UL_INFO.subframe = subframe; eNB->UL_INFO.subframe = subframe;
//eNB->UL_INFO.hypersfn = ; //eNB->UL_INFO.hypersfn = ;
pthread_mutex_unlock(&eNB->UL_INFO_mutex); pthread_mutex_unlock(&eNB->UL_INFO_mutex);
...@@ -2945,7 +2944,7 @@ void prach_procedures_NB_IoT(PHY_VARS_eNB *eNB) { ...@@ -2945,7 +2944,7 @@ void prach_procedures_NB_IoT(PHY_VARS_eNB *eNB) {
} }
} }
//////////////////////////////////////////////////////////// END /////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// END ///////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void prach_procedures(PHY_VARS_eNB *eNB) { void prach_procedures(PHY_VARS_eNB *eNB) {
// LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; // LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
...@@ -3876,6 +3875,33 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc){ ...@@ -3876,6 +3875,33 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc){
///VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON+offset, 0 ); ///VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON+offset, 0 );
} }
void fill_rx_indication_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t data_or_control)
{
nfapi_rx_indication_pdu_t *pdu;
pthread_mutex_lock(&eNB->UL_INFO_mutex);
eNB->UL_INFO.RX_NPUSCH.number_of_pdus = 1;
//eNB->UL_INFO.RX_NPUSCH.rx_pdu_list.rx_ue_information.tl.tag = NFAPI_RX_INDICATION_BODY_TAG; // do we need this ??
//eNB->UL_INFO.RX_NPUSCH.rx_pdu_list.rx_ue_information.rnti = rnti; // rnti should be got from eNB structure
//pdu = &eNB->UL_INFO.RX_NPUSCH.rx_pdu_list[eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus];
pdu = &eNB->UL_INFO.RX_NPUSCH.rx_pdu_list[0];
// pdu->rx_ue_information.handle = eNB->ulsch[UE_id]->handle;
// pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
//pdu->rx_indication_rel8.tl.tag = NFAPI_RX_INDICATION_REL8_TAG;
pdu->rx_ue_information.rnti = eNB->ulsch_NB_IoT[0]->rnti;
pdu->rx_indication_rel8.length = eNB->ulsch_NB_IoT[0]->harq_process->TBS>>3;
pdu->data = eNB->ulsch_NB_IoT[0]->harq_process->b;
//pdu->data = eNB->ulsch_NB_IoT[UE_id]->harq_processes[harq_pid]->b;
//eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus++;
//eNB->UL_INFO.rx_ind.sfn_sf = frame<<4 | subframe;
// do we need to transmit timing ?? however, the nfapi structure does not include timing paramters !!!!!
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
}
void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const relaying_type_t r_type) void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const relaying_type_t r_type)
{ {
......
...@@ -649,19 +649,14 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam ...@@ -649,19 +649,14 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
// UE-specific RX processing for subframe n // UE-specific RX processing for subframe n
///////////////////////////////////// for NB-IoT testing //////////////////////// ///////////////////////////////////// for NB-IoT testing ////////////////////////
// for NB-IoT testing // activating only TX part // for NB-IoT testing // activating only TX part
/// if (eNB->proc_uespec_rx) eNB->proc_uespec_rx(eNB, proc, no_relay ); if (eNB->proc_uespec_rx) eNB->proc_uespec_rx(eNB, proc, no_relay );
////////////////////////////////////END/////////////////////// ////////////////////////////////////END///////////////////////
//npusch_procedures(eNB,proc,data_or_control);
//fill_rx_indication(eNB,i,frame,subframe);
//////////////////////////////////// for IF Module/scheduler testing //////////////////////////////////// for IF Module/scheduler testing
//LOG_I(PHY,"Before UL_indication\n");
eNB->UL_INFO.frame = proc->frame_rx;
eNB->UL_INFO.subframe = proc->subframe_rx;
eNB->UL_INFO.module_id = eNB->Mod_id;
eNB->UL_INFO.CC_id = eNB->CC_id;
//eNB->if_inst->UL_indication(&eNB->UL_INFO);
//LOG_I(PHY,"After UL_indication\n"); //LOG_I(PHY,"After UL_indication\n");
// ***************************************** // *****************************************
// TX processing for subframe n+4 // TX processing for subframe n+4
...@@ -2212,7 +2207,10 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst ...@@ -2212,7 +2207,10 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst
eNB->fep = eNB_fep_full;//(single_thread_flag==1) ? eNB_fep_full_2thread : eNB_fep_full; eNB->fep = eNB_fep_full;//(single_thread_flag==1) ? eNB_fep_full_2thread : eNB_fep_full;
eNB->td = ulsch_decoding_data;//(single_thread_flag==1) ? ulsch_decoding_data_2thread : ulsch_decoding_data; eNB->td = ulsch_decoding_data;//(single_thread_flag==1) ? ulsch_decoding_data_2thread : ulsch_decoding_data;
eNB->te = dlsch_encoding;//(single_thread_flag==1) ? dlsch_encoding_2threads : dlsch_encoding; eNB->te = dlsch_encoding;//(single_thread_flag==1) ? dlsch_encoding_2threads : dlsch_encoding;
eNB->proc_uespec_rx = phy_procedures_eNB_uespec_RX; ////////////////////// NB-IoT testing ////////////////////
//eNB->proc_uespec_rx = phy_procedures_eNB_uespec_RX;
eNB->proc_uespec_rx = phy_procedures_eNB_uespec_RX_NB_IoT;
eNB->proc_tx = proc_tx_full; eNB->proc_tx = proc_tx_full;
eNB->tx_fh = NULL; eNB->tx_fh = NULL;
eNB->rx_fh = rx_rf; eNB->rx_fh = rx_rf;
......
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