diff --git a/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf
index e26fc3030d..b78ca916f3 100644
--- a/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf
+++ b/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf
@@ -63,8 +63,8 @@ gNBs =
dl_carrierBandwidth = 106;
#initialDownlinkBWP
#genericParameters
- # this is RBstart=27,L=48 (275*(L-1))+RBstart
- initialDLBWPlocationAndBandwidth = 13475; # 6366 12925 12956 28875 12952
+ # this is RBstart=0,L=106 (275*(L-1))+RBstart
+ initialDLBWPlocationAndBandwidth = 28875;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialDLBWPsubcarrierSpacing = 1;
@@ -85,7 +85,7 @@ gNBs =
pMax = 20;
#initialUplinkBWP
#genericParameters
- initialULBWPlocationAndBandwidth = 13475;
+ initialULBWPlocationAndBandwidth = 28875;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialULBWPsubcarrierSpacing = 1;
diff --git a/ci-scripts/xml_files/container_5g_fdd_rfsim.xml b/ci-scripts/xml_files/container_5g_fdd_rfsim.xml
index 61a2af9e54..b41dafb767 100644
--- a/ci-scripts/xml_files/container_5g_fdd_rfsim.xml
+++ b/ci-scripts/xml_files/container_5g_fdd_rfsim.xml
@@ -33,12 +33,10 @@
000013
020011
020012
- 100011
-
-
+ 100011
+
@@ -104,7 +102,7 @@
rfsim5g-oai-ext-dn
rfsim5g-oai-nr-ue
-u -i 1 -s
- -B 12.1.1.2 -c 192.168.72.135 -u -i 1 -t 30 -b 1M
+ -B 12.1.1.2 -c 192.168.72.135 -u -i 1 -t 30 -b 3M
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
index d57f9df223..a2d56036d4 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
@@ -391,7 +391,7 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP
const int16_t N_RA_RB = get_N_RA_RB(cfg->prach_config.prach_sub_c_spacing.value, mu_pusch);
uint16_t *vrb_map_UL = &cc->vrb_map_UL[slotP * MAX_BWP_SIZE];
for (int i = 0; i < N_RA_RB * fdm; ++i)
- vrb_map_UL[bwp_start + rach_ConfigGeneric->msg1_FrequencyStart + i] = SL_to_bitmap(start_symbol, N_t_slot*N_dur);
+ vrb_map_UL[bwp_start + rach_ConfigGeneric->msg1_FrequencyStart + i] |= SL_to_bitmap(start_symbol, N_t_slot*N_dur);
}
}
}
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c
index 2341a908b4..9229cfbdbd 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c
@@ -426,7 +426,7 @@ uint32_t schedule_control_sib1(module_id_t module_id,
gNB_mac->sched_ctrlCommon->cce_index,
gNB_mac->sched_ctrlCommon->aggregation_level);
for (int rb = 0; rb < gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize; rb++) {
- vrb_map[rb + rbStart] = SL_to_bitmap(startSymbolIndex, nrOfSymbols);
+ vrb_map[rb + rbStart] |= SL_to_bitmap(startSymbolIndex, nrOfSymbols);
}
return TBS;
}
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
index ef55ff04b3..3a67b7fca9 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
@@ -576,8 +576,8 @@ bool allocate_dl_retransmission(module_id_t module_id,
rbStart += rbSize; /* last iteration rbSize was not enough, skip it */
rbSize = 0;
- while (rbStart < bwpSize &&
- !(rballoc_mask[rbStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols)))
+ const int slbitmap = SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols);
+ while (rbStart < bwpSize && (rballoc_mask[rbStart] & slbitmap) != slbitmap)
rbStart++;
if (rbStart >= bwpSize) {
@@ -586,7 +586,7 @@ bool allocate_dl_retransmission(module_id_t module_id,
}
while (rbStart + rbSize < bwpSize &&
- (rballoc_mask[rbStart + rbSize]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols)) &&
+ (rballoc_mask[rbStart + rbSize] & slbitmap) == slbitmap &&
rbSize < retInfo->rbSize)
rbSize++;
}
@@ -619,12 +619,11 @@ bool allocate_dl_retransmission(module_id_t module_id,
sched_ctrl,
&temp_ps);
- while (rbStart < bwpSize &&
- !(rballoc_mask[rbStart]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols)))
+ const uint16_t slbitmap = SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols);
+ while (rbStart < bwpSize && (rballoc_mask[rbStart] & slbitmap) != slbitmap)
rbStart++;
- while (rbStart + rbSize < bwpSize &&
- (rballoc_mask[rbStart + rbSize]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols)))
+ while (rbStart + rbSize < bwpSize && (rballoc_mask[rbStart + rbSize] & slbitmap) == slbitmap)
rbSize++;
uint32_t new_tbs;
@@ -933,14 +932,12 @@ void pf_dl(module_id_t module_id,
const uint16_t slbitmap = SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols);
// Freq-demain allocation
- while (rbStart < bwpSize &&
- !(rballoc_mask[rbStart]&slbitmap))
+ while (rbStart < bwpSize && (rballoc_mask[rbStart] & slbitmap) != slbitmap)
rbStart++;
uint16_t max_rbSize = 1;
- while (rbStart + max_rbSize < bwpSize &&
- (rballoc_mask[rbStart + max_rbSize]&slbitmap))
+ while (rbStart + max_rbSize < bwpSize && (rballoc_mask[rbStart + max_rbSize] & slbitmap) == slbitmap)
max_rbSize++;
sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx);
@@ -1483,6 +1480,10 @@ void nr_schedule_ue_spec(module_id_t module_id,
header->L = htons(bufEnd-buf);
dlsch_total_bytes += bufEnd-buf;
+ for (; buf < bufEnd - 3; buf += 4) {
+ uint32_t *buf32 = (uint32_t *)buf;
+ *buf32 = lrand48();
+ }
for (; buf < bufEnd; buf++)
*buf = lrand48() & 0xff;
}
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
index c50a3a581c..6a6571927a 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
@@ -1621,18 +1621,10 @@ int nr_acknack_scheduling(int mod_id,
const NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels[CC_id].ServingCellConfigCommon;
const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL;
- // initializing the values for FDD
- int nr_slots_period = n_slots_frame;
- int first_ul_slot_tdd = slot + minfbtime;
- int first_ul_slot_period = 0;
- if(tdd){
- nr_slots_period /= get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity);
- first_ul_slot_tdd = tdd->nrofDownlinkSlots + nr_slots_period * (slot / nr_slots_period);
- first_ul_slot_period = tdd->nrofDownlinkSlots;
- }
- else
- // if TDD configuration is not present and the band is not FDD, it means it is a dynamic TDD configuration
- AssertFatal(RC.nrmac[mod_id]->common_channels[CC_id].frame_type == FDD,"Dynamic TDD not handled yet\n");
+ AssertFatal(tdd || RC.nrmac[mod_id]->common_channels[CC_id].frame_type == FDD, "Dynamic TDD not handled yet\n");
+ const int nr_slots_period = tdd ? n_slots_frame / get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity) : n_slots_frame;
+ const int next_ul_slot = tdd ? tdd->nrofDownlinkSlots + nr_slots_period * (slot / nr_slots_period) : slot + minfbtime;
+ const int first_ul_slot_period = tdd ? tdd->nrofDownlinkSlots : 0;
/* for the moment, we consider:
@@ -1788,8 +1780,8 @@ int nr_acknack_scheduling(int mod_id,
AssertFatal(pucch->sr_flag + pucch->dai_c == 0,
"expected no SR/AckNack for UE %d in %4d.%2d, but has %d/%d for %4d.%2d\n",
UE_id, frame, slot, pucch->sr_flag, pucch->dai_c, pucch->frame, pucch->ul_slot);
- const int s = first_ul_slot_tdd;
- pucch->frame = (s < n_slots_frame - 1) ? frame : (frame + 1) % 1024;
+ const int s = next_ul_slot;
+ pucch->frame = s < n_slots_frame ? frame : (frame + 1) % 1024;
pucch->ul_slot = s % n_slots_frame;
}
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
index 5a7c83cc68..83bf2a5a65 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
@@ -1004,8 +1004,8 @@ bool allocate_ul_retransmission(module_id_t module_id,
}
/* Check the resource is enough for retransmission */
- while (rbStart < bwpSize &&
- !(rballoc_mask[rbStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols)))
+ const uint16_t slbitmap = SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols);
+ while (rbStart < bwpSize && (rballoc_mask[rbStart] & slbitmap) != slbitmap)
rbStart++;
if (rbStart + retInfo->rbSize > bwpSize) {
LOG_W(NR_MAC, "cannot allocate retransmission of UE %d/RNTI %04x: no resources (rbStart %d, retInfo->rbSize %d, bwpSize %d\n", UE_id, UE_info->rnti[UE_id], rbStart, retInfo->rbSize, bwpSize);
@@ -1025,12 +1025,11 @@ bool allocate_ul_retransmission(module_id_t module_id,
&temp_ps);
/* the retransmission will use a different time domain allocation, check
* that we have enough resources */
- while (rbStart < bwpSize &&
- !(rballoc_mask[rbStart]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols)))
+ const uint16_t slbitmap = SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols);
+ while (rbStart < bwpSize && (rballoc_mask[rbStart] & slbitmap) != slbitmap)
rbStart++;
int rbSize = 0;
- while (rbStart + rbSize < bwpSize &&
- (rballoc_mask[rbStart + rbSize]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols)))
+ while (rbStart + rbSize < bwpSize && (rballoc_mask[rbStart + rbSize] & slbitmap) == slbitmap)
rbSize++;
uint32_t new_tbs;
uint16_t new_rbSize;
@@ -1261,8 +1260,8 @@ void pf_ul(module_id_t module_id,
}
LOG_D(NR_MAC,"Looking for min_rb %d RBs, starting at %d\n", min_rb, rbStart);
- while (rbStart < bwpSize &&
- !(rballoc_mask[rbStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols)))
+ const uint16_t slbitmap = SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols);
+ while (rbStart < bwpSize && (rballoc_mask[rbStart] & slbitmap) != slbitmap)
rbStart++;
if (rbStart + min_rb >= bwpSize) {
LOG_W(NR_MAC, "cannot allocate continuous UL data for UE %d/RNTI %04x: no resources (rbStart %d, min_rb %d, bwpSize %d\n",
@@ -1295,7 +1294,7 @@ void pf_ul(module_id_t module_id,
/* Mark the corresponding RBs as used */
n_rb_sched -= sched_pusch->rbSize;
for (int rb = 0; rb < sched_ctrl->sched_pusch.rbSize; rb++)
- rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] ^= SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols);
+ rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] ^= slbitmap;
continue;
}
@@ -1397,13 +1396,12 @@ void pf_ul(module_id_t module_id,
}
update_ul_ue_R_Qm(sched_pusch, ps);
- while (rbStart < bwpSize &&
- !(rballoc_mask[rbStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols)))
+ const uint16_t slbitmap = SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols);
+ while (rbStart < bwpSize && (rballoc_mask[rbStart] & slbitmap) != slbitmap)
rbStart++;
sched_pusch->rbStart = rbStart;
uint16_t max_rbSize = 1;
- while (rbStart + max_rbSize < bwpSize &&
- (rballoc_mask[rbStart + max_rbSize]&&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols)))
+ while (rbStart + max_rbSize < bwpSize && (rballoc_mask[rbStart + max_rbSize] & slbitmap) == slbitmap)
max_rbSize++;
if (rbStart + min_rb >= bwpSize) {
@@ -1445,7 +1443,7 @@ void pf_ul(module_id_t module_id,
n_rb_sched -= sched_pusch->rbSize;
for (int rb = 0; rb < sched_ctrl->sched_pusch.rbSize; rb++)
- rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] ^= SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols);
+ rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] ^= slbitmap;
}
}
@@ -1479,7 +1477,7 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t
if (tda < 0)
return false;
int K2 = get_K2(scc, scc_sib1, sched_ctrl->active_ubwp, tda, mu);
- const int sched_frame = (frame + (slot + K2 >= nr_slots_per_frame[mu]))&1023;
+ const int sched_frame = (frame + (slot + K2 >= nr_slots_per_frame[mu])) % 1024;
const int sched_slot = (slot + K2) % nr_slots_per_frame[mu];
if (!is_xlsch_in_slot(nr_mac->ulsch_slot_bitmap[sched_slot / 64], sched_slot))
diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c
index fb8de46953..00e11278a2 100644
--- a/openair2/RRC/NR/rrc_gNB_nsa.c
+++ b/openair2/RRC/NR/rrc_gNB_nsa.c
@@ -338,8 +338,6 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
sizeof(X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).rrc_buffer));
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).rrc_buffer_size = (enc_rval.encoded+7)>>3;
itti_send_msg_to_task(TASK_X2AP, ENB_MODULE_ID_TO_INSTANCE(0), msg); //Check right id instead of hardcoding
- } else if (get_softmodem_params()->do_ra || get_softmodem_params()->sa) {
- PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, rrc->module_id, GNB_FLAG_YES, ue_context_p->ue_id_rnti, 0, 0,rrc->module_id);
}
rrc->Nb_ue++;
@@ -373,36 +371,37 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
}
if(m == NULL){
+ PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, rrc->module_id, GNB_FLAG_YES, ue_context_p->ue_id_rnti, 0, 0, rrc->module_id);
LOG_W(RRC, "Calling RRC PDCP/RLC ASN1 request functions for protocol context %p with module_id %d, rnti %x, frame %d, subframe %d eNB_index %d \n", &ctxt,
ctxt.module_id,
ctxt.rnti,
ctxt.frame,
ctxt.subframe,
ctxt.eNB_index);
+
+ nr_rrc_pdcp_config_asn1_req(&ctxt,
+ get_softmodem_params()->sa ? ue_context_p->ue_context.rb_config->srb_ToAddModList : (NR_SRB_ToAddModList_t *) NULL,
+ ue_context_p->ue_context.rb_config->drb_ToAddModList ,
+ ue_context_p->ue_context.rb_config->drb_ToReleaseList,
+ (ue_context_p->ue_context.integrity_algorithm << 4) | ue_context_p->ue_context.ciphering_algorithm,
+ NULL, /* kRRCenc - unused */
+ NULL, /* kRRCint - unused */
+ kUPenc, /* kUPenc */
+ kUPint, /* kUPint */
+ NULL,
+ NULL,
+ ue_context_p->ue_context.secondaryCellGroup->rlc_BearerToAddModList);
+
+ nr_rrc_rlc_config_asn1_req (&ctxt,
+ get_softmodem_params()->sa ? ue_context_p->ue_context.rb_config->srb_ToAddModList : (NR_SRB_ToAddModList_t *) NULL,
+ ue_context_p->ue_context.rb_config->drb_ToAddModList,
+ ue_context_p->ue_context.rb_config->drb_ToReleaseList,
+ (LTE_PMCH_InfoList_r9_t *) NULL,
+ ue_context_p->ue_context.secondaryCellGroup->rlc_BearerToAddModList);
+
+ LOG_D(RRC, "%s:%d: done RRC PDCP/RLC ASN1 request for UE rnti %x\n", __FUNCTION__, __LINE__, ctxt.rnti);
}
- nr_rrc_pdcp_config_asn1_req(&ctxt,
- get_softmodem_params()->sa ? ue_context_p->ue_context.rb_config->srb_ToAddModList : (NR_SRB_ToAddModList_t *) NULL,
- ue_context_p->ue_context.rb_config->drb_ToAddModList ,
- ue_context_p->ue_context.rb_config->drb_ToReleaseList,
- (ue_context_p->ue_context.integrity_algorithm << 4) | ue_context_p->ue_context.ciphering_algorithm,
- NULL, /* kRRCenc - unused */
- NULL, /* kRRCint - unused */
- kUPenc, /* kUPenc */
- kUPint, /* kUPint */
- NULL,
- NULL,
- ue_context_p->ue_context.secondaryCellGroup->rlc_BearerToAddModList);
-
- nr_rrc_rlc_config_asn1_req (&ctxt,
- get_softmodem_params()->sa ? ue_context_p->ue_context.rb_config->srb_ToAddModList : (NR_SRB_ToAddModList_t *) NULL,
- ue_context_p->ue_context.rb_config->drb_ToAddModList,
- ue_context_p->ue_context.rb_config->drb_ToReleaseList,
- (LTE_PMCH_InfoList_r9_t *) NULL,
- ue_context_p->ue_context.secondaryCellGroup->rlc_BearerToAddModList);
-
- LOG_D(RRC, "%s:%d: done RRC PDCP/RLC ASN1 request for UE rnti %x\n", __FUNCTION__, __LINE__, ctxt.rnti);
-
}
void rrc_remove_nsa_user(gNB_RRC_INST *rrc, int rnti) {
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf
index 92d1ce432c..6aacd98c7f 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf
@@ -45,8 +45,6 @@ gNBs =
remote_s_portc = 500;
remote_s_portd = 2152;
ssb_SubcarrierOffset = 0;
- pdsch_AntennaPorts = 1;
- pusch_AntennaPorts = 1;
min_rxtxtime = 6;
pdcch_ConfigSIB1 = (
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf
index 74f6c34f57..f91683897f 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf
@@ -37,6 +37,7 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
+
servingCellConfigCommon = (
{
#spCellConfigCommon