nr_slot_select() and set_tdd_config_nr(): remove useless second frame
FAPI says these lists should be for MAX_TDD_PERIODICITY (which is maybe a frame, or a TDD period? but likely not two frames). Reduce to one frame. Also, the nFAPI code assumes one entire frame, so use that (this commit necessary to actually make the PNF work, otherwise, the packing/unpacking of the FAPI message would need to do 2 frames). Closes: #876
This commit is contained in:
@@ -268,7 +268,6 @@
|
|||||||
#if 1
|
#if 1
|
||||||
|
|
||||||
#define NB_NUMEROLOGIES_NR (5)
|
#define NB_NUMEROLOGIES_NR (5)
|
||||||
#define TDD_CONFIG_NB_FRAMES (2)
|
|
||||||
#define NR_MAX_SLOTS_PER_FRAME (160) /* number of slots per frame */
|
#define NR_MAX_SLOTS_PER_FRAME (160) /* number of slots per frame */
|
||||||
|
|
||||||
/* FFS_NR_TODO it defines ue capability which is the number of slots */
|
/* FFS_NR_TODO it defines ue capability which is the number of slots */
|
||||||
|
|||||||
@@ -67,101 +67,84 @@ int set_tdd_config_nr(nfapi_nr_config_request_scf_t *cfg,
|
|||||||
int nrofUplinkSlots,
|
int nrofUplinkSlots,
|
||||||
int nrofUplinkSymbols)
|
int nrofUplinkSymbols)
|
||||||
{
|
{
|
||||||
|
|
||||||
int slot_number = 0;
|
int slot_number = 0;
|
||||||
int nb_periods_per_frame = get_nb_periods_per_frame(cfg->tdd_table.tdd_period.value);
|
int nb_periods_per_frame = get_nb_periods_per_frame(cfg->tdd_table.tdd_period.value);
|
||||||
int nb_slots_to_set = TDD_CONFIG_NB_FRAMES*(1<<mu)*NR_NUMBER_OF_SUBFRAMES_PER_FRAME;
|
int nb_slots_to_set = (1 << mu) * NR_NUMBER_OF_SUBFRAMES_PER_FRAME;
|
||||||
|
|
||||||
int nb_slots_per_period = ((1<<mu) * NR_NUMBER_OF_SUBFRAMES_PER_FRAME)/nb_periods_per_frame;
|
int nb_slots_per_period = ((1 << mu) * NR_NUMBER_OF_SUBFRAMES_PER_FRAME) / nb_periods_per_frame;
|
||||||
|
|
||||||
if ( (nrofDownlinkSymbols + nrofUplinkSymbols) == 0 )
|
if ((nrofDownlinkSymbols + nrofUplinkSymbols) == 0)
|
||||||
AssertFatal(nb_slots_per_period == (nrofDownlinkSlots + nrofUplinkSlots),
|
AssertFatal(nb_slots_per_period == (nrofDownlinkSlots + nrofUplinkSlots),
|
||||||
"set_tdd_configuration_nr: given period is inconsistent with current tdd configuration, nrofDownlinkSlots %d, nrofUplinkSlots %d, nb_slots_per_period %d \n",
|
"set_tdd_configuration_nr: given period is inconsistent with current tdd configuration, nrofDownlinkSlots %d, "
|
||||||
nrofDownlinkSlots,nrofUplinkSlots,nb_slots_per_period);
|
"nrofUplinkSlots %d, nb_slots_per_period %d \n",
|
||||||
|
nrofDownlinkSlots,
|
||||||
|
nrofUplinkSlots,
|
||||||
|
nb_slots_per_period);
|
||||||
else {
|
else {
|
||||||
AssertFatal(nrofDownlinkSymbols + nrofUplinkSymbols < 14,"illegal symbol configuration DL %d, UL %d\n",nrofDownlinkSymbols,nrofUplinkSymbols);
|
AssertFatal(nrofDownlinkSymbols + nrofUplinkSymbols < 14,
|
||||||
|
"illegal symbol configuration DL %d, UL %d\n",
|
||||||
|
nrofDownlinkSymbols,
|
||||||
|
nrofUplinkSymbols);
|
||||||
AssertFatal(nb_slots_per_period == (nrofDownlinkSlots + nrofUplinkSlots + 1),
|
AssertFatal(nb_slots_per_period == (nrofDownlinkSlots + nrofUplinkSlots + 1),
|
||||||
"set_tdd_configuration_nr: given period is inconsistent with current tdd configuration, nrofDownlinkSlots %d, nrofUplinkSlots %d, nrofMixed slots 1, nb_slots_per_period %d \n",
|
"set_tdd_configuration_nr: given period is inconsistent with current tdd configuration, nrofDownlinkSlots %d, "
|
||||||
nrofDownlinkSlots,nrofUplinkSlots,nb_slots_per_period);
|
"nrofUplinkSlots %d, nrofMixed slots 1, nb_slots_per_period %d \n",
|
||||||
|
nrofDownlinkSlots,
|
||||||
|
nrofUplinkSlots,
|
||||||
|
nb_slots_per_period);
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg->tdd_table.max_tdd_periodicity_list = (nfapi_nr_max_tdd_periodicity_t *) malloc(nb_slots_to_set*sizeof(nfapi_nr_max_tdd_periodicity_t));
|
cfg->tdd_table.max_tdd_periodicity_list = calloc(nb_slots_to_set, sizeof(nfapi_nr_max_tdd_periodicity_t));
|
||||||
|
|
||||||
for(int memory_alloc =0 ; memory_alloc<nb_slots_to_set; memory_alloc++) {
|
for (int slot = 0; slot < nb_slots_to_set; slot++) {
|
||||||
cfg->tdd_table.max_tdd_periodicity_list[memory_alloc].max_num_of_symbol_per_slot_list = (nfapi_nr_max_num_of_symbol_per_slot_t *) malloc(NR_NUMBER_OF_SYMBOLS_PER_SLOT*sizeof(
|
nfapi_nr_max_tdd_periodicity_t *p_list = &cfg->tdd_table.max_tdd_periodicity_list[slot];
|
||||||
nfapi_nr_max_num_of_symbol_per_slot_t));
|
p_list->max_num_of_symbol_per_slot_list =
|
||||||
for(int number_of_symbol = 0; number_of_symbol < NR_NUMBER_OF_SYMBOLS_PER_SLOT; number_of_symbol++ ){
|
calloc(NR_NUMBER_OF_SYMBOLS_PER_SLOT, sizeof(*p_list->max_num_of_symbol_per_slot_list));
|
||||||
//for each symbol, assign the TLV tag for usage when packing
|
for (int sym = 0; sym < NR_NUMBER_OF_SYMBOLS_PER_SLOT; sym++) {
|
||||||
cfg->tdd_table.max_tdd_periodicity_list[memory_alloc].max_num_of_symbol_per_slot_list[number_of_symbol].slot_config.tl.tag = NFAPI_NR_CONFIG_SLOT_CONFIG_TAG;
|
// for each symbol, assign the TLV tag for usage when packing
|
||||||
|
p_list->max_num_of_symbol_per_slot_list[sym].slot_config.tl.tag = NFAPI_NR_CONFIG_SLOT_CONFIG_TAG;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while(slot_number != nb_slots_to_set) {
|
while (slot_number != nb_slots_to_set) {
|
||||||
if(nrofDownlinkSlots != 0) {
|
if (nrofDownlinkSlots != 0) {
|
||||||
for (int number_of_symbol = 0; number_of_symbol < nrofDownlinkSlots*NR_NUMBER_OF_SYMBOLS_PER_SLOT; number_of_symbol++) {
|
for (int sym = 0; sym < nrofDownlinkSlots * NR_NUMBER_OF_SYMBOLS_PER_SLOT; sym++) {
|
||||||
cfg->tdd_table.max_tdd_periodicity_list[slot_number].max_num_of_symbol_per_slot_list[number_of_symbol%NR_NUMBER_OF_SYMBOLS_PER_SLOT].slot_config.value= 0;
|
cfg->tdd_table.max_tdd_periodicity_list[slot_number]
|
||||||
|
.max_num_of_symbol_per_slot_list[sym % NR_NUMBER_OF_SYMBOLS_PER_SLOT]
|
||||||
|
.slot_config.value = 0;
|
||||||
|
|
||||||
if((number_of_symbol+1)%NR_NUMBER_OF_SYMBOLS_PER_SLOT == 0)
|
if ((sym + 1) % NR_NUMBER_OF_SYMBOLS_PER_SLOT == 0)
|
||||||
slot_number++;
|
slot_number++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nrofDownlinkSymbols != 0 || nrofUplinkSymbols != 0) {
|
if (nrofDownlinkSymbols != 0 || nrofUplinkSymbols != 0) {
|
||||||
for(int number_of_symbol =0; number_of_symbol < nrofDownlinkSymbols; number_of_symbol++) {
|
for (int sym = 0; sym < nrofDownlinkSymbols; sym++) {
|
||||||
cfg->tdd_table.max_tdd_periodicity_list[slot_number].max_num_of_symbol_per_slot_list[number_of_symbol].slot_config.value= 0;
|
cfg->tdd_table.max_tdd_periodicity_list[slot_number].max_num_of_symbol_per_slot_list[sym].slot_config.value = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int number_of_symbol = nrofDownlinkSymbols; number_of_symbol < NR_NUMBER_OF_SYMBOLS_PER_SLOT-nrofUplinkSymbols; number_of_symbol++) {
|
for (int sym = nrofDownlinkSymbols; sym < NR_NUMBER_OF_SYMBOLS_PER_SLOT - nrofUplinkSymbols; sym++) {
|
||||||
cfg->tdd_table.max_tdd_periodicity_list[slot_number].max_num_of_symbol_per_slot_list[number_of_symbol].slot_config.value= 2;
|
cfg->tdd_table.max_tdd_periodicity_list[slot_number].max_num_of_symbol_per_slot_list[sym].slot_config.value = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int number_of_symbol = NR_NUMBER_OF_SYMBOLS_PER_SLOT-nrofUplinkSymbols; number_of_symbol < NR_NUMBER_OF_SYMBOLS_PER_SLOT; number_of_symbol++) {
|
for (int sym = NR_NUMBER_OF_SYMBOLS_PER_SLOT - nrofUplinkSymbols; sym < NR_NUMBER_OF_SYMBOLS_PER_SLOT; sym++) {
|
||||||
cfg->tdd_table.max_tdd_periodicity_list[slot_number].max_num_of_symbol_per_slot_list[number_of_symbol].slot_config.value= 1;
|
cfg->tdd_table.max_tdd_periodicity_list[slot_number].max_num_of_symbol_per_slot_list[sym].slot_config.value = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
slot_number++;
|
slot_number++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(nrofUplinkSlots != 0) {
|
if (nrofUplinkSlots != 0) {
|
||||||
for (int number_of_symbol = 0; number_of_symbol < nrofUplinkSlots*NR_NUMBER_OF_SYMBOLS_PER_SLOT; number_of_symbol++) {
|
for (int sym = 0; sym < nrofUplinkSlots * NR_NUMBER_OF_SYMBOLS_PER_SLOT; sym++) {
|
||||||
cfg->tdd_table.max_tdd_periodicity_list[slot_number].max_num_of_symbol_per_slot_list[number_of_symbol%NR_NUMBER_OF_SYMBOLS_PER_SLOT].slot_config.value= 1;
|
cfg->tdd_table.max_tdd_periodicity_list[slot_number]
|
||||||
|
.max_num_of_symbol_per_slot_list[sym % NR_NUMBER_OF_SYMBOLS_PER_SLOT]
|
||||||
|
.slot_config.value = 1;
|
||||||
|
|
||||||
if((number_of_symbol+1)%NR_NUMBER_OF_SYMBOLS_PER_SLOT == 0)
|
if ((sym + 1) % NR_NUMBER_OF_SYMBOLS_PER_SLOT == 0)
|
||||||
slot_number++;
|
slot_number++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
while(slot_number != nb_slots_to_set) {
|
|
||||||
for (int number_of_slot = 0; number_of_slot < nrofDownlinkSlots; number_of_slot++) {
|
|
||||||
frame_parms->tdd_uplink_nr[slot_number] = NR_TDD_DOWNLINK_SLOT;
|
|
||||||
printf("slot %d set as downlink\n",slot_number);
|
|
||||||
slot_number++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nrofDownlinkSymbols != 0 || nrofUplinkSymbols != 0) {
|
|
||||||
frame_parms->tdd_uplink_nr[slot_number] = (1<<nrofUplinkSymbols) - 1;
|
|
||||||
printf("slot %d set as SL\n",slot_number);
|
|
||||||
slot_number++;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int number_of_slot = 0; number_of_slot < nrofUplinkSlots; number_of_slot++) {
|
|
||||||
frame_parms->tdd_uplink_nr[slot_number] = NR_TDD_UPLINK_SLOT;
|
|
||||||
printf("slot %d set as uplink\n",slot_number);
|
|
||||||
slot_number++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (p_tdd_ul_dl_configuration->nrofUplinkSymbols != 0) {
|
|
||||||
LOG_E(PHY,"set_tdd_configuration_nr: uplink symbol for slot is not supported for tdd configuration \n");
|
|
||||||
return (-1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (frame_parms->p_tdd_UL_DL_ConfigurationCommon2 != NULL) {
|
|
||||||
LOG_E(PHY,"set_tdd_configuration_nr: additionnal tdd configuration 2 is not supported for tdd configuration \n");
|
|
||||||
return (-1);
|
|
||||||
}*/
|
|
||||||
return (nb_periods_per_frame);
|
return (nb_periods_per_frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,7 +218,7 @@ int set_tdd_configuration_dedicated_nr(NR_DL_FRAME_PARMS *frame_parms) {
|
|||||||
while(p_current_TDD_UL_DL_SlotConfig != NULL) {
|
while(p_current_TDD_UL_DL_SlotConfig != NULL) {
|
||||||
int slot_index = p_current_TDD_UL_DL_SlotConfig->slotIndex;
|
int slot_index = p_current_TDD_UL_DL_SlotConfig->slotIndex;
|
||||||
|
|
||||||
if (slot_index < TDD_CONFIG_NB_FRAMES * frame_parms->slots_per_frame) {
|
if (slot_index < frame_parms->slots_per_frame) {
|
||||||
if (p_current_TDD_UL_DL_SlotConfig->nrofDownlinkSymbols != 0) {
|
if (p_current_TDD_UL_DL_SlotConfig->nrofDownlinkSymbols != 0) {
|
||||||
if (p_current_TDD_UL_DL_SlotConfig->nrofDownlinkSymbols == NR_TDD_SET_ALL_SYMBOLS) {
|
if (p_current_TDD_UL_DL_SlotConfig->nrofDownlinkSymbols == NR_TDD_SET_ALL_SYMBOLS) {
|
||||||
if (p_current_TDD_UL_DL_SlotConfig->nrofUplinkSymbols == 0) {
|
if (p_current_TDD_UL_DL_SlotConfig->nrofUplinkSymbols == 0) {
|
||||||
@@ -306,62 +289,39 @@ int get_next_downlink_slot(PHY_VARS_gNB *gNB, nfapi_nr_config_request_scf_t *cfg
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int nr_slot_select(nfapi_nr_config_request_scf_t *cfg, int nr_frame, int nr_slot) {
|
int nr_slot_select(nfapi_nr_config_request_scf_t *cfg, int nr_frame, int nr_slot)
|
||||||
|
{
|
||||||
|
(void) nr_frame;
|
||||||
|
|
||||||
/* for FFD all slot can be considered as an uplink */
|
/* for FFD all slot can be considered as an uplink */
|
||||||
int mu = cfg->ssb_config.scs_common.value,check_slot=0;
|
int check_slot = 0;
|
||||||
|
|
||||||
if (cfg->cell_config.frame_duplex_type.value == FDD) {
|
if (cfg->cell_config.frame_duplex_type.value == FDD) {
|
||||||
return (NR_UPLINK_SLOT | NR_DOWNLINK_SLOT );
|
return (NR_UPLINK_SLOT | NR_DOWNLINK_SLOT);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nr_frame%2 == 0) {
|
for (int symbol_count = 0; symbol_count < NR_NUMBER_OF_SYMBOLS_PER_SLOT; symbol_count++) {
|
||||||
for(int symbol_count=0; symbol_count<NR_NUMBER_OF_SYMBOLS_PER_SLOT; symbol_count++) {
|
if (cfg->tdd_table.max_tdd_periodicity_list[nr_slot].max_num_of_symbol_per_slot_list[symbol_count].slot_config.value == 1) {
|
||||||
if (cfg->tdd_table.max_tdd_periodicity_list[nr_slot].max_num_of_symbol_per_slot_list[symbol_count].slot_config.value==1) {
|
check_slot++;
|
||||||
check_slot++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(check_slot == NR_NUMBER_OF_SYMBOLS_PER_SLOT) {
|
if (check_slot == NR_NUMBER_OF_SYMBOLS_PER_SLOT) {
|
||||||
return (NR_UPLINK_SLOT);
|
return (NR_UPLINK_SLOT);
|
||||||
|
}
|
||||||
|
|
||||||
|
check_slot = 0;
|
||||||
|
|
||||||
|
for (int symbol_count = 0; symbol_count < NR_NUMBER_OF_SYMBOLS_PER_SLOT; symbol_count++) {
|
||||||
|
if (cfg->tdd_table.max_tdd_periodicity_list[nr_slot].max_num_of_symbol_per_slot_list[symbol_count].slot_config.value == 0) {
|
||||||
|
check_slot++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
check_slot = 0;
|
if (check_slot == NR_NUMBER_OF_SYMBOLS_PER_SLOT) {
|
||||||
|
return (NR_DOWNLINK_SLOT);
|
||||||
for(int symbol_count=0; symbol_count<NR_NUMBER_OF_SYMBOLS_PER_SLOT; symbol_count++) {
|
|
||||||
if (cfg->tdd_table.max_tdd_periodicity_list[nr_slot].max_num_of_symbol_per_slot_list[symbol_count].slot_config.value==0) {
|
|
||||||
check_slot++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(check_slot == NR_NUMBER_OF_SYMBOLS_PER_SLOT) {
|
|
||||||
return (NR_DOWNLINK_SLOT);
|
|
||||||
} else {
|
|
||||||
return (NR_MIXED_SLOT);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
for(int symbol_count=0; symbol_count<NR_NUMBER_OF_SYMBOLS_PER_SLOT; symbol_count++) {
|
return (NR_MIXED_SLOT);
|
||||||
if (cfg->tdd_table.max_tdd_periodicity_list[((1<<mu) * NR_NUMBER_OF_SUBFRAMES_PER_FRAME) + nr_slot].max_num_of_symbol_per_slot_list[symbol_count].slot_config.value==1) {
|
|
||||||
check_slot++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(check_slot == NR_NUMBER_OF_SYMBOLS_PER_SLOT) {
|
|
||||||
return (NR_UPLINK_SLOT);
|
|
||||||
}
|
|
||||||
|
|
||||||
check_slot = 0;
|
|
||||||
|
|
||||||
for(int symbol_count=0; symbol_count<NR_NUMBER_OF_SYMBOLS_PER_SLOT; symbol_count++) {
|
|
||||||
if (cfg->tdd_table.max_tdd_periodicity_list[((1<<mu) * NR_NUMBER_OF_SUBFRAMES_PER_FRAME) + nr_slot].max_num_of_symbol_per_slot_list[symbol_count].slot_config.value==0) {
|
|
||||||
check_slot++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(check_slot == NR_NUMBER_OF_SYMBOLS_PER_SLOT) {
|
|
||||||
return (NR_DOWNLINK_SLOT);
|
|
||||||
} else {
|
|
||||||
return (NR_MIXED_SLOT);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,10 +34,6 @@
|
|||||||
#ifndef PHY_FRAME_CONFIG_NR_H
|
#ifndef PHY_FRAME_CONFIG_NR_H
|
||||||
#define PHY_FRAME_CONFIG_NR_H
|
#define PHY_FRAME_CONFIG_NR_H
|
||||||
|
|
||||||
/************** DEFINE ********************************************/
|
|
||||||
|
|
||||||
#define TDD_CONFIG_NB_FRAMES (2)
|
|
||||||
|
|
||||||
/*************** FUNCTIONS *****************************************/
|
/*************** FUNCTIONS *****************************************/
|
||||||
|
|
||||||
/** \brief This function processes tdd dedicated configuration for nr
|
/** \brief This function processes tdd dedicated configuration for nr
|
||||||
|
|||||||
@@ -656,7 +656,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
reset_DLSCH_struct(gNB, &msgDataTx);
|
reset_DLSCH_struct(gNB, &msgDataTx);
|
||||||
|
|
||||||
int nb_slots_to_set = TDD_CONFIG_NB_FRAMES * (1 << mu) * NR_NUMBER_OF_SUBFRAMES_PER_FRAME;
|
int nb_slots_to_set = (1 << mu) * NR_NUMBER_OF_SUBFRAMES_PER_FRAME;
|
||||||
for (int i = 0; i < nb_slots_to_set; ++i)
|
for (int i = 0; i < nb_slots_to_set; ++i)
|
||||||
free(gNB->gNB_config.tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list);
|
free(gNB->gNB_config.tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list);
|
||||||
free(gNB->gNB_config.tdd_table.max_tdd_periodicity_list);
|
free(gNB->gNB_config.tdd_table.max_tdd_periodicity_list);
|
||||||
|
|||||||
@@ -782,7 +782,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
free_channel_desc_scm(gNB2UE);
|
free_channel_desc_scm(gNB2UE);
|
||||||
|
|
||||||
int nb_slots_to_set = TDD_CONFIG_NB_FRAMES * (1 << mu) * NR_NUMBER_OF_SUBFRAMES_PER_FRAME;
|
int nb_slots_to_set = (1 << mu) * NR_NUMBER_OF_SUBFRAMES_PER_FRAME;
|
||||||
for (int i = 0; i < nb_slots_to_set; ++i)
|
for (int i = 0; i < nb_slots_to_set; ++i)
|
||||||
free(gNB->gNB_config.tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list);
|
free(gNB->gNB_config.tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list);
|
||||||
free(gNB->gNB_config.tdd_table.max_tdd_periodicity_list);
|
free(gNB->gNB_config.tdd_table.max_tdd_periodicity_list);
|
||||||
|
|||||||
@@ -825,7 +825,7 @@ int main(int argc, char **argv){
|
|||||||
|
|
||||||
phy_free_nr_gNB(gNB);
|
phy_free_nr_gNB(gNB);
|
||||||
// allocated in set_tdd_config_nr()
|
// allocated in set_tdd_config_nr()
|
||||||
int nb_slots_to_set = TDD_CONFIG_NB_FRAMES*(1<<mu)*NR_NUMBER_OF_SUBFRAMES_PER_FRAME;
|
int nb_slots_to_set = (1<<mu)*NR_NUMBER_OF_SUBFRAMES_PER_FRAME;
|
||||||
free(gNB->gNB_config.prach_config.num_prach_fd_occasions_list);
|
free(gNB->gNB_config.prach_config.num_prach_fd_occasions_list);
|
||||||
for (int i = 0; i < nb_slots_to_set; ++i)
|
for (int i = 0; i < nb_slots_to_set; ++i)
|
||||||
free(gNB->gNB_config.tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list);
|
free(gNB->gNB_config.tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list);
|
||||||
|
|||||||
@@ -762,7 +762,7 @@ int main(int argc, char **argv)
|
|||||||
free_channel_desc_scm(UE2gNB);
|
free_channel_desc_scm(UE2gNB);
|
||||||
term_freq_channel();
|
term_freq_channel();
|
||||||
|
|
||||||
int nb_slots_to_set = TDD_CONFIG_NB_FRAMES * (1 << mu) * NR_NUMBER_OF_SUBFRAMES_PER_FRAME;
|
int nb_slots_to_set = (1 << mu) * NR_NUMBER_OF_SUBFRAMES_PER_FRAME;
|
||||||
for (int i = 0; i < nb_slots_to_set; ++i)
|
for (int i = 0; i < nb_slots_to_set; ++i)
|
||||||
free(gNB->gNB_config.tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list);
|
free(gNB->gNB_config.tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list);
|
||||||
free(gNB->gNB_config.tdd_table.max_tdd_periodicity_list);
|
free(gNB->gNB_config.tdd_table.max_tdd_periodicity_list);
|
||||||
|
|||||||
@@ -598,7 +598,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
free_nr_ue_ul_harq(UE->ul_harq_processes, NR_MAX_ULSCH_HARQ_PROCESSES, UE->frame_parms.N_RB_UL, UE->frame_parms.nb_antennas_tx);
|
free_nr_ue_ul_harq(UE->ul_harq_processes, NR_MAX_ULSCH_HARQ_PROCESSES, UE->frame_parms.N_RB_UL, UE->frame_parms.nb_antennas_tx);
|
||||||
|
|
||||||
int nb_slots_to_set = TDD_CONFIG_NB_FRAMES * (1 << mu) * NR_NUMBER_OF_SUBFRAMES_PER_FRAME;
|
int nb_slots_to_set = (1 << mu) * NR_NUMBER_OF_SUBFRAMES_PER_FRAME;
|
||||||
for (int i = 0; i < nb_slots_to_set; ++i)
|
for (int i = 0; i < nb_slots_to_set; ++i)
|
||||||
free(gNB->gNB_config.tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list);
|
free(gNB->gNB_config.tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list);
|
||||||
free(gNB->gNB_config.tdd_table.max_tdd_periodicity_list);
|
free(gNB->gNB_config.tdd_table.max_tdd_periodicity_list);
|
||||||
|
|||||||
@@ -54,9 +54,9 @@ void display_frame_configuration(NR_DL_FRAME_PARMS *frame_parms) {
|
|||||||
printf("\nTdd configuration tti %d downlink %d uplink %d period %d \n", frame_parms->slots_per_subframe, frame_parms->p_tdd_UL_DL_Configuration->nrofDownlinkSlots,
|
printf("\nTdd configuration tti %d downlink %d uplink %d period %d \n", frame_parms->slots_per_subframe, frame_parms->p_tdd_UL_DL_Configuration->nrofDownlinkSlots,
|
||||||
frame_parms->p_tdd_UL_DL_Configuration->nrofUplinkSlots, frame_parms->p_tdd_UL_DL_Configuration->dl_UL_TransmissionPeriodicity);
|
frame_parms->p_tdd_UL_DL_Configuration->nrofUplinkSlots, frame_parms->p_tdd_UL_DL_Configuration->dl_UL_TransmissionPeriodicity);
|
||||||
|
|
||||||
int k = (TDD_CONFIG_NB_FRAMES * NR_NUMBER_OF_SUBFRAMES_PER_FRAME) - 1; //19;
|
int k = NR_NUMBER_OF_SUBFRAMES_PER_FRAME - 1;
|
||||||
int tti = 0;
|
int tti = 0;
|
||||||
for (int j = 0; j < TDD_CONFIG_NB_FRAMES * frame_parms->slots_per_frame; j++) {
|
for (int j = 0; j < frame_parms->slots_per_frame; j++) {
|
||||||
int frame = 0;
|
int frame = 0;
|
||||||
if (j != 0) {
|
if (j != 0) {
|
||||||
frame = j / frame_parms->slots_per_frame;
|
frame = j / frame_parms->slots_per_frame;
|
||||||
@@ -81,7 +81,7 @@ void display_frame_configuration(NR_DL_FRAME_PARMS *frame_parms) {
|
|||||||
}
|
}
|
||||||
if (j == k) {
|
if (j == k) {
|
||||||
printf("\n");
|
printf("\n");
|
||||||
k += (TDD_CONFIG_NB_FRAMES * NR_NUMBER_OF_SUBFRAMES_PER_FRAME); // 20
|
k += NR_NUMBER_OF_SUBFRAMES_PER_FRAME;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ void sl_ue_mac_free(NR_UE_MAC_INST_t *mac)
|
|||||||
// @todo: maybe this should be done by phy
|
// @todo: maybe this should be done by phy
|
||||||
if (tdd_list) {
|
if (tdd_list) {
|
||||||
int mu = sl_config->sl_bwp_config.sl_scs;
|
int mu = sl_config->sl_bwp_config.sl_scs;
|
||||||
int nb_slots_to_set = TDD_CONFIG_NB_FRAMES*(1<<mu)*NR_NUMBER_OF_SUBFRAMES_PER_FRAME;
|
int nb_slots_to_set = (1 << mu) * NR_NUMBER_OF_SUBFRAMES_PER_FRAME;
|
||||||
for (int i=0; i<nb_slots_to_set; i++) {
|
for (int i=0; i<nb_slots_to_set; i++) {
|
||||||
free_and_zero(tdd_list[i].max_num_of_symbol_per_slot_list);
|
free_and_zero(tdd_list[i].max_num_of_symbol_per_slot_list);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user