Commit 29913701 authored by francescomani's avatar francescomani

32byte aligned DLSCH RX symbol size

parent cda82edf
...@@ -1633,7 +1633,7 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue, ...@@ -1633,7 +1633,7 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
nr_slot_rx, nr_slot_rx,
symbol, symbol,
frame_parms->ofdm_symbol_size, frame_parms->ofdm_symbol_size,
(int16_t *)(rxdataF_comp[0][aarx] + symbol * nb_re_pdsch), (int16_t *)(rxdataF_comp[0][aarx] + symbol * rx_size_symbol),
gold, gold,
(int16_t *)&phase_per_symbol[symbol], (int16_t *)&phase_per_symbol[symbol],
&ptrs_re_symbol[symbol]); &ptrs_re_symbol[symbol]);
...@@ -1654,21 +1654,21 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue, ...@@ -1654,21 +1654,21 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
} }
#ifdef DEBUG_DL_PTRS #ifdef DEBUG_DL_PTRS
LOG_M("ptrsEst.m","est",ptrs_phase_per_slot[aarx],frame_parms->symbols_per_slot,1,1 ); LOG_M("ptrsEst.m","est",ptrs_phase_per_slot[aarx],frame_parms->symbols_per_slot,1,1 );
LOG_M("rxdataF_bf_ptrs_comp.m", "bf_ptrs_cmp", rxdataF_comp[0][aarx] + (*startSymbIndex) * NR_NB_SC_PER_RB * (*nb_rb), (*nb_rb) * NR_NB_SC_PER_RB * (*nbSymb), 1, 1); LOG_M("rxdataF_bf_ptrs_comp.m", "bf_ptrs_cmp", rxdataF_comp[0][aarx] + (*startSymbIndex) * rx_size_symbol, rx_size_symbol * (*nbSymb), 1, 1);
#endif #endif
/*------------------------------------------------------------------------------------------------------- */ /*------------------------------------------------------------------------------------------------------- */
/* 3) Compensated DMRS based estimated signal with PTRS estimation */ /* 3) Compensated DMRS based estimated signal with PTRS estimation */
/*--------------------------------------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------------------------------------*/
for(uint8_t i = *startSymbIndex; i< symbInSlot ;i++) { for(uint8_t i = *startSymbIndex; i < symbInSlot; i++) {
/* DMRS Symbol has 0 phase so no need to rotate the respective symbol */ /* DMRS Symbol has 0 phase so no need to rotate the respective symbol */
/* Skip rotation if the slot processing is wrong */ /* Skip rotation if the slot processing is wrong */
if((!is_dmrs_symbol(i,*dmrsSymbPos)) && (ret == 0)) { if((!is_dmrs_symbol(i, *dmrsSymbPos)) && (ret == 0)) {
#ifdef DEBUG_DL_PTRS #ifdef DEBUG_DL_PTRS
printf("[PHY][DL][PTRS]: Rotate Symbol %2d with %d + j* %d\n", i, phase_per_symbol[i].r,phase_per_symbol[i].i); printf("[PHY][DL][PTRS]: Rotate Symbol %2d with %d + j* %d\n", i, phase_per_symbol[i].r,phase_per_symbol[i].i);
#endif #endif
rotate_cpx_vector((c16_t *)&rxdataF_comp[0][aarx][(i * (*nb_rb) * NR_NB_SC_PER_RB)], rotate_cpx_vector((c16_t *)&rxdataF_comp[0][aarx][i * rx_size_symbol],
&phase_per_symbol[i], &phase_per_symbol[i],
(c16_t *)&rxdataF_comp[0][aarx][(i * (*nb_rb) * NR_NB_SC_PER_RB)], (c16_t *)&rxdataF_comp[0][aarx][i * rx_size_symbol],
((*nb_rb) * NR_NB_SC_PER_RB), ((*nb_rb) * NR_NB_SC_PER_RB),
15); 15);
}// if not DMRS Symbol }// if not DMRS Symbol
......
...@@ -116,7 +116,6 @@ static int nr_dlsch_llr(uint32_t rx_size_symbol, ...@@ -116,7 +116,6 @@ static int nr_dlsch_llr(uint32_t rx_size_symbol,
unsigned char harq_pid, unsigned char harq_pid,
unsigned char first_symbol_flag, unsigned char first_symbol_flag,
unsigned char symbol, unsigned char symbol,
unsigned short nb_rb,
int32_t codeword_TB0, int32_t codeword_TB0,
int32_t codeword_TB1, int32_t codeword_TB1,
uint32_t len, uint32_t len,
...@@ -221,17 +220,16 @@ void nr_dlsch_scale_channel(uint32_t rx_size_symbol, ...@@ -221,17 +220,16 @@ void nr_dlsch_scale_channel(uint32_t rx_size_symbol,
uint8_t pilots, uint8_t pilots,
uint32_t len, uint32_t len,
unsigned short nb_rb); unsigned short nb_rb);
void nr_dlsch_detection_mrc(uint32_t rx_size_symbol, static void nr_dlsch_detection_mrc(uint32_t rx_size_symbol,
short n_tx, short n_tx,
short n_rx, short n_rx,
int32_t rxdataF_comp[][n_rx][rx_size_symbol * NR_SYMBOLS_PER_SLOT], int32_t rxdataF_comp[][n_rx][rx_size_symbol * NR_SYMBOLS_PER_SLOT],
int ***rho, int ***rho,
int32_t dl_ch_mag[][n_rx][rx_size_symbol], int32_t dl_ch_mag[][n_rx][rx_size_symbol],
int32_t dl_ch_magb[][n_rx][rx_size_symbol], int32_t dl_ch_magb[][n_rx][rx_size_symbol],
int32_t dl_ch_magr[][n_rx][rx_size_symbol], int32_t dl_ch_magr[][n_rx][rx_size_symbol],
unsigned char symbol, unsigned char symbol,
unsigned short nb_rb, int length);
int length);
static bool overlap_csi_symbol(fapi_nr_dl_config_csirs_pdu_rel15_t *csi_pdu, int symbol) static bool overlap_csi_symbol(fapi_nr_dl_config_csirs_pdu_rel15_t *csi_pdu, int symbol)
{ {
...@@ -596,7 +594,6 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, ...@@ -596,7 +594,6 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
dl_ch_magb, dl_ch_magb,
dl_ch_magr, dl_ch_magr,
symbol, symbol,
nb_rb_pdsch,
nb_re_pdsch); nb_re_pdsch);
if (nl >= 2) // Apply MMSE for 2, 3, and 4 Tx layers if (nl >= 2) // Apply MMSE for 2, 3, and 4 Tx layers
nr_dlsch_mmse(rx_size_symbol, nr_dlsch_mmse(rx_size_symbol,
...@@ -691,7 +688,6 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, ...@@ -691,7 +688,6 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
harq_pid, harq_pid,
first_symbol_flag, first_symbol_flag,
i, i,
nb_rb_pdsch,
codeword_TB0, codeword_TB0,
codeword_TB1, codeword_TB1,
dl_valid_re[i - 1], dl_valid_re[i - 1],
...@@ -877,15 +873,13 @@ static void nr_dlsch_channel_compensation(uint32_t rx_size_symbol, ...@@ -877,15 +873,13 @@ static void nr_dlsch_channel_compensation(uint32_t rx_size_symbol,
QAM_amp128r = simde_mm_set1_epi16(QAM256_n3); QAM_amp128r = simde_mm_set1_epi16(QAM256_n3);
} }
// printf("comp: rxdataF_comp %p, symbol %d\n",rxdataF_comp[0],symbol);
for (int aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) { for (int aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
dl_ch128 = (simde__m128i *)dl_ch_estimates_ext[(l * frame_parms->nb_antennas_rx) + aarx]; dl_ch128 = (simde__m128i *)dl_ch_estimates_ext[(l * frame_parms->nb_antennas_rx) + aarx];
dl_ch_mag128 = (simde__m128i *)dl_ch_mag[l][aarx]; dl_ch_mag128 = (simde__m128i *)dl_ch_mag[l][aarx];
dl_ch_mag128b = (simde__m128i *)dl_ch_magb[l][aarx]; dl_ch_mag128b = (simde__m128i *)dl_ch_magb[l][aarx];
dl_ch_mag128r = (simde__m128i *)dl_ch_magr[l][aarx]; dl_ch_mag128r = (simde__m128i *)dl_ch_magr[l][aarx];
rxdataF128 = (simde__m128i *)rxdataF_ext[aarx]; rxdataF128 = (simde__m128i *)rxdataF_ext[aarx];
rxdataF_comp128 = (simde__m128i *)(rxdataF_comp[l][aarx] + symbol * nb_rb * 12); rxdataF_comp128 = (simde__m128i *)(rxdataF_comp[l][aarx] + symbol * rx_size_symbol);
for (int rb = 0; rb < nb_rb_0; rb++) { for (int rb = 0; rb < nb_rb_0; rb++) {
if (mod_order > 2) { if (mod_order > 2) {
...@@ -1260,37 +1254,34 @@ static void nr_dlsch_extract_rbs(uint32_t rxdataF_sz, ...@@ -1260,37 +1254,34 @@ static void nr_dlsch_extract_rbs(uint32_t rxdataF_sz,
} }
} }
void nr_dlsch_detection_mrc(uint32_t rx_size_symbol, static void nr_dlsch_detection_mrc(uint32_t rx_size_symbol,
short n_tx, short n_tx,
short n_rx, short n_rx,
int32_t rxdataF_comp[][n_rx][rx_size_symbol * NR_SYMBOLS_PER_SLOT], int32_t rxdataF_comp[][n_rx][rx_size_symbol * NR_SYMBOLS_PER_SLOT],
int ***rho, int ***rho,
int32_t dl_ch_mag[][n_rx][rx_size_symbol], int32_t dl_ch_mag[][n_rx][rx_size_symbol],
int32_t dl_ch_magb[][n_rx][rx_size_symbol], int32_t dl_ch_magb[][n_rx][rx_size_symbol],
int32_t dl_ch_magr[][n_rx][rx_size_symbol], int32_t dl_ch_magr[][n_rx][rx_size_symbol],
unsigned char symbol, unsigned char symbol,
unsigned short nb_rb, int length)
int length) { {
unsigned char aatx, aarx;
int i;
simde__m128i *rxdataF_comp128_0,*rxdataF_comp128_1,*dl_ch_mag128_0,*dl_ch_mag128_1,*dl_ch_mag128_0b,*dl_ch_mag128_1b,*dl_ch_mag128_0r,*dl_ch_mag128_1r; simde__m128i *rxdataF_comp128_0,*rxdataF_comp128_1,*dl_ch_mag128_0,*dl_ch_mag128_1,*dl_ch_mag128_0b,*dl_ch_mag128_1b,*dl_ch_mag128_0r,*dl_ch_mag128_1r;
uint32_t nb_rb_0 = length/12 + ((length%12)?1:0); uint32_t nb_rb_0 = length/12 + ((length%12)?1:0);
if (n_rx>1) { if (n_rx > 1) {
for (aatx=0; aatx<n_tx; aatx++) { for (int aatx = 0; aatx < n_tx; aatx++) {
rxdataF_comp128_0 = (simde__m128i *)(rxdataF_comp[aatx][0] + symbol * nb_rb * 12); rxdataF_comp128_0 = (simde__m128i *)(rxdataF_comp[aatx][0] + symbol * rx_size_symbol);
dl_ch_mag128_0 = (simde__m128i *)dl_ch_mag[aatx][0]; dl_ch_mag128_0 = (simde__m128i *)dl_ch_mag[aatx][0];
dl_ch_mag128_0b = (simde__m128i *)dl_ch_magb[aatx][0]; dl_ch_mag128_0b = (simde__m128i *)dl_ch_magb[aatx][0];
dl_ch_mag128_0r = (simde__m128i *)dl_ch_magr[aatx][0]; dl_ch_mag128_0r = (simde__m128i *)dl_ch_magr[aatx][0];
for (aarx=1; aarx<n_rx; aarx++) { for (int aarx = 1; aarx < n_rx; aarx++) {
rxdataF_comp128_1 = (simde__m128i *)(rxdataF_comp[aatx][aarx] + symbol * nb_rb * 12); rxdataF_comp128_1 = (simde__m128i *)(rxdataF_comp[aatx][aarx] + symbol * rx_size_symbol);
dl_ch_mag128_1 = (simde__m128i *)dl_ch_mag[aatx][aarx]; dl_ch_mag128_1 = (simde__m128i *)dl_ch_mag[aatx][aarx];
dl_ch_mag128_1b = (simde__m128i *)dl_ch_magb[aatx][aarx]; dl_ch_mag128_1b = (simde__m128i *)dl_ch_magb[aatx][aarx];
dl_ch_mag128_1r = (simde__m128i *)dl_ch_magr[aatx][aarx]; dl_ch_mag128_1r = (simde__m128i *)dl_ch_magr[aatx][aarx];
// MRC on each re of rb, both on MF output and magnitude (for 16QAM/64QAM/256 llr computation) // MRC on each re of rb, both on MF output and magnitude (for 16QAM/64QAM/256 llr computation)
for (i=0; i<nb_rb_0*3; i++) { for (int i = 0; i < nb_rb_0 * 3; i++) {
rxdataF_comp128_0[i] = simde_mm_adds_epi16(rxdataF_comp128_0[i],rxdataF_comp128_1[i]); rxdataF_comp128_0[i] = simde_mm_adds_epi16(rxdataF_comp128_0[i],rxdataF_comp128_1[i]);
dl_ch_mag128_0[i] = simde_mm_adds_epi16(dl_ch_mag128_0[i],dl_ch_mag128_1[i]); dl_ch_mag128_0[i] = simde_mm_adds_epi16(dl_ch_mag128_0[i],dl_ch_mag128_1[i]);
dl_ch_mag128_0b[i] = simde_mm_adds_epi16(dl_ch_mag128_0b[i],dl_ch_mag128_1b[i]); dl_ch_mag128_0b[i] = simde_mm_adds_epi16(dl_ch_mag128_0b[i],dl_ch_mag128_1b[i]);
...@@ -1299,14 +1290,14 @@ void nr_dlsch_detection_mrc(uint32_t rx_size_symbol, ...@@ -1299,14 +1290,14 @@ void nr_dlsch_detection_mrc(uint32_t rx_size_symbol,
} }
} }
#ifdef DEBUG_DLSCH_DEMOD #ifdef DEBUG_DLSCH_DEMOD
for (i=0; i<nb_rb_0*3; i++) { for (int i = 0; i < nb_rb_0 * 3; i++) {
printf("symbol%d RB %d\n",symbol,i/3); printf("symbol%d RB %d\n", symbol,i / 3);
rxdataF_comp128_0 = (simde__m128i *)(rxdataF_comp[0][0] + symbol * nb_rb * 12); rxdataF_comp128_0 = (simde__m128i *)(rxdataF_comp[0][0] + symbol * rx_size_symbol);
rxdataF_comp128_1 = (simde__m128i *)(rxdataF_comp[0][n_rx] + symbol * nb_rb * 12); rxdataF_comp128_1 = (simde__m128i *)(rxdataF_comp[0][n_rx] + symbol * rx_size_symbol);
print_shorts("tx 1 mrc_re/mrc_Im:",(int16_t*)&rxdataF_comp128_0[i]); print_shorts("tx 1 mrc_re/mrc_Im:",(int16_t*)&rxdataF_comp128_0[i]);
print_shorts("tx 2 mrc_re/mrc_Im:",(int16_t*)&rxdataF_comp128_1[i]); print_shorts("tx 2 mrc_re/mrc_Im:",(int16_t*)&rxdataF_comp128_1[i]);
// printf("mrc mag0 = %d = %d \n",((int16_t*)&dl_ch_mag128_0[0])[0],((int16_t*)&dl_ch_mag128_0[0])[1]); // printf("mrc mag0 = %d = %d \n",((int16_t*)&dl_ch_mag128_0[0])[0],((int16_t*)&dl_ch_mag128_0[0])[1]);
// printf("mrc mag0b = %d = %d \n",((int16_t*)&dl_ch_mag128_0b[0])[0],((int16_t*)&dl_ch_mag128_0b[0])[1]); // printf("mrc mag0b = %d = %d \n",((int16_t*)&dl_ch_mag128_0b[0])[0],((int16_t*)&dl_ch_mag128_0b[0])[1]);
} }
#endif #endif
if (rho) { if (rho) {
...@@ -1891,7 +1882,6 @@ static int nr_dlsch_llr(uint32_t rx_size_symbol, ...@@ -1891,7 +1882,6 @@ static int nr_dlsch_llr(uint32_t rx_size_symbol,
unsigned char harq_pid, unsigned char harq_pid,
unsigned char first_symbol_flag, unsigned char first_symbol_flag,
unsigned char symbol, unsigned char symbol,
unsigned short nb_rb,
int32_t codeword_TB0, int32_t codeword_TB0,
int32_t codeword_TB1, int32_t codeword_TB1,
uint32_t len, uint32_t len,
...@@ -1908,22 +1898,22 @@ static int nr_dlsch_llr(uint32_t rx_size_symbol, ...@@ -1908,22 +1898,22 @@ static int nr_dlsch_llr(uint32_t rx_size_symbol,
switch (dlsch[0].dlsch_config.qamModOrder) { switch (dlsch[0].dlsch_config.qamModOrder) {
case 2 : case 2 :
for(int l = 0; l < dlsch[0].Nl; l++) for(int l = 0; l < dlsch[0].Nl; l++)
nr_qpsk_llr(&rxdataF_comp[l][0][symbol * nb_rb * 12], layer_llr[l] + llr_offset_symbol, len); nr_qpsk_llr(&rxdataF_comp[l][0][symbol * rx_size_symbol], layer_llr[l] + llr_offset_symbol, len);
break; break;
case 4 : case 4 :
for(int l = 0; l < dlsch[0].Nl; l++) for(int l = 0; l < dlsch[0].Nl; l++)
nr_16qam_llr(&rxdataF_comp[l][0][symbol * nb_rb * 12], dl_ch_mag, layer_llr[l] + llr_offset_symbol, len); nr_16qam_llr(&rxdataF_comp[l][0][symbol * rx_size_symbol], dl_ch_mag, layer_llr[l] + llr_offset_symbol, len);
break; break;
case 6 : case 6 :
for(int l=0; l < dlsch[0].Nl; l++) for(int l=0; l < dlsch[0].Nl; l++)
nr_64qam_llr(&rxdataF_comp[l][0][symbol * nb_rb * 12], dl_ch_mag, dl_ch_magb, layer_llr[l] + llr_offset_symbol, len); nr_64qam_llr(&rxdataF_comp[l][0][symbol * rx_size_symbol], dl_ch_mag, dl_ch_magb, layer_llr[l] + llr_offset_symbol, len);
break; break;
case 8: case 8:
for(int l=0; l < dlsch[0].Nl; l++) for(int l=0; l < dlsch[0].Nl; l++)
nr_256qam_llr(&rxdataF_comp[l][0][symbol * nb_rb * 12], dl_ch_mag, dl_ch_magb, dl_ch_magr, layer_llr[l] + llr_offset_symbol, len); nr_256qam_llr(&rxdataF_comp[l][0][symbol * rx_size_symbol], dl_ch_mag, dl_ch_magb, dl_ch_magr, layer_llr[l] + llr_offset_symbol, len);
break; break;
default: default:
...@@ -1936,19 +1926,19 @@ static int nr_dlsch_llr(uint32_t rx_size_symbol, ...@@ -1936,19 +1926,19 @@ static int nr_dlsch_llr(uint32_t rx_size_symbol,
if (dlsch1_harq) { if (dlsch1_harq) {
switch (dlsch[1].dlsch_config.qamModOrder) { switch (dlsch[1].dlsch_config.qamModOrder) {
case 2 : case 2 :
nr_qpsk_llr(&rxdataF_comp[0][0][symbol * nb_rb * 12], layer_llr[0] + llr_offset_symbol, len); nr_qpsk_llr(&rxdataF_comp[0][0][symbol * rx_size_symbol], layer_llr[0] + llr_offset_symbol, len);
break; break;
case 4: case 4:
nr_16qam_llr(&rxdataF_comp[0][0][symbol * nb_rb * 12], dl_ch_mag, layer_llr[0] + llr_offset_symbol, len); nr_16qam_llr(&rxdataF_comp[0][0][symbol * rx_size_symbol], dl_ch_mag, layer_llr[0] + llr_offset_symbol, len);
break; break;
case 6 : case 6 :
nr_64qam_llr(&rxdataF_comp[0][0][symbol * nb_rb * 12], dl_ch_mag, dl_ch_magb, layer_llr[0] + llr_offset_symbol, len); nr_64qam_llr(&rxdataF_comp[0][0][symbol * rx_size_symbol], dl_ch_mag, dl_ch_magb, layer_llr[0] + llr_offset_symbol, len);
break; break;
case 8 : case 8 :
nr_256qam_llr(&rxdataF_comp[0][0][symbol * nb_rb * 12], dl_ch_mag, dl_ch_magb, dl_ch_magr, layer_llr[0] + llr_offset_symbol, len); nr_256qam_llr(&rxdataF_comp[0][0][symbol * rx_size_symbol], dl_ch_mag, dl_ch_magb, dl_ch_magr, layer_llr[0] + llr_offset_symbol, len);
break; break;
default: default:
......
...@@ -509,7 +509,7 @@ static int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, ...@@ -509,7 +509,7 @@ static int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue,
int32_t ptrs_re_per_slot[ue->frame_parms.nb_antennas_rx][NR_SYMBOLS_PER_SLOT]; int32_t ptrs_re_per_slot[ue->frame_parms.nb_antennas_rx][NR_SYMBOLS_PER_SLOT];
memset(ptrs_re_per_slot, 0, sizeof(ptrs_re_per_slot)); memset(ptrs_re_per_slot, 0, sizeof(ptrs_re_per_slot));
const uint32_t rx_size_symbol = dlsch[0].dlsch_config.number_rbs * NR_NB_SC_PER_RB; const uint32_t rx_size_symbol = (dlsch[0].dlsch_config.number_rbs * NR_NB_SC_PER_RB + 15) & ~15;
__attribute__((aligned(32))) int32_t rxdataF_comp[dlsch[0].Nl][ue->frame_parms.nb_antennas_rx][rx_size_symbol * NR_SYMBOLS_PER_SLOT]; __attribute__((aligned(32))) int32_t rxdataF_comp[dlsch[0].Nl][ue->frame_parms.nb_antennas_rx][rx_size_symbol * NR_SYMBOLS_PER_SLOT];
memset(rxdataF_comp, 0, sizeof(rxdataF_comp)); memset(rxdataF_comp, 0, sizeof(rxdataF_comp));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment