|
|
|
@@ -266,9 +266,10 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP
|
|
|
|
|
|
|
|
|
|
NR_COMMON_channels_t *cc = gNB->common_channels;
|
|
|
|
|
NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
|
|
|
|
|
NR_RACH_ConfigCommon_t *rach_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup;
|
|
|
|
|
int mu;
|
|
|
|
|
if (scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing)
|
|
|
|
|
mu = *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing;
|
|
|
|
|
if (rach_ConfigCommon->msg1_SubcarrierSpacing)
|
|
|
|
|
mu = *rach_ConfigCommon->msg1_SubcarrierSpacing;
|
|
|
|
|
else
|
|
|
|
|
mu = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
|
|
|
|
|
int index = ul_buffer_index(frameP, slotP, mu, gNB->UL_tti_req_ahead_size);
|
|
|
|
@@ -276,8 +277,8 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP
|
|
|
|
|
nfapi_nr_config_request_scf_t *cfg = &RC.nrmac[module_idP]->config[0];
|
|
|
|
|
|
|
|
|
|
if (is_nr_UL_slot(scc->tdd_UL_DL_ConfigurationCommon, slotP, cc->frame_type)) {
|
|
|
|
|
|
|
|
|
|
uint8_t config_index = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.prach_ConfigurationIndex;
|
|
|
|
|
const NR_RACH_ConfigGeneric_t *rach_ConfigGeneric = &rach_ConfigCommon->rach_ConfigGeneric;
|
|
|
|
|
uint8_t config_index = rach_ConfigGeneric->prach_ConfigurationIndex;
|
|
|
|
|
uint8_t N_dur, N_t_slot, start_symbol = 0, N_RA_slot;
|
|
|
|
|
uint16_t RA_sfn_index = -1;
|
|
|
|
|
uint8_t config_period = 1;
|
|
|
|
@@ -289,22 +290,22 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP
|
|
|
|
|
|
|
|
|
|
uint8_t fdm = cfg->prach_config.num_prach_fd_occasions.value;
|
|
|
|
|
// prach is scheduled according to configuration index and tables 6.3.3.2.2 to 6.3.3.2.4
|
|
|
|
|
if ( get_nr_prach_info_from_index(config_index,
|
|
|
|
|
(int)frameP,
|
|
|
|
|
(int)slotP,
|
|
|
|
|
scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA,
|
|
|
|
|
mu,
|
|
|
|
|
cc->frame_type,
|
|
|
|
|
&format,
|
|
|
|
|
&start_symbol,
|
|
|
|
|
&N_t_slot,
|
|
|
|
|
&N_dur,
|
|
|
|
|
&RA_sfn_index,
|
|
|
|
|
&N_RA_slot,
|
|
|
|
|
&config_period) ) {
|
|
|
|
|
if (get_nr_prach_info_from_index(config_index,
|
|
|
|
|
(int)frameP,
|
|
|
|
|
(int)slotP,
|
|
|
|
|
scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA,
|
|
|
|
|
mu,
|
|
|
|
|
cc->frame_type,
|
|
|
|
|
&format,
|
|
|
|
|
&start_symbol,
|
|
|
|
|
&N_t_slot,
|
|
|
|
|
&N_dur,
|
|
|
|
|
&RA_sfn_index,
|
|
|
|
|
&N_RA_slot,
|
|
|
|
|
&config_period)) {
|
|
|
|
|
|
|
|
|
|
uint16_t format0 = format&0xff; // first column of format from table
|
|
|
|
|
uint16_t format1 = (format>>8)&0xff; // second column of format from table
|
|
|
|
|
uint16_t format0 = format & 0xff; // first column of format from table
|
|
|
|
|
uint16_t format1 = (format >> 8) & 0xff; // second column of format from table
|
|
|
|
|
|
|
|
|
|
if (N_RA_slot > 1) { //more than 1 PRACH slot in a subframe
|
|
|
|
|
if (slotP%2 == 1)
|
|
|
|
@@ -339,15 +340,19 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP
|
|
|
|
|
prach_pdu->num_prach_ocas = N_t_slot;
|
|
|
|
|
prach_pdu->prach_start_symbol = start_symbol;
|
|
|
|
|
prach_pdu->num_ra = fdm_index;
|
|
|
|
|
prach_pdu->num_cs = get_NCS(scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.zeroCorrelationZoneConfig,
|
|
|
|
|
prach_pdu->num_cs = get_NCS(rach_ConfigGeneric->zeroCorrelationZoneConfig,
|
|
|
|
|
format0,
|
|
|
|
|
scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->restrictedSetConfig);
|
|
|
|
|
rach_ConfigCommon->restrictedSetConfig);
|
|
|
|
|
|
|
|
|
|
LOG_D(NR_MAC, "Frame %d, Slot %d: Prach Occasion id = %u fdm index = %u start symbol = %u slot index = %u subframe index = %u \n",
|
|
|
|
|
frameP, slotP,
|
|
|
|
|
prach_occasion_id, prach_pdu->num_ra,
|
|
|
|
|
LOG_D(NR_MAC,
|
|
|
|
|
"Frame %d, Slot %d: Prach Occasion id = %u fdm index = %u start symbol = %u slot index = %u subframe index = %u \n",
|
|
|
|
|
frameP,
|
|
|
|
|
slotP,
|
|
|
|
|
prach_occasion_id,
|
|
|
|
|
prach_pdu->num_ra,
|
|
|
|
|
prach_pdu->prach_start_symbol,
|
|
|
|
|
slot_index, RA_sfn_index);
|
|
|
|
|
slot_index,
|
|
|
|
|
RA_sfn_index);
|
|
|
|
|
// SCF PRACH PDU format field does not consider A1/B1 etc. possibilities
|
|
|
|
|
// We added 9 = A1/B1 10 = A2/B2 11 A3/B3
|
|
|
|
|
if (format1!=0xff) {
|
|
|
|
@@ -409,15 +414,13 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// block resources in vrb_map_UL
|
|
|
|
|
const NR_RACH_ConfigGeneric_t *rach_ConfigGeneric =
|
|
|
|
|
&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric;
|
|
|
|
|
const uint8_t mu_pusch =
|
|
|
|
|
scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
|
|
|
|
|
const int16_t N_RA_RB = get_N_RA_RB(cfg->prach_config.prach_sub_c_spacing.value, mu_pusch);
|
|
|
|
|
const int16_t n_ra_rb = get_N_RA_RB(cfg->prach_config.prach_sub_c_spacing.value, mu_pusch);
|
|
|
|
|
index = ul_buffer_index(frameP, slotP, mu, gNB->vrb_map_UL_size);
|
|
|
|
|
uint16_t *vrb_map_UL = &cc->vrb_map_UL[index * 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);
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|