final changes at slave RRU
This commit is contained in:
@@ -532,7 +532,7 @@ void fep0(RU_t *ru,int slot) {
|
|||||||
LTE_DL_FRAME_PARMS *fp = &ru->frame_parms;
|
LTE_DL_FRAME_PARMS *fp = &ru->frame_parms;
|
||||||
int l;
|
int l;
|
||||||
|
|
||||||
// printf("fep0: slot %d\n",slot);
|
//printf("fep0: slot %d\n",slot);
|
||||||
|
|
||||||
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+slot, 1);
|
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+slot, 1);
|
||||||
remove_7_5_kHz(ru,(slot&1)+(proc->subframe_rx<<1));
|
remove_7_5_kHz(ru,(slot&1)+(proc->subframe_rx<<1));
|
||||||
@@ -649,8 +649,7 @@ void ru_fep_full_2thread(RU_t *ru) {
|
|||||||
//PHY_VARS_eNB *eNB = RC.eNB[0][0];
|
//PHY_VARS_eNB *eNB = RC.eNB[0][0];
|
||||||
LTE_DL_FRAME_PARMS *fp = &ru->frame_parms;
|
LTE_DL_FRAME_PARMS *fp = &ru->frame_parms;
|
||||||
RU_CALIBRATION *calibration = &ru->calibration;
|
RU_CALIBRATION *calibration = &ru->calibration;
|
||||||
|
RRU_CONFIG_msg_t rru_config_msg;
|
||||||
int cnt;
|
|
||||||
int check_sync_pos;
|
int check_sync_pos;
|
||||||
|
|
||||||
struct timespec wait;
|
struct timespec wait;
|
||||||
@@ -706,7 +705,7 @@ void ru_fep_full_2thread(RU_t *ru) {
|
|||||||
|
|
||||||
if (proc->subframe_rx==1 && ru->is_slave==1/* && ru->state == RU_CHECK_SYNC*/) {
|
if (proc->subframe_rx==1 && ru->is_slave==1/* && ru->state == RU_CHECK_SYNC*/) {
|
||||||
|
|
||||||
LOG_I(PHY,"Running check synchronization procedure for frame %d\n", proc->frame_rx);
|
//LOG_I(PHY,"Running check synchronization procedure for frame %d\n", proc->frame_rx);
|
||||||
ulsch_extract_rbs_single(ru->common.rxdataF,
|
ulsch_extract_rbs_single(ru->common.rxdataF,
|
||||||
calibration->rxdataF_ext,
|
calibration->rxdataF_ext,
|
||||||
0,
|
0,
|
||||||
@@ -715,7 +714,6 @@ void ru_fep_full_2thread(RU_t *ru) {
|
|||||||
3/(fp->symbols_per_tti/2),// Ns = slot number
|
3/(fp->symbols_per_tti/2),// Ns = slot number
|
||||||
fp);
|
fp);
|
||||||
|
|
||||||
|
|
||||||
/*lte_ul_channel_estimation((PHY_VARS_eNB *)NULL,
|
/*lte_ul_channel_estimation((PHY_VARS_eNB *)NULL,
|
||||||
proc,
|
proc,
|
||||||
ru->idx,
|
ru->idx,
|
||||||
@@ -740,15 +738,21 @@ void ru_fep_full_2thread(RU_t *ru) {
|
|||||||
|
|
||||||
check_sync_pos = lte_est_timing_advance_pusch((PHY_VARS_eNB *)NULL,
|
check_sync_pos = lte_est_timing_advance_pusch((PHY_VARS_eNB *)NULL,
|
||||||
ru->idx);
|
ru->idx);
|
||||||
//LOG_I(PHY,"Estimated check_sync_pos %d\n",check_sync_pos);
|
|
||||||
if (ru->state == RU_CHECK_SYNC) {
|
if (ru->state == RU_CHECK_SYNC) {
|
||||||
if ((check_sync_pos >= 0 && check_sync_pos<8) || (check_sync_pos < 0 && check_sync_pos>-8)) {
|
if ((check_sync_pos >= 0 && check_sync_pos<8) || (check_sync_pos < 0 && check_sync_pos>-8)) {
|
||||||
LOG_I(PHY,"check_sync_pos %d, frame %d, cnt %d\n",check_sync_pos,proc->frame_rx,ru->wait_check);
|
LOG_I(PHY,"~~~~~~~~~~~ check_sync_pos %d, frame %d, cnt %d\n",check_sync_pos,proc->frame_rx,ru->wait_check);
|
||||||
ru->wait_check++;
|
ru->wait_check++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ru->wait_check==10) {
|
if (ru->wait_check==20) {
|
||||||
ru->state = RU_RUN;
|
ru->state = RU_RUN;
|
||||||
|
ru->wait_check = 0;
|
||||||
|
// Send RRU_sync_ok
|
||||||
|
rru_config_msg.type = RRU_sync_ok;
|
||||||
|
rru_config_msg.len = sizeof(RRU_CONFIG_msg_t); // TODO: set to correct msg len
|
||||||
|
LOG_I(PHY,"Sending RRU_sync_ok to RAU\n");
|
||||||
|
AssertFatal((ru->ifdevice.trx_ctlsend_func(&ru->ifdevice,&rru_config_msg,rru_config_msg.len)!=-1),"Failed to send msg to RAU %d\n",ru->idx);
|
||||||
|
//LOG_I(PHY,"~~~~~~~~~ RU_RUN\n");
|
||||||
/*LOG_M("dmrs_time.m","dmrstime",calibration->drs_ch_estimates_time[0], (fp->ofdm_symbol_size),1,1);
|
/*LOG_M("dmrs_time.m","dmrstime",calibration->drs_ch_estimates_time[0], (fp->ofdm_symbol_size),1,1);
|
||||||
LOG_M("rxdataF_ext.m","rxdataFext",&calibration->rxdataF_ext[0][36*fp->N_RB_DL], 12*(fp->N_RB_DL),1,1);
|
LOG_M("rxdataF_ext.m","rxdataFext",&calibration->rxdataF_ext[0][36*fp->N_RB_DL], 12*(fp->N_RB_DL),1,1);
|
||||||
LOG_M("drs_seq0.m","drsseq0",ul_ref_sigs_rx[0][0][23],600,1,1);
|
LOG_M("drs_seq0.m","drsseq0",ul_ref_sigs_rx[0][0][23],600,1,1);
|
||||||
@@ -759,7 +763,9 @@ void ru_fep_full_2thread(RU_t *ru) {
|
|||||||
else if (ru->state == RU_RUN) {
|
else if (ru->state == RU_RUN) {
|
||||||
// check for synchronization error
|
// check for synchronization error
|
||||||
if (check_sync_pos >= 8 || check_sync_pos<=-8) {
|
if (check_sync_pos >= 8 || check_sync_pos<=-8) {
|
||||||
exit(-1);
|
LOG_E(PHY,"~~~~~~~~~~~~~~ check_sync_pos %d, frame %d ---> LOST SYNC-EXIT\n", check_sync_pos, proc->frame_rx);
|
||||||
|
LOG_M("rxdata.m","rxdata",&ru->common.rxdata[0][0], fp->samples_per_tti*2,1,1);
|
||||||
|
exit(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -444,7 +444,7 @@ void fh_if4p5_north_asynch_in(RU_t *ru,int *frame,int *subframe) {
|
|||||||
AssertFatal(frame_tx == *frame,
|
AssertFatal(frame_tx == *frame,
|
||||||
"frame_tx %d is not what we expect %d\n",frame_tx,*frame);
|
"frame_tx %d is not what we expect %d\n",frame_tx,*frame);
|
||||||
AssertFatal(subframe_tx == *subframe,
|
AssertFatal(subframe_tx == *subframe,
|
||||||
"subframe_tx %d is not what we expect %d\n",subframe_tx,*subframe);
|
"In frame_tx %d : subframe_tx %d is not what we expect %d\n",frame_tx,subframe_tx,*subframe);
|
||||||
}
|
}
|
||||||
if (packet_type == IF4p5_PDLFFT) {
|
if (packet_type == IF4p5_PDLFFT) {
|
||||||
symbol_mask = symbol_mask | (1<<symbol_number);
|
symbol_mask = symbol_mask | (1<<symbol_number);
|
||||||
@@ -1737,7 +1737,7 @@ if(!emulate_rf){
|
|||||||
|
|
||||||
#ifdef PHY_TX_THREAD
|
#ifdef PHY_TX_THREAD
|
||||||
if(first_phy_tx == 0)
|
if(first_phy_tx == 0)
|
||||||
{
|
{
|
||||||
phy_tx_end = 0;
|
phy_tx_end = 0;
|
||||||
phy_tx_txdataF_end = 0;
|
phy_tx_txdataF_end = 0;
|
||||||
if(pthread_mutex_lock(&ru->proc.mutex_phy_tx) != 0){
|
if(pthread_mutex_lock(&ru->proc.mutex_phy_tx) != 0){
|
||||||
@@ -1754,7 +1754,7 @@ if(!emulate_rf){
|
|||||||
++ru->proc.instance_cnt_phy_tx;
|
++ru->proc.instance_cnt_phy_tx;
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock( &ru->proc.mutex_phy_tx );
|
pthread_mutex_unlock( &ru->proc.mutex_phy_tx );
|
||||||
} else {
|
} else {
|
||||||
phy_tx_end = 1;
|
phy_tx_end = 1;
|
||||||
phy_tx_txdataF_end = 1;
|
phy_tx_txdataF_end = 1;
|
||||||
}
|
}
|
||||||
@@ -1780,7 +1780,7 @@ if(!emulate_rf){
|
|||||||
|
|
||||||
ru->wait_cnt--;
|
ru->wait_cnt--;
|
||||||
|
|
||||||
LOG_I(PHY,"RU thread %d, frame %d, subframe %d, wait_cnt %d \n",ru->idx, frame, subframe, ru->wait_cnt);
|
LOG_D(PHY,"RU thread %d, frame %d, subframe %d, wait_cnt %d \n",ru->idx, frame, subframe, ru->wait_cnt);
|
||||||
|
|
||||||
if (ru->if_south!=LOCAL_RF && ru->wait_cnt <=20 && subframe == 5 && frame != RC.ru[0]->proc.frame_rx && resynch_done == 0) {
|
if (ru->if_south!=LOCAL_RF && ru->wait_cnt <=20 && subframe == 5 && frame != RC.ru[0]->proc.frame_rx && resynch_done == 0) {
|
||||||
// Send RRU_frame adjust
|
// Send RRU_frame adjust
|
||||||
@@ -1789,7 +1789,7 @@ if(!emulate_rf){
|
|||||||
rru_config_msg.len = sizeof(RRU_CONFIG_msg_t); // TODO: set to correct msg len
|
rru_config_msg.len = sizeof(RRU_CONFIG_msg_t); // TODO: set to correct msg len
|
||||||
((uint16_t*)&rru_config_msg.msg[0])[0] = RC.ru[0]->proc.frame_rx;
|
((uint16_t*)&rru_config_msg.msg[0])[0] = RC.ru[0]->proc.frame_rx;
|
||||||
ru->cmd=WAIT_RESYNCH;
|
ru->cmd=WAIT_RESYNCH;
|
||||||
LOG_D(PHY,"Sending Frame Resynch %d to RRU %d\n", RC.ru[0]->proc.frame_rx,ru->idx);
|
LOG_I(PHY,"Sending Frame Resynch %d to RRU %d\n", RC.ru[0]->proc.frame_rx,ru->idx);
|
||||||
AssertFatal((ru->ifdevice.trx_ctlsend_func(&ru->ifdevice,&rru_config_msg,rru_config_msg.len)!=-1),"Failed to send msg to RAU\n");
|
AssertFatal((ru->ifdevice.trx_ctlsend_func(&ru->ifdevice,&rru_config_msg,rru_config_msg.len)!=-1),"Failed to send msg to RAU\n");
|
||||||
resynch_done=1;
|
resynch_done=1;
|
||||||
}
|
}
|
||||||
@@ -1819,7 +1819,7 @@ if(!emulate_rf){
|
|||||||
wakeup_slaves(proc);
|
wakeup_slaves(proc);
|
||||||
|
|
||||||
// do RX front-end processing (frequency-shift, dft) if needed
|
// do RX front-end processing (frequency-shift, dft) if needed
|
||||||
if (ru->feprx) ru->feprx(ru);
|
if (ru->feprx) ru->feprx(ru);
|
||||||
|
|
||||||
// wakeup all eNB processes waiting for this RU
|
// wakeup all eNB processes waiting for this RU
|
||||||
pthread_mutex_lock(&proc->mutex_eNBs);
|
pthread_mutex_lock(&proc->mutex_eNBs);
|
||||||
@@ -1882,7 +1882,7 @@ if(!emulate_rf){
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} // else wait_cnt == 0
|
} // else wait_cnt == 0
|
||||||
} // ru->state = RU_RU
|
} // ru->state = RU_RUN
|
||||||
} // while !oai_exit
|
} // while !oai_exit
|
||||||
|
|
||||||
printf( "Exiting ru_thread \n");
|
printf( "Exiting ru_thread \n");
|
||||||
|
|||||||
@@ -717,7 +717,7 @@ void* ru_thread_control( void* param ) {
|
|||||||
LOG_I(PHY,"Received RRU_frame_resynch command\n");
|
LOG_I(PHY,"Received RRU_frame_resynch command\n");
|
||||||
ru->cmd = RU_FRAME_RESYNCH;
|
ru->cmd = RU_FRAME_RESYNCH;
|
||||||
ru->cmdval = ((uint16_t*)&rru_config_msg.msg[0])[0];
|
ru->cmdval = ((uint16_t*)&rru_config_msg.msg[0])[0];
|
||||||
LOG_I(PHY,"Received Frame Resynch messaage with value %d\n",ru->cmdval);
|
LOG_I(PHY,"Received Frame Resynch message with value %d\n",ru->cmdval);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user