Commit 276f6364 authored by Luis Ariza's avatar Luis Ariza 💬

dlsim working in the frequency domain and some added time statistics

parent afbe4b51
......@@ -1919,7 +1919,7 @@ int main(int argc, char **argv)
printf("-B bandwidth configuration (in number of ressource blocks): 6, 25, 50, 100\n");
printf("-r ressource block allocation (see section 7.1.6.3 in 36.213\n");
printf("-g [A:M] Use 3GPP 25.814 SCM-A/B/C/D('A','B','C','D') or 36-101 EPA('E'), EVA ('F'),ETU('G') models (ignores delay spread and Ricean factor), Rayghleigh8 ('H'), Rayleigh1('I'), Rayleigh1_corr('J'), Rayleigh1_anticorr ('K'), Rice8('L'), Rice1('M')\n");
printf("-F forgetting factor (0 new channel every trial, 1 channel constant\n");
printf("-F forgetting factor (0 new channel every trial, 1 channel constant)\n");
printf("-x Transmission mode (1,2,6,7 for the moment)\n");
printf("-X Xforms\n");
printf("-q Number of TX antennas ports used in eNB\n");
......@@ -1929,7 +1929,7 @@ int main(int argc, char **argv)
printf("-R Number of HARQ rounds (fixed)\n");
printf("-A Turns on calibration mode for abstraction.\n");
printf("-N Determines the number of Channel Realizations in Abstraction mode. Default value is 1. \n");
printf("-O Set the percenatge of effective rate to testbench the modem performance (typically 30 and 70, range 1-100) \n");
printf("-O Set the percentage of effective rate to testbench the modem performance (typically 30 and 70, range 1-100) \n");
printf("-I Input filename for TrCH data (binary)\n");
printf("-u Enables the Interference Aware Receiver for TM5 (default is normal receiver)\n");
exit(1);
......@@ -2537,7 +2537,7 @@ int main(int argc, char **argv)
// printf("Trial %d : Round %d, pmi_feedback %d \n",trials,round,pmi_feedback);
for (aa=0; aa<eNB->frame_parms.nb_antennas_tx; aa++) {
memset(&eNB->common_vars.txdataF[eNB_id][aa][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t));
memset(&eNB->common_vars.txdata[eNB_id][aa][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t));
}
//printf("FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX %d\n",FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX);
if (input_fd==NULL) {
......
This diff is collapsed.
......@@ -79,7 +79,7 @@ void dac(double *s_re[2],
}
}
}
#define dac_SSE
//#define dac_SSE
#ifdef dac_SSE
double dac_fixed_gain(double *s_re[2],
double *s_im[2],
......
......@@ -240,8 +240,8 @@ void rf_rx_simple(double *r_re[2],
// Amplify by receiver gain and apply 3rd order non-linearity
/*count++;
clock_t start=clock();*/
r_re[a][i] = rx_gain_lin*(r_re[a][i] + sqrt(.5*N0W)*ziggurat(0.0,1.0));
r_im[a][i] = rx_gain_lin*(r_im[a][i] + sqrt(.5*N0W)*ziggurat(0.0,1.0));
r_re[a][i] = rx_gain_lin*(r_re[a][i] + sqrt(.5*N0W)*gaussdouble(0.0,1.0));
r_im[a][i] = rx_gain_lin*(r_im[a][i] + sqrt(.5*N0W)*gaussdouble(0.0,1.0));
/*clock_t stop=clock();
printf("do_DL_sig time is %f s, AVERAGE time is %f s, count %d, sum %e\n",(float) (stop-start)/CLOCKS_PER_SEC,(float) (sum+stop-start)/(count*CLOCKS_PER_SEC),count,sum+stop-start);
sum=(sum+stop-start);*/
......@@ -249,7 +249,7 @@ sum=(sum+stop-start);*/
}
}
#define RF_RX_SSE
//#define RF_RX_SSE
#ifdef RF_RX_SSE
void rf_rx_simple_freq(double *r_re[2],
double *r_im[2],
......
......@@ -98,25 +98,35 @@ typedef struct {
time_stats_t convolution;
time_stats_t ziggurat;
time_stats_t ziggurat_PRACH;
time_stats_t DL_multipath_channel;
time_stats_t UL_multipath_channel;
time_stats_t DL_dac_fixed_gain;
time_stats_t UL_dac_fixed_gain;
time_stats_t DL_rf_rx_simple;
time_stats_t UL_rf_rx_simple;
time_stats_t DL_adc;
time_stats_t UL_adc;
/// frequency measurements
time_stats_t DL_multipath_channel_freq;
time_stats_t DL_dac_fixed_gain;
time_stats_t DL_dac_fixed_gain_freq;
time_stats_t DL_rf_rx_simple_freq;
time_stats_t DL_adc;
time_stats_t DL_adc_freq;
time_stats_t UL_multipath_channel_freq;
time_stats_t UL_dac_fixed_gain;
time_stats_t UL_dac_fixed_gain_freq;
time_stats_t UL_rf_rx_simple_freq;
time_stats_t UL_adc;
time_stats_t UL_adc_freq;
time_stats_t multipath_channel_freq_PRACH;
time_stats_t dac_fixed_gain_PRACH;
time_stats_t rf_rx_simple_freq_PRACH;
time_stats_t adc_PRACH;
time_stats_t UL_PRACH_channel;
time_stats_t UL_channel;
time_stats_t DL_channel;
time_stats_t UL_PRACH_channel_freq;
time_stats_t UL_channel_freq;
time_stats_t DL_channel_freq;
} channel_desc_t;
......
......@@ -35,7 +35,7 @@ uint8_t multipath_channel_nosigconv(channel_desc_t *desc)
return(1);
}
#define CHANNEL_SSE
//#define CHANNEL_SSE
//#define __AVX2__
#ifdef CHANNEL_SSE
void multipath_channel(channel_desc_t *desc,
......@@ -417,8 +417,8 @@ void multipath_channel_freq(channel_desc_t *desc,
ofdm_symbol_size=length/PHY_vars_UE_g[UE_id][CC_id]->frame_parms.symbols_per_tti;
symbols_per_tti=length/PHY_vars_UE_g[UE_id][CC_id]->frame_parms.ofdm_symbol_size;
FILE *file;
file = fopen("multipath.txt","w");
//FILE *file;
//file = fopen("multipath.txt","w");
#ifdef DEBUG_CH
printf("[CHANNEL_FREQ] keep = %d : path_loss = %g (%f), nb_rx %d, nb_tx %d, dd %d, len %d \n",keep_channel,path_loss,desc->path_loss_dB,desc->nb_rx,desc->nb_tx,dd,desc->channel_length);
......@@ -741,7 +741,7 @@ void multipath_channel_freq_AVX_float(channel_desc_t *desc,
} // f,f2,f3
//}//k
}
#ifdef CHANNEL_SSE
//#ifdef CHANNEL_SSE
void multipath_channel_prach(channel_desc_t *desc,
double *tx_sig_re[2],
double *tx_sig_im[2],
......@@ -809,8 +809,8 @@ void multipath_channel_prach(channel_desc_t *desc,
} // ii
} // f
}
#else
void multipath_channel_prach(channel_desc_t *desc,
//#else
/*void multipath_channel_prach(channel_desc_t *desc,
double *tx_sig_re[2],
double *tx_sig_im[2],
double *rx_sig_re[2],
......@@ -858,7 +858,7 @@ void multipath_channel_prach(channel_desc_t *desc,
} // ii
} // f
}
#endif
#endif*/
void multipath_channel_prach_SSE_float(channel_desc_t *desc,
float *tx_sig_re[2],
float *tx_sig_im[2],
......
......@@ -139,7 +139,7 @@ eNBs =
////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.12.11";
mme_ip_address = ( { ipv4 = "192.168.13.11";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
......@@ -149,18 +149,18 @@ eNBs =
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth3";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth3";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24";
ENB_INTERFACE_NAME_FOR_S1_MME = "lo";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.170/24";
ENB_INTERFACE_NAME_FOR_S1U = "lo";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.170/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152
};
rrh_gw_config = (
{
local_if_name = "lo";
remote_address = "127.0.0.2";
local_address = "127.0.0.1";
remote_address = "192.168.12.171";
local_address = "192.168.12.170";
local_port = 50000; #for raw option local port must be the same to remote
remote_port = 50000;
rrh_gw_active = "yes";
......
This diff is collapsed.
......@@ -1486,26 +1486,38 @@ reset_opp_meas_oaisim (void)
reset_meas (&UE2eNB[UE_id][eNB_id][0]->convolution);
reset_meas (&UE2eNB[UE_id][eNB_id][0]->ziggurat);
reset_meas (&UE2eNB[UE_id][eNB_id][0]->ziggurat_PRACH);
reset_meas (&eNB2UE[eNB_id][UE_id][0]->DL_multipath_channel);
reset_meas (&UE2eNB[UE_id][eNB_id][0]->UL_multipath_channel);
reset_meas (&eNB2UE[eNB_id][UE_id][0]->DL_dac_fixed_gain);
reset_meas (&UE2eNB[UE_id][eNB_id][0]->UL_dac_fixed_gain);
reset_meas (&eNB2UE[eNB_id][UE_id][0]->DL_rf_rx_simple);
reset_meas (&UE2eNB[UE_id][eNB_id][0]->UL_rf_rx_simple);
reset_meas (&eNB2UE[eNB_id][UE_id][0]->DL_dac_fixed_gain);
reset_meas (&UE2eNB[UE_id][eNB_id][0]->UL_dac_fixed_gain);
reset_meas (&eNB2UE[eNB_id][UE_id][0]->DL_channel);
reset_meas (&UE2eNB[UE_id][eNB_id][0]->UL_channel);
//Time consuming in Frequency analysis
//Downlink
reset_meas (&eNB2UE[eNB_id][UE_id][0]->DL_multipath_channel_freq);
reset_meas (&eNB2UE[eNB_id][UE_id][0]->DL_dac_fixed_gain);
reset_meas (&eNB2UE[eNB_id][UE_id][0]->DL_dac_fixed_gain_freq);
reset_meas (&eNB2UE[eNB_id][UE_id][0]->DL_rf_rx_simple_freq);
reset_meas (&eNB2UE[eNB_id][UE_id][0]->DL_adc);
reset_meas (&eNB2UE[eNB_id][UE_id][0]->DL_adc_freq);
//Uplink
reset_meas (&UE2eNB[UE_id][eNB_id][0]->UL_multipath_channel_freq);
reset_meas (&UE2eNB[UE_id][eNB_id][0]->UL_dac_fixed_gain);
reset_meas (&UE2eNB[UE_id][eNB_id][0]->UL_dac_fixed_gain_freq);
reset_meas (&UE2eNB[UE_id][eNB_id][0]->UL_rf_rx_simple_freq);
reset_meas (&UE2eNB[UE_id][eNB_id][0]->UL_adc);
reset_meas (&UE2eNB[UE_id][eNB_id][0]->UL_adc_freq);
//PRACH
reset_meas (&UE2eNB[UE_id][eNB_id][0]->multipath_channel_freq_PRACH);
reset_meas (&UE2eNB[UE_id][eNB_id][0]->dac_fixed_gain_PRACH);
reset_meas (&UE2eNB[UE_id][eNB_id][0]->rf_rx_simple_freq_PRACH);
reset_meas (&UE2eNB[UE_id][eNB_id][0]->adc_PRACH);
//DL-UL Frequency Channel
reset_meas (&eNB2UE[eNB_id][UE_id][0]->DL_channel);
reset_meas (&UE2eNB[UE_id][eNB_id][0]->UL_channel);
reset_meas (&UE2eNB[UE_id][eNB_id][0]->UL_PRACH_channel);
reset_meas (&eNB2UE[eNB_id][UE_id][0]->DL_channel_freq);
reset_meas (&UE2eNB[UE_id][eNB_id][0]->UL_channel_freq);
reset_meas (&UE2eNB[UE_id][eNB_id][0]->UL_PRACH_channel_freq);
}
reset_meas (&PHY_vars_eNB_g[eNB_id][0]->phy_proc);
......@@ -1611,43 +1623,64 @@ print_opp_meas_oaisim (void)
"[UL][ziggurat]", &oaisim_stats, &oaisim_stats_f);
print_meas (&UE2eNB[UE_id][eNB_id][0]->ziggurat_PRACH,
"[UL][ziggurat]", &oaisim_stats, &oaisim_stats_f);
print_meas (&eNB2UE[eNB_id][UE_id][0]->DL_multipath_channel,
"[DL][multipath_channel]", &oaisim_stats, &oaisim_stats_f);
print_meas (&UE2eNB[UE_id][eNB_id][0]->UL_multipath_channel,
"[UL][multipath_channel]", &oaisim_stats, &oaisim_stats_f);
print_meas (&eNB2UE[eNB_id][UE_id][0]->DL_dac_fixed_gain,
"[DL][dac_fixed_gain]", &oaisim_stats, &oaisim_stats_f);
print_meas (&UE2eNB[UE_id][eNB_id][0]->UL_dac_fixed_gain,
"[UL][dac_fixed_gain]", &oaisim_stats, &oaisim_stats_f);
print_meas (&eNB2UE[eNB_id][UE_id][0]->DL_rf_rx_simple,
"[DL][rf_rx_simple]", &oaisim_stats, &oaisim_stats_f);
print_meas (&UE2eNB[UE_id][eNB_id][0]->UL_rf_rx_simple,
"[UL][rf_rx_simple]", &oaisim_stats, &oaisim_stats_f);
print_meas (&eNB2UE[eNB_id][UE_id][0]->DL_adc,
"[DL][adc]", &oaisim_stats, &oaisim_stats_f);
print_meas (&UE2eNB[UE_id][eNB_id][0]->UL_adc,
"[UL][adc]", &oaisim_stats, &oaisim_stats_f);
print_meas (&UE2eNB[UE_id][eNB_id][0]->UL_channel,
"[UL_channel]", &oaisim_stats, &oaisim_stats_f);
print_meas (&eNB2UE[eNB_id][UE_id][0]->DL_channel,
"[DL_channel]", &oaisim_stats, &oaisim_stats_f);
//Time consuming in Frequency analysis
//Downlink
print_meas (&eNB2UE[eNB_id][UE_id][0]->DL_multipath_channel_freq,
"[DL][multipath_channel_freq]", &oaisim_stats, &oaisim_stats_f);
print_meas (&eNB2UE[eNB_id][UE_id][0]->DL_dac_fixed_gain,
"[DL][dac_fixed_gain]", &oaisim_stats, &oaisim_stats_f);
print_meas (&eNB2UE[eNB_id][UE_id][0]->DL_dac_fixed_gain_freq,
"[DL][dac_fixed_gain_freq]", &oaisim_stats, &oaisim_stats_f);
print_meas (&eNB2UE[eNB_id][UE_id][0]->DL_rf_rx_simple_freq,
"[DL][rf_rx_simple_freq]", &oaisim_stats, &oaisim_stats_f);
print_meas (&eNB2UE[eNB_id][UE_id][0]->DL_adc,
"[DL][adc]", &oaisim_stats, &oaisim_stats_f);
print_meas (&eNB2UE[eNB_id][UE_id][0]->DL_adc_freq,
"[DL][adc_freq]", &oaisim_stats, &oaisim_stats_f);
//Uplink
print_meas (&UE2eNB[UE_id][eNB_id][0]->UL_multipath_channel_freq,
"[UL][multipath_channel_freq]", &oaisim_stats, &oaisim_stats_f);
print_meas (&UE2eNB[UE_id][eNB_id][0]->UL_dac_fixed_gain,
"[UL][dac_fixed_gain]", &oaisim_stats, &oaisim_stats_f);
print_meas (&UE2eNB[UE_id][eNB_id][0]->UL_dac_fixed_gain_freq,
"[UL][dac_fixed_gain_freq]", &oaisim_stats, &oaisim_stats_f);
print_meas (&UE2eNB[UE_id][eNB_id][0]->UL_rf_rx_simple_freq,
"[UL][rf_rx_simple_freq]", &oaisim_stats, &oaisim_stats_f);
print_meas (&UE2eNB[UE_id][eNB_id][0]->UL_adc,
"[UL][adc]", &oaisim_stats, &oaisim_stats_f);
print_meas (&UE2eNB[UE_id][eNB_id][0]->UL_adc_freq,
"[UL][adc_freq]", &oaisim_stats, &oaisim_stats_f);
//PRACH
print_meas (&UE2eNB[UE_id][eNB_id][0]->multipath_channel_freq_PRACH,
"[UL_PRACH][multipath_channel_freq]", &oaisim_stats, &oaisim_stats_f);
print_meas (&UE2eNB[UE_id][eNB_id][0]->dac_fixed_gain_PRACH,
"[UL_PRACH][dac_fixed_gain]", &oaisim_stats, &oaisim_stats_f);
"[UL_PRACH][dac_fixed_gain_freq]", &oaisim_stats, &oaisim_stats_f);
print_meas (&UE2eNB[UE_id][eNB_id][0]->rf_rx_simple_freq_PRACH,
"[UL_PRACH][rf_rx_simple_freq]", &oaisim_stats, &oaisim_stats_f);
print_meas (&UE2eNB[UE_id][eNB_id][0]->adc_PRACH,
"[UL_PRACH][adc]", &oaisim_stats, &oaisim_stats_f);
"[UL_PRACH][adc_freq]", &oaisim_stats, &oaisim_stats_f);
//Dl/UL Frequency Channel
print_meas (&UE2eNB[UE_id][eNB_id][0]->UL_channel,
"[UL_channel]", &oaisim_stats, &oaisim_stats_f);
print_meas (&UE2eNB[UE_id][eNB_id][0]->UL_PRACH_channel,
"[UL_PRACH_channel]", &oaisim_stats, &oaisim_stats_f);
print_meas (&eNB2UE[eNB_id][UE_id][0]->DL_channel,
"[DL_channel]", &oaisim_stats, &oaisim_stats_f);
print_meas (&UE2eNB[UE_id][eNB_id][0]->UL_channel_freq,
"[UL_channel_freq]", &oaisim_stats, &oaisim_stats_f);
print_meas (&UE2eNB[UE_id][eNB_id][0]->UL_PRACH_channel_freq,
"[UL_PRACH_channel_freq]", &oaisim_stats, &oaisim_stats_f);
print_meas (&eNB2UE[eNB_id][UE_id][0]->DL_channel_freq,
"[DL_channel_freq]", &oaisim_stats, &oaisim_stats_f);
}
}
......
......@@ -1127,7 +1127,7 @@ int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void *
{
//clock_t start=clock();
printf("subframe UL PRACH: %d\n",subframe);
start_meas(&UE2eNB[UE_id][eNB_id][CC_id]->UL_PRACH_channel);
start_meas(&UE2eNB[UE_id][eNB_id][CC_id]->UL_PRACH_channel_freq);
do_UL_sig_freq_prach(UE2eNB,
enb_data,
ue_data,
......@@ -1137,7 +1137,7 @@ int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void *
0, // frame is only used for abstraction
eNB_id,
CC_id);
stop_meas(&UE2eNB[UE_id][eNB_id][CC_id]->UL_PRACH_channel);
stop_meas(&UE2eNB[UE_id][eNB_id][CC_id]->UL_PRACH_channel_freq);
//clock_t stop=clock();
/*printf("do_DL_sig time_prach is %f s, AVERAGE time is %f s, count %d, sum %e\n",(float) (stop-start)/CLOCKS_PER_SEC,(float) (sum+stop-start)/(count1*CLOCKS_PER_SEC),count1,sum+stop-start);
sum=(sum+stop-start);
......@@ -1146,7 +1146,7 @@ int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void *
break;
}
}
start_meas(&UE2eNB[0][eNB_id][CC_id]->UL_channel);
start_meas(&UE2eNB[0][eNB_id][CC_id]->UL_channel_freq);
do_UL_sig_freq(UE2eNB,
enb_data,
ue_data,
......@@ -1156,10 +1156,11 @@ int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void *
0, // frame is only used for abstraction
eNB_id,
CC_id);
stop_meas(&UE2eNB[0][eNB_id][CC_id]->UL_channel);
stop_meas(&UE2eNB[0][eNB_id][CC_id]->UL_channel_freq);
}
else
{
start_meas(&UE2eNB[0][eNB_id][CC_id]->UL_channel);
do_UL_sig(UE2eNB,
enb_data,
ue_data,
......@@ -1169,6 +1170,7 @@ int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void *
0, // frame is only used for abstraction
eNB_id,
CC_id);
stop_meas(&UE2eNB[0][eNB_id][CC_id]->UL_channel);
}
last_eNB_rx_timestamp[eNB_id][CC_id] = last;
......@@ -1248,7 +1250,7 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
(unsigned long long)current_UE_rx_timestamp[UE_id][CC_id]);
if (do_ofdm_mod)
{
start_meas(&eNB2UE[0][UE_id][CC_id]->DL_channel);
start_meas(&eNB2UE[0][UE_id][CC_id]->DL_channel_freq);
//clock_t start=clock();
do_DL_sig_freq(eNB2UE,
enb_data,
......@@ -1258,7 +1260,7 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
&PHY_vars_UE_g[UE_id][CC_id]->frame_parms,
UE_id,
CC_id);
stop_meas(&eNB2UE[0][UE_id][CC_id]->DL_channel);
stop_meas(&eNB2UE[0][UE_id][CC_id]->DL_channel_freq);
/*clock_t stop=clock();
printf("do_DL_sig time is %f s, AVERAGE time is %f s, count %d, sum %e\n",(float) (stop-start)/CLOCKS_PER_SEC,(float) (sum+stop-start)/(count*CLOCKS_PER_SEC),count,sum+stop-start);
sum=(sum+stop-start);
......@@ -1269,6 +1271,7 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
else
{
//clock_t start=clock();
start_meas(&eNB2UE[0][UE_id][CC_id]->DL_channel);
do_DL_sig(eNB2UE,
enb_data,
ue_data,
......@@ -1277,6 +1280,7 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
&PHY_vars_UE_g[UE_id][CC_id]->frame_parms,
UE_id,
CC_id);
stop_meas(&eNB2UE[0][UE_id][CC_id]->DL_channel);
/*clock_t stop=clock();
printf("do_DL_sig time is %f s, AVERAGE time is %f s, count %d, sum %e\n",(float) (stop-start)/CLOCKS_PER_SEC,(float) (sum+stop-start)/(count*CLOCKS_PER_SEC),count,sum+stop-start);
sum=(sum+stop-start);
......
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