diff --git a/openair1/PHY/LTE_TRANSPORT/if4_tools.c b/openair1/PHY/LTE_TRANSPORT/if4_tools.c index 4756559ac39ddad2551456fc814a50b2a3953191..b71365d6fc0970257bdf00f1976a14325b3438ee 100644 --- a/openair1/PHY/LTE_TRANSPORT/if4_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/if4_tools.c @@ -176,7 +176,7 @@ void send_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type, } -void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type, uint32_t *symbol_number) { +void recv_IF4(PHY_VARS_eNB *eNB, int *frame, int *subframe, uint16_t *packet_type, uint32_t *symbol_number) { LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; int32_t **txdataF = eNB->common_vars.txdataF[0]; int32_t **rxdataF = eNB->common_vars.rxdataF[0]; @@ -208,10 +208,13 @@ void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type, packet_header = (IF4_header_t*) (rx_buffer+MAC_HEADER_SIZE_BYTES); data_block = (int16_t*) (rx_buffer+MAC_HEADER_SIZE_BYTES+sizeof_IF4_header_t); + + *frame = ((packet_header->frame_status)>>6)&0xffff; + *subframe = ((packet_header->frame_status)>>22)&0x000f; if (*packet_type == IF4_PDLFFT) { // Calculate from received packet - slotoffsetF = (subframe)*(fp->ofdm_symbol_size)*((fp->Ncp==1) ? 12 : 14) + 1; + slotoffsetF = (*subframe)*(fp->ofdm_symbol_size)*((fp->Ncp==1) ? 12 : 14) + 1; blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength; // Do decompression of the two parts and generate txdataF @@ -228,7 +231,7 @@ void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type, } else if (*packet_type == IF4_PULFFT) { // Calculate from received packet - slotoffsetF = (subframe)*(fp->ofdm_symbol_size)*((fp->Ncp==1) ? 12 : 14) + 1; + slotoffsetF = (*subframe)*(fp->ofdm_symbol_size)*((fp->Ncp==1) ? 12 : 14) + 1; blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength; // Do decompression of the two parts and generate rxdataF @@ -246,7 +249,7 @@ void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type, } else if (*packet_type == IF4_PRACH) { // FIX: hard coded prach samples length db_fulllength = 839*2; - + // Generate uncompressed data blocks memcpy((rxsigF[0]+slotoffsetF), data_block, db_fulllength*sizeof(int16_t)); diff --git a/openair1/PHY/LTE_TRANSPORT/if4_tools.h b/openair1/PHY/LTE_TRANSPORT/if4_tools.h index f06072b73e66be9feceddfda86359cb0928366ed..18ff2bb8f826186cc397dc59e895d3a9a716995e 100644 --- a/openair1/PHY/LTE_TRANSPORT/if4_tools.h +++ b/openair1/PHY/LTE_TRANSPORT/if4_tools.h @@ -70,4 +70,4 @@ void gen_IF4_prach_header(IF4_header_t*, int, int); void send_IF4(PHY_VARS_eNB*, int, int, uint16_t, int); -void recv_IF4(PHY_VARS_eNB*, int, int, uint16_t*, uint32_t*); +void recv_IF4(PHY_VARS_eNB*, int*, int*, uint16_t*, uint32_t*); diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 2754f7842bdf4e42c3bfd6ecf7316a8b678324bf..e5b93dc6ac058c2123b6a3f67a730bf3b8a443e3 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -2664,13 +2664,13 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl do { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 1 ); - recv_IF4(eNB, proc->frame_rx, proc->subframe_rx, &packet_type, &symbol_number); + recv_IF4(eNB, &proc->frame_rx, &proc->subframe_rx, &packet_type, &symbol_number); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 0 ); if (packet_type == IF4_PULFFT) { symbol_mask = symbol_mask | (1<<symbol_number); - } else if (is_prach_subframe(fp,frame,subframe)>0 && packet_type == PRACH) { + } else if (packet_type == IF4_PRACH) { // wake up thread for PRACH RX prach_rx = 1; @@ -2703,6 +2703,23 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl } while( (symbol_mask != symbol_mask_full) && (prach_rx == 0)); + if (proc->first_rx == 0) { + if (proc->subframe_rx != subframe){ + LOG_E(PHY,"Received Timestamp doesn't correspond to the time we think it is (proc->subframe_rx %d, subframe %d)\n",proc->subframe_rx,subframe); +// exit_fun("Exiting"); + } + if (proc->frame_rx != frame) { + LOG_E(PHY,"Received Timestamp doesn't correspond to the time we think it is (proc->frame_rx %d frame %d)\n",proc->frame_rx,frame); + // exit_fun("Exiting"); + } + } else { + proc->first_rx = 0; + } + + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, proc->timestamp_rx&0xffffffff ); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX_ENB, proc->frame_rx ); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX_ENB, proc->subframe_rx ); + // Tobi aka mr monaco: ETH } else { // should not get here diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index 0e3af529c22fe6166ef9924e97d50c525bb259de..6eb916c41bf0b527a541a4363090365c422eb22e 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -493,10 +493,11 @@ static void* eNB_thread_rxtx( void* param ) { /// **** recv_IF4 of txdataF from RCC **** /// VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 1 ); while (symbol_number < PHY_vars_eNB_g[0][proc->CC_id]->frame_parms.symbols_per_tti-1) { - recv_IF4(PHY_vars_eNB_g[0][proc->CC_id], proc->frame_tx, proc->subframe_tx, &packet_type, &symbol_number); + recv_IF4(PHY_vars_eNB_g[0][proc->CC_id], &proc->frame_tx, &proc->subframe_tx, &packet_type, &symbol_number); } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 0 ); + // Check the recv frame/subframe } }