From d718e6779780ac3b00b1016681dc67091148e951 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 6 Jan 2025 09:32:03 +0100 Subject: [PATCH 1/2] automatic determination of DCI mask size at the UE --- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 8a46ad9a25..038d699836 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -3011,10 +3011,10 @@ void nr_ue_send_sdu(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *dl_info, in // Fixme: Intel Endianess only procedure static inline int readBits(const uint8_t *dci, int *start, int length) { - const int mask[] = {0, 1, 3, 7, 0xf, 0x1f, 0x3f, 0x7f, 0xff, 0x1ff, 0x3ff, 0x7ff, 0xfff, 0x1fff, 0x3fff, 0x7fff, 0xffff}; + uint32_t mask = (1U << length) - 1; uint64_t *tmp = (uint64_t *)dci; *start -= length; - return *tmp >> *start & mask[length]; + return *tmp >> *start & mask; } static void extract_10_ra_rnti(dci_pdu_rel15_t *dci_pdu_rel15, const uint8_t *dci_pdu, int pos, const int N_RB) From a7b9a856409974fe3387ac553b8319b82ba1b068 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 6 Jan 2025 12:06:40 +0100 Subject: [PATCH 2/2] move temporary code to process type0 as type1 when the RB allocation is contiguous to L1 --- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 20 ++++++++++++++++++++ openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 18 ------------------ 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 4ab9167c0a..c6a477a8ee 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -287,6 +287,26 @@ static void configure_dlsch(NR_UE_DLSCH_t *dlsch0, NR_UE_MAC_INST_t *mac, int rnti) { + // Temporary code to process type0 as type1 when the RB allocation is contiguous + if (dlsch_config_pdu->resource_alloc == 0) { + dlsch_config_pdu->number_rbs = count_bits(dlsch_config_pdu->rb_bitmap, sizeofArray(dlsch_config_pdu->rb_bitmap)); + int state = 0; + for (int i = 0; i < sizeof(dlsch_config_pdu->rb_bitmap) * 8; i++) { + int allocated = dlsch_config_pdu->rb_bitmap[i / 8] & (1 << (i % 8)); + if (allocated) { + if (state == 0) { + dlsch_config_pdu->start_rb = i; + state = 1; + } else + AssertFatal(state == 1, "non-contiguous RB allocation in RB allocation type 0 not implemented"); + } else { + if (state == 1) { + state = 2; + } + } + } + } + const uint8_t current_harq_pid = dlsch_config_pdu->harq_process_nbr; dlsch0->active = true; dlsch0->rnti = rnti; diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 038d699836..272d2b93bd 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -390,24 +390,6 @@ int8_t nr_ue_process_dci_freq_dom_resource_assignment(nfapi_nr_ue_pusch_pdu_t *p const int tmp=(start_DLBWP + n_RB_DLBWP) % P; int last_RBG = tmp ? tmp : P; writeBit(rb_bitmap, currentBit, last_bit_rbg, last_RBG); - - dlsch_config_pdu->number_rbs = count_bits(dlsch_config_pdu->rb_bitmap, sizeofArray(dlsch_config_pdu->rb_bitmap)); - // Temporary code to process type0 as type1 when the RB allocation is contiguous - int state = 0; - for (int i = 0; i < sizeof(dlsch_config_pdu->rb_bitmap) * 8; i++) { - int allocated = dlsch_config_pdu->rb_bitmap[i / 8] & (1 << (i % 8)); - if (allocated) { - if (state == 0) { - dlsch_config_pdu->start_rb = i; - state = 1; - } else - AssertFatal(state == 1, "non-contiguous RB allocation in RB allocation type 0 not implemented"); - } else { - if (state == 1) { - state = 2; - } - } - } } else if (pdsch_Config && pdsch_Config->resourceAllocation == NR_PDSCH_Config__resourceAllocation_dynamicSwitch)