Commit 2b5e9f3b authored by Florian Kaltenberger's avatar Florian Kaltenberger

fixing --loop-memory options plus a few other things

parent 7b515226
...@@ -47,10 +47,10 @@ ...@@ -47,10 +47,10 @@
#include "LAYER2/NR_MAC_UE/mac_proto.h" #include "LAYER2/NR_MAC_UE/mac_proto.h"
#include "RRC/NR_UE/rrc_proto.h" #include "RRC/NR_UE/rrc_proto.h"
#include "SCHED_NR/extern.h"
//#ifndef NO_RAT_NR //#ifndef NO_RAT_NR
#include "SCHED_NR/phy_frame_config_nr.h" #include "SCHED_NR/phy_frame_config_nr.h"
//#endif //#endif
#include "SCHED_NR_UE/defs.h"
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
...@@ -574,6 +574,7 @@ static void *UE_thread_synch(void *arg) { ...@@ -574,6 +574,7 @@ static void *UE_thread_synch(void *arg) {
if (UE->UE_scan_carrier==1) if (UE->UE_scan_carrier==1)
openair0_cfg[UE->rf_map.card].autocal[UE->rf_map.chain+i] = 1; openair0_cfg[UE->rf_map.card].autocal[UE->rf_map.chain+i] = 1;
} }
if (UE->mode != loop_through_memory)
UE->rfdevice.trx_set_freq_func(&UE->rfdevice,&openair0_cfg[0],0); UE->rfdevice.trx_set_freq_func(&UE->rfdevice,&openair0_cfg[0],0);
}// initial_sync=0 }// initial_sync=0
break; break;
...@@ -660,7 +661,7 @@ static void *UE_thread_rxn_txnp4(void *arg) { ...@@ -660,7 +661,7 @@ static void *UE_thread_rxn_txnp4(void *arg) {
#ifdef UE_SLOT_PARALLELISATION #ifdef UE_SLOT_PARALLELISATION
phy_procedures_slot_parallelization_UE_RX( UE, proc, 0, 0, 1, UE->mode, no_relay, NULL ); phy_procedures_slot_parallelization_UE_RX( UE, proc, 0, 0, 1, UE->mode, no_relay, NULL );
#else #else
phy_procedures_nrUE_RX( UE, proc, 0, 0, 1, UE->mode, no_relay, NULL ); phy_procedures_nrUE_RX( UE, proc, 0, 0, 1, UE->mode, no_relay);
printf(">>> nr_ue_pdcch_procedures ended\n"); printf(">>> nr_ue_pdcch_procedures ended\n");
#endif #endif
...@@ -814,7 +815,7 @@ void *UE_thread(void *arg) { ...@@ -814,7 +815,7 @@ void *UE_thread(void *arg) {
CPU_SET(threads.iq, &cpuset); CPU_SET(threads.iq, &cpuset);
init_thread(100000, 500000, FIFO_PRIORITY, &cpuset, init_thread(100000, 500000, FIFO_PRIORITY, &cpuset,
"UHD Threads"); "UHD Threads");
if (oaisim_flag == 0) if ((oaisim_flag == 0) && (UE->mode !=loop_through_memory))
AssertFatal(0== openair0_device_load(&(UE->rfdevice), &openair0_cfg[0]), ""); AssertFatal(0== openair0_device_load(&(UE->rfdevice), &openair0_cfg[0]), "");
UE->rfdevice.host_type = RAU_HOST; UE->rfdevice.host_type = RAU_HOST;
sprintf(threadname, "Main UE %d", UE->Mod_id); sprintf(threadname, "Main UE %d", UE->Mod_id);
...@@ -829,6 +830,7 @@ void *UE_thread(void *arg) { ...@@ -829,6 +830,7 @@ void *UE_thread(void *arg) {
int tti_nr=-1; int tti_nr=-1;
//int cumulated_shift=0; //int cumulated_shift=0;
if ((oaisim_flag == 0) && (UE->mode != loop_through_memory))
AssertFatal(UE->rfdevice.trx_start_func(&UE->rfdevice) == 0, "Could not start the device\n"); AssertFatal(UE->rfdevice.trx_start_func(&UE->rfdevice) == 0, "Could not start the device\n");
while (!oai_exit) { while (!oai_exit) {
AssertFatal ( 0== pthread_mutex_lock(&UE->proc.mutex_synch), ""); AssertFatal ( 0== pthread_mutex_lock(&UE->proc.mutex_synch), "");
......
...@@ -510,7 +510,6 @@ static void get_options(void) { ...@@ -510,7 +510,6 @@ static void get_options(void) {
paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC ; paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC ;
paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC ; paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC ;
set_default_frame_parms(frame_parms);
config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL); config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL);
if (strlen(in_path) > 0) { if (strlen(in_path) > 0) {
...@@ -543,7 +542,7 @@ static void get_options(void) { ...@@ -543,7 +542,7 @@ static void get_options(void) {
config_process_cmdline( cmdline_uemodeparams,sizeof(cmdline_uemodeparams)/sizeof(paramdef_t),NULL); config_process_cmdline( cmdline_uemodeparams,sizeof(cmdline_uemodeparams)/sizeof(paramdef_t),NULL);
config_process_cmdline( cmdline_ueparams,sizeof(cmdline_ueparams)/sizeof(paramdef_t),NULL); config_process_cmdline( cmdline_ueparams,sizeof(cmdline_ueparams)/sizeof(paramdef_t),NULL);
if (loopfile != NULL) { if (loopfile != NULL) {
printf("Input file for hardware emulation: %s",loopfile); printf("Input file for hardware emulation: %s\n",loopfile);
mode=loop_through_memory; mode=loop_through_memory;
input_fd = fopen(loopfile,"r"); input_fd = fopen(loopfile,"r");
AssertFatal(input_fd != NULL,"Please provide a valid input file\n"); AssertFatal(input_fd != NULL,"Please provide a valid input file\n");
...@@ -825,6 +824,8 @@ int main( int argc, char **argv ) { ...@@ -825,6 +824,8 @@ int main( int argc, char **argv ) {
int ret; int ret;
#endif #endif
PHY_VARS_NR_UE *UE[MAX_NUM_CCs];
start_background_system(); start_background_system();
if ( load_configmodule(argc,argv) == NULL) { if ( load_configmodule(argc,argv) == NULL) {
exit_fun("[SOFTMODEM] Error, configuration module init failed\n"); exit_fun("[SOFTMODEM] Error, configuration module init failed\n");
...@@ -836,9 +837,7 @@ int main( int argc, char **argv ) { ...@@ -836,9 +837,7 @@ int main( int argc, char **argv ) {
setvbuf(stderr, NULL, _IONBF, 0); setvbuf(stderr, NULL, _IONBF, 0);
#endif #endif
PHY_VARS_NR_UE *UE[MAX_NUM_CCs]; set_default_frame_parms(frame_parms);
UE[0] = malloc(sizeof(PHY_VARS_NR_UE*));
//UE[1] = (PHY_VARS_NR_UE *)malloc(sizeof(PHY_VARS_NR_UE));
mode = normal_txrx; mode = normal_txrx;
memset(&openair0_cfg[0],0,sizeof(openair0_config_t)*MAX_CARDS); memset(&openair0_cfg[0],0,sizeof(openair0_config_t)*MAX_CARDS);
...@@ -897,9 +896,6 @@ int main( int argc, char **argv ) { ...@@ -897,9 +896,6 @@ int main( int argc, char **argv ) {
MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX); MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX);
#endif #endif
// get options and fill parameters from configuration file
get_options (); //Command-line options, enb_properties
if (opt_type != OPT_NONE) { if (opt_type != OPT_NONE) {
if (init_opt(in_path, in_ip) == -1) if (init_opt(in_path, in_ip) == -1)
LOG_E(OPT,"failed to run OPT \n"); LOG_E(OPT,"failed to run OPT \n");
...@@ -930,7 +926,6 @@ int main( int argc, char **argv ) { ...@@ -930,7 +926,6 @@ int main( int argc, char **argv ) {
// init the parameters // init the parameters
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
frame_parms[CC_id]->nb_antennas_tx = nb_antenna_tx; frame_parms[CC_id]->nb_antennas_tx = nb_antenna_tx;
frame_parms[CC_id]->nb_antennas_rx = nb_antenna_rx; frame_parms[CC_id]->nb_antennas_rx = nb_antenna_rx;
frame_parms[CC_id]->nb_antenna_ports_eNB = 1; //initial value overwritten by initial sync later frame_parms[CC_id]->nb_antenna_ports_eNB = 1; //initial value overwritten by initial sync later
...@@ -941,29 +936,23 @@ int main( int argc, char **argv ) { ...@@ -941,29 +936,23 @@ int main( int argc, char **argv ) {
//phy_init_nr_top(frame_parms[CC_id]); //phy_init_nr_top(frame_parms[CC_id]);
} }
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
//init prach for openair1 test //init prach for openair1 test
// prach_fmt = get_prach_fmt(frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex, frame_parms->frame_type); // prach_fmt = get_prach_fmt(frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex, frame_parms->frame_type);
// N_ZC = (prach_fmt <4)?839:139; // N_ZC = (prach_fmt <4)?839:139;
} }
/*NB_UE_INST=1;
NB_INST=1;
PHY_vars_UE_g = malloc(sizeof(PHY_VARS_NR_UE**));
PHY_vars_UE_g[0] = malloc(sizeof(PHY_VARS_NR_UE*)*MAX_NUM_CCs);*/
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
NB_UE_INST=1; NB_UE_INST=1;
NB_INST=1; NB_INST=1;
PHY_vars_UE_g = malloc(sizeof(PHY_VARS_NR_UE**)); PHY_vars_UE_g = malloc(sizeof(PHY_VARS_NR_UE**));
PHY_vars_UE_g[0] = malloc(sizeof(PHY_VARS_NR_UE*)*MAX_NUM_CCs); PHY_vars_UE_g[0] = malloc(sizeof(PHY_VARS_NR_UE*)*MAX_NUM_CCs);
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
printf("PHY_vars_UE_g[0][%d] = %p\n",CC_id,UE[CC_id]); printf("PHY_vars_UE_g[0][%d] = %p\n",CC_id,UE[CC_id]);
printf("frame_parms %d\n",frame_parms[CC_id]->ofdm_symbol_size); printf("frame_parms %d\n",frame_parms[CC_id]->ofdm_symbol_size);
nr_init_frame_parms_ue(frame_parms[CC_id],numerology,NORMAL,frame_parms[CC_id]->N_RB_DL,(frame_parms[CC_id]->N_RB_DL-20)>>1,0);
PHY_vars_UE_g[0][CC_id] = init_nr_ue_vars(frame_parms[CC_id], 0,abstraction_flag); PHY_vars_UE_g[0][CC_id] = init_nr_ue_vars(frame_parms[CC_id], 0,abstraction_flag);
UE[CC_id] = PHY_vars_UE_g[0][CC_id]; UE[CC_id] = PHY_vars_UE_g[0][CC_id];
......
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