Commit 9ac6dfee authored by cig's avatar cig

Minor fixes UE

- added some descriptions to the code
- fixed hardcoded factors
- removed commented out and unused code
- phy_procedures_nrUE_RX: removed unused do_pdcch_flag
- updated LTE naming to 5G
parent 7ab4abac
...@@ -422,7 +422,7 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) { ...@@ -422,7 +422,7 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
phy_procedures_slot_parallelization_nrUE_RX( UE, proc, 0, 0, 1, UE->mode, no_relay, NULL ); phy_procedures_slot_parallelization_nrUE_RX( UE, proc, 0, 0, 1, UE->mode, no_relay, NULL );
#else #else
uint64_t a=rdtsc(); uint64_t a=rdtsc();
phy_procedures_nrUE_RX( UE, proc, 0, 1, UE->mode); phy_procedures_nrUE_RX( UE, proc, 0, UE->mode);
LOG_D(PHY,"phy_procedures_nrUE_RX: slot:%d, time %lu\n", proc->nr_tti_rx, (rdtsc()-a)/3500); LOG_D(PHY,"phy_procedures_nrUE_RX: slot:%d, time %lu\n", proc->nr_tti_rx, (rdtsc()-a)/3500);
//printf(">>> nr_ue_pdcch_procedures ended\n"); //printf(">>> nr_ue_pdcch_procedures ended\n");
#endif #endif
......
...@@ -469,6 +469,9 @@ int32_t nr_segmentation(unsigned char *input_buffer, ...@@ -469,6 +469,9 @@ int32_t nr_segmentation(unsigned char *input_buffer,
unsigned int *F, unsigned int *F,
uint8_t BG); uint8_t BG);
/*!\fn uint32_t nr_compute_tbs
\brief This function returns the TBS in bits as per 6.1.4.2 of TS 38.214
*/
uint32_t nr_compute_tbs(uint16_t Qm, uint32_t nr_compute_tbs(uint16_t Qm,
uint16_t R, uint16_t R,
uint16_t nb_rb, uint16_t nb_rb,
......
...@@ -912,10 +912,6 @@ typedef struct { ...@@ -912,10 +912,6 @@ typedef struct {
char ulsch_no_allocation_counter[NUMBER_OF_CONNECTED_eNB_MAX]; char ulsch_no_allocation_counter[NUMBER_OF_CONNECTED_eNB_MAX];
unsigned char ulsch_Msg3_active[NUMBER_OF_CONNECTED_gNB_MAX]; unsigned char ulsch_Msg3_active[NUMBER_OF_CONNECTED_gNB_MAX];
uint32_t ulsch_Msg3_frame[NUMBER_OF_CONNECTED_gNB_MAX];
unsigned char ulsch_Msg3_subframe[NUMBER_OF_CONNECTED_gNB_MAX];
uint8_t Msg3_startSymbol[NUMBER_OF_CONNECTED_gNB_MAX];
uint8_t Msg3_Length[NUMBER_OF_CONNECTED_gNB_MAX];
NR_PRACH_RESOURCES_t *prach_resources[NUMBER_OF_CONNECTED_gNB_MAX]; NR_PRACH_RESOURCES_t *prach_resources[NUMBER_OF_CONNECTED_gNB_MAX];
int turbo_iterations, turbo_cntl_iterations; int turbo_iterations, turbo_cntl_iterations;
......
...@@ -111,17 +111,18 @@ int phy_procedures_RN_UE_RX(unsigned char last_slot, unsigned char next_slot, re ...@@ -111,17 +111,18 @@ int phy_procedures_RN_UE_RX(unsigned char last_slot, unsigned char next_slot, re
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying @param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
*/ */
void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id, uint8_t thread_id); void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id, uint8_t thread_id);
/*! \brief Scheduling for UE RX procedures in normal subframes. /*! \brief Scheduling for UE RX procedures in normal subframes.
@param last_slot Index of last slot (0-19) @param ue Pointer to UE variables on which to act
@param phy_vars_ue Pointer to UE variables on which to act @param proc Pointer to proc information
@param proc Pointer to RXn_TXnp4 proc information @param gNB_id Local id of eNB on which to act
@param eNB_id Local id of eNB on which to act @param mode calibration/debug mode
@param abstraction_flag Indicator of PHY abstraction
@param mode calibration/debug mode
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
@param phy_vars_rn pointer to RN variables
*/ */
int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t do_pdcch_flag,runmode_t mode); int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc,
uint8_t gNB_id,
runmode_t mode);
int phy_procedures_slot_parallelization_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,uint8_t do_pdcch_flag,runmode_t mode,relaying_type_t r_type); int phy_procedures_slot_parallelization_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,uint8_t do_pdcch_flag,runmode_t mode,relaying_type_t r_type);
......
...@@ -57,10 +57,6 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ ...@@ -57,10 +57,6 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
NR_UE_PDCCH *pdcch_vars = PHY_vars_UE_g[module_id][cc_id]->pdcch_vars[thread_id][0]; NR_UE_PDCCH *pdcch_vars = PHY_vars_UE_g[module_id][cc_id]->pdcch_vars[thread_id][0];
NR_UE_ULSCH_t *ulsch0 = PHY_vars_UE_g[module_id][cc_id]->ulsch[thread_id][0][0]; NR_UE_ULSCH_t *ulsch0 = PHY_vars_UE_g[module_id][cc_id]->ulsch[thread_id][0][0];
NR_DL_FRAME_PARMS frame_parms = PHY_vars_UE_g[module_id][cc_id]->frame_parms; NR_DL_FRAME_PARMS frame_parms = PHY_vars_UE_g[module_id][cc_id]->frame_parms;
//PRACH_RESOURCES_t *prach_resources = PHY_vars_UE_g[module_id][cc_id]->prach_resources[0];
// PUCCH_ConfigCommon_nr_t *pucch_config_common = PHY_vars_UE_g[module_id][cc_id]->pucch_config_common_nr[0];
// PUCCH_Config_t *pucch_config_dedicated = PHY_vars_UE_g[module_id][cc_id]->pucch_config_dedicated_nr[0];
if(scheduled_response->dl_config != NULL){ if(scheduled_response->dl_config != NULL){
fapi_nr_dl_config_request_t *dl_config = scheduled_response->dl_config; fapi_nr_dl_config_request_t *dl_config = scheduled_response->dl_config;
...@@ -93,7 +89,6 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ ...@@ -93,7 +89,6 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
dlsch0->current_harq_pid = current_harq_pid; dlsch0->current_harq_pid = current_harq_pid;
dlsch0->active = 1; dlsch0->active = 1;
dlsch0->rnti = dl_config->dl_config_list[i].dlsch_config_pdu.rnti; dlsch0->rnti = dl_config->dl_config_list[i].dlsch_config_pdu.rnti;
//dlsch0->harq_processes[0]->mcs = &dlsch_config_pdu->mcs;
dlsch0_harq = dlsch0->harq_processes[current_harq_pid]; dlsch0_harq = dlsch0->harq_processes[current_harq_pid];
if (dlsch0_harq){ if (dlsch0_harq){
...@@ -121,8 +116,6 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ ...@@ -121,8 +116,6 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
} }
} }
dl_config->number_pdus = 0; dl_config->number_pdus = 0;
} else {
pdcch_vars->nb_search_space = 0;
} }
if (scheduled_response->ul_config != NULL){ if (scheduled_response->ul_config != NULL){
...@@ -162,7 +155,6 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ ...@@ -162,7 +155,6 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
if (scheduled_response->tx_request){ // TBR todo here it should loop through the number of tx pdus if (scheduled_response->tx_request){ // TBR todo here it should loop through the number of tx pdus
fapi_nr_tx_request_body_t *tx_req_body = scheduled_response->tx_request->tx_request_body; fapi_nr_tx_request_body_t *tx_req_body = scheduled_response->tx_request->tx_request_body;
//harq_process_ul_ue->a = (unsigned char*)calloc(TBS/8, sizeof(unsigned char));
memcpy(harq_process_ul_ue->a, tx_req_body->pdu, tx_req_body->pdu_length); memcpy(harq_process_ul_ue->a, tx_req_body->pdu, tx_req_body->pdu_length);
harq_process_ul_ue->status = ACTIVE; harq_process_ul_ue->status = ACTIVE;
...@@ -225,7 +217,6 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ ...@@ -225,7 +217,6 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
case (FAPI_NR_UL_CONFIG_TYPE_PRACH): case (FAPI_NR_UL_CONFIG_TYPE_PRACH):
// prach config pdu // prach config pdu
//prach_resources = PHY_vars_UE_g[module_id][cc_id]->prach_resources[gNB_id];
prach_config_pdu = &ul_config->ul_config_list[i].prach_config_pdu; prach_config_pdu = &ul_config->ul_config_list[i].prach_config_pdu;
memcpy((void*)&(PHY_vars_UE_g[module_id][cc_id]->prach_vars[gNB_id]->prach_pdu), (void*)prach_config_pdu, sizeof(fapi_nr_ul_config_prach_pdu)); memcpy((void*)&(PHY_vars_UE_g[module_id][cc_id]->prach_vars[gNB_id]->prach_pdu), (void*)prach_config_pdu, sizeof(fapi_nr_ul_config_prach_pdu));
PHY_vars_UE_g[module_id][cc_id]->prach_vars[gNB_id]->prach_Config_enabled = 1; PHY_vars_UE_g[module_id][cc_id]->prach_vars[gNB_id]->prach_Config_enabled = 1;
......
...@@ -1627,8 +1627,7 @@ int is_pbch_in_slot(fapi_nr_config_request_t *config, int frame, int slot, NR_DL ...@@ -1627,8 +1627,7 @@ int is_pbch_in_slot(fapi_nr_config_request_t *config, int frame, int slot, NR_DL
int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc, UE_nr_rxtx_proc_t *proc,
uint8_t eNB_id, uint8_t gNB_id,
uint8_t do_pdcch_flag,
runmode_t mode) runmode_t mode)
{ {
int frame_rx = proc->frame_rx; int frame_rx = proc->frame_rx;
...@@ -1679,13 +1678,13 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, ...@@ -1679,13 +1678,13 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
#endif #endif
} }
nr_ue_pbch_procedures(eNB_id,ue,proc,0); nr_ue_pbch_procedures(gNB_id, ue, proc, 0);
if (ue->no_timing_correction==0) { if (ue->no_timing_correction==0) {
LOG_I(PHY,"start adjust sync slot = %d no timing %d\n", nr_tti_rx, ue->no_timing_correction); LOG_I(PHY,"start adjust sync slot = %d no timing %d\n", nr_tti_rx, ue->no_timing_correction);
nr_adjust_synch_ue(fp, nr_adjust_synch_ue(fp,
ue, ue,
eNB_id, gNB_id,
frame_rx, frame_rx,
nr_tti_rx, nr_tti_rx,
0, 0,
...@@ -1726,19 +1725,19 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, ...@@ -1726,19 +1725,19 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
#endif #endif
//printf("phy procedure pdcch start measurement l =%d\n",l); //printf("phy procedure pdcch start measurement l =%d\n",l);
//nr_ue_measurement_procedures(l,ue,proc,eNB_id,(nr_tti_rx),mode); //nr_ue_measurement_procedures(l,ue,proc,gNB_id,(nr_tti_rx),mode);
} }
dci_cnt = nr_ue_pdcch_procedures(eNB_id, ue, proc); dci_cnt = nr_ue_pdcch_procedures(gNB_id, ue, proc);
if (dci_cnt > 0) { if (dci_cnt > 0) {
LOG_D(PHY,"[UE %d] Frame %d, nr_tti_rx %d: found %d DCIs\n", ue->Mod_id, frame_rx, nr_tti_rx, dci_cnt); LOG_D(PHY,"[UE %d] Frame %d, nr_tti_rx %d: found %d DCIs\n", ue->Mod_id, frame_rx, nr_tti_rx, dci_cnt);
NR_UE_DLSCH_t *dlsch = NULL; NR_UE_DLSCH_t *dlsch = NULL;
if (ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active == 1){ if (ue->dlsch[ue->current_thread_id[nr_tti_rx]][gNB_id][0]->active == 1){
dlsch = ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]; dlsch = ue->dlsch[ue->current_thread_id[nr_tti_rx]][gNB_id][0];
} else if (ue->dlsch_ra[0]->active == 1){ } else if (ue->dlsch_ra[0]->active == 1){
dlsch = ue->dlsch_ra[0]; dlsch = ue->dlsch_ra[0];
} }
...@@ -1774,64 +1773,64 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, ...@@ -1774,64 +1773,64 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
start_meas(&ue->generic_stat); start_meas(&ue->generic_stat);
#endif #endif
// do procedures for C-RNTI // do procedures for C-RNTI
if (ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active == 1) { if (ue->dlsch[ue->current_thread_id[nr_tti_rx]][gNB_id][0]->active == 1) {
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN);
nr_ue_pdsch_procedures(ue, nr_ue_pdsch_procedures(ue,
proc, proc,
eNB_id, gNB_id,
PDSCH, PDSCH,
ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0], ue->dlsch[ue->current_thread_id[nr_tti_rx]][gNB_id][0],
NULL); NULL);
//printf("phy procedure pdsch start measurement\n"); //printf("phy procedure pdsch start measurement\n");
nr_ue_measurement_procedures(2,ue,proc,eNB_id,nr_tti_rx,mode); nr_ue_measurement_procedures(2,ue,proc,gNB_id,nr_tti_rx,mode);
/* /*
write_output("rxF.m","rxF",&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[nr_tti_rx]].rxdataF[0][0],fp->ofdm_symbol_size*14,1,1); write_output("rxF.m","rxF",&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[nr_tti_rx]].rxdataF[0][0],fp->ofdm_symbol_size*14,1,1);
write_output("rxF_ch.m","rxFch",&ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->dl_ch_estimates[0][0],fp->ofdm_symbol_size*14,1,1); write_output("rxF_ch.m","rxFch",&ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][gNB_id]->dl_ch_estimates[0][0],fp->ofdm_symbol_size*14,1,1);
write_output("rxF_ch_ext.m","rxFche",&ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->dl_ch_estimates_ext[0][2*50*12],50*12,1,1); write_output("rxF_ch_ext.m","rxFche",&ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][gNB_id]->dl_ch_estimates_ext[0][2*50*12],50*12,1,1);
write_output("rxF_ext.m","rxFe",&ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->rxdataF_ext[0][0],50*12*14,1,1); write_output("rxF_ext.m","rxFe",&ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][gNB_id]->rxdataF_ext[0][0],50*12*14,1,1);
write_output("rxF_comp.m","rxFc",&ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->rxdataF_comp0[0][0],fp->N_RB_DL*12*14,1,1); write_output("rxF_comp.m","rxFc",&ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][gNB_id]->rxdataF_comp0[0][0],fp->N_RB_DL*12*14,1,1);
write_output("rxF_llr.m","rxFllr",ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->llr[0],(nb_symb_sch-1)*50*12+50*6,1,0); write_output("rxF_llr.m","rxFllr",ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][gNB_id]->llr[0],(nb_symb_sch-1)*50*12+50*6,1,0);
*/ */
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_OUT); //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_OUT);
} }
// do procedures for SI-RNTI // do procedures for SI-RNTI
if ((ue->dlsch_SI[eNB_id]) && (ue->dlsch_SI[eNB_id]->active == 1)) { if ((ue->dlsch_SI[gNB_id]) && (ue->dlsch_SI[gNB_id]->active == 1)) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_SI, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_SI, VCD_FUNCTION_IN);
nr_ue_pdsch_procedures(ue, nr_ue_pdsch_procedures(ue,
proc, proc,
eNB_id, gNB_id,
SI_PDSCH, SI_PDSCH,
ue->dlsch_SI[eNB_id], ue->dlsch_SI[gNB_id],
NULL); NULL);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_SI, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_SI, VCD_FUNCTION_OUT);
} }
// do procedures for SI-RNTI // do procedures for SI-RNTI
if ((ue->dlsch_p[eNB_id]) && (ue->dlsch_p[eNB_id]->active == 1)) { if ((ue->dlsch_p[gNB_id]) && (ue->dlsch_p[gNB_id]->active == 1)) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_P, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_P, VCD_FUNCTION_IN);
nr_ue_pdsch_procedures(ue, nr_ue_pdsch_procedures(ue,
proc, proc,
eNB_id, gNB_id,
P_PDSCH, P_PDSCH,
ue->dlsch_p[eNB_id], ue->dlsch_p[gNB_id],
NULL); NULL);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_P, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_P, VCD_FUNCTION_OUT);
} }
// do procedures for RA-RNTI // do procedures for RA-RNTI
if ((ue->dlsch_ra[eNB_id]) && (ue->dlsch_ra[eNB_id]->active == 1)) { if ((ue->dlsch_ra[gNB_id]) && (ue->dlsch_ra[gNB_id]->active == 1)) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_RA, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_RA, VCD_FUNCTION_IN);
nr_ue_pdsch_procedures(ue, nr_ue_pdsch_procedures(ue,
proc, proc,
eNB_id, gNB_id,
RA_PDSCH, RA_PDSCH,
ue->dlsch_ra[eNB_id], ue->dlsch_ra[gNB_id],
NULL); NULL);
// #if UE_TIMING_TRACE // #if UE_TIMING_TRACE
...@@ -1840,11 +1839,11 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, ...@@ -1840,11 +1839,11 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
nr_ue_dlsch_procedures(ue, nr_ue_dlsch_procedures(ue,
proc, proc,
eNB_id, gNB_id,
RA_PDSCH, RA_PDSCH,
ue->dlsch_ra[eNB_id], ue->dlsch_ra[gNB_id],
NULL, NULL,
&ue->dlsch_ra_errors[eNB_id], &ue->dlsch_ra_errors[gNB_id],
mode); mode);
// #if UE_TIMING_TRACE // #if UE_TIMING_TRACE
...@@ -1862,7 +1861,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, ...@@ -1862,7 +1861,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
} }
// do procedures for C-RNTI // do procedures for C-RNTI
if (ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active == 1) { if (ue->dlsch[ue->current_thread_id[nr_tti_rx]][gNB_id][0]->active == 1) {
LOG_D(PHY, "DLSCH data reception at nr_tti_rx: %d \n \n", nr_tti_rx); LOG_D(PHY, "DLSCH data reception at nr_tti_rx: %d \n \n", nr_tti_rx);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN);
...@@ -1873,11 +1872,11 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, ...@@ -1873,11 +1872,11 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
nr_ue_dlsch_procedures(ue, nr_ue_dlsch_procedures(ue,
proc, proc,
eNB_id, gNB_id,
PDSCH, PDSCH,
ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0], ue->dlsch[ue->current_thread_id[nr_tti_rx]][gNB_id][0],
ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][1], ue->dlsch[ue->current_thread_id[nr_tti_rx]][gNB_id][1],
&ue->dlsch_errors[eNB_id], &ue->dlsch_errors[gNB_id],
mode); mode);
...@@ -1894,7 +1893,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, ...@@ -1894,7 +1893,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
#endif #endif
// deactivate dlsch once dlsch proc is done // deactivate dlsch once dlsch proc is done
ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active = 0; ue->dlsch[ue->current_thread_id[nr_tti_rx]][gNB_id][0]->active = 0;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_OUT);
...@@ -1905,9 +1904,9 @@ start_meas(&ue->generic_stat); ...@@ -1905,9 +1904,9 @@ start_meas(&ue->generic_stat);
#if 0 #if 0
if(nr_tti_rx==5 && ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->harq_processes[ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->current_harq_pid]->nb_rb > 20){ if(nr_tti_rx==5 && ue->dlsch[ue->current_thread_id[nr_tti_rx]][gNB_id][0]->harq_processes[ue->dlsch[ue->current_thread_id[nr_tti_rx]][gNB_id][0]->current_harq_pid]->nb_rb > 20){
//write_output("decoder_llr.m","decllr",dlsch_llr,G,1,0); //write_output("decoder_llr.m","decllr",dlsch_llr,G,1,0);
//write_output("llr.m","llr", &ue->pdsch_vars[eNB_id]->llr[0][0],(14*nb_rb*12*dlsch1_harq->Qm) - 4*(nb_rb*4*dlsch1_harq->Qm),1,0); //write_output("llr.m","llr", &ue->pdsch_vars[gNB_id]->llr[0][0],(14*nb_rb*12*dlsch1_harq->Qm) - 4*(nb_rb*4*dlsch1_harq->Qm),1,0);
write_output("rxdataF0_current.m" , "rxdataF0", &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[nr_tti_rx]].rxdataF[0][0],14*fp->ofdm_symbol_size,1,1); write_output("rxdataF0_current.m" , "rxdataF0", &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[nr_tti_rx]].rxdataF[0][0],14*fp->ofdm_symbol_size,1,1);
//write_output("rxdataF0_previous.m" , "rxdataF0_prev_sss", &ue->common_vars.common_vars_rx_data_per_thread[next_thread_id].rxdataF[0][0],14*fp->ofdm_symbol_size,1,1); //write_output("rxdataF0_previous.m" , "rxdataF0_prev_sss", &ue->common_vars.common_vars_rx_data_per_thread[next_thread_id].rxdataF[0][0],14*fp->ofdm_symbol_size,1,1);
...@@ -1925,78 +1924,78 @@ start_meas(&ue->generic_stat); ...@@ -1925,78 +1924,78 @@ start_meas(&ue->generic_stat);
#endif #endif
// do procedures for SI-RNTI // do procedures for SI-RNTI
if ((ue->dlsch_SI[eNB_id]) && (ue->dlsch_SI[eNB_id]->active == 1)) { if ((ue->dlsch_SI[gNB_id]) && (ue->dlsch_SI[gNB_id]->active == 1)) {
nr_ue_pdsch_procedures(ue, nr_ue_pdsch_procedures(ue,
proc, proc,
eNB_id, gNB_id,
SI_PDSCH, SI_PDSCH,
ue->dlsch_SI[eNB_id], ue->dlsch_SI[gNB_id],
NULL); NULL);
/*ue_dlsch_procedures(ue, /*ue_dlsch_procedures(ue,
proc, proc,
eNB_id, gNB_id,
SI_PDSCH, SI_PDSCH,
ue->dlsch_SI[eNB_id], ue->dlsch_SI[gNB_id],
NULL, NULL,
&ue->dlsch_SI_errors[eNB_id], &ue->dlsch_SI_errors[gNB_id],
mode, mode,
abstraction_flag); abstraction_flag);
ue->dlsch_SI[eNB_id]->active = 0;*/ ue->dlsch_SI[gNB_id]->active = 0;*/
} }
// do procedures for P-RNTI // do procedures for P-RNTI
if ((ue->dlsch_p[eNB_id]) && (ue->dlsch_p[eNB_id]->active == 1)) { if ((ue->dlsch_p[gNB_id]) && (ue->dlsch_p[gNB_id]->active == 1)) {
nr_ue_pdsch_procedures(ue, nr_ue_pdsch_procedures(ue,
proc, proc,
eNB_id, gNB_id,
P_PDSCH, P_PDSCH,
ue->dlsch_p[eNB_id], ue->dlsch_p[gNB_id],
NULL); NULL);
/*ue_dlsch_procedures(ue, /*ue_dlsch_procedures(ue,
proc, proc,
eNB_id, gNB_id,
P_PDSCH, P_PDSCH,
ue->dlsch_p[eNB_id], ue->dlsch_p[gNB_id],
NULL, NULL,
&ue->dlsch_p_errors[eNB_id], &ue->dlsch_p_errors[gNB_id],
mode, mode,
abstraction_flag);*/ abstraction_flag);*/
ue->dlsch_p[eNB_id]->active = 0; ue->dlsch_p[gNB_id]->active = 0;
} }
// do procedures for RA-RNTI // do procedures for RA-RNTI
if ((ue->dlsch_ra[eNB_id]) && (ue->dlsch_ra[eNB_id]->active == 1)) { if ((ue->dlsch_ra[gNB_id]) && (ue->dlsch_ra[gNB_id]->active == 1)) {
nr_ue_pdsch_procedures(ue, nr_ue_pdsch_procedures(ue,
proc, proc,
eNB_id, gNB_id,
RA_PDSCH, RA_PDSCH,
ue->dlsch_ra[eNB_id], ue->dlsch_ra[gNB_id],
NULL); NULL);
/*ue_dlsch_procedures(ue, /*ue_dlsch_procedures(ue,
proc, proc,
eNB_id, gNB_id,
RA_PDSCH, RA_PDSCH,
ue->dlsch_ra[eNB_id], ue->dlsch_ra[gNB_id],
NULL, NULL,
&ue->dlsch_ra_errors[eNB_id], &ue->dlsch_ra_errors[gNB_id],
mode, mode,
abstraction_flag);*/ abstraction_flag);*/
ue->dlsch_ra[eNB_id]->active = 0; ue->dlsch_ra[gNB_id]->active = 0;
} }
// duplicate harq structure // duplicate harq structure
/* /*
uint8_t current_harq_pid = ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->current_harq_pid; uint8_t current_harq_pid = ue->dlsch[ue->current_thread_id[nr_tti_rx]][gNB_id][0]->current_harq_pid;
NR_DL_UE_HARQ_t *current_harq_processes = ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->harq_processes[current_harq_pid]; NR_DL_UE_HARQ_t *current_harq_processes = ue->dlsch[ue->current_thread_id[nr_tti_rx]][gNB_id][0]->harq_processes[current_harq_pid];
NR_DL_UE_HARQ_t *harq_processes_dest = ue->dlsch[next1_thread_id][eNB_id][0]->harq_processes[current_harq_pid]; NR_DL_UE_HARQ_t *harq_processes_dest = ue->dlsch[next1_thread_id][gNB_id][0]->harq_processes[current_harq_pid];
NR_DL_UE_HARQ_t *harq_processes_dest1 = ue->dlsch[next2_thread_id][eNB_id][0]->harq_processes[current_harq_pid]; NR_DL_UE_HARQ_t *harq_processes_dest1 = ue->dlsch[next2_thread_id][gNB_id][0]->harq_processes[current_harq_pid];
*/ */
/*nr_harq_status_t *current_harq_ack = &ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->harq_ack[nr_tti_rx]; /*nr_harq_status_t *current_harq_ack = &ue->dlsch[ue->current_thread_id[nr_tti_rx]][gNB_id][0]->harq_ack[nr_tti_rx];
nr_harq_status_t *harq_ack_dest = &ue->dlsch[next1_thread_id][eNB_id][0]->harq_ack[nr_tti_rx]; nr_harq_status_t *harq_ack_dest = &ue->dlsch[next1_thread_id][gNB_id][0]->harq_ack[nr_tti_rx];
nr_harq_status_t *harq_ack_dest1 = &ue->dlsch[next2_thread_id][eNB_id][0]->harq_ack[nr_tti_rx]; nr_harq_status_t *harq_ack_dest1 = &ue->dlsch[next2_thread_id][gNB_id][0]->harq_ack[nr_tti_rx];
*/ */
//copy_harq_proc_struct(harq_processes_dest, current_harq_processes); //copy_harq_proc_struct(harq_processes_dest, current_harq_processes);
...@@ -2007,23 +2006,23 @@ start_meas(&ue->generic_stat); ...@@ -2007,23 +2006,23 @@ start_meas(&ue->generic_stat);
if (nr_tti_rx==9) { if (nr_tti_rx==9) {
if (frame_rx % 10 == 0) { if (frame_rx % 10 == 0) {
if ((ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]) != 0) if ((ue->dlsch_received[gNB_id] - ue->dlsch_received_last[gNB_id]) != 0)
ue->dlsch_fer[eNB_id] = (100*(ue->dlsch_errors[eNB_id] - ue->dlsch_errors_last[eNB_id]))/(ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]); ue->dlsch_fer[gNB_id] = (100*(ue->dlsch_errors[gNB_id] - ue->dlsch_errors_last[gNB_id]))/(ue->dlsch_received[gNB_id] - ue->dlsch_received_last[gNB_id]);
ue->dlsch_errors_last[eNB_id] = ue->dlsch_errors[eNB_id]; ue->dlsch_errors_last[gNB_id] = ue->dlsch_errors[gNB_id];
ue->dlsch_received_last[eNB_id] = ue->dlsch_received[eNB_id]; ue->dlsch_received_last[gNB_id] = ue->dlsch_received[gNB_id];
} }
ue->bitrate[eNB_id] = (ue->total_TBS[eNB_id] - ue->total_TBS_last[eNB_id])*100; ue->bitrate[gNB_id] = (ue->total_TBS[gNB_id] - ue->total_TBS_last[gNB_id])*100;
ue->total_TBS_last[eNB_id] = ue->total_TBS[eNB_id]; ue->total_TBS_last[gNB_id] = ue->total_TBS[gNB_id];
LOG_D(PHY,"[UE %d] Calculating bitrate Frame %d: total_TBS = %d, total_TBS_last = %d, bitrate %f kbits\n", LOG_D(PHY,"[UE %d] Calculating bitrate Frame %d: total_TBS = %d, total_TBS_last = %d, bitrate %f kbits\n",
ue->Mod_id,frame_rx,ue->total_TBS[eNB_id], ue->Mod_id,frame_rx,ue->total_TBS[gNB_id],
ue->total_TBS_last[eNB_id],(float) ue->bitrate[eNB_id]/1000.0); ue->total_TBS_last[gNB_id],(float) ue->bitrate[gNB_id]/1000.0);
#if UE_AUTOTEST_TRACE #if UE_AUTOTEST_TRACE
if ((frame_rx % 100 == 0)) { if ((frame_rx % 100 == 0)) {
LOG_I(PHY,"[UE %d] AUTOTEST Metric : UE_DLSCH_BITRATE = %5.2f kbps (frame = %d) \n", ue->Mod_id, (float) ue->bitrate[eNB_id]/1000.0, frame_rx); LOG_I(PHY,"[UE %d] AUTOTEST Metric : UE_DLSCH_BITRATE = %5.2f kbps (frame = %d) \n", ue->Mod_id, (float) ue->bitrate[gNB_id]/1000.0, frame_rx);
} }
#endif #endif
...@@ -2035,7 +2034,7 @@ printf("after tubo until end of Rx %5.2f \n",ue->generic_stat.p_time/(cpuf*1000. ...@@ -2035,7 +2034,7 @@ printf("after tubo until end of Rx %5.2f \n",ue->generic_stat.p_time/(cpuf*1000.
#endif #endif
#ifdef EMOS #ifdef EMOS
phy_procedures_emos_UE_RX(ue,slot,eNB_id); phy_procedures_emos_UE_RX(ue,slot,gNB_id);
#endif #endif
......
...@@ -191,7 +191,6 @@ int main(int argc, char **argv) ...@@ -191,7 +191,6 @@ int main(int argc, char **argv)
NR_UE_MAC_INST_t *UE_mac; NR_UE_MAC_INST_t *UE_mac;
int cyclic_prefix_type = NFAPI_CP_NORMAL; int cyclic_prefix_type = NFAPI_CP_NORMAL;
int run_initial_sync=0; int run_initial_sync=0;
int do_pdcch_flag=1;
int loglvl=OAILOG_INFO; int loglvl=OAILOG_INFO;
...@@ -848,7 +847,6 @@ int main(int argc, char **argv) ...@@ -848,7 +847,6 @@ int main(int argc, char **argv)
phy_procedures_nrUE_RX(UE, phy_procedures_nrUE_RX(UE,
&UE_proc, &UE_proc,
0, 0,
do_pdcch_flag,
normal_txrx); normal_txrx);
//printf("dlsim round %d ends\n",round); //printf("dlsim round %d ends\n",round);
......
...@@ -27,12 +27,15 @@ ...@@ -27,12 +27,15 @@
#include "common/utils/nr/nr_common.h" #include "common/utils/nr/nr_common.h"
#include <math.h> #include <math.h>
#include "PHY/defs_nr_common.h"
//Table 5.1.2.2-2 //Table 5.1.2.2-2
uint16_t Tbstable_nr[INDEX_MAX_TBS_TABLE] = {24,32,40,48,56,64,72,80,88,96,104,112,120,128,136,144,152,160,168,176,184,192,208,224,240,256,272,288,304,320,336,352,368,384,408,432,456,480,504,528,552,576,608,640,672,704,736,768,808,848,888,928,984,1032,1064,1128,1160,1192,1224,1256,1288,1320,1352,1416,1480,1544,1608,1672,1736,1800,1864,1928,2024,2088,2152,2216,2280,2408,2472,2536,2600,2664,2728,2792,2856,2976,3104,3240,3368,3496,3624,3752,3824}; uint16_t Tbstable_nr[INDEX_MAX_TBS_TABLE] = {24,32,40,48,56,64,72,80,88,96,104,112,120,128,136,144,152,160,168,176,184,192,208,224,240,256,272,288,304,320,336,352,368,384,408,432,456,480,504,528,552,576,608,640,672,704,736,768,808,848,888,928,984,1032,1064,1128,1160,1192,1224,1256,1288,1320,1352,1416,1480,1544,1608,1672,1736,1800,1864,1928,2024,2088,2152,2216,2280,2408,2472,2536,2600,2664,2728,2792,2856,2976,3104,3240,3368,3496,3624,3752,3824};
uint16_t NPRB_LBRM[7] = {32,66,107,135,162,217,273}; uint16_t NPRB_LBRM[7] = {32,66,107,135,162,217,273};
// Transport block size determination according to 6.1.4.2 of TS 38.214
// returns the TBS in bits
uint32_t nr_compute_tbs(uint16_t Qm, uint32_t nr_compute_tbs(uint16_t Qm,
uint16_t R, uint16_t R,
uint16_t nb_rb, uint16_t nb_rb,
...@@ -48,7 +51,7 @@ uint32_t nr_compute_tbs(uint16_t Qm, ...@@ -48,7 +51,7 @@ uint32_t nr_compute_tbs(uint16_t Qm,
uint32_t Ninfo, Np_info, C; uint32_t Ninfo, Np_info, C;
uint8_t n, scale; uint8_t n, scale;
nbp_re = 12 * nb_symb_sch - nb_dmrs_prb - nb_rb_oh; nbp_re = NR_NB_SC_PER_RB * nb_symb_sch - nb_dmrs_prb - nb_rb_oh;
nb_re = min(156, nbp_re) * nb_rb; nb_re = min(156, nbp_re) * nb_rb;
scale = (R>1024)?11:10; scale = (R>1024)?11:10;
// Intermediate number of information bits // Intermediate number of information bits
......
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