Commit 0db4776f authored by Siddharth Rana's avatar Siddharth Rana

Rebasing RAN/executables directory

parent 7a4d795e
/*
* 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
*/
#ifndef CREATE_NR_TASKS_H_
#define CREATE_NR_TASKS_H_
int create_gNB_tasks(uint32_t gnb_nb);
#endif /* CREATE_TASKS_H_ */
/*
* 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
*/
# include "intertask_interface.h"
# include "create_tasks.h"
# include "common/utils/LOG/log.h"
# include "executables/lte-softmodem.h"
# include "common/ran_context.h"
#include "sctp_eNB_task.h"
#include "x2ap_eNB.h"
#include "s1ap_eNB.h"
#include "openair3/ocp-gtpu/gtp_itf.h"
#if ENABLE_RAL
#include "lteRALue.h"
#include "lteRALenb.h"
#endif
#include "RRC/LTE/rrc_defs.h"
# include "f1ap_cu_task.h"
# include "f1ap_du_task.h"
# include "enb_app.h"
# include "openair2/LAYER2/MAC/mac_proto.h"
#include <executables/split_headers.h>
#include <openair3/ocp-gtpu/gtp_itf.h>
extern RAN_CONTEXT_t RC;
int create_tasks(uint32_t enb_nb) {
LOG_D(ENB_APP, "%s(enb_nb:%d\n", __FUNCTION__, enb_nb);
ngran_node_t type = RC.rrc[0]->node_type;
int rc;
if (enb_nb == 0) return 0;
LOG_I(ENB_APP, "Creating ENB_APP eNB Task\n");
rc = itti_create_task (TASK_ENB_APP, eNB_app_task, NULL);
AssertFatal(rc >= 0, "Create task for eNB APP failed\n");
LOG_I(RRC,"Creating RRC eNB Task\n");
rc = itti_create_task (TASK_RRC_ENB, rrc_enb_task, NULL);
AssertFatal(rc >= 0, "Create task for RRC eNB failed\n");
if (get_softmodem_params()->emulate_l1 || (EPC_MODE_ENABLED && split73 != SPLIT73_DU)) {
rc = itti_create_task(TASK_SCTP, sctp_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for SCTP failed\n");
}
if (EPC_MODE_ENABLED && !NODE_IS_DU(type) && ! ( split73==SPLIT73_DU ) ) {
rc = itti_create_task(TASK_S1AP, s1ap_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for S1AP failed\n");
rc = itti_create_task(TASK_GTPV1_U, gtpv1uTask, NULL);
AssertFatal(rc >= 0, "Create task for GTPV1U failed\n");
}
if (is_x2ap_enabled()) {
rc = itti_create_task(TASK_X2AP, x2ap_task, NULL);
AssertFatal(rc >= 0, "Create task for X2AP failed\n");
} else {
LOG_I(X2AP, "X2AP is disabled.\n");
}
if (NODE_IS_CU(type)) {
rc = itti_create_task(TASK_CU_F1, F1AP_CU_task, NULL);
AssertFatal(rc >= 0, "Create task for CU F1AP failed\n");
}
if (NODE_IS_DU(type)) {
rc = itti_create_task(TASK_DU_F1, F1AP_DU_task, NULL);
AssertFatal(rc >= 0, "Create task for DU F1AP failed\n");
rc = itti_create_task(TASK_GTPV1_U, gtpv1uTask, NULL);
AssertFatal(rc >= 0, "Create task for GTPV1U failed\n");
}
if (!NODE_IS_CU(type)) {
LOG_I(MAC,"Creating MAC eNB Task\n");
rc = itti_create_task(TASK_MAC_ENB, mac_enb_task, NULL);
AssertFatal(rc >= 0, "Create task for MAC eNB failed\n");
}
return 0;
}
/*
* 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
*/
#ifndef CREATE_TASKS_H_
#define CREATE_TASKS_H_
int create_tasks(uint32_t enb_nb);
int create_tasks_ue(uint32_t ue_nb);
int create_tasks_mbms(uint32_t enb_nb);
#endif /* CREATE_TASKS_H_ */
/*
* 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
*/
# include "intertask_interface.h"
# include "create_tasks.h"
# include "common/utils/LOG/log.h"
# include "executables/lte-softmodem.h"
# include "common/ran_context.h"
#include "sctp_eNB_task.h"
#include "x2ap_eNB.h"
#include "s1ap_eNB.h"
#include "openair3/ocp-gtpu/gtp_itf.h"
#include "m2ap_eNB.h"
#include "m2ap_MCE.h"
#include "m3ap_MME.h"
#include "m3ap_MCE.h"
#if ENABLE_RAL
#include "lteRALue.h"
#include "lteRALenb.h"
#endif
#include "RRC/LTE/rrc_defs.h"
# include "f1ap_cu_task.h"
# include "f1ap_du_task.h"
# include "enb_app.h"
# include "mce_app.h"
# include "mme_app.h"
#include <openair3/ocp-gtpu/gtp_itf.h>
//extern RAN_CONTEXT_t RC;
int create_tasks_mbms(uint32_t enb_nb) {
// LOG_D(ENB_APP, "%s(enb_nb:%d\n", __FUNCTION__, enb_nb);
// ngran_node_t type = RC.rrc[0]->node_type;
AssertFatal(!get_softmodem_params()->nsa, "In NSA mode\n");
int rc;
if (enb_nb == 0) return 0;
if(!EPC_MODE_ENABLED){
rc = itti_create_task(TASK_SCTP, sctp_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for SCTP failed\n");
}
LOG_I(MME_APP, "Creating MME_APP eNB Task\n");
rc = itti_create_task (TASK_MME_APP, MME_app_task, NULL);
AssertFatal(rc >= 0, "Create task for MME APP failed\n");
if (is_m3ap_MME_enabled()) {
rc = itti_create_task(TASK_M3AP_MME, m3ap_MME_task, NULL);
AssertFatal(rc >= 0, "Create task for M3AP MME failed\n");
}
LOG_I(MCE_APP, "Creating MCE_APP eNB Task\n");
rc = itti_create_task (TASK_MCE_APP, MCE_app_task, NULL);
AssertFatal(rc >= 0, "Create task for MCE APP failed\n");
if(!EPC_MODE_ENABLED){
// rc = itti_create_task(TASK_SCTP, sctp_eNB_task, NULL);
// AssertFatal(rc >= 0, "Create task for SCTP failed\n");
rc = itti_create_task(TASK_GTPV1_U, gtpv1uTask, NULL);
AssertFatal(rc >= 0, "Create task for GTPV1U failed\n");
}
///
// if (NODE_IS_CU(type)) {
// rc = itti_create_task(TASK_CU_F1, F1AP_CU_task, NULL);
// AssertFatal(rc >= 0, "Create task for CU F1AP failed\n");
// }
//
// if (NODE_IS_DU(type)) {
// rc = itti_create_task(TASK_DU_F1, F1AP_DU_task, NULL);
// AssertFatal(rc >= 0, "Create task for DU F1AP failed\n");
// }
//
if (is_m3ap_MCE_enabled()) {
rc = itti_create_task(TASK_M3AP_MCE, m3ap_MCE_task, NULL);
AssertFatal(rc >= 0, "Create task for M3AP MCE failed\n");
}
if (is_m2ap_MCE_enabled()) {
rc = itti_create_task(TASK_M2AP_MCE, m2ap_MCE_task, NULL);
AssertFatal(rc >= 0, "Create task for M2AP failed\n");
}
if (is_m2ap_eNB_enabled()) {
rc = itti_create_task(TASK_M2AP_ENB, m2ap_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for M2AP failed\n");
}
return 0;
}
/*
* 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
*/
# include "intertask_interface.h"
# include "create_tasks.h"
# include "common/utils/LOG/log.h"
# include "executables/softmodem-common.h"
#include "sctp_eNB_task.h"
#include "s1ap_eNB.h"
#include "openair3/NAS/UE/nas_ue_task.h"
#if ENABLE_RAL
#include "lteRALue.h"
#include "lteRALenb.h"
#endif
#include "RRC/LTE/rrc_defs.h"
# include "enb_app.h"
int create_tasks_ue(uint32_t ue_nb) {
LOG_D(ENB_APP, "%s(ue_nb:%d)\n", __FUNCTION__, ue_nb);
itti_wait_ready(1);
if (EPC_MODE_ENABLED) {
# if defined(NAS_BUILT_IN_UE)
if (ue_nb > 0) {
nas_user_container_t *users = calloc(1, sizeof(*users));
if (users == NULL) abort();
users->count = ue_nb;
if (itti_create_task (TASK_NAS_UE, nas_ue_task, users) < 0) {
LOG_E(NAS, "Create task for NAS UE failed\n");
return -1;
}
}
# endif
} /* EPC_MODE_ENABLED */
if (ue_nb > 0) {
if (itti_create_task (TASK_RRC_UE, rrc_ue_task, NULL) < 0) {
LOG_E(RRC, "Create task for RRC UE failed\n");
return -1;
}
if (get_softmodem_params()->nsa) {
init_connections_with_nr_ue();
LOG_I(RRC, "Started LTE-NR link in the LTE UE\n");
if (itti_create_task (TASK_RRC_NSA_UE, recv_msgs_from_nr_ue, NULL) < 0) {
LOG_E(RRC, "Create task for RRC NSA UE failed\n");
return -1;
}
}
}
itti_wait_ready(0);
return 0;
}
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -25,7 +25,7 @@
#include <common/utils/LOG/log.h>
#include <common/utils/system.h>
#include <common/config/config_userapi.h>
#include <targets/RT/USER/lte-softmodem.h>
#include "executables/lte-softmodem.h"
#include <openair1/PHY/defs_eNB.h>
#include <openair1/PHY/phy_extern.h>
#include <nfapi/oai_integration/vendor_ext.h>
......@@ -41,7 +41,7 @@
#include <executables/split_headers.h>
#include <openair1/PHY/CODING/coding_extern.h>
#include <threadPool/thread-pool.h>
#include <emmintrin.h>
#include "PHY/sse_intrin.h"
#define FS6_BUF_SIZE 1000*1000
static UDPsock_t sockFS6;
......@@ -740,6 +740,8 @@ void pusch_procedures_fromsplit(uint8_t *bufferZone, int bufSize, PHY_VARS_eNB *
while (proc->nbDecode > 0) {
notifiedFIFO_elt_t *req=pullTpool(proc->respDecode, proc->threadPool);
if (req == NULL)
break; // Tpool has been stopped
postDecode(proc, req);
delNotifiedFIFO_elt(req);
}
......
......@@ -24,11 +24,11 @@
/*
* This file replaces
* targets/RT/USER/lte-softmodem.c
* targets/RT/USER/rt_wrapper.c
* targets/RT/USER/lte-ru.c
* targets/RT/USER/lte-enb.c
* targets/RT/USER/ru_control.c
* executables/lte-softmodem.c
* executables/rt_wrapper.c
* executables/lte-ru.c
* executables/lte-enb.c
* executables/ru_control.c
* openair1/SCHED/prach_procedures.c
* The merger of OpenAir central code to this branch
* should check if these 3 files are modified and analyze if code code has to be copied in here
......@@ -42,7 +42,7 @@
static int DEFBANDS[] = {7};
static int DEFENBS[] = {0};
#include <common/config/config_userapi.h>
#include <targets/RT/USER/lte-softmodem.h>
#include "executables/lte-softmodem.h"
#include <openair1/PHY/defs_eNB.h>
#include <openair1/PHY/phy_extern.h>
#include <nfapi/oai_integration/vendor_ext.h>
......@@ -71,11 +71,12 @@ 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;
int oai_exit = 0;
double cpuf;
THREAD_STRUCT thread_struct;
uint16_t sf_ahead=4;
extern uint16_t sf_ahead; // Bell Labs
//uint16_t sf_ahead=4;
//uint16_t slot_ahead=6;
int otg_enabled;
uint64_t downlink_frequency[MAX_NUM_CCs][4];
......@@ -85,13 +86,6 @@ char *split73_config;
int split73;
AGENT_RRC_xface *agent_rrc_xface[NUM_MAX_ENB]= {0};
AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB]= {0};
void flexran_agent_slice_update(mid_t module_idP) {
}
int proto_agent_start(mid_t mod_id, const cudu_params_t *p) {
return 0;
}
void proto_agent_stop(mid_t mod_id) {
}
static void *ru_thread( void *param );
void kill_RU_proc(RU_t *ru) {
......@@ -173,7 +167,7 @@ void init_transport(PHY_VARS_eNB *eNB) {
}
for (int i=0; i<NUMBER_OF_ULSCH_MAX; i++) {
LOG_D(PHY,"Allocating Transport Channel Buffer for ULSCH, UE %d\n",i);
LOG_D(PHY,"Allocating Transport Channel Buffers for ULSCH, UE %d\n",i);
AssertFatal((eNB->ulsch[1+i] = new_eNB_ulsch(MAX_TURBO_ITERATIONS,fp->N_RB_UL, 0)) != NULL,
"Can't get eNB ulsch structures\n");
// this is the transmission mode for the signalling channels
......@@ -725,12 +719,8 @@ void ocp_tx_rf(RU_t *ru, L1_rxtx_proc_t *proc) {
}
#if defined(__x86_64) || defined(__i386__)
#ifdef __AVX2__
sf_extension = (sf_extension)&0xfffffff8;
#else
sf_extension = (sf_extension)&0xfffffffc;
#endif
#elif defined(__arm__)
#elif defined(__arm__) || defined(__aarch64__)
sf_extension = (sf_extension)&0xfffffffc;
#endif
......@@ -1080,67 +1070,12 @@ void terminate_task(module_id_t mod_id, task_id_t from, task_id_t to) {
itti_send_msg_to_task (to, ENB_MODULE_ID_TO_INSTANCE(mod_id), msg);
}
int stop_L1L2(module_id_t enb_id) {
LOG_W(ENB_APP, "stopping lte-softmodem\n");
/* these tasks need to pick up new configuration */
terminate_task(enb_id, TASK_ENB_APP, TASK_RRC_ENB);
oai_exit = 1;
LOG_I(ENB_APP, "calling kill_RU_proc() for instance %d\n", enb_id);
//kill_RU_proc(RC.ru[enb_id]);
LOG_I(ENB_APP, "calling kill_eNB_proc() for instance %d\n", enb_id);
kill_eNB_proc(enb_id);
oai_exit = 0;
for (int cc_id = 0; cc_id < RC.nb_CC[enb_id]; cc_id++) {
free_transport(RC.eNB[enb_id][cc_id]);
phy_free_lte_eNB(RC.eNB[enb_id][cc_id]);
}
//phy_free_RU(RC.ru[enb_id]);
free_lte_top();
return 0;
}
/*
* Restart the lte-softmodem after it has been soft-stopped with stop_L1L2()
*/
int restart_L1L2(module_id_t enb_id) {
RU_t *ru = NULL; //RC.ru[enb_id];
MessageDef *msg_p = NULL;
LOG_W(ENB_APP, "restarting lte-softmodem\n");
/* block threads */
pthread_mutex_lock(&sync_mutex);
sync_var = -1;
pthread_mutex_unlock(&sync_mutex);
/* copy the changed frame parameters to the RU */
/* TODO this should be done for all RUs associated to this eNB */
memcpy(&ru->frame_parms, &RC.eNB[enb_id][0]->frame_parms, sizeof(LTE_DL_FRAME_PARMS));
/* reset the list of connected UEs in the MAC, since in this process with
* loose all UEs (have to reconnect) */
init_UE_info(&RC.mac[enb_id]->UE_info);
LOG_I(ENB_APP, "attempting to create ITTI tasks\n");
// No more rrc thread, as many race conditions are hidden behind
rrc_enb_init();
itti_mark_task_ready(TASK_RRC_ENB);
/* pass a reconfiguration request which will configure everything down to
* RC.eNB[i][j]->frame_parms, too */
msg_p = itti_alloc_new_message(TASK_ENB_APP, 0, RRC_CONFIGURATION_REQ);
RRC_CONFIGURATION_REQ(msg_p) = RC.rrc[enb_id]->configuration;
itti_send_msg_to_task(TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
init_eNB_afterRU();
printf("Sending sync to all threads\n");
pthread_mutex_lock(&sync_mutex);
sync_var=0;
pthread_cond_broadcast(&sync_cond);
pthread_mutex_unlock(&sync_mutex);
return 0;
}
int main ( int argc, char **argv ) {
//mtrace();
int i;
int CC_id = 0;
int node_type = ngran_eNB;
sf_ahead=4; // Bell Labs
AssertFatal(load_configmodule(argc,argv,0), "[SOFTMODEM] Error, configuration module init failed\n");
logInit();
printf("Reading in command-line options\n");
......@@ -1179,8 +1114,6 @@ int main ( int argc, char **argv ) {
// some initialization is necessary and init_ru_vnf do this.
RU_t ru;
/* We need to read RU configuration before FlexRAN starts so it knows what
* splits to report. Actual RU start comes later. */
if ( NFAPI_MODE != NFAPI_MODE_VNF) {
ocpRCconfig_RU(&ru);
LOG_I(PHY,
......@@ -1203,9 +1136,6 @@ int main ( int argc, char **argv ) {
if (RC.nb_inst > 0) {
/* Start the agent. If it is turned off in the configuration, it won't start */
for (i = 0; i < RC.nb_inst; i++) {
//flexran_agent_start(i);
}
/* initializes PDCP and sets correct RLC Request/PDCP Indication callbacks
* for monolithic/F1 modes */
......@@ -1273,11 +1203,7 @@ int main ( int argc, char **argv ) {
L1proc->respEncode=(notifiedFIFO_t *) malloc(sizeof(notifiedFIFO_t));
L1proc->respDecode=(notifiedFIFO_t *) malloc(sizeof(notifiedFIFO_t));
if ( strlen(get_softmodem_params()->threadPoolConfig) > 0 )
initTpool(get_softmodem_params()->threadPoolConfig, L1proc->threadPool, true);
else
initTpool("n", L1proc->threadPool, true);
initTpool(get_softmodem_params()->threadPoolConfig, L1proc->threadPool,cpumeas(CPUMEAS_GETSTATE));
initNotifiedFIFO(L1proc->respEncode);
initNotifiedFIFO(L1proc->respDecode);
}
......
......@@ -45,8 +45,8 @@
#include "common/utils/load_module_shlib.h"
#include "../../ARCH/COMMON/common_lib.h"
#include "../../ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
#include "radio/COMMON/common_lib.h"
#include "radio/ETHERNET/USERSPACE/LIB/if_defs.h"
#include "PHY/phy_vars.h"
......@@ -66,6 +66,7 @@ static int DEFBANDS[] = {7};
static int DEFENBS[] = {0};
static int DEFBFW[] = {0x00007fff};
static int DEFRUTPCORES[] = {2,4,6,8};
THREAD_STRUCT thread_struct;
pthread_cond_t sync_cond;
......@@ -73,7 +74,7 @@ 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;
int oai_exit = 0;
uint16_t sf_ahead = 4;
RU_t ru_m;
......
This diff is collapsed.
This diff is collapsed.
......@@ -24,7 +24,7 @@
#include <unistd.h>
#include <sys/sysinfo.h>
#include "targets/ARCH/COMMON/common_lib.h"
#include "radio/COMMON/common_lib.h"
#undef MALLOC
#include "assertions.h"
#include "PHY/types.h"
......@@ -51,10 +51,9 @@
#define CONFIG_HLP_UEFO "set UE to enable estimation and compensation of frequency offset\n"
#define CONFIG_HLP_DUMPFRAME "dump UE received frame to rxsig_frame0.dat and exit\n"
#define CONFIG_HLP_DLSHIFT "dynamic shift for LLR compuation for TM3/4 (default 0)\n"
#define CONFIG_HLP_UELOOP "get softmodem (UE) to loop through memory instead of acquiring from HW\n"
#define CONFIG_HLP_PHYTST "test UE phy layer, mac disabled\n"
#define CONFIG_HLP_DORA "test gNB and UE with RA procedures\n"
#define CONFIG_HLP_DMAMAP "sets flag for improved EXMIMO UE performance\n"
#define CONFIG_HLP_DMAMAP "use DMA memory mapping\n"
#define CONFIG_HLP_EXCCLK "tells hardware to use a clock reference (0:internal(default), 1:external, 2:gpsdo)\n"
#define CONFIG_HLP_USIM "use XOR autentication algo in case of test usim mode\n"
#define CONFIG_HLP_NOSNGLT "Disables single-thread mode in lte-softmodem\n"
......@@ -63,10 +62,10 @@
#define CONFIG_HLP_ULOFF "Set the uplink frequnecy offset for all component carriers\n"
#define CONFIG_HLP_CHOFF "Channel id offset\n"
#define CONFIG_HLP_SOFTS "Enable soft scope and L1 and L2 stats (Xforms)\n"
#define CONFIG_HLP_EXMCAL "Calibrate the EXMIMO borad, available files: exmimo2_2arxg.lime exmimo2_2brxg.lime \n"
#define CONFIG_HLP_ITTIL "Generate ITTI analyzser logs (similar to wireshark logs but with more details)\n"
#define CONFIG_HLP_DLMCS_PHYTEST "Set the downlink MCS for PHYTEST mode\n"
#define CONFIG_HLP_DLNL_PHYTEST "Set the downlink nrOfLayers for PHYTEST mode\n"
#define CONFIG_HLP_ULNL_PHYTEST "Set the uplink nrOfLayers for PHYTEST mode\n"
#define CONFIG_HLP_STMON "Enable processing timing measurement of lte softmodem on per subframe basis \n"
#define CONFIG_HLP_MSLOTS "Skip the missed slots/subframes \n"
#define CONFIG_HLP_ULMCS_PHYTEST "Set the uplink MCS for PHYTEST mode\n"
......@@ -97,8 +96,10 @@
#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_DISABLNBIOT "disable nb-iot, even if defined in config\n"
#define CONFIG_HLP_LDPC_OFFLOAD "enable LDPC offload\n"
#define CONFIG_HLP_USRP_ARGS "set the arguments to identify USRP (same syntax as in UHD)\n"
#define CONFIG_HLP_TX_SUBDEV "set the arguments to select tx_subdev (same syntax as in UHD)\n"
#define CONFIG_HLP_RX_SUBDEV "set the arguments to select rx_subdev (same syntax as in UHD)\n"
#define CONFIG_HLP_FLOG "Enable online log \n"
#define CONFIG_HLP_LOGL "Set the global log level, valid options: (4:trace, 3:debug, 2:info, 1:warn, (0:error))\n"
......@@ -138,7 +139,7 @@ extern int rx_input_level_dBm;
extern uint64_t num_missed_slots; // counter for the number of missed slots
extern int oaisim_flag;
extern volatile int oai_exit;
extern int oai_exit;
extern openair0_config_t openair0_cfg[MAX_CARDS];
extern pthread_cond_t sync_cond;
......
......@@ -39,8 +39,8 @@
#undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all
//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
#include "../../ARCH/COMMON/common_lib.h"
#include "../../ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
#include "radio/COMMON/common_lib.h"
#include "radio/ETHERNET/USERSPACE/LIB/if_defs.h"
//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
......@@ -51,7 +51,7 @@
#include "PHY_INTERFACE/phy_interface_vars.h"
#include "gnb_config.h"
#include "SIMULATION/TOOLS/sim.h"
#include <targets/RT/USER/lte-softmodem.h>
#include "executables/lte-softmodem.h"
#ifdef SMBV
#include "PHY/TOOLS/smbv.h"
......@@ -320,7 +320,7 @@ int create_gNB_tasks(uint32_t gnb_nb) {
}
}
if (AMF_MODE_ENABLED) {
if (get_softmodem_params()->sa) {
char* gnb_ipv4_address_for_NGU = NULL;
uint32_t gnb_port_for_NGU = 0;
......@@ -778,7 +778,7 @@ int main( int argc, char **argv ) {
printf("wait_gNBs()\n");
wait_gNBs();
printf("About to Init RU threads RC.nb_RU:%d\n", RC.nb_RU);
int sl_ahead=6;
if (RC.nb_RU >0) {
printf("Initializing RU threads\n");
init_NR_RU(get_softmodem_params()->rf_config_file);
......@@ -786,7 +786,10 @@ int main( int argc, char **argv ) {
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.chain=CC_id+chain_offset;
if (ru_id==0) sl_ahead = RC.ru[ru_id]->sl_ahead;
else AssertFatal(RC.ru[ru_id]->sl_ahead != RC.ru[0]->sl_ahead,"RU %d has different sl_ahead %d than RU 0 %d\n",ru_id,RC.ru[ru_id]->sl_ahead,RC.ru[0]->sl_ahead);
}
}
config_sync_var=0;
......@@ -803,6 +806,7 @@ int main( int argc, char **argv ) {
// once all RUs are ready initialize the rest of the gNBs ((dependence on final RU parameters after configuration)
printf("ALL RUs ready - init gNBs\n");
for (int idx=0;idx<RC.nb_nr_L1_inst;idx++) RC.gNB[idx]->if_inst->sl_ahead = sl_ahead;
if(IS_SOFTMODEM_DOSCOPE) {
sleep(1);
scopeParms_t p;
......@@ -839,6 +843,7 @@ int main( int argc, char **argv ) {
printf("TYPE <CTRL-C> TO TERMINATE\n");
//getchar();
printf("Entering ITTI signals handler\n");
printf("TYPE <CTRL-C> TO TERMINATE\n");
itti_wait_tasks_end();
printf("Returned from ITTI signal handler\n");
oai_exit=1;
......@@ -867,21 +872,20 @@ int main( int argc, char **argv ) {
#endif*/
printf("stopping MODEM threads\n");
// cleanup
stop_gNB(NB_gNB_INST);
if (RC.nb_nr_L1_inst > 0)
stop_gNB(RC.nb_nr_L1_inst);
if (RC.nb_nr_L1_inst > 0) {
stop_RU(NB_RU);
}
if (RC.nb_RU > 0)
stop_RU(RC.nb_RU);
/* release memory used by the RU/gNB threads (incomplete), after all
* threads have been stopped (they partially use the same memory) */
for (int inst = 0; inst < NB_gNB_INST; inst++) {
//free_transport(RC.gNB[inst]);
phy_free_nr_gNB(RC.gNB[inst]);
for (int inst = 0; inst < RC.nb_RU; inst++) {
nr_phy_free_RU(RC.ru[inst]);
}
for (int inst = 0; inst < NB_RU; inst++) {
nr_phy_free_RU(RC.ru[inst]);
for (int inst = 0; inst < RC.nb_nr_L1_inst; inst++) {
phy_free_nr_gNB(RC.gNB[inst]);
}
free_lte_top();
......
......@@ -3,7 +3,6 @@
#include <executables/nr-softmodem-common.h>
#include "flexran_agent.h"
#include "PHY/defs_gNB.h"
#define DEFAULT_DLF 2680000000
......@@ -22,26 +21,28 @@
{"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, i8ptr:&threequarter_fs, defintval:0, TYPE_INT8, 0}, \
{"m" , CONFIG_HLP_DLMCS_PHYTEST,0, uptr:&target_dl_mcs, defintval:0, TYPE_UINT, 0}, \
{"l" , CONFIG_HLP_DLNL_PHYTEST,0, uptr:&target_dl_Nl, defintval:0, TYPE_UINT, 0}, \
{"L" , CONFIG_HLP_ULNL_PHYTEST,0, uptr:&target_ul_Nl, defintval:0, TYPE_UINT, 0}, \
{"t" , CONFIG_HLP_ULMCS_PHYTEST,0, uptr:&target_ul_mcs, defintval:0, TYPE_UINT, 0}, \
{"M" , CONFIG_HLP_DLBW_PHYTEST,0, uptr:&target_dl_bw, defintval:0, TYPE_UINT, 0}, \
{"T" , CONFIG_HLP_ULBW_PHYTEST,0, uptr:&target_ul_bw, defintval:0, TYPE_UINT, 0}, \
{"D" , CONFIG_HLP_DLBM_PHYTEST,0, u64ptr:&dlsch_slot_bitmap, defintval:0, TYPE_UINT64, 0}, \
{"U" , CONFIG_HLP_ULBM_PHYTEST,0, u64ptr:&ulsch_slot_bitmap, defintval:0, TYPE_UINT64, 0}, \
{"usrp-tx-thread-config", CONFIG_HLP_USRP_THREAD, 0, iptr:&usrp_tx_thread, defstrval:0, TYPE_INT, 0}, \
{"uecap_file", CONFIG_HLP_UECAP_FILE, 0, strptr:(char **)&uecap_file, defstrval:"./uecap.xml", TYPE_STRING, 0}, \
{"ldpc-offload-enable", CONFIG_HLP_LDPC_OFFLOAD, 0, iptr:&ldpc_offload_flag, defstrval:0, TYPE_INT, 0}, \
{"uecap_file", CONFIG_HLP_UECAP_FILE, 0, strptr:&uecap_file, defstrval:"./uecap_ports1.xml",TYPE_STRING, 0}, \
{"s" , CONFIG_HLP_SNR, 0, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0}, \
}
#include "threads_t.h"
extern threads_t threads;
extern uint32_t target_dl_mcs;
extern uint32_t target_dl_Nl;
extern uint32_t target_ul_Nl;
extern uint32_t target_ul_mcs;
extern uint32_t target_dl_bw;
extern uint32_t target_ul_bw;
extern uint64_t dlsch_slot_bitmap;
extern uint64_t ulsch_slot_bitmap;
extern char *uecap_file;
extern int ldpc_offload_flag;
// In nr-gnb.c
extern void init_gNB(int single_thread_flag,int wait_for_sync);
......@@ -57,13 +58,8 @@ extern void set_function_spec_param(RU_t *ru);
extern void reset_opp_meas(void);
extern void print_opp_meas(void);
extern void init_fep_thread(PHY_VARS_gNB *);
void init_gNB_afterRU(void);
extern int stop_L1L2(module_id_t gnb_id);
extern int restart_L1L2(module_id_t gnb_id);
void init_pdcp(void);
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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