Commit 924be4ed authored by francescomani's avatar francescomani

monitor DCI for other SI

parent 6d0ae249
...@@ -717,11 +717,13 @@ void nr_rrc_mac_config_req_mib(module_id_t module_id, ...@@ -717,11 +717,13 @@ void nr_rrc_mac_config_req_mib(module_id_t module_id,
void nr_rrc_mac_config_req_sib1(module_id_t module_id, void nr_rrc_mac_config_req_sib1(module_id_t module_id,
int cc_idP, int cc_idP,
struct NR_SI_SchedulingInfo *si_SchedulingInfo,
NR_ServingCellConfigCommonSIB_t *scc) NR_ServingCellConfigCommonSIB_t *scc)
{ {
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
AssertFatal(scc, "SIB1 SCC should not be NULL\n"); AssertFatal(scc, "SIB1 SCC should not be NULL\n");
mac->scc_SIB = scc; mac->scc_SIB = scc;
mac->si_SchedulingInfo = si_SchedulingInfo;
mac->nr_band = *scc->downlinkConfigCommon.frequencyInfoDL.frequencyBandList.list.array[0]->freqBandIndicatorNR; mac->nr_band = *scc->downlinkConfigCommon.frequencyInfoDL.frequencyBandList.list.array[0]->freqBandIndicatorNR;
config_common_ue_sa(mac, module_id, cc_idP); config_common_ue_sa(mac, module_id, cc_idP);
configure_current_BWP(mac, scc, NULL); configure_current_BWP(mac, scc, NULL);
......
...@@ -382,6 +382,43 @@ typedef struct NR_UL_TIME_ALIGNMENT { ...@@ -382,6 +382,43 @@ typedef struct NR_UL_TIME_ALIGNMENT {
int slot; int slot;
} NR_UL_TIME_ALIGNMENT_t; } NR_UL_TIME_ALIGNMENT_t;
// The PRACH Config period is a series of selected slots in one or multiple frames
typedef struct prach_conf_period {
prach_occasion_slot_t prach_occasion_slot_map[MAX_NB_FRAME_IN_PRACH_CONF_PERIOD][MAX_NB_SLOT_IN_FRAME];
uint16_t nb_of_prach_occasion; // Total number of PRACH occasions in the PRACH Config period
uint8_t nb_of_frame; // Size of the PRACH Config period in number of 10ms frames
uint8_t nb_of_slot; // Nb of slots in each frame
} prach_conf_period_t;
// The association period is a series of PRACH Config periods
typedef struct prach_association_period {
prach_conf_period_t *prach_conf_period_list[MAX_NB_PRACH_CONF_PERIOD_IN_ASSOCIATION_PERIOD];
uint8_t nb_of_prach_conf_period; // Nb of PRACH configuration periods within the association period
uint8_t nb_of_frame; // Total number of frames included in the association period
} prach_association_period_t;
// The association pattern is a series of Association periods
typedef struct prach_association_pattern {
prach_association_period_t prach_association_period_list[MAX_NB_ASSOCIATION_PERIOD_IN_ASSOCIATION_PATTERN_PERIOD];
prach_conf_period_t prach_conf_period_list[MAX_NB_PRACH_CONF_PERIOD_IN_ASSOCIATION_PATTERN_PERIOD];
uint8_t nb_of_assoc_period; // Nb of association periods within the association pattern
uint8_t nb_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_t nb_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;
// SSB details
typedef struct ssb_info {
bool transmitted; // True if the SSB index is transmitted according to the SSB positions map configuration
prach_occasion_info_t *mapped_ro[MAX_NB_RO_PER_SSB_IN_ASSOCIATION_PATTERN]; // List of mapped RACH Occasions to this SSB index
uint32_t nb_mapped_ro; // Total number of mapped ROs to this SSB index
} ssb_info_t;
// List of all the possible SSBs and their details
typedef struct ssb_list_info {
ssb_info_t tx_ssb[MAX_NB_SSB];
uint8_t nb_tx_ssb;
} ssb_list_info_t;
/*!\brief Top level UE MAC structure */ /*!\brief Top level UE MAC structure */
typedef struct { typedef struct {
NR_UE_L2_STATE_t state; NR_UE_L2_STATE_t state;
...@@ -402,6 +439,9 @@ typedef struct { ...@@ -402,6 +439,9 @@ typedef struct {
NR_PHR_Config_t *phr_Config; NR_PHR_Config_t *phr_Config;
NR_RNTI_Value_t *cs_RNTI; NR_RNTI_Value_t *cs_RNTI;
NR_MIB_t *mib; NR_MIB_t *mib;
struct NR_SI_SchedulingInfo *si_SchedulingInfo;
int si_window_start;
ssb_list_info_t ssb_list;
NR_UE_DL_BWP_t current_DL_BWP; NR_UE_DL_BWP_t current_DL_BWP;
NR_UE_UL_BWP_t current_UL_BWP; NR_UE_UL_BWP_t current_UL_BWP;
...@@ -485,43 +525,5 @@ typedef struct { ...@@ -485,43 +525,5 @@ typedef struct {
} NR_UE_MAC_INST_t; } NR_UE_MAC_INST_t;
// The PRACH Config period is a series of selected slots in one or multiple frames
typedef struct prach_conf_period {
prach_occasion_slot_t prach_occasion_slot_map[MAX_NB_FRAME_IN_PRACH_CONF_PERIOD][MAX_NB_SLOT_IN_FRAME];
uint16_t nb_of_prach_occasion; // Total number of PRACH occasions in the PRACH Config period
uint8_t nb_of_frame; // Size of the PRACH Config period in number of 10ms frames
uint8_t nb_of_slot; // Nb of slots in each frame
} prach_conf_period_t;
// The association period is a series of PRACH Config periods
typedef struct prach_association_period {
prach_conf_period_t *prach_conf_period_list[MAX_NB_PRACH_CONF_PERIOD_IN_ASSOCIATION_PERIOD];
uint8_t nb_of_prach_conf_period; // Nb of PRACH configuration periods within the association period
uint8_t nb_of_frame; // Total number of frames included in the association period
} prach_association_period_t;
// The association pattern is a series of Association periods
typedef struct prach_association_pattern {
prach_association_period_t prach_association_period_list[MAX_NB_ASSOCIATION_PERIOD_IN_ASSOCIATION_PATTERN_PERIOD];
prach_conf_period_t prach_conf_period_list[MAX_NB_PRACH_CONF_PERIOD_IN_ASSOCIATION_PATTERN_PERIOD];
uint8_t nb_of_assoc_period; // Nb of association periods within the association pattern
uint8_t nb_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_t nb_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;
// SSB details
typedef struct ssb_info {
bool transmitted; // True if the SSB index is transmitted according to the SSB positions map configuration
prach_occasion_info_t *mapped_ro[MAX_NB_RO_PER_SSB_IN_ASSOCIATION_PATTERN]; // List of mapped RACH Occasions to this SSB index
uint32_t nb_mapped_ro; // Total number of mapped ROs to this SSB index
} ssb_info_t;
// List of all the possible SSBs and their details
typedef struct ssb_list_info {
ssb_info_t tx_ssb[MAX_NB_SSB];
uint8_t nb_tx_ssb;
} ssb_list_info_t;
/*@}*/ /*@}*/
#endif /*__LAYER2_MAC_DEFS_H__ */ #endif /*__LAYER2_MAC_DEFS_H__ */
...@@ -110,6 +110,7 @@ void nr_rrc_mac_config_req_mib(module_id_t module_id, ...@@ -110,6 +110,7 @@ void nr_rrc_mac_config_req_mib(module_id_t module_id,
void nr_rrc_mac_config_req_sib1(module_id_t module_id, void nr_rrc_mac_config_req_sib1(module_id_t module_id,
int cc_idP, int cc_idP,
struct NR_SI_SchedulingInfo *si_SchedulingInfo,
NR_ServingCellConfigCommonSIB_t *scc); NR_ServingCellConfigCommonSIB_t *scc);
/**\brief initialization NR UE MAC instance(s), total number of MAC instance based on NB_NR_UE_MAC_INST*/ /**\brief initialization NR UE MAC instance(s), total number of MAC instance based on NB_NR_UE_MAC_INST*/
......
...@@ -365,6 +365,63 @@ bool is_ss_monitor_occasion(const int frame, const int slot, const int slots_per ...@@ -365,6 +365,63 @@ bool is_ss_monitor_occasion(const int frame, const int slot, const int slots_per
return monitor; return monitor;
} }
bool montior_dci_for_other_SI(NR_UE_MAC_INST_t *mac,
const NR_SearchSpace_t *ss,
const int slots_per_frame,
const int frame,
const int slot)
{
const struct NR_SI_SchedulingInfo *si_SchedulingInfo = mac->si_SchedulingInfo;
// 5.2.2.3.2 in 331
if (!si_SchedulingInfo)
return false;
const int si_window_slots = 5 << si_SchedulingInfo->si_WindowLength;
const int abs_slot = frame * slots_per_frame + slot;
for (int n = 0; n < si_SchedulingInfo->schedulingInfoList.list.count; n++) {
struct NR_SchedulingInfo *sched_Info = si_SchedulingInfo->schedulingInfoList.list.array[n];
if(mac->si_window_start == -1) {
int x = n * si_window_slots;
int T = 8 << sched_Info->si_Periodicity; // radio frame periodicity
if ((frame % T) == (x / slots_per_frame) &&
(x % slots_per_frame == 0))
mac->si_window_start = abs_slot; // in terms of absolute slot number
}
if (mac->si_window_start == -1) {
// out of window
return false;
}
else if (abs_slot > mac->si_window_start + si_window_slots) {
// window expired
mac->si_window_start = -1;
return false;
}
else {
const int duration = ss->duration ? *ss->duration : 1;
int period, offset;
get_monitoring_period_offset(ss, &period, &offset);
for (int i = 0; i < duration; i++) {
if (((frame * slots_per_frame + slot - offset - i) % period) == 0) {
int N = mac->ssb_list.nb_tx_ssb;
int K = 0; // k_th transmitted SSB
for (int i = 0; i < mac->mib_ssb; i++) {
if(mac->ssb_list.tx_ssb[i].transmitted)
K++;
}
// numbering current frame and slot in terms of monitoring occasions in window
int current_monitor_occasion = ((abs_slot - mac->si_window_start) % period) +
(duration * (abs_slot - mac->si_window_start) / period);
if (current_monitor_occasion % N == K)
return true;
else
return false;
}
}
}
}
return false;
}
void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl_config, const frame_t frame, const int slot) void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl_config, const frame_t frame, const int slot)
{ {
const NR_UE_DL_BWP_t *current_DL_BWP = &mac->current_DL_BWP; const NR_UE_DL_BWP_t *current_DL_BWP = &mac->current_DL_BWP;
...@@ -375,8 +432,10 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl ...@@ -375,8 +432,10 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
// are same as PDCCH monitoring occasions for SIB1 // are same as PDCCH monitoring occasions for SIB1
const NR_SearchSpace_t *ss = mac->otherSI_SS ? mac->otherSI_SS : mac->search_space_zero; const NR_SearchSpace_t *ss = mac->otherSI_SS ? mac->otherSI_SS : mac->search_space_zero;
// TODO configure SI-window // TODO configure SI-window
if (is_ss_monitor_occasion(frame, slot, slots_per_frame, ss)) if (montior_dci_for_other_SI(mac, ss, slots_per_frame, frame, slot)) {
LOG_D(NR_MAC, "Monitoring DCI for other SIs in frame %d slot %d\n", frame, slot);
config_dci_pdu(mac, dl_config, NR_RNTI_SI, slot, ss); config_dci_pdu(mac, dl_config, NR_RNTI_SI, slot, ss);
}
} }
if (mac->state == UE_PERFORMING_RA && if (mac->state == UE_PERFORMING_RA &&
mac->ra.ra_state >= WAIT_RAR) { mac->ra.ra_state >= WAIT_RAR) {
......
...@@ -168,6 +168,7 @@ void nr_ue_init_mac(module_id_t module_idP) ...@@ -168,6 +168,7 @@ void nr_ue_init_mac(module_id_t module_idP)
mac->get_otherSI = false; mac->get_otherSI = false;
mac->phy_config_request_sent = false; mac->phy_config_request_sent = false;
mac->state = UE_NOT_SYNC; mac->state = UE_NOT_SYNC;
mac->si_window_start = -1;
} }
void nr_ue_mac_default_configs(NR_UE_MAC_INST_t *mac) void nr_ue_mac_default_configs(NR_UE_MAC_INST_t *mac)
......
This diff is collapsed.
...@@ -736,7 +736,7 @@ static int8_t nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message(module_id_t module_id, ...@@ -736,7 +736,7 @@ static int8_t nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message(module_id_t module_id,
nr_rrc_set_sib1_timers_and_constants(&NR_UE_rrc_inst[module_id].timers_and_constants, sib1); nr_rrc_set_sib1_timers_and_constants(&NR_UE_rrc_inst[module_id].timers_and_constants, sib1);
// take ServingCellConfigCommon and configure L1/L2 // take ServingCellConfigCommon and configure L1/L2
NR_UE_rrc_inst[module_id].servingCellConfigCommonSIB = sib1->servingCellConfigCommon; NR_UE_rrc_inst[module_id].servingCellConfigCommonSIB = sib1->servingCellConfigCommon;
nr_rrc_mac_config_req_sib1(module_id, 0, sib1->servingCellConfigCommon); nr_rrc_mac_config_req_sib1(module_id, 0, sib1->si_SchedulingInfo, sib1->servingCellConfigCommon);
nr_rrc_ue_generate_ra_msg(module_id, gNB_index); nr_rrc_ue_generate_ra_msg(module_id, gNB_index);
break; break;
......
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