[GITLAB] - UPGRADE TO v12 on Wednesday the 18th of December at 11.30AM

Commit fa8b42c0 authored by knopp's avatar knopp

debugging of --siml1

parent 16b7faaa
......@@ -2014,7 +2014,7 @@ target_link_libraries (lte-uesoftmodem ${T_LIB})
add_executable(lte-uesoftmodem-nos1
${rrc_h}
${s1ap_h}
# ${OPENAIR_BIN_DIR}/messages_xml.h
${OPENAIR_BIN_DIR}/messages_xml.h
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.c
......
......@@ -709,6 +709,7 @@ int init_lte_ue_signal(PHY_VARS_UE *ue,
for (i=0; i<fp->nb_antennas_rx; i++) {
common_vars->rxdata[i] = (int32_t*) malloc16_clear( (fp->samples_per_tti*10+2048)*sizeof(int32_t) );
LOG_I(PHY,"common_vars->rxdata[%d] %p\n",i,common_vars->rxdata[i]);
common_vars->common_vars_rx_data_per_thread[0].rxdataF[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->ofdm_symbol_size*14) );
common_vars->common_vars_rx_data_per_thread[1].rxdataF[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->ofdm_symbol_size*14) );
}
......
......@@ -986,7 +986,7 @@ typedef uint8_t(*encoder_if_t)(uint8_t *input,
static inline void wait_sync(char *thread_name) {
printf( "waiting for sync (%s)\n",thread_name);
printf( "waiting for sync (%s,%p,%p,%p)\n",thread_name,&sync_var,&sync_cond,&sync_mutex);
pthread_mutex_lock( &sync_mutex );
while (sync_var<0)
......
......@@ -1644,7 +1644,7 @@ static void* ru_thread( void* param ) {
// wakeup all eNB processes waiting for this RU
if (ru->num_eNB>0) wakeup_eNBs(ru);
if(get_nprocs() <= 4){
if(get_nprocs() <= 4 || ru->num_eNB==0){
// do TX front-end processing if needed (precoding and/or IDFTs)
if (ru->feptx_prec) ru->feptx_prec(ru);
......
......@@ -154,7 +154,8 @@ static char *itti_dump_file = NULL;
int UE_scan = 1;
int UE_scan_carrier = 0;
runmode_t mode = normal_txrx;
int simL1flag;
int snr_dB;
FILE *input_fd=NULL;
......
......@@ -81,6 +81,7 @@
#define CONFIG_HLP_MSLOTS "Skip the missed slots/subframes \n"
#define CONFIG_HLP_ULMCS "Set the maximum uplink MCS\n"
#define CONFIG_HLP_TDD "Set hardware to TDD mode (default: FDD). Used only with -U (otherwise set in config file).\n"
#define CONFIG_HLP_SNR "Set average SNR in dB (for --siml1 option)\n"
#define CONFIG_HLP_UE "Set the lte softmodem as a UE\n"
#define CONFIG_HLP_L2MONW "Enable L2 wireshark messages on localhost \n"
#define CONFIG_HLP_L2MONP "Enable L2 pcap messages on localhost \n"
......@@ -183,6 +184,7 @@
{"q" , CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \
{"S" , CONFIG_HLP_MSLOTS, PARAMFLAG_BOOL, u8ptr:&exit_missed_slots, defintval:1, TYPE_UINT8, 0}, \
{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \
{"s" , CONFIG_HLP_SNR, PARAMFLAG_BOOL, iptr:&snr_dB, defintval:15, TYPE_INT, 0}, \
{"numerology" , CONFIG_HLP_NUMEROLOGY, PARAMFLAG_BOOL, iptr:&numerology, defintval:0, TYPE_INT, 0}, \
{"emulate-rf" , CONFIG_HLP_EMULATE_RF, PARAMFLAG_BOOL, iptr:&emulate_rf, defintval:0, TYPE_INT, 0}, \
{"codingw" , CONFIG_HLP_CODINGW, PARAMFLAG_BOOL, iptr:&codingw, defintval:0, TYPE_INT, 0}, \
......
......@@ -254,8 +254,18 @@ void init_UE(int nb_inst,int eMBMS_active, int uecap_xer_in, int timing_correcti
for (inst=0;inst<nb_inst;inst++) {
if (PHY_vars_UE_g[inst]==NULL) PHY_vars_UE_g[inst] = (PHY_VARS_UE**)calloc(1+MAX_NUM_CCs,sizeof(PHY_VARS_UE*));
if (simL1flag == 0) PHY_vars_UE_g[inst][0] = init_ue_vars(NULL,inst,0);
else PHY_vars_UE_g[inst][0] = init_ue_vars(&RC.ru[0]->frame_parms,inst,0);
else {
RC.ru[0]->frame_parms.nb_antennas_rx = nb_rx;
RC.ru[0]->frame_parms.nb_antennas_tx = nb_tx;
RC.ru[0]->frame_parms.frame_type = FDD;
RC.ru[0]->frame_parms.tdd_config = 3;
RC.ru[0]->frame_parms.tdd_config_S = 0;
PHY_vars_UE_g[inst][0] = init_ue_vars(&RC.ru[0]->frame_parms,inst,0);
}
// turn off timing control loop in UE
PHY_vars_UE_g[inst][0]->no_timing_correction = timing_correction;
......@@ -1476,8 +1486,7 @@ void *UE_thread(void *arg) {
pthread_mutex_unlock(&sync_mutex);
*/
wait_sync("UE thread\n");
LOG_I(PHY,"UE_thread Got sync\n");
wait_sync("UE thread");
#ifdef NAS_UE
MessageDef *message_p;
message_p = itti_alloc_new_message(TASK_NAS_UE, INITIALIZE_MESSAGE);
......
......@@ -157,6 +157,8 @@ static char *itti_dump_file = NULL;
int UE_scan = 1;
int UE_scan_carrier = 0;
int simL1flag = 0;
int snr_dB=15;
runmode_t mode = normal_txrx;
FILE *input_fd=NULL;
......@@ -870,6 +872,9 @@ int main( int argc, char **argv )
log_set_instance_type (LOG_INSTANCE_UE);
pthread_cond_init(&sync_cond,NULL);
pthread_mutex_init(&sync_mutex, NULL);
printf("ITTI init\n");
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, itti_dump_file);
......@@ -1052,8 +1057,6 @@ int main( int argc, char **argv )
mlockall(MCL_CURRENT | MCL_FUTURE);
pthread_cond_init(&sync_cond,NULL);
pthread_mutex_init(&sync_mutex, NULL);
#ifdef XFORMS
int UE_id;
......@@ -1144,19 +1147,19 @@ int main( int argc, char **argv )
}
//p_exmimo_config->framing.tdd_config = TXRXSWITCH_TESTRX;
if (simL1flag==1) init_ocm();
if (simL1flag==1) init_ocm((double)snr_dB,0);
printf("Sending sync to all threads\n");
printf("Sending sync to all threads (%p,%p,%p)\n",&sync_var,&sync_mutex,&sync_cond);
pthread_mutex_lock(&sync_mutex);
sync_var=0;
pthread_cond_broadcast(&sync_cond);
pthread_mutex_unlock(&sync_mutex);
/*
printf("About to call end_configmodule() from %s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__);
end_configmodule();
printf("Called end_configmodule() from %s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__);
*/
// wait for end of program
printf("TYPE <CTRL-C> TO TERMINATE\n");
//getchar();
......
......@@ -151,7 +151,7 @@ void RCConfig_sim(void) {
init_ru_devices();
int nframes = 100000;
static int nframes = 100000;
AssertFatal(0 == pthread_create(&rfsim_thread,
NULL,
......@@ -223,7 +223,8 @@ int ru_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
usleep(500);
}
subframe = (last_ru_rx_timestamp[ru_id][CC_id]/RC.ru[ru_id]->frame_parms.samples_per_tti)%10;
if (subframe_select(&RC.ru[ru_id]->frame_parms,subframe) != SF_DL || RC.ru[ru_id]->frame_parms.frame_type == FDD) {
LOG_D(SIM,"RU_trx_read generating UL subframe %d (Ts %llu, current TS %llu)\n",
......@@ -373,7 +374,7 @@ void init_ru_devices(){
if (RC.ru==NULL) RC.ru = (RU_t**)malloc(RC.nb_RU*sizeof(RU_t*));
for (ru_id=0;ru_id<RC.nb_RU;ru_id++) {
LOG_I(SIM,"Initiaizing rfdevice for RU %d\n",ru_id);
LOG_D(SIM,"Initiaizing rfdevice for RU %d\n",ru_id);
if (RC.ru[ru_id]==NULL) RC.ru[ru_id] = (RU_t*)malloc(sizeof(RU_t));
ru = RC.ru[ru_id];
ru->rfdevice.Mod_id = ru_id;
......@@ -530,13 +531,11 @@ void init_channel_vars(void)
void rfsim_top(void *n_frames) {
LOG_I(PHY,"rfsim_top: Waiting for sync\n");
while (sync_var<0)
pthread_cond_wait(&sync_cond, &sync_mutex);
pthread_mutex_unlock(&sync_mutex);
wait_sync("rfsim_top");
printf("Running rfsim with %d frames\n",*(int*)n_frames);
for (int frame = 0;
frame < *(int*)n_frames;
frame++) {
......@@ -544,10 +543,10 @@ void rfsim_top(void *n_frames) {
for (int sf = 0; sf < 10; sf++) {
int CC_id=0;
int all_done=0;
printf("Running %d.%d\n",frame,sf);
while (all_done==0) {
pthread_mutex_lock(&subframe_mutex);
int subframe_ru_mask_local = (subframe_select(&RC.ru[0]->frame_parms,(sf+4)%10)!=SF_UL) ? subframe_ru_mask : ((1<<RC.nb_RU)-1);
int subframe_UE_mask_local = (RC.ru[0]->frame_parms.frame_type == FDD || subframe_select(&RC.ru[0]->frame_parms,(sf+4)%10)!=SF_DL) ? subframe_UE_mask : ((1<<NB_UE_INST)-1);
pthread_mutex_unlock(&subframe_mutex);
......
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