reduce the use of NR_SYMBOLS_PER_SLOT in favor of the value in frame_parms
This commit is contained in:
+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_SYMBOLS_PER_SLOT; symbol_count++) {
|
||||
for(int symbol_count = 0; symbol_count < fp->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++;
|
||||
}
|
||||
|
||||
@@ -436,7 +436,7 @@ void init_nr_transport(PHY_VARS_gNB *gNB)
|
||||
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_SYMBOLS_PER_SLOT; j++) {
|
||||
for(int j = 0; j < fp->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;
|
||||
|
||||
@@ -409,7 +409,7 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp, fapi_nr_config_request_t* conf
|
||||
set_scs_parameters(fp, fp->numerology_index, N_RB, config->ssb_table.ssb_case);
|
||||
|
||||
fp->slots_per_frame = 10* fp->slots_per_subframe;
|
||||
fp->symbols_per_slot = ((Ncp == NR_NORMAL)? 14 : 12); // to redefine for different slot formats
|
||||
fp->symbols_per_slot = ((Ncp == NR_NORMAL)? NR_SYMBOLS_PER_SLOT : NR_SYMBOLS_PER_SLOT_EXTENDED_CP);
|
||||
fp->samples_per_subframe_wCP = fp->ofdm_symbol_size * fp->symbols_per_slot * fp->slots_per_subframe;
|
||||
fp->samples_per_frame_wCP = 10 * fp->samples_per_subframe_wCP;
|
||||
fp->samples_per_slot_wCP = fp->symbols_per_slot*fp->ofdm_symbol_size;
|
||||
@@ -469,7 +469,7 @@ void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, const nrUE_cell_p
|
||||
set_Lmax(frame_parms);
|
||||
|
||||
frame_parms->slots_per_frame = 10* frame_parms->slots_per_subframe;
|
||||
frame_parms->symbols_per_slot = ((frame_parms->Ncp == NR_NORMAL)? 14 : 12); // to redefine for different slot formats
|
||||
frame_parms->symbols_per_slot = ((frame_parms->Ncp == NR_NORMAL)? NR_SYMBOLS_PER_SLOT : NR_SYMBOLS_PER_SLOT_EXTENDED_CP);
|
||||
frame_parms->samples_per_subframe_wCP = frame_parms->ofdm_symbol_size * frame_parms->symbols_per_slot * frame_parms->slots_per_subframe;
|
||||
frame_parms->samples_per_frame_wCP = 10 * frame_parms->samples_per_subframe_wCP;
|
||||
frame_parms->samples_per_slot_wCP = frame_parms->symbols_per_slot*frame_parms->ofdm_symbol_size;
|
||||
@@ -570,7 +570,7 @@ int nr_init_frame_parms_ue_sl(NR_DL_FRAME_PARMS *fp,
|
||||
sl_set_scs_parameters(fp, fp->numerology_index, fp->N_RB_SL);
|
||||
|
||||
fp->slots_per_frame = 10 * fp->slots_per_subframe;
|
||||
fp->symbols_per_slot = ((fp->Ncp == NR_NORMAL) ? 14 : 12); // to redefine for different slot formats
|
||||
fp->symbols_per_slot = ((fp->Ncp == NR_NORMAL) ? NR_SYMBOLS_PER_SLOT : NR_SYMBOLS_PER_SLOT_EXTENDED_CP);
|
||||
fp->samples_per_subframe_wCP = fp->ofdm_symbol_size * fp->symbols_per_slot * fp->slots_per_subframe;
|
||||
fp->samples_per_frame_wCP = 10 * fp->samples_per_subframe_wCP;
|
||||
fp->samples_per_slot_wCP = fp->symbols_per_slot * fp->ofdm_symbol_size;
|
||||
|
||||
@@ -554,7 +554,7 @@ static int do_one_dlsch(unsigned char *input_ptr, PHY_VARS_gNB *gNB, NR_gNB_DLSC
|
||||
time_stats_t *dlsch_scrambling_stats = &gNB->dlsch_scrambling_stats;
|
||||
time_stats_t *dlsch_modulation_stats = &gNB->dlsch_modulation_stats;
|
||||
const nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &dlsch->pdsch_pdu->pdsch_pdu_rel15;
|
||||
const int layerSz = frame_parms->N_RB_DL * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB;
|
||||
const int layerSz = frame_parms->N_RB_DL * frame_parms->symbols_per_slot * NR_NB_SC_PER_RB;
|
||||
const int symbol_sz=frame_parms->ofdm_symbol_size;
|
||||
const int dmrs_Type = rel15->dmrsConfigType;
|
||||
const int nb_re_dmrs = rel15->numDmrsCdmGrpsNoData * (rel15->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4);
|
||||
@@ -765,7 +765,7 @@ static int do_one_dlsch(unsigned char *input_ptr, PHY_VARS_gNB *gNB, NR_gNB_DLSC
|
||||
/* output and its parts for each dlsch should be aligned on 64 bytes (or 8 * 64 bits)
|
||||
* should remain a multiple of 8 * 64 with enough offset to fit each dlsch
|
||||
*/
|
||||
uint32_t size_output_tb = rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * Qm * rel15->nrOfLayers;
|
||||
uint32_t size_output_tb = rel15->rbSize * frame_parms->symbols_per_slot * NR_NB_SC_PER_RB * Qm * rel15->nrOfLayers;
|
||||
return ((size_output_tb + 511) >> 9) << 6;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t *dlsch, uint16_t N_RB, const NR_DL_FRAME_PARM
|
||||
dlsch->b = NULL;
|
||||
}
|
||||
if (dlsch->f) {
|
||||
free16(dlsch->f, N_RB * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS);
|
||||
free16(dlsch->f, N_RB * frame_parms->symbols_per_slot * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS);
|
||||
dlsch->f = NULL;
|
||||
}
|
||||
for (int r = 0; r < a_segments; r++) {
|
||||
@@ -94,9 +94,9 @@ NR_gNB_DLSCH_t new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, uint16_t N_RB)
|
||||
bzero(dlsch.c[r], 8448);
|
||||
}
|
||||
|
||||
dlsch.f = malloc16(N_RB * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS);
|
||||
dlsch.f = malloc16(N_RB * frame_parms->symbols_per_slot * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS);
|
||||
AssertFatal(dlsch.f, "cannot allocate dlsch->f\n");
|
||||
bzero(dlsch.f, N_RB * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS);
|
||||
bzero(dlsch.f, N_RB * frame_parms->symbols_per_slot * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS);
|
||||
|
||||
return (dlsch);
|
||||
}
|
||||
@@ -262,7 +262,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
|
||||
/* output and its parts for each dlsch should be aligned on 64 bytes (or 8 * 64 bits)
|
||||
* => dlsch_offset should remain a multiple of 8 * 64 with enough offset to fit each dlsch
|
||||
*/
|
||||
const size_t dlsch_size = rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * rel15->qamModOrder[0] * rel15->nrOfLayers;
|
||||
const size_t dlsch_size = rel15->rbSize * gNB->frame_parms.symbols_per_slot * NR_NB_SC_PER_RB * rel15->qamModOrder[0] * rel15->nrOfLayers;
|
||||
dlsch_offset += ceil_mod(dlsch_size, 8 * 64);
|
||||
}
|
||||
|
||||
|
||||
@@ -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_SYMBOLS_PER_SLOT,
|
||||
gNB->frame_parms.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_SYMBOLS_PER_SLOT,
|
||||
gNB->frame_parms.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_SYMBOLS_PER_SLOT,
|
||||
gNB->frame_parms.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_SYMBOLS_PER_SLOT * slot + pucch_pdu->start_symbol_index + symb + 1) * (scramble + 1))
|
||||
((1ULL << 17) * ((frame_parms->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_SYMBOLS_PER_SLOT,
|
||||
gNB->frame_parms.symbols_per_slot,
|
||||
bitmap);
|
||||
}
|
||||
memcpy((void *)&srs->srs_pdu, (void *)srs_pdu, sizeof(nfapi_nr_srs_pdu_t));
|
||||
|
||||
@@ -330,7 +330,7 @@ static int nr_csi_rs_channel_estimation(
|
||||
}
|
||||
|
||||
#ifdef NR_CSIRS_DEBUG
|
||||
for(int symb = 0; symb < NR_SYMBOLS_PER_SLOT; symb++) {
|
||||
for(int symb = 0; symb < fp->symbols_per_slot; symb++) {
|
||||
if(!is_csi_rs_in_symbol(*csirs_config_pdu,symb)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -345,8 +345,7 @@ static void nr_rx_pdcch_symbol(PHY_VARS_NR_UE *ue,
|
||||
// generate pilot
|
||||
c16_t pilot[(n_rb + dmrs_ref) * 3] __attribute__((aligned(16)));
|
||||
// Note: pilot returned by the following function is already the complex conjugate of the transmitted DMRS
|
||||
const uint32_t *gold =
|
||||
nr_gold_pdcch(ue->frame_parms.N_RB_DL, ue->frame_parms.symbols_per_slot, scrambling_id, proc->nr_slot_rx, symbol);
|
||||
const uint32_t *gold = nr_gold_pdcch(fp->N_RB_DL, fp->symbols_per_slot, scrambling_id, proc->nr_slot_rx, symbol);
|
||||
nr_pdcch_dmrs_ref(gold, pilot, n_rb + dmrs_ref);
|
||||
nr_pdcch_channel_estimation(ue,
|
||||
n_rb,
|
||||
@@ -363,7 +362,7 @@ static void nr_rx_pdcch_symbol(PHY_VARS_NR_UE *ue,
|
||||
__attribute__((aligned(32))) c16_t rxdataF_ext[fp->nb_antennas_rx][rx_size];
|
||||
__attribute__((aligned(32))) c16_t pdcch_dl_ch_estimates_ext[fp->nb_antennas_rx][rx_size];
|
||||
|
||||
nr_pdcch_extract_rbs_single(ue->frame_parms.ofdm_symbol_size,
|
||||
nr_pdcch_extract_rbs_single(fp->ofdm_symbol_size,
|
||||
rxdataF,
|
||||
pdcch_est_size,
|
||||
pdcch_dl_ch_estimates,
|
||||
@@ -401,16 +400,18 @@ static void nr_rx_pdcch_symbol(PHY_VARS_NR_UE *ue,
|
||||
nr_pdcch_llr(llr_size_symbol, rxdataF_comp[0], llr);
|
||||
}
|
||||
|
||||
bool is_start_symbol_in_ss(const fapi_nr_dl_config_dci_dl_pdu_rel15_t *ss, const int symbol)
|
||||
static bool is_start_symbol_in_ss(const fapi_nr_dl_config_dci_dl_pdu_rel15_t *ss, const int symbol, const int nb_symb_slot)
|
||||
{
|
||||
return ((ss->coreset.StartSymbolBitmap >> (NR_SYMBOLS_PER_SLOT - 1 - symbol)) & 1);
|
||||
return ((ss->coreset.StartSymbolBitmap >> (nb_symb_slot - 1 - symbol)) & 1);
|
||||
}
|
||||
|
||||
int get_pdcch_mon_occasions_slot(const fapi_nr_dl_config_dci_dl_pdu_rel15_t *ss, uint8_t start_symb[NR_SYMBOLS_PER_SLOT])
|
||||
static int get_pdcch_mon_occasions_slot(const fapi_nr_dl_config_dci_dl_pdu_rel15_t *ss,
|
||||
int nb_symb_slot,
|
||||
uint8_t start_symb[nb_symb_slot])
|
||||
{
|
||||
int sum = 0;
|
||||
for (int s = 0; s < NR_SYMBOLS_PER_SLOT; s++) {
|
||||
if (is_start_symbol_in_ss(ss, s)) {
|
||||
for (int s = 0; s < nb_symb_slot; s++) {
|
||||
if (is_start_symbol_in_ss(ss, s, nb_symb_slot)) {
|
||||
if (start_symb != NULL)
|
||||
start_symb[sum] = s;
|
||||
sum++;
|
||||
@@ -420,22 +421,22 @@ int get_pdcch_mon_occasions_slot(const fapi_nr_dl_config_dci_dl_pdu_rel15_t *ss,
|
||||
return sum;
|
||||
}
|
||||
|
||||
int get_max_pdcch_monOcc(const NR_UE_PDCCH_CONFIG *phy_pdcch_config)
|
||||
int get_max_pdcch_monOcc(const NR_UE_PDCCH_CONFIG *phy_pdcch_config, int nb_symb_slot)
|
||||
{
|
||||
int monOcc = 0;
|
||||
for (int ss = 0; ss < phy_pdcch_config->nb_search_space; ss++) {
|
||||
monOcc = max(monOcc, get_pdcch_mon_occasions_slot(&phy_pdcch_config->pdcch_config[ss], NULL));
|
||||
monOcc = max(monOcc, get_pdcch_mon_occasions_slot(&phy_pdcch_config->pdcch_config[ss], nb_symb_slot, NULL));
|
||||
}
|
||||
return monOcc;
|
||||
}
|
||||
|
||||
void set_first_last_pdcch_symb(const NR_UE_PDCCH_CONFIG *phy_pdcch_config, int *first_symb, int *last_symb)
|
||||
void set_first_last_pdcch_symb(const NR_UE_PDCCH_CONFIG *phy_pdcch_config, int nb_symb_slot, int *first_symb, int *last_symb)
|
||||
{
|
||||
*first_symb = NR_SYMBOLS_PER_SLOT; // max first pdcch symbol
|
||||
*first_symb = nb_symb_slot; // max first pdcch symbol
|
||||
*last_symb = 0; // min last pdcch symbol
|
||||
for (int ss = 0; ss < phy_pdcch_config->nb_search_space; ss++) {
|
||||
for (int symb = 0; symb < NR_SYMBOLS_PER_SLOT; symb++) {
|
||||
if (is_start_symbol_in_ss(&phy_pdcch_config->pdcch_config[ss], symb)) {
|
||||
for (int symb = 0; symb < nb_symb_slot; symb++) {
|
||||
if (is_start_symbol_in_ss(&phy_pdcch_config->pdcch_config[ss], symb, nb_symb_slot)) {
|
||||
const int duration = phy_pdcch_config->pdcch_config[ss].coreset.duration;
|
||||
*first_symb = min(*first_symb, symb);
|
||||
*last_symb = max(*last_symb, symb + duration - 1);
|
||||
@@ -460,7 +461,9 @@ void nr_pdcch_generate_llr(PHY_VARS_NR_UE *ue,
|
||||
// Loop over search spaces
|
||||
for (int ss_idx = 0; ss_idx < phy_pdcch_config->nb_search_space; ss_idx++) {
|
||||
uint8_t start_symb[NR_SYMBOLS_PER_SLOT] = {0};
|
||||
const int num_monOcc = get_pdcch_mon_occasions_slot(&phy_pdcch_config->pdcch_config[ss_idx], start_symb);
|
||||
const int num_monOcc = get_pdcch_mon_occasions_slot(&phy_pdcch_config->pdcch_config[ss_idx],
|
||||
ue->frame_parms.symbols_per_slot,
|
||||
start_symb);
|
||||
// Loop over monitoring occations within the slot in this ss
|
||||
for (int occ = 0; occ < num_monOcc; occ++) {
|
||||
const int first_symb = start_symb[occ];
|
||||
@@ -609,7 +612,7 @@ void nr_pdcch_dci_indication(const UE_nr_rxtx_proc_t *proc,
|
||||
for (int ss_idx = 0; ss_idx < phy_pdcch_config->nb_search_space; ss_idx++) {
|
||||
fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15 = &phy_pdcch_config->pdcch_config[ss_idx];
|
||||
uint8_t unused_start_symb[NR_SYMBOLS_PER_SLOT] = {0};
|
||||
const int num_monitoring_occ = get_pdcch_mon_occasions_slot(rel15, unused_start_symb);
|
||||
const int num_monitoring_occ = get_pdcch_mon_occasions_slot(rel15, ue->frame_parms.symbols_per_slot, unused_start_symb);
|
||||
const int llr_stride = llr_size / rel15->coreset.duration;
|
||||
int n_rb, cset_start;
|
||||
get_coreset_rballoc(rel15->coreset.frequency_domain_resource, &n_rb, &cset_start);
|
||||
|
||||
@@ -701,7 +701,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
UEunlockScopeData(ue, pdschRxdataF_comp)
|
||||
}
|
||||
} else {
|
||||
UEscopeCopy(ue, pdschRxdataF_comp, rxdataF_comp[0], sizeof(c16_t), nbRx, rx_size_symbol * NR_SYMBOLS_PER_SLOT, 0);
|
||||
UEscopeCopy(ue, pdschRxdataF_comp, rxdataF_comp[0], sizeof(c16_t), nbRx, rx_size_symbol * fp->symbols_per_slot, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -69,11 +69,9 @@ typedef struct pdsch_scope_req_s {
|
||||
void nr_ue_dlsch_init(NR_UE_DLSCH_t *dlsch_list, int num_dlsch, uint8_t max_ldpc_iterations);
|
||||
void nr_conjch0_mult_ch1(c16_t *ch0, c16_t *ch1, c16_t *ch0conj_ch1, unsigned short nb_rb, unsigned char output_shift0);
|
||||
|
||||
void set_first_last_pdcch_symb(const NR_UE_PDCCH_CONFIG *phy_pdcch_config, int *first_symb, int *last_symb);
|
||||
void set_first_last_pdcch_symb(const NR_UE_PDCCH_CONFIG *phy_pdcch_config, int symb_slot, int *first_symb, int *last_symb);
|
||||
|
||||
int get_pdcch_mon_occasions_slot(const fapi_nr_dl_config_dci_dl_pdu_rel15_t *ss, uint8_t start_symb[NR_SYMBOLS_PER_SLOT]);
|
||||
|
||||
int get_max_pdcch_monOcc(const NR_UE_PDCCH_CONFIG *phy_pdcch_config);
|
||||
int get_max_pdcch_monOcc(const NR_UE_PDCCH_CONFIG *phy_pdcch_config, int nb_symb_slot);
|
||||
|
||||
/** \brief This is the alternative top-level entry point for DLSCH decoding in UE.
|
||||
It handles all the HARQ processes in only one call. The routine first
|
||||
@@ -167,14 +165,14 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
/** \brief This function does IFFT for PUSCH
|
||||
*/
|
||||
|
||||
uint8_t nr_tx_rotation_and_ofdm_mod(const uint8_t slot,
|
||||
const NR_DL_FRAME_PARMS *frame_parms,
|
||||
const uint8_t n_antenna_ports,
|
||||
c16_t **txdataF,
|
||||
c16_t **txdata,
|
||||
uint32_t linktype,
|
||||
bool was_symbol_used[NR_SYMBOLS_PER_SLOT],
|
||||
bool no_phase_pre_comp);
|
||||
void nr_tx_rotation_and_ofdm_mod(const uint8_t slot,
|
||||
const NR_DL_FRAME_PARMS *frame_parms,
|
||||
const uint8_t n_antenna_ports,
|
||||
c16_t **txdataF,
|
||||
c16_t **txdata,
|
||||
uint32_t linktype,
|
||||
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,
|
||||
|
||||
@@ -1603,19 +1603,19 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
stop_meas_nr_ue_phy(UE, PUSCH_PROC_STATS);
|
||||
}
|
||||
|
||||
uint8_t nr_tx_rotation_and_ofdm_mod(const uint8_t slot,
|
||||
const NR_DL_FRAME_PARMS *frame_parms,
|
||||
const uint8_t n_antenna_ports,
|
||||
c16_t **txdataF,
|
||||
c16_t **txdata,
|
||||
uint32_t linktype,
|
||||
bool was_symbol_used[NR_SYMBOLS_PER_SLOT],
|
||||
bool no_phase_pre_comp)
|
||||
void nr_tx_rotation_and_ofdm_mod(const uint8_t slot,
|
||||
const NR_DL_FRAME_PARMS *frame_parms,
|
||||
const uint8_t n_antenna_ports,
|
||||
c16_t **txdataF,
|
||||
c16_t **txdata,
|
||||
uint32_t linktype,
|
||||
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_SYMBOLS_PER_SLOT; i++) {
|
||||
for (int i = 0; i < frame_parms->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_SYMBOLS_PER_SLOT_EXTENDED_CP; i++) {
|
||||
for (int i = 0; i < frame_parms->symbols_per_slot; i++) {
|
||||
if (was_symbol_used[i] == false) {
|
||||
memset(&txdata[ap][(frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples) * i],
|
||||
0,
|
||||
@@ -1641,11 +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_SYMBOLS_PER_SLOT, frame_parms, slot, was_symbol_used);
|
||||
nr_normal_prefix_mod(txdataF[ap], txdata[ap], frame_parms->symbols_per_slot, frame_parms, slot, was_symbol_used);
|
||||
}
|
||||
}
|
||||
|
||||
///////////
|
||||
////////////////////////////////////////////////////
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -30,18 +30,18 @@ static const uint16_t srs_max_number_cs[3] = {8, 12, 6};
|
||||
|
||||
//#define SRS_DEBUG
|
||||
|
||||
static int group_number_hopping(int slot_number, uint8_t n_ID_SRS, uint8_t l0, uint8_t l_line)
|
||||
static int group_number_hopping(int slot_number, uint8_t n_ID_SRS, uint8_t l0, uint8_t l_line, int symb_slot)
|
||||
{
|
||||
// Pseudo-random sequence c(i) defined by TS 38.211 - Section 5.2.1
|
||||
uint32_t cinit = n_ID_SRS;
|
||||
uint8_t c_last_index = 8 * (slot_number * NR_SYMBOLS_PER_SLOT + l0 + l_line) + 7;
|
||||
uint8_t c_last_index = 8 * (slot_number * symb_slot + l0 + l_line) + 7;
|
||||
uint32_t *c_sequence = calloc(c_last_index + 1, sizeof(uint32_t));
|
||||
pseudo_random_sequence(c_last_index + 1, c_sequence, cinit);
|
||||
|
||||
// TS 38.211 - 6.4.1.4.2 Sequence generation
|
||||
uint32_t f_gh = 0;
|
||||
for (int m = 0; m <= 7; m++) {
|
||||
f_gh += c_sequence[8 * (slot_number * NR_SYMBOLS_PER_SLOT + l0 + l_line) + m] << m;
|
||||
f_gh += c_sequence[8 * (slot_number * symb_slot + l0 + l_line) + m] << m;
|
||||
}
|
||||
f_gh = f_gh % 30;
|
||||
int u = (f_gh + n_ID_SRS) % U_GROUP_NUMBER;
|
||||
@@ -49,13 +49,13 @@ static int group_number_hopping(int slot_number, uint8_t n_ID_SRS, uint8_t l0, u
|
||||
return u;
|
||||
}
|
||||
|
||||
static int sequence_number_hopping(int slot_number, uint8_t n_ID_SRS, uint16_t M_sc_b_SRS, uint8_t l0, uint8_t l_line)
|
||||
static int sequence_number_hopping(int slot_number, int n_ID_SRS, int M_sc_b_SRS, int l0, int l_line, int symb_slot)
|
||||
{
|
||||
int v = 0;
|
||||
if (M_sc_b_SRS > 6 * NR_NB_SC_PER_RB) {
|
||||
// Pseudo-random sequence c(i) defined by TS 38.211 - Section 5.2.1
|
||||
uint32_t cinit = n_ID_SRS;
|
||||
uint8_t c_last_index = (slot_number * NR_SYMBOLS_PER_SLOT + l0 + l_line);
|
||||
uint8_t c_last_index = (slot_number * symb_slot + l0 + l_line);
|
||||
uint32_t *c_sequence = calloc(c_last_index + 1, sizeof(uint32_t));
|
||||
pseudo_random_sequence(c_last_index + 1, c_sequence, cinit);
|
||||
// TS 38.211 - 6.4.1.4.2 Sequence generation
|
||||
@@ -255,12 +255,12 @@ bool generate_srs_nr(const NR_DL_FRAME_PARMS *frame_parms,
|
||||
v = 0;
|
||||
break;
|
||||
case groupHopping:
|
||||
u = group_number_hopping(slot_number, nr_srs_info->n_ID_SRS, l0, l_line);
|
||||
u = group_number_hopping(slot_number, nr_srs_info->n_ID_SRS, l0, l_line, frame_parms->symbols_per_slot);
|
||||
v = 0;
|
||||
break;
|
||||
case sequenceHopping:
|
||||
u = nr_srs_info->n_ID_SRS % U_GROUP_NUMBER;
|
||||
v = sequence_number_hopping(slot_number, nr_srs_info->n_ID_SRS, M_sc_b_SRS, l0, l_line);
|
||||
v = sequence_number_hopping(slot_number, nr_srs_info->n_ID_SRS, M_sc_b_SRS, l0, l_line, frame_parms->symbols_per_slot);
|
||||
break;
|
||||
default:
|
||||
LOG_E(NR_PHY, "generate_srs: unknown hopping setting %d !\n", nr_srs_info->groupOrSequenceHopping);
|
||||
|
||||
@@ -145,19 +145,17 @@ void nr_feptx0(RU_t *ru, int tti_tx, int first_symbol, int num_symbols, int aa)
|
||||
void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx)
|
||||
{
|
||||
nfapi_nr_config_request_scf_t *cfg = &ru->gNB_list[0]->gNB_config;
|
||||
NR_DL_FRAME_PARMS *fp=ru->nr_frame_parms;
|
||||
int cyclic_prefix_type = NFAPI_CP_NORMAL;
|
||||
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
|
||||
|
||||
unsigned int aa=0;
|
||||
int slot_sizeF = (fp->ofdm_symbol_size)*
|
||||
((cyclic_prefix_type == 1) ? 12 : 14);
|
||||
int slot_sizeF = fp->ofdm_symbol_size * fp->symbols_per_slot;
|
||||
int slot = tti_tx;
|
||||
int *txdata = &ru->common.txdata[aa][get_samples_slot_timestamp(fp, slot)];
|
||||
|
||||
if (nr_slot_select(cfg,frame_tx,slot) == NR_UPLINK_SLOT)
|
||||
return;
|
||||
|
||||
nr_feptx0(ru, slot, 0, NR_SYMBOLS_PER_SLOT, aa);
|
||||
nr_feptx0(ru, slot, 0, fp->symbols_per_slot, aa);
|
||||
|
||||
LOG_D(PHY,
|
||||
"feptx_ofdm (TXPATH): frame %d, slot %d: txp (time %p) %d dB, txp (freq) %d dB\n",
|
||||
|
||||
@@ -980,7 +980,6 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, N
|
||||
|
||||
const NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
|
||||
const uint16_t ofdm_symbol_size = frame_parms->ofdm_symbol_size;
|
||||
const int nb_symb = frame_parms->symbols_per_slot;
|
||||
const uint8_t nb_antennas_rx = frame_parms->nb_antennas_rx;
|
||||
LOG_D(PHY,"phy_procedures_gNB_uespec_RX frame %d, slot %d\n",frame_rx,slot_rx);
|
||||
{
|
||||
@@ -993,7 +992,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_SYMBOLS_PER_SLOT; symbol_count++) {
|
||||
for (int symbol_count = 0; symbol_count < frame_parms->symbols_per_slot; symbol_count++) {
|
||||
if (slot_conf[symbol_count].slot_config.value == 1) {
|
||||
if (num_symb == 0)
|
||||
first_symb = symbol_count;
|
||||
@@ -1001,11 +1000,11 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, N
|
||||
}
|
||||
}
|
||||
else
|
||||
num_symb = NR_SYMBOLS_PER_SLOT;
|
||||
num_symb = frame_parms->symbols_per_slot;
|
||||
gNB_I0_measurements(gNB, slot_rx, first_symb, num_symb, rb_mask_ul);
|
||||
}
|
||||
|
||||
const int soffset = (slot_rx & 3) * nb_symb * ofdm_symbol_size;
|
||||
const int soffset = (slot_rx & 3) * frame_parms->symbols_per_slot * ofdm_symbol_size;
|
||||
start_meas(&gNB->phy_proc_rx);
|
||||
|
||||
for (int i = 0; i < gNB->max_nb_pucch; i++) {
|
||||
@@ -1368,7 +1367,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, N
|
||||
T(T_GNB_PHY_PUCCH_PUSCH_IQ,
|
||||
T_INT(frame_rx),
|
||||
T_INT(slot_rx),
|
||||
T_BUFFER(&gNB->common_vars.rxdataF[0][0][0], nb_symb * ofdm_symbol_size * 4));
|
||||
T_BUFFER(&gNB->common_vars.rxdataF[0][0][0], frame_parms->symbols_per_slot * ofdm_symbol_size * 4));
|
||||
}
|
||||
|
||||
return pusch_DTX;
|
||||
|
||||
@@ -375,7 +375,7 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, n
|
||||
T(T_UE_PHY_UL_TICK, T_INT(ue->Mod_id), T_INT(frame_tx % 1024), T_INT(slot_tx));
|
||||
#endif
|
||||
|
||||
const int samplesF_per_slot = NR_SYMBOLS_PER_SLOT * ue->frame_parms.ofdm_symbol_size;
|
||||
const int samplesF_per_slot = ue->frame_parms.symbols_per_slot * ue->frame_parms.ofdm_symbol_size;
|
||||
c16_t txdataF_buf[ue->frame_parms.nb_antennas_tx * samplesF_per_slot] __attribute__((aligned(32)));
|
||||
memset(txdataF_buf, 0, sizeof(txdataF_buf));
|
||||
c16_t *txdataF[ue->frame_parms.nb_antennas_tx]; /* workaround to be compatible with current txdataF usage in all tx procedures. */
|
||||
@@ -618,7 +618,7 @@ static int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue,
|
||||
toFree2,
|
||||
dlsch[0].Nl,
|
||||
ue->frame_parms.nb_antennas_rx,
|
||||
rx_size_symbol * NR_SYMBOLS_PER_SLOT,
|
||||
rx_size_symbol * ue->frame_parms.symbols_per_slot,
|
||||
false);
|
||||
|
||||
uint32_t nvar = 0;
|
||||
@@ -1027,22 +1027,21 @@ void pdcch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_
|
||||
/* process PDCCH */
|
||||
LOG_D(PHY, " ------ --> PDCCH ChannelComp/LLR Frame.slot %d.%d ------ \n", proc->frame_rx % 1024, proc->nr_slot_rx);
|
||||
start_meas_nr_ue_phy(ue, DLSCH_RX_PDCCH_STATS);
|
||||
int num_monitoring_occ = get_max_pdcch_monOcc(phy_pdcch_config);
|
||||
NR_DL_FRAME_PARMS *fp = &ue->frame_parms;
|
||||
int num_monitoring_occ = get_max_pdcch_monOcc(phy_pdcch_config, fp->symbols_per_slot);
|
||||
int max_nb_symb_pdcch = get_max_pdcch_symb(phy_pdcch_config);
|
||||
int llr_size_symbol = get_pdcch_max_rbs(phy_pdcch_config) * 9;
|
||||
c16_t pdcch_llr[phy_pdcch_config->nb_search_space][num_monitoring_occ][max_nb_symb_pdcch * llr_size_symbol];
|
||||
|
||||
int start_symb_pdcch, last_symb_pdcch;
|
||||
set_first_last_pdcch_symb(phy_pdcch_config, &start_symb_pdcch, &last_symb_pdcch);
|
||||
set_first_last_pdcch_symb(phy_pdcch_config, fp->symbols_per_slot, &start_symb_pdcch, &last_symb_pdcch);
|
||||
|
||||
/* Temporarily loop over symbols in the slot, perform OFDM demod and process PDCCH.
|
||||
When symbol based proc design is fully merged, this function will be called to process only one symbol
|
||||
and OFDM demod will be removed from here. */
|
||||
const uint32_t rxdataF_sz = ue->frame_parms.samples_per_slot_wCP;
|
||||
__attribute__((aligned(32))) c16_t rxdataF[ue->frame_parms.nb_antennas_rx][rxdataF_sz];
|
||||
const uint32_t rxdataF_sz = fp->samples_per_slot_wCP;
|
||||
__attribute__((aligned(32))) c16_t rxdataF[fp->nb_antennas_rx][rxdataF_sz];
|
||||
|
||||
for (int symbol = start_symb_pdcch; symbol <= last_symb_pdcch; symbol++) {
|
||||
NR_DL_FRAME_PARMS *fp = &ue->frame_parms;
|
||||
nr_slot_fep(ue, fp, proc->nr_slot_rx, symbol, rxdataF, link_type_dl, 0, ue->common_vars.rxdata);
|
||||
__attribute__((aligned(32))) c16_t rxdataF_symb[fp->nb_antennas_rx][((fp->ofdm_symbol_size + 7) / 8) * 8];
|
||||
|
||||
@@ -1058,7 +1057,7 @@ void pdcch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_
|
||||
stop_meas_nr_ue_phy(ue, DLSCH_RX_PDCCH_STATS);
|
||||
TracyCZoneEnd(ctx);
|
||||
if (ue->phy_sim_rxdataF)
|
||||
memcpy(ue->phy_sim_rxdataF, rxdataF[0], sizeof(int32_t) * max_nb_symb_pdcch * ue->frame_parms.ofdm_symbol_size);
|
||||
memcpy(ue->phy_sim_rxdataF, rxdataF[0], sizeof(int32_t) * max_nb_symb_pdcch * fp->ofdm_symbol_size);
|
||||
}
|
||||
|
||||
int pbch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_data_t *phy_data)
|
||||
@@ -1248,7 +1247,7 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_
|
||||
|
||||
// do procedures for CSI-RS
|
||||
if (phy_data->csirs_vars.active == 1) {
|
||||
for(int symb = 0; symb < NR_SYMBOLS_PER_SLOT; symb++) {
|
||||
for(int symb = 0; symb < ue->frame_parms.symbols_per_slot; symb++) {
|
||||
if(is_csi_rs_in_symbol(phy_data->csirs_vars.csirs_config_pdu, symb)) {
|
||||
if (!slot_fep_map[symb]) {
|
||||
nr_slot_fep(ue, &ue->frame_parms, proc->nr_slot_rx, symb, rxdataF, link_type_dl, 0, ue->common_vars.rxdata);
|
||||
|
||||
@@ -246,7 +246,7 @@ static int freq_domain_loopback(PHY_VARS_NR_UE *UE_tx, PHY_VARS_NR_UE *UE_rx, in
|
||||
sl_ue2->sl_config.sl_sync_source.rx_slss_id);
|
||||
|
||||
NR_DL_FRAME_PARMS *fp = &sl_ue1->sl_frame_params;
|
||||
const int samplesF_per_slot = NR_SYMBOLS_PER_SLOT * fp->ofdm_symbol_size;
|
||||
const int samplesF_per_slot = fp->symbols_per_slot * fp->ofdm_symbol_size;
|
||||
c16_t txdataF_buf[fp->nb_antennas_tx * samplesF_per_slot] __attribute__((aligned(32)));
|
||||
memset(txdataF_buf, 0, sizeof(txdataF_buf));
|
||||
c16_t *txdataF[fp->nb_antennas_tx]; /* workaround to be compatible with current txdataF usage in all tx procedures. */
|
||||
|
||||
Reference in New Issue
Block a user