Commit 393363e2 authored by Sakthivel Velumani's avatar Sakthivel Velumani Committed by francescomani

Refactor PUSCH RE mapping

RE mapping time is reduced by 10x. Functions are made generic to be
later reused for PDSCH RE mapping at gNB.
parent add341e2
......@@ -85,6 +85,13 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols,
}
}
unsigned int get_first_ptrs_re(const rnti_t rnti, const uint8_t K_ptrs, const uint16_t nRB, const uint8_t k_RE_ref)
{
const uint16_t nRB_Kptrs = nRB % K_ptrs;
const uint16_t k_RB_ref = nRB_Kptrs ? (rnti % nRB_Kptrs) : (rnti % K_ptrs);
return (k_RE_ref + k_RB_ref * NR_NB_SC_PER_RB);
}
/*******************************************************************
*
* NAME : is_ptrs_subcarrier
......
......@@ -53,6 +53,8 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols,
uint8_t L_ptrs,
uint16_t dmrs_symb_pos);
unsigned int get_first_ptrs_re(const rnti_t rnti, const uint8_t K_ptrs, const uint16_t nRB, const uint8_t k_RE_ref);
uint8_t is_ptrs_subcarrier(uint16_t k,
uint16_t n_rnti,
uint8_t K_ptrs,
......
This diff is collapsed.
......@@ -24,6 +24,18 @@
#include <simde/simde-common.h>
#include <simde/x86/sse.h>
void mult_real_vector_single_vector(const c16_t *x, const int16_t *alpha, c16_t *y, const unsigned int N)
{
const simd_q15_t *alpha_128 = (const simd_q15_t *)alpha;
const simd_q15_t *x_128 = (const simd_q15_t *)x;
simd_q15_t *y_128 = (simd_q15_t *)y;
const unsigned int num_adds = (N + 3) / 4; // ceil(N/4)
for (uint_fast32_t n = 0; n < num_adds; n++) {
y_128[n] = mulhi_int16(x_128[n], *alpha_128);
}
}
void multadd_complex_vector_real_scalar(int16_t *x,
int16_t alpha,
int16_t *y,
......@@ -35,19 +47,20 @@ void multadd_complex_vector_real_scalar(int16_t *x,
int n;
alpha_128 = set1_int16(alpha);
const uint32_t num_adds = (N + 3) / 4; // ceil(N/4)
if (zero_flag == 1)
for (n=0; n<N>>2; n++) {
// print_shorts("x_128[n]=", &x_128[n]);
// print_shorts("alpha_128", &alpha_128);
if (zero_flag == 1) {
for (n = 0; n < num_adds; n++) {
// print_shorts("x_128[n]=", &x_128[n]);
// print_shorts("alpha_128", &alpha_128);
y_128[n] = mulhi_int16(x_128[n],alpha_128);
// print_shorts("y_128[n]=", &y_128[n]);
}
else
for (n=0; n<N>>2; n++) {
} else {
for (n = 0; n < num_adds; n++) {
y_128[n] = adds_int16(y_128[n],mulhi_int16(x_128[n],alpha_128));
}
}
simde_mm_empty();
simde_m_empty();
......
......@@ -52,6 +52,9 @@
extern "C" {
#endif
#define ALIGNARRAYSIZE(a, b) (((a + b - 1) / b) * b)
#define ALNARS_16_4(a) ALIGNARRAYSIZE(a, 4)
typedef struct complexd {
double r;
double i;
......@@ -821,6 +824,8 @@ double interp(double x, double *xs, double *ys, int count);
void simde_mm128_separate_real_imag_parts(simde__m128i *out_re, simde__m128i *out_im, simde__m128i in0, simde__m128i in1);
void simde_mm256_separate_real_imag_parts(simde__m256i *out_re, simde__m256i *out_im, simde__m256i in0, simde__m256i in1);
void mult_real_vector_single_vector(const c16_t *x, const int16_t *alpha, c16_t *y, const unsigned int N);
#ifdef __cplusplus
}
#endif
......
......@@ -1421,17 +1421,6 @@ int main(int argc, char *argv[])
errors_decoding++;
}
}
if (n_trials == 1) {
for (int r = 0; r < UE->ul_harq_processes[harq_pid].C; r++)
for (int i = 0; i < UE->ul_harq_processes[harq_pid].K >> 3; i++) {
if ((UE->ul_harq_processes[harq_pid].c[r][i] ^ ulsch_gNB->harq_process->c[r][i]) != 0)
printf("************");
/*printf("r %d: in[%d] %x, out[%d] %x (%x)\n",r,
i,UE->ul_harq_processes[harq_pid].c[r][i],
i,ulsch_gNB->harq_process->c[r][i],
UE->ul_harq_processes[harq_pid].c[r][i]^ulsch_gNB->harq_process->c[r][i]);*/
}
}
if (errors_decoding > 0 && error_flag == 0) {
n_false_positive++;
if (n_trials==1)
......
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