Commit e1d57b53 authored by laurent's avatar laurent

Merge branch 'enhancement-10-harmony' into enhancement-10-harmony-lts

parents e1aed5af 857af540
This diff is collapsed.
...@@ -1161,6 +1161,9 @@ void rx_prach(PHY_VARS_eNB *eNB, ...@@ -1161,6 +1161,9 @@ void rx_prach(PHY_VARS_eNB *eNB,
break; break;
} }
if (eNB->frame_parms.threequarter_fs == 1)
Ncp=(Ncp*3)>>2;
switch (eNB->frame_parms.N_RB_UL) { switch (eNB->frame_parms.N_RB_UL) {
case 6: case 6:
Ncp>>=4; Ncp>>=4;
...@@ -1258,13 +1261,24 @@ void rx_prach(PHY_VARS_eNB *eNB, ...@@ -1258,13 +1261,24 @@ void rx_prach(PHY_VARS_eNB *eNB,
break; break;
case 100: case 100:
if (prach_fmt == 4) { if (eNB->frame_parms.threequarter_fs==0) {
dft4096(prach2,rxsigF[aa],1); if (prach_fmt == 4) {
dft4096(prach2,rxsigF[aa],1);
} else {
dft24576(prach2,rxsigF[aa]);
if (prach_fmt>1)
dft24576(prach2+49152,rxsigF[aa]+49152);
}
} else { } else {
dft24576(prach2,rxsigF[aa]); if (prach_fmt == 4) {
dft3072(prach2,rxsigF[aa]);
if (prach_fmt>1) } else {
dft24576(prach2+49152,rxsigF[aa]+49152); dft18432(prach2,rxsigF[aa]);
if (prach_fmt>1)
dft18432(prach2+36864,rxsigF[aa]+36864);
}
} }
break; break;
......
...@@ -739,7 +739,7 @@ void ulsch_extract_rbs_single(int32_t **rxdataF, ...@@ -739,7 +739,7 @@ void ulsch_extract_rbs_single(int32_t **rxdataF,
nb_rb1 = cmin(cmax((int)(frame_parms->N_RB_UL) - (int)(2*first_rb),(int)0),(int)(2*nb_rb)); // 2 times no. RBs before the DC nb_rb1 = cmin(cmax((int)(frame_parms->N_RB_UL) - (int)(2*first_rb),(int)0),(int)(2*nb_rb)); // 2 times no. RBs before the DC
nb_rb2 = 2*nb_rb - nb_rb1; // 2 times no. RBs after the DC nb_rb2 = 2*nb_rb - nb_rb1; // 2 times no. RBs after the DC
#ifdef DEBUG_ULSCH #ifdef DEBUG_ULSCH
printf("ulsch_extract_rbs_single: 2*nb_rb1 = %d, 2*nb_rb2 = %d\n",nb_rb1,nb_rb2); printf("ulsch_extract_rbs_single: 2*nb_rb1 = %d, 2*nb_rb2 = %d\n",nb_rb1,nb_rb2);
#endif #endif
......
...@@ -246,6 +246,8 @@ typedef struct eNB_proc_t_s { ...@@ -246,6 +246,8 @@ typedef struct eNB_proc_t_s {
int frame_rx; int frame_rx;
/// frame to act upon for PRACH /// frame to act upon for PRACH
int frame_prach; int frame_prach;
/// \internal This variable is protected by \ref mutex_fep.
int instance_cnt_fep;
/// \brief Instance count for FH processing thread. /// \brief Instance count for FH processing thread.
/// \internal This variable is protected by \ref mutex_FH. /// \internal This variable is protected by \ref mutex_FH.
int instance_cnt_FH; int instance_cnt_FH;
...@@ -264,6 +266,8 @@ typedef struct eNB_proc_t_s { ...@@ -264,6 +266,8 @@ typedef struct eNB_proc_t_s {
int first_rx; int first_rx;
/// flag to indicate first TX transmission /// flag to indicate first TX transmission
int first_tx; int first_tx;
/// pthread attributes for parallel fep thread
pthread_attr_t attr_fep;
/// pthread attributes for FH processing thread /// pthread attributes for FH processing thread
pthread_attr_t attr_FH; pthread_attr_t attr_FH;
/// pthread attributes for single eNB processing thread /// pthread attributes for single eNB processing thread
...@@ -272,6 +276,8 @@ typedef struct eNB_proc_t_s { ...@@ -272,6 +276,8 @@ typedef struct eNB_proc_t_s {
pthread_attr_t attr_prach; pthread_attr_t attr_prach;
/// pthread attributes for asynchronous RX thread /// pthread attributes for asynchronous RX thread
pthread_attr_t attr_asynch_rxtx; pthread_attr_t attr_asynch_rxtx;
/// scheduling parameters for parallel fep thread
struct sched_param sched_param_fep;
/// scheduling parameters for FH thread /// scheduling parameters for FH thread
struct sched_param sched_param_FH; struct sched_param sched_param_FH;
/// scheduling parameters for single eNB thread /// scheduling parameters for single eNB thread
...@@ -280,14 +286,20 @@ typedef struct eNB_proc_t_s { ...@@ -280,14 +286,20 @@ typedef struct eNB_proc_t_s {
struct sched_param sched_param_prach; struct sched_param sched_param_prach;
/// scheduling parameters for asynch_rxtx thread /// scheduling parameters for asynch_rxtx thread
struct sched_param sched_param_asynch_rxtx; struct sched_param sched_param_asynch_rxtx;
/// pthread structure for parallel fep thread
pthread_t pthread_fep;
/// pthread structure for PRACH thread /// pthread structure for PRACH thread
pthread_t pthread_prach; pthread_t pthread_prach;
/// condition variable for parallel fep thread
pthread_cond_t cond_fep;
/// condition variable for FH thread /// condition variable for FH thread
pthread_cond_t cond_FH; pthread_cond_t cond_FH;
/// condition variable for PRACH processing thread; /// condition variable for PRACH processing thread;
pthread_cond_t cond_prach; pthread_cond_t cond_prach;
/// condition variable for asynch RX/TX thread /// condition variable for asynch RX/TX thread
pthread_cond_t cond_asynch_rxtx; pthread_cond_t cond_asynch_rxtx;
/// mutex for parallel fep thread
pthread_mutex_t mutex_fep;
/// mutex for FH /// mutex for FH
pthread_mutex_t mutex_FH; pthread_mutex_t mutex_FH;
/// mutex for PRACH thread /// mutex for PRACH thread
......
...@@ -2346,10 +2346,11 @@ void cba_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq_p ...@@ -2346,10 +2346,11 @@ void cba_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq_p
int ret=0; int ret=0;
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
if (eNB->ulsch[UE_id]==NULL) return;
num_active_cba_groups = eNB->ulsch[UE_id]->num_active_cba_groups; num_active_cba_groups = eNB->ulsch[UE_id]->num_active_cba_groups;
if ((eNB->ulsch[UE_id]) && if ((num_active_cba_groups > 0) &&
(num_active_cba_groups > 0) &&
(eNB->ulsch[UE_id]->cba_rnti[UE_id%num_active_cba_groups]>0) && (eNB->ulsch[UE_id]->cba_rnti[UE_id%num_active_cba_groups]>0) &&
(eNB->ulsch[UE_id]->harq_processes[harq_pid]->subframe_cba_scheduling_flag==1)) { (eNB->ulsch[UE_id]->harq_processes[harq_pid]->subframe_cba_scheduling_flag==1)) {
rnti=0; rnti=0;
...@@ -2462,7 +2463,8 @@ void cba_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq_p ...@@ -2462,7 +2463,8 @@ void cba_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq_p
UE_id % eNB->ulsch[UE_id]->num_active_cba_groups, eNB->ulsch[UE_id]->cba_rnti[UE_id%num_active_cba_groups]); UE_id % eNB->ulsch[UE_id]->num_active_cba_groups, eNB->ulsch[UE_id]->cba_rnti[UE_id%num_active_cba_groups]);
// detect if there is a CBA collision // detect if there is a CBA collision
if (eNB->cba_last_reception[UE_id%num_active_cba_groups] == 0 ) { if ((eNB->cba_last_reception[UE_id%num_active_cba_groups] == 0 ) &&
(eNB->mac_enabled==1)) {
mac_xface->rx_sdu(eNB->Mod_id, mac_xface->rx_sdu(eNB->Mod_id,
eNB->CC_id, eNB->CC_id,
frame,subframe, frame,subframe,
...@@ -2495,6 +2497,155 @@ void cba_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq_p ...@@ -2495,6 +2497,155 @@ void cba_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq_p
} }
typedef struct {
PHY_VARS_eNB *eNB;
int slot;
} fep_task;
void fep0(PHY_VARS_eNB *eNB,int slot) {
eNB_proc_t *proc = &eNB->proc;
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
int l;
remove_7_5_kHz(eNB,(slot&1)+(proc->subframe_rx<<1));
for (l=0; l<fp->symbols_per_tti/2; l++) {
slot_fep_ul(fp,
&eNB->common_vars,
l,
(slot&1)+(proc->subframe_rx<<1),
0,
0
);
}
}
static inline int release_thread(pthread_mutex_t *mutex,int *instance_cnt,char *name) {
if (pthread_mutex_lock(mutex) != 0) {
LOG_E( PHY, "[SCHED][eNB] error locking mutex for %s\n",name);
exit_fun("nothing to add");
return(-1);
}
*instance_cnt=*instance_cnt-1;
if (pthread_mutex_unlock(mutex) != 0) {
LOG_E( PHY, "[SCHED][eNB] error unlocking mutex for %s\n",name);
exit_fun("nothing to add");
return(-1);
}
return(0);
}
static inline int wait_on_condition(pthread_mutex_t *mutex,pthread_cond_t *cond,int *instance_cnt,char *name) {
if (pthread_mutex_lock(mutex) != 0) {
LOG_E( PHY, "[SCHED][eNB] error locking mutex for %s\n",name);
exit_fun("nothing to add");
return(-1);
}
while (*instance_cnt < 0) {
// most of the time the thread is waiting here
// proc->instance_cnt_rxtx is -1
pthread_cond_wait(cond,mutex); // this unlocks mutex_rxtx while waiting and then locks it again
}
if (pthread_mutex_unlock(mutex) != 0) {
LOG_E(PHY,"[SCHED][eNB] error unlocking mutex for %s\n",name);
exit_fun("nothing to add");
return(-1);
}
return(0);
}
extern int oai_exit;
static void *fep_thread(void *param) {
PHY_VARS_eNB *eNB = (PHY_VARS_eNB *)param;
eNB_proc_t *proc = &eNB->proc;
while (!oai_exit) {
if (wait_on_condition(&proc->mutex_fep,&proc->cond_fep,&proc->instance_cnt_fep,"fep thread")<0) break;
fep0(eNB,0);
if (release_thread(&proc->mutex_fep,&proc->instance_cnt_fep,"fep thread")<0) break;
}
return(NULL);
}
void init_fep_thread(PHY_VARS_eNB *eNB,pthread_attr_t *attr_fep) {
eNB_proc_t *proc = &eNB->proc;
proc->instance_cnt_fep = -1;
pthread_mutex_init( &proc->mutex_fep, NULL);
pthread_cond_init( &proc->cond_fep, NULL);
pthread_create(&proc->pthread_fep, attr_fep, fep_thread, (void*)eNB);
}
void eNB_fep_full_2thread(PHY_VARS_eNB *eNB) {
eNB_proc_t *proc = &eNB->proc;
struct timespec wait;
int wait_cnt=0;
wait.tv_sec=0;
wait.tv_nsec=5000000L;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_SLOT_FEP,1);
start_meas(&eNB->ofdm_demod_stats);
if (pthread_mutex_timedlock(&proc->mutex_fep,&wait) != 0) {
printf("[eNB] ERROR pthread_mutex_lock for fep thread %d (IC %d)\n", proc->instance_cnt_fep);
exit_fun( "error locking mutex_fep" );
return;
}
if (proc->instance_cnt_fep==0) {
printf("[eNB] FEP thread busy\n");
exit_fun("FEP thread busy");
pthread_mutex_unlock( &proc->mutex_fep );
return;
}
++proc->instance_cnt_fep;
if (pthread_cond_signal(&proc->cond_fep) != 0) {
printf("[eNB] ERROR pthread_cond_signal for fep thread\n");
exit_fun( "ERROR pthread_cond_signal" );
return;
}
pthread_mutex_unlock( &proc->mutex_fep );
// call second slot in this symbol
fep0(eNB,1);
if (pthread_mutex_timedlock(&proc->mutex_fep,&wait) != 0) {
printf("[eNB] ERROR pthread_mutex_lock for fep thread %d (IC %d)\n", proc->instance_cnt_fep);
exit_fun( "error locking mutex_fep" );
return;
}
while (proc->instance_cnt_fep==0) {
wait_cnt++;
if (wait_cnt>10000)
break;
};
pthread_mutex_unlock( &proc->mutex_fep );
if (wait_cnt>1000000) {
printf("[eNB] parallel FEP didn't finish\n");
exit_fun( "error" );
}
stop_meas(&eNB->ofdm_demod_stats);
}
void eNB_fep_full(PHY_VARS_eNB *eNB) { void eNB_fep_full(PHY_VARS_eNB *eNB) {
eNB_proc_t *proc = &eNB->proc; eNB_proc_t *proc = &eNB->proc;
...@@ -2502,6 +2653,7 @@ void eNB_fep_full(PHY_VARS_eNB *eNB) { ...@@ -2502,6 +2653,7 @@ void eNB_fep_full(PHY_VARS_eNB *eNB) {
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_SLOT_FEP,1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_SLOT_FEP,1);
start_meas(&eNB->ofdm_demod_stats);
remove_7_5_kHz(eNB,proc->subframe_rx<<1); remove_7_5_kHz(eNB,proc->subframe_rx<<1);
remove_7_5_kHz(eNB,1+(proc->subframe_rx<<1)); remove_7_5_kHz(eNB,1+(proc->subframe_rx<<1));
for (l=0; l<fp->symbols_per_tti/2; l++) { for (l=0; l<fp->symbols_per_tti/2; l++) {
...@@ -2520,6 +2672,7 @@ void eNB_fep_full(PHY_VARS_eNB *eNB) { ...@@ -2520,6 +2672,7 @@ void eNB_fep_full(PHY_VARS_eNB *eNB) {
0 0
); );
} }
stop_meas(&eNB->ofdm_demod_stats);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_SLOT_FEP,0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_SLOT_FEP,0);
...@@ -2626,10 +2779,11 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const ...@@ -2626,10 +2779,11 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const
const int frame = proc->frame_rx; const int frame = proc->frame_rx;
int offset = (proc == &eNB->proc.proc_rxtx[0]) ? 0 : 1; int offset = (proc == &eNB->proc.proc_rxtx[0]) ? 0 : 1;
if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)!=SF_UL)) return; if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)!=SF_UL)) return;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC+offset, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC+offset, 1 );
start_meas(&eNB->phy_proc_rx);
#ifdef DEBUG_PHY_PROC #ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_uespec_RX(%d)\n",eNB->Mod_id,frame, subframe); LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_uespec_RX(%d)\n",eNB->Mod_id,frame, subframe);
#endif #endif
...@@ -2920,14 +3074,15 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const ...@@ -2920,14 +3074,15 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const
eNB->UE_stats[i].ulsch_consecutive_errors++; eNB->UE_stats[i].ulsch_consecutive_errors++;
// indicate error to MAC // indicate error to MAC
mac_xface->rx_sdu(eNB->Mod_id, if (eNB->mac_enabled == 1)
eNB->CC_id, mac_xface->rx_sdu(eNB->Mod_id,
frame,subframe, eNB->CC_id,
eNB->ulsch[i]->rnti, frame,subframe,
NULL, eNB->ulsch[i]->rnti,
0, NULL,
harq_pid, 0,
&eNB->ulsch[i]->Msg3_flag); harq_pid,
&eNB->ulsch[i]->Msg3_flag);
} }
} }
} // ulsch in error } // ulsch in error
...@@ -2987,15 +3142,15 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const ...@@ -2987,15 +3142,15 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const
LOG_I(PHY,"[eNB %d][RAPROC] Frame %d Terminating ra_proc for harq %d, UE %d\n", LOG_I(PHY,"[eNB %d][RAPROC] Frame %d Terminating ra_proc for harq %d, UE %d\n",
eNB->Mod_id, eNB->Mod_id,
frame,harq_pid,i); frame,harq_pid,i);
if (eNB->mac_enabled)
mac_xface->rx_sdu(eNB->Mod_id, mac_xface->rx_sdu(eNB->Mod_id,
eNB->CC_id, eNB->CC_id,
frame,subframe, frame,subframe,
eNB->ulsch[i]->rnti, eNB->ulsch[i]->rnti,
eNB->ulsch[i]->harq_processes[harq_pid]->b, eNB->ulsch[i]->harq_processes[harq_pid]->b,
eNB->ulsch[i]->harq_processes[harq_pid]->TBS>>3, eNB->ulsch[i]->harq_processes[harq_pid]->TBS>>3,
harq_pid, harq_pid,
&eNB->ulsch[i]->Msg3_flag); &eNB->ulsch[i]->Msg3_flag);
// one-shot msg3 detection by MAC: empty PDU (e.g. CRNTI) // one-shot msg3 detection by MAC: empty PDU (e.g. CRNTI)
if (eNB->ulsch[i]->Msg3_flag == 0 ) { if (eNB->ulsch[i]->Msg3_flag == 0 ) {
......
...@@ -828,7 +828,7 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB ...@@ -828,7 +828,7 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
int i; int i;
int aa; int aa;
int tx_amp; int tx_amp;
uint8_t ulsch_input_buffer[2700] __attribute__ ((aligned(16))); uint8_t ulsch_input_buffer[5477] __attribute__ ((aligned(32)));
uint8_t access_mode; uint8_t access_mode;
// get harq_pid from subframe relationship // get harq_pid from subframe relationship
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should haeve received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not, included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>. see <http://www.gnu.org/licenses/>.
......
This diff is collapsed.
openair0_device openair0;
int oai_exit=0;
void exit_fun(const char *s) { exit(-1); }
extern unsigned int dlsch_tbs25[27][25],TBStable[27][110];
extern unsigned char offset_mumimo_llr_drange_fix;
extern unsigned short dftsizes[33];
extern short *ul_ref_sigs[30][2][33];
...@@ -610,7 +610,7 @@ extern "C" { ...@@ -610,7 +610,7 @@ extern "C" {
switch ((int)openair0_cfg[0].sample_rate) { switch ((int)openair0_cfg[0].sample_rate) {
case 30720000: case 30720000:
s->usrp->set_master_clock_rate(61.44e6); s->usrp->set_master_clock_rate(30.72e6);
openair0_cfg[0].tx_sample_advance = 115; openair0_cfg[0].tx_sample_advance = 115;
openair0_cfg[0].tx_bw = 20e6; openair0_cfg[0].tx_bw = 20e6;
openair0_cfg[0].rx_bw = 20e6; openair0_cfg[0].rx_bw = 20e6;
......
...@@ -166,6 +166,7 @@ void stop_eNB(int nb_inst); ...@@ -166,6 +166,7 @@ void stop_eNB(int nb_inst);
static inline void thread_top_init(char *thread_name, static inline void thread_top_init(char *thread_name,
int affinity,
uint64_t runtime, uint64_t runtime,
uint64_t deadline, uint64_t deadline,
uint64_t period) { uint64_t period) {
...@@ -209,7 +210,10 @@ static inline void thread_top_init(char *thread_name, ...@@ -209,7 +210,10 @@ static inline void thread_top_init(char *thread_name,
#ifdef CPU_AFFINITY #ifdef CPU_AFFINITY
if (get_nprocs() > 2) if (get_nprocs() > 2)
{ {
for (j = 1; j < get_nprocs(); j++) if (affinity == 0)
CPU_SET(0,&cpuset);
else
for (j = 1; j < get_nprocs(); j++)
CPU_SET(j, &cpuset); CPU_SET(j, &cpuset);
s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
if (s != 0) if (s != 0)
...@@ -628,7 +632,7 @@ static void* eNB_thread_rxtx( void* param ) { ...@@ -628,7 +632,7 @@ static void* eNB_thread_rxtx( void* param ) {
sprintf(thread_name,"RXn_TXnp4_%d\n",&eNB->proc.proc_rxtx[0] == proc ? 0 : 1); sprintf(thread_name,"RXn_TXnp4_%d\n",&eNB->proc.proc_rxtx[0] == proc ? 0 : 1);
thread_top_init(thread_name,850000L,1000000L,2000000L); thread_top_init(thread_name,1,850000L,1000000L,2000000L);
while (!oai_exit) { while (!oai_exit) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 );
...@@ -834,7 +838,7 @@ static void* eNB_thread_asynch_rxtx( void* param ) { ...@@ -834,7 +838,7 @@ static void* eNB_thread_asynch_rxtx( void* param ) {
int subframe=0, frame=0; int subframe=0, frame=0;
thread_top_init("thread_asynch",870000L,1000000L,1000000L); thread_top_init("thread_asynch",1,870000L,1000000L,1000000L);
// wait for top-level synchronization and do one acquisition to get timestamp for setting frame/subframe // wait for top-level synchronization and do one acquisition to get timestamp for setting frame/subframe
...@@ -1157,7 +1161,7 @@ static void* eNB_thread_FH( void* param ) { ...@@ -1157,7 +1161,7 @@ static void* eNB_thread_FH( void* param ) {
// set default return value // set default return value
eNB_thread_FH_status = 0; eNB_thread_FH_status = 0;
thread_top_init("eNB_thread_FH",870000,1000000,1000000); thread_top_init("eNB_thread_FH",0,870000,1000000,1000000);
wait_sync("eNB_thread_FH"); wait_sync("eNB_thread_FH");
...@@ -1237,7 +1241,7 @@ static void* eNB_thread_prach( void* param ) { ...@@ -1237,7 +1241,7 @@ static void* eNB_thread_prach( void* param ) {
// set default return value // set default return value
eNB_thread_prach_status = 0; eNB_thread_prach_status = 0;
thread_top_init("eNB_thread_prach",500000L,1000000L,20000000L); thread_top_init("eNB_thread_prach",1,500000L,1000000L,20000000L);
while (!oai_exit) { while (!oai_exit) {
...@@ -1269,7 +1273,7 @@ static void* eNB_thread_single( void* param ) { ...@@ -1269,7 +1273,7 @@ static void* eNB_thread_single( void* param ) {
// set default return value // set default return value
eNB_thread_single_status = 0; eNB_thread_single_status = 0;
thread_top_init("eNB_thread_single",870000,1000000,1000000); thread_top_init("eNB_thread_single",0,870000,1000000,1000000);
wait_sync("eNB_thread_single"); wait_sync("eNB_thread_single");
...@@ -1333,6 +1337,7 @@ static void* eNB_thread_single( void* param ) { ...@@ -1333,6 +1337,7 @@ static void* eNB_thread_single( void* param ) {
} }
extern void init_fep_thread(PHY_VARS_eNB *, pthread_attr_t *);
void init_eNB_proc(int inst) { void init_eNB_proc(int inst) {
...@@ -1341,7 +1346,7 @@ void init_eNB_proc(int inst) { ...@@ -1341,7 +1346,7 @@ void init_eNB_proc(int inst) {
PHY_VARS_eNB *eNB; PHY_VARS_eNB *eNB;
eNB_proc_t *proc; eNB_proc_t *proc;
eNB_rxtx_proc_t *proc_rxtx; eNB_rxtx_proc_t *proc_rxtx;
pthread_attr_t *attr0=NULL,*attr1=NULL,*attr_FH=NULL,*attr_prach=NULL,*attr_asynch=NULL,*attr_single=NULL; pthread_attr_t *attr0=NULL,*attr1=NULL,*attr_FH=NULL,*attr_prach=NULL,*attr_asynch=NULL,*attr_single=NULL,*attr_fep=NULL;
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
eNB = PHY_vars_eNB_g[inst][CC_id]; eNB = PHY_vars_eNB_g[inst][CC_id];
...@@ -1351,10 +1356,10 @@ void init_eNB_proc(int inst) { ...@@ -1351,10 +1356,10 @@ void init_eNB_proc(int inst) {
proc_rxtx = proc->proc_rxtx; proc_rxtx = proc->proc_rxtx;
proc_rxtx[0].instance_cnt_rxtx = -1; proc_rxtx[0].instance_cnt_rxtx = -1;
proc_rxtx[1].instance_cnt_rxtx = -1; proc_rxtx[1].instance_cnt_rxtx = -1;
proc->instance_cnt_prach = -1; proc->instance_cnt_prach = -1;
proc->instance_cnt_FH = -1; proc->instance_cnt_FH = -1;
proc->instance_cnt_asynch_rxtx = -1; proc->instance_cnt_asynch_rxtx = -1;
proc->CC_id = CC_id; proc->CC_id = CC_id;
proc->first_rx=1; proc->first_rx=1;
proc->first_tx=1; proc->first_tx=1;
...@@ -1370,6 +1375,14 @@ void init_eNB_proc(int inst) { ...@@ -1370,6 +1375,14 @@ void init_eNB_proc(int inst) {
pthread_cond_init( &proc->cond_prach, NULL); pthread_cond_init( &proc->cond_prach, NULL);
pthread_cond_init( &proc->cond_FH, NULL); pthread_cond_init( &proc->cond_FH, NULL);
pthread_cond_init( &proc->cond_asynch_rxtx, NULL); pthread_cond_init( &proc->cond_asynch_rxtx, NULL);
pthread_attr_init( &proc->attr_FH);
pthread_attr_init( &proc->attr_prach);
pthread_attr_init( &proc->attr_asynch_rxtx);
pthread_attr_init( &proc->attr_single);
pthread_attr_init( &proc->attr_fep);
pthread_attr_init( &proc_rxtx[0].attr_rxtx);
pthread_attr_init( &proc_rxtx[1].attr_rxtx);
#ifndef DEADLINE_SCHEDULER #ifndef DEADLINE_SCHEDULER
attr0 = &proc_rxtx[0].attr_rxtx; attr0 = &proc_rxtx[0].attr_rxtx;
attr1 = &proc_rxtx[1].attr_rxtx; attr1 = &proc_rxtx[1].attr_rxtx;
...@@ -1377,6 +1390,7 @@ void init_eNB_proc(int inst) { ...@@ -1377,6 +1390,7 @@ void init_eNB_proc(int inst) {
attr_prach = &proc->attr_prach; attr_prach = &proc->attr_prach;
attr_asynch = &proc->attr_asynch_rxtx; attr_asynch = &proc->attr_asynch_rxtx;
attr_single = &proc->attr_single; attr_single = &proc->attr_single;
attr_fep = &proc->attr_fep;
#endif #endif
if (eNB->single_thread_flag==0) { if (eNB->single_thread_flag==0) {
...@@ -1384,9 +1398,10 @@ void init_eNB_proc(int inst) { ...@@ -1384,9 +1398,10 @@ void init_eNB_proc(int inst) {
pthread_create( &proc_rxtx[1].pthread_rxtx, attr1, eNB_thread_rxtx, &proc_rxtx[1] ); pthread_create( &proc_rxtx[1].pthread_rxtx, attr1, eNB_thread_rxtx, &proc_rxtx[1] );
pthread_create( &proc->pthread_FH, attr_FH, eNB_thread_FH, &eNB->proc ); pthread_create( &proc->pthread_FH, attr_FH, eNB_thread_FH, &eNB->proc );
} }
else else {
pthread_create(&proc->pthread_single, attr_single, eNB_thread_single, &eNB->proc); pthread_create(&proc->pthread_single, attr_single, eNB_thread_single, &eNB->proc);
init_fep_thread(eNB,attr_fep);
}
pthread_create( &proc->pthread_prach, attr_prach, eNB_thread_prach, &eNB->proc ); pthread_create( &proc->pthread_prach, attr_prach, eNB_thread_prach, &eNB->proc );
if ((eNB->node_timing == synch_to_other) || if ((eNB->node_timing == synch_to_other) ||
(eNB->node_function == NGFI_RRU_IF5) || (eNB->node_function == NGFI_RRU_IF5) ||
......
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