Resolved merge conflicts with nfapi_nr_develop
This commit is contained in:
@@ -74,6 +74,7 @@ int config_sync_var=-1;
|
||||
volatile int oai_exit = 0;
|
||||
double cpuf;
|
||||
uint16_t sf_ahead=4;
|
||||
uint16_t slot_ahead=6;
|
||||
int otg_enabled;
|
||||
uint64_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
|
||||
+16
-2
@@ -135,16 +135,22 @@ void wakeup_prach_gNB(PHY_VARS_gNB *gNB, RU_t *ru, int frame, int subframe);
|
||||
|
||||
extern uint8_t nfapi_mode;
|
||||
extern void oai_subframe_ind(uint16_t sfn, uint16_t sf);
|
||||
extern void oai_slot_ind(uint16_t sfn, uint16_t slot);
|
||||
extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset);
|
||||
|
||||
//#define TICK_TO_US(ts) (ts.diff)
|
||||
#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);
|
||||
//LOG_I(PHY,"%sCurrent time %d.%d,frame_rx %d,slot_rx %d,frame_tx %d,slot_tx %d\n", __FUNCTION__, current.tv_sec,current.tv_nsec,frame_rx,slot_rx,frame_tx,slot_tx);
|
||||
// if(nfapi_mode!=0)
|
||||
// sf_ahead = (uint16_t) ceil((float)6/(0x01<<gNB->frame_parms.numerology_index));
|
||||
|
||||
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);
|
||||
|
||||
// *******************************************************************
|
||||
@@ -155,7 +161,9 @@ static inline int rxtx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_t
|
||||
//oai_subframe_ind(proc->frame_tx, proc->subframe_tx);
|
||||
//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_subframe_ind(frame_rx, slot_rx);
|
||||
|
||||
oai_slot_ind(frame_rx, slot_rx);
|
||||
stop_meas(&nfapi_meas);
|
||||
|
||||
/*if (gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus||
|
||||
@@ -396,15 +404,21 @@ static void *gNB_L1_thread( void *param ) {
|
||||
|
||||
|
||||
while (!oai_exit) {
|
||||
struct timespec t;
|
||||
clock_gettime(CLOCK_MONOTONIC,&t);
|
||||
//printf("\nbefore time %d.%d\n",t.tv_sec,t.tv_nsec);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX0, 0 );
|
||||
if (wait_on_condition(&L1_proc->mutex,&L1_proc->cond,&L1_proc->instance_cnt,thread_name)<0) break;
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX0, 1 );
|
||||
clock_gettime(CLOCK_MONOTONIC,&t);
|
||||
|
||||
int frame_rx = L1_proc->frame_rx;
|
||||
int slot_rx = L1_proc->slot_rx;
|
||||
int frame_tx = L1_proc->frame_tx;
|
||||
int slot_tx = L1_proc->slot_tx;
|
||||
uint64_t timestamp_tx = L1_proc->timestamp_tx;
|
||||
|
||||
//printf("\nframe %d slot %d after wait time %d.%d\n",frame_rx,slot_rx,t.tv_sec,t.tv_nsec);
|
||||
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_TX0_GNB,slot_tx);
|
||||
|
||||
+31
-2
@@ -97,7 +97,8 @@ 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"
|
||||
@@ -114,6 +115,7 @@ int attach_rru(RU_t *ru);
|
||||
int connect_rau(RU_t *ru);
|
||||
|
||||
uint16_t sf_ahead;
|
||||
uint16_t slot_ahead;
|
||||
uint16_t sl_ahead;
|
||||
|
||||
extern int emulate_rf;
|
||||
@@ -709,6 +711,7 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
|
||||
|
||||
|
||||
void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
|
||||
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
|
||||
nfapi_nr_config_request_scf_t *cfg = &ru->config;
|
||||
@@ -1540,9 +1543,35 @@ 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
|
||||
}
|
||||
|
||||
// clock_gettime(CLOCK_MONOTONIC, &curr_time);
|
||||
//printf("sfn:%d, slot:%d, start time %d.%d slot start %d.%d \n",frame,slot,curr_time.tv_sec,curr_time.tv_nsec,slot_start.tv_sec,slot_start.tv_nsec);
|
||||
if (slot==(fp->slots_per_frame-1)) {
|
||||
slot=0;
|
||||
frame++;
|
||||
@@ -1561,7 +1590,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,
|
||||
|
||||
@@ -820,6 +820,7 @@ void init_pdcp(void) {
|
||||
int main( int argc, char **argv )
|
||||
{
|
||||
int ru_id, CC_id = 0;
|
||||
|
||||
start_background_system();
|
||||
|
||||
///static configuration for NR at the moment
|
||||
@@ -892,7 +893,7 @@ if(!IS_SOFTMODEM_NOS1)
|
||||
AssertFatal(create_gNB_tasks(1) == 0,"cannot create ITTI tasks\n");
|
||||
} else {
|
||||
printf("No ITTI, Initializing L1\n");
|
||||
RCconfig_L1();
|
||||
RCconfig_NR_L1();
|
||||
}
|
||||
|
||||
/* Start the agent. If it is turned off in the configuration, it won't start */
|
||||
|
||||
+7
-1
@@ -151,6 +151,12 @@ 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);
|
||||
|
||||
@@ -821,7 +827,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;
|
||||
|
||||
|
||||
@@ -91,7 +91,8 @@ 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=6; //??? value ???
|
||||
uint16_t sf_ahead=4; //??? value ???
|
||||
// uint16_t slot_ahead = 6;
|
||||
pthread_cond_t sync_cond;
|
||||
pthread_mutex_t sync_mutex;
|
||||
int sync_var=-1; //!< protected by mutex \ref sync_mutex.
|
||||
|
||||
Reference in New Issue
Block a user