harmonize the use of definition for number of symbols per slot (no need to have two of them)
This commit is contained in:
@@ -84,8 +84,8 @@ static inline const char *rnti_types(nr_rnti_type_t rr)
|
||||
|
||||
#define MU_SCS(m) (15 << m)
|
||||
#define MAX_GSCN_BAND 620 // n78 has the highest GSCN range of 619
|
||||
#define NR_NUMBER_OF_SYMBOLS_PER_SLOT 14
|
||||
#define NR_NUMBER_OF_SYMBOLS_PER_SLOT_EXTENDED_CP 12
|
||||
#define NR_SYMBOLS_PER_SLOT 14
|
||||
#define NR_SYMBOLS_PER_SLOT_EXTENDED_CP 12
|
||||
#define NR_MAX_NB_LAYERS 4 // 8
|
||||
#define NR_MAX_CSI_PORTS 12
|
||||
|
||||
|
||||
+1
-1
@@ -538,7 +538,7 @@ void tx_rf(RU_t *ru, int frame,int slot, uint64_t timestamp)
|
||||
if(slot_type == NR_MIXED_SLOT) {
|
||||
int txsymb = 0;
|
||||
|
||||
for(int symbol_count = 0; symbol_count<NR_NUMBER_OF_SYMBOLS_PER_SLOT; symbol_count++) {
|
||||
for(int symbol_count = 0; symbol_count < NR_SYMBOLS_PER_SLOT; symbol_count++) {
|
||||
if (cfg->tdd_table.max_tdd_periodicity_list[slot].max_num_of_symbol_per_slot_list[symbol_count].slot_config.value == 0)
|
||||
txsymb++;
|
||||
}
|
||||
|
||||
+1
-1
@@ -281,7 +281,7 @@ static int nr_ue_slot_select(const fapi_nr_config_request_t *cfg, int nr_slot)
|
||||
if (current_slot->max_num_of_symbol_per_slot_list[0].slot_config == 2)
|
||||
return NR_MIXED_SLOT;
|
||||
|
||||
for (int i = 1; i < NR_NUMBER_OF_SYMBOLS_PER_SLOT; i++) {
|
||||
for (int i = 1; i < NR_SYMBOLS_PER_SLOT; i++) {
|
||||
// if the 1st symbol is DL and any other is not, the slot is mixed
|
||||
if (current_slot->max_num_of_symbol_per_slot_list[i].slot_config != 0) {
|
||||
return NR_MIXED_SLOT;
|
||||
|
||||
@@ -435,8 +435,8 @@ void init_nr_transport(PHY_VARS_gNB *gNB)
|
||||
fp->slots_per_frame;
|
||||
int nb_ul_slots_period = 0;
|
||||
if (cfg->cell_config.frame_duplex_type.value) {
|
||||
for(int i=0; i<nb_slots_per_period; i++) {
|
||||
for(int j=0; j<NR_NUMBER_OF_SYMBOLS_PER_SLOT; j++) {
|
||||
for(int i = 0; i < nb_slots_per_period; i++) {
|
||||
for(int j = 0; j < NR_SYMBOLS_PER_SLOT; j++) {
|
||||
if(cfg->tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list[j].slot_config.value == 1) { // UL symbol
|
||||
nb_ul_slots_period++;
|
||||
break;
|
||||
|
||||
@@ -53,7 +53,7 @@ void nr_normal_prefix_mod(c16_t *txdataF,
|
||||
uint8_t nsymb,
|
||||
const NR_DL_FRAME_PARMS *frame_parms,
|
||||
uint32_t slot,
|
||||
bool was_symbol_used[NR_NUMBER_OF_SYMBOLS_PER_SLOT]);
|
||||
bool was_symbol_used[NR_SYMBOLS_PER_SLOT]);
|
||||
|
||||
void do_OFDM_mod(c16_t **txdataF, c16_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ void nr_ofdm_demod_and_rx_rotation(c16_t **rxdata,
|
||||
int slot,
|
||||
int slot_offsetF,
|
||||
enum nr_Link linktype,
|
||||
bool was_symbol_used[NR_NUMBER_OF_SYMBOLS_PER_SLOT]);
|
||||
bool was_symbol_used[NR_SYMBOLS_PER_SLOT]);
|
||||
|
||||
void perform_symbol_rotation(NR_DL_FRAME_PARMS *fp, double f0, c16_t *symbol_rotation);
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ void nr_normal_prefix_mod(c16_t *txdataF,
|
||||
uint8_t nsymb,
|
||||
const NR_DL_FRAME_PARMS *frame_parms,
|
||||
uint32_t slot,
|
||||
bool was_symbol_used[NR_NUMBER_OF_SYMBOLS_PER_SLOT])
|
||||
bool was_symbol_used[NR_SYMBOLS_PER_SLOT])
|
||||
{
|
||||
// This function works only slot wise. For more generic symbol generation refer nr_feptx0()
|
||||
if (frame_parms->numerology_index != 0) { // case where numerology != 0
|
||||
|
||||
@@ -227,7 +227,7 @@ void nr_ofdm_demod_and_rx_rotation(c16_t **rxdata,
|
||||
int slot,
|
||||
int slot_offsetF,
|
||||
enum nr_Link linktype,
|
||||
bool was_symbol_used[NR_NUMBER_OF_SYMBOLS_PER_SLOT])
|
||||
bool was_symbol_used[NR_SYMBOLS_PER_SLOT])
|
||||
{
|
||||
for (int aa = 0; aa < nb_antennas; aa++) {
|
||||
for (uint8_t symbol = 0; symbol < fp->symbols_per_slot; symbol++) {
|
||||
|
||||
@@ -105,7 +105,7 @@ prach_item_t *nr_schedule_rx_prach(PHY_VARS_gNB *gNB, int SFN, int Slot, nfapi_n
|
||||
fapi_beam_idx,
|
||||
&gNB->common_vars,
|
||||
Slot,
|
||||
NR_NUMBER_OF_SYMBOLS_PER_SLOT,
|
||||
NR_SYMBOLS_PER_SLOT,
|
||||
bitmap);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ void nr_fill_ulsch(PHY_VARS_gNB *gNB, int frame, int slot, nfapi_nr_pusch_pdu_t
|
||||
fapi_beam_idx,
|
||||
&gNB->common_vars,
|
||||
slot,
|
||||
NR_NUMBER_OF_SYMBOLS_PER_SLOT,
|
||||
NR_SYMBOLS_PER_SLOT,
|
||||
bitmap);
|
||||
}
|
||||
ulsch->frame = frame;
|
||||
|
||||
@@ -73,7 +73,7 @@ void nr_fill_pucch(PHY_VARS_gNB *gNB, int frame, int slot, nfapi_nr_pucch_pdu_t
|
||||
fapi_beam_idx,
|
||||
&gNB->common_vars,
|
||||
slot,
|
||||
NR_NUMBER_OF_SYMBOLS_PER_SLOT,
|
||||
NR_SYMBOLS_PER_SLOT,
|
||||
bitmap);
|
||||
}
|
||||
memcpy((void *)&pucch->pucch_pdu, (void *)pucch_pdu, sizeof(nfapi_nr_pucch_pdu_t));
|
||||
@@ -1069,7 +1069,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
|
||||
// first compute DMRS component
|
||||
const int scramble = pucch_pdu->dmrs_scrambling_id * 2;
|
||||
uint32_t x2 =
|
||||
((1ULL << 17) * ((NR_NUMBER_OF_SYMBOLS_PER_SLOT * slot + pucch_pdu->start_symbol_index + symb + 1) * (scramble + 1))
|
||||
((1ULL << 17) * ((NR_SYMBOLS_PER_SLOT * slot + pucch_pdu->start_symbol_index + symb + 1) * (scramble + 1))
|
||||
+ scramble)
|
||||
% (1U << 31); // c_init calculation according to TS38.211 subclause
|
||||
#ifdef DEBUG_NR_PUCCH_RX
|
||||
|
||||
@@ -63,7 +63,7 @@ void nr_fill_srs(PHY_VARS_gNB *gNB, frame_t frame, slot_t slot, nfapi_nr_srs_pdu
|
||||
fapi_beam_idx,
|
||||
&gNB->common_vars,
|
||||
slot,
|
||||
NR_NUMBER_OF_SYMBOLS_PER_SLOT,
|
||||
NR_SYMBOLS_PER_SLOT,
|
||||
bitmap);
|
||||
}
|
||||
memcpy((void *)&srs->srs_pdu, (void *)srs_pdu, sizeof(nfapi_nr_srs_pdu_t));
|
||||
|
||||
@@ -162,7 +162,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
const uint8_t slot,
|
||||
nr_phy_data_tx_t *phy_data,
|
||||
c16_t **txdataF,
|
||||
bool was_symbol_used[NR_NUMBER_OF_SYMBOLS_PER_SLOT]);
|
||||
bool was_symbol_used[NR_SYMBOLS_PER_SLOT]);
|
||||
|
||||
/** \brief This function does IFFT for PUSCH
|
||||
*/
|
||||
@@ -173,14 +173,14 @@ uint8_t nr_tx_rotation_and_ofdm_mod(const uint8_t slot,
|
||||
c16_t **txdataF,
|
||||
c16_t **txdata,
|
||||
uint32_t linktype,
|
||||
bool was_symbol_used[NR_NUMBER_OF_SYMBOLS_PER_SLOT],
|
||||
bool was_symbol_used[NR_SYMBOLS_PER_SLOT],
|
||||
bool no_phase_pre_comp);
|
||||
|
||||
bool ue_srs_procedures_nr(PHY_VARS_NR_UE *ue,
|
||||
const UE_nr_rxtx_proc_t *proc,
|
||||
c16_t **txdataF,
|
||||
nr_phy_data_tx_t *phy_data,
|
||||
bool was_symbol_used[NR_NUMBER_OF_SYMBOLS_PER_SLOT]);
|
||||
bool was_symbol_used[NR_SYMBOLS_PER_SLOT]);
|
||||
|
||||
void clean_UE_harq(PHY_VARS_NR_UE *UE);
|
||||
|
||||
|
||||
@@ -1027,11 +1027,11 @@ static uci_on_pusch_bit_type_t *nr_data_control_mapping(const nfapi_nr_ue_pusch_
|
||||
if (!pusch_pdu || !codeword || codeword_len == 0 || !template)
|
||||
return NULL;
|
||||
const uint8_t n_symbols = pusch_pdu->nr_of_symbols;
|
||||
if (n_symbols == 0 || n_symbols > NR_NUMBER_OF_SYMBOLS_PER_SLOT)
|
||||
if (n_symbols == 0 || n_symbols > NR_SYMBOLS_PER_SLOT)
|
||||
return NULL;
|
||||
|
||||
uint32_t m_ulsch_initial[NR_NUMBER_OF_SYMBOLS_PER_SLOT] = {0};
|
||||
uint32_t m_uci_current[NR_NUMBER_OF_SYMBOLS_PER_SLOT] = {0}; // This holds RE counts, not bit counts
|
||||
uint32_t m_ulsch_initial[NR_SYMBOLS_PER_SLOT] = {0};
|
||||
uint32_t m_uci_current[NR_SYMBOLS_PER_SLOT] = {0}; // This holds RE counts, not bit counts
|
||||
|
||||
if (initialize_mapping_resources(pusch_pdu, m_ulsch_initial, m_uci_current) != 0) {
|
||||
LOG_E(PHY, "Failed to initialize mapping resources\n");
|
||||
@@ -1048,8 +1048,8 @@ static uci_on_pusch_bit_type_t *nr_data_control_mapping(const nfapi_nr_ue_pusch_
|
||||
|
||||
memset(template, 0, codeword_len * sizeof(uci_on_pusch_bit_type_t));
|
||||
|
||||
uint32_t positions_by_sym[NR_NUMBER_OF_SYMBOLS_PER_SLOT][MAX_UCI_CODED_BITS] = {0};
|
||||
uint32_t count_by_sym[NR_NUMBER_OF_SYMBOLS_PER_SLOT] = {0};
|
||||
uint32_t positions_by_sym[NR_SYMBOLS_PER_SLOT][MAX_UCI_CODED_BITS] = {0};
|
||||
uint32_t count_by_sym[NR_SYMBOLS_PER_SLOT] = {0};
|
||||
|
||||
struct map_uci_common_arg map_arg = {.template = template,
|
||||
.n_symbols = pusch_pdu->nr_of_symbols,
|
||||
@@ -1094,7 +1094,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
const uint8_t slot,
|
||||
nr_phy_data_tx_t *phy_data,
|
||||
c16_t **txdataF,
|
||||
bool was_symbol_used[NR_NUMBER_OF_SYMBOLS_PER_SLOT])
|
||||
bool was_symbol_used[NR_SYMBOLS_PER_SLOT])
|
||||
{
|
||||
|
||||
int harq_pid = phy_data->ulsch.pusch_pdu.pusch_data.harq_process_id;
|
||||
@@ -1609,13 +1609,13 @@ uint8_t nr_tx_rotation_and_ofdm_mod(const uint8_t slot,
|
||||
c16_t **txdataF,
|
||||
c16_t **txdata,
|
||||
uint32_t linktype,
|
||||
bool was_symbol_used[NR_NUMBER_OF_SYMBOLS_PER_SLOT],
|
||||
bool was_symbol_used[NR_SYMBOLS_PER_SLOT],
|
||||
bool no_phase_pre_comp)
|
||||
{
|
||||
int N_RB = (linktype == link_type_sl) ? frame_parms->N_RB_SL : frame_parms->N_RB_UL;
|
||||
|
||||
if (!no_phase_pre_comp) {
|
||||
for (int i = 0; i < NR_NUMBER_OF_SYMBOLS_PER_SLOT; i++) {
|
||||
for (int i = 0; i < NR_SYMBOLS_PER_SLOT; i++) {
|
||||
if (was_symbol_used[i] == false)
|
||||
continue;
|
||||
for (int ap = 0; ap < n_antenna_ports; ap++) {
|
||||
@@ -1626,7 +1626,7 @@ uint8_t nr_tx_rotation_and_ofdm_mod(const uint8_t slot,
|
||||
|
||||
for (int ap = 0; ap < n_antenna_ports; ap++) {
|
||||
if (frame_parms->Ncp == 1) { // extended cyclic prefix
|
||||
for (int i = 0; i < NR_NUMBER_OF_SYMBOLS_PER_SLOT_EXTENDED_CP; i++) {
|
||||
for (int i = 0; i < NR_SYMBOLS_PER_SLOT_EXTENDED_CP; i++) {
|
||||
if (was_symbol_used[i] == false) {
|
||||
memset(&txdata[ap][(frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples) * i],
|
||||
0,
|
||||
@@ -1641,7 +1641,7 @@ uint8_t nr_tx_rotation_and_ofdm_mod(const uint8_t slot,
|
||||
CYCLIC_PREFIX);
|
||||
}
|
||||
} else { // normal cyclic prefix
|
||||
nr_normal_prefix_mod(txdataF[ap], txdata[ap], NR_NUMBER_OF_SYMBOLS_PER_SLOT, frame_parms, slot, was_symbol_used);
|
||||
nr_normal_prefix_mod(txdataF[ap], txdata[ap], NR_SYMBOLS_PER_SLOT, frame_parms, slot, was_symbol_used);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,8 +42,6 @@
|
||||
#define MAX_NUM_SUBCARRIER_SPACING 5
|
||||
#define NR_MAX_OFDM_SYMBOL_SIZE 8192
|
||||
|
||||
#define NR_SYMBOLS_PER_SLOT NR_NUMBER_OF_SYMBOLS_PER_SLOT
|
||||
|
||||
#define ONE_OVER_SQRT2_Q15 23170
|
||||
|
||||
#define NR_MOD_TABLE_SIZE_SHORT 686
|
||||
|
||||
@@ -157,7 +157,7 @@ void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx)
|
||||
if (nr_slot_select(cfg,frame_tx,slot) == NR_UPLINK_SLOT)
|
||||
return;
|
||||
|
||||
nr_feptx0(ru,slot,0,NR_NUMBER_OF_SYMBOLS_PER_SLOT,aa);
|
||||
nr_feptx0(ru, slot, 0, NR_SYMBOLS_PER_SLOT, aa);
|
||||
|
||||
LOG_D(PHY,
|
||||
"feptx_ofdm (TXPATH): frame %d, slot %d: txp (time %p) %d dB, txp (freq) %d dB\n",
|
||||
|
||||
@@ -74,9 +74,8 @@ void set_tdd_config_nr(nfapi_nr_config_request_scf_t *cfg, frame_structure_t *fs
|
||||
cfg->tdd_table.max_tdd_periodicity_list = calloc_or_fail(nb_slots_to_set, sizeof(nfapi_nr_max_tdd_periodicity_t));
|
||||
for (int slot = 0; slot < nb_slots_to_set; slot++) {
|
||||
nfapi_nr_max_tdd_periodicity_t *p_list = &cfg->tdd_table.max_tdd_periodicity_list[slot];
|
||||
p_list->max_num_of_symbol_per_slot_list =
|
||||
calloc_or_fail(NR_NUMBER_OF_SYMBOLS_PER_SLOT, sizeof(*p_list->max_num_of_symbol_per_slot_list));
|
||||
for (int sym = 0; sym < NR_NUMBER_OF_SYMBOLS_PER_SLOT; sym++) {
|
||||
p_list->max_num_of_symbol_per_slot_list = calloc_or_fail(NR_SYMBOLS_PER_SLOT, sizeof(*p_list->max_num_of_symbol_per_slot_list));
|
||||
for (int sym = 0; sym < NR_SYMBOLS_PER_SLOT; sym++) {
|
||||
// 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;
|
||||
}
|
||||
@@ -89,9 +88,9 @@ void set_tdd_config_nr(nfapi_nr_config_request_scf_t *cfg, frame_structure_t *fs
|
||||
nfapi_nr_max_tdd_periodicity_t *list = &cfg->tdd_table.max_tdd_periodicity_list[slot_number];
|
||||
// FULL DOWNLINK SLOTS
|
||||
if (tdd_slot_bitmap[slot_index].slot_type == TDD_NR_DOWNLINK_SLOT) {
|
||||
for (int sym = 0; sym < NR_NUMBER_OF_SYMBOLS_PER_SLOT; sym++) {
|
||||
list->max_num_of_symbol_per_slot_list[sym % NR_NUMBER_OF_SYMBOLS_PER_SLOT].slot_config.value = 0;
|
||||
if ((sym + 1) % NR_NUMBER_OF_SYMBOLS_PER_SLOT == 0) {
|
||||
for (int sym = 0; sym < NR_SYMBOLS_PER_SLOT; sym++) {
|
||||
list->max_num_of_symbol_per_slot_list[sym % NR_SYMBOLS_PER_SLOT].slot_config.value = 0;
|
||||
if ((sym + 1) % NR_SYMBOLS_PER_SLOT == 0) {
|
||||
slot_number++;
|
||||
list += 1;
|
||||
}
|
||||
@@ -101,7 +100,7 @@ void set_tdd_config_nr(nfapi_nr_config_request_scf_t *cfg, frame_structure_t *fs
|
||||
if (tdd_slot_bitmap[slot_index].slot_type == TDD_NR_MIXED_SLOT) {
|
||||
int nrofDLSymbolsInSlot = tdd_slot_bitmap[slot_index].num_dl_symbols;
|
||||
int nrofULSymbolsInSlot = tdd_slot_bitmap[slot_index].num_ul_symbols;
|
||||
AssertFatal(nrofDLSymbolsInSlot + nrofULSymbolsInSlot < NR_NUMBER_OF_SYMBOLS_PER_SLOT,
|
||||
AssertFatal(nrofDLSymbolsInSlot + nrofULSymbolsInSlot < NR_SYMBOLS_PER_SLOT,
|
||||
"illegal symbol configuration DL %d, UL %d\n",
|
||||
nrofDLSymbolsInSlot,
|
||||
nrofULSymbolsInSlot);
|
||||
@@ -110,11 +109,11 @@ void set_tdd_config_nr(nfapi_nr_config_request_scf_t *cfg, frame_structure_t *fs
|
||||
list->max_num_of_symbol_per_slot_list[sym].slot_config.value = 0;
|
||||
}
|
||||
// Flexible Symbols
|
||||
for (int sym = nrofDLSymbolsInSlot; sym < NR_NUMBER_OF_SYMBOLS_PER_SLOT - nrofULSymbolsInSlot; sym++) {
|
||||
for (int sym = nrofDLSymbolsInSlot; sym < NR_SYMBOLS_PER_SLOT - nrofULSymbolsInSlot; sym++) {
|
||||
list->max_num_of_symbol_per_slot_list[sym].slot_config.value = 2;
|
||||
}
|
||||
// UL Symbols
|
||||
for (int sym = NR_NUMBER_OF_SYMBOLS_PER_SLOT - nrofULSymbolsInSlot; sym < NR_NUMBER_OF_SYMBOLS_PER_SLOT; sym++) {
|
||||
for (int sym = NR_SYMBOLS_PER_SLOT - nrofULSymbolsInSlot; sym < NR_SYMBOLS_PER_SLOT; sym++) {
|
||||
list->max_num_of_symbol_per_slot_list[sym].slot_config.value = 1;
|
||||
}
|
||||
slot_number++;
|
||||
@@ -122,9 +121,9 @@ void set_tdd_config_nr(nfapi_nr_config_request_scf_t *cfg, frame_structure_t *fs
|
||||
}
|
||||
// FULL UPLINK SLOTS
|
||||
if (tdd_slot_bitmap[slot_index].slot_type == TDD_NR_UPLINK_SLOT) {
|
||||
for (int sym = 0; sym < NR_NUMBER_OF_SYMBOLS_PER_SLOT; sym++) {
|
||||
list->max_num_of_symbol_per_slot_list[sym % NR_NUMBER_OF_SYMBOLS_PER_SLOT].slot_config.value = 1;
|
||||
if ((sym + 1) % NR_NUMBER_OF_SYMBOLS_PER_SLOT == 0) {
|
||||
for (int sym = 0; sym < NR_SYMBOLS_PER_SLOT; sym++) {
|
||||
list->max_num_of_symbol_per_slot_list[sym % NR_SYMBOLS_PER_SLOT].slot_config.value = 1;
|
||||
if ((sym + 1) % NR_SYMBOLS_PER_SLOT == 0) {
|
||||
slot_number++;
|
||||
list += 1;
|
||||
}
|
||||
@@ -134,14 +133,14 @@ void set_tdd_config_nr(nfapi_nr_config_request_scf_t *cfg, frame_structure_t *fs
|
||||
// Dump 1 period on the output
|
||||
for (int s = 0; s < fs->numb_slots_period; s++) {
|
||||
if (tdd_slot_bitmap[s].slot_type == TDD_NR_MIXED_SLOT) {
|
||||
char flexi_slot[NR_NUMBER_OF_SYMBOLS_PER_SLOT + 1];
|
||||
char flexi_slot[NR_SYMBOLS_PER_SLOT + 1];
|
||||
memset(flexi_slot, 0, sizeof(flexi_slot));
|
||||
for (int symb = 0; symb < NR_NUMBER_OF_SYMBOLS_PER_SLOT; symb++) {
|
||||
for (int symb = 0; symb < NR_SYMBOLS_PER_SLOT; symb++) {
|
||||
uint8_t val = cfg->tdd_table.max_tdd_periodicity_list[s].max_num_of_symbol_per_slot_list[symb].slot_config.value;
|
||||
char *symb_type_s[] = {"D", "U", "F"};
|
||||
flexi_slot[symb] = *symb_type_s[val];
|
||||
}
|
||||
flexi_slot[NR_NUMBER_OF_SYMBOLS_PER_SLOT] = '\0';
|
||||
flexi_slot[NR_SYMBOLS_PER_SLOT] = '\0';
|
||||
LOG_I(NR_PHY, "TDD period configuration: slot %d is FLEXIBLE: %s\n", s, flexi_slot);
|
||||
} else {
|
||||
LOG_I(NR_PHY,
|
||||
@@ -163,25 +162,25 @@ int nr_slot_select(const nfapi_nr_config_request_scf_t *cfg, int nr_frame, int n
|
||||
return (NR_UPLINK_SLOT | NR_DOWNLINK_SLOT);
|
||||
}
|
||||
|
||||
for (int symbol_count = 0; symbol_count < NR_NUMBER_OF_SYMBOLS_PER_SLOT; symbol_count++) {
|
||||
for (int symbol_count = 0; symbol_count < NR_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) {
|
||||
check_slot++;
|
||||
}
|
||||
}
|
||||
|
||||
if (check_slot == NR_NUMBER_OF_SYMBOLS_PER_SLOT) {
|
||||
if (check_slot == NR_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++) {
|
||||
for (int symbol_count = 0; symbol_count < NR_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) {
|
||||
if (check_slot == NR_SYMBOLS_PER_SLOT) {
|
||||
return (NR_DOWNLINK_SLOT);
|
||||
} else {
|
||||
return (NR_MIXED_SLOT);
|
||||
|
||||
@@ -993,7 +993,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, N
|
||||
|
||||
int first_symb = 0, num_symb = 0;
|
||||
if (frame_parms->frame_type == TDD)
|
||||
for (int symbol_count = 0; symbol_count < NR_NUMBER_OF_SYMBOLS_PER_SLOT; symbol_count++) {
|
||||
for (int symbol_count = 0; symbol_count < NR_SYMBOLS_PER_SLOT; symbol_count++) {
|
||||
if (slot_conf[symbol_count].slot_config.value == 1) {
|
||||
if (num_symb == 0)
|
||||
first_symb = symbol_count;
|
||||
@@ -1001,7 +1001,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, N
|
||||
}
|
||||
}
|
||||
else
|
||||
num_symb = NR_NUMBER_OF_SYMBOLS_PER_SLOT;
|
||||
num_symb = NR_SYMBOLS_PER_SLOT;
|
||||
gNB_I0_measurements(gNB, slot_rx, first_symb, num_symb, rb_mask_ul);
|
||||
}
|
||||
|
||||
|
||||
@@ -304,10 +304,10 @@ static void configure_srs_info(fapi_nr_ul_config_srs_pdu *srs_config_pdu, nr_srs
|
||||
*
|
||||
*********************************************************************/
|
||||
bool ue_srs_procedures_nr(PHY_VARS_NR_UE *ue,
|
||||
const UE_nr_rxtx_proc_t *proc,
|
||||
c16_t **txdataF,
|
||||
nr_phy_data_tx_t *phy_data,
|
||||
bool was_symbol_used[NR_NUMBER_OF_SYMBOLS_PER_SLOT])
|
||||
const UE_nr_rxtx_proc_t *proc,
|
||||
c16_t **txdataF,
|
||||
nr_phy_data_tx_t *phy_data,
|
||||
bool was_symbol_used[NR_SYMBOLS_PER_SLOT])
|
||||
{
|
||||
if(phy_data->srs_vars.active == false) {
|
||||
return false;
|
||||
@@ -383,7 +383,7 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, n
|
||||
txdataF[i] = &txdataF_buf[i * samplesF_per_slot];
|
||||
|
||||
LOG_D(PHY,"****** start TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, slot_tx);
|
||||
bool was_symbol_used[NR_NUMBER_OF_SYMBOLS_PER_SLOT] = {0};
|
||||
bool was_symbol_used[NR_SYMBOLS_PER_SLOT] = {0};
|
||||
|
||||
start_meas_nr_ue_phy(ue, PHY_PROC_TX);
|
||||
|
||||
|
||||
@@ -300,7 +300,7 @@ void phy_procedures_nrUE_SL_TX(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc
|
||||
tx_action = 1;
|
||||
}
|
||||
|
||||
bool was_symbol_used[NR_NUMBER_OF_SYMBOLS_PER_SLOT];
|
||||
bool was_symbol_used[NR_SYMBOLS_PER_SLOT];
|
||||
for (int i = 0; i < 14; i++)
|
||||
was_symbol_used[i] = true;
|
||||
if (tx_action) {
|
||||
|
||||
@@ -136,7 +136,7 @@ void pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue,
|
||||
const UE_nr_rxtx_proc_t *proc,
|
||||
nr_phy_data_tx_t *phy_data,
|
||||
c16_t **txdataF,
|
||||
bool was_symbol_used[NR_NUMBER_OF_SYMBOLS_PER_SLOT])
|
||||
bool was_symbol_used[NR_SYMBOLS_PER_SLOT])
|
||||
{
|
||||
const int nr_slot_tx = proc->nr_slot_tx;
|
||||
NR_UE_PUCCH *pucch_vars = &phy_data->pucch_vars;
|
||||
|
||||
@@ -1152,7 +1152,7 @@ int main(int argc, char **argv)
|
||||
frame_parms->nb_prefix_samples,
|
||||
CYCLIC_PREFIX);
|
||||
} else {
|
||||
bool was_symbol_used[NR_NUMBER_OF_SYMBOLS_PER_SLOT];
|
||||
bool was_symbol_used[NR_SYMBOLS_PER_SLOT];
|
||||
for (int i = 0; i < 14; i++) {
|
||||
was_symbol_used[i] = true;
|
||||
}
|
||||
|
||||
@@ -496,7 +496,7 @@ int main(int argc, char *argv[])
|
||||
proc.frame_tx = frame;
|
||||
proc.nr_slot_tx = slot;
|
||||
proc.nr_slot_rx = slot;
|
||||
bool was_symbol_used[NR_NUMBER_OF_SYMBOLS_PER_SLOT] = {0};
|
||||
bool was_symbol_used[NR_SYMBOLS_PER_SLOT] = {0};
|
||||
int slot_offset = get_samples_slot_timestamp(fp, slot);
|
||||
uint16_t ofdm_symbol_size = fp->ofdm_symbol_size;
|
||||
int slot_offsetF = (slot % RU_RX_SLOT_DEPTH) * fp->symbols_per_slot * ofdm_symbol_size;
|
||||
|
||||
@@ -96,28 +96,28 @@ static void set_tdd_config_nr_ue(fapi_nr_tdd_table_t *tdd_table, const frame_str
|
||||
for (int i = 0; i < fs->numb_slots_period; i++) {
|
||||
fapi_nr_max_tdd_periodicity_t *period_list = &tdd_table->max_tdd_periodicity_list[i];
|
||||
period_list->max_num_of_symbol_per_slot_list =
|
||||
malloc(NR_NUMBER_OF_SYMBOLS_PER_SLOT * sizeof(*period_list->max_num_of_symbol_per_slot_list));
|
||||
malloc(NR_SYMBOLS_PER_SLOT * sizeof(*period_list->max_num_of_symbol_per_slot_list));
|
||||
if (pc->tdd_slot_bitmap[i].slot_type == TDD_NR_DOWNLINK_SLOT) {
|
||||
for (int s = 0; s < NR_NUMBER_OF_SYMBOLS_PER_SLOT; s++) {
|
||||
for (int s = 0; s < NR_SYMBOLS_PER_SLOT; s++) {
|
||||
period_list->max_num_of_symbol_per_slot_list[s].slot_config = 0;
|
||||
}
|
||||
}
|
||||
if (pc->tdd_slot_bitmap[i].slot_type == TDD_NR_UPLINK_SLOT) {
|
||||
for (int s = 0; s < NR_NUMBER_OF_SYMBOLS_PER_SLOT; s++) {
|
||||
for (int s = 0; s < NR_SYMBOLS_PER_SLOT; s++) {
|
||||
period_list->max_num_of_symbol_per_slot_list[s].slot_config = 1;
|
||||
}
|
||||
}
|
||||
if (pc->tdd_slot_bitmap[i].slot_type == TDD_NR_MIXED_SLOT) {
|
||||
int dl_symb = pc->tdd_slot_bitmap[i].num_dl_symbols;
|
||||
int ul_symb = pc->tdd_slot_bitmap[i].num_ul_symbols;
|
||||
int g_symb = NR_NUMBER_OF_SYMBOLS_PER_SLOT - dl_symb - ul_symb;
|
||||
int g_symb = NR_SYMBOLS_PER_SLOT - dl_symb - ul_symb;
|
||||
for (int s = 0; s < dl_symb; s++) {
|
||||
period_list->max_num_of_symbol_per_slot_list[s].slot_config = 0;
|
||||
}
|
||||
for (int s = dl_symb; s < dl_symb + g_symb; s++) {
|
||||
period_list->max_num_of_symbol_per_slot_list[s].slot_config = 2;
|
||||
}
|
||||
for (int s = dl_symb + g_symb; s < NR_NUMBER_OF_SYMBOLS_PER_SLOT; s++) {
|
||||
for (int s = dl_symb + g_symb; s < NR_SYMBOLS_PER_SLOT; s++) {
|
||||
period_list->max_num_of_symbol_per_slot_list[s].slot_config = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,19 +77,19 @@ void sl_set_tdd_config_nr_ue(fapi_nr_tdd_table_t *tdd_table,
|
||||
|
||||
for(int memory_alloc = 0 ; memory_alloc < nb_slots_per_period; memory_alloc++)
|
||||
tdd_table->max_tdd_periodicity_list[memory_alloc].max_num_of_symbol_per_slot_list =
|
||||
(fapi_nr_max_num_of_symbol_per_slot_t *) malloc(NR_NUMBER_OF_SYMBOLS_PER_SLOT*sizeof(fapi_nr_max_num_of_symbol_per_slot_t));
|
||||
(fapi_nr_max_num_of_symbol_per_slot_t *) malloc(NR_SYMBOLS_PER_SLOT*sizeof(fapi_nr_max_num_of_symbol_per_slot_t));
|
||||
|
||||
int slot_number = (nb_slots_per_period - nrofUplinkSlots) - (nrofUplinkSymbols ? 1 : 0);
|
||||
if (nrofUplinkSymbols != 0) {
|
||||
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 number_of_symbol = NR_SYMBOLS_PER_SLOT - nrofUplinkSymbols; number_of_symbol < NR_SYMBOLS_PER_SLOT; number_of_symbol++) {
|
||||
tdd_table->max_tdd_periodicity_list[slot_number].max_num_of_symbol_per_slot_list[number_of_symbol].slot_config = 1;
|
||||
}
|
||||
slot_number++;
|
||||
}
|
||||
while(slot_number < nb_slots_per_period) {
|
||||
for (int number_of_symbol = 0; number_of_symbol < nrofUplinkSlots * NR_NUMBER_OF_SYMBOLS_PER_SLOT; number_of_symbol++) {
|
||||
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 = 1;
|
||||
if((number_of_symbol + 1) % NR_NUMBER_OF_SYMBOLS_PER_SLOT == 0)
|
||||
for (int number_of_symbol = 0; number_of_symbol < nrofUplinkSlots * NR_SYMBOLS_PER_SLOT; number_of_symbol++) {
|
||||
tdd_table->max_tdd_periodicity_list[slot_number].max_num_of_symbol_per_slot_list[number_of_symbol%NR_SYMBOLS_PER_SLOT].slot_config = 1;
|
||||
if((number_of_symbol + 1) % NR_SYMBOLS_PER_SLOT == 0)
|
||||
slot_number++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -425,8 +425,8 @@ static bool check_mixed_slot_prach(frame_structure_t *fs, int slot, int start_pr
|
||||
tdd_bitmap_t *bitmap = &fs->period_cfg.tdd_slot_bitmap[slot % fs->numb_slots_period];
|
||||
if (bitmap->num_ul_symbols == 0)
|
||||
return false;
|
||||
int ul_end = NR_NUMBER_OF_SYMBOLS_PER_SLOT - 1;
|
||||
int ul_start = NR_NUMBER_OF_SYMBOLS_PER_SLOT - bitmap->num_ul_symbols;
|
||||
int ul_end = NR_SYMBOLS_PER_SLOT - 1;
|
||||
int ul_start = NR_SYMBOLS_PER_SLOT - bitmap->num_ul_symbols;
|
||||
if (start_prach < ul_start || end_prach > ul_end)
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -63,9 +63,9 @@ static uint8_t sl_get_elapsed_slots(uint32_t slot, uint32_t sl_slot_bitmap)
|
||||
*/
|
||||
static uint8_t sl_determine_if_sidelink_slot(uint8_t sl_startsym, uint8_t sl_lensym, uint8_t num_ulsym)
|
||||
{
|
||||
uint8_t ul_startsym = NR_NUMBER_OF_SYMBOLS_PER_SLOT - num_ulsym;
|
||||
uint8_t ul_startsym = NR_SYMBOLS_PER_SLOT - num_ulsym;
|
||||
|
||||
if ((sl_startsym >= ul_startsym) && (sl_lensym <= NR_NUMBER_OF_SYMBOLS_PER_SLOT)) {
|
||||
if ((sl_startsym >= ul_startsym) && (sl_lensym <= NR_SYMBOLS_PER_SLOT)) {
|
||||
LOG_D(MAC,
|
||||
"MIXED SLOT is a SIDELINK SLOT. Sidelink Symbols: %d-%d, Uplink Symbols: %d-%d\n",
|
||||
sl_startsym,
|
||||
@@ -107,13 +107,13 @@ int sl_nr_ue_slot_select(const sl_nr_phy_config_request_t *cfg, int slot, uint8_
|
||||
|
||||
const fapi_nr_max_tdd_periodicity_t *current_slot = &tdd_table->max_tdd_periodicity_list[rel_slot];
|
||||
|
||||
for (int symbol_count = 0; symbol_count < NR_NUMBER_OF_SYMBOLS_PER_SLOT; symbol_count++) {
|
||||
for (int symbol_count = 0; symbol_count < NR_SYMBOLS_PER_SLOT; symbol_count++) {
|
||||
if (current_slot->max_num_of_symbol_per_slot_list[symbol_count].slot_config == 1) {
|
||||
ul_sym++;
|
||||
}
|
||||
}
|
||||
|
||||
if (ul_sym == NR_NUMBER_OF_SYMBOLS_PER_SLOT) {
|
||||
if (ul_sym == NR_SYMBOLS_PER_SLOT) {
|
||||
slot_type = NR_SIDELINK_SLOT;
|
||||
} else if (ul_sym) {
|
||||
slot_type = sl_determine_if_sidelink_slot(cfg->sl_bwp_config.sl_start_symbol, cfg->sl_bwp_config.sl_num_symbols, ul_sym);
|
||||
|
||||
@@ -1024,7 +1024,7 @@ static bool get_feasible_msg3_tda(const NR_ServingCellConfigCommon_t *scc,
|
||||
int s = get_slot_idx_in_period(temp_slot, fs);
|
||||
const tdd_bitmap_t *bm = &fs->period_cfg.tdd_slot_bitmap[s];
|
||||
bool is_mixed = is_mixed_slot(s, fs);
|
||||
uint16_t slot_mask = is_mixed ? SL_to_bitmap(NR_NUMBER_OF_SYMBOLS_PER_SLOT - bm->num_ul_symbols, bm->num_ul_symbols) : 0x3fff;
|
||||
uint16_t slot_mask = is_mixed ? SL_to_bitmap(NR_SYMBOLS_PER_SLOT - bm->num_ul_symbols, bm->num_ul_symbols) : 0x3fff;
|
||||
long startSymbolAndLength = tda_list->list.array[i]->startSymbolAndLength;
|
||||
int start, nr;
|
||||
SLIV2SL(startSymbolAndLength, &start, &nr);
|
||||
|
||||
@@ -101,7 +101,7 @@ static void fill_ssb_vrb_map(NR_COMMON_channels_t *cc,
|
||||
uint16_t *vrb_map = cc[CC_id].vrb_map[beam];
|
||||
const int extra_prb = ssb_subcarrier_offset > 0;
|
||||
for (int rb = 0; rb < 20 + extra_prb; rb++)
|
||||
vrb_map[rbStart + rb] = SL_to_bitmap(symStart % NR_NUMBER_OF_SYMBOLS_PER_SLOT, 4);
|
||||
vrb_map[rbStart + rb] = SL_to_bitmap(symStart % NR_SYMBOLS_PER_SLOT, 4);
|
||||
}
|
||||
|
||||
static int encode_mib(NR_BCCH_BCH_Message_t *mib, frame_t frame, uint8_t *buffer, int buf_size)
|
||||
|
||||
@@ -104,7 +104,7 @@ void nr_preprocessor_phytest(gNB_MAC_INST *mac, post_process_pdsch_t *pp_pdsch)
|
||||
const long band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
|
||||
uint16_t ssb_start_symbol = get_ssb_start_symbol(band, scs, i_ssb);
|
||||
// select beam for PDSCH in current slot based on SSB beam
|
||||
if ((ssb_start_symbol / NR_NUMBER_OF_SYMBOLS_PER_SLOT) == (slot % mac->frame_structure.numb_slots_period)) {
|
||||
if ((ssb_start_symbol / NR_SYMBOLS_PER_SLOT) == (slot % mac->frame_structure.numb_slots_period)) {
|
||||
ssb_idx_beam = i_ssb;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -479,7 +479,7 @@ static void nr_configure_srs(gNB_MAC_INST *nrmac,
|
||||
AssertFatal(beam.idx >= 0, "Cannot allocate SRS in any available beam\n");
|
||||
uint16_t *vrb_map_UL = &nrmac->common_channels[CC_id].vrb_map_UL[beam.idx][buffer_index * MAX_BWP_SIZE];
|
||||
uint16_t num = 1 << srs_pdu->num_symbols; // 0,1,2 means 1,2,4 symbols, see 222.10.04 table 3-105
|
||||
const uint8_t l0 = NR_NUMBER_OF_SYMBOLS_PER_SLOT - 1 - srs_pdu->time_start_position;
|
||||
const uint8_t l0 = NR_SYMBOLS_PER_SLOT - 1 - srs_pdu->time_start_position;
|
||||
uint16_t mask = SL_to_bitmap(l0, num);
|
||||
DevAssert(mask != 0);
|
||||
for (int i = 0; i < srs_pdu->bwp_size; ++i) {
|
||||
|
||||
@@ -1145,7 +1145,7 @@ void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay, i
|
||||
int nb_slots_per_period = ((1 << mu) * 10) / nb_periods_per_frame;
|
||||
|
||||
// make TDA for the mixed slot
|
||||
long mixed_sliv = get_SLIV(NR_NUMBER_OF_SYMBOLS_PER_SLOT - ul_symb, ul_symb - 1);
|
||||
long mixed_sliv = get_SLIV(NR_SYMBOLS_PER_SLOT - ul_symb, ul_symb - 1);
|
||||
int mixed_min_ul_symb = 3; // need at least two symbols PUSCH + PUCCH
|
||||
bool has_ul_mixed = ul_symb >= mixed_min_ul_symb;
|
||||
if (has_ul_mixed && (k2 <= N_dl1 || (p2 && N_ul2 == 0))) {
|
||||
|
||||
@@ -252,9 +252,9 @@ static bool check_srs_config(NR_SRS_Config_t *srs_Config)
|
||||
if (srs_Config->srs_ResourceToAddModList) {
|
||||
for (int i = 0; i < srs_Config->srs_ResourceToAddModList->list.count; i++) {
|
||||
NR_SRS_Resource_t *res = srs_Config->srs_ResourceToAddModList->list.array[i];
|
||||
int start = NR_NUMBER_OF_SYMBOLS_PER_SLOT - res->resourceMapping.startPosition - 1;
|
||||
int start = NR_SYMBOLS_PER_SLOT - res->resourceMapping.startPosition - 1;
|
||||
int num = 1 << res->resourceMapping.nrofSymbols;
|
||||
if (start + num > NR_NUMBER_OF_SYMBOLS_PER_SLOT) {
|
||||
if (start + num > NR_SYMBOLS_PER_SLOT) {
|
||||
LOG_E(NR_RRC, "The configured SRS resource exceeds the slot boundary\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user