remove emulate_l1 code

This commit is contained in:
francescomani
2025-10-08 17:39:29 +02:00
parent 55a56002de
commit f4e4ef74ff
20 changed files with 90 additions and 1763 deletions
-29
View File
@@ -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
+6 -9
View File
@@ -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,
-2
View File
@@ -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,
+2 -4
View File
@@ -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);
-2
View File
@@ -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);
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -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;
}
-2
View File
@@ -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);