Commit 3bb6457f authored by francescomani's avatar francescomani

RO MAC fields depending on bwp-id

parent 6302169d
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
// ========== // ==========
#define NB_NR_UE_MAC_INST 1 #define NB_NR_UE_MAC_INST 1
#define MAX_NUM_BWP_UE 4 #define MAX_NUM_BWP_UE 5
#define NUM_SLOT_FRAME 10 #define NUM_SLOT_FRAME 10
/*!\brief value for indicating BSR Timer is not running */ /*!\brief value for indicating BSR Timer is not running */
...@@ -461,13 +461,13 @@ typedef struct { ...@@ -461,13 +461,13 @@ typedef struct {
NR_MIB_t *mib; NR_MIB_t *mib;
struct NR_SI_SchedulingInfo *si_SchedulingInfo; struct NR_SI_SchedulingInfo *si_SchedulingInfo;
int si_window_start; int si_window_start;
ssb_list_info_t ssb_list; ssb_list_info_t ssb_list[MAX_NUM_BWP_UE];
prach_association_pattern_t prach_assoc_pattern; prach_association_pattern_t prach_assoc_pattern[MAX_NUM_BWP_UE];
NR_UE_ServingCell_Info_t sc_info; NR_UE_ServingCell_Info_t sc_info;
A_SEQUENCE_OF(NR_UE_DL_BWP_t) dl_BWPs; A_SEQUENCE_OF(NR_UE_DL_BWP_t) dl_BWPs;
A_SEQUENCE_OF(NR_UE_UL_BWP_t) ul_BWPs; A_SEQUENCE_OF(NR_UE_UL_BWP_t) ul_BWPs;
NR_BWP_PDCCH_t config_BWP_PDCCH[5]; NR_BWP_PDCCH_t config_BWP_PDCCH[MAX_NUM_BWP_UE];
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;
......
...@@ -74,6 +74,13 @@ void nr_ue_init_mac(module_id_t module_idP) ...@@ -74,6 +74,13 @@ void nr_ue_init_mac(module_id_t module_idP)
mac->servCellIndex = 0; mac->servCellIndex = 0;
mac->harq_ACK_SpatialBundlingPUCCH = false; mac->harq_ACK_SpatialBundlingPUCCH = false;
mac->harq_ACK_SpatialBundlingPUSCH = false; mac->harq_ACK_SpatialBundlingPUSCH = false;
memset(&mac->ssb_measurements, 0, sizeof(mac->ssb_measurements));
memset(&mac->ul_time_alignment, 0, sizeof(mac->ul_time_alignment));
for (int i = 0; i < MAX_NUM_BWP_UE; i++) {
memset(&mac->ssb_list[i], 0, sizeof(mac->ssb_list[i]));
memset(&mac->prach_assoc_pattern[i], 0, sizeof(mac->prach_assoc_pattern[i]));
}
} }
void nr_ue_mac_default_configs(NR_UE_MAC_INST_t *mac) void nr_ue_mac_default_configs(NR_UE_MAC_INST_t *mac)
...@@ -103,9 +110,6 @@ void nr_ue_mac_default_configs(NR_UE_MAC_INST_t *mac) ...@@ -103,9 +110,6 @@ void nr_ue_mac_default_configs(NR_UE_MAC_INST_t *mac)
for (int k = 0; k < NR_MAX_HARQ_PROCESSES; k++) for (int k = 0; k < NR_MAX_HARQ_PROCESSES; k++)
mac->UL_ndi[k] = -1; // initialize to invalid value mac->UL_ndi[k] = -1; // initialize to invalid value
} }
memset(&mac->ssb_measurements, 0, sizeof(mac->ssb_measurements));
memset(&mac->ul_time_alignment, 0, sizeof(mac->ul_time_alignment));
} }
NR_UE_MAC_INST_t *nr_l2_init_ue() NR_UE_MAC_INST_t *nr_l2_init_ue()
......
...@@ -412,6 +412,7 @@ bool monitior_dci_for_other_SI(NR_UE_MAC_INST_t *mac, ...@@ -412,6 +412,7 @@ bool monitior_dci_for_other_SI(NR_UE_MAC_INST_t *mac,
return false; return false;
const int si_window_slots = 5 << si_SchedulingInfo->si_WindowLength; const int si_window_slots = 5 << si_SchedulingInfo->si_WindowLength;
const int abs_slot = frame * slots_per_frame + slot; const int abs_slot = frame * slots_per_frame + slot;
const int bwp_id = mac->current_DL_BWP->bwp_id;
for (int n = 0; n < si_SchedulingInfo->schedulingInfoList.list.count; n++) { for (int n = 0; n < si_SchedulingInfo->schedulingInfoList.list.count; n++) {
struct NR_SchedulingInfo *sched_Info = si_SchedulingInfo->schedulingInfoList.list.array[n]; struct NR_SchedulingInfo *sched_Info = si_SchedulingInfo->schedulingInfoList.list.array[n];
if(mac->si_window_start == -1) { if(mac->si_window_start == -1) {
...@@ -436,10 +437,10 @@ bool monitior_dci_for_other_SI(NR_UE_MAC_INST_t *mac, ...@@ -436,10 +437,10 @@ bool monitior_dci_for_other_SI(NR_UE_MAC_INST_t *mac,
get_monitoring_period_offset(ss, &period, &offset); get_monitoring_period_offset(ss, &period, &offset);
for (int i = 0; i < duration; i++) { for (int i = 0; i < duration; i++) {
if (((frame * slots_per_frame + slot - offset - i) % period) == 0) { if (((frame * slots_per_frame + slot - offset - i) % period) == 0) {
int N = mac->ssb_list.nb_tx_ssb; int N = mac->ssb_list[bwp_id].nb_tx_ssb;
int K = 0; // k_th transmitted SSB int K = 0; // k_th transmitted SSB
for (int i = 0; i < mac->mib_ssb; i++) { for (int i = 0; i < mac->mib_ssb; i++) {
if(mac->ssb_list.tx_ssb[i].transmitted) if(mac->ssb_list[bwp_id].tx_ssb[i].transmitted)
K++; K++;
} }
// numbering current frame and slot in terms of monitoring occasions in window // numbering current frame and slot in terms of monitoring occasions in window
......
This diff is collapsed.
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