Merge remote-tracking branch 'origin/pusch-llr-parallelize' into integration_2023_w39
This commit is contained in:
@@ -1040,6 +1040,7 @@ set(PHY_SRC_UE
|
||||
${OPENAIR1_DIR}/PHY/NR_REFSIG/dmrs_nr.c
|
||||
${OPENAIR1_DIR}/PHY/NR_REFSIG/ptrs_nr.c
|
||||
${OPENAIR1_DIR}/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c
|
||||
${OPENAIR1_DIR}/PHY/NR_ESTIMATION/nr_freq_equalization.c
|
||||
${OPENAIR1_DIR}/PHY/NR_ESTIMATION/nr_measurements_gNB.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/file_output.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/cadd_vv.c
|
||||
|
||||
@@ -475,10 +475,12 @@ void init_gNB_Tpool(int inst) {
|
||||
PHY_VARS_gNB *gNB;
|
||||
gNB = RC.gNB[inst];
|
||||
gNB_L1_proc_t *proc = &gNB->proc;
|
||||
|
||||
// PUSCH symbols per thread need to be calculated by how many threads we have
|
||||
gNB->num_pusch_symbols_per_thread = 1;
|
||||
// ULSCH decoding threadpool
|
||||
initTpool(get_softmodem_params()->threadPoolConfig, &gNB->threadPool, cpumeas(CPUMEAS_GETSTATE));
|
||||
// ULSCH decoder result FIFO
|
||||
initNotifiedFIFO(&gNB->respPuschSymb);
|
||||
initNotifiedFIFO(&gNB->respDecode);
|
||||
|
||||
// L1 RX result FIFO
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_pbch_defs.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_transport_common_proto.h"
|
||||
#include "PHY/NR_ESTIMATION/nr_ul_estimation.h"
|
||||
#include "openair1/PHY/MODULATION/nr_modulation.h"
|
||||
#include "openair1/PHY/defs_RU.h"
|
||||
#include "openair1/PHY/CODING/nrLDPC_extern.h"
|
||||
@@ -525,6 +526,8 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB)
|
||||
init_scrambling_luts();
|
||||
init_pucch2_luts();
|
||||
|
||||
nr_init_fde(); // Init array for frequency equalization of transform precoding of PUSCH
|
||||
|
||||
load_nrLDPClib(NULL);
|
||||
|
||||
if (gNB->ldpc_offload_flag)
|
||||
@@ -683,7 +686,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB)
|
||||
int n_buf = Prx*max_ul_mimo_layers;
|
||||
|
||||
int nb_re_pusch = N_RB_UL * NR_NB_SC_PER_RB;
|
||||
int nb_re_pusch2 = nb_re_pusch + (nb_re_pusch&7);
|
||||
int nb_re_pusch2 = (nb_re_pusch + 7) & ~7;
|
||||
|
||||
gNB->pusch_vars = (NR_gNB_PUSCH *)malloc16_clear(gNB->max_nb_pusch * sizeof(NR_gNB_PUSCH));
|
||||
for (int ULSCH_id = 0; ULSCH_id < gNB->max_nb_pusch; ULSCH_id++) {
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "PHY/sse_intrin.h"
|
||||
#include "PHY/NR_ESTIMATION/nr_ul_estimation.h"
|
||||
|
||||
// Reference of openair1/PHY/LTE_ESTIMATION/freq_equalization.c
|
||||
|
||||
// This is 4096/(1:4096) in simde__m128i format
|
||||
static simde__m128i nr_inv_ch[4096]; /* = {0, 4096/1, 4096/2, 4096/3, 4096/4...}*/
|
||||
|
||||
void nr_init_fde()
|
||||
{
|
||||
for (int i = 1;i < 4096; i++)
|
||||
nr_inv_ch[i] = simde_mm_set1_epi16(4096/i);
|
||||
}
|
||||
|
||||
void nr_freq_equalization (NR_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t *rxdataF_comp,
|
||||
int32_t *ul_ch_mag,
|
||||
int32_t *ul_ch_magb,
|
||||
uint8_t symbol,
|
||||
uint16_t Msc_RS,
|
||||
uint8_t Qm)
|
||||
{
|
||||
simde__m128i *rxdataF_comp128 = (simde__m128i *)rxdataF_comp;
|
||||
simde__m128i *ul_ch_mag128 = (simde__m128i *)ul_ch_mag;
|
||||
simde__m128i *ul_ch_magb128 = (simde__m128i *)ul_ch_magb;
|
||||
|
||||
AssertFatal(symbol < frame_parms->symbols_per_slot, "symbol %d >= %d\n",
|
||||
symbol, frame_parms->symbols_per_slot);
|
||||
AssertFatal(Msc_RS <= frame_parms->N_RB_UL*12, "Msc_RS %d >= %d\n",
|
||||
Msc_RS, frame_parms->N_RB_UL*12);
|
||||
|
||||
for (uint16_t re = 0; re < (Msc_RS >> 2); re++) {
|
||||
int16_t amp = (*((int16_t*)&ul_ch_mag128[re]));
|
||||
|
||||
if (amp > 4095)
|
||||
amp = 4095;
|
||||
|
||||
rxdataF_comp128[re] = simde_mm_srai_epi16(simde_mm_mullo_epi16(rxdataF_comp128[re],nr_inv_ch[amp]),3);
|
||||
|
||||
if (Qm == 4)
|
||||
ul_ch_mag128[re] = simde_mm_set1_epi16(324); // this is 512*2/sqrt(10)
|
||||
else if (Qm == 6) {
|
||||
ul_ch_mag128[re] = simde_mm_set1_epi16(316); // this is 512*4/sqrt(42)
|
||||
ul_ch_magb128[re] = simde_mm_set1_epi16(158); // this is 512*2/sqrt(42)
|
||||
} else if(Qm != 2)
|
||||
AssertFatal(1, "nr_freq_equalization(), Qm = %d, should be 2, 4 or 6. symbol=%d, Msc_RS=%d\n", Qm, symbol, Msc_RS);
|
||||
}
|
||||
}
|
||||
@@ -486,6 +486,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
* 2) Interpolate PTRS estimated value in TD after all PTRS symbols
|
||||
* 3) Compensated DMRS based estimated signal with PTRS estimation for slot
|
||||
*********************************************************************/
|
||||
// #define DEBUG_UL_PTRS
|
||||
void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
nfapi_nr_pusch_pdu_t *rel15_ul,
|
||||
@@ -495,7 +496,6 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
|
||||
uint32_t nb_re_pusch)
|
||||
{
|
||||
NR_gNB_PUSCH *pusch_vars = &gNB->pusch_vars[ulsch_id];
|
||||
//#define DEBUG_UL_PTRS 1
|
||||
int32_t *ptrs_re_symbol = NULL;
|
||||
int8_t ret = 0;
|
||||
uint8_t symbInSlot = rel15_ul->start_symbol_index + rel15_ul->nr_of_symbols;
|
||||
@@ -573,13 +573,6 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG_UL_PTRS
|
||||
LOG_M("ptrsEstUl.m", "est", pusch_vars->ptrs_phase_per_slot[aarx], frame_parms->symbols_per_slot, 1, 1);
|
||||
LOG_M("rxdataF_bf_ptrs_comp_ul.m","bf_ptrs_cmp",
|
||||
&gNB->pusch_vars[0]->rxdataF_comp[aarx][rel15_ul->start_symbol_index * NR_NB_SC_PER_RB * rel15_ul->rb_size],
|
||||
rel15_ul->nr_of_symbols * NR_NB_SC_PER_RB * rel15_ul->rb_size,1,1);
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------------------------------------- */
|
||||
/* 3) Compensated DMRS based estimated signal with PTRS estimation */
|
||||
/*--------------------------------------------------------------------------------------------------------*/
|
||||
@@ -590,15 +583,15 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
|
||||
#ifdef DEBUG_UL_PTRS
|
||||
printf("[PHY][UL][PTRS]: Rotate Symbol %2d with %d + j* %d\n", i, phase_per_symbol[i].r,phase_per_symbol[i].i);
|
||||
#endif
|
||||
rotate_cpx_vector((c16_t *)&pusch_vars->rxdataF_comp[aarx][(i * rel15_ul->rb_size * NR_NB_SC_PER_RB)],
|
||||
rotate_cpx_vector((c16_t *)&pusch_vars->rxdataF_comp[aarx][i * nb_re_pusch],
|
||||
&phase_per_symbol[i],
|
||||
(c16_t *)&pusch_vars->rxdataF_comp[aarx][(i * rel15_ul->rb_size * NR_NB_SC_PER_RB)],
|
||||
(c16_t *)&pusch_vars->rxdataF_comp[aarx][i * nb_re_pusch],
|
||||
((*nb_rb) * NR_NB_SC_PER_RB),
|
||||
15);
|
||||
}// if not DMRS Symbol
|
||||
}// symbol loop
|
||||
}// last symbol check
|
||||
}//Antenna loop
|
||||
} // if not DMRS Symbol
|
||||
} // symbol loop
|
||||
} // last symbol check
|
||||
} // Antenna loop
|
||||
}
|
||||
|
||||
uint32_t calc_power(const int16_t *x, const uint32_t size) {
|
||||
|
||||
@@ -83,4 +83,15 @@ int nr_srs_channel_estimation(const PHY_VARS_gNB *gNB,
|
||||
int32_t srs_estimated_channel_time_shifted[][1<<srs_pdu->num_ant_ports][gNB->frame_parms.ofdm_symbol_size],
|
||||
int8_t *snr_per_rb,
|
||||
int8_t *snr);
|
||||
|
||||
void nr_freq_equalization(NR_DL_FRAME_PARMS *frame_parms,
|
||||
int *rxdataF_comp,
|
||||
int *ul_ch_mag,
|
||||
int *ul_ch_mag_b,
|
||||
unsigned char symbol,
|
||||
unsigned short Msc_RS,
|
||||
unsigned char Qm);
|
||||
|
||||
void nr_init_fde(void);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -76,3 +76,21 @@ void nr_codeword_unscrambling(int16_t* llr, uint32_t size, uint8_t q, uint32_t N
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void nr_codeword_unscrambling_init(int16_t *s2, uint32_t size, uint8_t q, uint32_t Nid, uint32_t n_RNTI)
|
||||
{
|
||||
uint32_t x1;
|
||||
uint32_t x2 = (n_RNTI << 15) + (q << 14) + Nid;
|
||||
simde__m128i *s128=(simde__m128i *)s2;
|
||||
|
||||
uint32_t s = lte_gold_generic(&x1, &x2, 1);
|
||||
uint8_t *s8=(uint8_t *)&s;
|
||||
|
||||
for (int i = 0; i < (size +31) >> 5; i++) {
|
||||
*s128++ = byte2m128i[s8[0]];
|
||||
*s128++ = byte2m128i[s8[1]];
|
||||
*s128++ = byte2m128i[s8[2]];
|
||||
*s128++ = byte2m128i[s8[3]];
|
||||
s = lte_gold_generic(&x1, &x2, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,6 +73,7 @@ void nr_codeword_scrambling(uint8_t *in,
|
||||
uint32_t* out);
|
||||
|
||||
void nr_codeword_unscrambling(int16_t* llr, uint32_t size, uint8_t q, uint32_t Nid, uint32_t n_RNTI);
|
||||
void nr_codeword_unscrambling_init(int16_t *s, uint32_t size, uint8_t q, uint32_t Nid, uint32_t n_RNTI);
|
||||
|
||||
/**@}*/
|
||||
|
||||
|
||||
@@ -125,82 +125,11 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t *dlsch, uint16_t N_RB, const NR_DL_FRAME_PARM
|
||||
@param slot Slot number
|
||||
@param harq_pid HARQ process ID
|
||||
*/
|
||||
void nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
uint8_t UE_id,
|
||||
uint32_t frame,
|
||||
uint8_t slot,
|
||||
unsigned char harq_pid);
|
||||
|
||||
/** \brief This function performs RB extraction (signal and channel estimates) (currently signal only until channel estimation and compensation are implemented)
|
||||
@param rxdataF pointer to the received frequency domain signal
|
||||
@param rxdataF_ext pointer to the extracted frequency domain signal
|
||||
@param rb_alloc RB allocation map (used for Resource Allocation Type 0 in NR)
|
||||
@param symbol Symbol on which to act (within-in nr_TTI_rx)
|
||||
@param start_rb The starting RB in the RB allocation (used for Resource Allocation Type 1 in NR)
|
||||
@param nb_rb_pusch The number of RBs allocated (used for Resource Allocation Type 1 in NR)
|
||||
@param frame_parms, Pointer to frame descriptor structure
|
||||
*/
|
||||
void nr_ulsch_extract_rbs(c16_t **rxdataF,
|
||||
NR_gNB_PUSCH *pusch_vars,
|
||||
int slot,
|
||||
unsigned char symbol,
|
||||
uint8_t is_dmrs_symbol,
|
||||
nfapi_nr_pusch_pdu_t *pusch_pdu,
|
||||
NR_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
void nr_ulsch_scale_channel(int32_t **ul_ch_estimates_ext,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
NR_gNB_ULSCH_t *ulsch_gNB,
|
||||
uint8_t symbol,
|
||||
uint8_t is_dmrs_symbol,
|
||||
uint32_t len,
|
||||
uint8_t nrOfLayers,
|
||||
uint16_t nb_rb,
|
||||
int shift_ch_ext);
|
||||
|
||||
/** \brief This function computes the average channel level over all allocated RBs and antennas (TX/RX) in order to compute output shift for compensated signal
|
||||
@param ul_ch_estimates_ext Channel estimates in allocated RBs
|
||||
@param frame_parms Pointer to frame descriptor
|
||||
@param avg Pointer to average signal strength
|
||||
@param pilots_flag Flag to indicate pilots in symbol
|
||||
@param nb_rb Number of allocated RBs
|
||||
*/
|
||||
void nr_ulsch_channel_level(int **ul_ch_estimates_ext,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t *avg,
|
||||
uint8_t symbol,
|
||||
uint32_t len,
|
||||
uint8_t nrOfLayers,
|
||||
unsigned short nb_rb);
|
||||
|
||||
/** \brief This function performs channel compensation (matched filtering) on the received RBs for this allocation. In addition, it computes the squared-magnitude of the channel with weightings for 16QAM/64QAM detection as well as dual-stream detection (cross-correlation)
|
||||
@param rxdataF_ext Frequency-domain received signal in RBs to be demodulated
|
||||
@param ul_ch_estimates_ext Frequency-domain channel estimates in RBs to be demodulated
|
||||
@param ul_ch_mag First Channel magnitudes (16QAM/64QAM/256QAM)
|
||||
@param ul_ch_magb Second weighted Channel magnitudes (64QAM/256QAM)
|
||||
@param ul_ch_magc Third weighted Channel magnitudes (256QAM)
|
||||
@param rxdataF_comp Compensated received waveform
|
||||
@param frame_parms Pointer to frame descriptor
|
||||
@param symbol Symbol on which to operate
|
||||
@param Qm Modulation order of allocation
|
||||
@param nb_rb Number of RBs in allocation
|
||||
@param output_shift Rescaling for compensated output (should be energy-normalizing)
|
||||
*/
|
||||
void nr_ulsch_channel_compensation(int **rxdataF_ext,
|
||||
int **ul_ch_estimates_ext,
|
||||
int **ul_ch_mag,
|
||||
int **ul_ch_magb,
|
||||
int **ul_ch_magc,
|
||||
int **rxdataF_comp,
|
||||
int ***rho,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
unsigned char symbol,
|
||||
int length,
|
||||
uint8_t is_dmrs_symbol,
|
||||
unsigned char mod_order,
|
||||
uint8_t nrOfLayers,
|
||||
unsigned short nb_rb,
|
||||
unsigned char output_shift);
|
||||
int nr_rx_pusch_tp(PHY_VARS_gNB *gNB,
|
||||
uint8_t ulsch_id,
|
||||
uint32_t frame,
|
||||
uint8_t slot,
|
||||
unsigned char harq_pid);
|
||||
|
||||
/*!
|
||||
\brief This function implements the idft transform precoding in PUSCH
|
||||
@@ -209,6 +138,28 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
|
||||
*/
|
||||
void nr_idft(int32_t *z, uint32_t Msc_PUSCH);
|
||||
|
||||
void nr_ulsch_qpsk_qpsk(c16_t *stream0_in,
|
||||
c16_t *stream1_in,
|
||||
c16_t *stream0_out,
|
||||
c16_t *rho01,
|
||||
uint32_t length);
|
||||
|
||||
void nr_ulsch_qam16_qam16(c16_t *stream0_in,
|
||||
c16_t *stream1_in,
|
||||
c16_t *ch_mag,
|
||||
c16_t *ch_mag_i,
|
||||
c16_t *stream0_out,
|
||||
c16_t *rho01,
|
||||
uint32_t length);
|
||||
|
||||
void nr_ulsch_qam64_qam64(c16_t *stream0_in,
|
||||
c16_t *stream1_in,
|
||||
c16_t *ch_mag,
|
||||
c16_t *ch_mag_i,
|
||||
c16_t *stream0_out,
|
||||
c16_t *rho01,
|
||||
uint32_t length);
|
||||
|
||||
/** \brief This function generates log-likelihood ratios (decoder input) for single-stream QPSK received waveforms.
|
||||
@param rxdataF_comp Compensated channel output
|
||||
@param ulsch_llr llr output
|
||||
@@ -216,7 +167,7 @@ void nr_idft(int32_t *z, uint32_t Msc_PUSCH);
|
||||
@param symbol OFDM symbol index in sub-frame
|
||||
*/
|
||||
void nr_ulsch_qpsk_llr(int32_t *rxdataF_comp,
|
||||
int16_t *ulsch_llr,
|
||||
int16_t *ulsch_llr,
|
||||
uint32_t nb_re,
|
||||
uint8_t symbol);
|
||||
|
||||
@@ -231,11 +182,9 @@ void nr_ulsch_qpsk_llr(int32_t *rxdataF_comp,
|
||||
void nr_ulsch_16qam_llr(int32_t *rxdataF_comp,
|
||||
int32_t **ul_ch_mag,
|
||||
int16_t *ulsch_llr,
|
||||
uint32_t nb_rb,
|
||||
uint32_t nb_re,
|
||||
uint8_t symbol);
|
||||
|
||||
|
||||
/** \brief This function generates log-likelihood ratios (decoder input) for single-stream 64 QAM received waveforms.
|
||||
@param rxdataF_comp Compensated channel output
|
||||
@param ul_ch_mag uplink channel magnitude multiplied by the 1st amplitude threshold in QAM 64
|
||||
@@ -248,7 +197,6 @@ void nr_ulsch_64qam_llr(int32_t *rxdataF_comp,
|
||||
int32_t **ul_ch_mag,
|
||||
int32_t **ul_ch_magb,
|
||||
int16_t *ulsch_llr,
|
||||
uint32_t nb_rb,
|
||||
uint32_t nb_re,
|
||||
uint8_t symbol);
|
||||
|
||||
@@ -266,7 +214,6 @@ void nr_ulsch_256qam_llr(int32_t *rxdataF_comp,
|
||||
int32_t **ul_ch_magb,
|
||||
int32_t **ul_ch_magc,
|
||||
int16_t *ulsch_llr,
|
||||
uint32_t nb_rb,
|
||||
uint32_t nb_re,
|
||||
uint8_t symbol);
|
||||
|
||||
@@ -284,7 +231,6 @@ void nr_ulsch_compute_llr(int32_t *rxdataF_comp,
|
||||
int32_t *ul_ch_magb,
|
||||
int32_t *ul_ch_magc,
|
||||
int16_t *ulsch_llr,
|
||||
uint32_t nb_rb,
|
||||
uint32_t nb_re,
|
||||
uint8_t symbol,
|
||||
uint8_t mod_order);
|
||||
@@ -292,15 +238,17 @@ void nr_ulsch_compute_llr(int32_t *rxdataF_comp,
|
||||
void reset_active_stats(PHY_VARS_gNB *gNB, int frame);
|
||||
void reset_active_ulsch(PHY_VARS_gNB *gNB, int frame);
|
||||
|
||||
void nr_ulsch_compute_ML_llr(int32_t **rxdataF_comp,
|
||||
int32_t **ul_ch_mag,
|
||||
int32_t ***rho,
|
||||
int16_t **llr_layers,
|
||||
uint8_t nb_antennas_rx,
|
||||
uint32_t rb_size,
|
||||
void nr_ulsch_compute_ML_llr(NR_gNB_PUSCH *pusch_vars,
|
||||
uint32_t symbol,
|
||||
c16_t* rxdataF_comp0,
|
||||
c16_t* rxdataF_comp1,
|
||||
c16_t* ul_ch_mag0,
|
||||
c16_t* ul_ch_mag1,
|
||||
c16_t* llr_layers0,
|
||||
c16_t* llr_layers1,
|
||||
c16_t* rho0,
|
||||
c16_t* rho1,
|
||||
uint32_t nb_re,
|
||||
uint8_t symbol,
|
||||
uint32_t rxdataF_ext_offset,
|
||||
uint8_t mod_order);
|
||||
|
||||
void nr_ulsch_shift_llr(int16_t **llr_layers, uint32_t nb_re, uint32_t rxdataF_ext_offset, uint8_t mod_order, int shift);
|
||||
|
||||
@@ -122,7 +122,6 @@ NR_gNB_ULSCH_t new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL)
|
||||
static void nr_processULSegment(void *arg)
|
||||
{
|
||||
ldpcDecode_t *rdata = (ldpcDecode_t *)arg;
|
||||
PHY_VARS_gNB *phy_vars_gNB = rdata->gNB;
|
||||
NR_UL_gNB_HARQ_t *ulsch_harq = rdata->ulsch_harq;
|
||||
t_nrLDPC_dec_params *p_decoderParms = &rdata->decoderParms;
|
||||
int length_dec;
|
||||
@@ -156,8 +155,6 @@ static void nr_processULSegment(void *arg)
|
||||
t_nrLDPC_time_stats procTime = {0};
|
||||
t_nrLDPC_time_stats *p_procTime = &procTime;
|
||||
|
||||
// start_meas(&phy_vars_gNB->ulsch_deinterleaving_stats);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////// nr_deinterleaving_ldpc ///////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -172,7 +169,6 @@ static void nr_processULSegment(void *arg)
|
||||
// for (int i =0; i<16; i++)
|
||||
// printf("rx output deinterleaving w[%d]= %d r_offset %d\n", i,ulsch_harq->w[r][i], r_offset);
|
||||
|
||||
stop_meas(&phy_vars_gNB->ulsch_deinterleaving_stats);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -182,7 +178,6 @@ static void nr_processULSegment(void *arg)
|
||||
|
||||
///////////////////////// ulsch_harq->e =====> ulsch_harq->d /////////////////////////
|
||||
|
||||
// start_meas(&phy_vars_gNB->ulsch_rate_unmatching_stats);
|
||||
|
||||
if (nr_rate_matching_ldpc_rx(rdata->tbslbrm,
|
||||
p_decoderParms->BG,
|
||||
@@ -196,13 +191,10 @@ static void nr_processULSegment(void *arg)
|
||||
ulsch_harq->F,
|
||||
Kr - ulsch_harq->F - 2 * (p_decoderParms->Z))
|
||||
== -1) {
|
||||
stop_meas(&phy_vars_gNB->ulsch_rate_unmatching_stats);
|
||||
|
||||
LOG_E(PHY, "ulsch_decoding.c: Problem in rate_matching\n");
|
||||
rdata->decodeIterations = max_ldpc_iterations + 1;
|
||||
return;
|
||||
} else {
|
||||
stop_meas(&phy_vars_gNB->ulsch_rate_unmatching_stats);
|
||||
}
|
||||
|
||||
ulsch_harq->d_to_be_cleared[r] = false;
|
||||
@@ -221,7 +213,6 @@ static void nr_processULSegment(void *arg)
|
||||
length_dec = (ulsch_harq->B + 24 * ulsch_harq->C) / ulsch_harq->C;
|
||||
}
|
||||
|
||||
// start_meas(&phy_vars_gNB->ulsch_ldpc_decoding_stats);
|
||||
|
||||
// set first 2*Z_c bits to zeros
|
||||
memset(&z[0], 0, 2 * ulsch_harq->Z * sizeof(int16_t));
|
||||
@@ -248,7 +239,6 @@ static void nr_processULSegment(void *arg)
|
||||
|
||||
if (rdata->decodeIterations <= p_decoderParms->numMaxIter)
|
||||
memcpy(ulsch_harq->c[r],llrProcBuf, Kr>>3);
|
||||
//stop_meas(&phy_vars_gNB->ulsch_ldpc_decoding_stats);
|
||||
}
|
||||
|
||||
int nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -30,6 +30,7 @@
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include "PHY/defs_nr_common.h"
|
||||
#include "PHY/sse_intrin.h"
|
||||
#include "PHY/impl_defs_top.h"
|
||||
@@ -46,16 +47,9 @@ void nr_ulsch_qpsk_llr(int32_t *rxdataF_comp,
|
||||
{
|
||||
c16_t *rxF = (c16_t *)rxdataF_comp;
|
||||
c16_t *llr32 = (c16_t *)ulsch_llr;
|
||||
|
||||
if (!llr32) {
|
||||
LOG_E(PHY,"nr_ulsch_qpsk_llr: llr is null, symbol %d, llr32 = %p\n",symbol, llr32);
|
||||
}
|
||||
for (int i = 0; i < nb_re; i++) {
|
||||
//*llr32 = *rxF;
|
||||
llr32->r = rxF->r >> 3;
|
||||
llr32->i = rxF->i >> 3;
|
||||
rxF++;
|
||||
llr32++;
|
||||
llr32[i].r = rxF[i].r >> 3;
|
||||
llr32[i].i = rxF[i].i >> 3;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,72 +60,34 @@ void nr_ulsch_qpsk_llr(int32_t *rxdataF_comp,
|
||||
void nr_ulsch_16qam_llr(int32_t *rxdataF_comp,
|
||||
int32_t *ul_ch_mag,
|
||||
int16_t *ulsch_llr,
|
||||
uint32_t nb_rb,
|
||||
uint32_t nb_re,
|
||||
uint8_t symbol)
|
||||
{
|
||||
simde__m256i *rxF_256 = (simde__m256i*)rxdataF_comp;
|
||||
simde__m256i *ch_mag = (simde__m256i*)ul_ch_mag;
|
||||
int64_t *llr_64 = (int64_t*)ulsch_llr;
|
||||
|
||||
simde__m256i *rxF = (simde__m256i*)rxdataF_comp;
|
||||
simde__m256i *ch_mag;
|
||||
simde__m256i llr256[2];
|
||||
register simde__m256i xmm0;
|
||||
uint32_t *llr32;
|
||||
int i;
|
||||
simde__m256i xmm0, xmm1, xmm2;
|
||||
|
||||
int off = ((nb_rb&1) == 1)? 4:0;
|
||||
|
||||
llr32 = (uint32_t*)ulsch_llr;
|
||||
|
||||
ch_mag = (simde__m256i*)&ul_ch_mag[(symbol*(off+(nb_rb*12)))];
|
||||
unsigned char len_mod8 = nb_re&7;
|
||||
nb_re >>= 3; // length in quad words (4 REs)
|
||||
nb_re += (len_mod8 == 0 ? 0 : 1);
|
||||
|
||||
for (i=0; i<nb_re; i++) {
|
||||
xmm0 = simde_mm256_abs_epi16(rxF[i]); // registers of even index in xmm0-> |y_R|, registers of odd index in xmm0-> |y_I|
|
||||
xmm0 = simde_mm256_subs_epi16(ch_mag[i],xmm0); // registers of even index in xmm0-> |y_R|-|h|^2, registers of odd index in xmm0-> |y_I|-|h|^2
|
||||
for (int i = 0; i < ((nb_re + 7) >> 3); i++) {
|
||||
xmm0 = simde_mm256_abs_epi16(rxF_256[i]); // registers of even index in xmm0-> |y_R|, registers of odd index in xmm0-> |y_I|
|
||||
xmm0 = simde_mm256_subs_epi16(ch_mag[i], xmm0); // registers of even index in xmm0-> |y_R|-|h|^2, registers of odd index in xmm0-> |y_I|-|h|^2
|
||||
|
||||
llr256[0] = simde_mm256_unpacklo_epi32(rxF[i],xmm0); // llr128[0] contains the llrs of the 1st,2nd,5th and 6th REs
|
||||
llr256[1] = simde_mm256_unpackhi_epi32(rxF[i],xmm0); // llr128[1] contains the llrs of the 3rd, 4th, 7th and 8th REs
|
||||
xmm1 = simde_mm256_unpacklo_epi32(rxF_256[i], xmm0);
|
||||
xmm2 = simde_mm256_unpackhi_epi32(rxF_256[i], xmm0);
|
||||
|
||||
// xmm1 |1st 2ed 3rd 4th 9th 10th 13rd 14th|
|
||||
// xmm2 |5th 6th 7th 8th 11st 12ed 15th 16th|
|
||||
|
||||
// 1st RE
|
||||
llr32[0] = simde_mm256_extract_epi32(llr256[0],0); // llr32[0] low 16 bits-> y_R , high 16 bits-> y_I
|
||||
llr32[1] = simde_mm256_extract_epi32(llr256[0],1); // llr32[1] low 16 bits-> |h|-|y_R|^2, high 16 bits-> |h|-|y_I|^2
|
||||
|
||||
// 2nd RE
|
||||
llr32[2] = simde_mm256_extract_epi32(llr256[0],2); // llr32[2] low 16 bits-> y_R , high 16 bits-> y_I
|
||||
llr32[3] = simde_mm256_extract_epi32(llr256[0],3); // llr32[3] low 16 bits-> |h|-|y_R|^2, high 16 bits-> |h|-|y_I|^2
|
||||
|
||||
// 3rd RE
|
||||
llr32[4] = simde_mm256_extract_epi32(llr256[1],0); // llr32[4] low 16 bits-> y_R , high 16 bits-> y_I
|
||||
llr32[5] = simde_mm256_extract_epi32(llr256[1],1); // llr32[5] low 16 bits-> |h|-|y_R|^2, high 16 bits-> |h|-|y_I|^2
|
||||
|
||||
// 4th RE
|
||||
llr32[6] = simde_mm256_extract_epi32(llr256[1],2); // llr32[6] low 16 bits-> y_R , high 16 bits-> y_I
|
||||
llr32[7] = simde_mm256_extract_epi32(llr256[1],3); // llr32[7] low 16 bits-> |h|-|y_R|^2, high 16 bits-> |h|-|y_I|^2
|
||||
|
||||
// 5th RE
|
||||
llr32[8] = simde_mm256_extract_epi32(llr256[0],4); // llr32[8] low 16 bits-> y_R , high 16 bits-> y_I
|
||||
llr32[9] = simde_mm256_extract_epi32(llr256[0],5); // llr32[9] low 16 bits-> |h|-|y_R|^2, high 16 bits-> |h|-|y_I|^2
|
||||
|
||||
// 6th RE
|
||||
llr32[10] = simde_mm256_extract_epi32(llr256[0],6); // llr32[10] low 16 bits-> y_R , high 16 bits-> y_I
|
||||
llr32[11] = simde_mm256_extract_epi32(llr256[0],7); // llr32[11] low 16 bits-> |h|-|y_R|^2, high 16 bits-> |h|-|y_I|^2
|
||||
|
||||
// 7th RE
|
||||
llr32[12] = simde_mm256_extract_epi32(llr256[1],4); // llr32[12] low 16 bits-> y_R , high 16 bits-> y_I
|
||||
llr32[13] = simde_mm256_extract_epi32(llr256[1],5); // llr32[13] low 16 bits-> |h|-|y_R|^2, high 16 bits-> |h|-|y_I|^2
|
||||
|
||||
// 8th RE
|
||||
llr32[14] = simde_mm256_extract_epi32(llr256[1],6); // llr32[14] low 16 bits-> y_R , high 16 bits-> y_I
|
||||
llr32[15] = simde_mm256_extract_epi32(llr256[1],7); // llr32[15] low 16 bits-> |h|-|y_R|^2, high 16 bits-> |h|-|y_I|^2
|
||||
|
||||
llr32+=16;
|
||||
|
||||
*llr_64++ = simde_mm256_extract_epi64(xmm1, 0);
|
||||
*llr_64++ = simde_mm256_extract_epi64(xmm1, 1);
|
||||
*llr_64++ = simde_mm256_extract_epi64(xmm2, 0);
|
||||
*llr_64++ = simde_mm256_extract_epi64(xmm2, 1);
|
||||
*llr_64++ = simde_mm256_extract_epi64(xmm1, 2);
|
||||
*llr_64++ = simde_mm256_extract_epi64(xmm1, 3);
|
||||
*llr_64++ = simde_mm256_extract_epi64(xmm2, 2);
|
||||
*llr_64++ = simde_mm256_extract_epi64(xmm2, 3);
|
||||
}
|
||||
|
||||
simde_mm_empty();
|
||||
simde_m_empty();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------
|
||||
@@ -142,232 +98,110 @@ void nr_ulsch_64qam_llr(int32_t *rxdataF_comp,
|
||||
int32_t *ul_ch_mag,
|
||||
int32_t *ul_ch_magb,
|
||||
int16_t *ulsch_llr,
|
||||
uint32_t nb_rb,
|
||||
uint32_t nb_re,
|
||||
uint8_t symbol)
|
||||
{
|
||||
int off = ((nb_rb&1) == 1)? 4:0;
|
||||
|
||||
simde__m256i *rxF = (simde__m256i*)rxdataF_comp;
|
||||
simde__m256i *ch_mag,*ch_magb;
|
||||
register simde__m256i xmm0,xmm1,xmm2;
|
||||
simde__m256i xmm0, xmm1, xmm2;
|
||||
|
||||
int i;
|
||||
simde__m256i *ch_maga = (simde__m256i*)ul_ch_mag;
|
||||
simde__m256i *ch_magb = (simde__m256i*)ul_ch_magb;
|
||||
|
||||
ch_mag = (simde__m256i*)&ul_ch_mag[(symbol*(off+(nb_rb*12)))];
|
||||
ch_magb = (simde__m256i*)&ul_ch_magb[(symbol*(off+(nb_rb*12)))];
|
||||
int32_t *llr_32 = (int32_t *)ulsch_llr;
|
||||
|
||||
int len_mod8 = nb_re&7;
|
||||
nb_re = nb_re>>3; // length in quad words (4 REs)
|
||||
nb_re += ((len_mod8 == 0) ? 0 : 1);
|
||||
|
||||
for (i=0; i<nb_re; i++) {
|
||||
for (int i = 0; i < ((nb_re + 7) >> 3); i++) {
|
||||
xmm0 = rxF[i];
|
||||
xmm1 = simde_mm256_abs_epi16(xmm0);
|
||||
xmm1 = simde_mm256_subs_epi16(ch_mag[i],xmm1);
|
||||
xmm1 = simde_mm256_abs_epi16(xmm0); // registers of even index in xmm0-> |y_R|, registers of odd index in xmm0-> |y_I|
|
||||
xmm1 = simde_mm256_subs_epi16(ch_maga[i], xmm1); // registers of even index in xmm0-> |y_R|-|h|^2, registers of odd index in xmm0-> |y_I|-|h|^2
|
||||
xmm2 = simde_mm256_abs_epi16(xmm1);
|
||||
xmm2 = simde_mm256_subs_epi16(ch_magb[i],xmm2);
|
||||
|
||||
// ---------------------------------------
|
||||
// 1st RE
|
||||
// ---------------------------------------
|
||||
ulsch_llr[0] = simde_mm256_extract_epi16(xmm0,0);
|
||||
ulsch_llr[1] = simde_mm256_extract_epi16(xmm0,1);
|
||||
ulsch_llr[2] = simde_mm256_extract_epi16(xmm1,0);
|
||||
ulsch_llr[3] = simde_mm256_extract_epi16(xmm1,1);
|
||||
ulsch_llr[4] = simde_mm256_extract_epi16(xmm2,0);
|
||||
ulsch_llr[5] = simde_mm256_extract_epi16(xmm2,1);
|
||||
// ---------------------------------------
|
||||
xmm2 = simde_mm256_subs_epi16(ch_magb[i], xmm2);
|
||||
// xmm0 |1st 4th 7th 10th 13th 16th 19th 22ed|
|
||||
// xmm1 |2ed 5th 8th 11th 14th 17th 20th 23rd|
|
||||
// xmm2 |3rd 6th 9th 12th 15th 18th 21st 24th|
|
||||
|
||||
ulsch_llr+=6;
|
||||
|
||||
// ---------------------------------------
|
||||
// 2nd RE
|
||||
// ---------------------------------------
|
||||
ulsch_llr[0] = simde_mm256_extract_epi16(xmm0,2);
|
||||
ulsch_llr[1] = simde_mm256_extract_epi16(xmm0,3);
|
||||
ulsch_llr[2] = simde_mm256_extract_epi16(xmm1,2);
|
||||
ulsch_llr[3] = simde_mm256_extract_epi16(xmm1,3);
|
||||
ulsch_llr[4] = simde_mm256_extract_epi16(xmm2,2);
|
||||
ulsch_llr[5] = simde_mm256_extract_epi16(xmm2,3);
|
||||
// ---------------------------------------
|
||||
*llr_32++ = simde_mm256_extract_epi32(xmm0,0);
|
||||
*llr_32++ = simde_mm256_extract_epi32(xmm1,0);
|
||||
*llr_32++ = simde_mm256_extract_epi32(xmm2,0);
|
||||
|
||||
ulsch_llr+=6;
|
||||
|
||||
// ---------------------------------------
|
||||
// 3rd RE
|
||||
// ---------------------------------------
|
||||
ulsch_llr[0] = simde_mm256_extract_epi16(xmm0,4);
|
||||
ulsch_llr[1] = simde_mm256_extract_epi16(xmm0,5);
|
||||
ulsch_llr[2] = simde_mm256_extract_epi16(xmm1,4);
|
||||
ulsch_llr[3] = simde_mm256_extract_epi16(xmm1,5);
|
||||
ulsch_llr[4] = simde_mm256_extract_epi16(xmm2,4);
|
||||
ulsch_llr[5] = simde_mm256_extract_epi16(xmm2,5);
|
||||
// ---------------------------------------
|
||||
*llr_32++ = simde_mm256_extract_epi32(xmm0,1);
|
||||
*llr_32++ = simde_mm256_extract_epi32(xmm1,1);
|
||||
*llr_32++ = simde_mm256_extract_epi32(xmm2,1);
|
||||
|
||||
ulsch_llr+=6;
|
||||
|
||||
// ---------------------------------------
|
||||
// 4th RE
|
||||
// ---------------------------------------
|
||||
ulsch_llr[0] = simde_mm256_extract_epi16(xmm0,6);
|
||||
ulsch_llr[1] = simde_mm256_extract_epi16(xmm0,7);
|
||||
ulsch_llr[2] = simde_mm256_extract_epi16(xmm1,6);
|
||||
ulsch_llr[3] = simde_mm256_extract_epi16(xmm1,7);
|
||||
ulsch_llr[4] = simde_mm256_extract_epi16(xmm2,6);
|
||||
ulsch_llr[5] = simde_mm256_extract_epi16(xmm2,7);
|
||||
// ---------------------------------------
|
||||
*llr_32++ = simde_mm256_extract_epi32(xmm0,2);
|
||||
*llr_32++ = simde_mm256_extract_epi32(xmm1,2);
|
||||
*llr_32++ = simde_mm256_extract_epi32(xmm2,2);
|
||||
|
||||
ulsch_llr+=6;
|
||||
ulsch_llr[0] = simde_mm256_extract_epi16(xmm0,8);
|
||||
ulsch_llr[1] = simde_mm256_extract_epi16(xmm0,9);
|
||||
ulsch_llr[2] = simde_mm256_extract_epi16(xmm1,8);
|
||||
ulsch_llr[3] = simde_mm256_extract_epi16(xmm1,9);
|
||||
ulsch_llr[4] = simde_mm256_extract_epi16(xmm2,8);
|
||||
ulsch_llr[5] = simde_mm256_extract_epi16(xmm2,9);
|
||||
*llr_32++ = simde_mm256_extract_epi32(xmm0,3);
|
||||
*llr_32++ = simde_mm256_extract_epi32(xmm1,3);
|
||||
*llr_32++ = simde_mm256_extract_epi32(xmm2,3);
|
||||
|
||||
ulsch_llr[6] = simde_mm256_extract_epi16(xmm0,10);
|
||||
ulsch_llr[7] = simde_mm256_extract_epi16(xmm0,11);
|
||||
ulsch_llr[8] = simde_mm256_extract_epi16(xmm1,10);
|
||||
ulsch_llr[9] = simde_mm256_extract_epi16(xmm1,11);
|
||||
ulsch_llr[10] = simde_mm256_extract_epi16(xmm2,10);
|
||||
ulsch_llr[11] = simde_mm256_extract_epi16(xmm2,11);
|
||||
*llr_32++ = simde_mm256_extract_epi32(xmm0,4);
|
||||
*llr_32++ = simde_mm256_extract_epi32(xmm1,4);
|
||||
*llr_32++ = simde_mm256_extract_epi32(xmm2,4);
|
||||
|
||||
ulsch_llr[12] = simde_mm256_extract_epi16(xmm0,12);
|
||||
ulsch_llr[13] = simde_mm256_extract_epi16(xmm0,13);
|
||||
ulsch_llr[14] = simde_mm256_extract_epi16(xmm1,12);
|
||||
ulsch_llr[15] = simde_mm256_extract_epi16(xmm1,13);
|
||||
ulsch_llr[16] = simde_mm256_extract_epi16(xmm2,12);
|
||||
ulsch_llr[17] = simde_mm256_extract_epi16(xmm2,13);
|
||||
*llr_32++ = simde_mm256_extract_epi32(xmm0,5);
|
||||
*llr_32++ = simde_mm256_extract_epi32(xmm1,5);
|
||||
*llr_32++ = simde_mm256_extract_epi32(xmm2,5);
|
||||
|
||||
ulsch_llr[18] = simde_mm256_extract_epi16(xmm0,14);
|
||||
ulsch_llr[19] = simde_mm256_extract_epi16(xmm0,15);
|
||||
ulsch_llr[20] = simde_mm256_extract_epi16(xmm1,14);
|
||||
ulsch_llr[21] = simde_mm256_extract_epi16(xmm1,15);
|
||||
ulsch_llr[22] = simde_mm256_extract_epi16(xmm2,14);
|
||||
ulsch_llr[23] = simde_mm256_extract_epi16(xmm2,15);
|
||||
*llr_32++ = simde_mm256_extract_epi32(xmm0,6);
|
||||
*llr_32++ = simde_mm256_extract_epi32(xmm1,6);
|
||||
*llr_32++ = simde_mm256_extract_epi32(xmm2,6);
|
||||
|
||||
ulsch_llr+=24;
|
||||
*llr_32++ = simde_mm256_extract_epi32(xmm0,7);
|
||||
*llr_32++ = simde_mm256_extract_epi32(xmm1,7);
|
||||
*llr_32++ = simde_mm256_extract_epi32(xmm2,7);
|
||||
}
|
||||
|
||||
simde_mm_empty();
|
||||
simde_m_empty();
|
||||
}
|
||||
|
||||
void nr_ulsch_256qam_llr(int32_t *rxdataF_comp,
|
||||
int32_t *ul_ch_mag,
|
||||
int32_t *ul_ch_magb,
|
||||
int32_t *ul_ch_magc,
|
||||
int16_t *ulsch_llr,
|
||||
uint32_t nb_rb,
|
||||
uint32_t nb_re,
|
||||
uint8_t symbol)
|
||||
int32_t *ul_ch_magc,
|
||||
int16_t *ulsch_llr,
|
||||
uint32_t nb_re,
|
||||
uint8_t symbol)
|
||||
{
|
||||
int off = ((nb_rb&1) == 1)? 4:0;
|
||||
|
||||
simde__m256i *rxF = (simde__m256i*)rxdataF_comp;
|
||||
simde__m256i *ch_mag,*ch_magb,*ch_magc;
|
||||
register simde__m256i xmm0,xmm1,xmm2,xmm3,xmm4,xmm5,xmm6;
|
||||
simde__m256i xmm0,xmm1,xmm2,xmm3,xmm4,xmm5,xmm6;
|
||||
simde__m256i *llr256=(simde__m256i*)ulsch_llr;
|
||||
|
||||
ch_mag = (simde__m256i*)&ul_ch_mag[(symbol*(off+(nb_rb*12)))];
|
||||
ch_magb = (simde__m256i*)&ul_ch_magb[(symbol*(off+(nb_rb*12)))];
|
||||
ch_magc = (simde__m256i*)&ul_ch_magc[(symbol*(off+(nb_rb*12)))];
|
||||
int len_mod8 = nb_re&7;
|
||||
int nb_re256 = nb_re>>3; // length in 256-bit words (8 REs)
|
||||
simde__m256i* ch_maga = (simde__m256i*)ul_ch_mag;
|
||||
simde__m256i* ch_magb = (simde__m256i*)ul_ch_magb;
|
||||
simde__m256i* ch_magc = (simde__m256i*)ul_ch_magc;
|
||||
|
||||
for (int i=0; i<nb_re256; i++) {
|
||||
xmm0 = simde_mm256_abs_epi16(rxF[i]); // registers of even index in xmm0-> |y_R|, registers of odd index in xmm0-> |y_I|
|
||||
xmm0 = simde_mm256_subs_epi16(ch_mag[i],xmm0); // registers of even index in xmm0-> |y_R|-|h|^2, registers of odd index in xmm0-> |y_I|-|h|^2
|
||||
// xmmtmpD2 contains 16 LLRs
|
||||
xmm1 = simde_mm256_abs_epi16(xmm0);
|
||||
xmm1 = simde_mm256_subs_epi16(ch_magb[i],xmm1); // contains 16 LLRs
|
||||
xmm2 = simde_mm256_abs_epi16(xmm1);
|
||||
xmm2 = simde_mm256_subs_epi16(ch_magc[i],xmm2); // contains 16 LLRs
|
||||
// rxF[i] A0 A1 A2 A3 A4 A5 A6 A7 bits 7,6
|
||||
// xmm0 B0 B1 B2 B3 B4 B5 B6 B7 bits 5,4
|
||||
// xmm1 C0 C1 C2 C3 C4 C5 C6 C7 bits 3,2
|
||||
// xmm2 D0 D1 D2 D3 D4 D5 D6 D7 bits 1,0
|
||||
xmm3 = simde_mm256_unpacklo_epi32(rxF[i],xmm0); // A0 B0 A1 B1 A4 B4 A5 B5
|
||||
xmm4 = simde_mm256_unpackhi_epi32(rxF[i],xmm0); // A2 B2 A3 B3 A6 B6 A7 B7
|
||||
xmm5 = simde_mm256_unpacklo_epi32(xmm1,xmm2); // C0 D0 C1 D1 C4 D4 C5 D5
|
||||
xmm6 = simde_mm256_unpackhi_epi32(xmm1,xmm2); // C2 D2 C3 D3 C6 D6 C7 D7
|
||||
|
||||
xmm0 = simde_mm256_unpacklo_epi64(xmm3,xmm5); // A0 B0 C0 D0 A4 B4 C4 D4
|
||||
xmm1 = simde_mm256_unpackhi_epi64(xmm3,xmm5); // A1 B1 C1 D1 A5 B5 C5 D5
|
||||
xmm2 = simde_mm256_unpacklo_epi64(xmm4,xmm6); // A2 B2 C2 D2 A6 B6 C6 D6
|
||||
xmm3 = simde_mm256_unpackhi_epi64(xmm4,xmm6); // A3 B3 C3 D3 A7 B7 C7 D7
|
||||
llr256[0] = simde_mm256_permute2x128_si256(xmm0, xmm1, 0x20); // A0 B0 C0 D0 A1 B1 C1 D1
|
||||
llr256[1] = simde_mm256_permute2x128_si256(xmm2, xmm3, 0x20); // A2 B2 C2 D2 A3 B3 C3 D3
|
||||
llr256[2] = simde_mm256_permute2x128_si256(xmm0, xmm1, 0x31); // A4 B4 C4 D4 A5 B5 C5 D5
|
||||
llr256[3] = simde_mm256_permute2x128_si256(xmm2, xmm3, 0x31); // A6 B6 C6 D6 A7 B7 C7 D7
|
||||
llr256+=4;
|
||||
for (int i = 0; i < ((nb_re + 7) >> 3); i++) {
|
||||
xmm0 = simde_mm256_abs_epi16(rxF[i]); // registers of even index in xmm0-> |y_R|, registers of odd index in xmm0-> |y_I|
|
||||
xmm0 = simde_mm256_subs_epi16(ch_maga[i], xmm0); // registers of even index in xmm0-> |y_R|-|h|^2, registers of odd index in xmm0-> |y_I|-|h|^2
|
||||
// xmmtmpD2 contains 16 LLRs
|
||||
xmm1 = simde_mm256_abs_epi16(xmm0);
|
||||
xmm1 = simde_mm256_subs_epi16(ch_magb[i], xmm1); // contains 16 LLRs
|
||||
xmm2 = simde_mm256_abs_epi16(xmm1);
|
||||
xmm2 = simde_mm256_subs_epi16(ch_magc[i], xmm2); // contains 16 LLRs
|
||||
// rxF[i] A0 A1 A2 A3 A4 A5 A6 A7 bits 7,6
|
||||
// xmm0 B0 B1 B2 B3 B4 B5 B6 B7 bits 5,4
|
||||
// xmm1 C0 C1 C2 C3 C4 C5 C6 C7 bits 3,2
|
||||
// xmm2 D0 D1 D2 D3 D4 D5 D6 D7 bits 1,0
|
||||
xmm3 = simde_mm256_unpacklo_epi32(rxF[i], xmm0); // A0 B0 A1 B1 A4 B4 A5 B5
|
||||
xmm4 = simde_mm256_unpackhi_epi32(rxF[i], xmm0); // A2 B2 A3 B3 A6 B6 A7 B7
|
||||
xmm5 = simde_mm256_unpacklo_epi32(xmm1, xmm2); // C0 D0 C1 D1 C4 D4 C5 D5
|
||||
xmm6 = simde_mm256_unpackhi_epi32(xmm1, xmm2); // C2 D2 C3 D3 C6 D6 C7 D7
|
||||
|
||||
xmm0 = simde_mm256_unpacklo_epi64(xmm3, xmm5); // A0 B0 C0 D0 A4 B4 C4 D4
|
||||
xmm1 = simde_mm256_unpackhi_epi64(xmm3, xmm5); // A1 B1 C1 D1 A5 B5 C5 D5
|
||||
xmm2 = simde_mm256_unpacklo_epi64(xmm4, xmm6); // A2 B2 C2 D2 A6 B6 C6 D6
|
||||
xmm3 = simde_mm256_unpackhi_epi64(xmm4, xmm6); // A3 B3 C3 D3 A7 B7 C7 D7
|
||||
*llr256++ = simde_mm256_permute2x128_si256(xmm0, xmm1, 0x20); // A0 B0 C0 D0 A1 B1 C1 D1
|
||||
*llr256++ = simde_mm256_permute2x128_si256(xmm2, xmm3, 0x20); // A2 B2 C2 D2 A3 B3 C3 D3
|
||||
*llr256++ = simde_mm256_permute2x128_si256(xmm0, xmm1, 0x31); // A4 B4 C4 D4 A5 B5 C5 D5
|
||||
*llr256++ = simde_mm256_permute2x128_si256(xmm2, xmm3, 0x31); // A6 B6 C6 D6 A7 B7 C7 D7
|
||||
}
|
||||
simde__m128i *llr128 = (simde__m128i*)llr256;
|
||||
if (len_mod8 >= 4) {
|
||||
int nb_re128 = nb_re>>2;
|
||||
simde__m128i xmm0,xmm1,xmm2,xmm3,xmm4,xmm5,xmm6;
|
||||
simde__m128i *rxF = (simde__m128i*)rxdataF_comp;
|
||||
simde__m128i *ch_mag = (simde__m128i*)&ul_ch_mag[(symbol*(off+(nb_rb*12)))];
|
||||
simde__m128i *ch_magb = (simde__m128i*)&ul_ch_magb[(symbol*(off+(nb_rb*12)))];
|
||||
simde__m128i *ch_magc = (simde__m128i*)&ul_ch_magc[(symbol*(off+(nb_rb*12)))];
|
||||
|
||||
xmm0 = simde_mm_abs_epi16(rxF[nb_re128-1]); // registers of even index in xmm0-> |y_R|, registers of odd index in xmm0-> |y_I|
|
||||
xmm0 = simde_mm_subs_epi16(ch_mag[nb_re128-1],xmm0); // registers of even index in xmm0-> |y_R|-|h|^2, registers of odd index in xmm0-> |y_I|-|h|^2
|
||||
// xmmtmpD2 contains 8 LLRs
|
||||
xmm1 = simde_mm_abs_epi16(xmm0);
|
||||
xmm1 = simde_mm_subs_epi16(ch_magb[nb_re128-1],xmm1); // contains 8 LLRs
|
||||
xmm2 = simde_mm_abs_epi16(xmm1);
|
||||
xmm2 = simde_mm_subs_epi16(ch_magc[nb_re128-1],xmm2); // contains 8 LLRs
|
||||
// rxF[i] A0 A1 A2 A3
|
||||
// xmm0 B0 B1 B2 B3
|
||||
// xmm1 C0 C1 C2 C3
|
||||
// xmm2 D0 D1 D2 D3
|
||||
xmm3 = simde_mm_unpacklo_epi32(rxF[nb_re128-1],xmm0); // A0 B0 A1 B1
|
||||
xmm4 = simde_mm_unpackhi_epi32(rxF[nb_re128-1],xmm0); // A2 B2 A3 B3
|
||||
xmm5 = simde_mm_unpacklo_epi32(xmm1,xmm2); // C0 D0 C1 D1
|
||||
xmm6 = simde_mm_unpackhi_epi32(xmm1,xmm2); // C2 D2 C3 D3
|
||||
|
||||
llr128[0] = simde_mm_unpacklo_epi64(xmm3,xmm5); // A0 B0 C0 D0
|
||||
llr128[1] = simde_mm_unpackhi_epi64(xmm3,xmm5); // A1 B1 C1 D1
|
||||
llr128[2] = simde_mm_unpacklo_epi64(xmm4,xmm6); // A2 B2 C2 D2
|
||||
llr128[3] = simde_mm_unpackhi_epi64(xmm4,xmm6); // A3 B3 C3 D3
|
||||
llr128+=4;
|
||||
}
|
||||
if (len_mod8 == 6) {
|
||||
int nb_re64 = nb_re>>1;
|
||||
simde__m64 *llr64 = (simde__m64 *)llr128;
|
||||
simde__m64 xmm0,xmm1,xmm2;
|
||||
simde__m64 *rxF = (simde__m64*)rxdataF_comp;
|
||||
simde__m64 *ch_mag = (simde__m64*)&ul_ch_mag[(symbol*(off+(nb_rb*12)))];
|
||||
simde__m64 *ch_magb = (simde__m64*)&ul_ch_magb[(symbol*(off+(nb_rb*12)))];
|
||||
simde__m64 *ch_magc = (simde__m64*)&ul_ch_magc[(symbol*(off+(nb_rb*12)))];
|
||||
|
||||
xmm0 = simde_mm_abs_pi16(rxF[nb_re64-1]); // registers of even index in xmm0-> |y_R|, registers of odd index in xmm0-> |y_I|
|
||||
xmm0 = simde_mm_subs_pi16(ch_mag[nb_re-1],xmm0); // registers of even index in xmm0-> |y_R|-|h|^2, registers of odd index in xmm0-> |y_I|-|h|^2
|
||||
// xmmtmpD2 contains 4 LLRs
|
||||
xmm1 = simde_mm_abs_pi16(xmm0);
|
||||
xmm1 = simde_mm_subs_pi16(ch_magb[nb_re64-1],xmm1); // contains 4 LLRs
|
||||
xmm2 = simde_mm_abs_pi16(xmm1);
|
||||
xmm2 = simde_mm_subs_pi16(ch_magc[nb_re64-1],xmm2); // contains 4 LLRs
|
||||
// rxF[i] A0 A1
|
||||
// xmm0 B0 B1
|
||||
// xmm1 C0 C1
|
||||
// xmm2 D0 D1
|
||||
llr64[0] = simde_m_punpckldq(rxF[nb_re64-1],xmm0); // A0 B0
|
||||
llr64[2] = simde_m_punpckhdq(rxF[nb_re64-1],xmm0); // A1 B1
|
||||
llr64[1] = simde_m_punpckldq(xmm1,xmm2); // C0 D0
|
||||
llr64[3] = simde_m_punpckhdq(xmm1,xmm2); // C1 D1
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void nr_ulsch_compute_llr(int32_t *rxdataF_comp,
|
||||
int32_t *ul_ch_mag,
|
||||
int32_t *ul_ch_magb,
|
||||
int32_t *ul_ch_magc,
|
||||
int16_t *ulsch_llr,
|
||||
uint32_t nb_rb,
|
||||
uint32_t nb_re,
|
||||
uint8_t symbol,
|
||||
uint8_t mod_order)
|
||||
@@ -383,7 +217,6 @@ void nr_ulsch_compute_llr(int32_t *rxdataF_comp,
|
||||
nr_ulsch_16qam_llr(rxdataF_comp,
|
||||
ul_ch_mag,
|
||||
ulsch_llr,
|
||||
nb_rb,
|
||||
nb_re,
|
||||
symbol);
|
||||
break;
|
||||
@@ -392,7 +225,6 @@ void nr_ulsch_compute_llr(int32_t *rxdataF_comp,
|
||||
ul_ch_mag,
|
||||
ul_ch_magb,
|
||||
ulsch_llr,
|
||||
nb_rb,
|
||||
nb_re,
|
||||
symbol);
|
||||
break;
|
||||
@@ -402,7 +234,6 @@ void nr_ulsch_compute_llr(int32_t *rxdataF_comp,
|
||||
ul_ch_magb,
|
||||
ul_ch_magc,
|
||||
ulsch_llr,
|
||||
nb_rb,
|
||||
nb_re,
|
||||
symbol);
|
||||
break;
|
||||
@@ -3786,46 +3617,7 @@ void nr_ulsch_qam64_qam64(c16_t *stream0_in,
|
||||
simde_m_empty();
|
||||
}
|
||||
|
||||
void nr_ulsch_compute_ML_llr(int32_t **rxdataF_comp,
|
||||
int32_t **ul_ch_mag,
|
||||
int32_t ***rho,
|
||||
int16_t **llr_layers,
|
||||
uint8_t nb_antennas_rx,
|
||||
uint32_t rb_size,
|
||||
uint32_t nb_re,
|
||||
uint8_t symbol,
|
||||
uint32_t rxdataF_ext_offset,
|
||||
uint8_t mod_order)
|
||||
{
|
||||
int off = ((rb_size & 1) == 1) ? 4 : 0;
|
||||
c16_t *rxdataF_comp0 = (c16_t *)&rxdataF_comp[0][symbol * (off + (rb_size * NR_NB_SC_PER_RB))];
|
||||
c16_t *rxdataF_comp1 = (c16_t *)&rxdataF_comp[nb_antennas_rx][symbol * (off + (rb_size * NR_NB_SC_PER_RB))];
|
||||
c16_t *ul_ch_mag0 = (c16_t *)&ul_ch_mag[0][symbol * (off + (rb_size * NR_NB_SC_PER_RB))];
|
||||
c16_t *ul_ch_mag1 = (c16_t *)&ul_ch_mag[nb_antennas_rx][symbol * (off + (rb_size * NR_NB_SC_PER_RB))];
|
||||
c16_t *llr_layers0 = (c16_t *)&llr_layers[0][rxdataF_ext_offset * mod_order];
|
||||
c16_t *llr_layers1 = (c16_t *)&llr_layers[1][rxdataF_ext_offset * mod_order];
|
||||
c16_t *rho0 = (c16_t *)&rho[0][1][symbol * (off + (rb_size * NR_NB_SC_PER_RB))];
|
||||
c16_t *rho1 = (c16_t *)&rho[0][2][symbol * (off + (rb_size * NR_NB_SC_PER_RB))];
|
||||
|
||||
switch (mod_order) {
|
||||
case 2:
|
||||
nr_ulsch_qpsk_qpsk(rxdataF_comp0, rxdataF_comp1, llr_layers0, rho0, nb_re);
|
||||
nr_ulsch_qpsk_qpsk(rxdataF_comp1, rxdataF_comp0, llr_layers1, rho1, nb_re);
|
||||
break;
|
||||
case 4:
|
||||
nr_ulsch_qam16_qam16(rxdataF_comp0, rxdataF_comp1, ul_ch_mag0, ul_ch_mag1, llr_layers0, rho0, nb_re);
|
||||
nr_ulsch_qam16_qam16(rxdataF_comp1, rxdataF_comp0, ul_ch_mag1, ul_ch_mag0, llr_layers1, rho1, nb_re);
|
||||
break;
|
||||
case 6:
|
||||
nr_ulsch_qam64_qam64(rxdataF_comp0, rxdataF_comp1, ul_ch_mag0, ul_ch_mag1, llr_layers0, rho0, nb_re);
|
||||
nr_ulsch_qam64_qam64(rxdataF_comp1, rxdataF_comp0, ul_ch_mag1, ul_ch_mag0, llr_layers1, rho1, nb_re);
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1 == 0, "nr_ulsch_compute_llr: invalid Qm value, symbol = %d, Qm = %d\n", symbol, mod_order);
|
||||
}
|
||||
}
|
||||
|
||||
void nr_ulsch_shift_llr(int16_t **llr_layers, uint32_t nb_re, uint32_t rxdataF_ext_offset, uint8_t mod_order, int shift)
|
||||
static void nr_ulsch_shift_llr(int16_t **llr_layers, uint32_t nb_re, uint32_t rxdataF_ext_offset, uint8_t mod_order, int shift)
|
||||
{
|
||||
simde__m128i *llr_layers0 = (simde__m128i *)&llr_layers[0][rxdataF_ext_offset * mod_order];
|
||||
simde__m128i *llr_layers1 = (simde__m128i *)&llr_layers[1][rxdataF_ext_offset * mod_order];
|
||||
@@ -3848,3 +3640,35 @@ void nr_ulsch_shift_llr(int16_t **llr_layers, uint32_t nb_re, uint32_t rxdataF_e
|
||||
llr_layers1[i] = simde_mm_srai_epi16(llr_layers1[i], shift);
|
||||
}
|
||||
}
|
||||
|
||||
void nr_ulsch_compute_ML_llr(NR_gNB_PUSCH *pusch_vars,
|
||||
uint32_t symbol,
|
||||
c16_t* rxdataF_comp0,
|
||||
c16_t* rxdataF_comp1,
|
||||
c16_t* ul_ch_mag0,
|
||||
c16_t* ul_ch_mag1,
|
||||
c16_t* llr_layers0,
|
||||
c16_t* llr_layers1,
|
||||
c16_t* rho0,
|
||||
c16_t* rho1,
|
||||
uint32_t nb_re,
|
||||
uint8_t mod_order)
|
||||
{
|
||||
switch (mod_order) {
|
||||
case 2:
|
||||
nr_ulsch_qpsk_qpsk(rxdataF_comp0, rxdataF_comp1, llr_layers0, rho0, nb_re);
|
||||
nr_ulsch_qpsk_qpsk(rxdataF_comp1, rxdataF_comp0, llr_layers1, rho1, nb_re);
|
||||
nr_ulsch_shift_llr(pusch_vars->llr_layers, nb_re, pusch_vars->llr_offset[symbol] >> 1, 2, 4);
|
||||
break;
|
||||
case 4:
|
||||
nr_ulsch_qam16_qam16(rxdataF_comp0, rxdataF_comp1, ul_ch_mag0, ul_ch_mag1, llr_layers0, rho0, nb_re);
|
||||
nr_ulsch_qam16_qam16(rxdataF_comp1, rxdataF_comp0, ul_ch_mag1, ul_ch_mag0, llr_layers1, rho1, nb_re);
|
||||
break;
|
||||
case 6:
|
||||
nr_ulsch_qam64_qam64(rxdataF_comp0, rxdataF_comp1, ul_ch_mag0, ul_ch_mag1, llr_layers0, rho0, nb_re);
|
||||
nr_ulsch_qam64_qam64(rxdataF_comp1, rxdataF_comp0, ul_ch_mag1, ul_ch_mag0, llr_layers1, rho1, nb_re);
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1 == 0, "nr_ulsch_compute_llr: invalid Qm value, Qm = %d\n", mod_order);
|
||||
}
|
||||
}
|
||||
|
||||
+33
-8
@@ -409,8 +409,8 @@ typedef struct {
|
||||
/// \brief Total RE count after DMRS/PTRS RE's are extracted from respective symbol.
|
||||
/// - first index: ? [0...14] smybol per slot
|
||||
int16_t *ul_valid_re_per_slot;
|
||||
/// flag to verify if channel level computation is done
|
||||
uint8_t cl_done;
|
||||
/// \brief offset for llr corresponding to each symbol
|
||||
int llr_offset[14];
|
||||
/// flag to indicate DTX on reception
|
||||
int DTX;
|
||||
} NR_gNB_PUSCH;
|
||||
@@ -728,18 +728,14 @@ typedef struct PHY_VARS_gNB_s {
|
||||
time_stats_t dlsch_segmentation_stats;
|
||||
|
||||
time_stats_t rx_pusch_stats;
|
||||
time_stats_t rx_pusch_init_stats;
|
||||
time_stats_t rx_pusch_symbol_processing_stats;
|
||||
time_stats_t ul_indication_stats;
|
||||
time_stats_t schedule_response_stats;
|
||||
time_stats_t ulsch_decoding_stats;
|
||||
time_stats_t ulsch_rate_unmatching_stats;
|
||||
time_stats_t ulsch_ldpc_decoding_stats;
|
||||
time_stats_t ulsch_deinterleaving_stats;
|
||||
time_stats_t ulsch_unscrambling_stats;
|
||||
time_stats_t ulsch_channel_estimation_stats;
|
||||
time_stats_t ulsch_ptrs_processing_stats;
|
||||
time_stats_t ulsch_channel_compensation_stats;
|
||||
time_stats_t ulsch_rbs_extraction_stats;
|
||||
time_stats_t ulsch_mrc_stats;
|
||||
time_stats_t ulsch_llr_stats;
|
||||
time_stats_t rx_srs_stats;
|
||||
time_stats_t generate_srs_stats;
|
||||
@@ -754,6 +750,7 @@ typedef struct PHY_VARS_gNB_s {
|
||||
time_stats_t rx_dft_stats;
|
||||
time_stats_t ulsch_freq_offset_estimation_stats;
|
||||
*/
|
||||
notifiedFIFO_t respPuschSymb;
|
||||
notifiedFIFO_t respDecode;
|
||||
notifiedFIFO_t resp_L1;
|
||||
notifiedFIFO_t L1_tx_free;
|
||||
@@ -761,6 +758,8 @@ typedef struct PHY_VARS_gNB_s {
|
||||
notifiedFIFO_t L1_tx_out;
|
||||
notifiedFIFO_t resp_RU_tx;
|
||||
tpool_t threadPool;
|
||||
int nbSymb;
|
||||
int num_pusch_symbols_per_thread;
|
||||
pthread_t L1_rx_thread;
|
||||
int L1_rx_thread_core;
|
||||
pthread_t L1_tx_thread;
|
||||
@@ -771,6 +770,32 @@ typedef struct PHY_VARS_gNB_s {
|
||||
rt_L1_profiling_t rt_L1_profiling;
|
||||
} PHY_VARS_gNB;
|
||||
|
||||
typedef struct puschSymbolProc_s {
|
||||
PHY_VARS_gNB *gNB;
|
||||
NR_DL_FRAME_PARMS *frame_parms;
|
||||
nfapi_nr_pusch_pdu_t *rel15_ul;
|
||||
int ulsch_id;
|
||||
int slot;
|
||||
int startSymbol;
|
||||
int numSymbols;
|
||||
int16_t *llr;
|
||||
int16_t **llr_layers;
|
||||
int16_t *s;
|
||||
uint32_t nvar;
|
||||
} puschSymbolProc_t;
|
||||
|
||||
struct puschSymbolReqId {
|
||||
uint16_t ulsch_id;
|
||||
uint16_t frame;
|
||||
uint8_t slot;
|
||||
uint16_t spare;
|
||||
} __attribute__((packed));
|
||||
|
||||
union puschSymbolReqUnion {
|
||||
struct puschSymbolReqId s;
|
||||
uint64_t p;
|
||||
};
|
||||
|
||||
typedef struct LDPCDecode_s {
|
||||
PHY_VARS_gNB *gNB;
|
||||
NR_UL_gNB_HARQ_t *ulsch_harq;
|
||||
|
||||
@@ -397,19 +397,7 @@ static int nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int
|
||||
number_dmrs_symbols, // number of dmrs symbols irrespective of single or double symbol dmrs
|
||||
pusch_pdu->qam_mod_order,
|
||||
pusch_pdu->nrOfLayers);
|
||||
|
||||
nr_ulsch_layer_demapping(gNB->pusch_vars[ULSCH_id].llr,
|
||||
pusch_pdu->nrOfLayers,
|
||||
pusch_pdu->qam_mod_order,
|
||||
G,
|
||||
gNB->pusch_vars[ULSCH_id].llr_layers);
|
||||
|
||||
//----------------------------------------------------------
|
||||
//------------------- ULSCH unscrambling -------------------
|
||||
//----------------------------------------------------------
|
||||
start_meas(&gNB->ulsch_unscrambling_stats);
|
||||
nr_ulsch_unscrambling(gNB->pusch_vars[ULSCH_id].llr, G, pusch_pdu->data_scrambling_id, pusch_pdu->rnti);
|
||||
stop_meas(&gNB->ulsch_unscrambling_stats);
|
||||
|
||||
//----------------------------------------------------------
|
||||
//--------------------- ULSCH decoding ---------------------
|
||||
//----------------------------------------------------------
|
||||
@@ -417,7 +405,7 @@ static int nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int
|
||||
start_meas(&gNB->ulsch_decoding_stats);
|
||||
int nbDecode =
|
||||
nr_ulsch_decoding(gNB, ULSCH_id, gNB->pusch_vars[ULSCH_id].llr, frame_parms, pusch_pdu, frame_rx, slot_rx, harq_pid, G);
|
||||
stop_meas(&gNB->ulsch_decoding_stats);
|
||||
|
||||
return nbDecode;
|
||||
}
|
||||
|
||||
@@ -899,7 +887,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RX_PUSCH, 1);
|
||||
start_meas(&gNB->rx_pusch_stats);
|
||||
nr_rx_pusch(gNB, ULSCH_id, frame_rx, slot_rx, ulsch->harq_pid);
|
||||
nr_rx_pusch_tp(gNB, ULSCH_id, frame_rx, slot_rx, ulsch->harq_pid);
|
||||
NR_gNB_PUSCH *pusch_vars = &gNB->pusch_vars[ULSCH_id];
|
||||
pusch_vars->ulsch_power_tot = 0;
|
||||
pusch_vars->ulsch_noise_power_tot = 0;
|
||||
@@ -963,6 +951,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
|
||||
totalDecode--;
|
||||
}
|
||||
}
|
||||
stop_meas(&gNB->ulsch_decoding_stats);
|
||||
for (int i = 0; i < gNB->max_nb_srs; i++) {
|
||||
NR_gNB_SRS_t *srs = &gNB->srs[i];
|
||||
if (srs) {
|
||||
|
||||
@@ -561,10 +561,12 @@ int main(int argc, char *argv[])
|
||||
RC.gNB[0] = calloc(1,sizeof(PHY_VARS_gNB));
|
||||
gNB = RC.gNB[0];
|
||||
gNB->ofdm_offset_divisor = UINT_MAX;
|
||||
initNotifiedFIFO(&gNB->respDecode);
|
||||
gNB->num_pusch_symbols_per_thread = 1;
|
||||
|
||||
initFloatingCoresTpool(threadCnt, &gNB->threadPool, false, "gNB-tpool");
|
||||
initNotifiedFIFO(&gNB->respDecode);
|
||||
|
||||
initNotifiedFIFO(&gNB->respPuschSymb);
|
||||
initNotifiedFIFO(&gNB->L1_tx_free);
|
||||
initNotifiedFIFO(&gNB->L1_tx_filled);
|
||||
initNotifiedFIFO(&gNB->L1_tx_out);
|
||||
@@ -719,7 +721,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
NR_gNB_ULSCH_t *ulsch_gNB = &gNB->ulsch[UE_id];
|
||||
|
||||
// nfapi_nr_ul_config_ulsch_pdu *rel15_ul = &ulsch_gNB->harq_process->ulsch_pdu;
|
||||
NR_Sched_Rsp_t *Sched_INFO = malloc(sizeof(*Sched_INFO));
|
||||
memset((void*)Sched_INFO,0,sizeof(*Sched_INFO));
|
||||
nfapi_nr_ul_tti_request_t *UL_tti_req = &Sched_INFO->UL_tti_req;
|
||||
@@ -927,15 +928,10 @@ int main(int argc, char *argv[])
|
||||
roundStats = 0;
|
||||
reset_meas(&gNB->phy_proc_rx);
|
||||
reset_meas(&gNB->rx_pusch_stats);
|
||||
reset_meas(&gNB->rx_pusch_init_stats);
|
||||
reset_meas(&gNB->rx_pusch_symbol_processing_stats);
|
||||
reset_meas(&gNB->ulsch_decoding_stats);
|
||||
reset_meas(&gNB->ulsch_deinterleaving_stats);
|
||||
reset_meas(&gNB->ulsch_rate_unmatching_stats);
|
||||
reset_meas(&gNB->ulsch_ldpc_decoding_stats);
|
||||
reset_meas(&gNB->ulsch_unscrambling_stats);
|
||||
reset_meas(&gNB->ulsch_channel_estimation_stats);
|
||||
reset_meas(&gNB->ulsch_llr_stats);
|
||||
reset_meas(&gNB->ulsch_channel_compensation_stats);
|
||||
reset_meas(&gNB->ulsch_rbs_extraction_stats);
|
||||
reset_meas(&UE->ulsch_ldpc_encoding_stats);
|
||||
reset_meas(&UE->ulsch_rate_matching_stats);
|
||||
reset_meas(&UE->ulsch_interleaving_stats);
|
||||
@@ -1588,25 +1584,22 @@ int main(int argc, char *argv[])
|
||||
dump_pusch_stats(fd,gNB);
|
||||
fclose(fd);
|
||||
|
||||
if (print_perf==1) {
|
||||
printDistribution(&gNB->phy_proc_rx,table_rx,"Total PHY proc rx");
|
||||
printStatIndent(&gNB->rx_pusch_stats,"RX PUSCH time");
|
||||
printStatIndent2(&gNB->ulsch_channel_estimation_stats,"ULSCH channel estimation time");
|
||||
printStatIndent2(&gNB->ulsch_ptrs_processing_stats,"ULSCH PTRS Processing time");
|
||||
printStatIndent2(&gNB->ulsch_rbs_extraction_stats,"ULSCH rbs extraction time");
|
||||
printStatIndent2(&gNB->ulsch_channel_compensation_stats,"ULSCH channel compensation time");
|
||||
printStatIndent2(&gNB->ulsch_mrc_stats,"ULSCH mrc computation");
|
||||
printStatIndent2(&gNB->ulsch_llr_stats,"ULSCH llr computation");
|
||||
printStatIndent(&gNB->ulsch_unscrambling_stats,"ULSCH unscrambling");
|
||||
if (print_perf==1)
|
||||
{
|
||||
printf("gNB RX\n");
|
||||
printDistribution(&gNB->phy_proc_rx,table_rx, "Total PHY proc rx");
|
||||
printStatIndent(&gNB->rx_pusch_stats, "RX PUSCH time");
|
||||
printStatIndent2(&gNB->ulsch_channel_estimation_stats, "ULSCH channel estimation time");
|
||||
printStatIndent2(&gNB->rx_pusch_init_stats, "RX PUSCH Initialization time");
|
||||
printStatIndent2(&gNB->rx_pusch_symbol_processing_stats, "RX PUSCH Symbol Processing time");
|
||||
printStatIndent(&gNB->ulsch_decoding_stats,"ULSCH total decoding time");
|
||||
|
||||
printf("\nUE TX\n");
|
||||
printStatIndent(&UE->ulsch_encoding_stats,"ULSCH total encoding time");
|
||||
printStatIndent2(&UE->ulsch_segmentation_stats,"ULSCH segmentation time");
|
||||
printStatIndent2(&UE->ulsch_ldpc_encoding_stats,"ULSCH LDPC encoder time");
|
||||
printStatIndent2(&UE->ulsch_rate_matching_stats,"ULSCH rate-matching time");
|
||||
printStatIndent2(&UE->ulsch_interleaving_stats,"ULSCH interleaving time");
|
||||
//printStatIndent2(&gNB->ulsch_deinterleaving_stats,"ULSCH deinterleaving");
|
||||
//printStatIndent2(&gNB->ulsch_rate_unmatching_stats,"ULSCH rate matching rx");
|
||||
//printStatIndent2(&gNB->ulsch_ldpc_decoding_stats,"ULSCH ldpc decoding");
|
||||
printStatIndent(&gNB->rx_srs_stats,"RX SRS time");
|
||||
printStatIndent2(&gNB->generate_srs_stats,"Generate SRS sequence time");
|
||||
printStatIndent2(&gNB->get_srs_signal_stats,"Get SRS signal time");
|
||||
|
||||
Reference in New Issue
Block a user