function to schedule reception of sib1
This commit is contained in:
@@ -353,6 +353,9 @@ typedef struct {
|
|||||||
/// SSB index from MIB decoding
|
/// SSB index from MIB decoding
|
||||||
uint8_t mib_ssb;
|
uint8_t mib_ssb;
|
||||||
|
|
||||||
|
/// Flag for SIB1
|
||||||
|
uint8_t sib1_received;
|
||||||
|
|
||||||
/// Last NDI of UL HARQ processes
|
/// Last NDI of UL HARQ processes
|
||||||
uint8_t UL_ndi[NR_MAX_HARQ_PROCESSES];
|
uint8_t UL_ndi[NR_MAX_HARQ_PROCESSES];
|
||||||
|
|
||||||
|
|||||||
@@ -231,6 +231,14 @@ void nr_ue_msg3_scheduler(NR_UE_MAC_INST_t *mac,
|
|||||||
sub_frame_t current_slot,
|
sub_frame_t current_slot,
|
||||||
uint8_t Msg3_tda_id);
|
uint8_t Msg3_tda_id);
|
||||||
|
|
||||||
|
void nr_ue_sib1_scheduler(module_id_t module_idP,
|
||||||
|
uint16_t ssb_start_symbol,
|
||||||
|
uint16_t frame,
|
||||||
|
uint8_t ssb_subcarrier_offset,
|
||||||
|
uint32_t ssb_index,
|
||||||
|
uint16_t ssb_start_subcarrier,
|
||||||
|
frequency_range_t frequency_range);
|
||||||
|
|
||||||
/* \brief Function called by PHY to process the received RAR and check that the preamble matches what was sent by the gNB. It provides the timing advance and t-CRNTI.
|
/* \brief Function called by PHY to process the received RAR and check that the preamble matches what was sent by the gNB. It provides the timing advance and t-CRNTI.
|
||||||
@param Mod_id Index of UE instance
|
@param Mod_id Index of UE instance
|
||||||
@param CC_id Index to a component carrier
|
@param CC_id Index to a component carrier
|
||||||
|
|||||||
@@ -148,27 +148,19 @@ int8_t nr_ue_decode_mib(module_id_t module_id,
|
|||||||
uint32_t band;
|
uint32_t band;
|
||||||
uint16_t ssb_start_symbol;
|
uint16_t ssb_start_symbol;
|
||||||
|
|
||||||
if (get_softmodem_params()->sa == 1) {
|
if ((get_softmodem_params()->sa == 1) && (mac->sib1_received == 0)) {
|
||||||
scs_ssb = get_softmodem_params()->numerology;
|
scs_ssb = get_softmodem_params()->numerology;
|
||||||
band = mac->nr_band;
|
band = mac->nr_band;
|
||||||
ssb_start_symbol = get_ssb_start_symbol(band,scs_ssb,ssb_index);
|
ssb_start_symbol = get_ssb_start_symbol(band,scs_ssb,ssb_index);
|
||||||
uint16_t ssb_offset_point_a = (ssb_start_subcarrier - ssb_subcarrier_offset)/12;
|
|
||||||
|
|
||||||
get_type0_PDCCH_CSS_config_parameters(&mac->type0_PDCCH_CSS_config,
|
nr_ue_sib1_scheduler(module_id,
|
||||||
frame,
|
ssb_start_symbol,
|
||||||
mac->mib,
|
frame,
|
||||||
nr_slots_per_frame[scs_ssb],
|
ssb_subcarrier_offset,
|
||||||
ssb_subcarrier_offset,
|
ssb_index,
|
||||||
ssb_start_symbol,
|
ssb_start_subcarrier,
|
||||||
scs_ssb,
|
frequency_range);
|
||||||
frequency_range,
|
|
||||||
ssb_index,
|
|
||||||
ssb_offset_point_a);
|
|
||||||
|
|
||||||
|
|
||||||
mac->type0_pdcch_ss_mux_pattern = mac->type0_PDCCH_CSS_config.type0_pdcch_ss_mux_pattern;
|
|
||||||
mac->type0_pdcch_ss_sfn_c = mac->type0_PDCCH_CSS_config.sfn_c;
|
|
||||||
mac->type0_pdcch_ss_n_c = mac->type0_PDCCH_CSS_config.n_c;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
NR_ServingCellConfigCommon_t *scc = mac->scc;
|
NR_ServingCellConfigCommon_t *scc = mac->scc;
|
||||||
|
|||||||
@@ -1439,7 +1439,9 @@ static void map_ssb_to_ro(NR_ServingCellConfigCommon_t *scc) {
|
|||||||
ssb_list.tx_ssb[ssb_idx].nb_mapped_ro++;
|
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);
|
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(MAC,"Mapped ssb_idx %u to RO slot-symbol %u-%u, %u-%u-%u/%u\n", ssb_idx, ro_p->slot, ro_p->start_symbol, slot, ro_in_time, ro_in_freq, prach_conf_period_p->prach_occasion_slot_map[frame][slot].nb_of_prach_occasion_in_freq);
|
LOG_D(MAC,"Mapped ssb_idx %u to RO slot-symbol %u-%u, %u-%u-%u/%u\n",
|
||||||
|
ssb_idx, ro_p->slot, ro_p->start_symbol, slot, ro_in_time, ro_in_freq,
|
||||||
|
prach_conf_period_p->prach_occasion_slot_map[frame][slot].nb_of_prach_occasion_in_freq);
|
||||||
LOG_D(MAC,"Nb mapped ROs for this ssb idx: in the association period only %u\n", ssb_list.tx_ssb[ssb_idx].nb_mapped_ro);
|
LOG_D(MAC,"Nb mapped ROs for this ssb idx: in the association period only %u\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
|
||||||
@@ -1508,11 +1510,15 @@ static void map_ssb_to_ro(NR_ServingCellConfigCommon_t *scc) {
|
|||||||
ro_p->nb_mapped_ssb = 1;
|
ro_p->nb_mapped_ssb = 1;
|
||||||
ssb_list.tx_ssb[ssb_idx].mapped_ro[ssb_list.tx_ssb[ssb_idx].nb_mapped_ro] = ro_p;
|
ssb_list.tx_ssb[ssb_idx].mapped_ro[ssb_list.tx_ssb[ssb_idx].nb_mapped_ro] = ro_p;
|
||||||
ssb_list.tx_ssb[ssb_idx].nb_mapped_ro++;
|
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);
|
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_ro_in_association_period++;
|
nb_mapped_ro_in_association_period++;
|
||||||
|
|
||||||
LOG_D(MAC,"Mapped ssb_idx %u to RO slot-symbol %u-%u, %u-%u-%u/%u\n", ssb_idx, ro_p->slot, ro_p->start_symbol, slot, ro_in_time, ro_in_freq, prach_conf_period_p->prach_occasion_slot_map[frame][slot].nb_of_prach_occasion_in_freq);
|
LOG_D(MAC,"Mapped ssb_idx %u to RO slot-symbol %u-%u, %u-%u-%u/%u\n",
|
||||||
LOG_D(MAC,"Nb mapped ROs for this ssb idx: in the association period only %u / total %u\n", ssb_list.tx_ssb[ssb_idx].nb_mapped_ro, nb_mapped_ro_in_association_period);
|
ssb_idx, ro_p->slot, ro_p->start_symbol, slot, ro_in_time, ro_in_freq,
|
||||||
|
prach_conf_period_p->prach_occasion_slot_map[frame][slot].nb_of_prach_occasion_in_freq);
|
||||||
|
LOG_D(MAC,"Nb mapped ROs for this ssb idx: in the association period only %u / total %u\n",
|
||||||
|
ssb_list.tx_ssb[ssb_idx].nb_mapped_ro, 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
|
||||||
// WIP: Assuming that ssb_rach_ratio equals the maximum nb of times a given ssb_idx is mapped within an association period:
|
// WIP: Assuming that ssb_rach_ratio equals the maximum nb of times a given ssb_idx is mapped within an association period:
|
||||||
@@ -1655,6 +1661,7 @@ void build_ssb_to_ro_map(NR_ServingCellConfigCommon_t *scc, uint8_t unpaired){
|
|||||||
LOG_D(MAC,"Map SSB to RO done\n");
|
LOG_D(MAC,"Map SSB to RO done\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// This function schedules the PRACH according to prach_ConfigurationIndex and TS 38.211, tables 6.3.3.2.x
|
// This function schedules the PRACH according to prach_ConfigurationIndex and TS 38.211, tables 6.3.3.2.x
|
||||||
// PRACH formats 9, 10, 11 are corresponding to dual PRACH format configurations A1/B1, A2/B2, A3/B3.
|
// PRACH formats 9, 10, 11 are corresponding to dual PRACH format configurations A1/B1, A2/B2, A3/B3.
|
||||||
// - todo:
|
// - todo:
|
||||||
@@ -1792,6 +1799,39 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s
|
|||||||
} // if is_nr_UL_slot
|
} // if is_nr_UL_slot
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// This function schedules the reception of SIB1 after initial sync and before going to real time state
|
||||||
|
void nr_ue_sib1_scheduler(module_id_t module_idP,
|
||||||
|
uint16_t ssb_start_symbol,
|
||||||
|
uint16_t frame,
|
||||||
|
uint8_t ssb_subcarrier_offset,
|
||||||
|
uint32_t ssb_index,
|
||||||
|
uint16_t ssb_start_subcarrier,
|
||||||
|
frequency_range_t frequency_range) {
|
||||||
|
|
||||||
|
NR_UE_MAC_INST_t *mac = get_mac_inst(module_idP);
|
||||||
|
|
||||||
|
uint8_t scs_ssb = get_softmodem_params()->numerology;
|
||||||
|
uint16_t ssb_offset_point_a = (ssb_start_subcarrier - ssb_subcarrier_offset)/12;
|
||||||
|
|
||||||
|
get_type0_PDCCH_CSS_config_parameters(&mac->type0_PDCCH_CSS_config,
|
||||||
|
frame,
|
||||||
|
mac->mib,
|
||||||
|
nr_slots_per_frame[scs_ssb],
|
||||||
|
ssb_subcarrier_offset,
|
||||||
|
ssb_start_symbol,
|
||||||
|
scs_ssb,
|
||||||
|
frequency_range,
|
||||||
|
ssb_index,
|
||||||
|
ssb_offset_point_a);
|
||||||
|
|
||||||
|
mac->type0_pdcch_ss_mux_pattern = mac->type0_PDCCH_CSS_config.type0_pdcch_ss_mux_pattern;
|
||||||
|
mac->type0_pdcch_ss_sfn_c = mac->type0_PDCCH_CSS_config.sfn_c;
|
||||||
|
mac->type0_pdcch_ss_n_c = mac->type0_PDCCH_CSS_config.n_c;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
uint8_t
|
uint8_t
|
||||||
nr_ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
|
nr_ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||||
sub_frame_t subframe, uint8_t eNB_index,
|
sub_frame_t subframe, uint8_t eNB_index,
|
||||||
|
|||||||
Reference in New Issue
Block a user