Merge remote-tracking branch 'origin/develop' into enhancement-74-SoDeRa
Conflicts: cmake_targets/CMakeLists.txt cmake_targets/build_oai targets/ARCH/COMMON/common_lib.c targets/ARCH/COMMON/common_lib.h targets/RT/USER/lte-softmodem.c
This commit is contained in:
@@ -148,7 +148,7 @@ void *rrh_proc_UE_thread(void * arg) {
|
||||
unsigned int samples_per_frame=0;
|
||||
rrh_module_t *dev=(rrh_module_t *)arg;
|
||||
|
||||
samples_per_frame= dev->eth_dev.openair0_cfg.samples_per_frame;
|
||||
samples_per_frame= dev->eth_dev.openair0_cfg->samples_per_frame;
|
||||
AssertFatal(samples_per_frame <=0, "invalide samples_per_frame !%u\n",samples_per_frame);
|
||||
|
||||
time_req.tv_sec = 0;
|
||||
@@ -260,7 +260,7 @@ void *rrh_UE_thread(void *arg) {
|
||||
void *tmp;
|
||||
unsigned int samples_per_frame=0;
|
||||
|
||||
samples_per_frame= dev->eth_dev.openair0_cfg.samples_per_frame;
|
||||
samples_per_frame= dev->eth_dev.openair0_cfg->samples_per_frame;
|
||||
time_req_1us.tv_sec = 0;
|
||||
time_req_1us.tv_nsec = 1000;
|
||||
|
||||
@@ -269,26 +269,26 @@ void *rrh_UE_thread(void *arg) {
|
||||
cmd=dev->eth_dev.trx_start_func(&dev->eth_dev);
|
||||
|
||||
/* allocate memory for TX/RX buffers */
|
||||
rx_buffer_UE = (int32_t**)malloc16(dev->eth_dev.openair0_cfg.rx_num_channels*sizeof(int32_t*));
|
||||
tx_buffer_UE = (int32_t**)malloc16(dev->eth_dev.openair0_cfg.tx_num_channels*sizeof(int32_t*));
|
||||
rx_buffer_UE = (int32_t**)malloc16(dev->eth_dev.openair0_cfg->rx_num_channels*sizeof(int32_t*));
|
||||
tx_buffer_UE = (int32_t**)malloc16(dev->eth_dev.openair0_cfg->tx_num_channels*sizeof(int32_t*));
|
||||
|
||||
for (i=0; i<dev->eth_dev.openair0_cfg.rx_num_channels; i++) {
|
||||
for (i=0; i<dev->eth_dev.openair0_cfg->rx_num_channels; i++) {
|
||||
tmp=(void *)malloc(sizeof(int32_t)*(samples_per_frame+4));
|
||||
memset(tmp,0,sizeof(int32_t)*(samples_per_frame+4));
|
||||
rx_buffer_UE[i]=(tmp+4*sizeof(int32_t));
|
||||
}
|
||||
|
||||
for (i=0; i<dev->eth_dev.openair0_cfg.tx_num_channels; i++) {
|
||||
for (i=0; i<dev->eth_dev.openair0_cfg->tx_num_channels; i++) {
|
||||
tmp=(void *)malloc(sizeof(int32_t)*(samples_per_frame+4));
|
||||
memset(tmp,0,sizeof(int32_t)*(samples_per_frame+4));
|
||||
tx_buffer_UE[i]=(tmp+4*sizeof(int32_t));
|
||||
}
|
||||
|
||||
printf("Client %s:%d is connected (DL_RB=%d) rt=%d|%d. \n" , dev->eth_dev.openair0_cfg.remote_ip,
|
||||
dev->eth_dev.openair0_cfg.remote_port,
|
||||
dev->eth_dev.openair0_cfg.num_rb_dl,
|
||||
dev->eth_dev.openair0_cfg.rx_num_channels,
|
||||
dev->eth_dev.openair0_cfg.tx_num_channels);
|
||||
printf("Client %s:%d is connected (DL_RB=%d) rt=%d|%d. \n" , dev->eth_dev.openair0_cfg->remote_addr,
|
||||
dev->eth_dev.openair0_cfg->remote_port,
|
||||
dev->eth_dev.openair0_cfg->num_rb_dl,
|
||||
dev->eth_dev.openair0_cfg->rx_num_channels,
|
||||
dev->eth_dev.openair0_cfg->tx_num_channels);
|
||||
|
||||
if (cmd==START_CMD) {
|
||||
|
||||
@@ -348,8 +348,8 @@ void *rrh_UE_rx_thread(void *arg) {
|
||||
openair0_timestamp temp, last_hw_counter=0;
|
||||
|
||||
antenna_index = 0;
|
||||
nsamps = dev->eth_dev.openair0_cfg.samples_per_packet;
|
||||
samples_per_frame = dev->eth_dev.openair0_cfg.samples_per_frame;
|
||||
nsamps = dev->eth_dev.openair0_cfg->samples_per_packet;
|
||||
samples_per_frame = dev->eth_dev.openair0_cfg->samples_per_frame;
|
||||
|
||||
while (rrh_exit == 0) {
|
||||
if (!UE_rx_started) {
|
||||
@@ -492,8 +492,8 @@ void *rrh_UE_tx_thread(void *arg) {
|
||||
unsigned int samples_per_frame=0;
|
||||
|
||||
antenna_index = 0;
|
||||
nsamps = dev->eth_dev.openair0_cfg.samples_per_packet;
|
||||
samples_per_frame = dev->eth_dev.openair0_cfg.samples_per_frame;
|
||||
nsamps = dev->eth_dev.openair0_cfg->samples_per_packet;
|
||||
samples_per_frame = dev->eth_dev.openair0_cfg->samples_per_frame;
|
||||
|
||||
|
||||
while (rrh_exit == 0) {
|
||||
|
||||
+123
-223
@@ -127,7 +127,7 @@ static void check_dev_config( rrh_module_t *mod_enb);
|
||||
* \note
|
||||
* @ingroup _oai
|
||||
*/
|
||||
static void calc_rt_period_ns( openair0_config_t openair0_cfg);
|
||||
static void calc_rt_period_ns( openair0_config_t *openair0_cfg);
|
||||
|
||||
|
||||
|
||||
@@ -140,104 +140,33 @@ void config_BBU_mod( rrh_module_t *mod_enb, uint8_t RT_flag, uint8_t NRT_flag) {
|
||||
|
||||
RT_flag_eNB=RT_flag;
|
||||
NRT_flag_eNB=NRT_flag;
|
||||
|
||||
/* handshake with client to exchange parameters */
|
||||
|
||||
/* init socket and have handshake-like msg with client to exchange parameters */
|
||||
mod_enb->eth_dev.trx_start_func(&mod_enb->eth_dev);//change port make it plus_id
|
||||
|
||||
/* if a RF iterface is added to RRH module get the configuration parameters sent from eNB */
|
||||
if (mod_enb->devs->type != NONE_IF ) {
|
||||
|
||||
memcpy((void*)&mod_enb->devs->openair0_cfg,(void *)&mod_enb->eth_dev.openair0_cfg,sizeof(openair0_config_t));
|
||||
|
||||
/* certain parameters have to be updated (calibration related)*/
|
||||
if ( mod_enb->devs->type == EXMIMO_IF ) {
|
||||
if ( mod_enb->devs->openair0_cfg.num_rb_dl == 100 ) {
|
||||
mod_enb->devs->openair0_cfg.samples_per_packet = 2048;
|
||||
mod_enb->devs->openair0_cfg.tx_forward_nsamps = 175;
|
||||
mod_enb->devs->openair0_cfg.tx_delay = 8;
|
||||
}
|
||||
else if ( mod_enb->devs->openair0_cfg.num_rb_dl == 50 ) {
|
||||
mod_enb->devs->openair0_cfg.samples_per_packet = 2048;
|
||||
mod_enb->devs->openair0_cfg.tx_forward_nsamps = 95;
|
||||
mod_enb->devs->openair0_cfg.tx_delay = 5;
|
||||
}
|
||||
else if ( mod_enb->devs->openair0_cfg.num_rb_dl == 25 ) {
|
||||
mod_enb->devs->openair0_cfg.samples_per_packet = 1024;
|
||||
mod_enb->devs->openair0_cfg.tx_forward_nsamps = 70;
|
||||
mod_enb->devs->openair0_cfg.tx_delay = 6;
|
||||
}
|
||||
else if ( mod_enb->devs->openair0_cfg.num_rb_dl == 6 ) {
|
||||
mod_enb->devs->openair0_cfg.samples_per_packet = 256;
|
||||
mod_enb->devs->openair0_cfg.tx_forward_nsamps = 40;
|
||||
mod_enb->devs->openair0_cfg.tx_delay = 8;
|
||||
}
|
||||
}
|
||||
else if ((mod_enb->devs->type == USRP_B200_IF )||(mod_enb->devs->type == USRP_X300_IF )) {
|
||||
if ( mod_enb->devs->openair0_cfg.num_rb_dl == 100 ) {
|
||||
mod_enb->devs->openair0_cfg.samples_per_packet = 2048;
|
||||
mod_enb->devs->openair0_cfg.tx_forward_nsamps = 175;
|
||||
mod_enb->devs->openair0_cfg.tx_delay = 8;
|
||||
}
|
||||
else if ( mod_enb->devs->openair0_cfg.num_rb_dl == 50 ) {
|
||||
mod_enb->devs->openair0_cfg.samples_per_packet = 2048;
|
||||
mod_enb->devs->openair0_cfg.tx_forward_nsamps = 95;
|
||||
mod_enb->devs->openair0_cfg.tx_delay = 5;
|
||||
}
|
||||
else if ( mod_enb->devs->openair0_cfg.num_rb_dl == 25 ) {
|
||||
mod_enb->devs->openair0_cfg.samples_per_packet = 1024;
|
||||
mod_enb->devs->openair0_cfg.tx_forward_nsamps = 70;
|
||||
mod_enb->devs->openair0_cfg.tx_delay = 6;
|
||||
}
|
||||
else if ( mod_enb->devs->openair0_cfg.num_rb_dl == 6 ) {
|
||||
mod_enb->devs->openair0_cfg.samples_per_packet = 256;
|
||||
mod_enb->devs->openair0_cfg.tx_forward_nsamps = 40;
|
||||
mod_enb->devs->openair0_cfg.tx_delay = 8;
|
||||
}
|
||||
}
|
||||
else if(mod_enb->devs->type == BLADERF_IF) {
|
||||
if ( mod_enb->devs->openair0_cfg.num_rb_dl == 100 ) {
|
||||
mod_enb->devs->openair0_cfg.samples_per_packet = 2048;
|
||||
mod_enb->devs->openair0_cfg.tx_forward_nsamps = 175;
|
||||
mod_enb->devs->openair0_cfg.tx_delay = 8;
|
||||
}
|
||||
else if ( mod_enb->devs->openair0_cfg.num_rb_dl == 50 ) {
|
||||
mod_enb->devs->openair0_cfg.samples_per_packet = 2048;
|
||||
mod_enb->devs->openair0_cfg.tx_forward_nsamps = 95;
|
||||
mod_enb->devs->openair0_cfg.tx_delay = 5;
|
||||
}
|
||||
else if ( mod_enb->devs->openair0_cfg.num_rb_dl == 25 ) {
|
||||
mod_enb->devs->openair0_cfg.samples_per_packet = 1024;
|
||||
mod_enb->devs->openair0_cfg.tx_forward_nsamps = 70;
|
||||
mod_enb->devs->openair0_cfg.tx_delay = 6;
|
||||
}
|
||||
else if ( mod_enb->devs->openair0_cfg.num_rb_dl == 6 ) {
|
||||
mod_enb->devs->openair0_cfg.samples_per_packet = 256;
|
||||
mod_enb->devs->openair0_cfg.tx_forward_nsamps = 40;
|
||||
mod_enb->devs->openair0_cfg.tx_delay = 8;
|
||||
}
|
||||
}
|
||||
|
||||
/* check sanity of configuration parameters and print */
|
||||
check_dev_config(mod_enb);
|
||||
|
||||
/* initialize and configure the RF device */
|
||||
if (openair0_device_init(mod_enb->devs, &mod_enb->devs->openair0_cfg)<0){
|
||||
LOG_E(RRH,"Exiting, cannot initialize RF device.\n");
|
||||
exit(-1);
|
||||
}
|
||||
else {
|
||||
LOG_I(RRH,"RF device has been successfully initialized.\n");
|
||||
}
|
||||
mod_enb->devs->openair0_cfg = mod_enb->eth_dev.openair0_cfg;
|
||||
|
||||
/* start RF device */
|
||||
if (mod_enb->devs->type == EXMIMO_IF ) {
|
||||
/* check sanity of configuration parameters and print */
|
||||
check_dev_config(mod_enb);
|
||||
|
||||
/* initialize and configure the RF device */
|
||||
if (openair0_device_load(mod_enb->devs, mod_enb->devs->openair0_cfg)<0) {
|
||||
LOG_E(RRH,"Exiting, cannot initialize RF device.\n");
|
||||
exit(-1);
|
||||
} else {
|
||||
if (mod_enb->devs->type != NONE_DEV) {
|
||||
/* start RF device */
|
||||
if (mod_enb->devs->type == EXMIMO_DEV) {
|
||||
//call start function for exmino
|
||||
} else {
|
||||
if (mod_enb->devs->trx_start_func(mod_enb->devs)!=0)
|
||||
LOG_E(RRH,"Unable to initiate RF device.\n");
|
||||
else
|
||||
LOG_I(RRH,"RF device has been initiated.\n");
|
||||
}
|
||||
|
||||
} else {
|
||||
if (mod_enb->devs->trx_start_func(mod_enb->devs)!=0)
|
||||
LOG_E(RRH,"Unable to initiate RF device.\n");
|
||||
}
|
||||
LOG_I(RRH,"RF device has been initiated.\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* create main eNB module thread
|
||||
main_rrh_eNB_thread allocates memory
|
||||
@@ -266,7 +195,7 @@ void *rrh_eNB_thread(void *arg) {
|
||||
void *tmp;
|
||||
unsigned int samples_per_frame=0;
|
||||
|
||||
samples_per_frame = dev->eth_dev.openair0_cfg.samples_per_frame;
|
||||
samples_per_frame = dev->eth_dev.openair0_cfg->samples_per_frame;
|
||||
|
||||
while (rrh_exit==0) {
|
||||
|
||||
@@ -278,42 +207,42 @@ void *rrh_eNB_thread(void *arg) {
|
||||
/* allocate memory for TX/RX buffers
|
||||
each antenna port has a TX and a RX buffer
|
||||
each TX and RX buffer is of (samples_per_frame + HEADER_SIZE) samples (size of samples is 4 bytes) */
|
||||
rx_buffer_eNB = (int32_t**)malloc16(dev->eth_dev.openair0_cfg.rx_num_channels*sizeof(int32_t*));
|
||||
tx_buffer_eNB = (int32_t**)malloc16(dev->eth_dev.openair0_cfg.tx_num_channels*sizeof(int32_t*));
|
||||
rx_buffer_eNB = (int32_t**)malloc16(dev->eth_dev.openair0_cfg->rx_num_channels*sizeof(int32_t*));
|
||||
tx_buffer_eNB = (int32_t**)malloc16(dev->eth_dev.openair0_cfg->tx_num_channels*sizeof(int32_t*));
|
||||
LOG_D(RRH,"rx_buffer_eNB address =%p tx_buffer_eNB address =%p \n",rx_buffer_eNB,tx_buffer_eNB);
|
||||
|
||||
/* rx_buffer_eNB points to the beginning of data */
|
||||
for (i=0; i<dev->eth_dev.openair0_cfg.rx_num_channels; i++) {
|
||||
for (i=0; i<dev->eth_dev.openair0_cfg->rx_num_channels; i++) {
|
||||
tmp=(void *)malloc16(sizeof(int32_t)*(samples_per_frame + 32));
|
||||
memset(tmp,0,sizeof(int32_t)*(samples_per_frame + 32));
|
||||
rx_buffer_eNB[i]=( tmp + (32*sizeof(int32_t)) );
|
||||
LOG_D(RRH,"i=%d rx_buffer_eNB[i]=%p tmp= %p\n",i,rx_buffer_eNB[i],tmp);
|
||||
}
|
||||
/* tx_buffer_eNB points to the beginning of data */
|
||||
for (i=0; i<dev->eth_dev.openair0_cfg.tx_num_channels; i++) {
|
||||
for (i=0; i<dev->eth_dev.openair0_cfg->tx_num_channels; i++) {
|
||||
tmp=(void *)malloc16(sizeof(int32_t)*(samples_per_frame + 32));
|
||||
memset(tmp,0,sizeof(int32_t)*(samples_per_frame + 32));
|
||||
tx_buffer_eNB[i]=( tmp + (32*sizeof(int32_t)) );
|
||||
LOG_D(RRH,"i= %d tx_buffer_eNB[i]=%p tmp= %p \n",i,tx_buffer_eNB[i],tmp);
|
||||
}
|
||||
/* dummy initialization for TX/RX buffers */
|
||||
for (i=0; i<dev->eth_dev.openair0_cfg.rx_num_channels; i++) {
|
||||
for (i=0; i<dev->eth_dev.openair0_cfg->rx_num_channels; i++) {
|
||||
for (j=0; j<samples_per_frame; j++) {
|
||||
rx_buffer_eNB[i][j]=32+i;
|
||||
}
|
||||
}
|
||||
/* dummy initialization for TX/RX buffers */
|
||||
for (i=0; i<dev->eth_dev.openair0_cfg.tx_num_channels; i++) {
|
||||
for (i=0; i<dev->eth_dev.openair0_cfg->tx_num_channels; i++) {
|
||||
for (j=0; j<samples_per_frame; j++) {
|
||||
tx_buffer_eNB[i][j]=12+i;
|
||||
}
|
||||
}
|
||||
/* allocate TX/RX buffers pointers used in write/read operations */
|
||||
rx_eNB = (void**)malloc16(dev->eth_dev.openair0_cfg.rx_num_channels*sizeof(int32_t*));
|
||||
tx_eNB = (void**)malloc16(dev->eth_dev.openair0_cfg.tx_num_channels*sizeof(int32_t*));
|
||||
rx_eNB = (void**)malloc16(dev->eth_dev.openair0_cfg->rx_num_channels*sizeof(int32_t*));
|
||||
tx_eNB = (void**)malloc16(dev->eth_dev.openair0_cfg->tx_num_channels*sizeof(int32_t*));
|
||||
|
||||
/* init mutexes */
|
||||
for (i=0; i<dev->eth_dev.openair0_cfg.tx_num_channels; i++) {
|
||||
for (i=0; i<dev->eth_dev.openair0_cfg->tx_num_channels; i++) {
|
||||
pthread_mutex_init(&sync_eNB_mutex[i],NULL);
|
||||
pthread_cond_init(&sync_eNB_cond[i],NULL);
|
||||
}
|
||||
@@ -353,7 +282,7 @@ void *rrh_eNB_thread(void *arg) {
|
||||
}
|
||||
|
||||
/* create timer thread; when no RF device is present a software clock is generated */
|
||||
if (dev->devs->type == NONE_IF) {
|
||||
if (dev->devs->type == NONE_DEV) {
|
||||
|
||||
int error_code_timer;
|
||||
pthread_t main_timer_proc_thread;
|
||||
@@ -405,10 +334,11 @@ void *rrh_eNB_thread(void *arg) {
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* Receive from RF and transmit to RRH */
|
||||
|
||||
void *rrh_eNB_rx_thread(void *arg) {
|
||||
|
||||
/* measuremnt related vars */
|
||||
/* measurement related vars */
|
||||
struct timespec time0,time1,time2;
|
||||
unsigned long long max_rx_time=0, min_rx_time=rt_period, total_rx_time=0, average_rx_time=rt_period, s_period=0, trial=0;
|
||||
int trace_cnt=0;
|
||||
@@ -425,10 +355,10 @@ void *rrh_eNB_rx_thread(void *arg) {
|
||||
|
||||
time_req_1us.tv_sec = 0;
|
||||
time_req_1us.tv_nsec =1000; //time_req_1us.tv_nsec = (int)rt_period/2;--->granularity issue
|
||||
spp_eth = dev->eth_dev.openair0_cfg.samples_per_packet;
|
||||
spp_rf = dev->devs->openair0_cfg.samples_per_packet;
|
||||
spp_eth = dev->eth_dev.openair0_cfg->samples_per_packet;
|
||||
spp_rf = dev->devs->openair0_cfg->samples_per_packet;
|
||||
|
||||
samples_per_frame = dev->eth_dev.openair0_cfg.samples_per_frame;
|
||||
samples_per_frame = dev->eth_dev.openair0_cfg->samples_per_frame;
|
||||
samples_per_subframe = (unsigned int)samples_per_frame/10;
|
||||
loopback = dev->loopback;
|
||||
measurements = dev->measurements;
|
||||
@@ -456,14 +386,14 @@ void *rrh_eNB_rx_thread(void *arg) {
|
||||
|
||||
while (rrh_exit == 0) {
|
||||
while (rx_pos <(1 + subframe)*samples_per_subframe) {
|
||||
LOG_D(RRH,"starting a new send:%d %d\n",sync_trx,frame);
|
||||
//LOG_D(RRH,"starting a new send:%d %d\n",sync_trx,frame);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_RX, 1 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_HW_FRAME_RX, frame);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_HW_SUBFRAME_RX, subframe );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RX_PCK, pck_rx );
|
||||
LOG_D(RRH,"pack=%d rx_pos=%d subframe=%d frame=%d\n ",pck_rx, rx_pos, subframe,frame);
|
||||
|
||||
if (dev->devs->type == NONE_IF) {
|
||||
if (dev->devs->type == NONE_DEV) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RX_HWCNT, hw_counter );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RX_LHWCNT, last_hw_counter );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_CNT, s_cnt );
|
||||
@@ -501,19 +431,19 @@ void *rrh_eNB_rx_thread(void *arg) {
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0; i<dev->eth_dev.openair0_cfg.rx_num_channels; i++) {
|
||||
for (i=0; i<dev->eth_dev.openair0_cfg->rx_num_channels; i++) {
|
||||
rx_eNB[i] = (void*)&rx_buffer_eNB[i][rx_pos];
|
||||
LOG_D(RRH," rx_eNB[i]=%p rx_buffer_eNB[i][rx_pos]=%p ,rx_pos=%d, i=%d ts=%d\n",rx_eNB[i],&rx_buffer_eNB[i][rx_pos],rx_pos,i,timestamp_rx);
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RXCNT, rx_pos );
|
||||
if (dev->devs->type != NONE_IF) {
|
||||
if (dev->devs->type != NONE_DEV) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_RF, 1 );
|
||||
/* Read operation to RF device (RX)*/
|
||||
if ( dev->devs->trx_read_func (dev->devs,
|
||||
×tamp_rx,
|
||||
rx_eNB,
|
||||
spp_rf,
|
||||
dev->devs->openair0_cfg.rx_num_channels
|
||||
dev->devs->openair0_cfg->rx_num_channels
|
||||
)<0) {
|
||||
perror("RRH eNB : USRP read");
|
||||
}
|
||||
@@ -526,14 +456,14 @@ void *rrh_eNB_rx_thread(void *arg) {
|
||||
timestamp_rx,
|
||||
rx_eNB,
|
||||
spp_eth,
|
||||
dev->eth_dev.openair0_cfg.rx_num_channels,
|
||||
dev->eth_dev.openair0_cfg->rx_num_channels,
|
||||
0))<0) {
|
||||
perror("RRH eNB : ETHERNET write");
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 );
|
||||
|
||||
/* when there is no RF timestamp is updated by number of samples */
|
||||
if (dev->devs->type == NONE_IF) {
|
||||
if (dev->devs->type == NONE_DEV) {
|
||||
timestamp_rx+=spp_eth;
|
||||
last_hw_counter=hw_counter;
|
||||
}
|
||||
@@ -559,7 +489,7 @@ void *rrh_eNB_rx_thread(void *arg) {
|
||||
}
|
||||
if (s_period++ == PRINTF_PERIOD) {
|
||||
s_period=0;
|
||||
LOG_I(RRH,"Average eNB RX time : %lu\tMax RX time : %lu\tMin RX time : %lu\n",average_rx_time,max_rx_time,min_rx_time);
|
||||
LOG_I(RRH,"Average eNB RX time : %lu ns\tMax RX time : %lu ns\tMin RXX time : %lu ns\n",average_rx_time,max_rx_time,min_rx_time);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -577,7 +507,7 @@ void *rrh_eNB_rx_thread(void *arg) {
|
||||
next_rx_pos=(rx_pos+spp_eth);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_RX, 0 );
|
||||
/**/
|
||||
/*
|
||||
if (frame>50) {
|
||||
pthread_mutex_lock(&sync_trx_mutex);
|
||||
while (sync_trx) {
|
||||
@@ -587,7 +517,7 @@ void *rrh_eNB_rx_thread(void *arg) {
|
||||
LOG_D(RRH,"out of while send:%d %d\n",sync_trx,frame);
|
||||
pthread_cond_signal(&sync_trx_cond);
|
||||
pthread_mutex_unlock(&sync_trx_mutex);
|
||||
}
|
||||
}*/
|
||||
} // while
|
||||
|
||||
subframe++;
|
||||
@@ -609,6 +539,7 @@ void *rrh_eNB_rx_thread(void *arg) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Receive from eNB and transmit to RF */
|
||||
|
||||
void *rrh_eNB_tx_thread(void *arg) {
|
||||
|
||||
@@ -647,60 +578,34 @@ void *rrh_eNB_tx_thread(void *arg) {
|
||||
|
||||
time_req_1us.tv_sec = 1;
|
||||
time_req_1us.tv_nsec = 0;
|
||||
spp_eth = dev->eth_dev.openair0_cfg.samples_per_packet;
|
||||
spp_rf = dev->devs->openair0_cfg.samples_per_packet;
|
||||
samples_per_frame = dev->eth_dev.openair0_cfg.samples_per_frame;
|
||||
spp_eth = dev->eth_dev.openair0_cfg->samples_per_packet;
|
||||
spp_rf = dev->devs->openair0_cfg->samples_per_packet;
|
||||
samples_per_frame = dev->eth_dev.openair0_cfg->samples_per_frame;
|
||||
samples_per_subframe = (unsigned int)samples_per_frame/10;
|
||||
tx_pos=0;
|
||||
//tx_pos_rf=spp_rf*dev->devs->openair0_cfg.tx_delay;
|
||||
|
||||
|
||||
loopback = dev->loopback;
|
||||
measurements = dev->measurements;
|
||||
|
||||
while (rrh_exit == 0) {
|
||||
while (tx_pos < (1 + subframe)*samples_per_subframe) {
|
||||
|
||||
LOG_D(RRH,"bef lock read:%d %d\n",sync_trx,frame);
|
||||
pthread_mutex_lock(&sync_trx_mutex);
|
||||
//LOG_D(RRH,"bef lock read:%d %d\n",sync_trx,frame);
|
||||
//pthread_mutex_lock(&sync_trx_mutex);
|
||||
|
||||
while (!sync_trx) {
|
||||
LOG_D(RRH,"in sync read:%d %d\n",sync_trx,frame);
|
||||
pthread_cond_wait(&sync_trx_cond,&sync_trx_mutex);
|
||||
}
|
||||
LOG_D(RRH,"out of while read:%d %d\n",sync_trx,frame);
|
||||
//while (!sync_trx) {
|
||||
//LOG_D(RRH,"in sync read:%d %d\n",sync_trx,frame);
|
||||
//pthread_cond_wait(&sync_trx_cond,&sync_trx_mutex);
|
||||
//}
|
||||
//LOG_D(RRH,"out of while read:%d %d\n",sync_trx,frame);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_TX, 1 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_HW_FRAME, frame);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_HW_SUBFRAME, subframe );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TX_PCK, pck_tx );
|
||||
|
||||
/*
|
||||
if (dev->devs->type == NONE_IF) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TX_HWCNT, hw_counter );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TX_LHWCNT, last_hw_counter );
|
||||
|
||||
if (!eNB_tx_started) {
|
||||
eNB_tx_started=1; // set this flag to 1 to indicate that eNB started
|
||||
if (RT_flag_eNB==1) {
|
||||
last_hw_counter=hw_counter;
|
||||
}
|
||||
} else {
|
||||
if (RT_flag_eNB==1) {
|
||||
if (hw_counter > last_hw_counter+1) {
|
||||
printf("LT");
|
||||
} else {
|
||||
while ((hw_counter < last_hw_counter+1)) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_TX_SLEEP, 1 );
|
||||
nanosleep(&time_req_1us,&time_rem_1us);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_TX_SLEEP, 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} */
|
||||
|
||||
|
||||
if (measurements == 1 ) clock_gettime(CLOCK_MONOTONIC,&time1);
|
||||
for (i=0; i<dev->eth_dev.openair0_cfg.tx_num_channels; i++) tx_eNB[i] = (void*)&tx_buffer_eNB[i][tx_pos]; //RF!!!!!
|
||||
for (i=0; i<dev->eth_dev.openair0_cfg->tx_num_channels; i++) tx_eNB[i] = (void*)&tx_buffer_eNB[i][tx_pos];
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TXCNT, tx_pos );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 1 );
|
||||
@@ -710,12 +615,12 @@ void *rrh_eNB_tx_thread(void *arg) {
|
||||
×tamp_tx,
|
||||
tx_eNB,
|
||||
spp_eth,
|
||||
dev->eth_dev.openair0_cfg.tx_num_channels))<0) {
|
||||
dev->eth_dev.openair0_cfg->tx_num_channels))<0) {
|
||||
perror("RRH eNB : ETHERNET read");
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 );
|
||||
|
||||
if (dev->devs->type != NONE_IF) {
|
||||
if (dev->devs->type != NONE_DEV) {
|
||||
LOG_D(RRH," tx_buffer_eNB[i][tx_pos]=%x t_buffer_eNB[i][tx_pos+1]=%x t_buffer_eNB[i][tx_pos+2]=%x \n",tx_buffer_eNB[0][tx_pos],tx_buffer_eNB[0][tx_pos+1],tx_buffer_eNB[0][tx_pos+2]);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_RF, 1 );
|
||||
/* Write operation to RF device (TX)*/
|
||||
@@ -723,8 +628,8 @@ void *rrh_eNB_tx_thread(void *arg) {
|
||||
timestamp_tx,
|
||||
tx_eNB,
|
||||
spp_rf,
|
||||
dev->devs->openair0_cfg.tx_num_channels,
|
||||
0)<0){
|
||||
dev->devs->openair0_cfg->tx_num_channels,
|
||||
1)<0){
|
||||
perror("RRH eNB : USRP write");
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_RF, 0 );
|
||||
@@ -733,7 +638,7 @@ void *rrh_eNB_tx_thread(void *arg) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TX_TS, timestamp_tx&0xffffffff );
|
||||
|
||||
|
||||
if (dev->devs->type == NONE_IF) last_hw_counter=hw_counter;
|
||||
if (dev->devs->type == NONE_DEV) last_hw_counter=hw_counter;
|
||||
|
||||
|
||||
if (loopback ==1 ) {
|
||||
@@ -754,10 +659,10 @@ void *rrh_eNB_tx_thread(void *arg) {
|
||||
tx_pos += spp_eth;
|
||||
pck_tx++;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_TX, 0 );
|
||||
sync_trx=0;
|
||||
pthread_cond_signal(&sync_trx_cond);
|
||||
pthread_mutex_unlock(&sync_trx_mutex);
|
||||
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_TX, 0 );
|
||||
//sync_trx=0;
|
||||
//pthread_cond_signal(&sync_trx_cond);
|
||||
//pthread_mutex_unlock(&sync_trx_mutex);
|
||||
}
|
||||
|
||||
/* wrap around tx buffer index */
|
||||
@@ -775,72 +680,67 @@ void *rrh_eNB_tx_thread(void *arg) {
|
||||
}
|
||||
|
||||
|
||||
static void calc_rt_period_ns( openair0_config_t openair0_cfg) {
|
||||
static void calc_rt_period_ns( openair0_config_t *openair0_cfg) {
|
||||
|
||||
rt_period= (double)(openair0_cfg.samples_per_packet/(openair0_cfg.samples_per_frame/10.0)*1000000);
|
||||
rt_period= (double)(openair0_cfg->samples_per_packet/(openair0_cfg->samples_per_frame/10.0)*1000000);
|
||||
AssertFatal(rt_period > 0, "Invalid rt period !%u\n", rt_period);
|
||||
LOG_I(RRH,"[eNB] Real time period is set to %u ns\n", rt_period);
|
||||
}
|
||||
|
||||
|
||||
static void check_dev_config( rrh_module_t *mod_enb) {
|
||||
|
||||
|
||||
AssertFatal( (mod_enb->devs->openair0_cfg.num_rb_dl==100 || mod_enb->devs->openair0_cfg.num_rb_dl==50 || mod_enb->devs->openair0_cfg.num_rb_dl==25 || mod_enb->devs->openair0_cfg.num_rb_dl==6) , "Invalid number of resource blocks! %d\n", mod_enb->devs->openair0_cfg.num_rb_dl);
|
||||
AssertFatal( mod_enb->devs->openair0_cfg.samples_per_frame > 0 , "Invalid number of samples per frame! %d\n",mod_enb->devs->openair0_cfg.samples_per_frame);
|
||||
AssertFatal( mod_enb->devs->openair0_cfg.sample_rate > 0.0, "Invalid sample rate! %f\n", mod_enb->devs->openair0_cfg.sample_rate);
|
||||
AssertFatal( mod_enb->devs->openair0_cfg.samples_per_packet > 0 , "Invalid number of samples per packet! %d\n",mod_enb->devs->openair0_cfg.samples_per_packet);
|
||||
AssertFatal( mod_enb->devs->openair0_cfg.rx_num_channels > 0 , "Invalid number of RX antennas! %d\n", mod_enb->devs->openair0_cfg.rx_num_channels);
|
||||
AssertFatal( mod_enb->devs->openair0_cfg.tx_num_channels > 0 , "Invalid number of TX antennas! %d\n", mod_enb->devs->openair0_cfg.tx_num_channels);
|
||||
AssertFatal( mod_enb->devs->openair0_cfg.rx_freq[0] > 0.0 ,"Invalid RX frequency! %f\n", mod_enb->devs->openair0_cfg.rx_freq[0]);
|
||||
AssertFatal( mod_enb->devs->openair0_cfg.tx_freq[0] > 0.0 ,"Invalid TX frequency! %f\n", mod_enb->devs->openair0_cfg.tx_freq[0]);
|
||||
AssertFatal( mod_enb->devs->openair0_cfg.rx_gain[0] > 0.0 ,"Invalid RX gain! %f\n", mod_enb->devs->openair0_cfg.rx_gain[0]);
|
||||
AssertFatal( mod_enb->devs->openair0_cfg.tx_gain[0] > 0.0 ,"Invalid TX gain! %f\n", mod_enb->devs->openair0_cfg.tx_gain[0]);
|
||||
AssertFatal( mod_enb->devs->openair0_cfg.rx_bw > 0.0 ,"Invalid RX bw! %f\n", mod_enb->devs->openair0_cfg.rx_bw);
|
||||
AssertFatal( mod_enb->devs->openair0_cfg.tx_bw > 0.0 ,"Invalid RX bw! %f\n", mod_enb->devs->openair0_cfg.tx_bw);
|
||||
AssertFatal( mod_enb->devs->openair0_cfg.autocal[0] > 0 , "Invalid auto calibration choice! %d\n", mod_enb->devs->openair0_cfg.autocal[0]);
|
||||
|
||||
AssertFatal( (mod_enb->devs->openair0_cfg->num_rb_dl==100 || mod_enb->devs->openair0_cfg->num_rb_dl==50 || mod_enb->devs->openair0_cfg->num_rb_dl==25 || mod_enb->devs->openair0_cfg->num_rb_dl==6) , "Invalid number of resource blocks! %d\n", mod_enb->devs->openair0_cfg->num_rb_dl);
|
||||
AssertFatal( mod_enb->devs->openair0_cfg->samples_per_frame > 0 , "Invalid number of samples per frame! %d\n",mod_enb->devs->openair0_cfg->samples_per_frame);
|
||||
AssertFatal( mod_enb->devs->openair0_cfg->sample_rate > 0.0, "Invalid sample rate! %f\n", mod_enb->devs->openair0_cfg->sample_rate);
|
||||
AssertFatal( mod_enb->devs->openair0_cfg->samples_per_packet > 0 , "Invalid number of samples per packet! %d\n",mod_enb->devs->openair0_cfg->samples_per_packet);
|
||||
AssertFatal( mod_enb->devs->openair0_cfg->rx_num_channels > 0 , "Invalid number of RX antennas! %d\n", mod_enb->devs->openair0_cfg->rx_num_channels);
|
||||
AssertFatal( mod_enb->devs->openair0_cfg->tx_num_channels > 0 , "Invalid number of TX antennas! %d\n", mod_enb->devs->openair0_cfg->tx_num_channels);
|
||||
AssertFatal( mod_enb->devs->openair0_cfg->rx_freq[0] > 0.0 ,"Invalid RX frequency! %f\n", mod_enb->devs->openair0_cfg->rx_freq[0]);
|
||||
AssertFatal( mod_enb->devs->openair0_cfg->tx_freq[0] > 0.0 ,"Invalid TX frequency! %f\n", mod_enb->devs->openair0_cfg->tx_freq[0]);
|
||||
AssertFatal( mod_enb->devs->openair0_cfg->rx_gain[0] > 0.0 ,"Invalid RX gain! %f\n", mod_enb->devs->openair0_cfg->rx_gain[0]);
|
||||
AssertFatal( mod_enb->devs->openair0_cfg->tx_gain[0] > 0.0 ,"Invalid TX gain! %f\n", mod_enb->devs->openair0_cfg->tx_gain[0]);
|
||||
AssertFatal( mod_enb->devs->openair0_cfg->rx_bw > 0.0 ,"Invalid RX bw! %f\n", mod_enb->devs->openair0_cfg->rx_bw);
|
||||
AssertFatal( mod_enb->devs->openair0_cfg->tx_bw > 0.0 ,"Invalid RX bw! %f\n", mod_enb->devs->openair0_cfg->tx_bw);
|
||||
AssertFatal( mod_enb->devs->openair0_cfg->autocal[0] > 0 , "Invalid auto calibration choice! %d\n", mod_enb->devs->openair0_cfg->autocal[0]);
|
||||
|
||||
printf("\n---------------------RF device configuration parameters---------------------\n");
|
||||
|
||||
printf("\tMod_id=%d\n \tlog level=%d\n \tDL_RB=%d\n \tsamples_per_frame=%d\n \tsample_rate=%f\n \tsamples_per_packet=%d\n \ttx_delay=%d\n \ttx_forward_nsamps=%d\n \trx_num_channels=%d\n \ttx_num_channels=%d\n \trx_freq_0=%f\n \ttx_freq_0=%f\n \trx_freq_1=%f\n \ttx_freq_1=%f\n \trx_freq_2=%f\n \ttx_freq_2=%f\n \trx_freq_3=%f\n \ttx_freq_3=%f\n \trxg_mode=%d\n \trx_gain_0=%f\n \ttx_gain_0=%f\n \trx_gain_1=%f\n \ttx_gain_1=%f\n \trx_gain_2=%f\n \ttx_gain_2=%f\n \trx_gain_3=%f\n \ttx_gain_3=%f\n \trx_gain_offset_2=%f\n \ttx_gain_offset_3=%f\n \trx_bw=%f\n \ttx_bw=%f\n \tautocal=%d\n \trem_addr %s:%d\n \tmy_addr %s:%d\n",
|
||||
mod_enb->devs->openair0_cfg.Mod_id,
|
||||
mod_enb->devs->openair0_cfg.log_level,
|
||||
mod_enb->devs->openair0_cfg.num_rb_dl,
|
||||
mod_enb->devs->openair0_cfg.samples_per_frame,
|
||||
mod_enb->devs->openair0_cfg.sample_rate,
|
||||
mod_enb->devs->openair0_cfg.samples_per_packet,
|
||||
mod_enb->devs->openair0_cfg.tx_delay,
|
||||
mod_enb->devs->openair0_cfg.tx_forward_nsamps,
|
||||
mod_enb->devs->openair0_cfg.rx_num_channels,
|
||||
mod_enb->devs->openair0_cfg.tx_num_channels,
|
||||
mod_enb->devs->openair0_cfg.rx_freq[0],
|
||||
mod_enb->devs->openair0_cfg.tx_freq[0],
|
||||
mod_enb->devs->openair0_cfg.rx_freq[1],
|
||||
mod_enb->devs->openair0_cfg.tx_freq[1],
|
||||
mod_enb->devs->openair0_cfg.rx_freq[2],
|
||||
mod_enb->devs->openair0_cfg.tx_freq[2],
|
||||
mod_enb->devs->openair0_cfg.rx_freq[3],
|
||||
mod_enb->devs->openair0_cfg.tx_freq[3],
|
||||
mod_enb->devs->openair0_cfg.rxg_mode[0],
|
||||
mod_enb->devs->openair0_cfg.rx_gain[0],
|
||||
mod_enb->devs->openair0_cfg.tx_gain[0],
|
||||
mod_enb->devs->openair0_cfg.rx_gain[1],
|
||||
mod_enb->devs->openair0_cfg.tx_gain[1],
|
||||
mod_enb->devs->openair0_cfg.rx_gain[2],
|
||||
mod_enb->devs->openair0_cfg.tx_gain[2],
|
||||
mod_enb->devs->openair0_cfg.rx_gain[3],
|
||||
mod_enb->devs->openair0_cfg.tx_gain[3],
|
||||
//mod_enb->devs->openair0_cfg.rx_gain_offset[0],
|
||||
//mod_enb->devs->openair0_cfg.rx_gain_offset[1],
|
||||
mod_enb->devs->openair0_cfg.rx_gain_offset[2],
|
||||
mod_enb->devs->openair0_cfg.rx_gain_offset[3],
|
||||
mod_enb->devs->openair0_cfg.rx_bw,
|
||||
mod_enb->devs->openair0_cfg.tx_bw,
|
||||
mod_enb->devs->openair0_cfg.autocal[0],
|
||||
mod_enb->devs->openair0_cfg.remote_ip,
|
||||
mod_enb->devs->openair0_cfg.remote_port,
|
||||
mod_enb->devs->openair0_cfg.my_ip,
|
||||
mod_enb->devs->openair0_cfg.my_port
|
||||
printf("\tMod_id=%d\n \tlog level=%d\n \tDL_RB=%d\n \tsamples_per_frame=%d\n \tsample_rate=%f\n \tsamples_per_packet=%d\n \ttx_scheduling_advance=%d\n \ttx_sample_advance=%d\n \trx_num_channels=%d\n \ttx_num_channels=%d\n \trx_freq_0=%f\n \ttx_freq_0=%f\n \trx_freq_1=%f\n \ttx_freq_1=%f\n \trx_freq_2=%f\n \ttx_freq_2=%f\n \trx_freq_3=%f\n \ttx_freq_3=%f\n \trxg_mode=%d\n \trx_gain_0=%f\n \ttx_gain_0=%f\n \trx_gain_1=%f\n \ttx_gain_1=%f\n \trx_gain_2=%f\n \ttx_gain_2=%f\n \trx_gain_3=%f\n \ttx_gain_3=%f\n \trx_gain_offset_2=%f\n \ttx_gain_offset_3=%f\n \trx_bw=%f\n \ttx_bw=%f\n \tautocal=%d\n",
|
||||
mod_enb->devs->openair0_cfg->Mod_id,
|
||||
mod_enb->devs->openair0_cfg->log_level,
|
||||
mod_enb->devs->openair0_cfg->num_rb_dl,
|
||||
mod_enb->devs->openair0_cfg->samples_per_frame,
|
||||
mod_enb->devs->openair0_cfg->sample_rate,
|
||||
mod_enb->devs->openair0_cfg->samples_per_packet,
|
||||
mod_enb->devs->openair0_cfg->tx_scheduling_advance,
|
||||
mod_enb->devs->openair0_cfg->tx_sample_advance,
|
||||
mod_enb->devs->openair0_cfg->rx_num_channels,
|
||||
mod_enb->devs->openair0_cfg->tx_num_channels,
|
||||
mod_enb->devs->openair0_cfg->rx_freq[0],
|
||||
mod_enb->devs->openair0_cfg->tx_freq[0],
|
||||
mod_enb->devs->openair0_cfg->rx_freq[1],
|
||||
mod_enb->devs->openair0_cfg->tx_freq[1],
|
||||
mod_enb->devs->openair0_cfg->rx_freq[2],
|
||||
mod_enb->devs->openair0_cfg->tx_freq[2],
|
||||
mod_enb->devs->openair0_cfg->rx_freq[3],
|
||||
mod_enb->devs->openair0_cfg->tx_freq[3],
|
||||
mod_enb->devs->openair0_cfg->rxg_mode[0],
|
||||
mod_enb->devs->openair0_cfg->tx_gain[0],
|
||||
mod_enb->devs->openair0_cfg->tx_gain[0],
|
||||
mod_enb->devs->openair0_cfg->rx_gain[1],
|
||||
mod_enb->devs->openair0_cfg->tx_gain[1],
|
||||
mod_enb->devs->openair0_cfg->rx_gain[2],
|
||||
mod_enb->devs->openair0_cfg->tx_gain[2],
|
||||
mod_enb->devs->openair0_cfg->rx_gain[3],
|
||||
mod_enb->devs->openair0_cfg->tx_gain[3],
|
||||
//mod_enb->devs->openair0_cfg->rx_gain_offset[0],
|
||||
//mod_enb->devs->openair0_cfg->rx_gain_offset[1],
|
||||
mod_enb->devs->openair0_cfg->rx_gain_offset[2],
|
||||
mod_enb->devs->openair0_cfg->rx_gain_offset[3],
|
||||
mod_enb->devs->openair0_cfg->rx_bw,
|
||||
mod_enb->devs->openair0_cfg->tx_bw,
|
||||
mod_enb->devs->openair0_cfg->autocal[0]
|
||||
);
|
||||
|
||||
printf("----------------------------------------------------------------------------\n");
|
||||
|
||||
+140
-78
@@ -332,7 +332,6 @@ void reset_opp_meas(void);
|
||||
void print_opp_meas(void);
|
||||
int transmission_mode=1;
|
||||
|
||||
|
||||
int16_t glog_level = LOG_INFO;
|
||||
int16_t glog_verbosity = LOG_MED;
|
||||
int16_t hw_log_level = LOG_INFO;
|
||||
@@ -363,16 +362,60 @@ int16_t osa_log_verbosity = LOG_MED;
|
||||
|
||||
|
||||
#ifdef ETHERNET
|
||||
char rrh_eNB_ip[20] = "127.0.0.1";
|
||||
int rrh_eNB_port = 50000;
|
||||
char *rrh_UE_ip = "127.0.0.1";
|
||||
int rrh_UE_port = 51000;
|
||||
#endif
|
||||
|
||||
/* flag set by eNB conf file to specify if the radio head is local or remote (default option is local) */
|
||||
uint8_t local_remote_radio = BBU_LOCAL_RADIO_HEAD;
|
||||
/* struct for ethernet specific parameters given in eNB conf file */
|
||||
eth_params_t *eth_params;
|
||||
|
||||
char uecap_xer[1024],uecap_xer_in=0;
|
||||
extern void *UE_thread(void *arg);
|
||||
extern void init_UE_threads(void);
|
||||
|
||||
/*---------------------BMC: timespec helpers -----------------------------*/
|
||||
|
||||
struct timespec min_diff_time = { .tv_sec = 0, .tv_nsec = 0 };
|
||||
struct timespec max_diff_time = { .tv_sec = 0, .tv_nsec = 0 };
|
||||
|
||||
struct timespec clock_difftime(struct timespec start, struct timespec end)
|
||||
{
|
||||
struct timespec temp;
|
||||
if ((end.tv_nsec-start.tv_nsec)<0) {
|
||||
temp.tv_sec = end.tv_sec-start.tv_sec-1;
|
||||
temp.tv_nsec = 1000000000+end.tv_nsec-start.tv_nsec;
|
||||
} else {
|
||||
temp.tv_sec = end.tv_sec-start.tv_sec;
|
||||
temp.tv_nsec = end.tv_nsec-start.tv_nsec;
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
|
||||
void print_difftimes()
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf("difftimes min = %lu ns ; max = %lu ns\n", min_diff_time.tv_nsec, max_diff_time.tv_nsec);
|
||||
#else
|
||||
LOG_I(HW,"difftimes min = %lu ns ; max = %lu ns\n", min_diff_time.tv_nsec, max_diff_time.tv_nsec);
|
||||
#endif
|
||||
}
|
||||
|
||||
void update_difftimes(struct timespec start, struct timespec end)
|
||||
{
|
||||
struct timespec diff_time = { .tv_sec = 0, .tv_nsec = 0 };
|
||||
int changed = 0;
|
||||
diff_time = clock_difftime(start, end);
|
||||
if ((min_diff_time.tv_nsec == 0) || (diff_time.tv_nsec < min_diff_time.tv_nsec)) { min_diff_time.tv_nsec = diff_time.tv_nsec; changed = 1; }
|
||||
if ((max_diff_time.tv_nsec == 0) || (diff_time.tv_nsec > max_diff_time.tv_nsec)) { max_diff_time.tv_nsec = diff_time.tv_nsec; changed = 1; }
|
||||
#if 1
|
||||
if (changed) print_difftimes();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
unsigned int build_rflocal(int txi, int txq, int rxi, int rxq)
|
||||
{
|
||||
return (txi + (txq<<6) + (rxi<<12) + (rxq<<18));
|
||||
@@ -433,7 +476,6 @@ void help (void) {
|
||||
printf(" -h provides this help message!\n");
|
||||
printf(" -K Generate ITTI analyzser logs (similar to wireshark logs but with more details)\n");
|
||||
printf(" -m Set the maximum downlink MCS\n");
|
||||
printf(" -M IP address of RRH\n");
|
||||
printf(" -O eNB configuration file (located in targets/PROJECTS/GENERIC-LTE-EPC/CONF\n");
|
||||
printf(" -q Enable processing timing measurement of lte softmodem on per subframe basis \n");
|
||||
printf(" -r Set the PRB, valid values: 6, 25, 50, 100 \n");
|
||||
@@ -958,27 +1000,9 @@ void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB)
|
||||
if (tx_offset>=(LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*phy_vars_eNB->lte_frame_parms.samples_per_tti))
|
||||
tx_offset -= LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*phy_vars_eNB->lte_frame_parms.samples_per_tti;
|
||||
|
||||
((short*)&phy_vars_eNB->lte_eNB_common_vars.txdata[0][aa][tx_offset])[0]=
|
||||
#ifdef EXMIMO
|
||||
((short*)dummy_tx_b)[2*i]<<4;
|
||||
#elif OAI_BLADERF
|
||||
((short*)dummy_tx_b)[2*i];
|
||||
#elif OAI_LMSSDR
|
||||
//phy_vars_eNB->lte_eNB_common_vars.txdata[0][aa][tx_offset]=dummy_tx_b[i];
|
||||
((short*)dummy_tx_b)[2*i];
|
||||
#else
|
||||
((short*)dummy_tx_b)[2*i]<<4;
|
||||
#endif
|
||||
((short*)&phy_vars_eNB->lte_eNB_common_vars.txdata[0][aa][tx_offset])[1]=
|
||||
#ifdef EXMIMO
|
||||
((short*)dummy_tx_b)[2*i+1]<<4;
|
||||
#elif OAI_BLADERF
|
||||
((short*)dummy_tx_b)[2*i+1];
|
||||
#elif OAI_LMSSDR
|
||||
((short*)dummy_tx_b)[2*i+1];
|
||||
#else
|
||||
((short*)dummy_tx_b)[2*i+1]<<4;
|
||||
#endif
|
||||
((short*)&phy_vars_eNB->lte_eNB_common_vars.txdata[0][aa][tx_offset])[0] = ((short*)dummy_tx_b)[2*i]<<openair0_cfg[0].iq_txshift;
|
||||
|
||||
((short*)&phy_vars_eNB->lte_eNB_common_vars.txdata[0][aa][tx_offset])[1] = ((short*)dummy_tx_b)[2*i+1]<<openair0_cfg[0].iq_txshift;
|
||||
}
|
||||
// if S-subframe switch to RX in second subframe
|
||||
if (subframe_select(&phy_vars_eNB->lte_frame_parms,subframe) == SF_S) {
|
||||
@@ -1835,7 +1859,9 @@ static void* eNB_thread( void* arg )
|
||||
PHY_vars_eNB_g[0][0]->lte_frame_parms.nb_antennas_rx);
|
||||
|
||||
stop_meas( &softmodem_stats_hw );
|
||||
clock_gettime( CLOCK_MONOTONIC, &trx_time1 );
|
||||
if (frame > 50) {
|
||||
clock_gettime( CLOCK_MONOTONIC, &trx_time1 );
|
||||
}
|
||||
|
||||
if (frame > 20){
|
||||
if (rxs != spp)
|
||||
@@ -1844,8 +1870,6 @@ static void* eNB_thread( void* arg )
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 );
|
||||
|
||||
// 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
|
||||
@@ -1865,17 +1889,28 @@ static void* eNB_thread( void* arg )
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (timestamp+(openair0_cfg[card].tx_scheduling_advance)-openair0_cfg[card].tx_sample_advance)&0xffffffff );
|
||||
|
||||
stop_meas( &softmodem_stats_mt );
|
||||
clock_gettime( CLOCK_MONOTONIC, &trx_time2 );
|
||||
if (frame > 50) {
|
||||
clock_gettime( CLOCK_MONOTONIC, &trx_time2 );
|
||||
//update_difftimes(trx_time1, trx_time2);
|
||||
}
|
||||
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE,0);
|
||||
#else
|
||||
// USRP_DEBUG is active
|
||||
rt_sleep_ns(1000000);
|
||||
#endif
|
||||
|
||||
if ((frame>50) &&
|
||||
(tx_launched == 0) &&
|
||||
(rx_pos >= (((2*hw_subframe)+1)*PHY_vars_eNB_g[0][0]->lte_frame_parms.samples_per_tti>>1))) {
|
||||
/* FT configurable tx lauch delay (in slots): txlaunch_wait, txlaunch_wait_slotcount is device specific and
|
||||
set in the corresponding library (with txlaunch_wait=1 and txlaunch_wait_slotcount=1 the check is as it previously was) */
|
||||
/* old check:
|
||||
if ((frame>50) &&
|
||||
(tx_launched == 0) &&
|
||||
(rx_pos >= (((2*hw_subframe)+1)*PHY_vars_eNB_g[0][0]->lte_frame_parms.samples_per_tti>>1))) {*/
|
||||
if ( (frame>50) && (tx_launched == 0) &&
|
||||
((openair0_cfg[card].txlaunch_wait == 0) ||
|
||||
((openair0_cfg[card].txlaunch_wait == 1) &&
|
||||
(rx_pos >= (((2*hw_subframe)+openair0_cfg[card].txlaunch_wait_slotcount)*PHY_vars_eNB_g[0][0]->lte_frame_parms.samples_per_tti>>1))))) {
|
||||
|
||||
tx_launched = 1;
|
||||
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
@@ -2037,6 +2072,9 @@ eNB_thread_cleanup:
|
||||
#endif
|
||||
|
||||
eNB_thread_status = 0;
|
||||
|
||||
// print_difftimes();
|
||||
|
||||
return &eNB_thread_status;
|
||||
}
|
||||
|
||||
@@ -2175,14 +2213,7 @@ static void get_options (int argc, char **argv)
|
||||
|
||||
case LONG_OPTION_DUMP_FRAME:
|
||||
mode = rx_dump_frame;
|
||||
break;
|
||||
|
||||
case 'M':
|
||||
#ifdef ETHERNET
|
||||
strcpy(rrh_eNB_ip,optarg);
|
||||
#endif
|
||||
break;
|
||||
|
||||
break;
|
||||
case 'A':
|
||||
timing_advance = atoi (optarg);
|
||||
break;
|
||||
@@ -2425,6 +2456,34 @@ static void get_options (int argc, char **argv)
|
||||
"lte-softmodem compiled with MAX_NUM_CCs=%d, but only %d CCs configured for eNB %d!",
|
||||
MAX_NUM_CCs, enb_properties->properties[i]->nb_cc, i);
|
||||
|
||||
for (j=0; j<enb_properties->properties[i]->nb_rrh_gw; j++) {
|
||||
|
||||
if (enb_properties->properties[i]->rrh_gw_config[j].active == 1 ) {
|
||||
local_remote_radio = BBU_REMOTE_RADIO_HEAD;
|
||||
eth_params = (eth_params_t*)malloc(sizeof(eth_params_t));
|
||||
memset(eth_params, 0, sizeof(eth_params_t));
|
||||
|
||||
printf( "\n\tRRH GW %d config for eNB %u:\n\n", j, i);
|
||||
printf( "\tinterface name : \t%s:\n",enb_properties->properties[i]->rrh_gw_if_name);
|
||||
printf( "\tlocal address : \t%s:\n",enb_properties->properties[i]->rrh_gw_config[j].local_address);
|
||||
printf( "\tlocal port : \t%d:\n",enb_properties->properties[i]->rrh_gw_config[j].local_port);
|
||||
printf( "\tremote address : \t%s:\n",enb_properties->properties[i]->rrh_gw_config[j].remote_address);
|
||||
printf( "\tremote port : \t%d:\n",enb_properties->properties[i]->rrh_gw_config[j].remote_port);
|
||||
printf( "\ttransport : \t%s Ethernet:\n\n",(enb_properties->properties[i]->rrh_gw_config[j].raw == 1)? "RAW" : "UDP");
|
||||
|
||||
eth_params->local_if_name = enb_properties->properties[i]->rrh_gw_if_name;
|
||||
eth_params->my_addr = enb_properties->properties[i]->rrh_gw_config[j].local_address;
|
||||
eth_params->my_port = enb_properties->properties[i]->rrh_gw_config[j].local_port;
|
||||
eth_params->remote_addr = enb_properties->properties[i]->rrh_gw_config[j].remote_address;
|
||||
eth_params->remote_port = enb_properties->properties[i]->rrh_gw_config[j].remote_port;
|
||||
eth_params->transp_preference = enb_properties->properties[i]->rrh_gw_config[j].raw;
|
||||
|
||||
} else {
|
||||
local_remote_radio = BBU_LOCAL_RADIO_HEAD;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
frame_parms[CC_id]->frame_type = enb_properties->properties[i]->frame_type[CC_id];
|
||||
frame_parms[CC_id]->tdd_config = enb_properties->properties[i]->tdd_config[CC_id];
|
||||
@@ -2967,20 +3026,13 @@ int main( int argc, char **argv )
|
||||
else //FDD
|
||||
openair0_cfg[card].duplex_mode = duplex_mode_FDD;
|
||||
|
||||
#ifdef ETHERNET
|
||||
|
||||
//calib needed
|
||||
openair0_cfg[card].tx_scheduling_advance = 0;
|
||||
openair0_cfg[card].tx_sample_advance = 0;
|
||||
|
||||
if (frame_parms[0]->N_RB_DL == 6)
|
||||
openair0_cfg[card].samples_per_packet = 256;
|
||||
else
|
||||
openair0_cfg[card].samples_per_packet = 1024;
|
||||
|
||||
printf("HW: samples_per_packet %d\n",openair0_cfg[card].samples_per_packet);
|
||||
#endif
|
||||
|
||||
if (local_remote_radio == BBU_REMOTE_RADIO_HEAD) {
|
||||
openair0_cfg[card].remote_addr = eth_params->remote_addr;
|
||||
openair0_cfg[card].remote_port = eth_params->remote_port;
|
||||
openair0_cfg[card].my_addr = eth_params->my_addr;
|
||||
openair0_cfg[card].my_port = eth_params->my_port;
|
||||
}
|
||||
|
||||
printf("HW: Configuring card %d, nb_antennas_tx/rx %d/%d\n",card,
|
||||
((UE_flag==0) ? PHY_vars_eNB_g[0][0]->lte_frame_parms.nb_antennas_tx : PHY_vars_UE_g[0][0]->lte_frame_parms.nb_antennas_tx),
|
||||
@@ -2990,13 +3042,10 @@ int main( int argc, char **argv )
|
||||
|
||||
if (UE_flag) {
|
||||
printf("ETHERNET: Configuring UE ETH for %s:%d\n",rrh_UE_ip,rrh_UE_port);
|
||||
openair0_cfg[card].remote_ip = &rrh_UE_ip[0];
|
||||
openair0_cfg[card].remote_addr = &rrh_UE_ip[0];
|
||||
openair0_cfg[card].remote_port = rrh_UE_port;
|
||||
} else {
|
||||
printf("ETHERNET: Configuring eNB ETH for %s:%d\n",rrh_eNB_ip,rrh_eNB_port);
|
||||
openair0_cfg[card].remote_ip = &rrh_eNB_ip[0];
|
||||
openair0_cfg[card].remote_port = rrh_eNB_port;
|
||||
}
|
||||
}
|
||||
|
||||
openair0_cfg[card].num_rb_dl=frame_parms[0]->N_RB_DL;
|
||||
#endif
|
||||
|
||||
@@ -3053,22 +3102,40 @@ int main( int argc, char **argv )
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
openair0.func_type = BBU_FUNC;
|
||||
/* device host type is set*/
|
||||
openair0.host_type = BBU_HOST;
|
||||
/* device type is initialized NONE_DEV (no RF device) when the RF device will be initiated device type will be set */
|
||||
openair0.type = NONE_DEV;
|
||||
/* transport type is initialized NONE_TP (no transport protocol) when the transport protocol will be initiated transport protocol type will be set */
|
||||
openair0.transp_type = NONE_TP;
|
||||
openair0_cfg[0].log_level = glog_level;
|
||||
|
||||
if (mode!=loop_through_memory){
|
||||
int ret;
|
||||
ret= openair0_device_init(&openair0, &openair0_cfg[0]);
|
||||
printf("openair0_device_init returns %d\n",ret);
|
||||
if (ret<0) {
|
||||
printf("Exiting, cannot initialize device\n");
|
||||
exit(-1);
|
||||
int returns=-1;
|
||||
/* BBU can have either a local or a remote radio head */
|
||||
if (local_remote_radio == BBU_LOCAL_RADIO_HEAD) { //local radio head active - load library of radio head and initiate it
|
||||
if (mode!=loop_through_memory) {
|
||||
returns=openair0_device_load(&openair0, &openair0_cfg[0]);
|
||||
printf("openair0_device_init returns %d\n",returns);
|
||||
if (returns<0) {
|
||||
printf("Exiting, cannot initialize device\n");
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (mode==loop_through_memory) {
|
||||
}
|
||||
|
||||
else if (mode==loop_through_memory) {
|
||||
}
|
||||
} else { //remote radio head active - load library of transport protocol and initiate it
|
||||
if (mode!=loop_through_memory) {
|
||||
returns=openair0_transport_load(&openair0, &openair0_cfg[0], eth_params);
|
||||
printf("openair0_transport_init returns %d\n",returns);
|
||||
if (returns<0) {
|
||||
printf("Exiting, cannot initialize transport protocol\n");
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
else if (mode==loop_through_memory) {
|
||||
}
|
||||
}
|
||||
|
||||
printf("Done\n");
|
||||
|
||||
mac_xface = malloc(sizeof(MAC_xface));
|
||||
@@ -3491,7 +3558,6 @@ int main( int argc, char **argv )
|
||||
if (multi_thread>0) {
|
||||
printf("Killing eNB processing threads\n");
|
||||
kill_eNB_proc();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3583,10 +3649,6 @@ int setup_eNB_buffers(PHY_VARS_eNB **phy_vars_eNB, openair0_config_t *openair0_c
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// replace RX signal buffers with mmaped HW versions
|
||||
#ifdef EXMIMO
|
||||
openair0_cfg[CC_id].tx_num_channels = 0;
|
||||
|
||||
+92
-16
@@ -1,19 +1,19 @@
|
||||
[*]
|
||||
[*] GTKWave Analyzer v3.3.58 (w)1999-2014 BSI
|
||||
[*] Thu Sep 17 14:23:43 2015
|
||||
[*] Fri Jan 29 16:34:46 2016
|
||||
[*]
|
||||
[dumpfile] "/tmp/openair_dump_rrh.vcd"
|
||||
[dumpfile_mtime] "Thu Sep 17 14:21:43 2015"
|
||||
[dumpfile_size] 636509125
|
||||
[savefile] "/home/guepe/openair4G/targets/RT/USER/rrh.gtkw"
|
||||
[timestart] 17746655400
|
||||
[size] 1855 1056
|
||||
[pos] -1 -1
|
||||
*-15.826077 17746846200 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
|
||||
[dumpfile_mtime] "Fri Jan 29 16:20:55 2016"
|
||||
[dumpfile_size] 224259458
|
||||
[savefile] "/home/guepe/openairinterface5g_rrh/openairinterface5g/targets/RT/USER/rrh.gtkw"
|
||||
[timestart] 31315875900
|
||||
[size] 1004 1028
|
||||
[pos] 926 -1
|
||||
*-17.429794 31316090054 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
|
||||
[sst_width] 224
|
||||
[signals_width] 230
|
||||
[signals_width] 261
|
||||
[sst_expanded] 1
|
||||
[sst_vpaned_height] 287
|
||||
[sst_vpaned_height] 278
|
||||
@24
|
||||
[color] 1
|
||||
variables.hw_frame_rx[63:0]
|
||||
@@ -23,7 +23,10 @@ variables.hw_subframe_rx[63:0]
|
||||
[color] 1
|
||||
functions.eNB_rx
|
||||
functions.eNB_rx_sleep
|
||||
functions.trx_write_rf
|
||||
[color] 3
|
||||
functions.trx_read_rf
|
||||
[color] 7
|
||||
functions.trx_write
|
||||
@c00024
|
||||
variables.rxcnt[63:0]
|
||||
@28
|
||||
@@ -95,24 +98,97 @@ variables.rxcnt[63:0]
|
||||
-group_end
|
||||
@24
|
||||
variables.pck_rx[63:0]
|
||||
variables.rx_ts[63:0]
|
||||
@c00024
|
||||
variables.tx_seq_num[63:0]
|
||||
@28
|
||||
(0)variables.tx_seq_num[63:0]
|
||||
(1)variables.tx_seq_num[63:0]
|
||||
(2)variables.tx_seq_num[63:0]
|
||||
(3)variables.tx_seq_num[63:0]
|
||||
(4)variables.tx_seq_num[63:0]
|
||||
(5)variables.tx_seq_num[63:0]
|
||||
(6)variables.tx_seq_num[63:0]
|
||||
(7)variables.tx_seq_num[63:0]
|
||||
(8)variables.tx_seq_num[63:0]
|
||||
(9)variables.tx_seq_num[63:0]
|
||||
(10)variables.tx_seq_num[63:0]
|
||||
(11)variables.tx_seq_num[63:0]
|
||||
(12)variables.tx_seq_num[63:0]
|
||||
(13)variables.tx_seq_num[63:0]
|
||||
(14)variables.tx_seq_num[63:0]
|
||||
(15)variables.tx_seq_num[63:0]
|
||||
(16)variables.tx_seq_num[63:0]
|
||||
(17)variables.tx_seq_num[63:0]
|
||||
(18)variables.tx_seq_num[63:0]
|
||||
(19)variables.tx_seq_num[63:0]
|
||||
(20)variables.tx_seq_num[63:0]
|
||||
(21)variables.tx_seq_num[63:0]
|
||||
(22)variables.tx_seq_num[63:0]
|
||||
(23)variables.tx_seq_num[63:0]
|
||||
(24)variables.tx_seq_num[63:0]
|
||||
(25)variables.tx_seq_num[63:0]
|
||||
(26)variables.tx_seq_num[63:0]
|
||||
(27)variables.tx_seq_num[63:0]
|
||||
(28)variables.tx_seq_num[63:0]
|
||||
(29)variables.tx_seq_num[63:0]
|
||||
(30)variables.tx_seq_num[63:0]
|
||||
(31)variables.tx_seq_num[63:0]
|
||||
(32)variables.tx_seq_num[63:0]
|
||||
(33)variables.tx_seq_num[63:0]
|
||||
(34)variables.tx_seq_num[63:0]
|
||||
(35)variables.tx_seq_num[63:0]
|
||||
(36)variables.tx_seq_num[63:0]
|
||||
(37)variables.tx_seq_num[63:0]
|
||||
(38)variables.tx_seq_num[63:0]
|
||||
(39)variables.tx_seq_num[63:0]
|
||||
(40)variables.tx_seq_num[63:0]
|
||||
(41)variables.tx_seq_num[63:0]
|
||||
(42)variables.tx_seq_num[63:0]
|
||||
(43)variables.tx_seq_num[63:0]
|
||||
(44)variables.tx_seq_num[63:0]
|
||||
(45)variables.tx_seq_num[63:0]
|
||||
(46)variables.tx_seq_num[63:0]
|
||||
(47)variables.tx_seq_num[63:0]
|
||||
(48)variables.tx_seq_num[63:0]
|
||||
(49)variables.tx_seq_num[63:0]
|
||||
(50)variables.tx_seq_num[63:0]
|
||||
(51)variables.tx_seq_num[63:0]
|
||||
(52)variables.tx_seq_num[63:0]
|
||||
(53)variables.tx_seq_num[63:0]
|
||||
(54)variables.tx_seq_num[63:0]
|
||||
(55)variables.tx_seq_num[63:0]
|
||||
(56)variables.tx_seq_num[63:0]
|
||||
(57)variables.tx_seq_num[63:0]
|
||||
(58)variables.tx_seq_num[63:0]
|
||||
(59)variables.tx_seq_num[63:0]
|
||||
(60)variables.tx_seq_num[63:0]
|
||||
(61)variables.tx_seq_num[63:0]
|
||||
(62)variables.tx_seq_num[63:0]
|
||||
(63)variables.tx_seq_num[63:0]
|
||||
@1401200
|
||||
-group_end
|
||||
@24
|
||||
variables.hw_frame[63:0]
|
||||
variables.hw_subframe[63:0]
|
||||
@28
|
||||
[color] 1
|
||||
functions.eNB_tx
|
||||
functions.eNB_tx_sleep
|
||||
functions.trx_read_rf
|
||||
[color] 7
|
||||
functions.trx_write
|
||||
[color] 7
|
||||
functions.trx_read
|
||||
[color] 3
|
||||
functions.trx_write_rf
|
||||
@24
|
||||
variables.txcnt[63:0]
|
||||
variables.rx_ts[63:0]
|
||||
variables.pck_tx[63:0]
|
||||
variables.tx_ts[63:0]
|
||||
@25
|
||||
variables.rx_seq_num_prv[63:0]
|
||||
@24
|
||||
variables.rx_seq_num[63:0]
|
||||
variables.hw_cnt_rx[63:0]
|
||||
variables.lhw_cnt_rx[63:0]
|
||||
@25
|
||||
[color] 3
|
||||
variables.cnt[63:0]
|
||||
[pattern_trace] 1
|
||||
|
||||
+73
-67
@@ -51,9 +51,9 @@
|
||||
#include <time.h>
|
||||
|
||||
#include "common_lib.h"
|
||||
#include "rrh_gw.h" // change to rrh_new.h, put externs in rrh_extern.h
|
||||
#include "rrh_gw.h"
|
||||
#include "rt_wrapper.h"
|
||||
#include "rrh_gw_externs.h" // change to rrh_new.h, put externs in rrh_extern.h
|
||||
#include "rrh_gw_externs.h"
|
||||
|
||||
|
||||
#include "log_if.h"
|
||||
@@ -71,8 +71,9 @@
|
||||
*****************************************************************************************/
|
||||
|
||||
|
||||
|
||||
char rrh_ip[20] = "192.168.12.242"; // there is code to detect the my ip address
|
||||
/* local IP/MAC address is detected*/
|
||||
char rrh_ip[20] = "0.0.0.0";
|
||||
unsigned char rrh_mac[6] = "0:0:0:0:0:0";
|
||||
int rrh_port = 50000; // has to be an option
|
||||
|
||||
/* log */
|
||||
@@ -86,7 +87,7 @@ int16_t ue_log_level = LOG_INFO;
|
||||
int16_t ue_log_verbosity = LOG_MED;
|
||||
|
||||
|
||||
/* flags definitions */
|
||||
/* flag definitions */
|
||||
uint8_t eNB_flag=0;
|
||||
uint8_t UE_flag=0;
|
||||
uint8_t EXMIMO_flag=0;
|
||||
@@ -102,10 +103,8 @@ uint8_t measurements_flag=0;
|
||||
- default ethernet interface is local */
|
||||
uint8_t num_eNB_mod=0;
|
||||
uint8_t num_UE_mod=0;
|
||||
uint8_t num_EXMIMO_mod=0;
|
||||
uint8_t num_USRP_mod=0;
|
||||
uint8_t hardware_target=NONE_IF;
|
||||
char* if_name="lo";
|
||||
char* if_name="lo";
|
||||
uint8_t eth_mode=ETH_UDP_MODE;
|
||||
|
||||
rrh_module_t *enb_array;
|
||||
rrh_module_t *ue_array;
|
||||
@@ -128,14 +127,14 @@ static void print_help(void);
|
||||
*/
|
||||
static rrh_module_t new_module(unsigned int id);
|
||||
|
||||
/*!\fn static int get_ip_address(char* if_name)
|
||||
/*!\fn static int get_address(char* if_name, uint8_t flag);
|
||||
* \brief retrieves IP address from the specified network interface
|
||||
* \param[in] name of network interface
|
||||
* \return 0
|
||||
* \note
|
||||
* @ingroup _oai
|
||||
*/
|
||||
static int get_ip_address(char* if_name);
|
||||
static int get_address(char* if_name, uint8_t flag);
|
||||
|
||||
|
||||
|
||||
@@ -192,48 +191,53 @@ static rrh_module_t new_module (unsigned int id) {
|
||||
rrh_mod.measurements=measurements_flag;
|
||||
|
||||
/* each module is associated with an ethernet device */
|
||||
rrh_mod.eth_dev.type=ETH_IF;
|
||||
rrh_mod.eth_dev.type=NONE_DEV;
|
||||
rrh_mod.eth_dev.transp_type=NONE_TP;
|
||||
/* ethernet device is functioning within RRH */
|
||||
rrh_mod.eth_dev.func_type=RRH_FUNC;
|
||||
/* specify IP address */
|
||||
get_ip_address(if_name);
|
||||
openair0_cfg.my_ip=&rrh_ip[0];
|
||||
openair0_cfg.my_port=rrh_port;
|
||||
rrh_mod.eth_dev.host_type=RRH_HOST;
|
||||
/* */
|
||||
rrh_mod.eth_dev.openair0_cfg = (openair0_config_t*)malloc(sizeof(openair0_config_t));
|
||||
memset(rrh_mod.eth_dev.openair0_cfg,0,sizeof(openair0_config_t));
|
||||
/* get IP and MAC address */
|
||||
get_address(if_name,eth_mode);
|
||||
|
||||
if(eth_mode==ETH_UDP_MODE) {
|
||||
openair0_cfg.my_addr = &rrh_ip[0];
|
||||
openair0_cfg.my_port = rrh_port;
|
||||
LOG_I(RRH,"UDP mode selected for ethernet.\n");
|
||||
} else if (eth_mode==ETH_RAW_MODE) {
|
||||
openair0_cfg.my_addr = &rrh_mac[0];
|
||||
openair0_cfg.my_port = rrh_port;
|
||||
LOG_I(RRH,"RAW mode selected for ethernet.\n");
|
||||
}
|
||||
|
||||
/* */
|
||||
eth_params_t *eth_params = (eth_params_t*)malloc(sizeof(eth_params_t));
|
||||
memset(eth_params, 0, sizeof(eth_params_t));
|
||||
eth_params->local_if_name = if_name;
|
||||
eth_params->transp_preference = eth_mode;
|
||||
|
||||
/* ethernet device initialization */
|
||||
if (openair0_dev_init_eth(&rrh_mod.eth_dev, &openair0_cfg)<0){
|
||||
if (openair0_transport_load(&rrh_mod.eth_dev, &openair0_cfg,eth_params)<0) {
|
||||
LOG_E(RRH,"Exiting, cannot initialize ethernet interface.\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/* allocate space and specify associated RF device */
|
||||
openair0_device *oai_dv = (openair0_device *)malloc(sizeof(openair0_device));
|
||||
memset(oai_dv,0, sizeof(openair0_device));
|
||||
memset(oai_dv,0,sizeof(openair0_device));
|
||||
|
||||
#ifdef EXMIMO
|
||||
rrh_mod.devs=oai_dv;
|
||||
rrh_mod.devs->type=EXMIMO_IF;
|
||||
LOG_I(RRH,"Setting RF device to EXMIMO\n");
|
||||
#elif OAI_USRP
|
||||
rrh_mod.devs=oai_dv;
|
||||
rrh_mod.devs->type=USRP_B200_IF;
|
||||
LOG_I(RRH,"Setting RF device to USRP\n");
|
||||
#elif OAI_BLADERF
|
||||
rrh_mod.devs=oai_dv;
|
||||
rrh_mod.devs->type=BLADERF_IF;
|
||||
LOG_I(RRH,"Setting RF device to BLADERF\n");
|
||||
#else
|
||||
rrh_mod.devs=oai_dv;
|
||||
rrh_mod.devs->type=NONE_IF;
|
||||
LOG_I(RRH,"Setting RF interface to NONE_IF... \n");
|
||||
#endif
|
||||
|
||||
rrh_mod.devs->type=NONE_DEV;
|
||||
rrh_mod.devs->transp_type=NONE_TP;
|
||||
rrh_mod.devs->host_type=RRH_HOST;
|
||||
|
||||
return rrh_mod;
|
||||
}
|
||||
|
||||
static void debug_init(void) {
|
||||
|
||||
// log initialization
|
||||
/* log initialization */
|
||||
logInit();
|
||||
set_glog(glog_level, glog_verbosity);
|
||||
|
||||
@@ -241,7 +245,7 @@ static void debug_init(void) {
|
||||
//set_comp_log(ENB_LOG, enb_log_level, enb_log_verbosity, 1);
|
||||
//set_comp_log(UE_LOG, ue_log_level, ue_log_verbosity, 1);
|
||||
|
||||
// vcd initialization
|
||||
/* vcd initialization */
|
||||
if (ouput_vcd) {
|
||||
vcd_signal_dumper_init("/tmp/openair_dump_rrh.vcd");
|
||||
|
||||
@@ -253,7 +257,7 @@ static void get_options(int argc, char *argv[]) {
|
||||
|
||||
int opt;
|
||||
|
||||
while ((opt = getopt(argc, argv, "xvhlte:n:u:g:r:w:i:")) != -1) {
|
||||
while ((opt = getopt(argc, argv, "xvhlte:n:u:g:r:m:i:")) != -1) {
|
||||
|
||||
switch (opt) {
|
||||
case 'n':
|
||||
@@ -273,6 +277,9 @@ static void get_options(int argc, char *argv[]) {
|
||||
printf("RRH interface name is set to %s\n", if_name);
|
||||
}
|
||||
break;
|
||||
case 'm':
|
||||
eth_mode=atoi(optarg);
|
||||
break;
|
||||
case 'r':
|
||||
//rrh_log_level=atoi(optarg);
|
||||
break;
|
||||
@@ -293,16 +300,12 @@ static void get_options(int argc, char *argv[]) {
|
||||
loopback_flag=1;
|
||||
break;
|
||||
case 't':
|
||||
/*When measurements are enabled statistics related to TX/RX time are printed*/
|
||||
/* When measurements are enabled statistics related to TX/RX time are printed */
|
||||
measurements_flag=1;
|
||||
break;
|
||||
case 'w':
|
||||
/* force to use this target*/
|
||||
hardware_target=1;
|
||||
break;
|
||||
case 'h':
|
||||
print_help();
|
||||
exit(-1);
|
||||
break;
|
||||
case 'h':
|
||||
print_help();
|
||||
exit(-1);
|
||||
default: /* '?' */
|
||||
//fprintf(stderr, "Usage: \n", argv[0]);
|
||||
exit(-1);
|
||||
@@ -311,31 +314,34 @@ static void get_options(int argc, char *argv[]) {
|
||||
|
||||
}
|
||||
|
||||
static int get_ip_address(char* if_name) {
|
||||
static int get_address(char* if_name, uint8_t flag) {
|
||||
|
||||
int fd;
|
||||
struct ifreq ifr;
|
||||
|
||||
|
||||
fd = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
|
||||
|
||||
fd = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
/* I want to get an IPv4 IP address */
|
||||
ifr.ifr_addr.sa_family = AF_INET;
|
||||
|
||||
ifr.ifr_addr.sa_family = AF_INET;
|
||||
/* I want IP address attached to "if_name" */
|
||||
strncpy(ifr.ifr_name, if_name, IFNAMSIZ-1);
|
||||
|
||||
if ( ioctl(fd, SIOCGIFADDR, &ifr)<0 ) {
|
||||
perror("IOCTL:");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (flag==ETH_UDP_MODE) {
|
||||
if ( ioctl(fd, SIOCGIFADDR, &ifr)<0 ) {
|
||||
perror("IOCTL:");
|
||||
exit(-1);
|
||||
}
|
||||
snprintf(&rrh_ip[0],20,"%s", inet_ntoa(((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr));
|
||||
LOG_I(RRH,"%s: IP address: %s\n",if_name,rrh_ip);
|
||||
} else if (flag==ETH_RAW_MODE) {
|
||||
if ( ioctl(fd, SIOCGIFHWADDR, &ifr)<0 ) {
|
||||
perror("IOCTL:");
|
||||
exit(-1);
|
||||
}
|
||||
ether_ntoa_r ((unsigned char *)ifr.ifr_hwaddr.sa_data, rrh_mac);
|
||||
LOG_I(RRH,"%s: MAC address: %s\n",if_name,rrh_mac);
|
||||
}
|
||||
|
||||
close(fd);
|
||||
|
||||
/* display result */
|
||||
snprintf(&rrh_ip[0],20,"%s", inet_ntoa(((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr));
|
||||
LOG_I(RRH,"Got IP address %s from interface %s\n", rrh_ip,if_name);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -343,19 +349,19 @@ static int get_ip_address(char* if_name) {
|
||||
static void print_help(void) {
|
||||
|
||||
puts("Usage: \n");
|
||||
puts(" sudo -E chrt 99 ./rrh -n1 -g6 -v -t");
|
||||
puts(" sudo -E chrt 99 ./rrh -n1 -g6 -v -t -i lo -m1");
|
||||
puts("Options:\n");
|
||||
puts("\t -n create eNB module\n");
|
||||
puts("\t -u create UE module\n");
|
||||
puts("\t -g define global log level\n");
|
||||
puts("\t -i set the RRH interface (default lo)\n");
|
||||
puts("\t -m set ethernet mode to be used by RRH, valid options: (1:raw, 0:udp) \n");
|
||||
puts("\t -r define rrh log level\n");
|
||||
puts("\t -e define eNB log level\n");
|
||||
puts("\t -x enable real time bahaviour\n");
|
||||
puts("\t -v enable vcd dump\n");
|
||||
puts("\t -l enable loopback mode\n");
|
||||
puts("\t -t enable measurements\n");
|
||||
puts("\t -w force to use specified HW\n");
|
||||
puts("\t -h display info\n");
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user