Commit 085718ae authored by Raymond Knopp's avatar Raymond Knopp

RRU synchronization debugging

parent 8df3f84f
...@@ -119,7 +119,7 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type ...@@ -119,7 +119,7 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type
gen_IF4p5_ul_header(packet_header, frame, subframe); gen_IF4p5_ul_header(packet_header, frame, subframe);
for (symbol_id=0; symbol_id<fp->symbols_per_tti; symbol_id++) { for (symbol_id=0; symbol_id<fp->symbols_per_tti; symbol_id++) {
LOG_I(PHY,"IF4p5_PULFFT: frame %d, subframe %d, symbol %d\n",frame,subframe,symbol_id);
for (element_id=0; element_id<db_halflength; element_id++) { for (element_id=0; element_id<db_halflength; element_id++) {
i = (uint16_t*) &rxdataF[0][blockoffsetF+element_id]; i = (uint16_t*) &rxdataF[0][blockoffsetF+element_id];
data_block[element_id] = ((uint16_t) lin2alaw[*i]) | (lin2alaw[*(i+1)]<<8); data_block[element_id] = ((uint16_t) lin2alaw[*i]) | (lin2alaw[*(i+1)]<<8);
...@@ -145,6 +145,7 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type ...@@ -145,6 +145,7 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type
} }
} else if (packet_type == IF4p5_PRACH) { } else if (packet_type == IF4p5_PRACH) {
// FIX: hard coded prach samples length // FIX: hard coded prach samples length
LOG_I(PHY,"IF4p5_PRACH: frame %d, subframe %d\n",frame,subframe);
db_fulllength = 840*2; db_fulllength = 840*2;
if (eth->flags == ETH_RAW_IF4p5_MODE) { if (eth->flags == ETH_RAW_IF4p5_MODE) {
packet_header = (IF4p5_header_t *)(tx_buffer + MAC_HEADER_SIZE_BYTES); packet_header = (IF4p5_header_t *)(tx_buffer + MAC_HEADER_SIZE_BYTES);
...@@ -229,11 +230,12 @@ void recv_IF4p5(PHY_VARS_eNB *eNB, int *frame, int *subframe, uint16_t *packet_t ...@@ -229,11 +230,12 @@ void recv_IF4p5(PHY_VARS_eNB *eNB, int *frame, int *subframe, uint16_t *packet_t
*packet_type = packet_header->sub_type; *packet_type = packet_header->sub_type;
// LOG_I(PHY,"CC_id %d : frame %d, subframe %d\n",eNB->CC_id,*frame,*subframe);
if (*packet_type == IF4p5_PDLFFT) { if (*packet_type == IF4p5_PDLFFT) {
*symbol_number = ((packet_header->frame_status)>>26)&0x000f; *symbol_number = ((packet_header->frame_status)>>26)&0x000f;
LOG_I(PHY,"DL_IF4p5: CC_id %d : frame %d, subframe %d, symbol %d\n",eNB->CC_id,*frame,*subframe,*symbol_number);
slotoffsetF = (*symbol_number)*(fp->ofdm_symbol_size) + (*subframe)*(fp->ofdm_symbol_size)*((fp->Ncp==1) ? 12 : 14) + 1; slotoffsetF = (*symbol_number)*(fp->ofdm_symbol_size) + (*subframe)*(fp->ofdm_symbol_size)*((fp->Ncp==1) ? 12 : 14) + 1;
blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength - 1; blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength - 1;
......
...@@ -244,6 +244,10 @@ typedef struct eNB_proc_t_s { ...@@ -244,6 +244,10 @@ typedef struct eNB_proc_t_s {
int subframe_prach; int subframe_prach;
/// frame to act upon for reception /// frame to act upon for reception
int frame_rx; int frame_rx;
/// frame to act upon for transmission
int frame_tx;
/// frame offset for secondary eNBs (to correct for frame asynchronism at startup)
int frame_offset;
/// 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. /// \internal This variable is protected by \ref mutex_fep.
......
...@@ -756,6 +756,7 @@ void fh_if4p5_asynch_DL(PHY_VARS_eNB *eNB,int *frame,int *subframe) { ...@@ -756,6 +756,7 @@ void fh_if4p5_asynch_DL(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
*frame = frame_tx; *frame = frame_tx;
*subframe = subframe_tx; *subframe = subframe_tx;
proc->first_tx = 0; proc->first_tx = 0;
proc->frame_offset = frame_tx - proc->frame_tx;
} }
else { else {
if (frame_tx != *frame) { if (frame_tx != *frame) {
...@@ -779,6 +780,7 @@ void fh_if4p5_asynch_DL(PHY_VARS_eNB *eNB,int *frame,int *subframe) { ...@@ -779,6 +780,7 @@ void fh_if4p5_asynch_DL(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
*frame = frame_tx; *frame = frame_tx;
// intialize this to zero after we're done with the subframe // intialize this to zero after we're done with the subframe
proc->symbol_mask[*subframe] = 0; proc->symbol_mask[*subframe] = 0;
...@@ -906,6 +908,9 @@ void rx_rf(PHY_VARS_eNB *eNB,int *frame,int *subframe) { ...@@ -906,6 +908,9 @@ void rx_rf(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
} }
proc->frame_rx = ((proc->timestamp_rx-eNB->ts_offset) / (fp->samples_per_tti*10))&1023; proc->frame_rx = ((proc->timestamp_rx-eNB->ts_offset) / (fp->samples_per_tti*10))&1023;
proc->subframe_rx = ((proc->timestamp_rx-eNB->ts_offset) / fp->samples_per_tti)%10; proc->subframe_rx = ((proc->timestamp_rx-eNB->ts_offset) / fp->samples_per_tti)%10;
proc->frame_rx = (proc->frame_rx+proc->frame_offset)%1023;
proc->frame_tx = proc->frame_rx;
if (proc->subframe_rx > 5) proc->frame_tx=(proc->frame_tx+1)%1023;
// synchronize first reception to frame 0 subframe 0 // synchronize first reception to frame 0 subframe 0
proc->timestamp_tx = proc->timestamp_rx+(4*fp->samples_per_tti); proc->timestamp_tx = proc->timestamp_rx+(4*fp->samples_per_tti);
...@@ -916,8 +921,8 @@ void rx_rf(PHY_VARS_eNB *eNB,int *frame,int *subframe) { ...@@ -916,8 +921,8 @@ void rx_rf(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
LOG_E(PHY,"rx_rf: Received Timestamp (%llu) doesn't correspond to the time we think it is (proc->subframe_rx %d, subframe %d)\n",proc->timestamp_rx,proc->subframe_rx,*subframe); LOG_E(PHY,"rx_rf: Received Timestamp (%llu) doesn't correspond to the time we think it is (proc->subframe_rx %d, subframe %d)\n",proc->timestamp_rx,proc->subframe_rx,*subframe);
exit_fun("Exiting"); exit_fun("Exiting");
} }
int f2 = *frame+proc->frame_offset;
if (proc->frame_rx != *frame) { if (proc->frame_rx != f2) {
LOG_E(PHY,"rx_rf: Received Timestamp (%llu) doesn't correspond to the time we think it is (proc->frame_rx %d frame %d)\n",proc->timestamp_rx,proc->frame_rx,*frame); LOG_E(PHY,"rx_rf: Received Timestamp (%llu) doesn't correspond to the time we think it is (proc->frame_rx %d frame %d)\n",proc->timestamp_rx,proc->frame_rx,*frame);
exit_fun("Exiting"); exit_fun("Exiting");
} }
...@@ -1495,7 +1500,7 @@ static void* eNB_thread_single( void* param ) { ...@@ -1495,7 +1500,7 @@ static void* eNB_thread_single( void* param ) {
proc_rxtx->subframe_rx = proc->subframe_rx; proc_rxtx->subframe_rx = proc->subframe_rx;
proc_rxtx->frame_rx = proc->frame_rx; proc_rxtx->frame_rx = proc->frame_rx;
proc_rxtx->subframe_tx = (proc->subframe_rx+4)%10; proc_rxtx->subframe_tx = (proc->subframe_rx+4)%10;
proc_rxtx->frame_tx = (proc->subframe_rx < 6) ? proc->frame_rx : (proc->frame_rx+1)&1023; proc_rxtx->frame_tx = proc->frame_tx;
proc_rxtx->timestamp_tx = proc->timestamp_tx; proc_rxtx->timestamp_tx = proc->timestamp_tx;
// At this point, all information for subframe has been received on FH interface // At this point, all information for subframe has been received on FH interface
......
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