Commit a64e7eef authored by Raymond Knopp's avatar Raymond Knopp

tested compilation and execution with --simL1 and --rfsim.

parent ed08f3ab
...@@ -1240,12 +1240,12 @@ set(PHY_SRC ...@@ -1240,12 +1240,12 @@ set(PHY_SRC
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pcfich.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pcfich.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pucch.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pucch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pmch.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pmch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/ulsch_demodulation.c # ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/ulsch_demodulation.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/ulsch_decoding.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/ulsch_decoding.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/rar_tools.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/rar_tools.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/uci_tools.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/uci_tools.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/freq_equalization.c # ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/freq_equalization.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_adjust_sync_eNB.c # ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_adjust_sync_eNB.c
# ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c # ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_eNB_measurements.c ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_eNB_measurements.c
${OPENAIR1_DIR}/PHY/INIT/lte_init.c ${OPENAIR1_DIR}/PHY/INIT/lte_init.c
...@@ -1255,7 +1255,10 @@ set(PHY_SRC_RU ...@@ -1255,7 +1255,10 @@ set(PHY_SRC_RU
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/if4_tools.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/if4_tools.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/if5_tools.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/if5_tools.c
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/drs_modulation.c ${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/drs_modulation.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/ulsch_demodulation.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_adjust_sync_eNB.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/freq_equalization.c
${OPENAIR1_DIR}/PHY/MODULATION/slot_fep_ul.c ${OPENAIR1_DIR}/PHY/MODULATION/slot_fep_ul.c
${OPENAIR1_DIR}/PHY/MODULATION/ul_7_5_kHz.c ${OPENAIR1_DIR}/PHY/MODULATION/ul_7_5_kHz.c
${OPENAIR1_DIR}/PHY/MODULATION/gen_75KHz.cpp ${OPENAIR1_DIR}/PHY/MODULATION/gen_75KHz.cpp
......
...@@ -869,7 +869,7 @@ int rx_pdsch(PHY_VARS_UE *ue, ...@@ -869,7 +869,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
pdsch_vars[eNB_id]->llr_offset[symbol], pdsch_vars[eNB_id]->llr_offset[symbol],
(int16_t*)pdsch_vars[eNB_id]->llr[0], (int16_t*)pdsch_vars[eNB_id]->llr[0],
pllr_symbol_cw0); pllr_symbol_cw0);
*/
switch (dlsch0_harq->Qm) { switch (dlsch0_harq->Qm) {
case 2 : case 2 :
if ((rx_type==rx_standard) || (codeword_TB1 == -1)) { if ((rx_type==rx_standard) || (codeword_TB1 == -1)) {
......
...@@ -49,6 +49,8 @@ ...@@ -49,6 +49,8 @@
#include "PHY/LTE_TRANSPORT/if4_tools.h" #include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/LTE_TRANSPORT/if5_tools.h" #include "PHY/LTE_TRANSPORT/if5_tools.h"
#include "PHY/LTE_TRANSPORT/transport_common_proto.h" #include "PHY/LTE_TRANSPORT/transport_common_proto.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
#include "LAYER2/MAC/mac.h" #include "LAYER2/MAC/mac.h"
#include "common/utils/LOG/log.h" #include "common/utils/LOG/log.h"
......
...@@ -21,7 +21,7 @@ RUs = ( ...@@ -21,7 +21,7 @@ RUs = (
THREAD_STRUCT = ( THREAD_STRUCT = (
{ {
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT"; parallel_config = "PARALLEL_SINGLE_THREAD";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE"; worker_config = "WORKER_ENABLE";
} }
......
...@@ -624,28 +624,29 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) { ...@@ -624,28 +624,29 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) {
if (ru->fh_north_asynch_in == NULL) { if (ru->fh_north_asynch_in == NULL) {
#ifdef PHY_TX_THREAD #ifdef PHY_TX_THREAD
proc->timestamp_phy_tx = proc->timestamp_rx+((sf_ahead-1)*fp->samples_per_tti); proc->timestamp_phy_tx = proc->timestamp_rx+((sf_ahead-1)*fp->samples_per_tti);
proc->subframe_phy_tx = (proc->subframe_rx+(sf_ahead-1))%10; proc->subframe_phy_tx = (proc->subframe_rx+(sf_ahead-1))%10;
proc->frame_phy_tx = (proc->subframe_rx>(9-(sf_ahead-1))) ? (proc->frame_rx+1)&1023 : proc->frame_rx; proc->frame_phy_tx = (proc->subframe_rx>(9-(sf_ahead-1))) ? (proc->frame_rx+1)&1023 : proc->frame_rx;
#endif #endif
LOG_D(PHY,"RU %d/%d TS %llu (off %d), frame %d, subframe %d\n", LOG_D(PHY,"RU %d/%d TS %llu (off %d), frame %d, subframe %d\n",
ru->idx, ru->idx,
0, 0,
(unsigned long long int)proc->timestamp_rx, (unsigned long long int)proc->timestamp_rx,
(int)ru->ts_offset,proc->frame_rx,proc->subframe_rx); (int)ru->ts_offset,proc->frame_rx,proc->subframe_rx);
LOG_D(PHY,"south_in/rx_rf: RU %d/%d TS %llu (off %d), frame %d, subframe %d\n", LOG_D(PHY,"south_in/rx_rf: RU %d/%d TS %llu (off %d), frame %d, subframe %d\n",
ru->idx, ru->idx,
0, 0,
(unsigned long long int)proc->timestamp_rx, (unsigned long long int)proc->timestamp_rx,
(int)ru->ts_offset,proc->frame_rx,proc->subframe_rx); (int)ru->ts_offset,proc->frame_rx,proc->subframe_rx);
// dump VCD output for first RU in list // dump VCD output for first RU in list
if (ru == RC.ru[0]) { if (ru == RC.ru[0]) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_RU, proc->frame_rx ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_RU, proc->frame_rx );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_RU, proc->subframe_rx ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_RU, proc->subframe_rx );
if (ru->fh_north_asynch_in == NULL) { if (ru->fh_north_asynch_in == NULL) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, proc->frame_tx ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, proc->frame_tx );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_RU, proc->subframe_tx ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_RU, proc->subframe_tx );
}
} }
} }
......
...@@ -707,20 +707,20 @@ int main( int argc, char **argv ) { ...@@ -707,20 +707,20 @@ int main( int argc, char **argv ) {
#ifdef XFORMS #ifdef XFORMS
int UE_id; int UE_id;
printf("XFORMS\n"); printf("XFORMS\n");
if (get_softmodem_params()->do_forms==1) { if (get_softmodem_params()->do_forms==1) {
fl_initialize (&argc, argv, NULL, 0, 0); fl_initialize (&argc, argv, NULL, 0, 0);
form_stats_l2 = create_form_stats_form(); form_stats_l2 = create_form_stats_form();
fl_show_form (form_stats_l2->stats_form, FL_PLACE_HOTSPOT, FL_FULLBORDER, "l2 stats"); fl_show_form (form_stats_l2->stats_form, FL_PLACE_HOTSPOT, FL_FULLBORDER, "l2 stats");
form_stats = create_form_stats_form(); form_stats = create_form_stats_form();
fl_show_form (form_stats->stats_form, FL_PLACE_HOTSPOT, FL_FULLBORDER, "stats"); fl_show_form (form_stats->stats_form, FL_PLACE_HOTSPOT, FL_FULLBORDER, "stats");
for(UE_id=0; UE_id<scope_enb_num_ue; UE_id++) { for(UE_id=0; UE_id<scope_enb_num_ue; UE_id++) {
for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
form_enb[CC_id][UE_id] = create_lte_phy_scope_enb(); form_enb[CC_id][UE_id] = create_lte_phy_scope_enb();
sprintf (title, "LTE UL SCOPE eNB for CC_id %d, UE %d",CC_id,UE_id); sprintf (title, "LTE UL SCOPE eNB for CC_id %d, UE %d",CC_id,UE_id);
fl_show_form (form_enb[CC_id][UE_id]->lte_phy_scope_enb, FL_PLACE_HOTSPOT, FL_FULLBORDER, title); fl_show_form (form_enb[CC_id][UE_id]->lte_phy_scope_enb, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
if (otg_enabled) { if (otg_enabled) {
fl_set_button(form_enb[CC_id][UE_id]->button_0,1); fl_set_button(form_enb[CC_id][UE_id]->button_0,1);
fl_set_object_label(form_enb[CC_id][UE_id]->button_0,"DL Traffic ON"); fl_set_object_label(form_enb[CC_id][UE_id]->button_0,"DL Traffic ON");
...@@ -730,91 +730,93 @@ int main( int argc, char **argv ) { ...@@ -730,91 +730,93 @@ int main( int argc, char **argv ) {
} }
} // CC_id } // CC_id
} // UE_id } // UE_id
ret = pthread_create(&forms_thread, NULL, scope_thread, NULL); ret = pthread_create(&forms_thread, NULL, scope_thread, NULL);
if (ret == 0) if (ret == 0)
pthread_setname_np( forms_thread, "xforms" ); pthread_setname_np( forms_thread, "xforms" );
printf("Scope thread created, ret=%d\n",ret); printf("Scope thread created, ret=%d\n",ret);
} }
#endif #endif
rt_sleep_ns(10*100000000ULL); rt_sleep_ns(10*100000000ULL);
if (NFAPI_MODE!=NFAPI_MONOLITHIC) { if (NFAPI_MODE!=NFAPI_MONOLITHIC) {
LOG_I(ENB_APP,"NFAPI*** - mutex and cond created - will block shortly for completion of PNF connection\n"); LOG_I(ENB_APP,"NFAPI*** - mutex and cond created - will block shortly for completion of PNF connection\n");
pthread_cond_init(&sync_cond,NULL); pthread_cond_init(&sync_cond,NULL);
pthread_mutex_init(&sync_mutex, NULL); pthread_mutex_init(&sync_mutex, NULL);
} }
if (NFAPI_MODE==NFAPI_MODE_VNF) {// VNF if (NFAPI_MODE==NFAPI_MODE_VNF) {// VNF
#if defined(PRE_SCD_THREAD) #if defined(PRE_SCD_THREAD)
init_ru_vnf(); // ru pointer is necessary for pre_scd. init_ru_vnf(); // ru pointer is necessary for pre_scd.
#endif #endif
wait_nfapi_init("main?"); wait_nfapi_init("main?");
} }
LOG_I(ENB_APP,"START MAIN THREADS\n"); LOG_I(ENB_APP,"START MAIN THREADS\n");
// start the main threads // start the main threads
number_of_cards = 1; number_of_cards = 1;
printf("RC.nb_L1_inst:%d\n", RC.nb_L1_inst); printf("RC.nb_L1_inst:%d\n", RC.nb_L1_inst);
if (RC.nb_L1_inst > 0) { if (RC.nb_L1_inst > 0) {
printf("Initializing eNB threads single_thread_flag:%d wait_for_sync:%d\n", get_softmodem_params()->single_thread_flag,get_softmodem_params()->wait_for_sync); printf("Initializing eNB threads single_thread_flag:%d wait_for_sync:%d\n", get_softmodem_params()->single_thread_flag,get_softmodem_params()->wait_for_sync);
init_eNB(get_softmodem_params()->single_thread_flag,get_softmodem_params()->wait_for_sync); init_eNB(get_softmodem_params()->single_thread_flag,get_softmodem_params()->wait_for_sync);
// for (inst=0;inst<RC.nb_L1_inst;inst++) // for (inst=0;inst<RC.nb_L1_inst;inst++)
// for (CC_id=0;CC_id<RC.nb_L1_CC[inst];CC_id++) phy_init_lte_eNB(RC.eNB[inst][CC_id],0,0); // for (CC_id=0;CC_id<RC.nb_L1_CC[inst];CC_id++) phy_init_lte_eNB(RC.eNB[inst][CC_id],0,0);
} }
printf("wait_eNBs()\n"); printf("wait_eNBs()\n");
wait_eNBs(); wait_eNBs();
printf("About to Init RU threads RC.nb_RU:%d\n", RC.nb_RU); printf("About to Init RU threads RC.nb_RU:%d\n", RC.nb_RU);
// RU thread and some L1 procedure aren't necessary in VNF or L2 FAPI simulator. // RU thread and some L1 procedure aren't necessary in VNF or L2 FAPI simulator.
// but RU thread deals with pre_scd and this is necessary in VNF and simulator. // but RU thread deals with pre_scd and this is necessary in VNF and simulator.
// some initialization is necessary and init_ru_vnf do this. // some initialization is necessary and init_ru_vnf do this.
if (RC.nb_RU >0 && NFAPI_MODE!=NFAPI_MODE_VNF) { if (RC.nb_RU >0 && NFAPI_MODE!=NFAPI_MODE_VNF) {
printf("Initializing RU threads\n"); printf("Initializing RU threads\n");
init_RU(get_softmodem_params()->rf_config_file,get_softmodem_params()->clock_source,get_softmodem_params()->timing_source,get_softmodem_params()->send_dmrs_sync); init_RU(get_softmodem_params()->rf_config_file,get_softmodem_params()->clock_source,get_softmodem_params()->timing_source,get_softmodem_params()->send_dmrs_sync);
for (ru_id=0; ru_id<RC.nb_RU; ru_id++) { for (ru_id=0; ru_id<RC.nb_RU; ru_id++) {
RC.ru[ru_id]->rf_map.card=0; RC.ru[ru_id]->rf_map.card=0;
RC.ru[ru_id]->rf_map.chain=CC_id+(get_softmodem_params()->chain_offset); RC.ru[ru_id]->rf_map.chain=CC_id+(get_softmodem_params()->chain_offset);
} }
config_sync_var=0; config_sync_var=0;
if (NFAPI_MODE==NFAPI_MODE_PNF) { // PNF if (NFAPI_MODE==NFAPI_MODE_PNF) { // PNF
wait_nfapi_init("main?"); wait_nfapi_init("main?");
} }
printf("wait RUs\n"); printf("wait RUs\n");
fflush(stdout); fflush(stdout);
fflush(stderr); fflush(stderr);
wait_RUs(); wait_RUs();
LOG_I(ENB_APP,"RC.nb_RU:%d\n", RC.nb_RU); LOG_I(ENB_APP,"RC.nb_RU:%d\n", RC.nb_RU);
// once all RUs are ready intiailize the rest of the eNBs ((dependence on final RU parameters after configuration) // once all RUs are ready intiailize the rest of the eNBs ((dependence on final RU parameters after configuration)
printf("ALL RUs ready - init eNBs\n"); printf("ALL RUs ready - init eNBs\n");
if (NFAPI_MODE!=NFAPI_MODE_PNF && NFAPI_MODE!=NFAPI_MODE_VNF) { if (NFAPI_MODE!=NFAPI_MODE_PNF && NFAPI_MODE!=NFAPI_MODE_VNF) {
LOG_I(ENB_APP,"Not NFAPI mode - call init_eNB_afterRU()\n"); LOG_I(ENB_APP,"Not NFAPI mode - call init_eNB_afterRU()\n");
init_eNB_afterRU(); init_eNB_afterRU();
} else { } else {
LOG_I(ENB_APP,"NFAPI mode - DO NOT call init_eNB_afterRU()\n"); LOG_I(ENB_APP,"NFAPI mode - DO NOT call init_eNB_afterRU()\n");
}
LOG_UI(ENB_APP,"ALL RUs ready - ALL eNBs ready\n");
// connect the TX/RX buffers
sleep(1); /* wait for thread activation */
LOG_I(ENB_APP,"Sending sync to all threads\n");
pthread_mutex_lock(&sync_mutex);
sync_var=0;
pthread_cond_broadcast(&sync_cond);
pthread_mutex_unlock(&sync_mutex);
config_check_unknown_cmdlineopt(CONFIG_CHECKALLSECTIONS);
} }
LOG_UI(ENB_APP,"ALL RUs ready - ALL eNBs ready\n");
// connect the TX/RX buffers
sleep(1); /* wait for thread activation */
LOG_I(ENB_APP,"Sending sync to all threads\n");
pthread_mutex_lock(&sync_mutex);
sync_var=0;
pthread_cond_broadcast(&sync_cond);
pthread_mutex_unlock(&sync_mutex);
config_check_unknown_cmdlineopt(CONFIG_CHECKALLSECTIONS);
} }
// wait for end of program // wait for end of program
LOG_UI(ENB_APP,"TYPE <CTRL-C> TO TERMINATE\n"); LOG_UI(ENB_APP,"TYPE <CTRL-C> TO TERMINATE\n");
//getchar(); //getchar();
itti_wait_tasks_end(); itti_wait_tasks_end();
...@@ -879,7 +881,7 @@ int main( int argc, char **argv ) { ...@@ -879,7 +881,7 @@ int main( int argc, char **argv ) {
} }
} }
} }
terminate_opt(); terminate_opt();
logClean(); logClean();
printf("Bye.\n"); printf("Bye.\n");
......
...@@ -1731,12 +1731,12 @@ void *UE_thread(void *arg) { ...@@ -1731,12 +1731,12 @@ void *UE_thread(void *arg) {
tv.tv_sec=INT_MAX; tv.tv_sec=INT_MAX;
// operate on thread sf mod 2 // operate on thread sf mod 2
if (pthread_mutex_timedlock(&proc->mutex_rxtx, &tv) !=0) { if ((errno = pthread_mutex_timedlock(&proc->mutex_rxtx, &tv)) !=0) {
if ( errno == ETIMEDOUT) { if ( errno == ETIMEDOUT) {
LOG_E(PHY,"Missed real time\n"); LOG_E(PHY,"Missed real time\n");
continue; continue;
} else { } else {
LOG_E(PHY,"System error %s\n",strerror(errno)); LOG_E(PHY,"System error %s (%d)\n",strerror(errno),errno);
abort(); abort();
} }
} }
......
...@@ -405,6 +405,8 @@ static void get_options(void) { ...@@ -405,6 +405,8 @@ static void get_options(void) {
int dumpframe=0; int dumpframe=0;
int timingadv; int timingadv;
uint8_t nfapi_mode;
int simL1flag ;
set_default_frame_parms(frame_parms); set_default_frame_parms(frame_parms);
CONFIG_SETRTFLAG(CONFIG_NOEXITONHELP); CONFIG_SETRTFLAG(CONFIG_NOEXITONHELP);
......
...@@ -63,7 +63,7 @@ sim_t sim; ...@@ -63,7 +63,7 @@ sim_t sim;
void init_ru_devices(void); void init_ru_devices(void);
void init_RU(const char*,clock_source_t clock_source,clock_source_t time_source,int send_dmrssync); void init_RU(char*,clock_source_t clock_source,clock_source_t time_source,int send_dmrssync);
void *rfsim_top(void *n_frames); void *rfsim_top(void *n_frames);
......
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