Commit 0699a73d authored by lfarizav's avatar lfarizav

Testing AT commands

parent 626e627f
......@@ -1390,7 +1390,6 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
unsigned char is_secondary_eNB,
unsigned char abstraction_flag)
{
// shortcuts
LTE_DL_FRAME_PARMS* const fp = &eNB->frame_parms;
LTE_eNB_COMMON* const common_vars = &eNB->common_vars;
......
......@@ -63,6 +63,8 @@ void print_meas_now(time_stats_t *ts, const char* name, FILE* file_name){
void print_meas(time_stats_t *ts, const char* name, time_stats_t * total_exec_time, time_stats_t * sf_exec_time)
{
//printf("ts->trials is %d\n",ts->trials);
//printf("opp_enabled %d\n",opp_enabled);
//printf("ts->trials %d, ts->diff %d,cpu_freq_GHz %e,sf_exec_time->trials %d, sf_exec_time->diff %d, total_exec_time->diff %d\n",ts->trials,ts->diff,cpu_freq_GHz,sf_exec_time->trials,sf_exec_time->diff,total_exec_time->diff);
if (opp_enabled) {
static int first_time = 0;
......@@ -90,15 +92,6 @@ void print_meas(time_stats_t *ts, const char* name, time_stats_t * total_exec_ti
(ts->diff/ts->trials/cpu_freq_GHz/1000.0),
ts->trials);
} else {
if (PHY_vars_UE_g[0][0]->do_ofdm_mod)
fprintf(stderr, "%25s: %15.3f us (%5.2f%%); %15.3f us (%5.2f%%); %15d;\n",
name,
(ts->diff_now/cpu_freq_GHz/1000.0),
((ts->diff_now/cpu_freq_GHz/1000.0)/(total_exec_time->diff/cpu_freq_GHz/1000.0))*100, // percentage
(ts->diff/ts->trials/cpu_freq_GHz/1000.0),
((ts->diff/ts->trials/cpu_freq_GHz/1000.0)/(sf_exec_time->diff/sf_exec_time->trials/cpu_freq_GHz/1000.0))*100, // percentage
ts->trials);
else
fprintf(stderr, "%25s: %15.3f ms (%5.2f%%); %15.3f us (%5.2f%%); %15d;\n",
name,
(ts->diff/cpu_freq_GHz/1000000.0),
......
......@@ -2430,7 +2430,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui
uint8_t next1_thread_id = current_thread_id[proc->subframe_rx]== (RX_NB_TH-1) ? 0:(current_thread_id[proc->subframe_rx]+1);
uint8_t next2_thread_id = next1_thread_id== (RX_NB_TH-1) ? 0:(next1_thread_id+1);
start_meas(&ue->phy_proc_tx);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX,VCD_FUNCTION_IN);
LOG_D(PHY,"****** start TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, subframe_tx);
......@@ -2599,6 +2599,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui
/*clock_t stop=clock();
printf("UE_TX time is %f s, AVERAGE UE_TX time is %f s, frame %d, subframe %d, count %d, sum %e\n",(float) (stop-start)/CLOCKS_PER_SEC,(float) (sum+stop-start)/(count*CLOCKS_PER_SEC),frame_tx,subframe_tx,count,sum+stop-start);
sum=(sum+stop-start);*/
stop_meas(&ue->phy_proc_tx);
}
void phy_procedures_UE_S_TX(PHY_VARS_UE *ue,uint8_t eNB_id,uint8_t abstraction_flag,relaying_type_t r_type)
......@@ -5125,7 +5126,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,
uint8_t next1_thread_id = ue->current_thread_id[subframe_rx]== (RX_NB_TH-1) ? 0:(ue->current_thread_id[subframe_rx]+1);
uint8_t next2_thread_id = next1_thread_id== (RX_NB_TH-1) ? 0:(next1_thread_id+1);
start_meas(&ue->phy_proc_rx[ue->current_thread_id[subframe_rx]]);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_IN);
#if T_TRACER
......@@ -5275,6 +5276,7 @@ else
// first slot has been processed (FFTs + Channel Estimation, PCFICH/PHICH/PDCCH)
#if UE_TIMING_TRACE
printf("ue timing trace is activated\n")
stop_meas(&ue->generic_stat);
#if DISABLE_LOG_X
printf("[SFN %d] Slot0: FFT + Channel Estimate + PCFICH/PHICH/PDCCH %5.2f \n",subframe_rx,ue->generic_stat.p_time/(cpuf*1000.0));
......@@ -5631,7 +5633,7 @@ else
/*clock_t stop=clock();
printf("UE_RX time is %f s, AVERAGE UE_RX time is %f s, frame %d, subframe %d, count %d, sum %e\n",(float) (stop-start)/CLOCKS_PER_SEC,(float) (sum+stop-start)/(count*CLOCKS_PER_SEC),frame_rx,subframe_rx,count,sum+stop-start);
sum=(sum+stop-start);*/
stop_meas(&ue->phy_proc_rx[ue->current_thread_id[subframe_rx]]);
return (0);
}
......
......@@ -536,8 +536,8 @@ clock_t start=clock();*/
//gauss_0_128_sqrt_NOW = _mm_set_ps(ziggurat(0.0,1.0),ziggurat(0.0,1.0),ziggurat(0.0,1.0),ziggurat(0.0,1.0));
//gauss_1_128_sqrt_NOW = _mm_set_ps(ziggurat(0.0,1.0),ziggurat(0.0,1.0),ziggurat(0.0,1.0),ziggurat(0.0,1.0));
boxmuller_AVX_float(&gauss_0_256_sqrt_NOW, &gauss_1_256_sqrt_NOW);
//gauss_0_256_sqrt_NOW = ziggurat_SSE_float();
//gauss_1_256_sqrt_NOW = ziggurat_SSE_float();
//gauss_0_256_sqrt_NOW = ziggurat_AVX_float();
//gauss_1_256_sqrt_NOW = ziggurat_AVX_float();
//stop_meas(&desc->ziggurat);
gauss_0_256_sqrt_NOW = _mm256_mul_ps(gauss_0_256_sqrt_NOW,_mm256_set1_ps(sqrt_NOW));
gauss_1_256_sqrt_NOW = _mm256_mul_ps(gauss_1_256_sqrt_NOW,_mm256_set1_ps(sqrt_NOW));
......
......@@ -518,6 +518,7 @@ double uniformrandom(void);
void uniformrandomSSE(__m128d *d1,__m128d *d2);
double ziggurat(double mean, double variance);
__m128 ziggurat_SSE_float(void);
__m256 ziggurat_AVX_float(void);
void boxmuller_SSE_float(__m128 *data1, __m128 *data2);
void boxmuller_AVX_float(__m256 *data1, __m256 *data2);
int freq_channel(channel_desc_t *desc,uint16_t nb_rb, int16_t n_samples);
......
......@@ -106,7 +106,7 @@ int emm_sap_send(nas_user_t *user, emm_sap_t *msg)
emm_primitive_t primitive = msg->primitive;
LOG_FUNC_IN;
//printf("emm_sap_send\n");
/* Check the EMM-SAP primitive */
if ( (primitive > (emm_primitive_t)EMMREG_PRIMITIVE_MIN) &&
(primitive < (emm_primitive_t)EMMREG_PRIMITIVE_MAX) ) {
......
......@@ -573,7 +573,7 @@ int nas_proc_detach(nas_user_t *user, int switch_off)
emm_sap_t emm_sap;
int rc = RETURNok;
printf("detaching UE\n");
if ( emm_main_is_attached(user->emm_data) ) {
/* Initiate an Detach procedure */
emm_sap.primitive = EMMREG_DETACH_INIT;
......@@ -604,7 +604,7 @@ int nas_proc_attach(nas_user_t *user)
emm_sap_t emm_sap;
int rc = RETURNok;
printf("attaching UE\n");
if ( !emm_main_is_attached(user->emm_data) ) {
/* Initiate an Attach procedure */
emm_sap.primitive = EMMREG_ATTACH_INIT;
......
......@@ -36,7 +36,7 @@
#include "nas_user.h"
// FIXME make command line option for NAS_UE_AUTOSTART
# define NAS_UE_AUTOSTART 1
# define NAS_UE_AUTOSTART 0
// FIXME review these externs
extern unsigned char NB_eNB_INST;
......@@ -167,6 +167,11 @@ void *nas_ue_task(void *args_p)
nas_user_receive_and_process (user, user_data);
}
#else
{
//nas_user_receive_and_process (user, "AT+CPIN=0000\r");
nas_proc_enable_s1_mode(user);
}
#endif
break;
......
......@@ -276,6 +276,25 @@ int nas_user_receive_and_process(nas_user_t *user, char *message)
LOG_FUNC_RETURN(FALSE);
}
/****************************************************************************
** **
** Name: nas_user_receive_and_process_oaisim() **
** **
** Description: Receives and process messages from user application **
** **
** Inputs: fd: File descriptor of the connection endpoint **
** from which data have been received **
** Others: None **
** **
** Outputs: Return: FALSE, TRUE **
** **
***************************************************************************/
int nas_user_receive_and_process_oaisim(void)
{
LOG_FUNC_IN;
LOG_FUNC_RETURN(FALSE);
}
/****************************************************************************
** **
** Name: nas_user_process_data() **
......@@ -698,7 +717,6 @@ static int _nas_user_proc_cfun(nas_user_t *user, const at_command_t *data)
/* Set to the selected parameter value */
fun = data->command.cfun.fun;
}
switch (fun) {
case AT_CFUN_MIN:
/* TODO: Shutdown ??? */
......@@ -1270,6 +1288,7 @@ static int _nas_user_proc_cgatt(nas_user_t *user, const at_command_t *data)
}
if (ret_code != RETURNok) {
printf ("ret_code = %d\n",ret_code);
LOG_TRACE(ERROR, "USR-MAIN - Failed to attach/detach "
"to/from EPS service (<state>=%d)",
data->command.cgatt.state);
......
......@@ -64,6 +64,7 @@ void nas_user_initialize(nas_user_t *user, emm_indication_callback_t emm_cb,
esm_indication_callback_t esm_cb, const char *version);
int nas_user_receive_and_process(nas_user_t *user, char *message);
int nas_user_receive_and_process_oaisim(void);
int nas_user_process_data(nas_user_t *user, const void *data);
......
......@@ -136,7 +136,7 @@ eNBs =
};
////////// MME parameters:
mme_ip_address = ( { ipv4 = "127.0.0.3";
mme_ip_address = ( { ipv4 = "192.168.13.11";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
......@@ -145,11 +145,11 @@ eNBs =
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "lo";
ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24";
ENB_INTERFACE_NAME_FOR_S1_MME = "eno2";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.13.10/24";
ENB_INTERFACE_NAME_FOR_S1U = "lo";
ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.5/24";
ENB_INTERFACE_NAME_FOR_S1U = "eno2";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.13.10/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152
};
......
......@@ -414,6 +414,7 @@ void do_DL_sig_freq(channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][
uint8_t eNB_id=0;
#ifdef __AVX2__
float tx_pwr;
//printf ("AVX2 instruction set activated\n");
#else
double tx_pwr;
#endif
......
......@@ -1412,6 +1412,9 @@ reset_opp_meas_oaisim (void)
reset_meas (&dl_chan_stats);
reset_meas (&ul_chan_stats);
// init time stats here (UE and eNB RX-TX)
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
reset_meas (&PHY_vars_UE_g[UE_id][0]->phy_proc[0]);
reset_meas (&PHY_vars_UE_g[UE_id][0]->phy_proc[1]);
......@@ -1694,6 +1697,8 @@ print_opp_meas_oaisim (void)
"[UE][total_phy_proc_rx[0]]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_UE_g[UE_id][0]->phy_proc_rx[1],
"[UE][total_phy_proc_rx[1]]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_UE_g[UE_id][0]->phy_proc_tx,
"[UE][total_phy_proc_tx]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_UE_g[UE_id][0]->ofdm_demod_stats,
"[UE][ofdm_demod]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_UE_g[UE_id][0]->rx_dft_stats, "[UE][rx_dft]",
......@@ -1773,8 +1778,8 @@ print_opp_meas_oaisim (void)
print_meas (&PHY_vars_eNB_g[eNB_id][0]->dlsch_turbo_encoding_stats,
"[eNB][|_turbo_encoding]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_eNB_g[eNB_id][0]->phy_proc_rx,
"[eNB][total_phy_proc_rx]", &oaisim_stats, &oaisim_stats_f);
//print_meas (&PHY_vars_eNB_g[eNB_id][0]->phy_proc_rx,
// "[eNB][total_phy_proc_rx]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_eNB_g[eNB_id][0]->ofdm_demod_stats,
"[eNB][ofdm_demod]", &oaisim_stats, &oaisim_stats_f);
//print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_channel_estimation_stats,"[eNB][channel_est]");
......
......@@ -84,6 +84,10 @@ void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, frame_t frame, uint16_t ne
void reset_opp_meas(void);
void print_opp_meas(void);
void reset_opp_meas_oaisim (void);
void print_opp_meas_oaisim (void);
#ifdef OPENAIR2
int omv_write (int pfd, node_list* enb_node_list, node_list* ue_node_list, Data_Flow_Unit omv_data);
void omv_end (int pfd, Data_Flow_Unit omv_data);
......
......@@ -1005,6 +1005,7 @@ openair0_timestamp current_UE_rx_timestamp[NUMBER_OF_UE_MAX][MAX_NUM_CCs];
openair0_timestamp last_eNB_rx_timestamp[NUMBER_OF_eNB_MAX][MAX_NUM_CCs];
openair0_timestamp last_UE_rx_timestamp[NUMBER_OF_UE_MAX][MAX_NUM_CCs];
static int first_run=0;
static int count=0;
int eNB_trx_start(openair0_device *device) {
return(0);
}
......@@ -1043,11 +1044,9 @@ extern int subframe_eNB_mask,subframe_UE_mask;
int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc)
{
static int count;
if (!first_run)
{
first_run=1;
count=0;
}
if (count==500)
{
......
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