Commit a3c40dc3 authored by Aikaterini Trilyraki's avatar Aikaterini Trilyraki

revert lte-softmodem to previous version

parent 9b68212e
......@@ -329,7 +329,15 @@ time_stats_t softmodem_stats_rx_sf[10]; // total rx time
void reset_opp_meas(void);
void print_opp_meas(void);
int transmission_mode=1;
/*
FT: not a very clean way of managing the rescale of iqs in rx path, but this is done in
openair1/PHY/MODULATION/ul_7_5_kHz.c which doesn't have access to config parameters
to re-worked later.....
RX_IQRESCALELEN is setup in device libraries for all non expressmimo targets and acessed as an
external variable in ul_7_5_kHz.c. For expressmimo it is a macro (openair1/PHY/defs.h)
Regarding the value of this variable or macro: 18 is for 15 bits iqs, 15 is used for USRP, EXMIMO
*/
//int rxrescale;
int16_t glog_level = LOG_INFO;
int16_t glog_verbosity = LOG_MED;
......@@ -361,16 +369,57 @@ 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 given in runtime to specify if the RF head is local or remote (default option is local RF)*/
uint8_t local_remote_RF = BBU_LOCAL_RF_ENABLED;
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));
......@@ -430,7 +479,7 @@ 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(" -M Specify whether RF head is local or remote,valid options: (1: local , 2:remote) \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");
......@@ -947,6 +996,12 @@ 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] = ((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;
/*
((short*)&phy_vars_eNB->lte_eNB_common_vars.txdata[0][aa][tx_offset])[0]=
#ifdef EXMIMO
((short*)dummy_tx_b)[2*i]<<4;
......@@ -963,6 +1018,7 @@ void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB)
#else
((short*)dummy_tx_b)[2*i+1]<<4;
#endif
*/
}
// if S-subframe switch to RX in second subframe
if (subframe_select(&phy_vars_eNB->lte_frame_parms,subframe) == SF_S) {
......@@ -1780,7 +1836,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)
......@@ -1789,8 +1847,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
......@@ -1811,16 +1867,23 @@ static void* eNB_thread( void* arg )
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (timestamp+(openair0_cfg[card].tx_delay*spp)-openair0_cfg[card].tx_forward_nsamps)&0xffffffff );
stop_meas( &softmodem_stats_mt );
clock_gettime( CLOCK_MONOTONIC, &trx_time2 );
if (frame > 50) {
clock_gettime( CLOCK_MONOTONIC, &trx_time2 );
// BMC: compute time between rx and tx
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
/* FT configurable tx lauch delay (in slots )*/
if ((tx_launched == 0) &&
(rx_pos >= (((2*hw_subframe)+1)*PHY_vars_eNB_g[0][0]->lte_frame_parms.samples_per_tti>>1))) {
((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++) {
......@@ -1981,6 +2044,9 @@ eNB_thread_cleanup:
#endif
eNB_thread_status = 0;
print_difftimes();
return &eNB_thread_status;
}
......@@ -1992,8 +2058,8 @@ static void get_options (int argc, char **argv)
int c;
// char line[1000];
// int l;
int k,i,j;//,j,k;
#if defined(OAI_USRP) || defined(CPRIGW)
int k,i;//,j,k;
#if defined(OAI_USRP) || defined(CPRIGW) //#ifndef EXMIMO?
int clock_src;
#endif
int CC_id;
......@@ -2112,9 +2178,7 @@ static void get_options (int argc, char **argv)
break;
case 'M':
#ifdef ETHERNET
strcpy(rrh_eNB_ip,optarg);
#endif
local_remote_RF=atoi(optarg);
break;
case 'C':
......@@ -2243,7 +2307,7 @@ static void get_options (int argc, char **argv)
break;
case 's':
#if defined(OAI_USRP) || defined(CPRIGW)
#if defined(OAI_USRP) || defined(CPRIGW) //#ifndef EXMIMO
clock_src = atoi(optarg);
......@@ -2342,21 +2406,6 @@ 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 ){
// replace printf by setting
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");
}
}
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];
......@@ -2861,6 +2910,11 @@ int main( int argc, char **argv )
for (card=0; card<MAX_CARDS; card++) {
#ifdef EXMIMO
/* FT: for all other devices the iq_txshift value is setup in the device library */
openair0_cfg[card].iq_txshift=4;
#endif
if(frame_parms[0]->N_RB_DL == 100) {
sample_rate = 30.72e6;
bw = 10.0e6;
......@@ -2871,8 +2925,8 @@ int main( int argc, char **argv )
openair0_cfg[card].tx_bw = 10e6;
openair0_cfg[card].rx_bw = 10e6;
// from usrp_time_offset
openair0_cfg[card].tx_forward_nsamps = 175;
openair0_cfg[card].tx_delay = 8;
//openair0_cfg[card].tx_forward_nsamps = 175;
// openair0_cfg[card].tx_delay = 8;
#endif
} else if(frame_parms[0]->N_RB_DL == 50) {
sample_rate = 15.36e6;
......@@ -2883,8 +2937,8 @@ int main( int argc, char **argv )
openair0_cfg[card].samples_per_frame = 153600;
openair0_cfg[card].tx_bw = 5e6;
openair0_cfg[card].rx_bw = 5e6;
openair0_cfg[card].tx_forward_nsamps = 95;
openair0_cfg[card].tx_delay = 5;
//openair0_cfg[card].tx_forward_nsamps = 95;
//openair0_cfg[card].tx_delay = 5;
#endif
} else if (frame_parms[0]->N_RB_DL == 25) {
sample_rate = 7.68e6;
......@@ -2896,12 +2950,14 @@ int main( int argc, char **argv )
openair0_cfg[card].rx_bw = 2.5e6;
openair0_cfg[card].samples_per_packet = 1024;
#ifdef OAI_USRP
openair0_cfg[card].tx_forward_nsamps = 70;
openair0_cfg[card].tx_delay = 5;
#elif OAI_BLADERF
openair0_cfg[card].tx_forward_nsamps = 0;
openair0_cfg[card].tx_delay = 8;
#endif
// openair0_cfg[card].tx_forward_nsamps = 70;
//openair0_cfg[card].tx_delay = 5;
#endif
//#elif OAI_BLADERF
//openair0_cfg[card].tx_forward_nsamps = 0;
//openair0_cfg[card].tx_delay = 8;
//#endif
#endif
} else if (frame_parms[0]->N_RB_DL == 6) {
sample_rate = 1.92e6;
......@@ -2912,16 +2968,26 @@ int main( int argc, char **argv )
openair0_cfg[card].samples_per_frame = 19200;
openair0_cfg[card].tx_bw = 1.5e6;
openair0_cfg[card].rx_bw = 1.5e6;
openair0_cfg[card].tx_forward_nsamps = 40;
openair0_cfg[card].tx_delay = 8;
//openair0_cfg[card].tx_forward_nsamps = 40;
//openair0_cfg[card].tx_delay = 8;
#endif
}
#ifdef ETHERNET
//calib needed
openair0_cfg[card].tx_delay = 0;
//openair0_cfg[card].remote_addr = "192.168.12.242";
//openair0_cfg[card].remote_addr = "127.0.0.1";
openair0_cfg[card].remote_addr = "74:d4:35:cc:88:45";
openair0_cfg[card].remote_port = 50000;
//openair0_cfg[card].my_addr = "192.168.12.31";
//openair0_cfg[card].my_addr = "127.0.0.1";
openair0_cfg[card].my_addr = "d4:be:d9:22:0a:ac";
openair0_cfg[card].my_port = 50000;
//openair0_cfg[card].my_port = 50001;
openair0_cfg[card].tx_delay = 10;
openair0_cfg[card].tx_forward_nsamps = 0;
openair0_cfg[card].txlaunch_wait = 0;
openair0_cfg[card].txlaunch_wait_slotcount = 0;
if (frame_parms[0]->N_RB_DL == 6)
openair0_cfg[card].samples_per_packet = 256;
......@@ -2934,23 +3000,20 @@ int main( int argc, char **argv )
#ifndef EXMIMO
openair0_cfg[card].samples_per_packet = openair0_cfg[0].samples_per_packet;
openair0_cfg[card].num_rb_dl=frame_parms[0]->N_RB_DL;
#endif
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),
((UE_flag==0) ? PHY_vars_eNB_g[0][0]->lte_frame_parms.nb_antennas_rx : PHY_vars_UE_g[0][0]->lte_frame_parms.nb_antennas_rx));
openair0_cfg[card].Mod_id = 0;
#ifdef ETHERNET
#ifdef ETHERNET/*do we need to separate ue and enb????*/
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
openair0_cfg[card].sample_rate = sample_rate;
openair0_cfg[card].tx_bw = bw;
......@@ -3003,18 +3066,36 @@ openair0_cfg[card].num_rb_dl=frame_parms[0]->N_RB_DL;
#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;
/* BBU can either have local or remote radio heads - local radio head option is set by default so the corresponding device is initiated */
if ((mode!=loop_through_memory) &&
(openair0_device_init(&openair0, &openair0_cfg[0]) <0)) {
(openair0_device_load(&openair0, &openair0_cfg[0]) <0)) {
printf("Exiting, cannot initialize device\n");
exit(-1);
}
else if (mode==loop_through_memory) {
}
/* radio heads are remote so the trasnsport protocol is initiated */
if (local_remote_RF == BBU_REMOTE_RF_ENABLED) {
if ((mode!=loop_through_memory) &&
(openair0_transport_load(&openair0, &openair0_cfg[0]) <0)) {
printf("Exiting, cannot initialize transport protocol\n");
exit(-1);
}
else if (mode==loop_through_memory) {
}
}
//for EXMIMO
//openair0_cfg[0].iq_rxrescale=15; /* default value if build with EXMIMO */
//rxrescale=openair0_cfg[0].iq_rxrescale; /* see comments near RX_IQRESCALELEN definition */
printf("Done\n");
mac_xface = malloc(sizeof(MAC_xface));
......@@ -3432,7 +3513,6 @@ openair0_cfg[card].num_rb_dl=frame_parms[0]->N_RB_DL;
if (multi_thread>0) {
printf("Killing eNB processing threads\n");
kill_eNB_proc();
}
}
......@@ -3524,10 +3604,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;
......
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