Commit 3fd226f7 authored by Sandeep Kumar's avatar Sandeep Kumar

added sync between rru and rcc frame, subframe

parent 36a3d857
......@@ -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));
......
......@@ -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*);
......@@ -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
......
......@@ -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
}
}
......
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