remove emulate_l1 code
This commit is contained in:
+1
-42
@@ -40,48 +40,7 @@ Normally it should be fine to run both executables on the same host using the `l
|
||||
|
||||
**2022/03/08: Starting the `2022.w01` tag on the `develop` branch, the L2 nFAPI simulation is using a proxy.**
|
||||
|
||||
## 5G L2 nFAPI simulator
|
||||
|
||||
**Note: L2 simulator does not work anymore.**
|
||||
|
||||
### Download and Build the Proxy Server (from EpiSci)
|
||||
|
||||
```bash
|
||||
$ cd ~
|
||||
$ git clone https://github.com/EpiSci/oai-lte-5g-multi-ue-proxy.git
|
||||
$ cd oai-lte-multi-ue-proxy
|
||||
$ make
|
||||
```
|
||||
|
||||
### Start Proxy Server
|
||||
Set the number of UEs to connect to server as 1 and the mode is SA.
|
||||
```bash
|
||||
$ number_of_ues=1
|
||||
$ sudo -E ./build/proxy $number_of_ues --nr
|
||||
```
|
||||
|
||||
### Start gNB
|
||||
```bash
|
||||
$ sudo -E ./nr-softmodem -O ../ci-scripts/conf_files/episci/proxy_rcc.band78.tm1.106PRB.nfapi.conf --nfapi VNF --noS1 --emulate-l1
|
||||
```
|
||||
### Start UE
|
||||
```bash
|
||||
$ sudo -E ./nr-uesoftmodem -O ../ci-scripts/conf_files/nrue.uicc.conf --nfapi STANDALONE_PNF --node-number 2 --emulate-l1
|
||||
```
|
||||
### EpiSci's Documentation
|
||||
A more detailed tutorial is available on the [EpiSci GitHub Repository](https://github.com/EpiSci/oai-lte-5g-multi-ue-proxy#readme).
|
||||
|
||||
This proxy allows to perform L2 nFAPI simulator for:
|
||||
|
||||
* LTE
|
||||
* 5G-NSA
|
||||
* 5G-SA
|
||||
|
||||
### L2 Simulator as Docker Containers
|
||||
|
||||
There used to be docker deployment with L2sim that was run in the CI. Since L2
|
||||
simulator does not work anymore, it has been removed. However, you can see the
|
||||
old `README.md` from tag `2024.w44`
|
||||
[here](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/2024.w44/ci-scripts/yaml_files/5g_l2sim_tdd/README.md).
|
||||
In the same directory is a `docker-compose.yaml` file that can be used to run
|
||||
L2sim.
|
||||
Since 5G code has been removed, this proxy allows to perform L2 nFAPI simulator for LTE only.
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "fapi_nr_ue_interface.h"
|
||||
#include "fapi_nr_ue_l1.h"
|
||||
#include "harq_nr.h"
|
||||
@@ -39,247 +38,11 @@
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
#include "PHY/impl_defs_nr.h"
|
||||
#include "utils.h"
|
||||
#include "openair2/PHY_INTERFACE/queue_t.h"
|
||||
#include "SCHED_NR_UE/phy_sch_processing_time.h"
|
||||
#include "openair1/PHY/phy_extern_nr_ue.h"
|
||||
|
||||
const char *const dl_pdu_type[] = {"DCI", "DLSCH", "RA_DLSCH", "SI_DLSCH", "P_DLSCH", "CSI_RS", "CSI_IM", "TA"};
|
||||
const char *const ul_pdu_type[] = {"PRACH", "PUCCH", "PUSCH", "SRS"};
|
||||
queue_t nr_rx_ind_queue;
|
||||
queue_t nr_crc_ind_queue;
|
||||
queue_t nr_uci_ind_queue;
|
||||
queue_t nr_rach_ind_queue;
|
||||
|
||||
static void fill_uci_2_3_4(nfapi_nr_uci_pucch_pdu_format_2_3_4_t *pdu_2_3_4,
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_pdu)
|
||||
{
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(0);
|
||||
memset(pdu_2_3_4, 0, sizeof(*pdu_2_3_4));
|
||||
pdu_2_3_4->handle = 0;
|
||||
pdu_2_3_4->rnti = pucch_pdu->rnti;
|
||||
pdu_2_3_4->pucch_format = 2;
|
||||
pdu_2_3_4->ul_cqi = 255;
|
||||
pdu_2_3_4->timing_advance = 0;
|
||||
pdu_2_3_4->rssi = 0;
|
||||
// TODO: Eventually check 38.212:Sect.631 to know when to use csi_part2, for now only using csi_part1
|
||||
pdu_2_3_4->pduBitmap = 4;
|
||||
pdu_2_3_4->csi_part1.csi_part1_bit_len = mac->nr_ue_emul_l1.num_csi_reports;
|
||||
int csi_part1_byte_len = (int)((pdu_2_3_4->csi_part1.csi_part1_bit_len / 8) + 1);
|
||||
AssertFatal(!pdu_2_3_4->csi_part1.csi_part1_payload, "pdu_2_3_4->csi_part1.csi_part1_payload != NULL\n");
|
||||
pdu_2_3_4->csi_part1.csi_part1_payload = CALLOC(csi_part1_byte_len,
|
||||
sizeof(pdu_2_3_4->csi_part1.csi_part1_payload));
|
||||
for (int k = 0; k < csi_part1_byte_len; k++)
|
||||
{
|
||||
pdu_2_3_4->csi_part1.csi_part1_payload[k] = (pucch_pdu->payload >> (k * 8)) & 0xff;
|
||||
}
|
||||
pdu_2_3_4->csi_part1.csi_part1_crc = 0;
|
||||
}
|
||||
|
||||
static void free_uci_inds(nfapi_nr_uci_indication_t *uci_ind)
|
||||
{
|
||||
for (int k = 0; k < uci_ind->num_ucis; k++)
|
||||
{
|
||||
if (uci_ind->uci_list[k].pdu_type == NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE)
|
||||
{
|
||||
//nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[k].pucch_pdu_format_0_1;
|
||||
// Warning: pdu_0_1 is unused
|
||||
}
|
||||
if (uci_ind->uci_list[k].pdu_type == NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE)
|
||||
{
|
||||
nfapi_nr_uci_pucch_pdu_format_2_3_4_t *pdu_2_3_4 = &uci_ind->uci_list[k].pucch_pdu_format_2_3_4;
|
||||
free(pdu_2_3_4->sr.sr_payload);
|
||||
pdu_2_3_4->sr.sr_payload = NULL;
|
||||
free(pdu_2_3_4->harq.harq_payload);
|
||||
pdu_2_3_4->harq.harq_payload = NULL;
|
||||
}
|
||||
}
|
||||
free(uci_ind->uci_list);
|
||||
uci_ind->uci_list = NULL;
|
||||
free(uci_ind);
|
||||
}
|
||||
|
||||
int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response) {
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(0);
|
||||
|
||||
if (scheduled_response && scheduled_response->ul_config) {
|
||||
int frame = scheduled_response->ul_config->frame;
|
||||
int slot = scheduled_response->ul_config->slot;
|
||||
fapi_nr_ul_config_request_pdu_t *it = fapiLockIterator(scheduled_response->ul_config, frame, slot);
|
||||
while (it->pdu_type != FAPI_NR_END) {
|
||||
switch (it->pdu_type) {
|
||||
case FAPI_NR_UL_CONFIG_TYPE_PRACH: {
|
||||
fapi_nr_ul_config_prach_pdu *prach_pdu = &it->prach_config_pdu;
|
||||
nfapi_nr_rach_indication_t *rach_ind = CALLOC(1, sizeof(*rach_ind));
|
||||
rach_ind->sfn = frame;
|
||||
rach_ind->slot = slot;
|
||||
rach_ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION;
|
||||
uint8_t pdu_index = 0;
|
||||
rach_ind->pdu_list = CALLOC(1, sizeof(*rach_ind->pdu_list));
|
||||
rach_ind->number_of_pdus = 1;
|
||||
rach_ind->pdu_list[pdu_index].phy_cell_id = prach_pdu->phys_cell_id;
|
||||
rach_ind->pdu_list[pdu_index].symbol_index = prach_pdu->prach_start_symbol;
|
||||
rach_ind->pdu_list[pdu_index].slot_index = prach_pdu->prach_slot;
|
||||
rach_ind->pdu_list[pdu_index].freq_index = prach_pdu->num_ra;
|
||||
rach_ind->pdu_list[pdu_index].avg_rssi = 128;
|
||||
rach_ind->pdu_list[pdu_index].avg_snr = 0xff; // invalid for now
|
||||
const int num_p = rach_ind->pdu_list[pdu_index].num_preamble;
|
||||
AssertFatal(num_p == 1, "can handle only one preamble in preamble_list\n");
|
||||
rach_ind->pdu_list[pdu_index].num_preamble = 1;
|
||||
rach_ind->pdu_list[pdu_index].preamble_list[0].preamble_index = prach_pdu->ra_PreambleIndex;
|
||||
rach_ind->pdu_list[pdu_index].preamble_list[0].timing_advance = 0;
|
||||
rach_ind->pdu_list[pdu_index].preamble_list[0].preamble_pwr = 0xffffffff;
|
||||
|
||||
if (!put_queue(&nr_rach_ind_queue, rach_ind)) {
|
||||
free(rach_ind->pdu_list);
|
||||
free(rach_ind);
|
||||
}
|
||||
LOG_D(NR_MAC, "We have successfully filled the rach_ind queue with the recently filled rach ind\n");
|
||||
break;
|
||||
}
|
||||
case (FAPI_NR_UL_CONFIG_TYPE_PUSCH): {
|
||||
nfapi_nr_rx_data_indication_t *rx_ind = CALLOC(1, sizeof(*rx_ind));
|
||||
nfapi_nr_crc_indication_t *crc_ind = CALLOC(1, sizeof(*crc_ind));
|
||||
nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu = &it->pusch_config_pdu;
|
||||
if (pusch_config_pdu->tx_request_body.fapiTxPdu) {
|
||||
rx_ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION;
|
||||
rx_ind->sfn = frame;
|
||||
rx_ind->slot = slot;
|
||||
rx_ind->number_of_pdus = 1;
|
||||
rx_ind->pdu_list = CALLOC(rx_ind->number_of_pdus, sizeof(*rx_ind->pdu_list));
|
||||
for (int j = 0; j < rx_ind->number_of_pdus; j++) {
|
||||
fapi_nr_tx_request_body_t *tx_req_body = &pusch_config_pdu->tx_request_body;
|
||||
rx_ind->pdu_list[j].handle = pusch_config_pdu->handle;
|
||||
rx_ind->pdu_list[j].harq_id = pusch_config_pdu->pusch_data.harq_process_id;
|
||||
rx_ind->pdu_list[j].pdu_length = tx_req_body->pdu_length;
|
||||
rx_ind->pdu_list[j].pdu = CALLOC(tx_req_body->pdu_length, sizeof(*rx_ind->pdu_list[j].pdu));
|
||||
memcpy(rx_ind->pdu_list[j].pdu, tx_req_body->fapiTxPdu, tx_req_body->pdu_length * sizeof(*rx_ind->pdu_list[j].pdu));
|
||||
rx_ind->pdu_list[j].rnti = pusch_config_pdu->rnti;
|
||||
/* TODO: Implement channel modeling to abstract TA and CQI. For now,
|
||||
we hard code the values below since they are set in L1 and we are
|
||||
abstracting L1. */
|
||||
rx_ind->pdu_list[j].timing_advance = 31;
|
||||
rx_ind->pdu_list[j].ul_cqi = 255;
|
||||
}
|
||||
|
||||
crc_ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION;
|
||||
crc_ind->number_crcs = rx_ind->number_of_pdus;
|
||||
crc_ind->sfn = frame;
|
||||
crc_ind->slot = slot;
|
||||
crc_ind->crc_list = CALLOC(crc_ind->number_crcs, sizeof(*crc_ind->crc_list));
|
||||
for (int j = 0; j < crc_ind->number_crcs; j++) {
|
||||
crc_ind->crc_list[j].handle = pusch_config_pdu->handle;
|
||||
crc_ind->crc_list[j].harq_id = pusch_config_pdu->pusch_data.harq_process_id;
|
||||
LOG_D(NR_MAC, "This is the harq pid %d for crc_list[%d]\n", crc_ind->crc_list[j].harq_id, j);
|
||||
LOG_D(NR_MAC, "This is sched sfn/sl [%d %d] and crc sfn/sl [%d %d]\n", frame, slot, crc_ind->sfn, crc_ind->slot);
|
||||
crc_ind->crc_list[j].num_cb = pusch_config_pdu->pusch_data.num_cb;
|
||||
crc_ind->crc_list[j].rnti = pusch_config_pdu->rnti;
|
||||
crc_ind->crc_list[j].tb_crc_status = 0;
|
||||
crc_ind->crc_list[j].timing_advance = 31;
|
||||
crc_ind->crc_list[j].ul_cqi = 255;
|
||||
emul_l1_harq_t *harq = &mac->nr_ue_emul_l1.harq[crc_ind->crc_list[j].harq_id];
|
||||
AssertFatal(harq->active_ul_harq_sfn == -1 && harq->active_ul_harq_slot == -1,
|
||||
"We did not send an active CRC when we should have!\n");
|
||||
harq->active_ul_harq_sfn = crc_ind->sfn;
|
||||
harq->active_ul_harq_slot = crc_ind->slot;
|
||||
LOG_D(NR_MAC,
|
||||
"This is sched sfn/sl [%d %d] and crc sfn/sl [%d %d] with mcs_index in ul_cqi -> %d\n",
|
||||
frame,
|
||||
slot,
|
||||
crc_ind->sfn,
|
||||
crc_ind->slot,
|
||||
pusch_config_pdu->mcs_index);
|
||||
}
|
||||
|
||||
if (!put_queue(&nr_rx_ind_queue, rx_ind)) {
|
||||
LOG_E(NR_MAC, "Put_queue failed for rx_ind\n");
|
||||
for (int i = 0; i < rx_ind->number_of_pdus; i++) {
|
||||
free(rx_ind->pdu_list[i].pdu);
|
||||
rx_ind->pdu_list[i].pdu = NULL;
|
||||
}
|
||||
|
||||
free(rx_ind->pdu_list);
|
||||
rx_ind->pdu_list = NULL;
|
||||
free(rx_ind);
|
||||
rx_ind = NULL;
|
||||
}
|
||||
if (!put_queue(&nr_crc_ind_queue, crc_ind)) {
|
||||
LOG_E(NR_MAC, "Put_queue failed for crc_ind\n");
|
||||
free(crc_ind->crc_list);
|
||||
crc_ind->crc_list = NULL;
|
||||
free(crc_ind);
|
||||
crc_ind = NULL;
|
||||
}
|
||||
|
||||
LOG_D(PHY, "In %s: Filled queue rx/crc_ind which was filled by ulconfig. \n", __FUNCTION__);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case FAPI_NR_UL_CONFIG_TYPE_PUCCH: {
|
||||
nfapi_nr_uci_indication_t *uci_ind = CALLOC(1, sizeof(*uci_ind));
|
||||
uci_ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION;
|
||||
uci_ind->sfn = frame;
|
||||
uci_ind->slot = slot;
|
||||
uci_ind->num_ucis = 1;
|
||||
uci_ind->uci_list = CALLOC(uci_ind->num_ucis, sizeof(*uci_ind->uci_list));
|
||||
for (int j = 0; j < uci_ind->num_ucis; j++) {
|
||||
LOG_D(NR_MAC, "pucch_config_pdu.n_bit = %d\n", it->pucch_config_pdu.n_bit);
|
||||
if (it->pucch_config_pdu.n_bit > 3 && mac->nr_ue_emul_l1.num_csi_reports > 0) {
|
||||
uci_ind->uci_list[j].pdu_type = NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE;
|
||||
uci_ind->uci_list[j].pdu_size = sizeof(nfapi_nr_uci_pucch_pdu_format_2_3_4_t);
|
||||
nfapi_nr_uci_pucch_pdu_format_2_3_4_t *pdu_2_3_4 = &uci_ind->uci_list[j].pucch_pdu_format_2_3_4;
|
||||
fill_uci_2_3_4(pdu_2_3_4, &it->pucch_config_pdu);
|
||||
} else {
|
||||
nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[j].pucch_pdu_format_0_1;
|
||||
uci_ind->uci_list[j].pdu_type = NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE;
|
||||
uci_ind->uci_list[j].pdu_size = sizeof(nfapi_nr_uci_pucch_pdu_format_0_1_t);
|
||||
memset(pdu_0_1, 0, sizeof(*pdu_0_1));
|
||||
pdu_0_1->handle = 0;
|
||||
pdu_0_1->rnti = it->pucch_config_pdu.rnti;
|
||||
pdu_0_1->pucch_format = 1;
|
||||
pdu_0_1->ul_cqi = 255;
|
||||
pdu_0_1->timing_advance = 0;
|
||||
pdu_0_1->rssi = 0;
|
||||
if (mac->nr_ue_emul_l1.num_harqs > 0) {
|
||||
int harq_index = 0;
|
||||
pdu_0_1->pduBitmap = 2; // (value->pduBitmap >> 1) & 0x01) == HARQ and (value->pduBitmap) & 0x01) == SR
|
||||
pdu_0_1->harq.num_harq = mac->nr_ue_emul_l1.num_harqs;
|
||||
pdu_0_1->harq.harq_confidence_level = 0;
|
||||
int harq_pid = -1;
|
||||
for (int k = 0; k < NR_MAX_HARQ_PROCESSES; k++) {
|
||||
if (mac->nr_ue_emul_l1.harq[k].active && mac->nr_ue_emul_l1.harq[k].active_dl_harq_sfn == uci_ind->sfn
|
||||
&& mac->nr_ue_emul_l1.harq[k].active_dl_harq_slot == uci_ind->slot) {
|
||||
mac->nr_ue_emul_l1.harq[k].active = false;
|
||||
harq_pid = k;
|
||||
AssertFatal(harq_index < pdu_0_1->harq.num_harq, "Invalid harq_index %d\n", harq_index);
|
||||
pdu_0_1->harq.harq_list[harq_index].harq_value = !mac->dl_harq_info[k].ack;
|
||||
harq_index++;
|
||||
}
|
||||
}
|
||||
AssertFatal(harq_pid != -1, "No active harq_pid, sfn_slot = %u.%u", uci_ind->sfn, uci_ind->slot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LOG_D(NR_PHY, "Sending UCI with %d PDUs in sfn.slot %d/%d\n", uci_ind->num_ucis, uci_ind->sfn, uci_ind->slot);
|
||||
NR_UL_IND_t ul_info = {
|
||||
.uci_ind = *uci_ind,
|
||||
};
|
||||
send_nsa_standalone_msg(&ul_info, uci_ind->header.message_id);
|
||||
free_uci_inds(uci_ind);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
LOG_W(NR_MAC, "Unknown ul_config->pdu_type %d\n", it->pdu_type);
|
||||
break;
|
||||
}
|
||||
it++;
|
||||
}
|
||||
release_ul_config(it, true);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void configure_dlsch(NR_UE_DLSCH_t *dlsch0,
|
||||
NR_DL_UE_HARQ_t *harq_list,
|
||||
|
||||
@@ -320,35 +320,6 @@ typedef struct {
|
||||
uint8_t nbits;
|
||||
} dci_field_t;
|
||||
|
||||
typedef struct {
|
||||
/* The active harq sfn/slot field was created to save the
|
||||
scheduled SFN/Slot transmission for the ACK/NAK. If we
|
||||
do not save it, then we have to calculate it again as the
|
||||
NRUE MAC layer already does in get_downlink_ack(). */
|
||||
int active_dl_harq_sfn;
|
||||
int active_dl_harq_slot;
|
||||
int active_ul_harq_sfn;
|
||||
int active_ul_harq_slot;
|
||||
bool active;
|
||||
} emul_l1_harq_t;
|
||||
|
||||
typedef struct {
|
||||
bool expected_sib;
|
||||
bool index_has_sib[NR_MAX_HARQ_PROCESSES];
|
||||
bool expected_rar;
|
||||
bool index_has_rar[NR_MAX_HARQ_PROCESSES];
|
||||
bool expected_dci;
|
||||
bool index_has_dci[NR_MAX_HARQ_PROCESSES];
|
||||
emul_l1_harq_t harq[NR_MAX_HARQ_PROCESSES];
|
||||
int active_uci_sfn_slot;
|
||||
int num_srs;
|
||||
int num_harqs;
|
||||
int num_csi_reports;
|
||||
uint8_t pmi;
|
||||
uint8_t ri;
|
||||
uint8_t cqi;
|
||||
} nr_emulated_l1_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
uint8_t format_indicator; //1 bit
|
||||
|
||||
@@ -1942,8 +1942,7 @@ void nr_rrc_mac_config_req_sib1(module_id_t module_id, int cc_idP, NR_SIB1_t *si
|
||||
if (mac->state == UE_RECEIVING_SIB && can_start_ra)
|
||||
mac->state = UE_PERFORMING_RA;
|
||||
|
||||
if (!get_softmodem_params()->emulate_l1)
|
||||
mac->if_module->phy_config_request(&mac->phy_config);
|
||||
mac->if_module->phy_config_request(&mac->phy_config);
|
||||
ret = pthread_mutex_unlock(&mac->if_mutex);
|
||||
AssertFatal(!ret, "mutex failed %d\n", ret);
|
||||
}
|
||||
@@ -2002,13 +2001,11 @@ static void handle_reconfiguration_with_sync(NR_UE_MAC_INST_t *mac,
|
||||
ra->ra_state = nrRA_UE_IDLE;
|
||||
nr_ue_mac_default_configs(mac);
|
||||
|
||||
if (!get_softmodem_params()->emulate_l1) {
|
||||
mac->synch_request.Mod_id = mac->ue_id;
|
||||
mac->synch_request.CC_id = cc_idP;
|
||||
mac->synch_request.synch_req.target_Nid_cell = mac->physCellId;
|
||||
mac->if_module->synch_request(&mac->synch_request);
|
||||
mac->if_module->phy_config_request(&mac->phy_config);
|
||||
}
|
||||
mac->synch_request.Mod_id = mac->ue_id;
|
||||
mac->synch_request.CC_id = cc_idP;
|
||||
mac->synch_request.synch_req.target_Nid_cell = mac->physCellId;
|
||||
mac->if_module->synch_request(&mac->synch_request);
|
||||
mac->if_module->phy_config_request(&mac->phy_config);
|
||||
}
|
||||
|
||||
static void configure_physicalcellgroup(NR_UE_MAC_INST_t *mac,
|
||||
|
||||
@@ -646,8 +646,6 @@ typedef struct NR_UE_MAC_INST_s {
|
||||
NR_TimeAlignmentTimer_t timeAlignmentTimerCommon;
|
||||
NR_timer_t time_alignment_timer;
|
||||
|
||||
nr_emulated_l1_t nr_ue_emul_l1;
|
||||
|
||||
pthread_mutex_t mutex_dl_info;
|
||||
|
||||
//SIDELINK MAC PARAMETERS
|
||||
|
||||
@@ -1253,7 +1253,6 @@ void prepare_msg4_msgb_feedback(NR_UE_MAC_INST_t *mac, int pid, int ack_nack)
|
||||
NR_UE_DL_HARQ_STATUS_t *current_harq = &mac->dl_harq_info[pid];
|
||||
int sched_slot = current_harq->ul_slot;
|
||||
int sched_frame = current_harq->ul_frame;
|
||||
mac->nr_ue_emul_l1.num_harqs = 1;
|
||||
PUCCH_sched_t pucch = {.n_CCE = current_harq->n_CCE,
|
||||
.N_CCE = current_harq->N_CCE,
|
||||
.ack_payload = ack_nack,
|
||||
|
||||
@@ -2420,11 +2420,6 @@ bool get_downlink_ack(NR_UE_MAC_INST_t *mac, frame_t frame, int slot, PUCCH_sche
|
||||
dl_harq_pid, current_harq->ul_frame, current_harq->ul_slot);
|
||||
/* check if current tx slot should transmit downlink acknowlegment */
|
||||
if (current_harq->ul_frame == frame && current_harq->ul_slot == slot) {
|
||||
if (get_softmodem_params()->emulate_l1) {
|
||||
mac->nr_ue_emul_l1.harq[dl_harq_pid].active = true;
|
||||
mac->nr_ue_emul_l1.harq[dl_harq_pid].active_dl_harq_sfn = frame;
|
||||
mac->nr_ue_emul_l1.harq[dl_harq_pid].active_dl_harq_slot = slot;
|
||||
}
|
||||
if (res_ind != -1 && res_ind != current_harq->pucch_resource_indicator)
|
||||
LOG_E(NR_MAC,
|
||||
"Value of pucch_resource_indicator %d not matching with what set before %d (Possibly due to a false DCI) \n",
|
||||
@@ -3037,18 +3032,6 @@ static csi_payload_t get_csirs_RI_PMI_CQI_payload(NR_UE_MAC_INST_t *mac,
|
||||
int pmi_x1_bitlen = csi_report->csi_meas_bitlen.pmi_x1_bitlen[mac->l1_measurements.rank_indicator];
|
||||
int pmi_x2_bitlen = csi_report->csi_meas_bitlen.pmi_x2_bitlen[mac->l1_measurements.rank_indicator];
|
||||
int cqi_bitlen = csi_report->csi_meas_bitlen.cqi_bitlen[mac->l1_measurements.rank_indicator];
|
||||
|
||||
if (get_softmodem_params()->emulate_l1) {
|
||||
static const uint8_t mcs_to_cqi[] = {0, 1, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,
|
||||
10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15};
|
||||
CHECK_INDEX(nr_bler_data, NR_NUM_MCS - 1);
|
||||
int mcs = get_mcs_from_sinr(nr_bler_data, (mac->nr_ue_emul_l1.cqi - 640) * 0.1);
|
||||
CHECK_INDEX(mcs_to_cqi, mcs);
|
||||
mac->l1_measurements.rank_indicator = mac->nr_ue_emul_l1.ri;
|
||||
mac->l1_measurements.i1 = mac->nr_ue_emul_l1.pmi;
|
||||
mac->l1_measurements.cqi = mcs_to_cqi[mcs];
|
||||
}
|
||||
|
||||
int padding_bitlen = 0;
|
||||
// TODO: Improvements will be needed to cri_bitlen>0 and pmi_x1_bitlen>0
|
||||
if (mapping_type == ON_PUSCH) {
|
||||
@@ -4291,21 +4274,6 @@ static void nr_ue_process_rar(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *d
|
||||
handle_rar_reception(mac, rar, frame, slot);
|
||||
if (ra->cfra)
|
||||
nr_ra_succeeded(mac, dl_info->gNB_index, frame, slot);
|
||||
if (get_softmodem_params()->emulate_l1) {
|
||||
/* When we are emulating L1 with multiple UEs, the rx_indication will have
|
||||
multiple RAR PDUs. The code would previously handle each of these PDUs,
|
||||
but it should only be handling the single RAR that matches the current
|
||||
UE. */
|
||||
LOG_I(NR_MAC, "RAR PDU found for our UE with PDU index %d\n", pdu_id);
|
||||
dl_info->rx_ind->number_pdus = 1;
|
||||
if (pdu_id != 0) {
|
||||
memcpy(&dl_info->rx_ind->rx_indication_body[0],
|
||||
&dl_info->rx_ind->rx_indication_body[pdu_id],
|
||||
sizeof(fapi_nr_rx_indication_body_t));
|
||||
}
|
||||
mac->nr_ue_emul_l1.expected_rar = false;
|
||||
memset(mac->nr_ue_emul_l1.index_has_rar, 0, sizeof(mac->nr_ue_emul_l1.index_has_rar));
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (rarh->E == 0) {
|
||||
|
||||
@@ -1718,10 +1718,6 @@ static bool schedule_uci_on_pusch(NR_UE_MAC_INST_t *mac,
|
||||
static void nr_ue_pucch_scheduler(NR_UE_MAC_INST_t *mac, frame_t frame, int slot)
|
||||
{
|
||||
PUCCH_sched_t pucch[3] = {0}; // TODO the size might change in the future in case of multiple SR or multiple CSI in a slot
|
||||
|
||||
mac->nr_ue_emul_l1.num_srs = 0;
|
||||
mac->nr_ue_emul_l1.num_harqs = 0;
|
||||
mac->nr_ue_emul_l1.num_csi_reports = 0;
|
||||
int num_res = 0;
|
||||
|
||||
if (mac->ra.ra_pucch) {
|
||||
@@ -1771,9 +1767,6 @@ static void nr_ue_pucch_scheduler(NR_UE_MAC_INST_t *mac, frame_t frame, int slot
|
||||
pucch[j].n_harq,
|
||||
pucch[j].n_sr,
|
||||
pucch[j].n_csi);
|
||||
mac->nr_ue_emul_l1.num_srs = pucch[j].n_sr;
|
||||
mac->nr_ue_emul_l1.num_harqs = pucch[j].n_harq;
|
||||
mac->nr_ue_emul_l1.num_csi_reports = pucch[j].n_csi;
|
||||
|
||||
// checking if we need to schedule pucch[j] on PUSCH
|
||||
if (schedule_uci_on_pusch(mac, frame, slot, &pucch[j], mac->current_UL_BWP))
|
||||
@@ -1784,9 +1777,6 @@ static void nr_ue_pucch_scheduler(NR_UE_MAC_INST_t *mac, frame_t frame, int slot
|
||||
LOG_E(NR_MAC, "Error in pucch allocation\n");
|
||||
return;
|
||||
}
|
||||
DevAssert(mac->current_DL_BWP != NULL);
|
||||
int mu = mac->current_DL_BWP->scs;
|
||||
mac->nr_ue_emul_l1.active_uci_sfn_slot = NFAPI_SFNSLOT2DEC(mu, frame, slot);
|
||||
int ret = nr_ue_configure_pucch(mac,
|
||||
slot,
|
||||
frame,
|
||||
|
||||
@@ -1262,7 +1262,7 @@ pdcp_run (
|
||||
|
||||
// IP/NAS -> PDCP traffic : TX, read the pkt from the upper layer buffer
|
||||
// if (LINK_ENB_PDCP_TO_GTPV1U && ctxt_pP->enb_flag == ENB_FLAG_NO) {
|
||||
if (!get_softmodem_params()->emulate_l1 && (IS_SOFTMODEM_NOS1 || ctxt_pP->enb_flag == ENB_FLAG_NO)) {
|
||||
if (IS_SOFTMODEM_NOS1 || ctxt_pP->enb_flag == ENB_FLAG_NO) {
|
||||
pdcp_fifo_read_input_sdus(ctxt_pP);
|
||||
}
|
||||
|
||||
@@ -1272,9 +1272,7 @@ pdcp_run (
|
||||
} else {
|
||||
start_meas(&UE_pdcp_stats[ctxt_pP->module_id].pdcp_ip);
|
||||
}
|
||||
if (!get_softmodem_params()->emulate_l1) {
|
||||
pdcp_fifo_flush_sdus(ctxt_pP);
|
||||
}
|
||||
pdcp_fifo_flush_sdus(ctxt_pP);
|
||||
|
||||
if (ctxt_pP->enb_flag) {
|
||||
stop_meas(&eNB_pdcp_stats[ctxt_pP->module_id].pdcp_ip);
|
||||
|
||||
@@ -138,8 +138,6 @@ void NR_IF_Module_kill(int Mod_id);
|
||||
|
||||
void NR_UL_indication(NR_UL_IND_t *UL_INFO);
|
||||
|
||||
void RCconfig_nr_ue_macrlc(void);
|
||||
|
||||
/*Interface for Downlink, transmitting the DLSCH SDU, DCI SDU*/
|
||||
void NR_Schedule_Response(NR_Sched_Rsp_t *Sched_INFO);
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -34,11 +34,8 @@
|
||||
#define __NR_IF_MODULE_H__
|
||||
|
||||
#include "common/platform_types.h"
|
||||
#include <semaphore.h>
|
||||
#include "fapi_nr_ue_interface.h"
|
||||
#include "openair2/PHY_INTERFACE/queue_t.h"
|
||||
#include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h"
|
||||
#include "NR_Packet_Drop.h"
|
||||
#include "nfapi/open-nFAPI/nfapi/public_inc/sidelink_nr_ue_interface.h"
|
||||
|
||||
typedef enum sl_sidelink_slot_type {
|
||||
@@ -50,19 +47,6 @@ typedef enum sl_sidelink_slot_type {
|
||||
|
||||
} sl_sidelink_slot_type_t;
|
||||
|
||||
extern queue_t nr_rach_ind_queue;
|
||||
extern queue_t nr_rx_ind_queue;
|
||||
extern queue_t nr_crc_ind_queue;
|
||||
extern queue_t nr_uci_ind_queue;
|
||||
extern queue_t nr_sfn_slot_queue;
|
||||
extern queue_t nr_chan_param_queue;
|
||||
extern queue_t nr_dl_tti_req_queue;
|
||||
extern queue_t nr_tx_req_queue;
|
||||
extern queue_t nr_ul_dci_req_queue;
|
||||
extern queue_t nr_ul_tti_req_queue;
|
||||
|
||||
extern slot_rnti_mcs_s slot_rnti_mcs[NUM_NFAPI_SLOT];
|
||||
|
||||
typedef struct NR_UL_TIME_ALIGNMENT NR_UL_TIME_ALIGNMENT_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -292,32 +276,6 @@ typedef struct nr_ue_if_module_s {
|
||||
\param module_id module id*/
|
||||
nr_ue_if_module_t *nr_ue_if_module_init(uint32_t module_id);
|
||||
|
||||
void nrue_init_standalone_socket(int tx_port, int rx_port);
|
||||
|
||||
void *nrue_standalone_pnf_task(void *context);
|
||||
extern sem_t sfn_slot_semaphore;
|
||||
|
||||
typedef struct nfapi_dl_tti_config_req_tx_data_req_t
|
||||
{
|
||||
nfapi_nr_dl_tti_request_pdu_t *dl_itti_config_req;
|
||||
nfapi_nr_tx_data_request_t *tx_data_req_pdu_list;
|
||||
} nfapi_dl_tti_config_req_tx_data_req_t;
|
||||
|
||||
void send_nsa_standalone_msg(NR_UL_IND_t *UL_INFO, uint16_t msg_id);
|
||||
|
||||
void save_nr_measurement_info(nfapi_nr_dl_tti_request_t *dl_tti_request);
|
||||
|
||||
void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request,
|
||||
nfapi_nr_tx_data_request_t *tx_data_request,
|
||||
nfapi_nr_ul_dci_request_t *ul_dci_request,
|
||||
nfapi_nr_ul_tti_request_t *ul_tti_request);
|
||||
|
||||
struct sfn_slot_s {
|
||||
int sfn;
|
||||
int slot;
|
||||
};
|
||||
bool sfn_slot_matcher(void *sfn_slot_s, void *candidate);
|
||||
|
||||
/**\brief interface between L1/L2, indicating the downlink related information, like dci_ind and rx_req
|
||||
\param dl_info including dci_ind and rx_request messages*/
|
||||
int nr_ue_dl_indication(nr_downlink_indication_t *dl_info);
|
||||
|
||||
@@ -6354,7 +6354,7 @@ rrc_eNB_decode_dcch(
|
||||
/*NN: revise the condition */
|
||||
/*FK: left the condition as is for the case MME is used (S1 mode) but setting dedicated_DRB = 1 otherwise (noS1 mode) so that no second RRCReconfiguration message activationg more DRB is sent as this causes problems with the nasmesh driver.*/
|
||||
|
||||
if (!IS_SOFTMODEM_NOS1 || get_softmodem_params()->emulate_l1) {
|
||||
if (!IS_SOFTMODEM_NOS1) {
|
||||
if (ue_context_p->ue_context.StatusRrc == RRC_RECONFIGURED) {
|
||||
dedicated_DRB = 1;
|
||||
LOG_I(RRC,
|
||||
|
||||
@@ -2921,7 +2921,7 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
|
||||
LOG_D(NR_RRC, "NR carrierFreq_r15 (ssb): %ld and sub carrier spacing:%ld\n",
|
||||
nr_meas_obj->measObject.choice.measObjectNR_r15.carrierFreq_r15,
|
||||
nr_meas_obj->measObject.choice.measObjectNR_r15.rs_ConfigSSB_r15.subcarrierSpacingSSB_r15);
|
||||
start_oai_nrue_threads();
|
||||
//start_oai_nrue_threads();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -74,8 +74,6 @@ void *recv_msgs_from_lte_ue(void *args_p);
|
||||
|
||||
void init_connections_with_lte_ue(void);
|
||||
|
||||
extern void start_oai_nrue_threads(void);
|
||||
|
||||
int get_from_lte_ue_fd();
|
||||
|
||||
void nr_rrc_SI_timers(NR_UE_RRC_SI_INFO *SInfo);
|
||||
|
||||
Reference in New Issue
Block a user