Commit 0d4d8cef authored by Sandeep Kumar's avatar Sandeep Kumar

added node func BBU and marked split for rf/if read and write

parent 6ae41237
......@@ -157,10 +157,11 @@ enum transmission_access_mode {
SCHEDULED_ACCESS,
CBA_ACCESS};
typedef enum {
eNodeB_3GPP=0, // classical eNodeB function
NGFI_RRU_IF4, // NGFI_RRU (NGFI remote radio-unit, currently split at common - ue_specific interface, IF4)
NGFI_RCC_IF4 // NGFI_RCC (NGFI radio cloud center, currently split at common - ue_specific interface, IF4)
typedef enum {
eNodeB_3GPP=0, // classical eNodeB function
eNodeB_3GPP_BBU, // classical eNodeB function with transport interface
NGFI_RRU_IF4, // NGFI_RRU (NGFI remote radio-unit, currently split at common - ue_specific interface, IF4)
NGFI_RCC_IF4, // NGFI_RCC (NGFI radio cloud center, currently split at common - ue_specific interface, IF4)
} eNB_func_t;
typedef struct UE_SCAN_INFO_s {
......
......@@ -2524,11 +2524,7 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl
uint16_t packet_type;
uint32_t symbol_number=0;
uint32_t symbol_mask, symbol_mask_full;
struct timespec time_req, time_rem;
time_req.tv_sec = 0;
time_req.tv_nsec = 300000;
if (subframe==9) {
subframe=0;
frame++;
......@@ -2547,7 +2543,7 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl
if (abstraction_flag==0) { // grab signal in chunks of 500 us (1 slot)
if ((eNB->node_function == NGFI_RRU_IF4) ||
(eNB->node_function == eNodeB_3GPP)) { // acquisition from RF and front-end processing
(eNB->node_function == eNodeB_3GPP)) { // acquisition from RF
for (i=0; i<fp->nb_antennas_rx; i++)
rxp[i] = (void*)&eNB->common_vars.rxdata[0][i][subframe*fp->samples_per_tti];
......@@ -2563,13 +2559,13 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl
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");
}
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");
}
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;
}
......@@ -2585,6 +2581,16 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 );
} else if(eNB->node_function == eNodeB_3GPP_BBU) { // acquisition from IF
/// **** trx_read_func from IF device **** ///
}
if ((eNB->node_function == NGFI_RRU_IF4) ||
(eNB->node_function == eNodeB_3GPP) ||
(eNB->node_function == eNodeB_3GPP_BBU)) { // front-end processing
// now do common RX processing for first slot in subframe
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_SLOT_FEP,1);
remove_7_5_kHz(eNB,proc->subframe_rx<<1);
......@@ -2608,12 +2614,10 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_SLOT_FEP,0);
if (eNB->node_function == NGFI_RRU_IF4 && is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx)<=0) {
/// **** 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 );
send_IF4(eNB, frame, subframe, IF4_PULFFT, 0);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 0 );
}
/// **** send_IF4 of prach to RCC **** /// done in prach thread (below)
......@@ -2657,10 +2661,6 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl
symbol_mask = 0;
symbol_mask_full = (1<<fp->symbols_per_tti)-1;
prach_rx = 0;
// Block from loop while testing
//symbol_mask = symbol_mask_full;
//nanosleep(&time_req, &time_rem);
do {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 1 );
......
......@@ -500,12 +500,13 @@ static void* eNB_thread_rxtx( void* param ) {
}
}
// eNodeB_3GPP and RRU create txdata and write to RF device
// eNodeB_3GPP, _BBU and RRU create txdata
if (PHY_vars_eNB_g[0][proc->CC_id]->node_function != NGFI_RCC_IF4) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_SFGEN , 1 );
do_OFDM_mod_rt( proc->subframe_tx, PHY_vars_eNB_g[0][proc->CC_id] );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_SFGEN , 0 );
}
/*
short *txdata = (short*)&PHY_vars_eNB_g[0][proc->CC_id]->common_vars.txdata[0][0][proc->subframe_tx*PHY_vars_eNB_g[0][proc->CC_id]->frame_parms.samples_per_tti];
int i;
......@@ -518,8 +519,12 @@ static void* eNB_thread_rxtx( void* param ) {
txdata[i+5] = 0;
txdata[i+6] = 0;
txdata[i+7] = -2047; }
*/
*/
// eNodeB_3GPP, RRU write to RF device
if (PHY_vars_eNB_g[0][proc->CC_id]->node_function == eNodeB_3GPP ||
PHY_vars_eNB_g[0][proc->CC_id]->node_function == NGFI_RRU_IF4) {
// Transmit TX buffer based on timestamp from RX
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 );
// prepare tx buffer pointers
......@@ -539,13 +544,15 @@ static void* eNB_thread_rxtx( void* param ) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (proc->timestamp_tx-openair0_cfg[0].tx_sample_advance)&0xffffffff );
} else if (PHY_vars_eNB_g[0][proc->CC_id]->node_function == eNodeB_3GPP_BBU) {
/// **** trx_write_func to IF device **** ///
} else {
/// **** send_IF4 of txdataF to RRU **** ///
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, 0);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 0 );
}
if (pthread_mutex_lock(&proc->mutex_rxtx) != 0) {
......@@ -744,7 +751,7 @@ static void* eNB_thread_rx_common( void* param ) {
#endif
// Start RF device for this CC
if (eNB->node_function != NGFI_RCC_IF4) {
if (eNB->node_function == eNodeB_3GPP || eNB->node_function == NGFI_RRU_IF4) {
if (eNB->rfdevice.trx_start_func(&eNB->rfdevice) != 0 )
LOG_E(HW,"Could not start the RF device\n");
}
......
......@@ -686,7 +686,8 @@ static void get_options (int argc, char **argv)
LONG_OPTION_PHYTEST,
LONG_OPTION_RCC,
LONG_OPTION_RRU,
LONG_OPTION_ENB
LONG_OPTION_ENB,
LONG_OPTION_ENB_BBU
#if T_TRACER
,
LONG_OPTION_T_PORT,
......@@ -713,6 +714,7 @@ static void get_options (int argc, char **argv)
{"RCC", no_argument, NULL, LONG_OPTION_RCC},
{"RRU", no_argument, NULL, LONG_OPTION_RRU},
{"eNB", no_argument, NULL, LONG_OPTION_ENB},
{"BBU", no_argument, NULL, LONG_OPTION_ENB_BBU},
#if T_TRACER
{"T_port", required_argument, 0, LONG_OPTION_T_PORT},
{"T_nowait", no_argument, 0, LONG_OPTION_T_NOWAIT},
......@@ -815,6 +817,10 @@ static void get_options (int argc, char **argv)
case LONG_OPTION_ENB:
node_function = eNodeB_3GPP;
break;
case LONG_OPTION_ENB_BBU:
node_function = eNodeB_3GPP_BBU;
break;
#if T_TRACER
case LONG_OPTION_T_PORT: {
......@@ -1694,7 +1700,7 @@ int main( int argc, char **argv )
// Handle spatially distributed MIMO antenna ports
// Load RF device and initialize
if (node_function != NGFI_RCC_IF4) {
if (node_function == NGFI_RRU_IF4 || node_function == eNodeB_3GPP) {
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
if (mode!=loop_through_memory) {
returns=openair0_device_load(&(PHY_vars_eNB_g[0][CC_id]->rfdevice), &openair0_cfg[0]);
......@@ -1710,7 +1716,7 @@ int main( int argc, char **argv )
}
// Load transport protocol and initialize
if (node_function != eNodeB_3GPP){
if (node_function != eNodeB_3GPP) {
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
if (mode!=loop_through_memory) {
returns=openair0_transport_load(&(PHY_vars_eNB_g[0][CC_id]->ifdevice), &openair0_cfg[0], (eth_params+CC_id));
......
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