remove some LTE dependence in NR files
This commit is contained in:
@@ -51,7 +51,6 @@
|
|||||||
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
|
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
|
||||||
#include "PHY/TOOLS/tools_defs.h"
|
#include "PHY/TOOLS/tools_defs.h"
|
||||||
#include "PHY/defs_RU.h"
|
#include "PHY/defs_RU.h"
|
||||||
#include "PHY/defs_common.h"
|
|
||||||
#include "PHY/defs_gNB.h"
|
#include "PHY/defs_gNB.h"
|
||||||
#include "PHY/defs_nr_common.h"
|
#include "PHY/defs_nr_common.h"
|
||||||
#include "PHY/impl_defs_nr.h"
|
#include "PHY/impl_defs_nr.h"
|
||||||
@@ -200,7 +199,7 @@ static void rx_func(processingData_L1_t *info)
|
|||||||
int soffset = (slot_rx % RU_RX_SLOT_DEPTH) * gNB->frame_parms.symbols_per_slot * gNB->frame_parms.ofdm_symbol_size;
|
int soffset = (slot_rx % RU_RX_SLOT_DEPTH) * gNB->frame_parms.symbols_per_slot * gNB->frame_parms.ofdm_symbol_size;
|
||||||
for (int bb = 0; bb < gNB->common_vars.num_beams_period; bb++) {
|
for (int bb = 0; bb < gNB->common_vars.num_beams_period; bb++) {
|
||||||
for (int aa = 0; aa < gNB->frame_parms.nb_antennas_rx; aa++) {
|
for (int aa = 0; aa < gNB->frame_parms.nb_antennas_rx; aa++) {
|
||||||
const uint max_symb = (gNB->frame_parms.Ncp == EXTENDED) ? 12 : 14;
|
const uint max_symb = (gNB->frame_parms.Ncp == NR_EXTENDED) ? 12 : 14;
|
||||||
for (int sym = 0; sym < max_symb; sym++)
|
for (int sym = 0; sym < max_symb; sym++)
|
||||||
apply_nr_rotation_symbol_RX(&gNB->frame_parms,
|
apply_nr_rotation_symbol_RX(&gNB->frame_parms,
|
||||||
gNB->common_vars.rxdataF[bb][aa] + soffset + sym * gNB->frame_parms.ofdm_symbol_size,
|
gNB->common_vars.rxdataF[bb][aa] + soffset + sym * gNB->frame_parms.ofdm_symbol_size,
|
||||||
|
|||||||
-1
@@ -27,7 +27,6 @@
|
|||||||
#include "nr_rate_matching.h"
|
#include "nr_rate_matching.h"
|
||||||
#include "PHY/CODING/coding_extern.h"
|
#include "PHY/CODING/coding_extern.h"
|
||||||
#include "PHY/CODING/coding_defs.h"
|
#include "PHY/CODING/coding_defs.h"
|
||||||
#include "PHY/CODING/lte_interleaver_inline.h"
|
|
||||||
#include "PHY/CODING/nrLDPC_coding/nrLDPC_coding_interface.h"
|
#include "PHY/CODING/nrLDPC_coding/nrLDPC_coding_interface.h"
|
||||||
#include "PHY/CODING/nrLDPC_extern.h"
|
#include "PHY/CODING/nrLDPC_extern.h"
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|||||||
-1
@@ -26,7 +26,6 @@
|
|||||||
#include "nr_rate_matching.h"
|
#include "nr_rate_matching.h"
|
||||||
#include "PHY/CODING/coding_extern.h"
|
#include "PHY/CODING/coding_extern.h"
|
||||||
#include "PHY/CODING/coding_defs.h"
|
#include "PHY/CODING/coding_defs.h"
|
||||||
#include "PHY/CODING/lte_interleaver_inline.h"
|
|
||||||
#include "PHY/CODING/nrLDPC_coding/nrLDPC_coding_interface.h"
|
#include "PHY/CODING/nrLDPC_coding/nrLDPC_coding_interface.h"
|
||||||
#include "PHY/CODING/nrLDPC_extern.h"
|
#include "PHY/CODING/nrLDPC_extern.h"
|
||||||
#include "common/utils/LOG/log.h"
|
#include "common/utils/LOG/log.h"
|
||||||
|
|||||||
@@ -30,7 +30,6 @@
|
|||||||
#include <nr_rate_matching.h>
|
#include <nr_rate_matching.h>
|
||||||
#include "PHY/CODING/coding_defs.h"
|
#include "PHY/CODING/coding_defs.h"
|
||||||
#include "PHY/CODING/coding_extern.h"
|
#include "PHY/CODING/coding_extern.h"
|
||||||
#include "PHY/CODING/lte_interleaver_inline.h"
|
|
||||||
#include "PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/nrLDPC_coding_xdma_offload.h"
|
#include "PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/nrLDPC_coding_xdma_offload.h"
|
||||||
#include "PHY/CODING/nrLDPC_extern.h"
|
#include "PHY/CODING/nrLDPC_extern.h"
|
||||||
#include "common/utils/LOG/log.h"
|
#include "common/utils/LOG/log.h"
|
||||||
|
|||||||
@@ -409,7 +409,7 @@ void nr_init_frame_parms(nfapi_nr_config_request_scf_t* cfg, NR_DL_FRAME_PARMS *
|
|||||||
fp->nb_antennas_rx = cfg->carrier_config.num_rx_ant.value; // It denotes the number of rx antennas at gNB
|
fp->nb_antennas_rx = cfg->carrier_config.num_rx_ant.value; // It denotes the number of rx antennas at gNB
|
||||||
fp->nb_antennas_tx = cfg->carrier_config.num_tx_ant.value; // It corresponds to pdsch_AntennaPorts (logical antenna ports)
|
fp->nb_antennas_tx = cfg->carrier_config.num_tx_ant.value; // It corresponds to pdsch_AntennaPorts (logical antenna ports)
|
||||||
|
|
||||||
fp->symbols_per_slot = ((Ncp == NORMAL)? 14 : 12); // to redefine for different slot formats
|
fp->symbols_per_slot = ((Ncp == NR_NORMAL)? 14 : 12); // to redefine for different slot formats
|
||||||
fp->samples_per_subframe_wCP = fp->ofdm_symbol_size * fp->symbols_per_slot * fp->slots_per_subframe;
|
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_frame_wCP = 10 * fp->samples_per_subframe_wCP;
|
||||||
fp->samples_per_slot_wCP = fp->symbols_per_slot*fp->ofdm_symbol_size;
|
fp->samples_per_slot_wCP = fp->symbols_per_slot*fp->ofdm_symbol_size;
|
||||||
@@ -443,7 +443,7 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
|
|||||||
uint8_t nb_ant_ports_gNB = 1;
|
uint8_t nb_ant_ports_gNB = 1;
|
||||||
uint8_t tdd_cfg = 3;
|
uint8_t tdd_cfg = 3;
|
||||||
uint8_t Nid_cell = 0;
|
uint8_t Nid_cell = 0;
|
||||||
int Ncp = NORMAL;
|
int Ncp = NR_NORMAL;
|
||||||
|
|
||||||
if(fp->nb_antennas_rx == 0)
|
if(fp->nb_antennas_rx == 0)
|
||||||
fp->nb_antennas_rx = 1;
|
fp->nb_antennas_rx = 1;
|
||||||
@@ -491,7 +491,7 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
|
|||||||
set_scs_parameters(fp, fp->numerology_index, N_RB);
|
set_scs_parameters(fp, fp->numerology_index, N_RB);
|
||||||
|
|
||||||
fp->slots_per_frame = 10* fp->slots_per_subframe;
|
fp->slots_per_frame = 10* fp->slots_per_subframe;
|
||||||
fp->symbols_per_slot = ((Ncp == NORMAL)? 14 : 12); // to redefine for different slot formats
|
fp->symbols_per_slot = ((Ncp == NR_NORMAL)? 14 : 12); // to redefine for different slot formats
|
||||||
fp->samples_per_subframe_wCP = fp->ofdm_symbol_size * fp->symbols_per_slot * fp->slots_per_subframe;
|
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_frame_wCP = 10 * fp->samples_per_subframe_wCP;
|
||||||
fp->samples_per_slot_wCP = fp->symbols_per_slot*fp->ofdm_symbol_size;
|
fp->samples_per_slot_wCP = fp->symbols_per_slot*fp->ofdm_symbol_size;
|
||||||
@@ -552,12 +552,12 @@ void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, const nrUE_cell_p
|
|||||||
frame_parms->nr_band = nr_band;
|
frame_parms->nr_band = nr_band;
|
||||||
frame_parms->frame_type = get_frame_type(frame_parms->nr_band, frame_parms->numerology_index);
|
frame_parms->frame_type = get_frame_type(frame_parms->nr_band, frame_parms->numerology_index);
|
||||||
|
|
||||||
frame_parms->Ncp = NORMAL;
|
frame_parms->Ncp = NR_NORMAL;
|
||||||
set_scs_parameters(frame_parms, frame_parms->numerology_index, frame_parms->N_RB_DL);
|
set_scs_parameters(frame_parms, frame_parms->numerology_index, frame_parms->N_RB_DL);
|
||||||
set_Lmax(frame_parms);
|
set_Lmax(frame_parms);
|
||||||
|
|
||||||
frame_parms->slots_per_frame = 10* frame_parms->slots_per_subframe;
|
frame_parms->slots_per_frame = 10* frame_parms->slots_per_subframe;
|
||||||
frame_parms->symbols_per_slot = ((frame_parms->Ncp == NORMAL)? 14 : 12); // to redefine for different slot formats
|
frame_parms->symbols_per_slot = ((frame_parms->Ncp == NR_NORMAL)? 14 : 12); // to redefine for different slot formats
|
||||||
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_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_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;
|
frame_parms->samples_per_slot_wCP = frame_parms->symbols_per_slot*frame_parms->ofdm_symbol_size;
|
||||||
@@ -652,7 +652,7 @@ int nr_init_frame_parms_ue_sl(NR_DL_FRAME_PARMS *fp,
|
|||||||
|
|
||||||
LOG_I(PHY, "Initializing frame parms for mu %d, N_RB %d, Ncp %d\n", fp->numerology_index, fp->N_RB_DL, fp->Ncp);
|
LOG_I(PHY, "Initializing frame parms for mu %d, N_RB %d, Ncp %d\n", fp->numerology_index, fp->N_RB_DL, fp->Ncp);
|
||||||
|
|
||||||
if (fp->Ncp == EXTENDED)
|
if (fp->Ncp == NR_EXTENDED)
|
||||||
AssertFatal(fp->numerology_index == NR_MU_2,
|
AssertFatal(fp->numerology_index == NR_MU_2,
|
||||||
"Invalid cyclic prefix %d for numerology index %d\n",
|
"Invalid cyclic prefix %d for numerology index %d\n",
|
||||||
fp->Ncp,
|
fp->Ncp,
|
||||||
@@ -661,7 +661,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);
|
sl_set_scs_parameters(fp, fp->numerology_index, fp->N_RB_SL);
|
||||||
|
|
||||||
fp->slots_per_frame = 10 * fp->slots_per_subframe;
|
fp->slots_per_frame = 10 * fp->slots_per_subframe;
|
||||||
fp->symbols_per_slot = ((fp->Ncp == NORMAL) ? 14 : 12); // to redefine for different slot formats
|
fp->symbols_per_slot = ((fp->Ncp == NR_NORMAL) ? 14 : 12); // to redefine for different slot formats
|
||||||
fp->samples_per_subframe_wCP = fp->ofdm_symbol_size * fp->symbols_per_slot * fp->slots_per_subframe;
|
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_frame_wCP = 10 * fp->samples_per_subframe_wCP;
|
||||||
fp->samples_per_slot_wCP = fp->symbols_per_slot * fp->ofdm_symbol_size;
|
fp->samples_per_slot_wCP = fp->symbols_per_slot * fp->ofdm_symbol_size;
|
||||||
|
|||||||
@@ -488,10 +488,9 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
|||||||
const int nb_rb_pusch = pusch_pdu->rb_size;
|
const int nb_rb_pusch = pusch_pdu->rb_size;
|
||||||
|
|
||||||
//------------------generate DMRS------------------//
|
//------------------generate DMRS------------------//
|
||||||
|
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
|
||||||
if (pusch_pdu->transform_precoding == transformPrecoder_disabled) {
|
if (pusch_pdu->transform_precoding == transformPrecoder_disabled) {
|
||||||
// Note: pilot returned by the following function is already the complex conjugate of the transmitted DMRS
|
// Note: pilot returned by the following function is already the complex conjugate of the transmitted DMRS
|
||||||
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
|
|
||||||
const uint32_t *gold = nr_gold_pusch(fp->N_RB_UL,
|
const uint32_t *gold = nr_gold_pusch(fp->N_RB_UL,
|
||||||
fp->symbols_per_slot,
|
fp->symbols_per_slot,
|
||||||
gNB->gNB_config.cell_config.phy_cell_id.value,
|
gNB->gNB_config.cell_config.phy_cell_id.value,
|
||||||
@@ -500,7 +499,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
|||||||
symbol);
|
symbol);
|
||||||
float beta_dmrs_pusch = get_beta_dmrs(pusch_pdu->num_dmrs_cdm_grps_no_data, pusch_pdu->dmrs_config_type == pusch_dmrs_type2);
|
float beta_dmrs_pusch = get_beta_dmrs(pusch_pdu->num_dmrs_cdm_grps_no_data, pusch_pdu->dmrs_config_type == pusch_dmrs_type2);
|
||||||
int16_t dmrs_scaling = (1 / beta_dmrs_pusch) * (1 << 14);
|
int16_t dmrs_scaling = (1 / beta_dmrs_pusch) * (1 << 14);
|
||||||
nr_pusch_dmrs_rx(gNB,
|
nr_pusch_dmrs_rx(fp->Ncp,
|
||||||
Ns,
|
Ns,
|
||||||
gold,
|
gold,
|
||||||
pilot,
|
pilot,
|
||||||
@@ -521,7 +520,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
|||||||
"Num RBs not configured according to 3GPP 38.211 section 6.3.1.4. For PUSCH with transform precoding, num RBs "
|
"Num RBs not configured according to 3GPP 38.211 section 6.3.1.4. For PUSCH with transform precoding, num RBs "
|
||||||
"cannot be multiple of any other primenumber other than 2,3,5\n");
|
"cannot be multiple of any other primenumber other than 2,3,5\n");
|
||||||
AssertFatal(dmrs_seq != NULL, "DMRS low PAPR seq not found, check if DMRS sequences are generated");
|
AssertFatal(dmrs_seq != NULL, "DMRS low PAPR seq not found, check if DMRS sequences are generated");
|
||||||
nr_pusch_lowpaprtype1_dmrs_rx(gNB, Ns, dmrs_seq, pilot, 1000, 0, nb_rb_pusch, 0, pusch_pdu->dmrs_config_type);
|
nr_pusch_lowpaprtype1_dmrs_rx(fp->Ncp, Ns, dmrs_seq, pilot, 1000, 0, nb_rb_pusch, 0, pusch_pdu->dmrs_config_type);
|
||||||
#ifdef DEBUG_PUSCH
|
#ifdef DEBUG_PUSCH
|
||||||
printf("NR_UL_CHANNEL_EST: index %d, u %d,v %d\n", index, u, v);
|
printf("NR_UL_CHANNEL_EST: index %d, u %d,v %d\n", index, u, v);
|
||||||
LOG_M("gNb_DMRS_SEQ.m", "gNb_DMRS_SEQ", dmrs_seq, 6 * nb_rb_pusch, 1, 1);
|
LOG_M("gNb_DMRS_SEQ.m", "gNb_DMRS_SEQ", dmrs_seq, 6 * nb_rb_pusch, 1, 1);
|
||||||
@@ -556,7 +555,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
|||||||
delay_t *delay = &gNB->ulsch[ul_id].delay;
|
delay_t *delay = &gNB->ulsch[ul_id].delay;
|
||||||
memset(delay, 0, sizeof(*delay));
|
memset(delay, 0, sizeof(*delay));
|
||||||
|
|
||||||
int nb_antennas_rx = gNB->frame_parms.nb_antennas_rx;
|
int nb_antennas_rx = fp->nb_antennas_rx;
|
||||||
delay_t delay_arr[nb_antennas_rx];
|
delay_t delay_arr[nb_antennas_rx];
|
||||||
uint64_t noise_amp2_arr[nb_antennas_rx];
|
uint64_t noise_amp2_arr[nb_antennas_rx];
|
||||||
int max_ch_arr[nb_antennas_rx];
|
int max_ch_arr[nb_antennas_rx];
|
||||||
@@ -573,7 +572,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
|||||||
initNotifiedFIFO(&respPuschAarx);
|
initNotifiedFIFO(&respPuschAarx);
|
||||||
start_meas(&gNB->pusch_channel_estimation_antenna_processing_stats);
|
start_meas(&gNB->pusch_channel_estimation_antenna_processing_stats);
|
||||||
int numAntennas = gNB->dmrs_num_antennas_per_thread;
|
int numAntennas = gNB->dmrs_num_antennas_per_thread;
|
||||||
int num_jobs = CEILIDIV(gNB->frame_parms.nb_antennas_rx, numAntennas);
|
int num_jobs = CEILIDIV(fp->nb_antennas_rx, numAntennas);
|
||||||
puschAntennaProc_t rdatas[num_jobs];
|
puschAntennaProc_t rdatas[num_jobs];
|
||||||
memset(rdatas, 0, sizeof(rdatas));
|
memset(rdatas, 0, sizeof(rdatas));
|
||||||
task_ans_t ans;
|
task_ans_t ans;
|
||||||
@@ -597,7 +596,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
|||||||
rdata->noise_amp2 = &noise_amp2_arr[rdata->aarx];
|
rdata->noise_amp2 = &noise_amp2_arr[rdata->aarx];
|
||||||
rdata->delay = &delay_arr[rdata->aarx];
|
rdata->delay = &delay_arr[rdata->aarx];
|
||||||
rdata->beam_nb = beam_nb;
|
rdata->beam_nb = beam_nb;
|
||||||
rdata->frame_parms = &gNB->frame_parms;
|
rdata->frame_parms = fp;
|
||||||
rdata->pusch_vars = &gNB->pusch_vars[ul_id];
|
rdata->pusch_vars = &gNB->pusch_vars[ul_id];
|
||||||
rdata->chest_freq = gNB->chest_freq;
|
rdata->chest_freq = gNB->chest_freq;
|
||||||
rdata->rxdataF = gNB->common_vars.rxdataF;
|
rdata->rxdataF = gNB->common_vars.rxdataF;
|
||||||
@@ -617,14 +616,14 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
|||||||
join_task_ans(&ans);
|
join_task_ans(&ans);
|
||||||
|
|
||||||
stop_meas(&gNB->pusch_channel_estimation_antenna_processing_stats);
|
stop_meas(&gNB->pusch_channel_estimation_antenna_processing_stats);
|
||||||
for (int aarx = 0; aarx < gNB->frame_parms.nb_antennas_rx; aarx++) {
|
for (int aarx = 0; aarx < fp->nb_antennas_rx; aarx++) {
|
||||||
*max_ch = max(*max_ch, max_ch_arr[aarx]);
|
*max_ch = max(*max_ch, max_ch_arr[aarx]);
|
||||||
noise_amp2 += noise_amp2_arr[aarx];
|
noise_amp2 += noise_amp2_arr[aarx];
|
||||||
nest_count += nest_count_arr[aarx];
|
nest_count += nest_count_arr[aarx];
|
||||||
}
|
}
|
||||||
// get the maximum delay
|
// get the maximum delay
|
||||||
*delay = delay_arr[0];
|
*delay = delay_arr[0];
|
||||||
for (int aarx = 1; aarx < gNB->frame_parms.nb_antennas_rx; aarx++) {
|
for (int aarx = 1; aarx < fp->nb_antennas_rx; aarx++) {
|
||||||
if (delay_arr[aarx].est_delay >= delay->est_delay) {
|
if (delay_arr[aarx].est_delay >= delay->est_delay) {
|
||||||
*delay = delay_arr[aarx];
|
*delay = delay_arr[aarx];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,9 +36,7 @@
|
|||||||
|
|
||||||
#include "PHY/TOOLS/tools_defs.h"
|
#include "PHY/TOOLS/tools_defs.h"
|
||||||
#include "refsig_defs_ue.h"
|
#include "refsig_defs_ue.h"
|
||||||
#include "PHY/defs_nr_UE.h"
|
|
||||||
#include "nr_refsig.h"
|
#include "nr_refsig.h"
|
||||||
#include "PHY/defs_gNB.h"
|
|
||||||
#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h"
|
#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h"
|
||||||
|
|
||||||
// Table 6.4.1.1.3-1/2 from TS 38.211
|
// Table 6.4.1.1.3-1/2 from TS 38.211
|
||||||
@@ -66,7 +64,7 @@ static inline c16_t get_modulated(const uint32_t *gold_sequence, const int idx_g
|
|||||||
return (c16_t){-val.r, -val.i};
|
return (c16_t){-val.r, -val.i};
|
||||||
}
|
}
|
||||||
|
|
||||||
int nr_pusch_dmrs_rx(PHY_VARS_gNB *gNB,
|
int nr_pusch_dmrs_rx(nr_prefix_type_t Ncp,
|
||||||
unsigned int Ns,
|
unsigned int Ns,
|
||||||
const uint32_t *nr_gold_pusch,
|
const uint32_t *nr_gold_pusch,
|
||||||
c16_t *output,
|
c16_t *output,
|
||||||
@@ -88,7 +86,7 @@ int nr_pusch_dmrs_rx(PHY_VARS_gNB *gNB,
|
|||||||
const int nb_dmrs = dmrs_type == pusch_dmrs_type1 ? 6 : 4;
|
const int nb_dmrs = dmrs_type == pusch_dmrs_type1 ? 6 : 4;
|
||||||
|
|
||||||
if ((p>=1000) && (p<((dmrs_type==pusch_dmrs_type1) ? 1008 : 1012))) {
|
if ((p>=1000) && (p<((dmrs_type==pusch_dmrs_type1) ? 1008 : 1012))) {
|
||||||
if (gNB->frame_parms.Ncp == NORMAL) {
|
if (Ncp == NR_NORMAL) {
|
||||||
for (int k = 0; k < nb_pusch_rb * nb_dmrs; k++) {
|
for (int k = 0; k < nb_pusch_rb * nb_dmrs; k++) {
|
||||||
int i = k + dmrs_offset;
|
int i = k + dmrs_offset;
|
||||||
int w = (wf[p - 1000][i & 1]) * (wt[p - 1000][lp]);
|
int w = (wf[p - 1000][i & 1]) * (wt[p - 1000][lp]);
|
||||||
@@ -110,7 +108,7 @@ int nr_pusch_dmrs_rx(PHY_VARS_gNB *gNB,
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int nr_pdsch_dmrs_rx(const PHY_VARS_NR_UE *ue,
|
int nr_pdsch_dmrs_rx(nr_prefix_type_t Ncp,
|
||||||
unsigned int Ns,
|
unsigned int Ns,
|
||||||
const unsigned int *nr_gold_pdsch,
|
const unsigned int *nr_gold_pdsch,
|
||||||
c16_t *output,
|
c16_t *output,
|
||||||
@@ -128,7 +126,7 @@ int nr_pdsch_dmrs_rx(const PHY_VARS_NR_UE *ue,
|
|||||||
LOG_E(PHY,"Bad PDSCH DMRS config type %d\n", config_type);
|
LOG_E(PHY,"Bad PDSCH DMRS config type %d\n", config_type);
|
||||||
|
|
||||||
if ((p >= 1000) && (p < ((config_type == NFAPI_NR_DMRS_TYPE1) ? 1008 : 1012))) {
|
if ((p >= 1000) && (p < ((config_type == NFAPI_NR_DMRS_TYPE1) ? 1008 : 1012))) {
|
||||||
if (ue->frame_parms.Ncp == NORMAL) {
|
if (Ncp == NR_NORMAL) {
|
||||||
for (int i = 0; i < nb_pdsch_rb * ((config_type == NFAPI_NR_DMRS_TYPE1) ? 6 : 4); i++) {
|
for (int i = 0; i < nb_pdsch_rb * ((config_type == NFAPI_NR_DMRS_TYPE1) ? 6 : 4); i++) {
|
||||||
int w = (wf[p - 1000][i & 1]) * (wt[p - 1000][lp]);
|
int w = (wf[p - 1000][i & 1]) * (wt[p - 1000][lp]);
|
||||||
output[i] = get_modulated(nr_gold_pdsch, i, w == 1);
|
output[i] = get_modulated(nr_gold_pdsch, i, w == 1);
|
||||||
@@ -215,7 +213,7 @@ void nr_gen_ref_conj_symbols(const uint32_t *in, uint32_t length, c16_t *output,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int nr_pusch_lowpaprtype1_dmrs_rx(PHY_VARS_gNB *gNB,
|
int nr_pusch_lowpaprtype1_dmrs_rx(nr_prefix_type_t Ncp,
|
||||||
unsigned int Ns,
|
unsigned int Ns,
|
||||||
c16_t *dmrs_seq,
|
c16_t *dmrs_seq,
|
||||||
c16_t *output,
|
c16_t *output,
|
||||||
@@ -234,7 +232,7 @@ int nr_pusch_lowpaprtype1_dmrs_rx(PHY_VARS_gNB *gNB,
|
|||||||
LOG_E(PHY,"PUSCH DMRS config type %d not valid\n", dmrs_type);
|
LOG_E(PHY,"PUSCH DMRS config type %d not valid\n", dmrs_type);
|
||||||
|
|
||||||
if ((p>=1000) && (p<1008)) {
|
if ((p>=1000) && (p<1008)) {
|
||||||
if (gNB->frame_parms.Ncp == NORMAL) {
|
if (Ncp == NR_NORMAL) {
|
||||||
nb_dmrs = NR_NB_SC_PER_RB/2; // for DMRS TYPE 1 - 6 DMRS REs present per RB
|
nb_dmrs = NR_NB_SC_PER_RB/2; // for DMRS TYPE 1 - 6 DMRS REs present per RB
|
||||||
for (int i=dmrs_offset; i<dmrs_offset+(nb_pusch_rb*nb_dmrs); i++) {
|
for (int i=dmrs_offset; i<dmrs_offset+(nb_pusch_rb*nb_dmrs); i++) {
|
||||||
k = i-dmrs_offset;
|
k = i-dmrs_offset;
|
||||||
|
|||||||
@@ -24,11 +24,10 @@
|
|||||||
#ifndef __NR_REFSIG__H__
|
#ifndef __NR_REFSIG__H__
|
||||||
#define __NR_REFSIG__H__
|
#define __NR_REFSIG__H__
|
||||||
|
|
||||||
#include "PHY/defs_gNB.h"
|
|
||||||
#include "openair1/PHY/NR_REFSIG/nr_refsig_common.h"
|
#include "openair1/PHY/NR_REFSIG/nr_refsig_common.h"
|
||||||
#include "PHY/nr_phy_common/inc/nr_phy_common.h"
|
#include "PHY/nr_phy_common/inc/nr_phy_common.h"
|
||||||
|
|
||||||
int nr_pusch_dmrs_rx(PHY_VARS_gNB *gNB,
|
int nr_pusch_dmrs_rx(nr_prefix_type_t Ncp,
|
||||||
unsigned int Ns,
|
unsigned int Ns,
|
||||||
const uint32_t *nr_gold_pusch,
|
const uint32_t *nr_gold_pusch,
|
||||||
c16_t *output,
|
c16_t *output,
|
||||||
@@ -43,7 +42,7 @@ void nr_generate_modulation_table(void);
|
|||||||
|
|
||||||
extern simde__m128i byte2m128i[256];
|
extern simde__m128i byte2m128i[256];
|
||||||
|
|
||||||
int nr_pusch_lowpaprtype1_dmrs_rx(PHY_VARS_gNB *gNB,
|
int nr_pusch_lowpaprtype1_dmrs_rx(nr_prefix_type_t Ncp,
|
||||||
unsigned int Ns,
|
unsigned int Ns,
|
||||||
c16_t *dmrs_seq,
|
c16_t *dmrs_seq,
|
||||||
c16_t *output,
|
c16_t *output,
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
#ifndef __NR_REFSIG_COMMON_H__
|
#ifndef __NR_REFSIG_COMMON_H__
|
||||||
#define __NR_REFSIG_COMMON_H__
|
#define __NR_REFSIG_COMMON_H__
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
uint32_t *gold_cache(uint32_t key, int length);
|
uint32_t *gold_cache(uint32_t key, int length);
|
||||||
uint32_t *nr_gold_pbch(int Lmax, int Nid, int n_hf, int ssb);
|
uint32_t *nr_gold_pbch(int Lmax, int Nid, int n_hf, int ssb);
|
||||||
uint32_t *nr_gold_pdcch(int N_RB_DL, int symbols_per_slot, unsigned short n_idDMRS, int ns, int l);
|
uint32_t *nr_gold_pdcch(int N_RB_DL, int symbols_per_slot, unsigned short n_idDMRS, int ns, int l);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ void nr_pbch_dmrs_rx(int dmrss, const unsigned int *nr_gold_pbch, c16_t *output,
|
|||||||
*/
|
*/
|
||||||
void nr_pdcch_dmrs_ref(const unsigned int *nr_gold_pdcch, c16_t *output, unsigned short nb_rb_corset);
|
void nr_pdcch_dmrs_ref(const unsigned int *nr_gold_pdcch, c16_t *output, unsigned short nb_rb_corset);
|
||||||
|
|
||||||
int nr_pdsch_dmrs_rx(const PHY_VARS_NR_UE *ue,
|
int nr_pdsch_dmrs_rx(nr_prefix_type_t Ncp,
|
||||||
unsigned int Ns,
|
unsigned int Ns,
|
||||||
const unsigned int *nr_gold_pdsch,
|
const unsigned int *nr_gold_pdsch,
|
||||||
c16_t *output,
|
c16_t *output,
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
#include "PHY/defs_gNB.h"
|
#include "PHY/defs_gNB.h"
|
||||||
#include "PHY/CODING/coding_extern.h"
|
#include "PHY/CODING/coding_extern.h"
|
||||||
#include "PHY/CODING/coding_defs.h"
|
#include "PHY/CODING/coding_defs.h"
|
||||||
#include "PHY/CODING/lte_interleaver_inline.h"
|
|
||||||
#include "PHY/CODING/nrLDPC_coding/nrLDPC_coding_interface.h"
|
#include "PHY/CODING/nrLDPC_coding/nrLDPC_coding_interface.h"
|
||||||
#include "PHY/CODING/nrLDPC_extern.h"
|
#include "PHY/CODING/nrLDPC_extern.h"
|
||||||
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
|
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#include "PHY/defs_gNB.h"
|
#include "PHY/defs_gNB.h"
|
||||||
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
|
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
|
||||||
#include "PHY/LTE_REFSIG/lte_refsig.h"
|
|
||||||
#include "PHY/NR_REFSIG/nr_refsig.h"
|
#include "PHY/NR_REFSIG/nr_refsig.h"
|
||||||
#include "PHY/sse_intrin.h"
|
#include "PHY/sse_intrin.h"
|
||||||
#include "openair1/PHY/NR_REFSIG/refsig_defs_ue.h"
|
#include "openair1/PHY/NR_REFSIG/refsig_defs_ue.h"
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ void nr_idft(int32_t *z, uint32_t Msc_PUSCH)
|
|||||||
|
|
||||||
int i, ip;
|
int i, ip;
|
||||||
|
|
||||||
LOG_T(PHY,"Doing lte_idft for Msc_PUSCH %d\n",Msc_PUSCH);
|
LOG_T(PHY,"Doing nr_idft for Msc_PUSCH %d\n", Msc_PUSCH);
|
||||||
|
|
||||||
if ((Msc_PUSCH % 1536) > 0) {
|
if ((Msc_PUSCH % 1536) > 0) {
|
||||||
// conjugate input
|
// conjugate input
|
||||||
|
|||||||
@@ -1296,7 +1296,7 @@ void nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
|
|||||||
float beta_dmrs_pdsch = get_beta_dmrs(dlsch->n_dmrs_cdm_groups, config_type == NFAPI_NR_DMRS_TYPE2);
|
float beta_dmrs_pdsch = get_beta_dmrs(dlsch->n_dmrs_cdm_groups, config_type == NFAPI_NR_DMRS_TYPE2);
|
||||||
int16_t dmrs_scaling = (int16_t)((1 / beta_dmrs_pdsch) * (1 << 14));
|
int16_t dmrs_scaling = (int16_t)((1 / beta_dmrs_pdsch) * (1 << 14));
|
||||||
const uint32_t *gold = nr_gold_pdsch(fp->N_RB_DL, fp->symbols_per_slot, dlsch->dlDmrsScramblingId, dlsch->nscid, slot, symbol);
|
const uint32_t *gold = nr_gold_pdsch(fp->N_RB_DL, fp->symbols_per_slot, dlsch->dlDmrsScramblingId, dlsch->nscid, slot, symbol);
|
||||||
nr_pdsch_dmrs_rx(ue, slot, gold, pilot, 1000 + p, 0, nb_rb_pdsch + rb_offset, config_type, dmrs_scaling);
|
nr_pdsch_dmrs_rx(fp->Ncp, slot, gold, pilot, 1000 + p, 0, nb_rb_pdsch + rb_offset, config_type, dmrs_scaling);
|
||||||
|
|
||||||
delay_t delay = {0};
|
delay_t delay = {0};
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "PHY/defs_nr_UE.h"
|
#include "PHY/defs_nr_UE.h"
|
||||||
#include "PHY/LTE_REFSIG/lte_refsig.h"
|
|
||||||
#include "PHY/NR_REFSIG/nr_mod_table.h"
|
#include "PHY/NR_REFSIG/nr_mod_table.h"
|
||||||
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
|
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
|
||||||
#include "PHY/CODING/nrPolar_tools/nr_polar_psbch_defs.h"
|
#include "PHY/CODING/nrPolar_tools/nr_polar_psbch_defs.h"
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
|
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
|
||||||
#include "PHY/CODING/coding_defs.h"
|
#include "PHY/CODING/coding_defs.h"
|
||||||
#include "PHY/CODING/coding_extern.h"
|
#include "PHY/CODING/coding_extern.h"
|
||||||
#include "PHY/CODING/lte_interleaver_inline.h"
|
|
||||||
#include "PHY/CODING/nrLDPC_extern.h"
|
#include "PHY/CODING/nrLDPC_extern.h"
|
||||||
#include "PHY/CODING/nrLDPC_coding/nrLDPC_coding_interface.h"
|
#include "PHY/CODING/nrLDPC_coding/nrLDPC_coding_interface.h"
|
||||||
#include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h"
|
#include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h"
|
||||||
|
|||||||
@@ -86,6 +86,11 @@
|
|||||||
|
|
||||||
#define NR_PUCCH_DMRS_RB 4
|
#define NR_PUCCH_DMRS_RB 4
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
NR_NORMAL = 0,
|
||||||
|
NR_EXTENDED = 1
|
||||||
|
} nr_prefix_type_t;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
NR_MU_0=0,
|
NR_MU_0=0,
|
||||||
NR_MU_1,
|
NR_MU_1,
|
||||||
@@ -232,7 +237,7 @@ struct NR_DL_FRAME_PARMS {
|
|||||||
/// Number of common transmit antenna ports in eNodeB (1 or 2)
|
/// Number of common transmit antenna ports in eNodeB (1 or 2)
|
||||||
uint8_t nb_antenna_ports_gNB;
|
uint8_t nb_antenna_ports_gNB;
|
||||||
/// Cyclic Prefix for DL (0=Normal CP, 1=Extended CP)
|
/// Cyclic Prefix for DL (0=Normal CP, 1=Extended CP)
|
||||||
lte_prefix_type_t Ncp;
|
nr_prefix_type_t Ncp;
|
||||||
/// sequence which is computed based on carrier frequency and numerology to rotate/derotate each OFDM symbol according to Section 5.3 in 38.211
|
/// sequence which is computed based on carrier frequency and numerology to rotate/derotate each OFDM symbol according to Section 5.3 in 38.211
|
||||||
/// First dimension is for the direction of the link (0 DL, 1 UL, 2 SL)
|
/// First dimension is for the direction of the link (0 DL, 1 UL, 2 SL)
|
||||||
c16_t symbol_rotation[3][224];
|
c16_t symbol_rotation[3][224];
|
||||||
|
|||||||
@@ -338,7 +338,7 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
|
|||||||
slot,
|
slot,
|
||||||
fp->N_RB_DL,
|
fp->N_RB_DL,
|
||||||
0,
|
0,
|
||||||
fp->Ncp == EXTENDED ? 12 : 14);
|
fp->Ncp == NR_EXTENDED ? 12 : 14);
|
||||||
}
|
}
|
||||||
T(T_GNB_PHY_DL_OUTPUT_SIGNAL,
|
T(T_GNB_PHY_DL_OUTPUT_SIGNAL,
|
||||||
T_INT(0),
|
T_INT(0),
|
||||||
|
|||||||
@@ -374,7 +374,7 @@ int main(int argc, char **argv)
|
|||||||
frame_parms->nb_antennas_tx = n_tx;
|
frame_parms->nb_antennas_tx = n_tx;
|
||||||
frame_parms->nb_antennas_rx = n_rx;
|
frame_parms->nb_antennas_rx = n_rx;
|
||||||
frame_parms->N_RB_DL = N_RB_DL;
|
frame_parms->N_RB_DL = N_RB_DL;
|
||||||
frame_parms->Ncp = extended_prefix_flag ? EXTENDED : NORMAL;
|
frame_parms->Ncp = extended_prefix_flag ? NR_EXTENDED : NR_NORMAL;
|
||||||
crcTableInit();
|
crcTableInit();
|
||||||
nr_phy_config_request_sim(gNB, N_RB_DL, N_RB_DL, mu, Nid_cell,SSB_positions);
|
nr_phy_config_request_sim(gNB, N_RB_DL, N_RB_DL, mu, Nid_cell,SSB_positions);
|
||||||
// TDD configuration
|
// TDD configuration
|
||||||
|
|||||||
@@ -338,7 +338,7 @@ int main(int argc, char *argv[])
|
|||||||
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
|
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
|
||||||
fp->N_RB_DL = N_RB_DL;
|
fp->N_RB_DL = N_RB_DL;
|
||||||
fp->N_RB_UL = N_RB_UL;
|
fp->N_RB_UL = N_RB_UL;
|
||||||
fp->Ncp = extended_prefix_flag ? EXTENDED : NORMAL;
|
fp->Ncp = extended_prefix_flag ? NR_EXTENDED : NR_NORMAL;
|
||||||
fp->nb_antennas_tx = n_tx;
|
fp->nb_antennas_tx = n_tx;
|
||||||
fp->nb_antennas_rx = n_rx;
|
fp->nb_antennas_rx = n_rx;
|
||||||
fp->threequarter_fs = threequarter_fs;
|
fp->threequarter_fs = threequarter_fs;
|
||||||
|
|||||||
@@ -393,7 +393,7 @@ int main(int argc, char **argv)
|
|||||||
frame_parms = &gNB->frame_parms; //to be initialized I suppose (maybe not necessary for PBCH)
|
frame_parms = &gNB->frame_parms; //to be initialized I suppose (maybe not necessary for PBCH)
|
||||||
frame_parms->N_RB_DL = N_RB_DL;
|
frame_parms->N_RB_DL = N_RB_DL;
|
||||||
frame_parms->N_RB_UL = N_RB_UL;
|
frame_parms->N_RB_UL = N_RB_UL;
|
||||||
frame_parms->Ncp = extended_prefix_flag ? EXTENDED : NORMAL;
|
frame_parms->Ncp = extended_prefix_flag ? NR_EXTENDED : NR_NORMAL;
|
||||||
gNB->max_ldpc_iterations = max_ldpc_iterations;
|
gNB->max_ldpc_iterations = max_ldpc_iterations;
|
||||||
|
|
||||||
crcTableInit();
|
crcTableInit();
|
||||||
|
|||||||
@@ -741,7 +741,7 @@ int main(int argc, char *argv[])
|
|||||||
gNB->pusch_thres = -20;
|
gNB->pusch_thres = -20;
|
||||||
gNB->frame_parms.N_RB_DL = N_RB_DL;
|
gNB->frame_parms.N_RB_DL = N_RB_DL;
|
||||||
gNB->frame_parms.N_RB_UL = N_RB_UL;
|
gNB->frame_parms.N_RB_UL = N_RB_UL;
|
||||||
gNB->frame_parms.Ncp = extended_prefix_flag ? EXTENDED : NORMAL;
|
gNB->frame_parms.Ncp = extended_prefix_flag ? NR_EXTENDED : NR_NORMAL;
|
||||||
|
|
||||||
AssertFatal((gNB->if_inst = NR_IF_Module_init(0)) != NULL, "Cannot register interface");
|
AssertFatal((gNB->if_inst = NR_IF_Module_init(0)) != NULL, "Cannot register interface");
|
||||||
gNB->if_inst->NR_PHY_config_req = nr_phy_config_request;
|
gNB->if_inst->NR_PHY_config_req = nr_phy_config_request;
|
||||||
|
|||||||
Reference in New Issue
Block a user