Commit 260ee38f authored by Robert Schmidt's avatar Robert Schmidt

Save slots to schedule as bitmap from config

parent 3799ab37
...@@ -386,6 +386,29 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, ...@@ -386,6 +386,29 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
if (RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req) RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req(&phycfg); if (RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req) RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req(&phycfg);
find_SSB_and_RO_available(Mod_idP); find_SSB_and_RO_available(Mod_idP);
const NR_TDD_UL_DL_Pattern_t *tdd = &scc->tdd_UL_DL_ConfigurationCommon->pattern1;
const int nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0;
const int nr_slots_period = tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots;
const int nr_dlmix_slots = tdd->nrofDownlinkSlots + (tdd->nrofDownlinkSymbols != 0);
const int nr_ulstart_slot = tdd->nrofDownlinkSlots + (tdd->nrofUplinkSymbols == 0);
for (int slot = 0; slot < n; ++slot) {
RC.nrmac[Mod_idP]->dlsch_slot_bitmap[slot / 64] |= ((slot % nr_slots_period) < nr_dlmix_slots) << (slot % 64);
RC.nrmac[Mod_idP]->ulsch_slot_bitmap[slot / 64] |= ((slot % nr_slots_period) >= nr_ulstart_slot) << (slot % 64);
LOG_D(MAC,
"slot %d DL %d UL %d\n",
slot,
(RC.nrmac[Mod_idP]->dlsch_slot_bitmap[slot / 64] & (1 << (slot % 64))) != 0,
(RC.nrmac[Mod_idP]->ulsch_slot_bitmap[slot / 64] & (1 << (slot % 64))) != 0);
}
if (get_softmodem_params()->phy_test) {
RC.nrmac[Mod_idP]->pre_processor_dl = nr_preprocessor_phytest;
RC.nrmac[Mod_idP]->pre_processor_ul = nr_ul_preprocessor_phytest;
} else {
RC.nrmac[Mod_idP]->pre_processor_dl = nr_init_fr1_dlsch_preprocessor(Mod_idP, 0);
RC.nrmac[Mod_idP]->pre_processor_ul = nr_init_fr1_ulsch_preprocessor(Mod_idP, 0);
}
} }
if (secondaryCellGroup) { if (secondaryCellGroup) {
......
...@@ -707,9 +707,13 @@ typedef struct gNB_MAC_INST_s { ...@@ -707,9 +707,13 @@ typedef struct gNB_MAC_INST_s {
/// so we can have it for every slot as a function of the numerology /// so we can have it for every slot as a function of the numerology
int *pucch_index_used[MAX_NUM_BWP]; int *pucch_index_used[MAX_NUM_BWP];
/// bitmap of DLSCH slots, can hold up to 160 slots
uint64_t dlsch_slot_bitmap[3];
/// Lookup for preferred time domain allocation for BWP, in DL, slots /// Lookup for preferred time domain allocation for BWP, in DL, slots
/// dynamically allocated /// dynamically allocated
int *preferred_dl_tda[MAX_NUM_BWP]; int *preferred_dl_tda[MAX_NUM_BWP];
/// bitmap of ULSCH slots, can hold up to 160 slots
uint64_t ulsch_slot_bitmap[3];
/// Lookup for preferred time domain allocation for UL BWP, dynamically /// Lookup for preferred time domain allocation for UL BWP, dynamically
/// allocated. The index refers to the DL slot, and the indicated TDA's k2 /// allocated. The index refers to the DL slot, and the indicated TDA's k2
/// points to the right UL slot /// points to the right UL slot
......
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