#define MAX_NB_PRACH_CONF_PERIOD_IN_ASSOCIATION_PERIOD (16) // Maximum association period is 16
#define MAX_NB_PRACH_CONF_PERIOD_IN_ASSOCIATION_PERIOD (16) // Maximum association period is 16
#define MAX_NB_PRACH_CONF_PERIOD_IN_ASSOCIATION_PATTERN_PERIOD (16) // Max association pattern period is 160ms and minimum PRACH configuration period is 10ms
#define MAX_NB_PRACH_CONF_PERIOD_IN_ASSOCIATION_PATTERN_PERIOD (16) // Max association pattern period is 160ms and minimum PRACH configuration period is 10ms
#define MAX_NB_ASSOCIATION_PERIOD_IN_ASSOCIATION_PATTERN_PERIOD (16) // Max nb of association periods in an association pattern period of 160ms
#define MAX_NB_ASSOCIATION_PERIOD_IN_ASSOCIATION_PATTERN_PERIOD (16) // Max nb of association periods in an association pattern period of 160ms
#define MAX_NB_FRAMES_IN_PRACH_CONF_PERIOD (16) // Max PRACH configuration period is 160ms and frame is 10ms
#define MAX_NB_FRAME_IN_PRACH_CONF_PERIOD (16) // Max PRACH configuration period is 160ms and frame is 10ms
#define MAX_NB_SLOTS_IN_FRAME (160) // Max number of slots in a frame (@ SCS 240kHz = 160)
#define MAX_NB_SLOT_IN_FRAME (160) // Max number of slots in a frame (@ SCS 240kHz = 160)
#define MAX_NB_FRAMES_IN_ASSOCIATION_PATTERN_PERIOD (16) // Maximum number of frames in the maximum association pattern period
#define MAX_NB_FRAME_IN_ASSOCIATION_PATTERN_PERIOD (16) // Maximum number of frames in the maximum association pattern period
#define MAX_NB_SSBS (64) // Maximum number of possible SSB indexes
#define MAX_NB_SSB (64) // Maximum number of possible SSB indexes
#define MAX_RO_PER_SSB (8) // Maximum number of consecutive ROs that can be mapped to an SSB according to the ssb_per_RACH config
#define MAX_RO_PER_SSB (8) // Maximum number of consecutive ROs that can be mapped to an SSB according to the ssb_per_RACH config
// Maximum number of ROs that can be mapped to an SSB in an association pattern
// Maximum number of ROs that can be mapped to an SSB in an association pattern
// This is to reserve enough elements in the SSBs list for each mapped ROs for a single SSB
// This is to reserve enough elements in the SSBs list for each mapped ROs for a single SSB
// An arbitrary maximum number is chosen to be safe: maximum number of slots in an association pattern * maximum number of ROs in a slot
// An arbitrary maximum number is chosen to be safe: maximum number of slots in an association pattern * maximum number of ROs in a slot
uint8_tnb_of_assoc_periods;// Nb of association periods within the association pattern
uint8_tnb_of_assoc_period;// Nb of association periods within the association pattern
uint8_tnb_of_prach_conf_periods_in_max_period;// Nb of PRACH configuration periods within the maximum association pattern period (according to the size of the configured PRACH
uint8_tnb_of_prach_conf_period_in_max_period;// Nb of PRACH configuration periods within the maximum association pattern period (according to the size of the configured PRACH
uint8_tnb_of_frames;// Total number of frames included in the association pattern period (after mapping the SSBs and determining the real association pattern length)
uint8_tnb_of_frame;// Total number of frames included in the association pattern period (after mapping the SSBs and determining the real association pattern length)
}prach_association_pattern_t;
}prach_association_pattern_t;
// SSB details
// SSB details
typedefstructssb_info{
typedefstructssb_info{
boolean_ttransmitted;// True if the SSB index is transmitted according to the SSB positions map configuration
boolean_ttransmitted;// True if the SSB index is transmitted according to the SSB positions map configuration
prach_occasion_info_t*mapped_ros[MAX_NB_ROS_PER_SSB_IN_ASSOCIATION_PATTERN];// List of mapped RACH Occasions to this SSB index
prach_occasion_info_t*mapped_ro[MAX_NB_RO_PER_SSB_IN_ASSOCIATION_PATTERN];// List of mapped RACH Occasions to this SSB index
uint16_tnb_mapped_ros;// Total number of mapped ROs to this SSB index
uint16_tnb_mapped_ro;// Total number of mapped ROs to this SSB index
}ssb_info_t;
}ssb_info_t;
// List of all the possible SSBs and their details
// List of all the possible SSBs and their details
// WIP-IDCC: Assumption for now is that all the PRACH configuration periods within a maximum association pattern period have the same number of PRACH occasions
// WIP-IDCC: 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)
AssertFatal(16>=required_nb_of_prach_conf_periods,"Invalid number of PRACH config periods within an association period %d\n",required_nb_of_prach_conf_periods);
AssertFatal(1==0,"Invalid number of PRACH config periods within an association period %d\n",required_nb_of_prach_conf_period);
AssertFatal(MAX_NB_ROS_PER_SSB_IN_ASSOCIATION_PATTERN>ssb_list.tx_ssb[ssb_idx].nb_mapped_ros,"Too many mapped ROs (%d) to a single SSB\n",ssb_list.tx_ssb[ssb_idx].nb_mapped_ros);
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);
// If all the required SSBs are mapped to this RO, exit the loop of SSBs
// If all the required SSBs are mapped to this RO, exit the loop of SSBs
// Exit the loop of ROs if there is no more SSB to map
// Exit the loop of ROs if there is no more SSB to map
if(MAX_NB_SSBS==ssb_idx)break;
if(MAX_NB_SSB==ssb_idx)break;
}// for ro_in_freq
}// for ro_in_freq
// Exit the loop of ROs if there is no more SSB to map
// Exit the loop of ROs if there is no more SSB to map
if(MAX_NB_SSBS==ssb_idx)break;
if(MAX_NB_SSB==ssb_idx)break;
}// for ro_in_time
}// for ro_in_time
// Exit the loop of slots if there is no more SSB to map
// Exit the loop of slots if there is no more SSB to map
if(MAX_NB_SSBS==ssb_idx)break;
if(MAX_NB_SSB==ssb_idx)break;
}// for slot
}// for slot
// Exit the loop frames if there is no more SSB to map
// Exit the loop frames if there is no more SSB to map
if(MAX_NB_SSBS==ssb_idx)break;
if(MAX_NB_SSB==ssb_idx)break;
}// for frame
}// for frame
// Exit the loop of PRACH configurations if there is no more SSB to map
// Exit the loop of PRACH configurations if there is no more SSB to map
if(MAX_NB_SSBS==ssb_idx)break;
if(MAX_NB_SSB==ssb_idx)break;
}// for n_prach_conf
}// for n_prach_conf
// WIP-IDCC: 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-IDCC: 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
AssertFatal(MAX_NB_ROS_PER_SSB_IN_ASSOCIATION_PATTERN>ssb_list.tx_ssb[ssb_idx].nb_mapped_ros,"Too many mapped ROs (%d) to a single SSB\n",ssb_list.tx_ssb[ssb_idx].nb_mapped_ros);
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);
nb_mapped_ros_in_association_period++;
nb_mapped_ro_in_association_period++;
// Exit the loop if this SSB has been mapped to all the required ROs
// Exit the loop if this SSB has been mapped to all the required ROs