mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 12:40:28 +00:00
Compare commits
4 Commits
statsMonit
...
revert_pol
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89a1343b8c | ||
|
|
9078fce945 | ||
|
|
ffac414117 | ||
|
|
a699feda87 |
@@ -665,6 +665,7 @@ void polar_encoder_fast(uint64_t *A,
|
||||
printf("\n");
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
uint64_t u[16] = {0};
|
||||
nr_polar_generate_u(u,
|
||||
Cprime,
|
||||
@@ -703,6 +704,139 @@ void polar_encoder_fast(uint64_t *A,
|
||||
printf("\n");
|
||||
#endif
|
||||
|
||||
#else
|
||||
/* printf("Bbytes : %x.%x.%x.%x.%x.%x.%x.%x\n",Bbyte[0],Bbyte[1],Bbyte[2],Bbyte[3],Bbyte[4],Bbyte[5],Bbyte[6],Bbyte[7]);
|
||||
printf("%llx,%llx,%llx,%llx,%llx,%llx,%llx,%llx\n",polarParams->cprime_tab[0][Bbyte[0]] ,
|
||||
polarParams->cprime_tab[1][Bbyte[1]] ,
|
||||
polarParams->cprime_tab[2][Bbyte[2]] ,
|
||||
polarParams->cprime_tab[3][Bbyte[3]] ,
|
||||
polarParams->cprime_tab[4][Bbyte[4]] ,
|
||||
polarParams->cprime_tab[5][Bbyte[5]] ,
|
||||
polarParams->cprime_tab[6][Bbyte[6]] ,
|
||||
polarParams->cprime_tab[7][Bbyte[7]]);*/
|
||||
// now do Gu product (here using 64-bit XORs, we can also do with SIMD after)
|
||||
// here we're reading out the bits LSB -> MSB, is this correct w.r.t. 3GPP ?
|
||||
uint64_t Cprime_i;
|
||||
/* printf("%llx Cprime_0 (%llx) G %llx,%llx,%llx,%llx,%llx,%llx,%llx,%llx\n",Cprime_i,Cprime &1,
|
||||
polarParams->G_N_tab[0][0],
|
||||
polarParams->G_N_tab[0][1],
|
||||
polarParams->G_N_tab[0][2],
|
||||
polarParams->G_N_tab[0][3],
|
||||
polarParams->G_N_tab[0][4],
|
||||
polarParams->G_N_tab[0][5],
|
||||
polarParams->G_N_tab[0][6],
|
||||
polarParams->G_N_tab[0][7]);*/
|
||||
uint64_t D[8]= {0,0,0,0,0,0,0,0};
|
||||
int off=0;
|
||||
int len=polarParams->K;
|
||||
cast2Darray(g_n, uint64_t, polarParams->G_N_tab);
|
||||
if (polarParams->N==512) {
|
||||
for (int j=0; j<(1+(polarParams->K>>6)); j++,off+=64,len-=64) {
|
||||
for (int i=0; i<((len>63) ? 64 : len); i++) {
|
||||
Cprime_i = -((Cprime[j]>>i)&1); // this converts bit 0 as, 0 => 0000x00, 1 => 1111x11
|
||||
/*
|
||||
#ifdef DEBUG_POLAR_ENCODER
|
||||
printf("%llx Cprime_%d (%llx) G %llx,%llx,%llx,%llx,%llx,%llx,%llx,%llx\n",
|
||||
Cprime_i,off+i,(Cprime[j]>>i) &1,
|
||||
polarParams->G_N_tab[off+i][0],
|
||||
polarParams->G_N_tab[off+i][1],
|
||||
polarParams->G_N_tab[off+i][2],
|
||||
polarParams->G_N_tab[off+i][3],
|
||||
polarParams->G_N_tab[off+i][4],
|
||||
polarParams->G_N_tab[off+i][5],
|
||||
polarParams->G_N_tab[off+i][6],
|
||||
polarParams->G_N_tab[off+i][7]);
|
||||
#endif
|
||||
*/
|
||||
uint64_t *Gi=g_n[off+i];
|
||||
D[0] ^= (Cprime_i & Gi[0]);
|
||||
D[1] ^= (Cprime_i & Gi[1]);
|
||||
D[2] ^= (Cprime_i & Gi[2]);
|
||||
D[3] ^= (Cprime_i & Gi[3]);
|
||||
D[4] ^= (Cprime_i & Gi[4]);
|
||||
D[5] ^= (Cprime_i & Gi[5]);
|
||||
D[6] ^= (Cprime_i & Gi[6]);
|
||||
D[7] ^= (Cprime_i & Gi[7]);
|
||||
|
||||
#ifdef DEBUG_POLAR_ENCODER
|
||||
printf("D %llx,%llx,%llx,%llx,%llx,%llx,%llx,%llx\n",
|
||||
D[0],
|
||||
D[1],
|
||||
D[2],
|
||||
D[3],
|
||||
D[4],
|
||||
D[5],
|
||||
D[6],
|
||||
D[7]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (polarParams->N==256) {
|
||||
for (int j=0; j<(1+(polarParams->K>>6)); j++,off+=64,len-=64) {
|
||||
for (int i=0; i<((len>63) ? 64 : len); i++) {
|
||||
Cprime_i = -((Cprime[j]>>i)&1); // this converts bit 0 as, 0 => 0000x00, 1 => 1111x11
|
||||
/*
|
||||
#ifdef DEBUG_POLAR_ENCODER
|
||||
printf("%llx Cprime_%d (%llx) G %llx,%llx,%llx,%llx\n",
|
||||
Cprime_i,off+i,(Cprime[j]>>i) &1,
|
||||
polarParams->G_N_tab[off+i][0],
|
||||
polarParams->G_N_tab[off+i][1],
|
||||
polarParams->G_N_tab[off+i][2],
|
||||
polarParams->G_N_tab[off+i][3],
|
||||
#endif
|
||||
*/
|
||||
uint64_t *Gi=g_n[off+i];
|
||||
D[0] ^= (Cprime_i & Gi[0]);
|
||||
D[1] ^= (Cprime_i & Gi[1]);
|
||||
D[2] ^= (Cprime_i & Gi[2]);
|
||||
D[3] ^= (Cprime_i & Gi[3]);
|
||||
|
||||
|
||||
#ifdef DEBUG_POLAR_ENCODER
|
||||
printf("D %llx,%llx,%llx,%llx\n",
|
||||
D[0],
|
||||
D[1],
|
||||
D[2],
|
||||
D[3]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (polarParams->N==128) {
|
||||
for (int j=0; j<(1+(polarParams->K>>6)); j++,off+=64,len-=64) {
|
||||
for (int i=0; i<((len>63) ? 64 : len); i++) {
|
||||
Cprime_i = -((Cprime[j]>>i)&1); // this converts bit 0 as, 0 => 0000x00, 1 => 1111x11
|
||||
|
||||
#ifdef DEBUG_POLAR_ENCODER
|
||||
printf("%lx Cprime_%d (%d+%d) (%llx) G %llx,%llx\n",
|
||||
Cprime_i,off+i,off,i,(Cprime[j]>>i) &1,
|
||||
polarParams->G_N_tab[off+i][0],
|
||||
polarParams->G_N_tab[off+i][1]);
|
||||
#endif
|
||||
|
||||
uint64_t *Gi=g_n[off+i];
|
||||
D[0] ^= (Cprime_i & Gi[0]);
|
||||
D[1] ^= (Cprime_i & Gi[1]);
|
||||
|
||||
|
||||
#ifdef DEBUG_POLAR_ENCODER
|
||||
printf("D %llx,%llx\n",
|
||||
D[0],
|
||||
D[1]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
} else if (polarParams->N == 64) {
|
||||
for (int i = 0; i < ((len > 63) ? 64 : len); i++) {
|
||||
Cprime_i = -((Cprime[0] >> i) & 1);
|
||||
D[0] ^= (Cprime_i & g_n[off + i][0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
memset((void*)out,0,polarParams->encoderLength>>3);
|
||||
polar_rate_matching(polarParams,(void *)D, out);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ oai_dfts_sse4: oai_dfts.c
|
||||
gcc -O3 -std=gnu99 -msse4.1 -o oai_dfts_sse4 oai_dfts.c time_meas.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR_HOME -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR_TARGETS/COMMON -I$$OPENAIR_HOME/radio/COMMON -I$$OPENAIR2_DIR -I$$OPENAIR2_DIR/COMMON -I$$OPENAIR_HOME/common/utils -I$$OPENAIR_HOME/common/utils/T -I$$OPENAIR_HOME/common/utils/msc -I$$OPENAIR_HOME/nfapi/open-nFAPI/nfapi/public_inc -DMR_MAIN -DNB_ANTENNAS_RX=1 -lm -lpthread # -DD256STATS #-DD64STATS
|
||||
|
||||
oai_dfts_avx2: oai_dfts.c
|
||||
gcc -O2 -std=gnu99 -mavx2 -g -ggdb -o oai_dfts_avx2 oai_dfts.c time_meas.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR_HOME -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR_TARGETS/COMMON -I$$OPENAIR_HOME/radio/COMMON -I$$OPENAIR2_DIR -I$$OPENAIR2_DIR/COMMON -I$$OPENAIR_HOME/common/utils -I$$OPENAIR_HOME/common/utils/T -I$$OPENAIR_HOME/common/utils/msc -I$$OPENAIR_HOME/nfapi/open-nFAPI/nfapi/public_inc -DMR_MAIN -DNB_ANTENNAS_RX=1 -lm -lpthread # -DD256STATS #-DD64STATS
|
||||
gcc -O2 -std=gnu99 -mavx2 -g -ggdb -o oai_dfts_avx2 oai_dfts.c $$OPENAIR_HOME/common/utils/time_meas.c ../../SIMULATION/TOOLS/taus.c $$OPENAIR_HOME/openair1/SIMULATION/TOOLS/rangen_double.c $$OPENAIR_HOME/common/utils/LOG/log.c $$OPENAIR_HOME/common/config/config_userapi.c $$OPENAIR_HOME/common/config/config_cmdline.c $$OPENAIR_HOME/common/config/config_common.c -I$$OPENAIR_HOME -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR_TARGETS/COMMON -I$$OPENAIR_HOME/radio/COMMON -I$$OPENAIR2_DIR -I$$OPENAIR2_DIR/COMMON -I$$OPENAIR_HOME/common/utils -I$$OPENAIR_HOME/common/utils/T -I$$OPENAIR_HOME/common/utils/msc -I$$OPENAIR_HOME/nfapi/open-nFAPI/nfapi/public_inc -DMR_MAIN -DNB_ANTENNAS_RX=1 -DNB_ANTENNAS_TX=1 -DMAX_NUM_CCs=1 -lm -lpthread # -DD256STATS #-DD64STATS
|
||||
|
||||
oai_dfts_avx2.s: oai_dfts.c
|
||||
gcc -O2 -std=gnu99 -mavx2 -S oai_dfts.c time_meas.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR_HOME -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR_TARGETS/COMMON -I$$OPENAIR_HOME/radio/COMMON -I$$OPENAIR2_DIR -I$$OPENAIR2_DIR/COMMON -I$$OPENAIR_HOME/common/utils -I$$OPENAIR_HOME/common/utils/T -I$$OPENAIR_HOME/common/utils/msc -I$$OPENAIR_HOME/nfapi/open-nFAPI/nfapi/public_inc -DMR_MAIN -DNB_ANTENNAS_RX=1 -lm -lpthread # -DD256STATS #-DD64STATS
|
||||
|
||||
@@ -7948,8 +7948,28 @@ void idft(uint8_t sizeidx, int16_t *input,int16_t *output,unsigned char scale_fl
|
||||
#ifdef MR_MAIN
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "common/config/config_load_configmodule.h"
|
||||
#include "../../SIMULATION/TOOLS/sim.h"
|
||||
|
||||
#define LOG_M write_output
|
||||
configmodule_interface_t *cfgptr=NULL;
|
||||
configmodule_interface_t *uniqCfg = NULL;
|
||||
|
||||
void exit_function(const char *file, const char *function, const int line, const char *s, const int assert) {
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
static
|
||||
int64_t time_now_ns(void)
|
||||
{
|
||||
struct timespec tms;
|
||||
|
||||
if (clock_gettime(CLOCK_REALTIME,&tms)) {
|
||||
return -1;
|
||||
}
|
||||
int64_t nanos = tms.tv_sec * 1000000000 + tms.tv_nsec;
|
||||
return nanos;
|
||||
}
|
||||
/*#define LOG_M write_output
|
||||
int write_output(const char *fname,const char *vname,void *data,int length,int dec,char format)
|
||||
{
|
||||
|
||||
@@ -8104,7 +8124,7 @@ int write_output(const char *fname,const char *vname,void *data,int length,int d
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
int main(int argc, char**argv)
|
||||
{
|
||||
@@ -8601,14 +8621,15 @@ int main(int argc, char**argv)
|
||||
((int16_t*)x)[i] = -364;
|
||||
}
|
||||
reset_meas(&ts);
|
||||
|
||||
int64_t t0=time_now_ns();
|
||||
for (i=0; i<10000; i++) {
|
||||
start_meas(&ts);
|
||||
idft4096((int16_t *)x,(int16_t *)y,1);
|
||||
stop_meas(&ts);
|
||||
}
|
||||
|
||||
printf("\n\n4096-point(%f cycles)\n",(double)ts.diff/(double)ts.trials);
|
||||
int64_t t1=time_now_ns();
|
||||
printf("\n\n4096-point(%f cycles, %d ns)\n",(double)ts.diff/(double)ts.trials,(t1-t0)/10000);
|
||||
LOG_M("y4096.m","y4096",y,4096,1,1);
|
||||
LOG_M("x4096.m","x4096",x,4096,1,1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user