Merge branch 'develop-nr' into uhd_set_thread_prio
Conflicts: openair1/SCHED_NR/phy_procedures_nr_gNB.c targets/RT/USER/nr-ru.c
This commit is contained in:
@@ -293,12 +293,12 @@ static void *gNB_L1_thread_tx(void *param) {
|
||||
pthread_mutex_lock( &L1_proc_tx->mutex );
|
||||
L1_proc_tx->instance_cnt = -1;
|
||||
|
||||
pthread_mutex_unlock(&L1_proc_tx->mutex);
|
||||
// the thread can now be woken up
|
||||
if (pthread_cond_signal(&L1_proc_tx->cond) != 0) {
|
||||
LOG_E( PHY, "[gNB] ERROR pthread_cond_signal for gNB TXnp4 thread\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
}
|
||||
pthread_mutex_unlock(&L1_proc_tx->mutex);
|
||||
|
||||
wakeup_txfh(gNB,L1_proc_tx,frame_tx,slot_tx,timestamp_tx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX1, 0 );
|
||||
@@ -420,18 +420,23 @@ int wakeup_txfh(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc,int frame_tx,int slot
|
||||
|
||||
// note this should depend on the numerology used by the TX L1 thread, set here for 500us slot time
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL,1);
|
||||
waitret=timedwait_on_condition(&proc->mutex_RUs_tx,&proc->cond_RUs,&proc->instance_cnt_RUs,"wakeup_txfh",500000);
|
||||
waitret=timedwait_on_condition(&proc->mutex_RUs_tx,&proc->cond_RUs,&proc->instance_cnt_RUs,"wakeup_txfh",1000000);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL,0);
|
||||
|
||||
AssertFatal(release_thread(&proc->mutex_RUs_tx,&proc->instance_cnt_RUs,"wakeup_txfh")==0, "error releaseing gNB lock on RUs\n");
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_UE,proc->instance_cnt_RUs);
|
||||
|
||||
if (waitret == ETIMEDOUT) {
|
||||
LOG_W(PHY,"Dropping TX slot (%d.%d) because FH is blocked more than 2 slot times (1000us)\n",frame_tx,slot_tx);
|
||||
LOG_W(PHY,"Dropping TX slot (%d.%d) because FH is blocked more than 1 slot times (500us)\n",frame_tx,slot_tx);
|
||||
|
||||
AssertFatal((ret=pthread_mutex_lock(&gNB->proc.mutex_RU_tx))==0,"mutex_lock returns %d\n",ret);
|
||||
gNB->proc.RU_mask_tx = 0;
|
||||
AssertFatal((ret=pthread_mutex_unlock(&gNB->proc.mutex_RU_tx))==0,"mutex_unlock returns %d\n",ret);
|
||||
AssertFatal((ret=pthread_mutex_lock(&proc->mutex_RUs_tx))==0,"mutex_lock returns %d\n",ret);
|
||||
proc->instance_cnt_RUs = 0;
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_UE,proc->instance_cnt_RUs);
|
||||
AssertFatal((ret=pthread_mutex_unlock(&proc->mutex_RUs_tx))==0,"mutex_unlock returns %d\n",ret);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_UE,1);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_UE,0);
|
||||
|
||||
|
||||
+2
-2
@@ -1304,7 +1304,7 @@ static void *ru_thread_tx( void *param ) {
|
||||
if (L1_proc->instance_cnt_RUs==-1) {
|
||||
AssertFatal(pthread_cond_signal(&L1_proc->cond_RUs) == 0,
|
||||
"ERROR pthread_cond_signal for gNB_L1_thread\n");
|
||||
} else AssertFatal(1==0,"gNB TX thread is not ready\n");
|
||||
} //else AssertFatal(1==0,"gNB TX thread is not ready\n");
|
||||
L1_proc->instance_cnt_RUs = 0;
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_UE,L1_proc->instance_cnt_RUs);
|
||||
AssertFatal((ret=pthread_mutex_unlock(&L1_proc->mutex_RUs_tx))==0,"mutex_unlock returns %d\n",ret);
|
||||
@@ -1451,7 +1451,7 @@ static void *ru_thread( void *param ) {
|
||||
// wakeup all gNB processes waiting for this RU
|
||||
if (ru->num_gNB>0) wakeup_gNB_L1s(ru);
|
||||
|
||||
if(get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD && ru->num_gNB==0) {
|
||||
if(get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD || ru->num_gNB==0) {
|
||||
// do TX front-end processing if needed (precoding and/or IDFTs)
|
||||
if (ru->feptx_prec) ru->feptx_prec(ru,proc->frame_tx,proc->tti_tx);
|
||||
|
||||
|
||||
@@ -976,6 +976,8 @@ int main( int argc, char **argv ) {
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
openair0_cfg[0].threequarter_fs = threequarter_fs;
|
||||
|
||||
#if T_TRACER
|
||||
T_Config_Init();
|
||||
#endif
|
||||
|
||||
+8
-6
@@ -169,6 +169,7 @@ static void UE_synch(void *arg) {
|
||||
int freq_offset=0;
|
||||
UE->is_synchronized = 0;
|
||||
|
||||
|
||||
if (UE->UE_scan == 0) {
|
||||
get_band(downlink_frequency[CC_id][0], &UE->frame_parms.eutra_band, &uplink_frequency_offset[CC_id][0], &UE->frame_parms.frame_type);
|
||||
LOG_I( PHY, "[SCHED][UE] Check absolute frequency DL %"PRIu32", UL %"PRIu32" (oai_exit %d, rx_num_channels %d)\n",
|
||||
@@ -239,7 +240,7 @@ static void UE_synch(void *arg) {
|
||||
case pbch:
|
||||
LOG_I(PHY, "[UE thread Synch] Running Initial Synch (mode %d)\n",UE->mode);
|
||||
|
||||
if (nr_initial_sync( &syncD->proc, UE, UE->mode ) == 0) {
|
||||
if (nr_initial_sync( &syncD->proc, UE, UE->mode,2) == 0) {
|
||||
freq_offset = UE->common_vars.freq_offset; // frequency offset computed with pss in initial sync
|
||||
hw_slot_offset = (UE->rx_offset<<1) / UE->frame_parms.samples_per_slot;
|
||||
LOG_I(PHY,"Got synch: hw_slot_offset %d, carrier off %d Hz, rxgain %d (DL %u, UL %u), UE_scan_carrier %d\n",
|
||||
@@ -348,7 +349,7 @@ static void UE_synch(void *arg) {
|
||||
}
|
||||
}
|
||||
|
||||
void processSubframeRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
|
||||
void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
|
||||
// Process Rx data for one sub-frame
|
||||
if (slot_select_nr(&UE->frame_parms, proc->frame_tx, proc->nr_tti_tx) & NR_DOWNLINK_SLOT) {
|
||||
//clean previous FAPI MESSAGE
|
||||
@@ -376,9 +377,9 @@ void processSubframeRX( 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 );
|
||||
#else
|
||||
uint64_t a=rdtsc();
|
||||
phy_procedures_nrUE_RX( UE, proc, 0, 1, UE->mode);
|
||||
phy_procedures_nrUE_RX( UE, proc, 0, 1, UE->mode, UE_mac->phy_config.config_req.pbch_config);
|
||||
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
|
||||
}
|
||||
|
||||
@@ -413,7 +414,7 @@ void UE_processing(void *arg) {
|
||||
processingData_t *rxtxD=(processingData_t *) arg;
|
||||
UE_nr_rxtx_proc_t *proc = &rxtxD->proc;
|
||||
PHY_VARS_NR_UE *UE = rxtxD->UE;
|
||||
processSubframeRX(UE, proc);
|
||||
processSlotRX(UE, proc);
|
||||
//printf(">>> mac ended\n");
|
||||
// Prepare the future Tx data
|
||||
#if 0
|
||||
@@ -447,7 +448,7 @@ void readFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp) {
|
||||
for (int i=0; i<UE->frame_parms.nb_antennas_tx; i++)
|
||||
dummy_tx[i]=malloc16_clear(UE->frame_parms.samples_per_subframe*4);
|
||||
|
||||
for(int x=0; x<10; x++) {
|
||||
for(int x=0; x<20; x++) { // two frames for initial sync
|
||||
for (int i=0; i<UE->frame_parms.nb_antennas_rx; i++)
|
||||
rxp[i] = ((void *)&UE->common_vars.rxdata[i][0]) + 4*x*UE->frame_parms.samples_per_subframe;
|
||||
|
||||
@@ -613,6 +614,7 @@ void *UE_thread(void *arg) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
absolute_slot++;
|
||||
// whatever means thread_idx
|
||||
// Fix me: will be wrong when slot 1 is slow, as slot 2 finishes
|
||||
|
||||
@@ -393,7 +393,7 @@ static void get_options(void) {
|
||||
uint32_t online_log_messages;
|
||||
uint32_t glog_level, glog_verbosity;
|
||||
uint32_t start_telnetsrv=0;
|
||||
paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC ;
|
||||
paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC_UE ;
|
||||
paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC ;
|
||||
config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL);
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@
|
||||
/* command line parameters common to eNodeB and UE */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define CMDLINE_PARAMS_DESC { \
|
||||
#define CMDLINE_PARAMS_DESC_UE { \
|
||||
{"rf-config-file", CONFIG_HLP_RFCFGF, 0, strptr:(char **)&rf_config_file, defstrval:NULL, TYPE_STRING, sizeof(rf_config_file)}, \
|
||||
{"ulsch-max-errors", CONFIG_HLP_ULMAXE, 0, uptr:&ULSCH_max_consecutive_errors, defuintval:0, TYPE_UINT, 0}, \
|
||||
{"phy-test", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, iptr:&phy_test, defintval:0, TYPE_INT, 0}, \
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
#ifndef OPENAIRINTERFACE5G_LIMITS_H_
|
||||
#define OPENAIRINTERFACE5G_LIMITS_H_
|
||||
|
||||
#if 1 /*defined(CBMIMO1) || defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706)*/
|
||||
#define NUMBER_OF_eNB_MAX 1
|
||||
#define NUMBER_OF_gNB_MAX 1
|
||||
#define NUMBER_OF_RU_MAX 2
|
||||
#define NUMBER_OF_NR_RU_MAX 2
|
||||
#ifndef PHYSIM
|
||||
#ifndef UE_EXPANSION
|
||||
#define NUMBER_OF_UE_MAX 4
|
||||
#define NUMBER_OF_NR_UE_MAX 4
|
||||
#define NUMBER_OF_CONNECTED_eNB_MAX 1
|
||||
#define NUMBER_OF_CONNECTED_gNB_MAX 1
|
||||
#else
|
||||
#define NUMBER_OF_UE_MAX 256
|
||||
#define NUMBER_OF_NR_UE_MAX 256
|
||||
#define NUMBER_OF_CONNECTED_eNB_MAX 1
|
||||
#define NUMBER_OF_CONNECTED_gNB_MAX 1
|
||||
#endif
|
||||
#else
|
||||
#define NUMBER_OF_UE_MAX 1
|
||||
#define NUMBER_OF_NR_UE_MAX 1
|
||||
#define NUMBER_OF_CONNECTED_eNB_MAX 1
|
||||
#define NUMBER_OF_CONNECTED_gNB_MAX 1
|
||||
#endif
|
||||
#else
|
||||
#define NUMBER_OF_eNB_MAX 7
|
||||
#define NUMBER_OF_gNB_MAX 7
|
||||
#define NUMBER_OF_RU_MAX 32
|
||||
#define NUMBER_OF_NR_RU_MAX 32
|
||||
#ifndef UE_EXPANSION
|
||||
#define NUMBER_OF_UE_MAX 20
|
||||
#define NUMBER_OF_NR_UE_MAX 20
|
||||
#define NUMBER_OF_CONNECTED_eNB_MAX 3
|
||||
#define NUMBER_OF_CONNECTED_gNB_MAX 3
|
||||
#else
|
||||
#define NUMBER_OF_UE_MAX 256
|
||||
#define NUMBER_OF_NR_UE_MAX 256
|
||||
#define NUMBER_OF_CONNECTED_eNB_MAX 1
|
||||
#define NUMBER_OF_CONNECTED_gNB_MAX 1
|
||||
#endif
|
||||
#if defined(STANDALONE) && STANDALONE==1
|
||||
#undef NUMBER_OF_eNB_MAX
|
||||
#undef NUMBER_OF_gNB_MAX
|
||||
|
||||
#undef NUMBER_OF_UE_MAX
|
||||
#undef NUMBER_OF_NR_UE_MAX
|
||||
|
||||
#undef NUMBER_OF_RU_MAX
|
||||
#undef NUMBER_OF_NR_RU_MAX
|
||||
|
||||
#define NUMBER_OF_eNB_MAX 3
|
||||
#define NUMBER_OF_gNB_MAX 3
|
||||
|
||||
#define NUMBER_OF_UE_MAX 3
|
||||
#define NUMBER_OF_NR_UE_MAX 3
|
||||
|
||||
#define NUMBER_OF_RU_MAX 3
|
||||
#define NUMBER_OF_NR_RU_MAX 3
|
||||
#endif
|
||||
#if defined(LARGE_SCALE) && LARGE_SCALE
|
||||
#undef NUMBER_OF_eNB_MAX
|
||||
#undef NUMBER_OF_gNB_MAX
|
||||
|
||||
#undef NUMBER_OF_UE_MAX
|
||||
#undef NUMBER_OF_NR_UE_MAX
|
||||
|
||||
#undef NUMBER_OF_CONNECTED_eNB_MAX
|
||||
#undef NUMBER_OF_CONNECTED_gNB_MAX
|
||||
|
||||
#undef NUMBER_OF_RU_MAX
|
||||
#undef NUMBER_OF_NR_RU_MAX
|
||||
|
||||
#define NUMBER_OF_eNB_MAX 2
|
||||
#define NUMBER_OF_gNB_MAX 2
|
||||
|
||||
#define NUMBER_OF_UE_MAX 120
|
||||
#define NUMBER_OF_NR_UE_MAX 120
|
||||
|
||||
#define NUMBER_OF_RU_MAX 16
|
||||
#define NUMBER_OF_NR_RU_MAX 16
|
||||
|
||||
#define NUMBER_OF_CONNECTED_eNB_MAX 1 // to save some memory
|
||||
#define NUMBER_OF_CONNECTED_gNB_MAX 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* OPENAIRINTERFACE5G_LIMITS_H_ */
|
||||
Reference in New Issue
Block a user