remove emulate_l1 code
This commit is contained in:
@@ -52,7 +52,7 @@ int create_tasks(uint32_t enb_nb) {
|
||||
rrc_enb_init();
|
||||
itti_mark_task_ready(TASK_RRC_ENB);
|
||||
|
||||
if (get_softmodem_params()->emulate_l1 || !IS_SOFTMODEM_NOS1) {
|
||||
if (!IS_SOFTMODEM_NOS1) {
|
||||
rc = itti_create_task(TASK_SCTP, sctp_eNB_task, NULL);
|
||||
AssertFatal(rc >= 0, "Create task for SCTP failed\n");
|
||||
}
|
||||
|
||||
@@ -31,13 +31,10 @@
|
||||
#include "SCHED_NR_UE/defs.h"
|
||||
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "PHY/NR_REFSIG/refsig_defs_ue.h"
|
||||
#include "radio/COMMON/common_lib.h"
|
||||
#include "LAYER2/nr_pdcp/nr_pdcp_oai_api.h"
|
||||
#include "LAYER2/nr_rlc/nr_rlc_oai_api.h"
|
||||
#include "RRC/NR/MESSAGES/asn1_msg.h"
|
||||
#include "openair1/PHY/TOOLS/phy_scope_interface.h"
|
||||
#include "PHY/MODULATION/nr_modulation.h"
|
||||
#include "instrumentation.h"
|
||||
#include "common/utils/threadPool/notified_fifo.h"
|
||||
#include "position_interface.h"
|
||||
@@ -102,8 +99,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
static void *NRUE_phy_stub_standalone_pnf_task(void *arg);
|
||||
|
||||
static void start_process_slot_tx(void* arg) {
|
||||
notifiedFIFO_elt_t *newTx = arg;
|
||||
nr_rxtx_thread_data_t *curMsgTx = NotifiedFifoData(newTx);
|
||||
@@ -194,189 +189,6 @@ void init_nr_ue_vars(PHY_VARS_NR_UE *ue, uint8_t UE_id)
|
||||
ue->ta_slot = -1;
|
||||
}
|
||||
|
||||
void init_nrUE_standalone_thread(int ue_idx)
|
||||
{
|
||||
int standalone_tx_port = 3611 + ue_idx * 2;
|
||||
int standalone_rx_port = 3612 + ue_idx * 2;
|
||||
nrue_init_standalone_socket(standalone_tx_port, standalone_rx_port);
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(0);
|
||||
pthread_mutex_init(&mac->mutex_dl_info, NULL);
|
||||
|
||||
pthread_t thread;
|
||||
if (pthread_create(&thread, NULL, nrue_standalone_pnf_task, NULL) != 0) {
|
||||
LOG_E(NR_MAC, "pthread_create failed for calling nrue_standalone_pnf_task");
|
||||
}
|
||||
pthread_setname_np(thread, "oai:nrue-stand");
|
||||
pthread_t phy_thread;
|
||||
if (pthread_create(&phy_thread, NULL, NRUE_phy_stub_standalone_pnf_task, NULL) != 0) {
|
||||
LOG_E(NR_MAC, "pthread_create failed for calling NRUE_phy_stub_standalone_pnf_task");
|
||||
}
|
||||
pthread_setname_np(phy_thread, "oai:nrue-stand-phy");
|
||||
}
|
||||
|
||||
static void process_queued_nr_nfapi_msgs(NR_UE_MAC_INST_t *mac, int sfn, int slot)
|
||||
{
|
||||
struct sfn_slot_s sfn_slot = {.sfn = sfn, .slot = slot};
|
||||
nfapi_nr_rach_indication_t *rach_ind = unqueue_matching(&nr_rach_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot);
|
||||
nfapi_nr_dl_tti_request_t *dl_tti_request = get_queue(&nr_dl_tti_req_queue);
|
||||
nfapi_nr_ul_dci_request_t *ul_dci_request = get_queue(&nr_ul_dci_req_queue);
|
||||
|
||||
for (int i = 0; i < NR_MAX_HARQ_PROCESSES; i++) {
|
||||
LOG_D(NR_MAC,
|
||||
"Try to get a ul_tti_req by matching CRC active sfn/slot %d.%d from queue with %lu items\n",
|
||||
sfn,
|
||||
slot,
|
||||
nr_ul_tti_req_queue.num_items);
|
||||
struct sfn_slot_s sfn_sf = {.sfn = mac->nr_ue_emul_l1.harq[i].active_ul_harq_sfn, .slot = mac->nr_ue_emul_l1.harq[i].active_ul_harq_slot };
|
||||
nfapi_nr_ul_tti_request_t *ul_tti_request_crc = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_sf);
|
||||
if (ul_tti_request_crc && ul_tti_request_crc->n_pdus > 0) {
|
||||
check_and_process_dci(NULL, NULL, NULL, ul_tti_request_crc);
|
||||
free_and_zero(ul_tti_request_crc);
|
||||
}
|
||||
}
|
||||
|
||||
if (rach_ind && rach_ind->number_of_pdus > 0) {
|
||||
NR_UL_IND_t UL_INFO = {
|
||||
.rach_ind = *rach_ind,
|
||||
};
|
||||
send_nsa_standalone_msg(&UL_INFO, rach_ind->header.message_id);
|
||||
free_and_zero(rach_ind->pdu_list);
|
||||
free_and_zero(rach_ind);
|
||||
}
|
||||
if (dl_tti_request) {
|
||||
struct sfn_slot_s sfn_slot = {.sfn = dl_tti_request->SFN, .slot = dl_tti_request->Slot};
|
||||
nfapi_nr_tx_data_request_t *tx_data_request = unqueue_matching(&nr_tx_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot);
|
||||
if (!tx_data_request) {
|
||||
LOG_E(NR_MAC, "[%d.%d] No corresponding tx_data_request for given dl_tti_request sfn/slot\n",
|
||||
dl_tti_request->SFN, dl_tti_request->Slot);
|
||||
if (get_softmodem_params()->nsa)
|
||||
save_nr_measurement_info(dl_tti_request);
|
||||
free_and_zero(dl_tti_request);
|
||||
}
|
||||
else if (dl_tti_request->dl_tti_request_body.nPDUs > 0 && tx_data_request->Number_of_PDUs > 0) {
|
||||
if (get_softmodem_params()->nsa)
|
||||
save_nr_measurement_info(dl_tti_request);
|
||||
check_and_process_dci(dl_tti_request, tx_data_request, NULL, NULL);
|
||||
free_and_zero(dl_tti_request);
|
||||
free_and_zero(tx_data_request);
|
||||
}
|
||||
else {
|
||||
AssertFatal(false, "We dont have PDUs in either dl_tti %d or tx_req %d\n",
|
||||
dl_tti_request->dl_tti_request_body.nPDUs, tx_data_request->Number_of_PDUs);
|
||||
}
|
||||
}
|
||||
if (ul_dci_request && ul_dci_request->numPdus > 0) {
|
||||
check_and_process_dci(NULL, NULL, ul_dci_request, NULL);
|
||||
free_and_zero(ul_dci_request);
|
||||
}
|
||||
}
|
||||
|
||||
static void *NRUE_phy_stub_standalone_pnf_task(void *arg)
|
||||
{
|
||||
LOG_I(MAC, "Clearing Queues\n");
|
||||
reset_queue(&nr_rach_ind_queue);
|
||||
reset_queue(&nr_rx_ind_queue);
|
||||
reset_queue(&nr_crc_ind_queue);
|
||||
reset_queue(&nr_uci_ind_queue);
|
||||
reset_queue(&nr_dl_tti_req_queue);
|
||||
reset_queue(&nr_tx_req_queue);
|
||||
reset_queue(&nr_ul_dci_req_queue);
|
||||
reset_queue(&nr_ul_tti_req_queue);
|
||||
|
||||
int last_sfn_slot = -1;
|
||||
uint16_t sfn_slot = 0;
|
||||
|
||||
module_id_t mod_id = 0;
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
|
||||
for (int i = 0; i < NR_MAX_HARQ_PROCESSES; i++) {
|
||||
mac->nr_ue_emul_l1.harq[i].active = false;
|
||||
mac->nr_ue_emul_l1.harq[i].active_ul_harq_sfn = -1;
|
||||
mac->nr_ue_emul_l1.harq[i].active_ul_harq_slot = -1;
|
||||
}
|
||||
|
||||
while (!oai_exit) {
|
||||
if (sem_wait(&sfn_slot_semaphore) != 0) {
|
||||
LOG_E(NR_MAC, "sem_wait() error\n");
|
||||
abort();
|
||||
}
|
||||
uint16_t *slot_ind = get_queue(&nr_sfn_slot_queue);
|
||||
nr_phy_channel_params_t *ch_info = get_queue(&nr_chan_param_queue);
|
||||
if (!slot_ind && !ch_info) {
|
||||
LOG_D(MAC, "get nr_sfn_slot_queue and nr_chan_param_queue == NULL!\n");
|
||||
continue;
|
||||
}
|
||||
if (slot_ind) {
|
||||
sfn_slot = *slot_ind;
|
||||
free_and_zero(slot_ind);
|
||||
}
|
||||
else if (ch_info) {
|
||||
sfn_slot = ch_info->sfn_slot;
|
||||
free_and_zero(ch_info);
|
||||
}
|
||||
|
||||
int mu = 1; // NR-UE emul-L1 is hardcoded to 30kHZ, see check_and_process_dci()
|
||||
frame_t frame = NFAPI_SFNSLOTDEC2SFN(mu, sfn_slot);
|
||||
int slot = NFAPI_SFNSLOTDEC2SLOT(mu, sfn_slot);
|
||||
if (sfn_slot == last_sfn_slot) {
|
||||
LOG_D(NR_MAC, "repeated sfn_sf = %d.%d\n",
|
||||
frame, slot);
|
||||
continue;
|
||||
}
|
||||
last_sfn_slot = sfn_slot;
|
||||
|
||||
LOG_D(NR_MAC, "The received sfn/slot [%d %d] from proxy\n",
|
||||
frame, slot);
|
||||
|
||||
if (IS_SA_MODE(get_softmodem_params()) && mac->mib == NULL) {
|
||||
LOG_D(NR_MAC, "We haven't gotten MIB. Lets see if we received it\n");
|
||||
nr_ue_dl_indication(&mac->dl_info);
|
||||
process_queued_nr_nfapi_msgs(mac, frame, slot);
|
||||
}
|
||||
|
||||
int CC_id = 0;
|
||||
uint8_t gNB_id = 0;
|
||||
int slots_per_frame = 20; //30 kHZ subcarrier spacing
|
||||
int slot_ahead = 2; // TODO: Make this dynamic
|
||||
nr_uplink_indication_t ul_info = {.cc_id = CC_id,
|
||||
.gNB_index = gNB_id,
|
||||
.module_id = mod_id,
|
||||
.slot = (slot + slot_ahead) % slots_per_frame,
|
||||
.frame = (slot + slot_ahead >= slots_per_frame) ? (frame + 1) % 1024 : frame};
|
||||
|
||||
if (pthread_mutex_lock(&mac->mutex_dl_info)) abort();
|
||||
|
||||
if (ch_info) {
|
||||
mac->nr_ue_emul_l1.pmi = ch_info->csi[0].pmi;
|
||||
mac->nr_ue_emul_l1.ri = ch_info->csi[0].ri;
|
||||
mac->nr_ue_emul_l1.cqi = ch_info->csi[0].cqi;
|
||||
free_and_zero(ch_info);
|
||||
}
|
||||
|
||||
if (is_dl_slot(slot, &mac->frame_structure)) {
|
||||
memset(&mac->dl_info, 0, sizeof(mac->dl_info));
|
||||
mac->dl_info.cc_id = CC_id;
|
||||
mac->dl_info.gNB_index = gNB_id;
|
||||
mac->dl_info.module_id = mod_id;
|
||||
mac->dl_info.frame = frame;
|
||||
mac->dl_info.slot = slot;
|
||||
mac->dl_info.dci_ind = NULL;
|
||||
mac->dl_info.rx_ind = NULL;
|
||||
nr_ue_dl_indication(&mac->dl_info);
|
||||
}
|
||||
|
||||
if (pthread_mutex_unlock(&mac->mutex_dl_info)) abort();
|
||||
|
||||
if (is_ul_slot(ul_info.slot, &mac->frame_structure)) {
|
||||
LOG_D(NR_MAC, "Slot %d. calling nr_ue_ul_ind()\n", ul_info.slot);
|
||||
nr_ue_ul_scheduler(mac, &ul_info);
|
||||
}
|
||||
process_queued_nr_nfapi_msgs(mac, frame, slot);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* It performs band scanning and synchonization.
|
||||
* \param arg is a pointer to a \ref PHY_VARS_NR_UE structure.
|
||||
|
||||
+77
-136
@@ -93,15 +93,6 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
THREAD_STRUCT thread_struct;
|
||||
nrUE_params_t nrUE_params = {0};
|
||||
|
||||
// Thread variables
|
||||
pthread_cond_t nfapi_sync_cond;
|
||||
pthread_mutex_t nfapi_sync_mutex;
|
||||
int nfapi_sync_var=-1; //!< protected by mutex \ref nfapi_sync_mutex
|
||||
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;
|
||||
|
||||
// not used in UE
|
||||
instance_t CUuniqInstance=0;
|
||||
instance_t DUuniqInstance=0;
|
||||
@@ -111,7 +102,6 @@ int get_node_type() {return -1;}
|
||||
RAN_CONTEXT_t RC;
|
||||
int oai_exit = 0;
|
||||
|
||||
|
||||
static int tx_max_power[MAX_NUM_CCs] = {0};
|
||||
|
||||
double rx_gain_off = 0.0;
|
||||
@@ -121,10 +111,7 @@ int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
uint64_t sidelink_frequency[MAX_NUM_CCs][4];
|
||||
|
||||
// UE and OAI config variables
|
||||
int16_t node_synch_ref[MAX_NUM_CCs];
|
||||
int otg_enabled;
|
||||
double cpuf;
|
||||
uint32_t N_RB_DL = 106;
|
||||
|
||||
int create_tasks_nrue(uint32_t ue_nb) {
|
||||
LOG_D(NR_RRC, "%s(ue_nb:%d)\n", __FUNCTION__, ue_nb);
|
||||
@@ -342,40 +329,6 @@ static void trigger_deregistration(int sig)
|
||||
}
|
||||
}
|
||||
|
||||
static void get_channel_model_mode(configmodule_interface_t *cfg)
|
||||
{
|
||||
paramdef_t GNBParams[] = GNBPARAMS_DESC;
|
||||
config_get(cfg, GNBParams, sizeofArray(GNBParams), NULL);
|
||||
int num_xp_antennas = *GNBParams[GNB_PDSCH_ANTENNAPORTS_XP_IDX].iptr;
|
||||
|
||||
if (num_xp_antennas == 2)
|
||||
init_nr_bler_table("NR_MIMO2x2_AWGN_RESULTS_DIR");
|
||||
else
|
||||
init_nr_bler_table("NR_AWGN_RESULTS_DIR");
|
||||
}
|
||||
|
||||
void start_oai_nrue_threads()
|
||||
{
|
||||
init_queue(&nr_rach_ind_queue);
|
||||
init_queue(&nr_rx_ind_queue);
|
||||
init_queue(&nr_crc_ind_queue);
|
||||
init_queue(&nr_uci_ind_queue);
|
||||
init_queue(&nr_sfn_slot_queue);
|
||||
init_queue(&nr_chan_param_queue);
|
||||
init_queue(&nr_dl_tti_req_queue);
|
||||
init_queue(&nr_tx_req_queue);
|
||||
init_queue(&nr_ul_dci_req_queue);
|
||||
init_queue(&nr_ul_tti_req_queue);
|
||||
|
||||
if (sem_init(&sfn_slot_semaphore, 0, 0) != 0)
|
||||
{
|
||||
LOG_E(MAC, "sem_init() error\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
init_nrUE_standalone_thread(ue_id_g);
|
||||
}
|
||||
|
||||
int NB_UE_INST = 1;
|
||||
configmodule_interface_t *uniqCfg = NULL;
|
||||
nrLDPC_coding_interface_t nrLDPC_coding_interface = {0};
|
||||
@@ -455,11 +408,6 @@ int main(int argc, char **argv)
|
||||
|
||||
init_NR_UE(NB_UE_INST, get_nrUE_params()->uecap_file, get_nrUE_params()->reconfig_file, get_nrUE_params()->rbconfig_file);
|
||||
|
||||
if (get_softmodem_params()->emulate_l1) {
|
||||
RCconfig_nr_ue_macrlc();
|
||||
get_channel_model_mode(uniqCfg);
|
||||
}
|
||||
|
||||
// start time manager with some reasonable default for the running mode
|
||||
// (may be overwritten in configuration file or command line)
|
||||
void nr_pdcp_ms_tick(void);
|
||||
@@ -475,97 +423,90 @@ int main(int argc, char **argv)
|
||||
IS_SOFTMODEM_RFSIM ? TIME_SOURCE_IQ_SAMPLES
|
||||
: TIME_SOURCE_REALTIME);
|
||||
|
||||
if (!get_softmodem_params()->nsa && get_softmodem_params()->emulate_l1)
|
||||
start_oai_nrue_threads();
|
||||
|
||||
if (!get_softmodem_params()->emulate_l1) {
|
||||
for (int inst = 0; inst < NB_UE_INST; inst++) {
|
||||
PHY_VARS_NR_UE *UE[MAX_NUM_CCs];
|
||||
for (int CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
UE[CC_id] = PHY_vars_UE_g[inst][CC_id];
|
||||
|
||||
set_options(CC_id, UE[CC_id]);
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(inst);
|
||||
init_nr_ue_phy_cpu_stats(&UE[CC_id]->phy_cpu_stats);
|
||||
|
||||
if (IS_SA_MODE(get_softmodem_params()) || get_softmodem_params()->sl_mode) { // set frame config to initial values from command line
|
||||
// and assume that the SSB is centered on the grid
|
||||
uint16_t nr_band = get_softmodem_params()->band;
|
||||
mac->nr_band = nr_band;
|
||||
mac->ssb_start_subcarrier = UE[CC_id]->frame_parms.ssb_start_subcarrier;
|
||||
nr_init_frame_parms_ue_sa(&UE[CC_id]->frame_parms,
|
||||
downlink_frequency[CC_id][0],
|
||||
uplink_frequency_offset[CC_id][0],
|
||||
get_softmodem_params()->numerology,
|
||||
nr_band);
|
||||
} else {
|
||||
do {
|
||||
notifiedFIFO_elt_t *elt = pollNotifiedFIFO(&mac->input_nf);
|
||||
if (!elt) {
|
||||
break;
|
||||
}
|
||||
process_msg_rcc_to_mac(NotifiedFifoData(elt), inst);
|
||||
delNotifiedFIFO_elt(elt);
|
||||
} while (true);
|
||||
fapi_nr_config_request_t *nrUE_config = &UE[CC_id]->nrUE_config;
|
||||
nr_init_frame_parms_ue(&UE[CC_id]->frame_parms, nrUE_config, mac->nr_band);
|
||||
}
|
||||
|
||||
UE[CC_id]->sl_mode = get_softmodem_params()->sl_mode;
|
||||
init_actor(&UE[CC_id]->sync_actor, "SYNC_", -1);
|
||||
if (get_nrUE_params()->num_dl_actors > 0) {
|
||||
UE[CC_id]->dl_actors = calloc_or_fail(get_nrUE_params()->num_dl_actors, sizeof(*UE[CC_id]->dl_actors));
|
||||
for (int i = 0; i < get_nrUE_params()->num_dl_actors; i++) {
|
||||
init_actor(&UE[CC_id]->dl_actors[i], "DL_", -1);
|
||||
for (int inst = 0; inst < NB_UE_INST; inst++) {
|
||||
PHY_VARS_NR_UE *UE[MAX_NUM_CCs];
|
||||
for (int CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
UE[CC_id] = PHY_vars_UE_g[inst][CC_id];
|
||||
set_options(CC_id, UE[CC_id]);
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(inst);
|
||||
init_nr_ue_phy_cpu_stats(&UE[CC_id]->phy_cpu_stats);
|
||||
// set frame config to initial values from command line and assume that the SSB is centered on the grid
|
||||
if (IS_SA_MODE(get_softmodem_params()) || get_softmodem_params()->sl_mode) {
|
||||
uint16_t nr_band = get_softmodem_params()->band;
|
||||
mac->nr_band = nr_band;
|
||||
mac->ssb_start_subcarrier = UE[CC_id]->frame_parms.ssb_start_subcarrier;
|
||||
nr_init_frame_parms_ue_sa(&UE[CC_id]->frame_parms,
|
||||
downlink_frequency[CC_id][0],
|
||||
uplink_frequency_offset[CC_id][0],
|
||||
get_softmodem_params()->numerology,
|
||||
nr_band);
|
||||
} else {
|
||||
do {
|
||||
notifiedFIFO_elt_t *elt = pollNotifiedFIFO(&mac->input_nf);
|
||||
if (!elt) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (get_nrUE_params()->num_ul_actors > 0) {
|
||||
UE[CC_id]->ul_actors = calloc_or_fail(get_nrUE_params()->num_ul_actors, sizeof(*UE[CC_id]->ul_actors));
|
||||
for (int i = 0; i < get_nrUE_params()->num_ul_actors; i++) {
|
||||
init_actor(&UE[CC_id]->ul_actors[i], "UL_", -1);
|
||||
}
|
||||
}
|
||||
init_nr_ue_vars(UE[CC_id], inst);
|
||||
|
||||
if (UE[CC_id]->sl_mode) {
|
||||
AssertFatal(UE[CC_id]->sl_mode == 2, "Only Sidelink mode 2 supported. Mode 1 not yet supported\n");
|
||||
DevAssert(mac->if_module != NULL && mac->if_module->sl_phy_config_request != NULL);
|
||||
nr_sl_phy_config_t *phycfg = &mac->SL_MAC_PARAMS->sl_phy_config;
|
||||
phycfg->sl_config_req.sl_carrier_config.sl_num_rx_ant = get_nrUE_params()->nb_antennas_rx;
|
||||
phycfg->sl_config_req.sl_carrier_config.sl_num_tx_ant = get_nrUE_params()->nb_antennas_tx;
|
||||
mac->if_module->sl_phy_config_request(phycfg);
|
||||
sl_nr_ue_phy_params_t *sl_phy = &UE[CC_id]->SL_UE_PHY_PARAMS;
|
||||
nr_init_frame_parms_ue_sl(&sl_phy->sl_frame_params,
|
||||
&sl_phy->sl_config,
|
||||
get_softmodem_params()->threequarter_fs,
|
||||
get_nrUE_params()->ofdm_offset_divisor);
|
||||
sl_ue_phy_init(UE[CC_id]);
|
||||
}
|
||||
init_openair0(UE[CC_id]);
|
||||
process_msg_rcc_to_mac(NotifiedFifoData(elt), inst);
|
||||
delNotifiedFIFO_elt(elt);
|
||||
} while (true);
|
||||
fapi_nr_config_request_t *nrUE_config = &UE[CC_id]->nrUE_config;
|
||||
nr_init_frame_parms_ue(&UE[CC_id]->frame_parms, nrUE_config, mac->nr_band);
|
||||
}
|
||||
}
|
||||
|
||||
lock_memory_to_ram();
|
||||
UE[CC_id]->sl_mode = get_softmodem_params()->sl_mode;
|
||||
init_actor(&UE[CC_id]->sync_actor, "SYNC_", -1);
|
||||
if (get_nrUE_params()->num_dl_actors > 0) {
|
||||
UE[CC_id]->dl_actors = calloc_or_fail(get_nrUE_params()->num_dl_actors, sizeof(*UE[CC_id]->dl_actors));
|
||||
for (int i = 0; i < get_nrUE_params()->num_dl_actors; i++) {
|
||||
init_actor(&UE[CC_id]->dl_actors[i], "DL_", -1);
|
||||
}
|
||||
}
|
||||
if (get_nrUE_params()->num_ul_actors > 0) {
|
||||
UE[CC_id]->ul_actors = calloc_or_fail(get_nrUE_params()->num_ul_actors, sizeof(*UE[CC_id]->ul_actors));
|
||||
for (int i = 0; i < get_nrUE_params()->num_ul_actors; i++) {
|
||||
init_actor(&UE[CC_id]->ul_actors[i], "UL_", -1);
|
||||
}
|
||||
}
|
||||
init_nr_ue_vars(UE[CC_id], inst);
|
||||
|
||||
if (IS_SOFTMODEM_DOSCOPE) {
|
||||
load_softscope("nr", PHY_vars_UE_g[0][0]);
|
||||
if (UE[CC_id]->sl_mode) {
|
||||
AssertFatal(UE[CC_id]->sl_mode == 2, "Only Sidelink mode 2 supported. Mode 1 not yet supported\n");
|
||||
DevAssert(mac->if_module != NULL && mac->if_module->sl_phy_config_request != NULL);
|
||||
nr_sl_phy_config_t *phycfg = &mac->SL_MAC_PARAMS->sl_phy_config;
|
||||
phycfg->sl_config_req.sl_carrier_config.sl_num_rx_ant = get_nrUE_params()->nb_antennas_rx;
|
||||
phycfg->sl_config_req.sl_carrier_config.sl_num_tx_ant = get_nrUE_params()->nb_antennas_tx;
|
||||
mac->if_module->sl_phy_config_request(phycfg);
|
||||
sl_nr_ue_phy_params_t *sl_phy = &UE[CC_id]->SL_UE_PHY_PARAMS;
|
||||
nr_init_frame_parms_ue_sl(&sl_phy->sl_frame_params,
|
||||
&sl_phy->sl_config,
|
||||
get_softmodem_params()->threequarter_fs,
|
||||
get_nrUE_params()->ofdm_offset_divisor);
|
||||
sl_ue_phy_init(UE[CC_id]);
|
||||
}
|
||||
init_openair0(UE[CC_id]);
|
||||
}
|
||||
if (IS_SOFTMODEM_IMSCOPE_ENABLED) {
|
||||
load_softscope("im", PHY_vars_UE_g[0][0]);
|
||||
}
|
||||
AssertFatal(!(IS_SOFTMODEM_IMSCOPE_ENABLED && IS_SOFTMODEM_IMSCOPE_RECORD_ENABLED),
|
||||
"Data recoding and ImScope cannot be enabled at the same time\n");
|
||||
if (IS_SOFTMODEM_IMSCOPE_RECORD_ENABLED) {
|
||||
load_module_shlib("imscope_record", NULL, 0, PHY_vars_UE_g[0][0]);
|
||||
}
|
||||
|
||||
for (int inst = 0; inst < NB_UE_INST; inst++) {
|
||||
LOG_I(PHY,"Intializing UE Threads for instance %d ...\n", inst);
|
||||
init_NR_UE_threads(PHY_vars_UE_g[inst][0]);
|
||||
}
|
||||
printf("UE threads created by %ld\n", gettid());
|
||||
}
|
||||
|
||||
lock_memory_to_ram();
|
||||
|
||||
if (IS_SOFTMODEM_DOSCOPE) {
|
||||
load_softscope("nr", PHY_vars_UE_g[0][0]);
|
||||
}
|
||||
if (IS_SOFTMODEM_IMSCOPE_ENABLED) {
|
||||
load_softscope("im", PHY_vars_UE_g[0][0]);
|
||||
}
|
||||
AssertFatal(!(IS_SOFTMODEM_IMSCOPE_ENABLED && IS_SOFTMODEM_IMSCOPE_RECORD_ENABLED),
|
||||
"Data recoding and ImScope cannot be enabled at the same time\n");
|
||||
if (IS_SOFTMODEM_IMSCOPE_RECORD_ENABLED) {
|
||||
load_module_shlib("imscope_record", NULL, 0, PHY_vars_UE_g[0][0]);
|
||||
}
|
||||
|
||||
for (int inst = 0; inst < NB_UE_INST; inst++) {
|
||||
LOG_I(PHY,"Intializing UE Threads for instance %d ...\n", inst);
|
||||
init_NR_UE_threads(PHY_vars_UE_g[inst][0]);
|
||||
}
|
||||
printf("UE threads created by %ld\n", gettid());
|
||||
|
||||
// wait for end of program
|
||||
printf("TYPE <CTRL-C> TO TERMINATE\n");
|
||||
|
||||
|
||||
@@ -137,8 +137,6 @@ extern int setup_nr_ue_buffers(PHY_VARS_NR_UE **phy_vars_ue, openair0_config_t *
|
||||
extern void fill_ue_band_info(void);
|
||||
extern void init_NR_UE(int, char *, char *, char *);
|
||||
extern void init_NR_UE_threads(PHY_VARS_NR_UE *ue);
|
||||
void start_oai_nrue_threads(void);
|
||||
void *UE_thread(void *arg);
|
||||
void init_nr_ue_vars(PHY_VARS_NR_UE *ue, uint8_t UE_id);
|
||||
void init_nrUE_standalone_thread(int ue_idx);
|
||||
#endif
|
||||
|
||||
@@ -105,7 +105,6 @@ extern "C"
|
||||
#define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n"
|
||||
#define CONFIG_HLP_USRP_THREAD "having extra thead for usrp tx\n"
|
||||
#define CONFIG_HLP_NFAPI "Change the nFAPI mode for NR 'MONOLITHIC', 'PNF', 'VNF', 'AERIAL','UE_STUB_PNF','UE_STUB_OFFNET','STANDALONE_PNF'\n"
|
||||
#define CONFIG_L1_EMULATOR "Run in L1 emulated mode (disable PHY layer)\n"
|
||||
#define CONFIG_HLP_CONTINUOUS_TX "perform continuous transmission, even in TDD mode (to work around USRP issues)\n"
|
||||
#define CONFIG_HLP_STATS_DISABLE "disable globally the stats generation and persistence"
|
||||
#define CONFIG_HLP_NOITTI "Do not start itti threads, call queue processing in place, inside the caller thread"
|
||||
@@ -137,7 +136,6 @@ extern "C"
|
||||
#define NSA softmodem_params.nsa
|
||||
#define NODE_NUMBER softmodem_params.node_number
|
||||
#define NON_STOP softmodem_params.non_stop
|
||||
#define EMULATE_L1 softmodem_params.emulate_l1
|
||||
#define CONTINUOUS_TX softmodem_params.continuous_tx
|
||||
#define SYNC_REF softmodem_params.sync_ref
|
||||
#define DEFAULT_PDU_ID softmodem_params.default_pdu_session_id
|
||||
@@ -174,7 +172,6 @@ extern int usrp_tx_thread;
|
||||
{"usrp-tx-thread-config", CONFIG_HLP_USRP_THREAD, 0, .iptr=&usrp_tx_thread, .defstrval=0, TYPE_INT, 0}, \
|
||||
{"nfapi", CONFIG_HLP_NFAPI, 0, .strptr=NULL, .defstrval="MONOLITHIC", TYPE_STRING, 0}, \
|
||||
{"non-stop", CONFIG_HLP_NONSTOP, PARAMFLAG_BOOL, .iptr=&NON_STOP, .defintval=0, TYPE_INT, 0}, \
|
||||
{"emulate-l1", CONFIG_L1_EMULATOR, PARAMFLAG_BOOL, .iptr=&EMULATE_L1, .defintval=0, TYPE_INT, 0}, \
|
||||
{"continuous-tx", CONFIG_HLP_CONTINUOUS_TX, PARAMFLAG_BOOL, .iptr=&CONTINUOUS_TX, .defintval=0, TYPE_INT, 0}, \
|
||||
{"disable-stats", CONFIG_HLP_STATS_DISABLE, PARAMFLAG_BOOL, .iptr=&stats_disabled, .defintval=0, TYPE_INT, 0}, \
|
||||
{"no-itti-threads", CONFIG_HLP_NOITTI, PARAMFLAG_BOOL, .iptr=&softmodem_params.no_itti, .defintval=0, TYPE_INT, 0}, \
|
||||
@@ -228,7 +225,6 @@ extern int usrp_tx_thread;
|
||||
{ .s5 = { NULL } }, \
|
||||
{ .s5 = { NULL } }, \
|
||||
{ .s5 = { NULL } }, \
|
||||
{ .s5 = { NULL } }, \
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
@@ -331,7 +327,6 @@ typedef struct {
|
||||
int nsa;
|
||||
uint16_t node_number;
|
||||
int non_stop;
|
||||
int emulate_l1;
|
||||
int continuous_tx;
|
||||
uint32_t sync_ref;
|
||||
int no_itti;
|
||||
|
||||
Reference in New Issue
Block a user