Commit 89052325 authored by Sandeep Kumar's avatar Sandeep Kumar

handling if send for rxsigF

parent f5eaa7d7
...@@ -48,13 +48,13 @@ ...@@ -48,13 +48,13 @@
// --- Careful to handle buffer memory --- RAW/UDP modes --- PRACH variables and data // --- Careful to handle buffer memory --- RAW/UDP modes --- PRACH variables and data
void send_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type) { void send_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type, int k) {
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
int32_t **txdataF = eNB->common_vars.txdataF[0]; int32_t **txdataF = eNB->common_vars.txdataF[0];
int32_t **rxdataF = eNB->common_vars.rxdataF[0]; int32_t **rxdataF = eNB->common_vars.rxdataF[0];
int16_t *prachF = eNB->prach_vars.prachF; int16_t **rxsigF = eNB->prach_vars.rxsigF;
uint16_t symbol_id, element_id; uint16_t symbol_id=0, element_id=0;
uint16_t db_fulllength, db_halflength; uint16_t db_fulllength, db_halflength;
int slotoffsetF=0, blockoffsetF=0; int slotoffsetF=0, blockoffsetF=0;
...@@ -139,8 +139,7 @@ void send_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type) ...@@ -139,8 +139,7 @@ void send_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type)
} }
} else if (packet_type == IF4_PRACH) { } else if (packet_type == IF4_PRACH) {
// FIX: hard coded prach samples length // FIX: hard coded prach samples length
db_fulllength = 839; db_fulllength = 839*2;
slotoffsetF = (subframe)*(fp->ofdm_symbol_size)*((fp->Ncp==1) ? 12 : 14) + 1;
tx_buffer = malloc(MAC_HEADER_SIZE_BYTES + sizeof_IF4_prach_header_t + db_fulllength*sizeof(int16_t)); tx_buffer = malloc(MAC_HEADER_SIZE_BYTES + sizeof_IF4_prach_header_t + db_fulllength*sizeof(int16_t));
IF4_prach_header_t *prach_header = (IF4_prach_header_t *)(tx_buffer + MAC_HEADER_SIZE_BYTES); IF4_prach_header_t *prach_header = (IF4_prach_header_t *)(tx_buffer + MAC_HEADER_SIZE_BYTES);
...@@ -148,11 +147,14 @@ void send_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type) ...@@ -148,11 +147,14 @@ void send_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type)
gen_IF4_prach_header(prach_header, frame, subframe); gen_IF4_prach_header(prach_header, frame, subframe);
// Do compression and generate data blocks // Generate uncompressed data blocks
for (element_id=0; element_id<db_fulllength; element_id++) { memcpy(data_block, (rxsigF[0]+k), db_fulllength*sizeof(int16_t));
data_block[element_id] = lin2alaw[ (prachF[blockoffsetF+element_id] & 0xffff) + 32768 ];
data_block[element_id] |= lin2alaw[ (prachF[blockoffsetF+element_id]>>16) + 32768 ]<<8; //for (element_id=0; element_id<db_fulllength; element_id++) {
} // data_block[element_id] = rxsigF[0][prachoffsetF];
// data_block[element_id] |= rxsigF[0][prachoffsetF+1]<<16;
// prachoffsetF += 2;
//}
// Write the packet to the fronthaul // Write the packet to the fronthaul
if ((eNB->ifdevice.trx_write_func(&eNB->ifdevice, if ((eNB->ifdevice.trx_write_func(&eNB->ifdevice,
...@@ -176,16 +178,16 @@ void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type, ...@@ -176,16 +178,16 @@ void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type,
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
int32_t **txdataF = eNB->common_vars.txdataF[0]; int32_t **txdataF = eNB->common_vars.txdataF[0];
int32_t **rxdataF = eNB->common_vars.rxdataF[0]; int32_t **rxdataF = eNB->common_vars.rxdataF[0];
int16_t *prachF = eNB->prach_vars.prachF; int16_t **rxsigF = eNB->prach_vars.rxsigF;
uint16_t element_id; uint16_t element_id;
uint16_t db_fulllength, db_halflength; uint16_t db_fulllength, db_halflength;
int slotoffsetF, blockoffsetF; int slotoffsetF, blockoffsetF;
if (expected_packet == IF4_PDLFFT) { if (expected_packet == IF4_PDLFFT) {
db_fulllength = = (12*fp->N_RB_DL); db_fulllength = (12*fp->N_RB_DL);
} else { } else {
db_fulllength = = (12*fp->N_RB_UL); db_fulllength = (12*fp->N_RB_UL);
} }
db_halflength = db_fulllength>>1; db_halflength = db_fulllength>>1;
......
...@@ -182,6 +182,6 @@ void gen_IF4_ul_header(IF4_ul_header_t*, int, int); ...@@ -182,6 +182,6 @@ void gen_IF4_ul_header(IF4_ul_header_t*, int, int);
void gen_IF4_prach_header(IF4_prach_header_t*, int, int); void gen_IF4_prach_header(IF4_prach_header_t*, int, int);
void send_IF4(PHY_VARS_eNB*, int, int, uint16_t); 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*, uint16_t);
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include "PHY/defs.h" #include "PHY/defs.h"
#include "PHY/extern.h" #include "PHY/extern.h"
//#include "prach.h" //#include "prach.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "SCHED/defs.h" #include "SCHED/defs.h"
#include "SCHED/extern.h" #include "SCHED/extern.h"
#include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/LOG/vcd_signal_dumper.h"
...@@ -1269,18 +1270,25 @@ void rx_prach(PHY_VARS_eNB *eNB, ...@@ -1269,18 +1270,25 @@ void rx_prach(PHY_VARS_eNB *eNB,
} }
if (eNB->node_function == NGFI_RRU_IF4) { if (eNB->node_function == NGFI_RRU_IF4) {
/// **** send_IF4 of prachF to RCC **** /// k = (12*n_ra_prb) - 6*eNB->frame_parms.N_RB_UL;
if (k<0) {
k+=(eNB->frame_parms.ofdm_symbol_size);
}
k*=12;
k+=13;
k*=2;
/// **** send_IF4 of rxsigF to RCC **** ///
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 1 );
//send_IF4(eNB, frame, subframe, IF4_PRACH); send_IF4(eNB, eNB->proc.frame_rx, eNB->proc.subframe_rx, IF4_PRACH, k);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 0 );
return; return;
} }
// in case of RCC and prach received rx_thread wakes up prach // in case of RCC and prach received rx_thread wakes up prach
//else if (eNB->node_function == NGFI_RCC_IF4) {
// wait for prachF from RRU and continue with PRACH processing
//}
// here onwards is for eNodeB_3GPP or NGFI_RCC_IF4 // here onwards is for eNodeB_3GPP or NGFI_RCC_IF4
......
...@@ -2605,7 +2605,7 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl ...@@ -2605,7 +2605,7 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl
/// **** send_IF4 of rxdataF to RCC (no prach now) **** /// /// **** send_IF4 of rxdataF to RCC (no prach now) **** ///
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 1 );
send_IF4(eNB, frame, subframe, IF4_PULFFT); send_IF4(eNB, frame, subframe, IF4_PULFFT, 0);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 0 );
} }
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
// Packet sizes for IF4 interface format // Packet sizes for IF4 interface format
#define DATA_BLOCK_SIZE_BYTES(scaled_nblocks) (sizeof(int16_t)*scaled_nblocks) #define DATA_BLOCK_SIZE_BYTES(scaled_nblocks) (sizeof(int16_t)*scaled_nblocks)
#define PRACH_BLOCK_SIZE_BYTES (sizeof(int16_t)*839) // FIX hard coded prach size #define PRACH_BLOCK_SIZE_BYTES (sizeof(int16_t)*839*2) // FIX hard coded prach size (uncompressed)
#define RAW_IF4_PDLFFT_SIZE_BYTES(nblocks) (MAC_HEADER_SIZE_BYTES + sizeof_IF4_dl_header_t + DATA_BLOCK_SIZE_BYTES(nblocks)) #define RAW_IF4_PDLFFT_SIZE_BYTES(nblocks) (MAC_HEADER_SIZE_BYTES + sizeof_IF4_dl_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
#define RAW_IF4_PULFFT_SIZE_BYTES(nblocks) (MAC_HEADER_SIZE_BYTES + sizeof_IF4_ul_header_t + DATA_BLOCK_SIZE_BYTES(nblocks)) #define RAW_IF4_PULFFT_SIZE_BYTES(nblocks) (MAC_HEADER_SIZE_BYTES + sizeof_IF4_ul_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
......
...@@ -534,7 +534,7 @@ static void* eNB_thread_rxtx( void* param ) { ...@@ -534,7 +534,7 @@ static void* eNB_thread_rxtx( void* param ) {
/// **** send_IF4 of txdataF to RRU **** /// /// **** send_IF4 of txdataF to RRU **** ///
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 1 );
send_IF4(PHY_vars_eNB_g[0][proc->CC_id], proc->frame_tx, proc->subframe_tx, IF4_PDLFFT); send_IF4(PHY_vars_eNB_g[0][proc->CC_id], proc->frame_tx, proc->subframe_tx, IF4_PDLFFT, 0);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 0 );
} }
......
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