diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 94ce740e47..cd1bfd14b6 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -144,12 +144,10 @@ extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset); #define TICK_TO_US(ts) (ts.trials==0?0:ts.diff/ts.trials) static inline int rxtx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_tx, int slot_tx, char *thread_name) { -struct timespec current; -clock_gettime(CLOCK_MONOTONIC, ¤t); sl_ahead = sf_ahead*gNB->frame_parms.slots_per_subframe; nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; - + start_meas(&softmodem_stats_rxtx_sf); // ******************************************************************* @@ -161,7 +159,6 @@ clock_gettime(CLOCK_MONOTONIC, ¤t); //LOG_D(PHY, "oai_subframe_ind(frame:%u, subframe:%d) - NOT CALLED ********\n", frame, subframe); start_meas(&nfapi_meas); // oai_subframe_ind(frame_rx, slot_rx); - oai_slot_ind(frame_rx, slot_rx); stop_meas(&nfapi_meas); @@ -253,7 +250,7 @@ clock_gettime(CLOCK_MONOTONIC, ¤t); gNB->UL_INFO.CC_id = gNB->CC_id; gNB->if_inst->NR_UL_indication(&gNB->UL_INFO); pthread_mutex_unlock(&gNB->UL_INFO_mutex); - + // RX processing int tx_slot_type = nr_slot_select(cfg,frame_tx,slot_tx); int rx_slot_type = nr_slot_select(cfg,frame_rx,slot_rx); diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 9144d99898..73421d8ed7 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -98,8 +98,6 @@ static int DEFBFW[] = {0x00007fff}; extern volatile int oai_exit; -extern struct timespec timespec_sub(struct timespec lhs, struct timespec rhs); -extern struct timespec timespec_add(struct timespec lhs, struct timespec rhs); extern void nr_phy_free_RU(RU_t *); extern void nr_phy_config_request(NR_PHY_Config_t *gNB); #include "executables/thread-common.h" @@ -1543,33 +1541,10 @@ void *ru_thread( void *param ) { pthread_cond_signal(&proc->cond_FH1); // This is a forever while loop, it loops over subframes which are scheduled by incoming samples from HW devices - struct timespec slot_start; - clock_gettime(CLOCK_MONOTONIC, &slot_start); - - struct timespec slot_duration; - slot_duration.tv_sec = 0; - //slot_duration.tv_nsec = 0.5e6; - slot_duration.tv_nsec = 0.5e6; - - - while (!oai_exit) { // these are local subframe/frame counters to check that we are in synch with the fronthaul timing. // They are set on the first rx/tx in the underly FH routines. - slot_start = timespec_add(slot_start,slot_duration); - struct timespec curr_time; - clock_gettime(CLOCK_MONOTONIC, &curr_time); - - struct timespec sleep_time; - - if((slot_start.tv_sec > curr_time.tv_sec) || (slot_start.tv_sec == curr_time.tv_sec && slot_start.tv_nsec > curr_time.tv_nsec)){ - sleep_time = timespec_sub(slot_start,curr_time); - usleep(sleep_time.tv_nsec * 1e-3); - } - else{//continue - } - - if(slot==(fp->slots_per_frame-1)) { + if (slot==(fp->slots_per_frame-1)) { slot=0; frame++; frame&=1023; @@ -1587,7 +1562,7 @@ void *ru_thread( void *param ) { proc->frame_rx,proc->tti_rx, proc->frame_tx,proc->tti_tx, RC.gNB[0]->proc.frame_rx,RC.gNB[0]->proc.slot_rx, - RC.gNB[0]->proc.frame_tx); + RC.gNB[0]->proc.frame_tx); /* LOG_D(PHY,"RU thread (do_prach %d, is_prach_subframe %d), received frame %d, subframe %d\n", ru->do_prach, diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index b31be5ca66..924c32b8a7 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -91,7 +91,7 @@ pthread_cond_t nfapi_sync_cond; pthread_mutex_t nfapi_sync_mutex; int nfapi_sync_var=-1; //!< protected by mutex \ref nfapi_sync_mutex -extern uint8_t nfapi_mode; // Default to monolithic mode,set in config_load_configmodule.c +extern uint8_t nfapi_mode; // Default to monolithic mode pthread_cond_t sync_cond; pthread_mutex_t sync_mutex; @@ -861,7 +861,7 @@ if(!IS_SOFTMODEM_NOS1) printf("NFAPI MODE:%s\n", nfapi_mode_str); - if (NFAPI_MODE==NFAPI_MODE_VNF) // VNF + if (NFAPI_MODE==NFAPI_MODE_VNF) wait_nfapi_init("main?"); printf("START MAIN THREADS\n"); @@ -890,7 +890,7 @@ if(!IS_SOFTMODEM_NOS1) config_sync_var=0; - if (NFAPI_MODE==NFAPI_MODE_PNF) { // PNF + if (NFAPI_MODE==NFAPI_MODE_PNF) { wait_nfapi_init("main?"); } diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 4e8c403bbb..6be23582b1 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -114,12 +114,6 @@ void init_nr_ue_vars(PHY_VARS_NR_UE *ue, ue->prach_resources[gNB_id] = (NR_PRACH_RESOURCES_t *)malloc16_clear(sizeof(NR_PRACH_RESOURCES_t)); } - // Setting UE mode to NOT_SYNCHED by default - for (gNB_id = 0; gNB_id < nb_connected_gNB; gNB_id++){ - ue->UE_mode[gNB_id] = NOT_SYNCHED; - ue->prach_resources[gNB_id] = (NR_PRACH_RESOURCES_t *)malloc16_clear(sizeof(NR_PRACH_RESOURCES_t)); - } - // initialize all signal buffers init_nr_ue_signal(ue, nb_connected_gNB, abstraction_flag); @@ -759,7 +753,7 @@ void *UE_thread(void *arg) { } void init_NR_UE(int nb_inst, char* rrc_config_path) { - int inst; + int inst; NR_UE_MAC_INST_t *mac_inst; NR_UE_RRC_INST_t* rrc_inst; diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index 945deeeb72..87cd157948 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -93,8 +93,7 @@ extern const char *duplex_mode[]; pthread_cond_t nfapi_sync_cond; pthread_mutex_t nfapi_sync_mutex; int nfapi_sync_var=-1; //!< protected by mutex \ref nfapi_sync_mutex -uint16_t sf_ahead=4; //??? value ??? -// uint16_t slot_ahead = 6; +uint16_t sf_ahead=6; //??? value ??? pthread_cond_t sync_cond; pthread_mutex_t sync_mutex; int sync_var=-1; //!< protected by mutex \ref sync_mutex. diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 52631d662a..2d1fdff4be 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -1658,10 +1658,5 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, if (pucch_pdu->bit_len_csi_part2>0) { uci_pdu->pduBitmap|=8; } - - if (pucch_pdu->bit_len_csi_part2>0) { - uci_pdu->pduBitmap|=8; - } - } diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 70c9ca508e..f516ad8639 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1958,7 +1958,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, // do procedures for C-RNTI if (ue->dlsch[proc->thread_id][gNB_id][0]->active == 1) { - LOG_I(PHY, "DLSCH data reception at nr_slot_rx: %d \n \n", nr_slot_rx); + LOG_D(PHY, "DLSCH data reception at nr_slot_rx: %d \n \n", nr_slot_rx); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); #if UE_TIMING_TRACE