Code fixes for NSA test
This commit is contained in:
@@ -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);
|
||||
|
||||
+2
-27
@@ -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,
|
||||
|
||||
@@ -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?");
|
||||
}
|
||||
|
||||
|
||||
+1
-7
@@ -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;
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user