Merge remote-tracking branch 'origin/develop' into prb_based_dl_channel_estimation
Conflicts: cmake_targets/autotests/test_case_list.xml openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c openair1/SIMULATION/NR_PHY/ulsim.c targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band22.tm1.106PRB.adrv9371zc706.conf targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf
This commit is contained in:
@@ -750,7 +750,7 @@ void phy_procedures_eNB_uespec_RX_fromsplit(uint8_t *bufferZone, int nbBlocks,PH
|
||||
recvFs6Ul(bufferZone, nbBlocks, eNB, ul_propa);
|
||||
|
||||
// dirty memory allocation in OAI...
|
||||
for (int i = 0; i < NUMBER_OF_UCI_VARS_MAX; i++)
|
||||
for (int i = 0; i < NUMBER_OF_UCI_MAX; i++)
|
||||
if ( eNB->uci_vars[i].frame == proc->frame_rx &&
|
||||
eNB->uci_vars[i].subframe == proc->subframe_rx )
|
||||
eNB->uci_vars[i].active=0;
|
||||
@@ -1145,7 +1145,7 @@ void appendFs6DLUEcch(uint8_t *bufferZone, PHY_VARS_eNB *eNB, int frame, int sub
|
||||
commonUDP_t *newUDPheader=(commonUDP_t *) firstFreeByte;
|
||||
bool first_UE=true;
|
||||
|
||||
for (int i = 0; i < NUMBER_OF_UCI_VARS_MAX; i++) {
|
||||
for (int i = 0; i < NUMBER_OF_UCI_MAX; i++) {
|
||||
LTE_eNB_UCI *uci = &(eNB->uci_vars[i]);
|
||||
|
||||
if ((uci->active == 1) && (uci->frame == frame) && (uci->subframe == subframe)) {
|
||||
|
||||
+18
-5
@@ -204,7 +204,6 @@ void init_eNB_afterRU(void) {
|
||||
for (int inst=0; inst<RC.nb_inst; inst++) {
|
||||
for (int CC_id=0; CC_id<RC.nb_CC[inst]; CC_id++) {
|
||||
PHY_VARS_eNB *eNB = RC.eNB[inst][CC_id];
|
||||
phy_init_lte_eNB(eNB,0,0);
|
||||
eNB->frame_parms.nb_antennas_rx = 0;
|
||||
eNB->frame_parms.nb_antennas_tx = 0;
|
||||
eNB->prach_vars.rxsigF[0] = (int16_t **)malloc16(64*sizeof(int16_t *));
|
||||
@@ -230,12 +229,26 @@ void init_eNB_afterRU(void) {
|
||||
for (int ce_level=0; ce_level<4; ce_level++)
|
||||
eNB->prach_vars_br.rxsigF[ce_level][aa] = eNB->RU_list[ru_id]->prach_rxsigF_br[ce_level][i];
|
||||
|
||||
eNB->common_vars.rxdataF[aa] = eNB->RU_list[ru_id]->common.rxdataF[i];
|
||||
}
|
||||
}
|
||||
|
||||
AssertFatal( eNB->frame_parms.nb_antennas_rx > 0 && eNB->frame_parms.nb_antennas_rx < 4, "");
|
||||
AssertFatal( eNB->frame_parms.nb_antennas_tx > 0 && eNB->frame_parms.nb_antennas_rx < 4, "");
|
||||
|
||||
AssertFatal( eNB->frame_parms.nb_antennas_rx > 0 && eNB->frame_parms.nb_antennas_rx < 5, "");
|
||||
AssertFatal( eNB->frame_parms.nb_antennas_tx > 0 && eNB->frame_parms.nb_antennas_rx < 5, "");
|
||||
|
||||
phy_init_lte_eNB(eNB,0,0);
|
||||
|
||||
// need to copy rxdataF after L1 variables are allocated
|
||||
for (int inst=0; inst<RC.nb_inst; inst++) {
|
||||
for (int CC_id=0; CC_id<RC.nb_CC[inst]; CC_id++) {
|
||||
PHY_VARS_eNB *eNB = RC.eNB[inst][CC_id];
|
||||
for (int ru_id=0,aa=0; ru_id<eNB->num_RU; ru_id++) {
|
||||
for (int i=0; i<eNB->RU_list[ru_id]->nb_rx; aa++,i++)
|
||||
eNB->common_vars.rxdataF[aa] = eNB->RU_list[ru_id]->common.rxdataF[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LOG_I(PHY,"inst %d, CC_id %d : nb_antennas_rx %d\n",inst,CC_id,eNB->frame_parms.nb_antennas_rx);
|
||||
init_transport(eNB);
|
||||
//init_precoding_weights(RC.eNB[inst][CC_id]);
|
||||
@@ -802,7 +815,7 @@ int init_rf(RU_t *ru) {
|
||||
pthread_setname_np(pthread_self(),name);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void ocp_init_RU(RU_t *ru, char *rf_config_file, int send_dmrssync) {
|
||||
PHY_VARS_eNB *eNB0= (PHY_VARS_eNB *)NULL;
|
||||
int i;
|
||||
|
||||
@@ -0,0 +1,382 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file oairu.c
|
||||
* \brief Top-level threads for radio-unit
|
||||
* \author R. Knopp
|
||||
* \date 2020
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
|
||||
#define _GNU_SOURCE /* See feature_test_macros(7) */
|
||||
#include <sched.h>
|
||||
|
||||
|
||||
|
||||
|
||||
#include "assertions.h"
|
||||
#include "PHY/types.h"
|
||||
|
||||
#include "PHY/defs_RU.h"
|
||||
#include "common/config/config_userapi.h"
|
||||
#include "common/utils/load_module_shlib.h"
|
||||
|
||||
|
||||
#include "../../ARCH/COMMON/common_lib.h"
|
||||
#include "../../ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
|
||||
|
||||
|
||||
#include "PHY/phy_vars.h"
|
||||
#include "SCHED/sched_common_vars.h"
|
||||
#include "PHY/TOOLS/phy_scope_interface.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
#include "openair2/ENB_APP/enb_paramdef.h"
|
||||
#include "system.h"
|
||||
|
||||
#include <executables/split_headers.h>
|
||||
#include <executables/softmodem-common.h>
|
||||
#include <executables/thread-common.h>
|
||||
|
||||
static int DEFBANDS[] = {7};
|
||||
static int DEFENBS[] = {0};
|
||||
static int DEFBFW[] = {0x00007fff};
|
||||
|
||||
THREAD_STRUCT thread_struct;
|
||||
|
||||
pthread_cond_t sync_cond;
|
||||
pthread_mutex_t sync_mutex;
|
||||
int sync_var=-1; //!< protected by mutex \ref sync_mutex.
|
||||
int config_sync_var=-1;
|
||||
|
||||
volatile int oai_exit = 0;
|
||||
uint16_t sf_ahead = 4;
|
||||
RU_t ru_m;
|
||||
|
||||
|
||||
extern void init_RU0(RU_t *ru,int ru_id,char *rf_config_file, int send_dmrssync);
|
||||
extern void init_RU_proc(RU_t *ru);
|
||||
extern void kill_RU_proc(RU_t *ru);
|
||||
extern void set_function_spec_param(RU_t *ru);
|
||||
|
||||
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
|
||||
|
||||
void nfapi_setmode(nfapi_mode_t nfapi_mode) { return; }
|
||||
void exit_function(const char *file, const char *function, const int line, const char *s) {
|
||||
|
||||
if (s != NULL) {
|
||||
printf("%s:%d %s() Exiting OAI softmodem: %s\n",file,line, function, s);
|
||||
}
|
||||
close_log_mem();
|
||||
oai_exit = 1;
|
||||
|
||||
if (ru_m.rfdevice.trx_end_func) {
|
||||
ru_m.rfdevice.trx_end_func(&ru_m.rfdevice);
|
||||
ru_m.rfdevice.trx_end_func = NULL;
|
||||
}
|
||||
|
||||
if (ru_m.ifdevice.trx_end_func) {
|
||||
ru_m.ifdevice.trx_end_func(&ru_m.ifdevice);
|
||||
ru_m.ifdevice.trx_end_func = NULL;
|
||||
}
|
||||
|
||||
pthread_mutex_destroy(ru_m.ru_mutex);
|
||||
pthread_cond_destroy(ru_m.ru_cond);
|
||||
sleep(1); //allow lte-softmodem threads to exit first
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
static void get_options(void) {
|
||||
CONFIG_SETRTFLAG(CONFIG_NOEXITONHELP);
|
||||
get_common_options(SOFTMODEM_ENB_BIT );
|
||||
CONFIG_CLEARRTFLAG(CONFIG_NOEXITONHELP);
|
||||
|
||||
//RCConfig();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
extern void phy_free_RU(RU_t *);
|
||||
|
||||
nfapi_mode_t nfapi_getmode(void) {
|
||||
return(NFAPI_MODE_PNF);
|
||||
}
|
||||
|
||||
void oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind) {
|
||||
|
||||
AssertFatal(1==0,"This is bad ... please check why we get here\n");
|
||||
}
|
||||
|
||||
void wait_eNBs(void){ return; }
|
||||
|
||||
uint64_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
|
||||
|
||||
int main ( int argc, char **argv )
|
||||
{
|
||||
|
||||
if ( load_configmodule(argc,argv,0) == NULL) {
|
||||
exit_fun("[SOFTMODEM] Error, configuration module init failed\n");
|
||||
}
|
||||
|
||||
logInit();
|
||||
printf("Reading in command-line options\n");
|
||||
get_options ();
|
||||
|
||||
if (CONFIG_ISFLAGSET(CONFIG_ABORT) ) {
|
||||
fprintf(stderr,"Getting configuration failed\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
#if T_TRACER
|
||||
T_Config_Init();
|
||||
#endif
|
||||
printf("configuring for RRU\n");
|
||||
|
||||
#ifndef PACKAGE_VERSION
|
||||
# define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL"
|
||||
#endif
|
||||
LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
|
||||
|
||||
/* Read configuration */
|
||||
|
||||
printf("About to Init RU threads\n");
|
||||
|
||||
|
||||
RU_t *ru=&ru_m;
|
||||
|
||||
paramdef_t RUParams[] = RUPARAMS_DESC;
|
||||
paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0};
|
||||
config_getlist( &RUParamList,RUParams,sizeof(RUParams)/sizeof(paramdef_t), NULL);
|
||||
|
||||
int j=0;
|
||||
uint64_t ru_mask=1;
|
||||
pthread_mutex_t ru_mutex; pthread_mutex_init(&ru_mutex,NULL);
|
||||
pthread_cond_t ru_cond; pthread_cond_init(&ru_cond,NULL);
|
||||
|
||||
ru->ru_mask= &ru_mask;
|
||||
ru->ru_mutex = &ru_mutex;
|
||||
ru->ru_cond = &ru_cond;
|
||||
|
||||
ru->if_timing = synch_to_ext_device;
|
||||
ru->num_eNB = 0;
|
||||
ru->has_ctrl_prt = 1;
|
||||
if (config_isparamset(RUParamList.paramarray[j], RU_SDR_ADDRS)) {
|
||||
ru->openair0_cfg.sdr_addrs = strdup(*(RUParamList.paramarray[j][RU_SDR_ADDRS].strptr));
|
||||
}
|
||||
|
||||
if (config_isparamset(RUParamList.paramarray[j], RU_SDR_CLK_SRC)) {
|
||||
if (strcmp(*(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr), "internal") == 0) {
|
||||
ru->openair0_cfg.clock_source = internal;
|
||||
LOG_D(PHY, "RU clock source set as internal\n");
|
||||
} else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr), "external") == 0) {
|
||||
ru->openair0_cfg.clock_source = external;
|
||||
LOG_D(PHY, "RU clock source set as external\n");
|
||||
} else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr), "gpsdo") == 0) {
|
||||
ru->openair0_cfg.clock_source = gpsdo;
|
||||
LOG_D(PHY, "RU clock source set as gpsdo\n");
|
||||
} else {
|
||||
LOG_E(PHY, "Erroneous RU clock source in the provided configuration file: '%s'\n", *(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr));
|
||||
}
|
||||
}
|
||||
else {
|
||||
ru->openair0_cfg.clock_source = unset;
|
||||
}
|
||||
|
||||
if (config_isparamset(RUParamList.paramarray[j], RU_SDR_TME_SRC)) {
|
||||
if (strcmp(*(RUParamList.paramarray[j][RU_SDR_TME_SRC].strptr), "internal") == 0) {
|
||||
ru->openair0_cfg.time_source = internal;
|
||||
LOG_D(PHY, "RU time source set as internal\n");
|
||||
} else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_TME_SRC].strptr), "external") == 0) {
|
||||
ru->openair0_cfg.time_source = external;
|
||||
LOG_D(PHY, "RU time source set as external\n");
|
||||
} else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_TME_SRC].strptr), "gpsdo") == 0) {
|
||||
ru->openair0_cfg.time_source = gpsdo;
|
||||
LOG_D(PHY, "RU time source set as gpsdo\n");
|
||||
} else {
|
||||
LOG_E(PHY, "Erroneous RU time source in the provided configuration file: '%s'\n", *(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr));
|
||||
}
|
||||
}
|
||||
else {
|
||||
ru->openair0_cfg.time_source = unset;
|
||||
}
|
||||
|
||||
if (strcmp(*(RUParamList.paramarray[j][RU_LOCAL_RF_IDX].strptr), "yes") == 0) {
|
||||
if ( !(config_isparamset(RUParamList.paramarray[j],RU_LOCAL_IF_NAME_IDX)) ) {
|
||||
AssertFatal(1==0,"IF_NAME is required\n");
|
||||
} else {
|
||||
ru->eth_params.local_if_name = strdup(*(RUParamList.paramarray[j][RU_LOCAL_IF_NAME_IDX].strptr));
|
||||
ru->eth_params.my_addr = strdup(*(RUParamList.paramarray[j][RU_LOCAL_ADDRESS_IDX].strptr));
|
||||
ru->eth_params.remote_addr = strdup(*(RUParamList.paramarray[j][RU_REMOTE_ADDRESS_IDX].strptr));
|
||||
ru->eth_params.my_portd = *(RUParamList.paramarray[j][RU_LOCAL_PORTD_IDX].uptr);
|
||||
ru->eth_params.remote_portd = *(RUParamList.paramarray[j][RU_REMOTE_PORTD_IDX].uptr);
|
||||
|
||||
// Check if control port set
|
||||
if (!(config_isparamset(RUParamList.paramarray[j],RU_REMOTE_PORTC_IDX)) ) {
|
||||
printf("Removing control port for RU %d\n",j);
|
||||
ru->has_ctrl_prt = 0;
|
||||
} else {
|
||||
ru->eth_params.my_portc = *(RUParamList.paramarray[j][RU_LOCAL_PORTC_IDX].uptr);
|
||||
ru->eth_params.remote_portc = *(RUParamList.paramarray[j][RU_REMOTE_PORTC_IDX].uptr);
|
||||
printf(" Control port %u \n",ru->eth_params.my_portc);
|
||||
}
|
||||
|
||||
if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp") == 0) {
|
||||
ru->if_south = LOCAL_RF;
|
||||
ru->function = NGFI_RRU_IF5;
|
||||
ru->eth_params.transp_preference = ETH_UDP_MODE;
|
||||
printf("Setting function for RU %d to NGFI_RRU_IF5 (udp)\n",j);
|
||||
} else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw") == 0) {
|
||||
ru->if_south = LOCAL_RF;
|
||||
ru->function = NGFI_RRU_IF5;
|
||||
ru->eth_params.transp_preference = ETH_RAW_MODE;
|
||||
printf("Setting function for RU %d to NGFI_RRU_IF5 (raw)\n",j);
|
||||
} else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp_if4p5") == 0) {
|
||||
ru->if_south = LOCAL_RF;
|
||||
ru->function = NGFI_RRU_IF4p5;
|
||||
ru->eth_params.transp_preference = ETH_UDP_IF4p5_MODE;
|
||||
printf("Setting function for RU %d to NGFI_RRU_IF4p5 (udp)\n",j);
|
||||
} else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw_if4p5") == 0) {
|
||||
ru->if_south = LOCAL_RF;
|
||||
ru->function = NGFI_RRU_IF4p5;
|
||||
ru->eth_params.transp_preference = ETH_RAW_IF4p5_MODE;
|
||||
printf("Setting function for RU %d to NGFI_RRU_IF4p5 (raw)\n",j);
|
||||
}
|
||||
|
||||
printf("RU %d is_slave=%s\n",j,*(RUParamList.paramarray[j][RU_IS_SLAVE_IDX].strptr));
|
||||
|
||||
if (strcmp(*(RUParamList.paramarray[j][RU_IS_SLAVE_IDX].strptr), "yes") == 0) ru->is_slave=1;
|
||||
else ru->is_slave=0;
|
||||
|
||||
printf("RU %d ota_sync_enabled=%s\n",j,*(RUParamList.paramarray[j][RU_OTA_SYNC_ENABLE_IDX].strptr));
|
||||
|
||||
if (strcmp(*(RUParamList.paramarray[j][RU_OTA_SYNC_ENABLE_IDX].strptr), "yes") == 0) ru->ota_sync_enable=1;
|
||||
else ru->ota_sync_enable=0;
|
||||
}
|
||||
|
||||
ru->max_pdschReferenceSignalPower = *(RUParamList.paramarray[j][RU_MAX_RS_EPRE_IDX].uptr);;
|
||||
ru->max_rxgain = *(RUParamList.paramarray[j][RU_MAX_RXGAIN_IDX].uptr);
|
||||
ru->num_bands = RUParamList.paramarray[j][RU_BAND_LIST_IDX].numelt;
|
||||
/* sf_extension is in unit of samples for 30.72MHz here, has to be scaled later */
|
||||
ru->sf_extension = *(RUParamList.paramarray[j][RU_SF_EXTENSION_IDX].uptr);
|
||||
|
||||
for (int i=0; i<ru->num_bands; i++) ru->band[i] = RUParamList.paramarray[j][RU_BAND_LIST_IDX].iptr[i];
|
||||
} //strcmp(local_rf, "yes") == 0
|
||||
else {
|
||||
printf("RU %d: Transport %s\n",j,*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr));
|
||||
ru->eth_params.local_if_name = strdup(*(RUParamList.paramarray[j][RU_LOCAL_IF_NAME_IDX].strptr));
|
||||
ru->eth_params.my_addr = strdup(*(RUParamList.paramarray[j][RU_LOCAL_ADDRESS_IDX].strptr));
|
||||
ru->eth_params.remote_addr = strdup(*(RUParamList.paramarray[j][RU_REMOTE_ADDRESS_IDX].strptr));
|
||||
ru->eth_params.my_portc = *(RUParamList.paramarray[j][RU_LOCAL_PORTC_IDX].uptr);
|
||||
ru->eth_params.remote_portc = *(RUParamList.paramarray[j][RU_REMOTE_PORTC_IDX].uptr);
|
||||
ru->eth_params.my_portd = *(RUParamList.paramarray[j][RU_LOCAL_PORTD_IDX].uptr);
|
||||
ru->eth_params.remote_portd = *(RUParamList.paramarray[j][RU_REMOTE_PORTD_IDX].uptr);
|
||||
|
||||
if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp") == 0) {
|
||||
ru->if_south = REMOTE_IF5;
|
||||
ru->function = NGFI_RAU_IF5;
|
||||
ru->eth_params.transp_preference = ETH_UDP_MODE;
|
||||
} else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw") == 0) {
|
||||
ru->if_south = REMOTE_IF5;
|
||||
ru->function = NGFI_RAU_IF5;
|
||||
ru->eth_params.transp_preference = ETH_RAW_MODE;
|
||||
} else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp_if4p5") == 0) {
|
||||
ru->if_south = REMOTE_IF4p5;
|
||||
ru->function = NGFI_RAU_IF4p5;
|
||||
ru->eth_params.transp_preference = ETH_UDP_IF4p5_MODE;
|
||||
} else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw_if4p5") == 0) {
|
||||
ru->if_south = REMOTE_IF4p5;
|
||||
ru->function = NGFI_RAU_IF4p5;
|
||||
ru->eth_params.transp_preference = ETH_RAW_IF4p5_MODE;
|
||||
}
|
||||
|
||||
if (strcmp(*(RUParamList.paramarray[j][RU_IS_SLAVE_IDX].strptr), "yes") == 0) ru->is_slave=1;
|
||||
else ru->is_slave=0;
|
||||
} /* strcmp(local_rf, "yes") != 0 */
|
||||
|
||||
ru->nb_tx = *(RUParamList.paramarray[j][RU_NB_TX_IDX].uptr);
|
||||
ru->nb_rx = *(RUParamList.paramarray[j][RU_NB_RX_IDX].uptr);
|
||||
ru->att_tx = *(RUParamList.paramarray[j][RU_ATT_TX_IDX].uptr);
|
||||
ru->att_rx = *(RUParamList.paramarray[j][RU_ATT_RX_IDX].uptr);
|
||||
|
||||
|
||||
set_worker_conf("WORKER_ENABLE");
|
||||
|
||||
mlockall(MCL_CURRENT | MCL_FUTURE);
|
||||
pthread_cond_init(&sync_cond,NULL);
|
||||
pthread_mutex_init(&sync_mutex, NULL);
|
||||
|
||||
init_RU0(ru,0,get_softmodem_params()->rf_config_file,get_softmodem_params()->send_dmrs_sync);
|
||||
ru->rf_map.card=0;
|
||||
ru->rf_map.chain=(get_softmodem_params()->chain_offset);
|
||||
|
||||
LOG_I(PHY, "Initializing RRU descriptor : (%s,%s,%d)\n", ru_if_types[ru->if_south], NB_timing[ru->if_timing], ru->function);
|
||||
set_function_spec_param(ru);
|
||||
LOG_I(PHY, "Starting ru_thread , is_slave %d, send_dmrs %d\n", ru->is_slave, ru->generate_dmrs_sync);
|
||||
init_RU_proc(ru);
|
||||
|
||||
pthread_mutex_lock(&ru_mutex);
|
||||
while (ru_mask>0)
|
||||
pthread_cond_wait(&ru_cond,&ru_mutex);
|
||||
pthread_mutex_unlock(&ru_mutex);
|
||||
LOG_I(PHY,"RU configured, unlocking threads\n");
|
||||
config_sync_var=0;
|
||||
pthread_mutex_lock(&sync_mutex);
|
||||
sync_var=0;
|
||||
pthread_cond_broadcast(&sync_cond);
|
||||
pthread_mutex_unlock(&sync_mutex);
|
||||
|
||||
while (oai_exit==0) sleep(1);
|
||||
// stop threads
|
||||
|
||||
kill_RU_proc(ru);
|
||||
phy_free_RU(ru);
|
||||
|
||||
free_lte_top();
|
||||
end_configmodule();
|
||||
|
||||
if (ru->rfdevice.trx_end_func) {
|
||||
ru->rfdevice.trx_end_func(&ru->rfdevice);
|
||||
ru->rfdevice.trx_end_func = NULL;
|
||||
}
|
||||
|
||||
if (ru->ifdevice.trx_end_func) {
|
||||
ru->ifdevice.trx_end_func(&ru->ifdevice);
|
||||
ru->ifdevice.trx_end_func = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
logClean();
|
||||
printf("Bye.\n");
|
||||
return 0;
|
||||
}
|
||||
+3
-2
@@ -112,6 +112,7 @@ void configure_ru(int idx, void *arg);
|
||||
void configure_rru(int idx, void *arg);
|
||||
int attach_rru(RU_t *ru);
|
||||
int connect_rau(RU_t *ru);
|
||||
static void NRRCconfig_RU(void);
|
||||
|
||||
uint16_t sf_ahead;
|
||||
uint16_t slot_ahead;
|
||||
@@ -1837,7 +1838,7 @@ void init_NR_RU(char *rf_config_file)
|
||||
pthread_cond_init(&RC.ru_cond,NULL);
|
||||
// read in configuration file)
|
||||
printf("configuring RU from file\n");
|
||||
RCconfig_RU();
|
||||
NRRCconfig_RU();
|
||||
LOG_I(PHY,"number of L1 instances %d, number of RU %d, number of CPU cores %d\n",RC.nb_nr_L1_inst,RC.nb_RU,get_nprocs());
|
||||
|
||||
LOG_D(PHY,"Process RUs RC.nb_RU:%d\n",RC.nb_RU);
|
||||
@@ -1912,7 +1913,7 @@ void stop_RU(int nb_ru)
|
||||
|
||||
/* --------------------------------------------------------*/
|
||||
/* from here function to use configuration module */
|
||||
void RCconfig_RU(void)
|
||||
static void NRRCconfig_RU(void)
|
||||
{
|
||||
int i = 0, j = 0;
|
||||
paramdef_t RUParams[] = RUPARAMS_DESC;
|
||||
|
||||
@@ -164,10 +164,15 @@ int otg_enabled;
|
||||
uint32_t timing_advance = 0;
|
||||
uint64_t num_missed_slots=0; // counter for the number of missed slots
|
||||
|
||||
#include <executables/split_headers.h>
|
||||
int split73=0;
|
||||
void sendFs6Ul(PHY_VARS_eNB *eNB, int UE_id, int harq_pid, int segmentID, int16_t *data, int dataLen, int r_offset) {
|
||||
AssertFatal(false, "Must not be called in this context\n");
|
||||
}
|
||||
void sendFs6Ulharq(enum pckType type, int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, int frame, int subframe, uint8_t *harq_ack, uint8_t tdd_mapping_mode, uint16_t tdd_multiplexing_mask, uint16_t rnti, int32_t stat) {
|
||||
AssertFatal(false, "Must not be called in this context\n");
|
||||
}
|
||||
|
||||
|
||||
extern void reset_opp_meas(void);
|
||||
extern void print_opp_meas(void);
|
||||
|
||||
@@ -82,7 +82,6 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
// current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0)
|
||||
#include "PHY/TOOLS/phy_scope_interface.h"
|
||||
#include "PHY/TOOLS/nr_phy_scope.h"
|
||||
#define NRUE_MAIN
|
||||
#include <executables/nr-uesoftmodem.h>
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "executables/thread-common.h"
|
||||
@@ -90,6 +89,7 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
extern const char *duplex_mode[];
|
||||
msc_interface_t msc_interface;
|
||||
THREAD_STRUCT thread_struct;
|
||||
nrUE_params_t nrUE_params;
|
||||
|
||||
// Thread variables
|
||||
pthread_cond_t nfapi_sync_cond;
|
||||
|
||||
@@ -76,9 +76,6 @@ extern uint64_t get_nrUE_optmask(void);
|
||||
extern uint64_t set_nrUE_optmask(uint64_t bitmask);
|
||||
extern nrUE_params_t *get_nrUE_params(void);
|
||||
|
||||
#ifdef NRUE_MAIN
|
||||
nrUE_params_t nrUE_params;
|
||||
#endif
|
||||
|
||||
// In nr-ue.c
|
||||
extern int setup_nr_ue_buffers(PHY_VARS_NR_UE **phy_vars_ue, openair0_config_t *openair0_cfg);
|
||||
|
||||
@@ -89,6 +89,8 @@ extern "C"
|
||||
#define CONFIG_HLP_EMULATE_RF "Emulated RF enabled(disable by defult)\n"
|
||||
#define CONFIG_HLP_PARALLEL_CMD "three config for level of parallelism 'PARALLEL_SINGLE_THREAD', 'PARALLEL_RU_L1_SPLIT', or 'PARALLEL_RU_L1_TRX_SPLIT'\n"
|
||||
#define CONFIG_HLP_WORKER_CMD "two option for worker 'WORKER_DISABLE' or 'WORKER_ENABLE'\n"
|
||||
#define CONFIG_HLP_USRP_THREAD "having extra thead for usrp tx\n"
|
||||
|
||||
#define CONFIG_HLP_NOS1 "Disable s1 interface\n"
|
||||
#define CONFIG_HLP_RFSIM "Run in rf simulator mode (also known as basic simulator)\n"
|
||||
#define CONFIG_HLP_NOKRNMOD "(noS1 only): Use tun instead of namesh module \n"
|
||||
@@ -257,6 +259,7 @@ extern char *get_softmodem_function(uint64_t *sofmodemfunc_mask_ptr);
|
||||
extern void set_softmodem_sighandler(void);
|
||||
extern uint64_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
extern int usrp_tx_thread;
|
||||
extern uint16_t sl_ahead;
|
||||
extern uint16_t sf_ahead;
|
||||
extern volatile int oai_exit;
|
||||
|
||||
Reference in New Issue
Block a user