Commit 40175d24 authored by Robert Schmidt's avatar Robert Schmidt

Format schedule_nr_mib()

parent 2bdcbe6c
...@@ -75,29 +75,38 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP, ...@@ -75,29 +75,38 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP,
int ratio; int ratio;
switch (*cc->ServingCellConfigCommon->ssbSubcarrierSpacing) { switch (*cc->ServingCellConfigCommon->ssbSubcarrierSpacing) {
case NR_SubcarrierSpacing_kHz15: case NR_SubcarrierSpacing_kHz15:
AssertFatal(band <= 79, "Band %ld is not possible for SSB with 15 kHz SCS\n",band); AssertFatal(band <= 79,
if (band<77) // below 3GHz "Band %ld is not possible for SSB with 15 kHz SCS\n",
ratio=3; // NRARFCN step is 5 kHz band);
if (band < 77) // below 3GHz
ratio = 3; // NRARFCN step is 5 kHz
else else
ratio=1; // NRARFCN step is 15 kHz ratio = 1; // NRARFCN step is 15 kHz
break; break;
case NR_SubcarrierSpacing_kHz30: case NR_SubcarrierSpacing_kHz30:
AssertFatal(band <= 79, "Band %ld is not possible for SSB with 15 kHz SCS\n",band); AssertFatal(band <= 79,
if (band<77) // below 3GHz "Band %ld is not possible for SSB with 15 kHz SCS\n",
ratio=6; // NRARFCN step is 5 kHz band);
if (band < 77) // below 3GHz
ratio = 6; // NRARFCN step is 5 kHz
else else
ratio=2; // NRARFCN step is 15 kHz ratio = 2; // NRARFCN step is 15 kHz
break; break;
case NR_SubcarrierSpacing_kHz120: case NR_SubcarrierSpacing_kHz120:
AssertFatal(band >= 257, "Band %ld is not possible for SSB with 120 kHz SCS\n",band); AssertFatal(band >= 257,
ratio=2; // NRARFCN step is 15 kHz "Band %ld is not possible for SSB with 120 kHz SCS\n",
band);
ratio = 2; // NRARFCN step is 15 kHz
break; break;
case NR_SubcarrierSpacing_kHz240: case NR_SubcarrierSpacing_kHz240:
AssertFatal(band >= 257, "Band %ld is not possible for SSB with 240 kHz SCS\n",band); AssertFatal(band >= 257,
ratio=4; // NRARFCN step is 15 kHz "Band %ld is not possible for SSB with 240 kHz SCS\n",
band);
ratio = 4; // NRARFCN step is 15 kHz
break; break;
default: default:
AssertFatal(1==0,"SCS %ld not allowed for SSB \n", *cc->ServingCellConfigCommon->ssbSubcarrierSpacing); AssertFatal(1 == 0, "SCS %ld not allowed for SSB \n",
*cc->ServingCellConfigCommon->ssbSubcarrierSpacing);
} }
// scheduling MIB every 8 frames, PHY repeats it in between // scheduling MIB every 8 frames, PHY repeats it in between
...@@ -105,13 +114,17 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP, ...@@ -105,13 +114,17 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP,
dl_tti_request = &gNB->DL_req[CC_id]; dl_tti_request = &gNB->DL_req[CC_id];
dl_req = &dl_tti_request->dl_tti_request_body; dl_req = &dl_tti_request->dl_tti_request_body;
mib_sdu_length = mac_rrc_nr_data_req(module_idP, CC_id, frameP, MIBCH, 1, &cc->MIB_pdu.payload[0]); // not used in this case mib_sdu_length = mac_rrc_nr_data_req(module_idP, CC_id, frameP, MIBCH, 1, &cc->MIB_pdu.payload[0]);
LOG_D(MAC, "Frame %d, slot %d: BCH PDU length %d\n", frameP, slotP, mib_sdu_length); LOG_D(MAC, "Frame %d, slot %d: BCH PDU length %d\n", frameP, slotP, mib_sdu_length);
if (mib_sdu_length > 0) { if (mib_sdu_length > 0) {
LOG_D(MAC,
LOG_D(MAC, "Frame %d, slot %d: Adding BCH PDU in position %d (length %d)\n", frameP, slotP, dl_req->nPDUs, mib_sdu_length); "Frame %d, slot %d: Adding BCH PDU in position %d (length %d)\n",
frameP,
slotP,
dl_req->nPDUs,
mib_sdu_length);
if ((frameP & 1023) < 80){ if ((frameP & 1023) < 80){
LOG_I(MAC,"[gNB %d] Frame %d : MIB->BCH CC_id %d, Received %d bytes\n",module_idP, frameP, CC_id, mib_sdu_length); LOG_I(MAC,"[gNB %d] Frame %d : MIB->BCH CC_id %d, Received %d bytes\n",module_idP, frameP, CC_id, mib_sdu_length);
...@@ -146,49 +159,45 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP, ...@@ -146,49 +159,45 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP,
const int abs_slot = (slots_per_frame * frameP) + slotP; const int abs_slot = (slots_per_frame * frameP) + slotP;
const int slot_per_period = (slots_per_frame>>1)<<(*cc->ServingCellConfigCommon->ssb_periodicityServingCell); const int slot_per_period = (slots_per_frame>>1)<<(*cc->ServingCellConfigCommon->ssb_periodicityServingCell);
int eff_120_slot; int eff_120_slot;
const BIT_STRING_t *mediumBitmap = &cc->ServingCellConfigCommon->ssb_PositionsInBurst->choice.mediumBitmap;
uint8_t buf = 0;
switch (cc->ServingCellConfigCommon->ssb_PositionsInBurst->present) { switch (cc->ServingCellConfigCommon->ssb_PositionsInBurst->present) {
case 1 : case 1:
// presence of ssbs possible in the first 2 slots of ssb period // presence of ssbs possible in the first 2 slots of ssb period
if ((abs_slot%slot_per_period)<2){ if ((abs_slot % slot_per_period) < 2 &&
if((((cc->ServingCellConfigCommon->ssb_PositionsInBurst->choice.mediumBitmap.buf[0])>>(6-(slotP<<1)))&3)!=0) (((mediumBitmap->buf[0]) >> (6 - (slotP << 1))) & 3) != 0)
fill_ssb_vrb_map(cc, (ssb_offset0/(ratio*12) - 10), CC_id); fill_ssb_vrb_map(cc, (ssb_offset0 / (ratio * 12) - 10), CC_id);
}
break; break;
case 2 : case 2:
// presence of ssbs possible in the first 4 slots of ssb period // presence of ssbs possible in the first 4 slots of ssb period
if ((abs_slot%slot_per_period)<4){ if ((abs_slot % slot_per_period) < 4 &&
if((((cc->ServingCellConfigCommon->ssb_PositionsInBurst->choice.mediumBitmap.buf[0])>>(6-(slotP<<1)))&3)!=0) (((mediumBitmap->buf[0]) >> (6 - (slotP << 1))) & 3) != 0)
fill_ssb_vrb_map(cc, (ssb_offset0/(ratio*12) - 10), CC_id); fill_ssb_vrb_map(cc, (ssb_offset0 / (ratio * 12) - 10), CC_id);
}
break; break;
case 3 : case 3:
if(*cc->ServingCellConfigCommon->ssbSubcarrierSpacing == NR_SubcarrierSpacing_kHz120){ AssertFatal(*cc->ServingCellConfigCommon->ssbSubcarrierSpacing ==
if ((abs_slot%slot_per_period)<8){ NR_SubcarrierSpacing_kHz120,
eff_120_slot = slotP; "240kHZ subcarrier spacing currently not supported for SSBs\n");
if((((cc->ServingCellConfigCommon->ssb_PositionsInBurst->choice.mediumBitmap.buf[0])>>(6-(eff_120_slot<<1)))&3)!=0) if ((abs_slot % slot_per_period) < 8) {
fill_ssb_vrb_map(cc, (ssb_offset0/(ratio*12) - 10), CC_id); eff_120_slot = slotP;
} buf = mediumBitmap->buf[0];
else if ((abs_slot%slot_per_period)<17){ } else if ((abs_slot % slot_per_period) < 17) {
eff_120_slot = slotP-9; eff_120_slot = slotP - 9;
if((((cc->ServingCellConfigCommon->ssb_PositionsInBurst->choice.mediumBitmap.buf[1])>>(6-(eff_120_slot<<1)))&3)!=0) buf = mediumBitmap->buf[1];
fill_ssb_vrb_map(cc, (ssb_offset0/(ratio*12) - 10), CC_id); } else if ((abs_slot % slot_per_period) < 26) {
} eff_120_slot = slotP - 18;
else if ((abs_slot%slot_per_period)<26){ buf = mediumBitmap->buf[2];
eff_120_slot = slotP-18; } else if ((abs_slot % slot_per_period) < 35) {
if((((cc->ServingCellConfigCommon->ssb_PositionsInBurst->choice.mediumBitmap.buf[2])>>(6-(eff_120_slot<<1)))&3)!=0) eff_120_slot = slotP - 27;
fill_ssb_vrb_map(cc, (ssb_offset0/(ratio*12) - 10), CC_id); buf = mediumBitmap->buf[3];
}
else if ((abs_slot%slot_per_period)<35){
eff_120_slot = slotP-27;
if((((cc->ServingCellConfigCommon->ssb_PositionsInBurst->choice.mediumBitmap.buf[3])>>(6-(eff_120_slot<<1)))&3)!=0)
fill_ssb_vrb_map(cc, (ssb_offset0/(ratio*12) - 10), CC_id);
}
} }
else if (((buf >> (6 - (eff_120_slot << 1))) & 3) != 0)
AssertFatal(1==0,"240kHZ subcarrier spacing currently not supported for SSBs\n"); fill_ssb_vrb_map(cc, ssb_offset0 / (ratio * 12) - 10, CC_id);
break; break;
default: default:
AssertFatal(1==0,"SSB bitmap size value %d undefined (allowed values 1,2,3) \n", cc->ServingCellConfigCommon->ssb_PositionsInBurst->present); AssertFatal(0,
"SSB bitmap size value %d undefined (allowed values 1,2,3)\n",
cc->ServingCellConfigCommon->ssb_PositionsInBurst->present);
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment