LOG_D(NR_MAC,"In %s: Set config request for UL transmission in [%d.%d], number of UL PDUs: %d\n",__FUNCTION__,ul_config->sfn,ul_config->slot,ul_config->number_pdus);
LOG_D(NR_MAC,"In %s: Set config request for UL transmission in [%d.%d], number of UL PDUs: %d\n",__FUNCTION__,ul_config->sfn,ul_config->slot,ul_config->number_pdus);
LOG_D(NR_MAC,"In %s:[%d.%d]: number of UL PDUs: %d with UL transmission in [%d.%d]\n",__FUNCTION__,frame_tx,slot_tx,ul_config->number_pdus,ul_config->sfn,ul_config->slot);
LOG_D(NR_MAC,"In %s:[%d.%d]: number of UL PDUs: %d with UL transmission in [%d.%d]\n",__FUNCTION__,frame_tx,slot_tx,ul_config->number_pdus,ul_config->sfn,ul_config->slot);
LOG_D(NR_MAC,"In %s: currently at [%d.%d] UL transmission in [%d.%d] (k2 %d delta %d)\n",__FUNCTION__,current_frame,current_slot,*frame_tx,*slot_tx,k2,delta);
LOG_D(NR_MAC,"In %s: currently at [%d.%d] UL transmission in [%d.%d] (k2 %d delta %d)\n",__FUNCTION__,current_frame,current_slot,*frame_tx,*slot_tx,k2,delta);
return0;
return0;
}
}
// Build the list of all the valid RACH occasions in the maximum association pattern period according to the PRACH config
// Build the list of all the valid RACH occasions in the maximum association pattern period according to the PRACH config
staticvoidbuild_ro_list(NR_UE_MAC_INST_t*mac){
staticvoidbuild_ro_list(NR_UE_MAC_INST_t*mac){
intx,y;// PRACH Configuration Index table variables used to compute the valid frame numbers
intx,y;// PRACH Configuration Index table variables used to compute the valid frame numbers
inty2;// PRACH Configuration Index table additional variable used to compute the valid frame numbers
inty2;// PRACH Configuration Index table additional variable used to compute the valid frame numbers
LOG_D(NR_MAC,"Adding a PRACH occasion: frame %u, slot-symbol %d-%d, occ_in_time-occ_in-freq %d-%d, nb ROs in conf period %d, for this slot: RO# in time %d, RO# in freq %d\n",
LOG_D(NR_MAC,"Adding a PRACH occasion: frame %u, slot-symbol %d-%d, occ_in_time-occ_in-freq %d-%d, nb ROs in conf period %d, for this slot: RO# in time %d, RO# in freq %d\n",
// WIP: Assumption for now is that all the PRACH configuration periods within a maximum association pattern period have the same number of PRACH occasions
// WIP: Assumption for now is that all the PRACH configuration periods within a maximum association pattern period have the same number of PRACH occasions
// (No PRACH occasions are conflicting with SSBs nor TDD_UL_DL_ConfigurationCommon schedule)
// (No PRACH occasions are conflicting with SSBs nor TDD_UL_DL_ConfigurationCommon schedule)
// There is only one possible association period which can contain up to 16 PRACH configuration periods
// There is only one possible association period which can contain up to 16 PRACH configuration periods
LOG_D(NR_MAC,"Evaluate the number of PRACH configuration periods required to map all the SSBs and set the association period\n");
LOG_D(NR_MAC,"Evaluate the number of PRACH configuration periods required to map all the SSBs and set the association period\n");
AssertFatal(MAX_NB_RO_PER_SSB_IN_ASSOCIATION_PATTERN>ssb_list.tx_ssb[ssb_idx].nb_mapped_ro,"Too many mapped ROs (%d) to a single SSB\n",ssb_list.tx_ssb[ssb_idx].nb_mapped_ro);
AssertFatal(MAX_NB_RO_PER_SSB_IN_ASSOCIATION_PATTERN>ssb_list.tx_ssb[ssb_idx].nb_mapped_ro,"Too many mapped ROs (%d) to a single SSB\n",ssb_list.tx_ssb[ssb_idx].nb_mapped_ro);
LOG_D(NR_MAC,"Mapped ssb_idx %u to RO slot-symbol %u-%u, %u-%u-%u/%u\n",
LOG_D(NR_MAC,"Mapped ssb_idx %u to RO slot-symbol %u-%u, %u-%u-%u/%u\n",
// WIP: note that there is no re-mapping of the SSBs within the association period since there is no invalid ROs in the PRACH config periods that would create this situation
// WIP: note that there is no re-mapping of the SSBs within the association period since there is no invalid ROs in the PRACH config periods that would create this situation
}// if multiple_ssbs_per_ro
}// if multiple_ssbs_per_ro
else{
else{
// --------------------
// --------------------
// --------------------
// --------------------
// Multiple ROs per SSB
// Multiple ROs per SSB
// --------------------
// --------------------
// --------------------
// --------------------
n_prach_conf=0;
n_prach_conf=0;
// Go through the list of transmitted SSBs
// Go through the list of transmitted SSBs
for(ssb_idx=0;ssb_idx<MAX_NB_SSB;ssb_idx++){
for(ssb_idx=0;ssb_idx<MAX_NB_SSB;ssb_idx++){
uint8_tnb_mapped_ro_in_association_period=0;// Reset the nb of mapped ROs for the new SSB index
uint8_tnb_mapped_ro_in_association_period=0;// Reset the nb of mapped ROs for the new SSB index
LOG_D(NR_MAC,"Checking ssb_idx %d => %d\n",
LOG_D(NR_MAC,"Checking ssb_idx %d => %d\n",
ssb_idx,ssb_list.tx_ssb[ssb_idx].transmitted);
ssb_idx,ssb_list.tx_ssb[ssb_idx].transmitted);
// Map only the transmitted ssb_idx
// Map only the transmitted ssb_idx
if(true==ssb_list.tx_ssb[ssb_idx].transmitted){
if(true==ssb_list.tx_ssb[ssb_idx].transmitted){
// Map all the required ROs to this SSB
// Map all the required ROs to this SSB
// Go through the list of PRACH config periods within this association period
// Go through the list of PRACH config periods within this association period
AssertFatal(prach_config_pdu->ssb_nb_in_ro<prach_occasion_info_p->nb_mapped_ssb,"%u not found in the mapped SSBs to the PRACH occasion",selected_gnb_ssb_idx);
AssertFatal(prach_config_pdu->ssb_nb_in_ro<prach_occasion_info_p->nb_mapped_ssb,"%u not found in the mapped SSBs to the PRACH occasion",selected_gnb_ssb_idx);