Merge remote-tracking branch 'origin/type0dlsch' into integration_2026_w17 (!3762)

L1 gNB type0 PDSCH

PDSCH type0 allows frequency allocation via PRB bitmap (type1 is via
start and number of PRBs) allowing for non contiguous allocation in
frequency domain
This commit is contained in:
Jaroslava Fiedlerova
2026-04-23 10:19:40 +02:00
36 changed files with 494 additions and 361 deletions
@@ -5,7 +5,7 @@
#include <math.h>
#include "nr_mac.h"
#include "nr_mac_common.h"
#include "common/utils/nr/nr_common.h"
#include "common/utils/bits.h"
#include <limits.h>
#include <executables/softmodem-common.h>
+20 -16
View File
@@ -27,7 +27,7 @@
/* utils */
#include "assertions.h"
#include "reverse_bits.h"
#include "bits.h"
#include "oai_asn1.h"
#include "common/utils/LOG/log.h"
#include "LAYER2/nr_rlc/nr_rlc_oai_api.h"
@@ -380,14 +380,14 @@ int8_t nr_ue_process_dci_freq_dom_resource_assignment(nfapi_nr_ue_pusch_pdu_t *p
currentBit += writeBit(rb_bitmap, currentBit, bit_rbg, P);
}
// write last bit
int last_bit_rbg = frequency_domain_assignment.val & 0x01;
const int tmp=(start_DLBWP + n_RB_DLBWP) % P;
int last_RBG = tmp ? tmp : P;
writeBit(rb_bitmap, currentBit, last_bit_rbg, last_RBG);
}
else if (pdsch_Config &&
pdsch_Config->resourceAllocation == NR_PDSCH_Config__resourceAllocation_dynamicSwitch)
// write last bit (only if more than 1 RBG)
if (n_RBG > 1) {
int last_bit_rbg = frequency_domain_assignment.val & 0x01;
const int tmp = (start_DLBWP + n_RB_DLBWP) % P;
int last_RBG = tmp ? tmp : P;
writeBit(rb_bitmap, currentBit, last_bit_rbg, last_RBG);
}
} else if (pdsch_Config && pdsch_Config->resourceAllocation == NR_PDSCH_Config__resourceAllocation_dynamicSwitch)
AssertFatal(false, "DLSCH dynamic switch allocation not yet supported\n");
else {
// TS 38.214 subclause 5.1.2.2.2 Downlink resource allocation type 1
@@ -408,7 +408,7 @@ int8_t nr_ue_process_dci_freq_dom_resource_assignment(nfapi_nr_ue_pusch_pdu_t *p
LOG_D(MAC,"DLSCH start_rb = %i\n", dlsch_config_pdu->start_rb);
}
}
if(pusch_config_pdu != NULL){
if(pusch_config_pdu != NULL) {
/*
* TS 38.214 subclause 6.1.2.2 Resource allocation in frequency domain (uplink)
*/
@@ -428,10 +428,6 @@ int8_t nr_ue_process_dci_freq_dom_resource_assignment(nfapi_nr_ue_pusch_pdu_t *p
LOG_W(MAC, "Frequency domain assignment values are invalid! #RBs: %d, Start RB: %d, n_RB_ULBWP: %d \n",pusch_config_pdu->rb_size, pusch_config_pdu->rb_start, n_RB_ULBWP);
return -1;
}
LOG_D(MAC,"ULSCH riv = %i\n", riv);
LOG_D(MAC,"ULSCH n_RB_DLBWP = %i\n", n_RB_ULBWP);
LOG_D(MAC,"ULSCH number_rbs = %i\n", pusch_config_pdu->rb_size);
LOG_D(MAC,"ULSCH start_rb = %i\n", pusch_config_pdu->rb_start);
}
return 0;
}
@@ -1376,12 +1372,20 @@ static int nr_ue_process_dci_dl_11(NR_UE_MAC_INST_t *mac,
nb_rb_oh = 0;
int nb_re_dmrs = ((dmrs_type == NULL) ? 6 : 4) * dlsch_pdu->n_dmrs_cdm_groups;
int number_rbs;
if (dlsch_pdu->resource_alloc == 1) {
number_rbs = dlsch_pdu->number_rbs;
} else {
uint32_t temp_bitmap[9];
memcpy(temp_bitmap, dlsch_pdu->rb_bitmap, 36);
number_rbs = count_bits(temp_bitmap, 9);
}
int R = nr_get_code_rate_dl(dlsch_pdu->mcs, dlsch_pdu->mcs_table);
if (R > 0) {
dlsch_pdu->targetCodeRate = R;
dlsch_pdu->TBS = nr_compute_tbs(dlsch_pdu->qamModOrder,
R,
dlsch_pdu->number_rbs,
number_rbs,
dlsch_pdu->number_symbols,
nb_re_dmrs * get_num_dmrs(dlsch_pdu->dlDmrsSymbPos),
nb_rb_oh,
@@ -1422,7 +1426,7 @@ static int nr_ue_process_dci_dl_11(NR_UE_MAC_INST_t *mac,
if (dl_dmrs_config->phaseTrackingRS != NULL) {
bool valid_ptrs_setup =
set_dl_ptrs_values(dl_dmrs_config->phaseTrackingRS->choice.setup,
dlsch_pdu->number_rbs,
number_rbs,
dlsch_pdu->mcs,
dlsch_pdu->mcs_table,
&dlsch_pdu->PTRSFreqDensity,
+1 -1
View File
@@ -23,7 +23,7 @@
#include "oai_asn1.h"
#include "SIMULATION/TOOLS/sim.h" // for taus
#include "utils.h"
#include "bits.h"
#include <executables/softmodem-common.h>
#include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h"
#include "RRC/NR_UE/L2_interface_ue.h"
@@ -15,7 +15,7 @@
/* Utils */
#include "common/utils/LOG/log.h"
#include "common/utils/nr/nr_common.h"
#include "common/utils/bits.h"
#include "UTIL/OPT/opt.h"
/* rlc */
@@ -11,8 +11,8 @@
#include "NR_MAC_gNB/nr_mac_gNB.h"
#include "NR_MAC_gNB/mac_proto.h"
#include "common/utils/bits.h"
#include "common/utils/LOG/log.h"
#include "common/utils/nr/nr_common.h"
#include "UTIL/OPT/opt.h"
#include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h"
+1 -1
View File
@@ -24,7 +24,7 @@
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
#include "openair3/UTILS/conversions.h"
#include "LAYER2/nr_rlc/nr_rlc_asn1_utils.h"
#include "reverse_bits.h"
#include "bits.h"
#include "NR_MeasurementTimingConfiguration.h"
#include "uper_decoder.h"
+1 -1
View File
@@ -11,7 +11,7 @@
#include "NR_MAC_UE/mac_proto.h"
#include "assertions.h"
#include "SCHED_NR_UE/fapi_nr_ue_l1.h"
#include "reverse_bits.h"
#include "bits.h"
#include "openair2/RRC/NR_UE/L2_interface_ue.h"
#define MAX_IF_MODULES 100
+5 -3
View File
@@ -2,7 +2,8 @@
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
*/
#include "rrc_proto.h"
#include "rrc_proto.h"
#include "common/utils/bits.h"
static bool check_resourcesForInterference(const NR_CSI_MeasConfig_t *meas, NR_CSI_ResourceConfigId_t res_id, bool is_CSIIM)
{
@@ -119,8 +120,9 @@ static bool check_csi_resourceMapping_consistency(NR_CSI_RS_ResourceMapping_t re
valid = false;
break;
case NR_CSI_RS_ResourceMapping__nrofPorts_p8: {
uint8_t freq = BIT_STRING_to_uint8(&resourceMapping.frequencyDomainAllocation.choice.other);
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2 || count_bits(&freq, 1) != 4) {
uint32_t freq32 = 0;
freq32 = (uint32_t)BIT_STRING_to_uint8(&resourceMapping.frequencyDomainAllocation.choice.other);
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2 || count_bits(&freq32, 1) != 4) {
// row 7 and 8 -> l0+1
if (resourceMapping.firstOFDMSymbolInTimeDomain == 13)
valid = false;