Merge branch 'develop' into prb_based_dl_channel_estimation
This commit is contained in:
@@ -73,7 +73,6 @@ int sync_var=-1; //!< protected by mutex \ref sync_mutex.
|
||||
int config_sync_var=-1;
|
||||
volatile int oai_exit = 0;
|
||||
double cpuf;
|
||||
msc_interface_t msc_interface;
|
||||
THREAD_STRUCT thread_struct;
|
||||
|
||||
uint16_t sf_ahead=4;
|
||||
@@ -86,6 +85,7 @@ 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};
|
||||
uint8_t proto_agent_flag = 0;
|
||||
void flexran_agent_slice_update(mid_t module_idP) {
|
||||
}
|
||||
int proto_agent_start(mod_id_t mod_id, const cudu_params_t *p){
|
||||
|
||||
+22
-1
@@ -87,6 +87,8 @@
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#include "executables/softmodem-common.h"
|
||||
#include <nfapi/oai_integration/nfapi_pnf.h>
|
||||
#include <openair1/PHY/NR_TRANSPORT/nr_ulsch.h>
|
||||
#include <PHY/NR_ESTIMATION/nr_ul_estimation.h>
|
||||
//#define DEBUG_THREADS 1
|
||||
|
||||
//#define USRP_DEBUG 1
|
||||
@@ -348,6 +350,22 @@ static void *process_stats_thread(void *param) {
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
void *nrL1_stats_thread(void *param) {
|
||||
PHY_VARS_gNB *gNB = (PHY_VARS_gNB *)param;
|
||||
wait_sync("L1_stats_thread");
|
||||
FILE *fd;
|
||||
while (!oai_exit) {
|
||||
sleep(1);
|
||||
fd=fopen("nrL1_stats.log","w");
|
||||
AssertFatal(fd!=NULL,"Cannot open nrL1_stats.log\n");
|
||||
dump_nr_I0_stats(fd,gNB);
|
||||
dump_pusch_stats(fd,gNB);
|
||||
// nr_dump_uci_stats(fd,eNB,eNB->proc.L1_proc_tx.frame_tx);
|
||||
fclose(fd);
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
void init_gNB_Tpool(int inst) {
|
||||
PHY_VARS_gNB *gNB;
|
||||
gNB = RC.gNB[inst];
|
||||
@@ -366,6 +384,7 @@ void init_gNB_Tpool(int inst) {
|
||||
sprintf(ul_pool+2+s_offset,",-1");
|
||||
s_offset += 3;
|
||||
}
|
||||
if (getenv("noThreads")) strcpy(ul_pool, "n");
|
||||
initTpool(ul_pool, gNB->threadPool, false);
|
||||
// ULSCH decoder result FIFO
|
||||
gNB->respDecode = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
|
||||
@@ -384,7 +403,9 @@ void init_gNB_Tpool(int inst) {
|
||||
initNotifiedFIFO(gNB->resp_RU_tx);
|
||||
|
||||
// Stats measurement thread
|
||||
if(opp_enabled == 1) threadCreate(&proc->L1_stats_thread, process_stats_thread,(void *)gNB, "time_meas", -1, OAI_PRIORITY_RT_LOW);
|
||||
if(opp_enabled == 1) threadCreate(&proc->process_stats_thread, process_stats_thread,(void *)gNB, "time_meas", -1, OAI_PRIORITY_RT_LOW);
|
||||
threadCreate(&proc->L1_stats_thread,nrL1_stats_thread,(void*)gNB,"L1_stats",-1,OAI_PRIORITY_RT_LOW);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
+29
-26
@@ -24,14 +24,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sched.h>
|
||||
#include <linux/sched.h>
|
||||
#include <signal.h>
|
||||
#include <execinfo.h>
|
||||
#include <getopt.h>
|
||||
#include <sys/sysinfo.h>
|
||||
#include <math.h>
|
||||
|
||||
@@ -39,7 +33,6 @@
|
||||
|
||||
#include "common/utils/assertions.h"
|
||||
#include "common/utils/system.h"
|
||||
#include "msc.h"
|
||||
|
||||
#include "../../ARCH/COMMON/common_lib.h"
|
||||
#include "../../ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h"
|
||||
@@ -50,20 +43,15 @@
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs_nr_common.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
#include "SCHED/sched_eNB.h"
|
||||
#include "SCHED_NR/sched_nr.h"
|
||||
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
|
||||
#include "RRC/LTE/rrc_extern.h"
|
||||
#include "PHY_INTERFACE/phy_interface.h"
|
||||
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
#include "enb_config.h"
|
||||
#include <executables/softmodem-common.h>
|
||||
|
||||
#ifdef SMBV
|
||||
@@ -758,9 +746,9 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
|
||||
// currently we switch beams every 10 slots (should = 1 TDD period in FR2) and we take the beam index of the first symbol of the first slot of this period
|
||||
int beam=0;
|
||||
if (slot%10==0) {
|
||||
if (ru->common.beam_id[0][slot*fp->symbols_per_slot] < 8) {
|
||||
beam = ru->common.beam_id[0][slot*fp->symbols_per_slot] | 8;
|
||||
}
|
||||
if ( ru->common.beam_id && (ru->common.beam_id[0][slot*fp->symbols_per_slot] < 8)) {
|
||||
beam = ru->common.beam_id[0][slot*fp->symbols_per_slot] | 8;
|
||||
}
|
||||
}
|
||||
/*
|
||||
if (slot==0 || slot==40) beam=0|8;
|
||||
@@ -904,6 +892,18 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
|
||||
cfg->tx_bw = 80e6;
|
||||
cfg->rx_bw = 80e6;
|
||||
}
|
||||
break;
|
||||
case 133 :
|
||||
if (fp->threequarter_fs) {
|
||||
AssertFatal(1==0,"N_RB %d cannot use 3/4 sampling\n",N_RB);
|
||||
}
|
||||
else {
|
||||
cfg->sample_rate=61.44e6;
|
||||
cfg->samples_per_frame = 614400;
|
||||
cfg->tx_bw = 50e6;
|
||||
cfg->rx_bw = 50e6;
|
||||
}
|
||||
|
||||
break;
|
||||
case 106:
|
||||
if (fp->threequarter_fs) {
|
||||
@@ -918,7 +918,7 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
|
||||
cfg->tx_bw = 40e6;
|
||||
cfg->rx_bw = 40e6;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case 51:
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=23.04e6;
|
||||
@@ -1948,39 +1948,41 @@ static void NRRCconfig_RU(void)
|
||||
if (config_isparamset(RUParamList.paramarray[j], RU_SDR_CLK_SRC)) {
|
||||
if (strcmp(*(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr), "internal") == 0) {
|
||||
RC.ru[j]->openair0_cfg.clock_source = internal;
|
||||
LOG_D(PHY, "RU clock source set as internal\n");
|
||||
LOG_I(PHY, "RU clock source set as internal\n");
|
||||
} else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr), "external") == 0) {
|
||||
RC.ru[j]->openair0_cfg.clock_source = external;
|
||||
LOG_D(PHY, "RU clock source set as external\n");
|
||||
LOG_I(PHY, "RU clock source set as external\n");
|
||||
} else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr), "gpsdo") == 0) {
|
||||
RC.ru[j]->openair0_cfg.clock_source = gpsdo;
|
||||
LOG_D(PHY, "RU clock source set as gpsdo\n");
|
||||
LOG_I(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 {
|
||||
RC.ru[j]->openair0_cfg.clock_source = unset;
|
||||
LOG_I(PHY,"Setting clock source to internal\n");
|
||||
RC.ru[j]->openair0_cfg.clock_source = internal;
|
||||
}
|
||||
|
||||
if (config_isparamset(RUParamList.paramarray[j], RU_SDR_TME_SRC)) {
|
||||
if (strcmp(*(RUParamList.paramarray[j][RU_SDR_TME_SRC].strptr), "internal") == 0) {
|
||||
RC.ru[j]->openair0_cfg.time_source = internal;
|
||||
LOG_D(PHY, "RU time source set as internal\n");
|
||||
LOG_I(PHY, "RU time source set as internal\n");
|
||||
} else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_TME_SRC].strptr), "external") == 0) {
|
||||
RC.ru[j]->openair0_cfg.time_source = external;
|
||||
LOG_D(PHY, "RU time source set as external\n");
|
||||
LOG_I(PHY, "RU time source set as external\n");
|
||||
} else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_TME_SRC].strptr), "gpsdo") == 0) {
|
||||
RC.ru[j]->openair0_cfg.time_source = gpsdo;
|
||||
LOG_D(PHY, "RU time source set as gpsdo\n");
|
||||
LOG_I(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 {
|
||||
RC.ru[j]->openair0_cfg.time_source = unset;
|
||||
LOG_I(PHY,"Setting time source to internal\n");
|
||||
RC.ru[j]->openair0_cfg.time_source = internal;
|
||||
}
|
||||
|
||||
|
||||
if (strcmp(*(RUParamList.paramarray[j][RU_LOCAL_RF_IDX].strptr), "yes") == 0) {
|
||||
if ( !(config_isparamset(RUParamList.paramarray[j],RU_LOCAL_IF_NAME_IDX)) ) {
|
||||
RC.ru[j]->if_south = LOCAL_RF;
|
||||
@@ -2050,7 +2052,7 @@ static void NRRCconfig_RU(void)
|
||||
RC.ru[j]->if_south = REMOTE_IF4p5;
|
||||
RC.ru[j]->function = NGFI_RAU_IF4p5;
|
||||
RC.ru[j]->eth_params.transp_preference = ETH_RAW_IF4p5_MODE;
|
||||
}
|
||||
}
|
||||
} /* strcmp(local_rf, "yes") != 0 */
|
||||
|
||||
RC.ru[j]->nb_tx = *(RUParamList.paramarray[j][RU_NB_TX_IDX].uptr);
|
||||
@@ -2059,6 +2061,7 @@ static void NRRCconfig_RU(void)
|
||||
RC.ru[j]->att_rx = *(RUParamList.paramarray[j][RU_ATT_RX_IDX].uptr);
|
||||
RC.ru[j]->if_frequency = *(RUParamList.paramarray[j][RU_IF_FREQUENCY].u64ptr);
|
||||
RC.ru[j]->if_freq_offset = *(RUParamList.paramarray[j][RU_IF_FREQ_OFFSET].iptr);
|
||||
RC.ru[j]->do_precoding = *(RUParamList.paramarray[j][RU_DO_PRECODING].iptr);
|
||||
|
||||
if (config_isparamset(RUParamList.paramarray[j], RU_BF_WEIGHTS_LIST_IDX)) {
|
||||
RC.ru[j]->nb_bfw = RUParamList.paramarray[j][RU_BF_WEIGHTS_LIST_IDX].numelt;
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
#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_STMON "Enable processing timing measurement of lte softmodem on per subframe basis \n"
|
||||
#define CONFIG_HLP_PRB "Set the PRB, valid values: 6, 25, 50, 100 \n"
|
||||
#define CONFIG_HLP_MSLOTS "Skip the missed slots/subframes \n"
|
||||
|
||||
+71
-60
@@ -98,7 +98,6 @@ 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;
|
||||
msc_interface_t msc_interface;
|
||||
|
||||
volatile int start_gNB = 0;
|
||||
volatile int oai_exit = 0;
|
||||
@@ -165,6 +164,8 @@ uint32_t timing_advance = 0;
|
||||
uint64_t num_missed_slots=0; // counter for the number of missed slots
|
||||
|
||||
#include <executables/split_headers.h>
|
||||
#include <SIMULATION/ETH_TRANSPORT/proto.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");
|
||||
@@ -344,7 +345,7 @@ int create_gNB_tasks(uint32_t gnb_nb) {
|
||||
}
|
||||
|
||||
|
||||
if (AMF_MODE_ENABLED && (get_softmodem_params()->phy_test==0 && get_softmodem_params()->do_ra==0 && get_softmodem_params()->sa==0)) {
|
||||
if (AMF_MODE_ENABLED) {
|
||||
if (gnb_nb > 0) {
|
||||
/*
|
||||
if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) {
|
||||
@@ -369,25 +370,31 @@ int create_gNB_tasks(uint32_t gnb_nb) {
|
||||
}
|
||||
}
|
||||
|
||||
if (itti_create_task (TASK_GTPV1_U, >pv1u_gNB_task, NULL) < 0) {
|
||||
/*if (itti_create_task (TASK_GTPV1_U, &nr_gtpv1u_gNB_task, NULL) < 0) {
|
||||
LOG_E(GTPU, "Create task for GTPV1U failed\n");
|
||||
return -1;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (gnb_nb > 0) {
|
||||
if (itti_create_task (TASK_GNB_APP, gNB_app_task, NULL) < 0) {
|
||||
LOG_E(GNB_APP, "Create task for gNB APP failed\n");
|
||||
return -1;
|
||||
}
|
||||
LOG_I(NR_RRC,"Creating NR RRC gNB Task\n");
|
||||
|
||||
LOG_I(NR_RRC,"Creating NR RRC gNB Task\n");
|
||||
if (itti_create_task (TASK_RRC_GNB, rrc_gnb_task, NULL) < 0) {
|
||||
LOG_E(NR_RRC, "Create task for NR RRC gNB failed\n");
|
||||
return -1;
|
||||
}
|
||||
//Use check on x2ap to consider the NSA scenario and check on AMF_MODE_ENABLED for the SA scenario
|
||||
if(is_x2ap_enabled() || AMF_MODE_ENABLED){
|
||||
if (itti_create_task (TASK_GTPV1_U, &nr_gtpv1u_gNB_task, NULL) < 0) {
|
||||
LOG_E(GTPU, "Create task for GTPV1U failed\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -623,33 +630,36 @@ static void wait_nfapi_init(char *thread_name) {
|
||||
}
|
||||
|
||||
void init_pdcp(void) {
|
||||
//if (!NODE_IS_DU(RC.rrc[0]->node_type)) {
|
||||
pdcp_layer_init();
|
||||
uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ?
|
||||
(PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT;
|
||||
if (!NODE_IS_DU(RC.nrrrc[0]->node_type)) {
|
||||
// pdcp_layer_init();
|
||||
uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ?
|
||||
(PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT;
|
||||
if (IS_SOFTMODEM_NOS1) {
|
||||
printf("IS_SOFTMODEM_NOS1 option enabled \n");
|
||||
pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT;
|
||||
}
|
||||
|
||||
if (IS_SOFTMODEM_NOS1) {
|
||||
printf("IS_SOFTMODEM_NOS1 option enabled \n");
|
||||
pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT ;
|
||||
}
|
||||
pdcp_module_init(pdcp_initmask);
|
||||
|
||||
pdcp_module_init(pdcp_initmask);
|
||||
|
||||
/*if (NODE_IS_CU(RC.rrc[0]->node_type)) {
|
||||
pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t)proto_agent_send_rlc_data_req);
|
||||
} else {*/
|
||||
pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req);
|
||||
pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
|
||||
//}
|
||||
/*} else {
|
||||
if (NODE_IS_CU(RC.nrrrc[0]->node_type)) {
|
||||
LOG_I(PDCP, "node is CU, pdcp send rlc_data_req by proto_agent \n");
|
||||
pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t)proto_agent_send_rlc_data_req);
|
||||
} else {
|
||||
LOG_I(PDCP, "node is gNB \n");
|
||||
pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req);
|
||||
pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
|
||||
}
|
||||
} else {
|
||||
LOG_I(PDCP, "node is DU, rlc send pdcp_data_ind by proto_agent \n");
|
||||
pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) proto_agent_send_pdcp_data_ind);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main( int argc, char **argv )
|
||||
{
|
||||
int ru_id, CC_id = 0;
|
||||
|
||||
start_background_system();
|
||||
|
||||
///static configuration for NR at the moment
|
||||
@@ -675,8 +685,8 @@ int main( int argc, char **argv )
|
||||
}
|
||||
|
||||
openair0_cfg[0].threequarter_fs = threequarter_fs;
|
||||
AMF_MODE_ENABLED = !IS_SOFTMODEM_NOS1; //!get_softmodem_params()->phy_test;
|
||||
NGAP_CONF_MODE = !IS_SOFTMODEM_NOS1; //!get_softmodem_params()->phy_test;
|
||||
AMF_MODE_ENABLED = get_softmodem_params()->sa;
|
||||
NGAP_CONF_MODE = get_softmodem_params()->sa;
|
||||
|
||||
if (get_softmodem_params()->do_ra)
|
||||
AssertFatal(get_softmodem_params()->phy_test == 0,"RA and phy_test are mutually exclusive\n");
|
||||
@@ -717,15 +727,11 @@ if(!IS_SOFTMODEM_NOS1)
|
||||
#endif
|
||||
LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
|
||||
|
||||
if(IS_SOFTMODEM_NOS1)
|
||||
init_pdcp();
|
||||
|
||||
if (RC.nb_nr_L1_inst > 0)
|
||||
RCconfig_NR_L1();
|
||||
if (RC.nb_nr_inst > 0) {
|
||||
|
||||
// don't create if node doesn't connect to RRC/S1/GTP
|
||||
AssertFatal(create_gNB_tasks(1) == 0,"cannot create ITTI tasks\n");
|
||||
}
|
||||
|
||||
/* Start the agent. If it is turned off in the configuration, it won't start */
|
||||
/*
|
||||
@@ -806,36 +812,38 @@ if(!IS_SOFTMODEM_NOS1)
|
||||
wait_nfapi_init("main?");
|
||||
}
|
||||
|
||||
printf("wait RUs\n");
|
||||
wait_RUs();
|
||||
printf("ALL RUs READY!\n");
|
||||
printf("RC.nb_RU:%d\n", RC.nb_RU);
|
||||
// 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");
|
||||
if(IS_SOFTMODEM_DOSCOPE) {
|
||||
sleep(1);
|
||||
scopeParms_t p;
|
||||
p.argc=&argc;
|
||||
p.argv=argv;
|
||||
p.gNB=RC.gNB[0];
|
||||
p.ru=RC.ru[0];
|
||||
load_softscope("nr",&p);
|
||||
}
|
||||
if (RC.nb_nr_L1_inst > 0) {
|
||||
printf("wait RUs\n");
|
||||
wait_RUs();
|
||||
printf("ALL RUs READY!\n");
|
||||
printf("RC.nb_RU:%d\n", RC.nb_RU);
|
||||
// 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");
|
||||
if(IS_SOFTMODEM_DOSCOPE) {
|
||||
sleep(1);
|
||||
scopeParms_t p;
|
||||
p.argc=&argc;
|
||||
p.argv=argv;
|
||||
p.gNB=RC.gNB[0];
|
||||
p.ru=RC.ru[0];
|
||||
load_softscope("nr",&p);
|
||||
}
|
||||
|
||||
if (NFAPI_MODE != NFAPI_MODE_PNF && NFAPI_MODE != NFAPI_MODE_VNF) {
|
||||
printf("Not NFAPI mode - call init_eNB_afterRU()\n");
|
||||
init_eNB_afterRU();
|
||||
} else {
|
||||
printf("NFAPI mode - DO NOT call init_gNB_afterRU()\n");
|
||||
}
|
||||
if (NFAPI_MODE != NFAPI_MODE_PNF && NFAPI_MODE != NFAPI_MODE_VNF) {
|
||||
printf("Not NFAPI mode - call init_eNB_afterRU()\n");
|
||||
init_eNB_afterRU();
|
||||
} else {
|
||||
printf("NFAPI mode - DO NOT call init_gNB_afterRU()\n");
|
||||
}
|
||||
|
||||
printf("ALL RUs ready - ALL gNBs ready\n");
|
||||
// connect the TX/RX buffers
|
||||
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);
|
||||
printf("ALL RUs ready - ALL gNBs ready\n");
|
||||
// connect the TX/RX buffers
|
||||
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);
|
||||
}
|
||||
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__);
|
||||
@@ -873,7 +881,10 @@ if(!IS_SOFTMODEM_NOS1)
|
||||
printf("stopping MODEM threads\n");
|
||||
// cleanup
|
||||
stop_gNB(NB_gNB_INST);
|
||||
stop_RU(NB_RU);
|
||||
|
||||
if (RC.nb_nr_L1_inst > 0) {
|
||||
stop_RU(NB_RU);
|
||||
}
|
||||
|
||||
/* release memory used by the RU/gNB threads (incomplete), after all
|
||||
* threads have been stopped (they partially use the same memory) */
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
{"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \
|
||||
{"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}, \
|
||||
{"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}, \
|
||||
@@ -34,6 +35,7 @@
|
||||
#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_mcs;
|
||||
extern uint32_t target_dl_bw;
|
||||
extern uint32_t target_ul_bw;
|
||||
|
||||
+10
-3
@@ -290,6 +290,7 @@ void processSlotTX(void *arg) {
|
||||
int tx_slot_type = nr_ue_slot_select(cfg, proc->frame_tx, proc->nr_slot_tx);
|
||||
uint8_t gNB_id = 0;
|
||||
|
||||
LOG_D(PHY,"%d.%d => slot type %d\n",proc->frame_tx,proc->nr_slot_tx,tx_slot_type);
|
||||
if (tx_slot_type == NR_UPLINK_SLOT || tx_slot_type == NR_MIXED_SLOT){
|
||||
|
||||
// trigger L2 to run ue_scheduler thru IF module
|
||||
@@ -343,7 +344,7 @@ void processSlotRX(void *arg) {
|
||||
LOG_D(PHY, "In %s: slot %d, time %lu\n", __FUNCTION__, proc->nr_slot_rx, (rdtsc()-a)/3500);
|
||||
#endif
|
||||
|
||||
if(IS_SOFTMODEM_NOS1){
|
||||
if(IS_SOFTMODEM_NOS1 || get_softmodem_params()->sa){
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(0);
|
||||
protocol_ctxt_t ctxt;
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, UE->Mod_id, ENB_FLAG_NO, mac->crnti, proc->frame_rx, proc->nr_slot_rx, 0);
|
||||
@@ -607,7 +608,7 @@ void *UE_thread(void *arg) {
|
||||
thread_idx = absolute_slot % NR_RX_NB_TH;
|
||||
int slot_nr = absolute_slot % nb_slot_frame;
|
||||
notifiedFIFO_elt_t *msgToPush;
|
||||
AssertFatal((msgToPush=pullTpool(&freeBlocks,&(get_nrUE_params()->Tpool))) != NULL,"chained list failure");
|
||||
AssertFatal((msgToPush=pullNotifiedFIFO_nothreadSafe(&freeBlocks)) != NULL,"chained list failure");
|
||||
nr_rxtx_thread_data_t *curMsg=(nr_rxtx_thread_data_t *)NotifiedFifoData(msgToPush);
|
||||
curMsg->UE=UE;
|
||||
// update thread index for received subframe
|
||||
@@ -714,7 +715,13 @@ void *UE_thread(void *arg) {
|
||||
if (openair0_cfg[0].duplex_mode == duplex_mode_TDD) {
|
||||
|
||||
uint8_t tdd_period = mac->phy_config.config_req.tdd_table.tdd_period_in_slots;
|
||||
int nrofUplinkSlots = mac->scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots;
|
||||
|
||||
int nrofUplinkSlots = 0;
|
||||
if (mac->scc_SIB)
|
||||
nrofUplinkSlots = mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots;
|
||||
else if (mac->scc)
|
||||
nrofUplinkSlots = mac->scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots;
|
||||
|
||||
uint8_t num_UL_slots = nrofUplinkSlots + (nrofUplinkSlots != 0);
|
||||
uint8_t first_tx_slot = tdd_period - num_UL_slots;
|
||||
|
||||
|
||||
@@ -86,8 +86,9 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "executables/thread-common.h"
|
||||
|
||||
#include "nr_nas_msg_sim.h"
|
||||
|
||||
extern const char *duplex_mode[];
|
||||
msc_interface_t msc_interface;
|
||||
THREAD_STRUCT thread_struct;
|
||||
nrUE_params_t nrUE_params;
|
||||
|
||||
@@ -150,8 +151,9 @@ int transmission_mode = 1;
|
||||
int numerology = 0;
|
||||
int oaisim_flag = 0;
|
||||
int emulate_rf = 0;
|
||||
|
||||
char uecap_xer[1024],uecap_xer_in=0;
|
||||
uint32_t N_RB_DL = 106;
|
||||
char uecap_xer_in = 0;
|
||||
char uecap_xer[1024];
|
||||
|
||||
/* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed
|
||||
* this is very hackish - find a proper solution
|
||||
@@ -191,7 +193,10 @@ int create_tasks_nrue(uint32_t ue_nb) {
|
||||
LOG_E(NR_RRC, "Create task for RRC UE failed\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (itti_create_task (TASK_NAS_NRUE, nas_nrue_task, NULL) < 0) {
|
||||
LOG_E(NR_RRC, "Create task for NAS UE failed\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
itti_wait_ready(0);
|
||||
@@ -328,8 +333,9 @@ void set_options(int CC_id, PHY_VARS_NR_UE *UE){
|
||||
LOG_I(PHY, "Set UE frame_type %d\n", fp->frame_type);
|
||||
}
|
||||
|
||||
LOG_I(PHY, "Set UE N_RB_DL %d\n", fp->N_RB_DL);
|
||||
fp->N_RB_DL = N_RB_DL;
|
||||
|
||||
LOG_I(PHY, "Set UE N_RB_DL %d\n", N_RB_DL);
|
||||
LOG_I(PHY, "Set UE nb_rx_antenna %d, nb_tx_antenna %d, threequarter_fs %d\n", fp->nb_antennas_rx, fp->nb_antennas_tx, fp->threequarter_fs);
|
||||
|
||||
fp->ofdm_offset_divisor = nrUE_params.ofdm_offset_divisor;
|
||||
@@ -357,8 +363,8 @@ void init_openair0(void) {
|
||||
openair0_cfg[card].num_rb_dl = frame_parms->N_RB_DL;
|
||||
openair0_cfg[card].clock_source = get_softmodem_params()->clock_source;
|
||||
openair0_cfg[card].time_source = get_softmodem_params()->timing_source;
|
||||
openair0_cfg[card].tx_num_channels = min(2, frame_parms->nb_antennas_tx);
|
||||
openair0_cfg[card].rx_num_channels = min(2, frame_parms->nb_antennas_rx);
|
||||
openair0_cfg[card].tx_num_channels = min(4, frame_parms->nb_antennas_tx);
|
||||
openair0_cfg[card].rx_num_channels = min(4, frame_parms->nb_antennas_rx);
|
||||
|
||||
LOG_I(PHY, "HW: Configuring card %d, sample_rate %f, tx/rx num_channels %d/%d, duplex_mode %s\n",
|
||||
card,
|
||||
@@ -393,10 +399,10 @@ void init_pdcp(void) {
|
||||
}
|
||||
pdcp_layer_init();
|
||||
nr_DRB_preconfiguration();*/
|
||||
pdcp_layer_init();
|
||||
pdcp_module_init(pdcp_initmask);
|
||||
pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req);
|
||||
pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
|
||||
LOG_I(PDCP, "Before getting out from init_pdcp() \n");
|
||||
}
|
||||
|
||||
// Stupid function addition because UE itti messages queues definition is common with eNB
|
||||
@@ -448,7 +454,7 @@ int main( int argc, char **argv ) {
|
||||
LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
|
||||
|
||||
init_NR_UE(1,rrc_config_path);
|
||||
if(IS_SOFTMODEM_NOS1)
|
||||
if(IS_SOFTMODEM_NOS1 || get_softmodem_params()->sa)
|
||||
init_pdcp();
|
||||
|
||||
NB_UE_INST=1;
|
||||
@@ -476,8 +482,22 @@ int main( int argc, char **argv ) {
|
||||
mac->if_module->phy_config_request(&mac->phy_config);
|
||||
|
||||
fapi_nr_config_request_t *nrUE_config = &UE[CC_id]->nrUE_config;
|
||||
if (get_softmodem_params()->sa) { // set frame config to initial values from command line and assume that the SSB is centered on the grid
|
||||
nrUE_config->ssb_config.scs_common = get_softmodem_params()->numerology;
|
||||
nrUE_config->carrier_config.dl_grid_size[nrUE_config->ssb_config.scs_common] = UE[CC_id]->frame_parms.N_RB_DL;
|
||||
nrUE_config->carrier_config.ul_grid_size[nrUE_config->ssb_config.scs_common] = UE[CC_id]->frame_parms.N_RB_DL;
|
||||
nrUE_config->carrier_config.dl_frequency = (downlink_frequency[0][0] -(6*UE[CC_id]->frame_parms.N_RB_DL*(15000<<nrUE_config->ssb_config.scs_common)))/1000;
|
||||
nrUE_config->carrier_config.uplink_frequency = (downlink_frequency[0][0] -(6*UE[CC_id]->frame_parms.N_RB_DL*(15000<<nrUE_config->ssb_config.scs_common)))/1000;
|
||||
nrUE_config->ssb_table.ssb_offset_point_a = (UE[CC_id]->frame_parms.N_RB_DL - 20)>>1;
|
||||
|
||||
nr_init_frame_parms_ue(&UE[CC_id]->frame_parms, nrUE_config, *mac->scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]);
|
||||
// Initialize values, will be updated upon SIB1 reception
|
||||
nrUE_config->cell_config.frame_duplex_type = TDD;
|
||||
nrUE_config->ssb_table.ssb_mask_list[0].ssb_mask = 0xFFFFFFFF;
|
||||
nrUE_config->ssb_table.ssb_period = 1;
|
||||
}
|
||||
|
||||
nr_init_frame_parms_ue(&UE[CC_id]->frame_parms, nrUE_config,
|
||||
mac->scc == NULL ? 78 : *mac->scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]);
|
||||
|
||||
init_symbol_rotation(&UE[CC_id]->frame_parms);
|
||||
init_timeshift_rotation(&UE[CC_id]->frame_parms);
|
||||
@@ -500,7 +520,7 @@ int main( int argc, char **argv ) {
|
||||
configure_linux();
|
||||
mlockall(MCL_CURRENT | MCL_FUTURE);
|
||||
|
||||
if(IS_SOFTMODEM_DOSCOPE) {
|
||||
if(IS_SOFTMODEM_DOSCOPE) {
|
||||
load_softscope("nr",PHY_vars_UE_g[0][0]);
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
{"ue-scan-carrier", CONFIG_HLP_UESCAN, PARAMFLAG_BOOL, iptr:&(UE->UE_scan_carrier), defintval:0, TYPE_INT, 0}, \
|
||||
{"ue-fo-compensation", CONFIG_HLP_UEFO, PARAMFLAG_BOOL, iptr:&(UE->UE_fo_compensation), defintval:0, TYPE_INT, 0}, \
|
||||
{"ue-max-power", NULL, 0, iptr:&(tx_max_power[0]), defintval:90, TYPE_INT, 0}, \
|
||||
{"r" , CONFIG_HLP_PRB, 0, iptr:&(fp->N_RB_DL), defintval:25, TYPE_UINT, 0}, \
|
||||
{"r" , CONFIG_HLP_PRB, 0, uptr:&(N_RB_DL), defuintval:160, TYPE_UINT, 0}, \
|
||||
{"A" , CONFIG_HLP_TADV, 0, iptr:&(UE->timing_advance), defintval:0, TYPE_INT, 0}, \
|
||||
{"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, u8ptr:&(fp->threequarter_fs), defintval:0, TYPE_UINT8, 0}, \
|
||||
{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \
|
||||
|
||||
@@ -86,6 +86,7 @@ extern "C"
|
||||
#define CONFIG_HLP_TNOFORK "to ease debugging with gdb\n"
|
||||
|
||||
#define CONFIG_HLP_NUMEROLOGY "adding numerology for 5G\n"
|
||||
#define CONFIG_HLP_BAND "band index\n"
|
||||
#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"
|
||||
@@ -112,6 +113,7 @@ extern "C"
|
||||
#define SINGLE_THREAD_FLAG softmodem_params.single_thread_flag
|
||||
#define CHAIN_OFFSET softmodem_params.chain_offset
|
||||
#define NUMEROLOGY softmodem_params.numerology
|
||||
#define BAND softmodem_params.band
|
||||
#define EMULATE_RF softmodem_params.emulate_rf
|
||||
#define CLOCK_SOURCE softmodem_params.clock_source
|
||||
#define TIMING_SOURCE softmodem_params.timing_source
|
||||
@@ -127,22 +129,23 @@ extern "C"
|
||||
extern int usrp_tx_thread;
|
||||
#define CMDLINE_PARAMS_DESC { \
|
||||
{"rf-config-file", CONFIG_HLP_RFCFGF, 0, strptr:(char **)&RF_CONFIG_FILE, defstrval:NULL, TYPE_STRING, sizeof(RF_CONFIG_FILE)},\
|
||||
{"split73", CONFIG_HLP_SPLIT73, 0, strptr:(char **)&SPLIT73, defstrval:NULL, TYPE_STRING, sizeof(SPLIT73)},\
|
||||
{"thread-pool", CONFIG_HLP_TPOOL, 0, strptr:(char **)&TP_CONFIG, defstrval:"n", TYPE_STRING, sizeof(TP_CONFIG)}, \
|
||||
{"split73", CONFIG_HLP_SPLIT73, 0, strptr:(char **)&SPLIT73, defstrval:NULL, TYPE_STRING, sizeof(SPLIT73)}, \
|
||||
{"thread-pool", CONFIG_HLP_TPOOL, 0, strptr:(char **)&TP_CONFIG, defstrval:"n", TYPE_STRING, sizeof(TP_CONFIG)}, \
|
||||
{"phy-test", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, iptr:&PHY_TEST, defintval:0, TYPE_INT, 0}, \
|
||||
{"do-ra", CONFIG_HLP_DORA, PARAMFLAG_BOOL, iptr:&DO_RA, defintval:0, TYPE_INT, 0}, \
|
||||
{"sa", CONFIG_HLP_SA, PARAMFLAG_BOOL, iptr:&SA, defintval:0, TYPE_INT, 0}, \
|
||||
{"sa", CONFIG_HLP_SA, PARAMFLAG_BOOL, iptr:&SA, defintval:0, TYPE_INT, 0}, \
|
||||
{"usim-test", CONFIG_HLP_USIM, PARAMFLAG_BOOL, u8ptr:&USIM_TEST, defintval:0, TYPE_UINT8, 0}, \
|
||||
{"clock-source", CONFIG_HLP_CLK, 0, uptr:&CLOCK_SOURCE, defintval:0, TYPE_UINT, 0}, \
|
||||
{"time-source", CONFIG_HLP_TME, 0, uptr:&TIMING_SOURCE, defintval:0, TYPE_UINT, 0}, \
|
||||
{"clock-source", CONFIG_HLP_CLK, 0, uptr:&CLOCK_SOURCE, defintval:0, TYPE_UINT, 0}, \
|
||||
{"time-source", CONFIG_HLP_TME, 0, uptr:&TIMING_SOURCE, defintval:0, TYPE_UINT, 0}, \
|
||||
{"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&WAIT_FOR_SYNC, defintval:0, TYPE_INT, 0}, \
|
||||
{"single-thread-enable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&SINGLE_THREAD_FLAG, defintval:0, TYPE_INT, 0}, \
|
||||
{"C" , CONFIG_HLP_DLF, 0, u64ptr:&(downlink_frequency[0][0]), defuintval:0, TYPE_UINT64, 0}, \
|
||||
{"CO" , CONFIG_HLP_ULF, 0, iptr:&(uplink_frequency_offset[0][0]), defintval:0, TYPE_INT, 0}, \
|
||||
{"C" , CONFIG_HLP_DLF, 0, u64ptr:&(downlink_frequency[0][0]), defuintval:3619200000, TYPE_UINT64, 0}, \
|
||||
{"CO" , CONFIG_HLP_ULF, 0, iptr:&(uplink_frequency_offset[0][0]), defintval:0, TYPE_INT, 0}, \
|
||||
{"a" , CONFIG_HLP_CHOFF, 0, iptr:&CHAIN_OFFSET, defintval:0, TYPE_INT, 0}, \
|
||||
{"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:(uint32_t *)&do_forms, defintval:0, TYPE_INT8, 0}, \
|
||||
{"q" , CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \
|
||||
{"numerology" , CONFIG_HLP_NUMEROLOGY, PARAMFLAG_BOOL, iptr:&NUMEROLOGY, defintval:0, TYPE_INT, 0}, \
|
||||
{"numerology" , CONFIG_HLP_NUMEROLOGY, PARAMFLAG_BOOL, iptr:&NUMEROLOGY, defintval:1, TYPE_INT, 0}, \
|
||||
{"band" , CONFIG_HLP_BAND, PARAMFLAG_BOOL, iptr:&BAND, defintval:78, TYPE_INT, 0}, \
|
||||
{"emulate-rf" , CONFIG_HLP_EMULATE_RF, PARAMFLAG_BOOL, iptr:&EMULATE_RF, defintval:0, TYPE_INT, 0}, \
|
||||
{"parallel-config", CONFIG_HLP_PARALLEL_CMD, 0, strptr:(char **)¶llel_config, defstrval:NULL, TYPE_STRING, 0}, \
|
||||
{"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:(char **)&worker_config, defstrval:NULL, TYPE_STRING, 0}, \
|
||||
@@ -239,6 +242,7 @@ typedef struct {
|
||||
int single_thread_flag; //eNodeB only
|
||||
int chain_offset;
|
||||
int numerology;
|
||||
int band;
|
||||
unsigned int start_msc;
|
||||
uint32_t clock_source;
|
||||
uint32_t timing_source;
|
||||
|
||||
Reference in New Issue
Block a user