Commit 21aff80b authored by knopp's avatar knopp

Merge branch 'enhancement-10-harmony' of...

Merge branch 'enhancement-10-harmony' of https://gitlab.eurecom.fr/oai/openairinterface5g into enhancement-10-harmony

Conflicts:
	targets/RT/USER/lte-enb.c
parents f91457d8 5541cafd
......@@ -138,7 +138,7 @@ else (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l")
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mavx2")
endif()
if (CPUINFO MATCHES "sse4_1")
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1 -mavx2")
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1")
endif()
if (CPUINFO MATCHES "ssse3")
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mssse3")
......@@ -960,6 +960,7 @@ add_boolean_option(OAI_NW_DRIVER_USE_NETLINK True "????")
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/rar_tools.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/print_stats.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/initial_sync.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/if4_tools.c
${OPENAIR1_DIR}/PHY/MODULATION/ofdm_mod.c
${OPENAIR1_DIR}/PHY/MODULATION/slot_fep.c
${OPENAIR1_DIR}/PHY/MODULATION/slot_fep_mbsfn.c
......
......@@ -29,7 +29,7 @@
/*! \file PHY/LTE_TRANSPORT/if4_tools.c
* \brief
* \author Mauricio Gunther, S. Sandeep Kumar, Raymond Knopp
* \author Fredrik Skretteberg, Tobias Schuster, Mauricio Gunther, S. Sandeep Kumar, Raymond Knopp
* \date 2016
* \version 0.1
* \company Eurecom
......@@ -38,109 +38,137 @@
* \warning
*/
#ifndef USER_MODE
#include "if4_tools.h"
#include <stdint.h>
#else
#include "PHY/defs.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h"
#endif
#include "PHY/TOOLS/ALAW/alaw_lut.h"
// Get device information
void send_IF4(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc) {
int frame = proc->frame_tx;
int subframe = proc->subframe_tx;
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
uint16_t i;
float_t data_block_length = 1200*(fp->ofdm_symbol_size/2048);
uint16_t *data_block = (uint16_t*)malloc(data_block_length*sizeof(uint16_t));
void send_IF4(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, uint16_t packet_type) {
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
int32_t **txdataF = eNB->common_vars.txdataF[0];
uint16_t symbol_id, element_id;
uint16_t db_fulllength = 12*fp->N_RB_DL;
uint16_t db_halflength = db_fulllength>>1;
int slotoffsetF = (proc->subframe_tx)*(fp->ofdm_symbol_size)*((fp->Ncp==1) ? 12 : 14) + 1;
int blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength;
int16_t *data_block = (int16_t*)malloc(db_fulllength*sizeof(int16_t));
// Caller: RCC - DL *** handle RRU case - UL and PRACH ***
if (eNB->node_function == NGFI_RCC_IF4) {
if (packet_type == IF4_PDLFFT) {
IF4_dl_packet_t *dl_packet = (IF4_dl_packet_t*)malloc(sizeof_IF4_dl_packet_t);
gen_IF4_dl_packet(dl_packet, proc);
dl_packet->data_block = data_block;
for(i=0; i<fp->symbols_per_tti; i++) {
//Do compression of the two parts and generate data blocks
for (symbol_id=0; symbol_id<fp->symbols_per_tti; symbol_id++) {
printf("\n Send IF4 for frame %d, subframe %d and symbol %d\n", proc->frame_tx, proc->subframe_tx, symbol_id);
//symbol = eNB->common_vars.txdataF[0][0 /*antenna number*/][subframe*fp->ofdm_symbol_size*(fp->symbols_per_tti)]
//data_block[j] = Atan(symbol[fp->ofmd_symbol_size - NrOfNonZeroValues + j -1])<<16 + Atan(symbol[fp->ofmd_symbol_size - NrOfNonZeroValues + j]);
//data_block[j+NrOfNonZeroValues] = Atan(subframe[i][j+1])<<16 + Atan(subframe[i][j+2]);
// Do compression of the two parts and generate data blocks
for (element_id=0; element_id<db_halflength; element_id++) {
data_block[element_id] = lin2alaw[ (txdataF[0][blockoffsetF+element_id] & 0xffff) + 32768 ];
data_block[element_id] |= lin2alaw[ (txdataF[0][blockoffsetF+element_id]>>16) + 32768 ]<<8;
data_block[element_id+db_halflength] = lin2alaw[ (txdataF[0][slotoffsetF+element_id] & 0xffff) + 32768 ];
data_block[element_id+db_halflength] |= lin2alaw[ (txdataF[0][slotoffsetF+element_id]>>16) + 32768 ]<<8;
}
// Update information in generated packet
dl_packet->frame_status.sym_num = i;
dl_packet->frame_status.sym_num = symbol_id;
// Write the packet(s) to the fronthaul
//if ((bytes_sent = dev->eth_dev.trx_write_func (&dev->eth_dev,
// timestamp_rx,
// rx_eNB,
// spp_eth,
// dev->eth_dev.openair0_cfg->rx_num_channels,
// 0)) < 0) {
// perror("RCC : ETHERNET write");
//}
// if ((bytes_sent = eNB->ifdevice.trx_write_func(&eNB->ifdevice,
// (proc->timestamp_tx-eNB->ifdevice.openair0_cfg.tx_sample_advance),
// dl_packet,
// eNB->frame_parms.samples_per_tti,
// eNB->frame_parms.nb_antennas_tx,
// 0)) < 0) {
// perror("RCC : ETHERNET write");
//}
slotoffsetF += fp->ofdm_symbol_size;
blockoffsetF += fp->ofdm_symbol_size;
}
}else {
} else if (packet_type == IF4_PULFFT) {
IF4_ul_packet_t *ul_packet = (IF4_ul_packet_t*)malloc(sizeof_IF4_ul_packet_t);
gen_IF4_ul_packet(ul_packet, proc);
ul_packet->data_block = data_block;
for(i=0; i<fp->symbols_per_tti; i++) {
//Do compression of the two parts and generate data blocks
for (symbol_id=0; symbol_id<fp->symbols_per_tti; symbol_id++) {
//symbol = eNB->common_vars.txdataF[0][0 /*antenna number*/][subframe*fp->ofdm_symbol_size*(fp->symbols_per_tti)]
//data_block[j] = Atan(symbol[fp->ofmd_symbol_size - NrOfNonZeroValues + j -1])<<16 + Atan(symbol[fp->ofmd_symbol_size - NrOfNonZeroValues + j]);
//data_block[j+NrOfNonZeroValues] = Atan(subframe[i][j+1])<<16 + Atan(subframe[i][j+2]);
// Do compression of the two parts and generate data blocks - rxdataF
for (element_id=0; element_id<db_halflength; element_id++) {
//data_block[element_id] = lin2alaw[ (rxdataF[0][blockoffsetF+element_id] & 0xffff) + 32768 ];
//data_block[element_id] |= lin2alaw[ (rxdataF[0][blockoffsetF+element_id]>>16) + 32768 ]<<8;
//data_block[element_id+db_halflength] = lin2alaw[ (txdataF[0][slotoffsetF+element_id] & 0xffff) + 32768 ];
//data_block[element_id+db_halflength] |= lin2alaw[ (txdataF[0][slotoffsetF+element_id]>>16) + 32768 ]<<8;
}
// Update information in generated packet
ul_packet->frame_status.sym_num = i;
ul_packet->frame_status.sym_num = symbol_id;
// Write the packet(s) to the fronthaul
slotoffsetF += fp->ofdm_symbol_size;
blockoffsetF += fp->ofdm_symbol_size;
}
}
} else if (packet_type == IF4_PRACH) {
} else {
AssertFatal(1==0, "send_IF4 - Unknown packet_type %x", packet_type);
}
return;
}
void recv_IF4(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc) {
// Caller: RRU - DL *** handle RCC case - UL and PRACH ***
if (eNB->node_function == NGFI_RRU_IF4) {
void recv_IF4(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, uint16_t *packet_type, uint32_t *symbol_number) {
*packet_type = 0;
int16_t *data_block=NULL;
// Read packet(s) from the fronthaul
// for(i=0; i<fp->symbols_per_tti; i++) {
// if (dev->eth_dev.trx_read_func (&dev->eth_dev,
// timestamp_rx,
// rx_eNB,
// spp_eth,
// dev->eth_dev.openair0_cfg->rx_num_channels
// ) < 0) {
// perror("RRU : ETHERNET read");
// }
// printf("\n Recv IF4 for frame %d, subframe %d and symbol %d\n", proc->frame_tx, proc->subframe_tx, symbol_id);
//*packet_type = ;
for(i=0; i<fp->symbols_per_tti; i++) {
// Read packet(s) from the fronthaul
if (dev->eth_dev.trx_read_func (&dev->eth_dev,
timestamp_rx,
rx_eNB,
spp_eth,
dev->eth_dev.openair0_cfg->rx_num_channels
) < 0) {
perror("RRU : ETHERNET read");
}
if (*packet_type == IF4_PDLFFT) {
// Apply reverse processing - decompression
// txAlawtolinear( Datablock )
// Generate and return the OFDM symbols (txdataF)
txDataF
}
}else {
// txDataF
}
} else if (*packet_type == IF4_PULFFT) {
} else if (*packet_type == IF4_PRACH) {
} else {
AssertFatal(1==0, "recv_IF4 - Unknown packet_type %x", *packet_type);
}
return;
}
void gen_IF4_dl_packet(IF4_dl_packet_t *dl_packet, eNB_rxtx_proc_t *proc) {
// Set Type and Sub-Type
dl_packet->type = 0x080A;
dl_packet->type = IF4_PACKET_TYPE;
dl_packet->sub_type = IF4_PDLFFT;
// Leave reserved as it is
......@@ -160,7 +188,7 @@ void gen_IF4_dl_packet(IF4_dl_packet_t *dl_packet, eNB_rxtx_proc_t *proc) {
void gen_IF4_ul_packet(IF4_ul_packet_t *ul_packet, eNB_rxtx_proc_t *proc) {
// Set Type and Sub-Type
ul_packet->type = 0x080A;
ul_packet->type = IF4_PACKET_TYPE;
ul_packet->sub_type = IF4_PULFFT;
// Leave reserved as it is
......@@ -184,7 +212,7 @@ void gen_IF4_ul_packet(IF4_ul_packet_t *ul_packet, eNB_rxtx_proc_t *proc) {
void gen_IF4_prach_packet(IF4_prach_packet_t *prach_packet, eNB_rxtx_proc_t *proc) {
// Set Type and Sub-Type
prach_packet->type = 0x080A;
prach_packet->type = IF4_PACKET_TYPE;
prach_packet->sub_type = IF4_PRACH;
// Leave reserved as it is
......
......@@ -38,6 +38,10 @@
* \warning
*/
#include <stdint.h>
/// Macro for IF4 packet type
#define IF4_PACKET_TYPE 0x080A
#define IF4_PULFFT 0x0019
#define IF4_PDLFFT 0x0020
#define IF4_PRACH 0x0021
......@@ -103,7 +107,7 @@ struct IF4_dl_packet {
/// Frame Status
IF4_frame_status_t frame_status;
/// Data Blocks
uint16_t *data_block;
int16_t *data_block;
/// Frame Check Sequence
uint32_t fcs;
};
......@@ -141,7 +145,7 @@ struct IF4_ul_packet {
/// Gain 7
IF4_gain_t gain7;
/// Data Blocks
uint16_t *data_block;
int16_t *data_block;
/// Frame Check Sequence
uint32_t fcs;
};
......@@ -163,7 +167,7 @@ struct IF4_prach_packet {
/// LTE Prach Configuration
IF4_lte_prach_conf_t prach_conf;
/// Prach Data Block (one antenna)
uint16_t *data_block;
int16_t *data_block;
/// Frame Check Sequence
uint32_t fcs;
};
......@@ -177,6 +181,6 @@ void gen_IF4_ul_packet(IF4_ul_packet_t*, eNB_rxtx_proc_t*);
void gen_IF4_prach_packet(IF4_prach_packet_t*, eNB_rxtx_proc_t*);
void send_IF4(PHY_VARS_eNB*, eNB_rxtx_proc_t*);
void send_IF4(PHY_VARS_eNB*, eNB_rxtx_proc_t*, uint16_t);
void recv_IF4(PHY_VARS_eNB*, eNB_rxtx_proc_t*, int*, int*);
void recv_IF4(PHY_VARS_eNB*, eNB_rxtx_proc_t*, uint16_t*, uint32_t*);
......@@ -1269,16 +1269,19 @@ void rx_prach(PHY_VARS_eNB *eNB,
}
if (eNB->node_function == NGFI_RRU_IF4) {
//send prachF to RCC
/// **** send_IF4 of prachF to RCC **** ///
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 1 );
// send_IF4();
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 0 );
return;
}
// 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
// wait for prachF from RRU and continue with PRACH processing
//}
// here onwards is for eNodeB_3GPP or NGFI_RCC_IF4
preamble_offset_old = 99;
......
......@@ -139,6 +139,8 @@ static inline void* malloc16_clear( size_t size )
#include "PHY/LTE_TRANSPORT/defs.h"
#include <pthread.h>
#include "targets/ARCH/COMMON/common_lib.h"
#define NUM_DCI_MAX 32
#define NUMBER_OF_eNB_SECTORS_MAX 3
......@@ -456,6 +458,11 @@ typedef struct PHY_VARS_eNB_s {
SLIST_HEAD(ral_thresholds_gen_poll_enb_s, ral_threshold_phy_t) ral_thresholds_gen_polled[RAL_LINK_PARAM_GEN_MAX];
SLIST_HEAD(ral_thresholds_lte_poll_enb_s, ral_threshold_phy_t) ral_thresholds_lte_polled[RAL_LINK_PARAM_LTE_MAX];
#endif
/// RF and Interface devices per CC
openair0_device rfdevice;
openair0_device ifdevice;
// *** Handle spatially distributed MIMO antenna ports
} PHY_VARS_eNB;
......
......@@ -44,6 +44,8 @@
#include "SCHED/defs.h"
#include "SCHED/extern.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h"
#ifdef EMOS
#include "SCHED/phy_procedures_emos.h"
#endif
......@@ -59,6 +61,8 @@
#include "assertions.h"
#include "msc.h"
#include <time.h>
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
#endif
......@@ -73,7 +77,8 @@ void exit_fun(const char* s);
extern int exit_openair;
extern openair0_device openair0;
// Fix per CC openair rf/if device update
// extern openair0_device openair0;
unsigned char dlsch_input_buffer[2700] __attribute__ ((aligned(32)));
int eNB_sync_buffer0[640*6] __attribute__ ((aligned(32)));
......@@ -1429,24 +1434,6 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
#endif
// Clean up split point *** RRU only function to recv and do_OFDM_mod ***
if (eNB->node_function == eNodeB_3GPP) {
// Add above to IF4 split
// do_OFDM_mod
}else if (eNB->node_function == NGFI_RCC_IF4) {
//send_IF4(eNB,subframe<<1);
//send_IF4(eNB,(subframe<<1)+1);
}else if (eNB->node_function == NGFI_RRU_IF4) { // => acquisition from RCC (IF4)
// get frame/subframe information from IF4 interface
//recv_IF4(eNB,subframe<<1);
//recv_IF4(eNB,1+(subframe<<1));
//do_OFDM_mod
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX,0);
stop_meas(&eNB->phy_proc_tx);
......@@ -2488,7 +2475,6 @@ void cba_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq_p
}
void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_flag) {
int i,l;
......@@ -2498,160 +2484,198 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl
eNB_proc_t *proc = &eNB->proc;
int subframe = proc->subframe_rx;
int frame = proc->frame_rx;
int symbol_number, symbol_mask, symbol_mask_full, prach_rx, packet_type;
int prach_rx;
uint16_t packet_type;
uint32_t symbol_number;
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++;
frame&=1023;
} else {
subframe++;
}
else subframe++;
// VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_COMMON_RX,1);
start_meas(&eNB->phy_proc_rx);
#ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_RX(%d)\n",eNB->Mod_id,frame, subframe);
#endif
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
for (i=0; i<fp->nb_antennas_rx; i++)
rxp[i] = (void*)&eNB->common_vars.rxdata[0][i][subframe*fp->samples_per_tti];
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 1 );
rxs = openair0.trx_read_func(&openair0,
&proc->timestamp_rx,
rxp,
fp->samples_per_tti,
fp->nb_antennas_rx);
proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_tti*10))&1023;
proc->subframe_rx = (proc->timestamp_rx / fp->samples_per_tti)%10;
if (proc->first_rx == 0) {
AssertFatal(proc->subframe_rx == subframe, "Received Timestamp doesn't correspond to the time we think it is (proc->subframe_rx %d, subframe %d)",proc->subframe_rx,subframe);
AssertFatal(proc->frame_rx == frame, "Received Timestamp doesn't correspond to the time we think it is (proc->frame_rx %d frame %d)",proc->frame_rx,frame);
}
else
proc->first_rx = 0;
// printf("timestamp_rx %lu, frame %d(%d), subframe %d(%d)\n",proc->timestamp_rx,proc->frame_rx,frame,proc->subframe_rx,subframe);
if ((eNB->node_function == NGFI_RRU_IF4) ||
(eNB->node_function == eNodeB_3GPP)) { // acquisition from RF and front-end processing
for (i=0; i<fp->nb_antennas_rx; i++)
rxp[i] = (void*)&eNB->common_vars.rxdata[0][i][subframe*fp->samples_per_tti];
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 1 );
rxs = eNB->rfdevice.trx_read_func(&eNB->rfdevice,
&proc->timestamp_rx,
rxp,
fp->samples_per_tti,
fp->nb_antennas_rx);
proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_tti*10))&1023;
proc->subframe_rx = (proc->timestamp_rx / fp->samples_per_tti)%10;
if (proc->first_rx == 0) {
AssertFatal(proc->subframe_rx == subframe, "Received Timestamp doesn't correspond to the time we think it is (proc->subframe_rx %d, subframe %d)",proc->subframe_rx,subframe);
AssertFatal(proc->frame_rx == frame, "Received Timestamp doesn't correspond to the time we think it is (proc->frame_rx %d frame %d)",proc->frame_rx,frame);
} 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, frame );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX_ENB, subframe );
//printf("timestamp_rx %lu, frame %d(%d), subframe %d(%d)\n",proc->timestamp_rx,proc->frame_rx,frame,proc->subframe_rx,subframe);
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, frame );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX_ENB, subframe );
if (rxs != fp->samples_per_tti)
exit_fun( "problem receiving samples" );
if (rxs != fp->samples_per_tti)
exit_fun( "problem receiving samples" );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 );
// 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,subframe<<1);
remove_7_5_kHz(eNB,1+(subframe<<1));
for (l=0; l<fp->symbols_per_tti/2; l++) {
slot_fep_ul(fp,
&eNB->common_vars,
l,
subframe<<1,
0,
0
);
slot_fep_ul(fp,
&eNB->common_vars,
l,
1+(subframe<<1),
0,
0
);
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 );
// 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,subframe<<1);
remove_7_5_kHz(eNB,1+(subframe<<1));
for (l=0; l<fp->symbols_per_tti/2; l++) {
slot_fep_ul(fp,
&eNB->common_vars,
l,
subframe<<1,
0,
0
);
slot_fep_ul(fp,
&eNB->common_vars,
l,
1+(subframe<<1),
0,
0
);
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_SLOT_FEP,0);
if (eNB->node_function == NGFI_RRU_IF4) {
//send_IF4(eNB,subframe<<1);
//send_IF4(eNB,(subframe<<1)+1);
}
if (eNB->node_function == NGFI_RRU_IF4 && is_prach_subframe(fp, frame, subframe)<=0) {
/// **** 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();
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 0 );
}
else if (eNB->node_function == NGFI_RCC_IF4) { // => acquisition from RRU (IF4)
// get frame/subframe information from IF4 interface
// timed loop (200 us)
//symbol_mask = 0;
//symbol_mask_full = (1<<fp->symbols_per_tti)-1;
//if (is_prach_subframe(fp,frame,subframe)>0)
//prach_rx = 0;
//else
//prach_rx = 1;
//do {
//recv_IF4(eNB, proc, &packet_type, &symbol_number);
//if (is_prach_subframe(fp,frame,subframe)>0 && packet_type == PRACH) {
//// wake up prach_rx
//prach_rx = 1;
//}
//if (packet_type == IF4_PULFFT)
//symbol_mask = symbol_mask | (1<<symbol_number);
//} while( (symbol_mask != symbol_mask_full) || (prach_rx == 0));
//recv_IF4(eNB,subframe<<1);
//recv_IF4(eNB,1+(subframe<<1));
// Tobi aka mr monaco: ETH
}
else { // should not get here
AssertFatal(1==0, "Unknown eNB->node_function %d",eNB->node_function);
}
// check if we have to detect PRACH first
if (is_prach_subframe(fp,frame,subframe)>0) {
// wake up thread for PRACH RX
if (pthread_mutex_lock(&proc->mutex_prach) != 0) {
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB PRACH thread %d (IC %d)\n", proc->instance_cnt_prach );
exit_fun( "error locking mutex_prach" );
return;
}
int cnt_prach = ++proc->instance_cnt_prach;
// set timing for prach thread
proc->frame_prach = frame;
proc->subframe_prach = subframe;
pthread_mutex_unlock( &proc->mutex_prach );
if (cnt_prach == 0) {
// the thread was presumably waiting where it should and can now be woken up
if (pthread_cond_signal(&proc->cond_prach) != 0) {
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB PRACH thread %d\n", proc->thread_index);
exit_fun( "ERROR pthread_cond_signal" );
return;
}
} else {
LOG_W( PHY,"[eNB] Frame %d, eNB PRACH thread busy!!\n", frame);
exit_fun( "PRACH thread busy" );
return;
/// **** send_IF4 of prach to RCC **** /// done in prach thread (below)
// check if we have to detect PRACH first
if (is_prach_subframe(fp,frame,subframe)>0) {
// wake up thread for PRACH RX
if (pthread_mutex_lock(&proc->mutex_prach) != 0) {
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB PRACH thread %d (IC %d)\n", proc->instance_cnt_prach );
exit_fun( "error locking mutex_prach" );
return;
}
int cnt_prach = ++proc->instance_cnt_prach;
// set timing for prach thread
proc->frame_prach = frame;
proc->subframe_prach = subframe;
pthread_mutex_unlock( &proc->mutex_prach );
if (cnt_prach == 0) {
// the thread was presumably waiting where it should and can now be woken up
if (pthread_cond_signal(&proc->cond_prach) != 0) {
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB PRACH thread %d\n", proc->thread_index);
exit_fun( "ERROR pthread_cond_signal" );
return;
}
} else {
LOG_W( PHY,"[eNB] Frame %d, eNB PRACH thread busy!!\n", frame);
exit_fun( "PRACH thread busy" );
return;
}
}
} else if (eNB->node_function == NGFI_RCC_IF4) {
/// **** recv_IF4 of rxdataF from RRU **** ///
/// **** recv_IF4 of prachF from RRU **** ///
// get frame/subframe information from IF4 interface
// timed loop (200 us)
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 );
//recv_IF4(eNB, proc, &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) {
// wake up thread for PRACH RX
prach_rx = 1;
if (pthread_mutex_lock(&proc->mutex_prach) != 0) {
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB PRACH thread %d (IC %d)\n", proc->instance_cnt_prach );
exit_fun( "error locking mutex_prach" );
return;
}
int cnt_prach = ++proc->instance_cnt_prach;
// set timing for prach thread
proc->frame_prach = frame;
proc->subframe_prach = subframe;
pthread_mutex_unlock( &proc->mutex_prach );
if (cnt_prach == 0) {
// the thread was presumably waiting where it should and can now be woken up
if (pthread_cond_signal(&proc->cond_prach) != 0) {
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB PRACH thread %d\n", proc->thread_index);
exit_fun( "ERROR pthread_cond_signal" );
return;
}
} else {
LOG_W( PHY,"[eNB] Frame %d, eNB PRACH thread busy!!\n", frame);
exit_fun( "PRACH thread busy" );
return;
}
}
} while( (symbol_mask != symbol_mask_full) && (prach_rx == 0));
// Tobi aka mr monaco: ETH
} else { // should not get here
AssertFatal(1==0, "Unknown eNB->node_function %d",eNB->node_function);
}
}
else {