code review remarks, cannot perform full test (develop bugged)
This commit is contained in:
@@ -151,11 +151,5 @@ void lte_param_init(PHY_VARS_eNB **eNBp,
|
||||
else if (eNB->frame_parms.N_RB_DL == 25) ru->N_TA_offset = 624/4;
|
||||
} else ru->N_TA_offset=0;
|
||||
|
||||
if (IS_SOFTMODEM_BASICSIM)
|
||||
/* this is required for the basic simulator in TDD mode
|
||||
* TODO: find a proper cleaner solution
|
||||
*/
|
||||
UE->N_TA_offset = 0;
|
||||
|
||||
printf("Done lte_param_init\n");
|
||||
}
|
||||
|
||||
+415
-1
@@ -38,7 +38,7 @@
|
||||
#include "openair1/PHY/CODING/nrLDPC_extern.h"
|
||||
#include "assertions.h"
|
||||
#include <math.h>
|
||||
|
||||
#include <complex.h>
|
||||
#include "PHY/NR_TRANSPORT/nr_ulsch.h"
|
||||
#include "PHY/NR_REFSIG/nr_refsig.h"
|
||||
#include "SCHED_NR/fapi_nr_l1.h"
|
||||
@@ -71,6 +71,407 @@ int l1_north_init_gNB() {
|
||||
return(0);
|
||||
}
|
||||
|
||||
int init_codebook_gNB(PHY_VARS_gNB *gNB) {
|
||||
|
||||
if(gNB->frame_parms.nb_antennas_tx>1){
|
||||
int CSI_RS_antenna_ports = gNB->frame_parms.nb_antennas_tx;
|
||||
//NR Codebook Generation for codebook type1 SinglePanel
|
||||
int N1 = gNB->ap_N1;
|
||||
int N2 = gNB->ap_N2;
|
||||
//Uniform Planner Array: UPA
|
||||
// X X X X ... X
|
||||
// X X X X ... X
|
||||
// N2 . . . . ... .
|
||||
// X X X X ... X
|
||||
// |<-----N1---->|
|
||||
int x_polarization = gNB->ap_XP;
|
||||
//Get the uniform planar array parameters
|
||||
// To be confirmed
|
||||
int O2 = N2 > 1? 4 : 1; //Vertical beam oversampling (1 or 4)
|
||||
int O1 = CSI_RS_antenna_ports > 2 ? 4 : 1; //Horizontal beam oversampling (1 or 4)
|
||||
AssertFatal(CSI_RS_antenna_ports == N1*N2*x_polarization,
|
||||
"Nb of antenna ports at PHY %d does not correspond to what passed down with fapi %d\n",
|
||||
N1*N2*x_polarization, CSI_RS_antenna_ports);
|
||||
|
||||
// Generation of codebook Type1 with codebookMode 1 (CSI_RS_antenna_ports < 16)
|
||||
if (CSI_RS_antenna_ports < 16) {
|
||||
//Generate DFT vertical beams
|
||||
//ll: index of a vertical beams vector (represented by i1_1 in TS 38.214)
|
||||
double complex v[N1*O1][N1];
|
||||
for (int ll=0; ll<N1*O1; ll++) { //i1_1
|
||||
for (int nn=0; nn<N1; nn++) {
|
||||
v[ll][nn] = cexp(I*(2*M_PI*nn*ll)/(N1*O1));
|
||||
//printf("v[%d][%d] = %f +j %f\n", ll,nn, creal(v[ll][nn]),cimag(v[ll][nn]));
|
||||
}
|
||||
}
|
||||
//Generate DFT Horizontal beams
|
||||
//mm: index of a Horizontal beams vector (represented by i1_2 in TS 38.214)
|
||||
double complex u[N2*O2][N2];
|
||||
for (int mm=0; mm<N2*O2; mm++) { //i1_2
|
||||
for (int nn=0; nn<N2; nn++) {
|
||||
u[mm][nn] = cexp(I*(2*M_PI*nn*mm)/(N2*O2));
|
||||
//printf("u[%d][%d] = %f +j %f\n", mm,nn, creal(u[mm][nn]),cimag(u[mm][nn]));
|
||||
}
|
||||
}
|
||||
//Generate co-phasing angles
|
||||
//i_2: index of a co-phasing vector
|
||||
//i1_1, i1_2, and i_2 are reported from UEs
|
||||
double complex theta_n[4];
|
||||
for (int nn=0; nn<4; nn++) {
|
||||
theta_n[nn] = cexp(I*M_PI*nn/2);
|
||||
//printf("theta_n[%d] = %f +j %f\n", nn, creal(theta_n[nn]),cimag(theta_n[nn]));
|
||||
}
|
||||
//Kronecker product v_lm
|
||||
double complex v_lm[N1*O1][N2*O2][N2*N1];
|
||||
//v_ll_mm_codebook denotes the elements of a precoding matrix W_i1,1_i_1,2
|
||||
for(int ll=0; ll<N1*O1; ll++) { //i_1_1
|
||||
for (int mm=0; mm<N2*O2; mm++) { //i_1_2
|
||||
for (int nn1=0; nn1<N1; nn1++) {
|
||||
for (int nn2=0; nn2<N2; nn2++) {
|
||||
//printf("indx %d \n",nn1*N2+nn2);
|
||||
v_lm[ll][mm][nn1*N2+nn2] = v[ll][nn1]*u[mm][nn2];
|
||||
//printf("v_lm[%d][%d][%d] = %f +j %f\n",ll,mm, nn1*N2+nn2, creal(v_lm[ll][mm][nn1*N2+nn2]),cimag(v_lm[ll][mm][nn1*N2+nn2]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int max_mimo_layers =(CSI_RS_antenna_ports<NR_MAX_NB_LAYERS) ? CSI_RS_antenna_ports : NR_MAX_NB_LAYERS;
|
||||
|
||||
gNB->nr_mimo_precoding_matrix = (int32_t ***)malloc16(max_mimo_layers* sizeof(int32_t **));
|
||||
int32_t ***mat = gNB->nr_mimo_precoding_matrix;
|
||||
double complex res_code;
|
||||
|
||||
//Table 5.2.2.2.1-5:
|
||||
//Codebook for 1-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS
|
||||
gNB->pmiq_size[0] = N1*O1*N2*O2*4+1;
|
||||
mat[0] = (int32_t **)malloc16(gNB->pmiq_size[0]*sizeof(int32_t *));
|
||||
|
||||
//pmi=0 corresponds to unit matrix
|
||||
mat[0][0] = (int32_t *)calloc(2*N1*N2,sizeof(int32_t));
|
||||
for(int j_col=0; j_col<1; j_col++) { //1 layer
|
||||
for (int i_rows=0; i_rows<2*N1*N2; i_rows++) { //2-x polarized antenna
|
||||
if(j_col==i_rows) {
|
||||
mat[0][0][i_rows+j_col] = 0x7fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(int ll=0; ll<N1*O1; ll++) { //i_1_1
|
||||
for (int mm=0; mm<N2*O2; mm++) { //i_1_2
|
||||
for (int nn=0; nn<4; nn++) {
|
||||
int pmiq = 1+ll*N2*O2*4+mm*4+nn;
|
||||
mat[0][pmiq] = (int32_t *)malloc16((2*N1*N2)*1*sizeof(int32_t));
|
||||
LOG_D(PHY, "layer 1 Codebook pmiq = %d\n",pmiq);
|
||||
for (int len=0; len<N1*N2; len++) {
|
||||
res_code=sqrt(1/(double)CSI_RS_antenna_ports)*v_lm[ll][mm][len];
|
||||
if (creal(res_code)>0)
|
||||
((short*) &mat[0][pmiq][len])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[0][pmiq][len])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15
|
||||
if (cimag(res_code)>0)
|
||||
((short*) &mat[0][pmiq][len])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[0][pmiq][len])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15
|
||||
LOG_D(PHY, "1 Layer Precoding Matrix[0][pmi %d][antPort %d]= %f+j %f -> Fixed Point %d+j %d \n",
|
||||
pmiq, len, creal(res_code), cimag(res_code),((short*) &mat[0][pmiq][len])[0],((short*) &mat[0][pmiq][len])[1]);
|
||||
}
|
||||
|
||||
for(int len=N1*N2; len<2*N1*N2; len++) {
|
||||
res_code=sqrt(1/(double)CSI_RS_antenna_ports)*theta_n[nn]*v_lm[ll][mm][len-N1*N2];
|
||||
if (creal(res_code)>0)
|
||||
((short*) &mat[0][pmiq][len])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[0][pmiq][len])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15
|
||||
if (cimag(res_code)>0)
|
||||
((short*) &mat[0][pmiq][len])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[0][pmiq][len])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15
|
||||
LOG_D(PHY, "1 Layer Precoding Matrix[0][pmi %d][antPort %d]= %f+j %f -> Fixed Point %d+j %d \n",
|
||||
pmiq, len, creal(res_code), cimag(res_code),((short*) &mat[0][pmiq][len])[0],((short*) &mat[0][pmiq][len])[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int llc;
|
||||
int mmc;
|
||||
double complex phase_sign;
|
||||
//Table 5.2.2.2.1-6:
|
||||
//Codebook for 2-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS
|
||||
//Compute the code book size for generating 2 layers out of Tx antenna ports
|
||||
|
||||
//pmi_size is computed as follows
|
||||
gNB->pmiq_size[1] = 1;//1 for unity matrix
|
||||
for(int llb=0; llb<N1*O1; llb++) { //i_1_1
|
||||
for (int mmb=0; mmb<N2*O2; mmb++) { //i_1_2
|
||||
for(int ll=0; ll<N1*O1; ll++) { //i_1_1
|
||||
for (int mm=0; mm<N2*O2; mm++) { //i_1_2
|
||||
for (int nn=0; nn<2; nn++) {
|
||||
if((llb != ll) || (mmb != mm) || ((N1 == 1) && (N2 == 1))) gNB->pmiq_size[1] += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
mat[1] = (int32_t **)malloc16(gNB->pmiq_size[1]*sizeof(int32_t *));
|
||||
|
||||
//pmi=0 corresponds to unit matrix
|
||||
mat[1][0] = (int32_t *)calloc((2*N1*N2)*(2),sizeof(int32_t));
|
||||
for(int j_col=0; j_col<2; j_col++) { //2 layers
|
||||
for (int i_rows=0; i_rows<2*N1*N2; i_rows++) { //2-x polarized antenna
|
||||
if(j_col==i_rows) {
|
||||
mat[1][0][i_rows*2+j_col] = 0x7fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//pmi=1,...,pmi_size, we construct
|
||||
int pmiq = 0;
|
||||
for(int llb=0; llb<N1*O1; llb++) { //i_1_1
|
||||
for (int mmb=0; mmb<N2*O2; mmb++) { //i_1_2
|
||||
for(int ll=0; ll<N1*O1; ll++) { //i_1_1
|
||||
for (int mm=0; mm<N2*O2; mm++) { //i_1_2
|
||||
for (int nn=0; nn<2; nn++) {
|
||||
if((llb != ll) || (mmb != mm) || ((N1 == 1) && (N2 == 1))){
|
||||
pmiq += 1;
|
||||
mat[1][pmiq] = (int32_t *)malloc16((2*N1*N2)*(2)*sizeof(int32_t));
|
||||
LOG_I(PHY, "layer 2 Codebook pmiq = %d\n",pmiq);
|
||||
for(int j_col=0; j_col<2; j_col++) {
|
||||
if (j_col==0) {
|
||||
llc = llb;
|
||||
mmc = mmb;
|
||||
phase_sign = 1;
|
||||
}
|
||||
if (j_col==1) {
|
||||
llc = ll;
|
||||
mmc = mm;
|
||||
phase_sign = -1;
|
||||
}
|
||||
for (int i_rows=0; i_rows<N1*N2; i_rows++) {
|
||||
res_code=sqrt(1/(double)(2*CSI_RS_antenna_ports))*v_lm[llc][mmc][i_rows];
|
||||
if (creal(res_code)>0)
|
||||
((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15
|
||||
if (cimag(res_code)>0)
|
||||
((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15
|
||||
LOG_D(PHY, "2 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",
|
||||
pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[1][pmiq][i_rows*2+j_col])[0],((short*) &mat[1][pmiq][i_rows*2+j_col])[1]);
|
||||
}
|
||||
for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) {
|
||||
res_code=sqrt(1/(double)(2*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2];
|
||||
if (creal(res_code)>0)
|
||||
((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15
|
||||
if (cimag(res_code)>0)
|
||||
((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15
|
||||
LOG_D(PHY, "2 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",
|
||||
pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[1][pmiq][i_rows*2+j_col])[0],((short*) &mat[1][pmiq][i_rows*2+j_col])[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Table 5.2.2.2.1-7:
|
||||
//Codebook for 3-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS
|
||||
if(max_mimo_layers>=3) {
|
||||
|
||||
//pmi_size is computed as follows
|
||||
gNB->pmiq_size[2] = 1;//unity matrix
|
||||
for(int llb=0; llb<N1*O1; llb++) { //i_1_1
|
||||
for (int mmb=0; mmb<N2*O2; mmb++) { //i_1_2
|
||||
for(int ll=0; ll<N1*O1; ll++) { //i_1_1
|
||||
for (int mm=0; mm<N2*O2; mm++) { //i_1_2
|
||||
for (int nn=0; nn<2; nn++) {
|
||||
if((llb != ll) || (mmb != mm)) gNB->pmiq_size[2] += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
mat[2] = (int32_t **)malloc16(gNB->pmiq_size[2]*sizeof(int32_t *));
|
||||
//pmi=0 corresponds to unit matrix
|
||||
mat[2][0] = (int32_t *)calloc((2*N1*N2)*(3),sizeof(int32_t));
|
||||
for(int j_col=0; j_col<3; j_col++) { //3 layers
|
||||
for (int i_rows=0; i_rows<2*N1*N2; i_rows++) { //2-x polarized antenna
|
||||
if(j_col==i_rows) {
|
||||
mat[2][0][i_rows*3+j_col] = 0x7fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pmiq = 0;
|
||||
//pmi=1,...,pmi_size are computed as follows
|
||||
for(int llb=0; llb<N1*O1; llb++) { //i_1_1
|
||||
for (int mmb=0; mmb<N2*O2; mmb++) { //i_1_2
|
||||
for(int ll=0; ll<N1*O1; ll++) { //i_1_1
|
||||
for (int mm=0; mm<N2*O2; mm++) { //i_1_2
|
||||
for (int nn=0; nn<2; nn++) {
|
||||
if((llb != ll) || (mmb != mm)){
|
||||
pmiq += 1;
|
||||
mat[2][pmiq] = (int32_t *)malloc16((2*N1*N2)*(3)*sizeof(int32_t));
|
||||
LOG_I(PHY, "layer 3 Codebook pmiq = %d\n",pmiq);
|
||||
for(int j_col=0; j_col<3; j_col++) {
|
||||
if (j_col==0) {
|
||||
llc = llb;
|
||||
mmc = mmb;
|
||||
phase_sign = 1;
|
||||
}
|
||||
if (j_col==1) {
|
||||
llc = ll;
|
||||
mmc = mm;
|
||||
phase_sign = 1;
|
||||
}
|
||||
if (j_col==2) {
|
||||
llc = ll;
|
||||
mmc = mm;
|
||||
phase_sign = -1;
|
||||
}
|
||||
for (int i_rows=0; i_rows<N1*N2; i_rows++) {
|
||||
res_code=sqrt(1/(double)(3*CSI_RS_antenna_ports))*v_lm[llc][mmc][i_rows];
|
||||
if (creal(res_code)>0)
|
||||
((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15
|
||||
if (cimag(res_code)>0)
|
||||
((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15
|
||||
LOG_D(PHY, "3 Layer Precoding Matrix[2][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",
|
||||
pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[2][pmiq][i_rows*3+j_col])[0],((short*) &mat[2][pmiq][i_rows*3+j_col])[1]);
|
||||
}
|
||||
for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) {
|
||||
res_code=sqrt(1/(double)(3*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2];
|
||||
if (creal(res_code)>0)
|
||||
((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15
|
||||
if (cimag(res_code)>0)
|
||||
((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15
|
||||
LOG_D(PHY, "3 Layer Precoding Matrix[2][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",
|
||||
pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[2][pmiq][i_rows*3+j_col])[0],((short*) &mat[2][pmiq][i_rows*3+j_col])[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Table 5.2.2.2.1-8:
|
||||
//Codebook for 4-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS
|
||||
if(max_mimo_layers>=4) {
|
||||
//pmi_size is computed as follows
|
||||
gNB->pmiq_size[3] = 1;//unity matrix
|
||||
for(int llb=0; llb<N1*O1; llb++) { //i_1_1
|
||||
for (int mmb=0; mmb<N2*O2; mmb++) { //i_1_2
|
||||
for(int ll=0; ll<N1*O1; ll++) { //i_1_1
|
||||
for (int mm=0; mm<N2*O2; mm++) { //i_1_2
|
||||
for (int nn=0; nn<2; nn++) {
|
||||
if((llb != ll) || (mmb != mm)) gNB->pmiq_size[3] += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mat[3] = (int32_t **)malloc16(gNB->pmiq_size[3]*sizeof(int32_t *));
|
||||
//pmi=0 corresponds to unit matrix
|
||||
mat[3][0] = (int32_t *)calloc((2*N1*N2)*(4),sizeof(int32_t));
|
||||
for(int j_col=0; j_col<4; j_col++) { //4 layers
|
||||
for (int i_rows=0; i_rows<2*N1*N2; i_rows++) { //2-x polarized antenna
|
||||
if(j_col==i_rows) {
|
||||
mat[3][0][i_rows*4+j_col] = 0x7fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pmiq = 0;
|
||||
//pmi=1,...,pmi_size are computed as follows
|
||||
for(int llb=0; llb<N1*O1; llb++) { //i_1_1
|
||||
for (int mmb=0; mmb<N2*O2; mmb++) { //i_1_2
|
||||
for(int ll=0; ll<N1*O1; ll++) { //i_1_1
|
||||
for (int mm=0; mm<N2*O2; mm++) { //i_1_2
|
||||
for (int nn=0; nn<2; nn++) {
|
||||
|
||||
if((llb != ll) || (mmb != mm)){
|
||||
pmiq += 1;
|
||||
mat[3][pmiq] = (int32_t *)malloc16((2*N1*N2)*4*sizeof(int32_t));
|
||||
LOG_I(PHY, "layer 4 pmiq = %d\n",pmiq);
|
||||
for(int j_col=0; j_col<4; j_col++) {
|
||||
if (j_col==0) {
|
||||
llc = llb;
|
||||
mmc = mmb;
|
||||
phase_sign = 1;
|
||||
}
|
||||
if (j_col==1) {
|
||||
llc = ll;
|
||||
mmc = mm;
|
||||
phase_sign = 1;
|
||||
}
|
||||
if (j_col==2) {
|
||||
llc = llb;
|
||||
mmc = mmb;
|
||||
phase_sign = -1;
|
||||
}
|
||||
if (j_col==3) {
|
||||
llc = ll;
|
||||
mmc = mm;
|
||||
phase_sign = -1;
|
||||
}
|
||||
for (int i_rows=0; i_rows<N1*N2; i_rows++) {
|
||||
res_code=sqrt(1/(double)(4*CSI_RS_antenna_ports))*v_lm[llc][mmc][i_rows];
|
||||
if (creal(res_code)>0)
|
||||
((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15
|
||||
if (cimag(res_code)>0)
|
||||
((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15
|
||||
LOG_D(PHY, "4 Layer Precoding Matrix[3][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",
|
||||
pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[3][pmiq][i_rows*4+j_col])[0],((short*) &mat[3][pmiq][i_rows*4+j_col])[1]);
|
||||
}
|
||||
|
||||
for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) {
|
||||
res_code=sqrt(1/(double)(4*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2];
|
||||
if (creal(res_code)>0)
|
||||
((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15
|
||||
if (cimag(res_code)>0)
|
||||
((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15
|
||||
LOG_D(PHY, "4 Layer Precoding Matrix[3][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",
|
||||
pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[3][pmiq][i_rows*4+j_col])[0],((short*) &mat[3][pmiq][i_rows*4+j_col])[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
|
||||
unsigned char is_secondary_gNB,
|
||||
@@ -108,6 +509,9 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
|
||||
init_scrambling_luts();
|
||||
init_pucch2_luts();
|
||||
load_nrLDPClib(NULL);
|
||||
|
||||
init_codebook_gNB(gNB);
|
||||
|
||||
// PBCH DMRS gold sequences generation
|
||||
nr_init_pbch_dmrs(gNB);
|
||||
//PDCCH DMRS init
|
||||
@@ -317,6 +721,16 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
|
||||
const int max_ul_mimo_layers = 4; // taken from phy_init_nr_gNB()
|
||||
const int n_buf = Prx * max_ul_mimo_layers;
|
||||
|
||||
int max_dl_mimo_layers =(fp->nb_antennas_tx<NR_MAX_NB_LAYERS) ? fp->nb_antennas_tx : NR_MAX_NB_LAYERS;
|
||||
if (fp->nb_antennas_tx>1) {
|
||||
for (int nl = 0; nl < max_dl_mimo_layers; nl++) {
|
||||
for(int size = 0; size < gNB->pmiq_size[nl]; size++)
|
||||
free_and_zero(gNB->nr_mimo_precoding_matrix[nl][size]);
|
||||
free_and_zero(gNB->nr_mimo_precoding_matrix[nl]);
|
||||
}
|
||||
free_and_zero(gNB->nr_mimo_precoding_matrix);
|
||||
}
|
||||
|
||||
uint32_t ***pdcch_dmrs = gNB->nr_gold_pdcch_dmrs;
|
||||
for (int slot = 0; slot < fp->slots_per_frame; slot++) {
|
||||
for (int symb = 0; symb < fp->symbols_per_slot; symb++)
|
||||
|
||||
+14
-102
@@ -55,13 +55,11 @@ extern uint16_t beta_cqi[16];
|
||||
* \param[in] frame_parms LTE_DL_FRAME_PARMS structure.
|
||||
* \note This function is optimistic in that it expects malloc() to succeed.
|
||||
*/
|
||||
void phy_init_nr_ue__PDSCH(NR_UE_PDSCH *const pdsch,
|
||||
void phy_init_nr_ue_PDSCH(NR_UE_PDSCH *const pdsch,
|
||||
const NR_DL_FRAME_PARMS *const fp) {
|
||||
|
||||
AssertFatal( pdsch, "pdsch==0" );
|
||||
pdsch->pmi_ext = (uint8_t *)malloc16_clear( fp->N_RB_DL );
|
||||
pdsch->llr[0] = (int16_t *)malloc16_clear( (8*(3*8*6144))*sizeof(int16_t) );
|
||||
pdsch->layer_llr[0] = (int16_t *)malloc16_clear( (8*(3*8*6144))*sizeof(int16_t) );
|
||||
|
||||
pdsch->llr128 = (int16_t **)malloc16_clear( sizeof(int16_t *) );
|
||||
// FIXME! no further allocation for (int16_t*)pdsch->llr128 !!! expect SIGSEGV
|
||||
// FK, 11-3-2015: this is only as a temporary pointer, no memory is stored there
|
||||
@@ -73,8 +71,6 @@ void phy_init_nr_ue__PDSCH(NR_UE_PDSCH *const pdsch,
|
||||
pdsch->dl_ch_estimates_ext = (int32_t **)malloc16_clear( NR_MAX_NB_LAYERS*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
pdsch->dl_bf_ch_estimates = (int32_t **)malloc16_clear( NR_MAX_NB_LAYERS*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
pdsch->dl_bf_ch_estimates_ext = (int32_t **)malloc16_clear( NR_MAX_NB_LAYERS*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
//pdsch->dl_ch_rho_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
//pdsch->dl_ch_rho2_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
pdsch->dl_ch_mag0 = (int32_t **)malloc16_clear( NR_MAX_NB_LAYERS*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
pdsch->dl_ch_magb0 = (int32_t **)malloc16_clear( NR_MAX_NB_LAYERS*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
pdsch->dl_ch_magr0 = (int32_t **)malloc16_clear( NR_MAX_NB_LAYERS*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
@@ -103,8 +99,6 @@ void phy_init_nr_ue__PDSCH(NR_UE_PDSCH *const pdsch,
|
||||
pdsch->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * num );
|
||||
pdsch->dl_bf_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * fp->ofdm_symbol_size*7*2);
|
||||
pdsch->dl_bf_ch_estimates_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * num );
|
||||
//pdsch->dl_ch_rho_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
|
||||
//pdsch->dl_ch_rho2_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
|
||||
pdsch->dl_ch_mag0[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * num );
|
||||
pdsch->dl_ch_magb0[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * num );
|
||||
pdsch->dl_ch_magr0[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * num );
|
||||
@@ -136,8 +130,11 @@ void phy_term_nr_ue__PDSCH(NR_UE_PDSCH* pdsch, const NR_DL_FRAME_PARMS *const fp
|
||||
free_and_zero(pdsch->rho[i]);
|
||||
}
|
||||
free_and_zero(pdsch->pmi_ext);
|
||||
free_and_zero(pdsch->llr[0]);
|
||||
free_and_zero(pdsch->layer_llr[0]);
|
||||
int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
|
||||
for (int i=0; i<nb_codewords; i++)
|
||||
free_and_zero(pdsch->llr[i]);
|
||||
for (int i=0; i<NR_MAX_NB_LAYERS; i++)
|
||||
free_and_zero(pdsch->layer_llr[i]);
|
||||
free_and_zero(pdsch->llr128);
|
||||
free_and_zero(pdsch->rxdataF_ext);
|
||||
free_and_zero(pdsch->rxdataF_uespec_pilots);
|
||||
@@ -162,13 +159,10 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
NR_UE_COMMON *const common_vars = &ue->common_vars;
|
||||
NR_UE_PBCH **const pbch_vars = ue->pbch_vars;
|
||||
NR_UE_PRACH **const prach_vars = ue->prach_vars;
|
||||
int i,j,k,l,slot,symb;
|
||||
int i,j,slot,symb, gNB_id, th_id;
|
||||
|
||||
NR_UE_SRS **const srs_vars = ue->srs_vars;
|
||||
|
||||
int gNB_id;
|
||||
int th_id;
|
||||
|
||||
LOG_I(PHY, "Initializing UE vars for gNB TXant %u, UE RXant %u\n", fp->nb_antennas_tx, fp->nb_antennas_rx);
|
||||
|
||||
phy_init_nr_top(ue);
|
||||
@@ -348,54 +342,18 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
ue->nr_srs_info->srs_estimated_channel_time_shifted[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
|
||||
}
|
||||
|
||||
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
||||
phy_init_nr_ue__PDSCH( ue->pdsch_vars[th_id][gNB_id], fp );
|
||||
}
|
||||
|
||||
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
||||
ue->pdsch_vars[th_id][gNB_id]->llr_shifts = (uint8_t *)malloc16_clear(7*2*fp->N_RB_DL*12);
|
||||
ue->pdsch_vars[th_id][gNB_id]->llr_shifts_p = ue->pdsch_vars[0][gNB_id]->llr_shifts;
|
||||
ue->pdsch_vars[th_id][gNB_id]->llr[1] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );
|
||||
ue->pdsch_vars[th_id][gNB_id]->layer_llr[1] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );
|
||||
ue->pdsch_vars[th_id][gNB_id]->llr128_2ndstream = (int16_t **)malloc16_clear( sizeof(int16_t *) );
|
||||
phy_init_nr_ue_PDSCH( ue->pdsch_vars[th_id][gNB_id], fp );
|
||||
}
|
||||
|
||||
|
||||
int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
|
||||
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
||||
ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
}
|
||||
|
||||
for (i=0; i<fp->nb_antennas_rx; i++)
|
||||
for (j=0; j<4; j++) {
|
||||
const int idx = (j*fp->nb_antennas_rx)+i;
|
||||
const size_t num = 7*2*fp->N_RB_DL*12+4;
|
||||
|
||||
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
||||
ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * num );
|
||||
}
|
||||
for (i=0; i<nb_codewords; i++) {
|
||||
ue->pdsch_vars[th_id][gNB_id]->llr[i] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );//Q_m = 8 bits/Sym, Code_Rate=3, Number of Segments =8, Circular Buffer K_cb = 8448
|
||||
}
|
||||
|
||||
//const size_t num = 7*2*fp->N_RB_DL*12+4;
|
||||
for (k=0; k<8; k++) { //harq_pid
|
||||
for (l=0; l<8; l++) { //round
|
||||
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
||||
ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
}
|
||||
|
||||
for (int i=0; i<fp->nb_antennas_rx; i++)
|
||||
for (int j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++)
|
||||
const int idx = (j*fp->nb_antennas_rx)+i;
|
||||
|
||||
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
||||
ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12));
|
||||
ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12));
|
||||
ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12));
|
||||
ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12));
|
||||
}
|
||||
}
|
||||
for (i=0; i<NR_MAX_NB_LAYERS; i++) {
|
||||
ue->pdsch_vars[th_id][gNB_id]->layer_llr[i] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );//Q_m = 8 bits/Sym, Code_Rate=3, Number of Segments =8, Circular Buffer K_cb = 8448
|
||||
}
|
||||
}
|
||||
|
||||
@@ -405,7 +363,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
ue->pdcch_vars[th_id][gNB_id]->llr16 = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
|
||||
ue->pdcch_vars[th_id][gNB_id]->wbar = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
|
||||
ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
ue->pdcch_vars[th_id][gNB_id]->rho = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
@@ -423,7 +380,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
// size_t num = 7*2*fp->N_RB_DL*12;
|
||||
size_t num = 4*273*12; // 4 symbols, 100 PRBs, 12 REs per PRB
|
||||
ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num);
|
||||
ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num);
|
||||
ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num);
|
||||
ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num);
|
||||
}
|
||||
@@ -436,13 +392,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
|
||||
}
|
||||
|
||||
// initialization for the last instance of pdsch_vars (used for MU-MIMO)
|
||||
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
||||
ue->pdsch_vars[th_id][gNB_id] = malloc16_clear(sizeof(NR_UE_PDSCH));
|
||||
ue->pdsch_vars[th_id][gNB_id]->llr[1] = malloc16_clear((8*(3*8*8448))*sizeof(int16_t));
|
||||
ue->pdsch_vars[th_id][gNB_id]->layer_llr[1] = malloc16_clear((8*(3*8*8448))*sizeof(int16_t));
|
||||
}
|
||||
|
||||
ue->sinr_CQI_dB = (double *) malloc16_clear( fp->N_RB_DL*12*sizeof(double) );
|
||||
ue->init_averaging = 1;
|
||||
|
||||
@@ -522,37 +471,9 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
|
||||
// PDSCH
|
||||
for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) {
|
||||
for (int k = 0; k < 8; k++) { //harq_pid
|
||||
for (int l = 0; l < 8; l++) { //round
|
||||
for (int i = 0; i < fp->nb_antennas_rx; i++) {
|
||||
for (int j = 0; j < 4; j++) { //frame_parms->nb_antennas_tx; j++)
|
||||
const int idx = j * fp->nb_antennas_rx + i;
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l][idx]);
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l][idx]);
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l][idx]);
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l][idx]);
|
||||
}
|
||||
}
|
||||
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l]);
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l]);
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l]);
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l]);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < fp->nb_antennas_rx; i++) {
|
||||
for (int j = 0; j < 4; j++) {
|
||||
const int idx = (j*fp->nb_antennas_rx)+i;
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext[idx]);
|
||||
}
|
||||
}
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr_shifts);
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr[1]);
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->layer_llr[1]);
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr128_2ndstream);
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext);
|
||||
|
||||
phy_term_nr_ue__PDSCH(ue->pdsch_vars[th_id][gNB_id], fp);
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]);
|
||||
}
|
||||
@@ -564,7 +485,6 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates[idx]);
|
||||
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time[idx]);
|
||||
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp[idx]);
|
||||
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext[idx]);
|
||||
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext[idx]);
|
||||
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext[idx]);
|
||||
}
|
||||
@@ -574,7 +494,6 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->llr16);
|
||||
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->wbar);
|
||||
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp);
|
||||
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext);
|
||||
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rho);
|
||||
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext);
|
||||
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext);
|
||||
@@ -610,13 +529,6 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
free_and_zero(ue->prach_vars[gNB_id]);
|
||||
}
|
||||
|
||||
const int gNB_id = ue->n_connected_gNB;
|
||||
for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) {
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr[1]);
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->layer_llr[1]);
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]);
|
||||
}
|
||||
|
||||
free_and_zero(ue->sinr_CQI_dB);
|
||||
}
|
||||
|
||||
|
||||
@@ -402,6 +402,7 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue);
|
||||
void init_N_TA_offset(PHY_VARS_NR_UE *ue);
|
||||
void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms);
|
||||
int phy_init_nr_gNB(PHY_VARS_gNB *gNB, unsigned char is_secondary_gNB, unsigned char lowmem_flag);
|
||||
int init_codebook_gNB(PHY_VARS_gNB *gNB);
|
||||
void nr_phy_config_request(NR_PHY_Config_t *gNB);
|
||||
void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu,int Nid_cell,uint64_t position_in_burst);
|
||||
void phy_free_nr_gNB(PHY_VARS_gNB *gNB);
|
||||
|
||||
@@ -72,10 +72,6 @@ int generate_pss(int32_t **txdataF,
|
||||
a = (frame_parms->nb_antenna_ports_eNB == 1) ? amp: (amp*ONE_OVER_SQRT2_Q15)>>15;
|
||||
//printf("[PSS] amp=%d, a=%d\n",amp,a);
|
||||
|
||||
if (IS_SOFTMODEM_BASICSIM)
|
||||
/* a hack to remove at some point (the UE doesn't synch with 100 RBs) */
|
||||
a = (frame_parms->nb_antenna_ports_eNB == 1) ? 4*amp: (amp*ONE_OVER_SQRT2_Q15)>>15;
|
||||
|
||||
Nsymb = (frame_parms->Ncp==NORMAL)?14:12;
|
||||
|
||||
for (aa=0; aa<frame_parms->nb_antenna_ports_eNB; aa++) {
|
||||
|
||||
@@ -557,11 +557,6 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
|
||||
ue->measurements.rx_power_avg_dB[0] = dB_fixed(ue->measurements.rx_power_avg[0]);
|
||||
LOG_I(PHY,"[UE%d] Initial sync : Estimated power: %d dB\n",ue->Mod_id,ue->measurements.rx_power_avg_dB[0] );
|
||||
|
||||
if (IS_SOFTMODEM_BASICSIM )
|
||||
phy_adjust_gain(ue,ue->measurements.rx_power_avg_dB[0],0);
|
||||
} else {
|
||||
if (IS_SOFTMODEM_BASICSIM )
|
||||
phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -81,29 +81,20 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
|
||||
int i, prach_len;
|
||||
uint16_t first_nonzero_root_idx=0;
|
||||
|
||||
if ( !(IS_SOFTMODEM_BASICSIM ) ) {
|
||||
prach_start = (ue->rx_offset+subframe*ue->frame_parms.samples_per_tti-ue->hw_timing_advance-ue->N_TA_offset);
|
||||
prach_start = (ue->rx_offset+subframe*ue->frame_parms.samples_per_tti-ue->hw_timing_advance-ue->N_TA_offset);
|
||||
#ifdef PRACH_DEBUG
|
||||
LOG_I(PHY,"[UE %d] prach_start %d, rx_offset %d, hw_timing_advance %d, N_TA_offset %d\n", ue->Mod_id,
|
||||
prach_start,
|
||||
ue->rx_offset,
|
||||
ue->hw_timing_advance,
|
||||
ue->N_TA_offset);
|
||||
LOG_I(PHY,"[UE %d] prach_start %d, rx_offset %d, hw_timing_advance %d, N_TA_offset %d\n", ue->Mod_id,
|
||||
prach_start,
|
||||
ue->rx_offset,
|
||||
ue->hw_timing_advance,
|
||||
ue->N_TA_offset);
|
||||
#endif
|
||||
|
||||
if (prach_start<0)
|
||||
prach_start+=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
|
||||
if (prach_start<0)
|
||||
prach_start+=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
|
||||
|
||||
if (prach_start>=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME))
|
||||
prach_start-=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
|
||||
} else { //normal case (simulation)
|
||||
prach_start = subframe*ue->frame_parms.samples_per_tti-ue->N_TA_offset;
|
||||
LOG_I(PHY,"[UE %d] prach_start %d, rx_offset %d, hw_timing_advance %d, N_TA_offset %d\n", ue->Mod_id,
|
||||
prach_start,
|
||||
ue->rx_offset,
|
||||
ue->hw_timing_advance,
|
||||
ue->N_TA_offset);
|
||||
}
|
||||
if (prach_start>=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME))
|
||||
prach_start-=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
|
||||
|
||||
// First compute physical root sequence
|
||||
if (restricted_set == 0) {
|
||||
@@ -476,40 +467,32 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
|
||||
AssertFatal(prach_fmt<4,
|
||||
"prach_fmt4 not fully implemented" );
|
||||
|
||||
if (!(IS_SOFTMODEM_BASICSIM ) ) {
|
||||
int j;
|
||||
int overflow = prach_start + prach_len - LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*ue->frame_parms.samples_per_tti;
|
||||
LOG_I( PHY, "prach_start=%d, overflow=%d\n", prach_start, overflow );
|
||||
int j;
|
||||
int overflow = prach_start + prach_len - LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*ue->frame_parms.samples_per_tti;
|
||||
LOG_I( PHY, "prach_start=%d, overflow=%d\n", prach_start, overflow );
|
||||
|
||||
for (i=prach_start,j=0; i<min(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,prach_start+prach_len); i++,j++) {
|
||||
((int16_t *)ue->common_vars.txdata[0])[2*i] = prach[2*j];
|
||||
((int16_t *)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1];
|
||||
}
|
||||
for (i=prach_start,j=0; i<min(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,prach_start+prach_len); i++,j++) {
|
||||
((int16_t *)ue->common_vars.txdata[0])[2*i] = prach[2*j];
|
||||
((int16_t *)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1];
|
||||
}
|
||||
|
||||
for (i=0; i<overflow; i++,j++) {
|
||||
((int16_t *)ue->common_vars.txdata[0])[2*i] = prach[2*j];
|
||||
((int16_t *)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1];
|
||||
}
|
||||
for (i=0; i<overflow; i++,j++) {
|
||||
((int16_t *)ue->common_vars.txdata[0])[2*i] = prach[2*j];
|
||||
((int16_t *)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1];
|
||||
}
|
||||
|
||||
#if defined(EXMIMO)
|
||||
|
||||
// handle switch before 1st TX subframe, guarantee that the slot prior to transmission is switch on
|
||||
for (k=prach_start - (ue->frame_parms.samples_per_tti>>1) ; k<prach_start ; k++) {
|
||||
if (k<0)
|
||||
ue->common_vars.txdata[0][k+ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE;
|
||||
else if (k>(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME))
|
||||
ue->common_vars.txdata[0][k-ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE;
|
||||
else
|
||||
ue->common_vars.txdata[0][k] &= 0xFFFEFFFE;
|
||||
}
|
||||
|
||||
#endif
|
||||
} else { // simulators
|
||||
for (i=0; i<prach_len; i++) {
|
||||
((int16_t *)(&ue->common_vars.txdata[0][prach_start]))[2*i] = prach[2*i];
|
||||
((int16_t *)(&ue->common_vars.txdata[0][prach_start]))[2*i+1] = prach[2*i+1];
|
||||
}
|
||||
// handle switch before 1st TX subframe, guarantee that the slot prior to transmission is switch on
|
||||
for (k=prach_start - (ue->frame_parms.samples_per_tti>>1) ; k<prach_start ; k++) {
|
||||
if (k<0)
|
||||
ue->common_vars.txdata[0][k+ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE;
|
||||
else if (k>(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME))
|
||||
ue->common_vars.txdata[0][k-ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE;
|
||||
else
|
||||
ue->common_vars.txdata[0][k] &= 0xFFFEFFFE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PRACH_WRITE_OUTPUT_DEBUG)
|
||||
LOG_M("prach_txF0.m","prachtxF0",prachF,prach_len-Ncp,1,1);
|
||||
|
||||
@@ -719,3 +719,18 @@ int nr_layer_precoder(int16_t **datatx_F_precoding, char *prec_matrix, uint8_t n
|
||||
/* ((int16_t *)precodatatx_F)[0] = (int16_t)((((int16_t *)precodatatx_F)[0]*ONE_OVER_SQRT2_Q15)>>15);
|
||||
((int16_t *)precodatatx_F)[1] = (int16_t)((((int16_t *)precodatatx_F)[1]*ONE_OVER_SQRT2_Q15)>>15);*/
|
||||
}
|
||||
|
||||
int nr_layer_precoder_cm(int16_t **datatx_F_precoding, int *prec_matrix, uint8_t n_layers, int32_t re_offset)
|
||||
{
|
||||
int32_t precodatatx_F = 0;
|
||||
for (int al = 0; al<n_layers; al++) {
|
||||
int16_t antenna_re = datatx_F_precoding[al][re_offset<<1];
|
||||
int16_t antenna_im = datatx_F_precoding[al][(re_offset<<1) +1];
|
||||
//printf("antenna precoding: %d %d\n",((int16_t *)&prec_matrix[al])[0],((int16_t *)&prec_matrix[al])[1]);
|
||||
((int16_t *) &precodatatx_F)[0] += (int16_t)(((int32_t)(antenna_re*(((int16_t *)&prec_matrix[al])[0])) - (int32_t)(antenna_im* (((int16_t *)&prec_matrix[al])[1])))>>15);
|
||||
((int16_t *) &precodatatx_F)[1] += (int16_t)(((int32_t)(antenna_re*(((int16_t *)&prec_matrix[al])[1])) + (int32_t)(antenna_im* (((int16_t *)&prec_matrix[al])[0])))>>15);
|
||||
}
|
||||
|
||||
return precodatatx_F;
|
||||
}
|
||||
|
||||
|
||||
@@ -135,4 +135,9 @@ int nr_layer_precoder(int16_t **datatx_F_precoding,
|
||||
char *prec_matrix,
|
||||
uint8_t n_layers,
|
||||
int32_t re_offset);
|
||||
|
||||
int nr_layer_precoder_cm(int16_t **datatx_F_precoding,
|
||||
int *prec_matrix,
|
||||
uint8_t n_layers,
|
||||
int32_t re_offset);
|
||||
#endif
|
||||
|
||||
@@ -433,8 +433,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
|
||||
// The same precoding matrix is applied on prg_size RBs, Thus
|
||||
// pmi = prgs_list[rbidx/prg_size].pm_idx, rbidx =0,...,rbSize-1
|
||||
// The Precoding matrix:
|
||||
// The Codebook Type I and Type II are not supported yet.
|
||||
// We`adopt the precoding matrices of PUSCH for 4 layers.
|
||||
// The Codebook Type I
|
||||
start_meas(&gNB->dlsch_precoding_stats);
|
||||
|
||||
for (int ap=0; ap<frame_parms->nb_antennas_tx; ap++) {
|
||||
@@ -451,61 +450,72 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
|
||||
pmi = 0;//no precoding
|
||||
|
||||
if (pmi == 0) {//unitary Precoding
|
||||
if(ap<rel15->nrOfLayers)
|
||||
memcpy((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k],
|
||||
(void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size + k)],
|
||||
NR_NB_SC_PER_RB*sizeof(int32_t));
|
||||
else
|
||||
memset((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k],
|
||||
0,
|
||||
NR_NB_SC_PER_RB*sizeof(int32_t));
|
||||
if (k + NR_NB_SC_PER_RB <= frame_parms->ofdm_symbol_size) { // RB does not cross DC
|
||||
if(ap<rel15->nrOfLayers)
|
||||
memcpy((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k],
|
||||
(void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size + k)],
|
||||
NR_NB_SC_PER_RB*sizeof(int32_t));
|
||||
else
|
||||
memset((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k],
|
||||
0,
|
||||
NR_NB_SC_PER_RB*sizeof(int32_t));
|
||||
} else { // RB does cross DC
|
||||
int neg_length = frame_parms->ofdm_symbol_size - k;
|
||||
int pos_length = NR_NB_SC_PER_RB - neg_length;
|
||||
if (ap<rel15->nrOfLayers) {
|
||||
memcpy((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k],
|
||||
(void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size + k)],
|
||||
neg_length*sizeof(int32_t));
|
||||
memcpy((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset],
|
||||
(void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size)],
|
||||
pos_length*sizeof(int32_t));
|
||||
} else {
|
||||
memset((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k],
|
||||
0,
|
||||
neg_length*sizeof(int32_t));
|
||||
memset((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset],
|
||||
0,
|
||||
pos_length*sizeof(int32_t));
|
||||
}
|
||||
}
|
||||
k += NR_NB_SC_PER_RB;
|
||||
if (k >= frame_parms->ofdm_symbol_size) {
|
||||
k -= frame_parms->ofdm_symbol_size;
|
||||
}
|
||||
}
|
||||
else {
|
||||
//get the precoding matrix weights:
|
||||
char *W_prec;
|
||||
switch (frame_parms->nb_antennas_tx) {
|
||||
case 1://1 antenna port
|
||||
W_prec = nr_W_1l_2p[pmi][ap];
|
||||
break;
|
||||
case 2://2 antenna ports
|
||||
if (rel15->nrOfLayers == 1)//1 layer
|
||||
W_prec = nr_W_1l_2p[pmi][ap];
|
||||
else//2 layers
|
||||
W_prec = nr_W_2l_2p[pmi][ap];
|
||||
break;
|
||||
case 4://4 antenna ports
|
||||
if (rel15->nrOfLayers == 1)//1 layer
|
||||
W_prec = nr_W_1l_4p[pmi][ap];
|
||||
else if (rel15->nrOfLayers == 2)//2 layers
|
||||
W_prec = nr_W_2l_4p[pmi][ap];
|
||||
else if (rel15->nrOfLayers == 3)//3 layers
|
||||
W_prec = nr_W_3l_4p[pmi][ap];
|
||||
else//4 layers
|
||||
W_prec = nr_W_4l_4p[pmi][ap];
|
||||
break;
|
||||
default:
|
||||
LOG_D(PHY,"Precoding 1,2, or 4 antenna ports are currently supported\n");
|
||||
W_prec = nr_W_1l_2p[pmi][ap];
|
||||
break;
|
||||
}
|
||||
for (int i=0; i<NR_NB_SC_PER_RB; i++) {
|
||||
int32_t re_offset = l*frame_parms->ofdm_symbol_size + k;
|
||||
int32_t precodatatx_F = nr_layer_precoder(txdataF_precoding, W_prec, rel15->nrOfLayers, re_offset);
|
||||
((int16_t*)txdataF[ap])[(re_offset<<1) + (2*txdataF_offset)] = ((int16_t *) &precodatatx_F)[0];
|
||||
((int16_t*)txdataF[ap])[(re_offset<<1) + 1 + (2*txdataF_offset)] = ((int16_t *) &precodatatx_F)[1];
|
||||
#ifdef DEBUG_DLSCH_MAPPING
|
||||
printf("antenna %d\t l %d \t k %d \t txdataF: %d %d\n",
|
||||
ap, l, k, ((int16_t*)txdataF[ap])[(re_offset<<1) + (2*txdataF_offset)],
|
||||
((int16_t*)txdataF[ap])[(re_offset<<1) + 1 + (2*txdataF_offset)]);
|
||||
#endif
|
||||
if (++k >= frame_parms->ofdm_symbol_size) {
|
||||
if(frame_parms->nb_antennas_tx==1){//no precoding matrix defined
|
||||
memcpy((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k],
|
||||
(void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size + k)],
|
||||
NR_NB_SC_PER_RB*sizeof(int32_t));
|
||||
k += NR_NB_SC_PER_RB;
|
||||
if (k >= frame_parms->ofdm_symbol_size) {
|
||||
k -= frame_parms->ofdm_symbol_size;
|
||||
}
|
||||
}
|
||||
else {
|
||||
//get the precoding matrix weights:
|
||||
int32_t **mat = gNB->nr_mimo_precoding_matrix[rel15->nrOfLayers-1];
|
||||
//i_row =0,...,dl_antenna_port
|
||||
//j_col =0,...,nrOfLayers
|
||||
//mat[pmi][i_rows*2+j_col]
|
||||
int *W_prec;
|
||||
W_prec = (int32_t *)&mat[pmi][ap*rel15->nrOfLayers];
|
||||
for (int i=0; i<NR_NB_SC_PER_RB; i++) {
|
||||
int32_t re_offset = l*frame_parms->ofdm_symbol_size + k;
|
||||
int32_t precodatatx_F = nr_layer_precoder_cm(txdataF_precoding, W_prec, rel15->nrOfLayers, re_offset);
|
||||
((int16_t*)txdataF[ap])[(re_offset<<1) + (2*txdataF_offset)] = ((int16_t *) &precodatatx_F)[0];
|
||||
((int16_t*)txdataF[ap])[(re_offset<<1) + 1 + (2*txdataF_offset)] = ((int16_t *) &precodatatx_F)[1];
|
||||
#ifdef DEBUG_DLSCH_MAPPING
|
||||
printf("antenna %d\t l %d \t k %d \t txdataF: %d %d\n",
|
||||
ap, l, k, ((int16_t*)txdataF[ap])[(re_offset<<1) + (2*txdataF_offset)],
|
||||
((int16_t*)txdataF[ap])[(re_offset<<1) + 1 + (2*txdataF_offset)]);
|
||||
#endif
|
||||
if (++k >= frame_parms->ofdm_symbol_size) {
|
||||
k -= frame_parms->ofdm_symbol_size;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} //RB loop
|
||||
} // symbol loop
|
||||
|
||||
@@ -356,7 +356,7 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF,
|
||||
if (is_dmrs_symbol == 0) {
|
||||
//
|
||||
//rxF[ ((start_re + re)*2) % (frame_parms->ofdm_symbol_size*2)]);
|
||||
if (start_re + nb_re_pusch < frame_parms->ofdm_symbol_size) {
|
||||
if (start_re + nb_re_pusch <= frame_parms->ofdm_symbol_size) {
|
||||
memcpy1((void*)rxF_ext,
|
||||
(void*)&rxF[start_re*2],
|
||||
nb_re_pusch*sizeof(int32_t));
|
||||
|
||||
@@ -534,8 +534,12 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
16);
|
||||
pil += 2;
|
||||
rxF += 8;
|
||||
//for (int i= 0; i<8; i++)
|
||||
//printf("dl_ch addr %p %d\n", dl_ch+i, *(dl_ch+i));
|
||||
k += 4;
|
||||
|
||||
if (k >= ue->frame_parms.ofdm_symbol_size) {
|
||||
k -= ue->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+1)];
|
||||
}
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
@@ -548,6 +552,12 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
16);
|
||||
pil += 2;
|
||||
rxF += 8;
|
||||
k += 4;
|
||||
|
||||
if (k >= ue->frame_parms.ofdm_symbol_size) {
|
||||
k -= ue->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+1)];
|
||||
}
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
@@ -560,23 +570,22 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
ch,
|
||||
dl_ch,
|
||||
16);
|
||||
|
||||
#ifdef DEBUG_PDCCH
|
||||
#ifdef DEBUG_PDCCH
|
||||
for (int m =0; m<12; m++)
|
||||
printf("data : dl_ch -> (%d,%d)\n",dl_ch[0+2*m],dl_ch[1+2*m]);
|
||||
#endif
|
||||
#endif
|
||||
dl_ch += 24;
|
||||
|
||||
pil += 2;
|
||||
rxF += 8;
|
||||
dl_ch += 24;
|
||||
k += 12;
|
||||
|
||||
|
||||
k += 4;
|
||||
|
||||
for (pilot_cnt=3; pilot_cnt<(3*nb_rb_coreset); pilot_cnt += 3) {
|
||||
|
||||
if (k >= ue->frame_parms.ofdm_symbol_size){
|
||||
k-=ue->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+1)];}
|
||||
if (k >= ue->frame_parms.ofdm_symbol_size) {
|
||||
k -= ue->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+1)];
|
||||
}
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
@@ -593,6 +602,12 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
|
||||
pil += 2;
|
||||
rxF += 8;
|
||||
k += 4;
|
||||
|
||||
if (k >= ue->frame_parms.ofdm_symbol_size) {
|
||||
k -= ue->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+1)];
|
||||
}
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
@@ -605,6 +620,12 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
16);
|
||||
pil += 2;
|
||||
rxF += 8;
|
||||
k += 4;
|
||||
|
||||
if (k >= ue->frame_parms.ofdm_symbol_size) {
|
||||
k -= ue->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+1)];
|
||||
}
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
@@ -617,11 +638,15 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
ch,
|
||||
dl_ch,
|
||||
16);
|
||||
#ifdef DEBUG_PDCCH
|
||||
for (int m =0; m<12; m++)
|
||||
printf("data : dl_ch -> (%d,%d)\n",dl_ch[0+2*m],dl_ch[1+2*m]);
|
||||
#endif
|
||||
dl_ch += 24;
|
||||
|
||||
pil += 2;
|
||||
rxF += 8;
|
||||
dl_ch += 24;
|
||||
k += 12;
|
||||
|
||||
k += 4;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -61,12 +61,8 @@ char nr_dci_format_string[8][30] = {
|
||||
//#define NR_LTE_PDCCH_DCI_SWITCH
|
||||
//#define NR_PDCCH_DCI_DEBUG // activates NR_PDCCH_DCI_DEBUG logs
|
||||
#ifdef NR_PDCCH_DCI_DEBUG
|
||||
#define LOG_DNL(a, ...) printf("\n\t\t<-NR_PDCCH_DCI_DEBUG (%s)-> " a, __func__, ##__VA_ARGS__ )
|
||||
#define LOG_DD(a, ...) printf("\t<-NR_PDCCH_DCI_DEBUG (%s)-> " a, __func__, ##__VA_ARGS__ )
|
||||
#define LOG_DDD(a, ...) printf("\t\t<-NR_PDCCH_DCI_DEBUG (%s)-> " a, __func__, ##__VA_ARGS__ )
|
||||
#define LOG_DDD(a, ...) printf("<-NR_PDCCH_DCI_DEBUG (%s)-> " a, __func__, ##__VA_ARGS__ )
|
||||
#else
|
||||
#define LOG_DNL(a...)
|
||||
#define LOG_DD(a...)
|
||||
#define LOG_DDD(a...)
|
||||
#endif
|
||||
#define NR_NBR_CORESET_ACT_BWP 3 // The number of CoreSets per BWP is limited to 3 (including initial CORESET: ControlResourceId 0)
|
||||
@@ -84,7 +80,7 @@ char nr_dci_format_string[8][30] = {
|
||||
|
||||
|
||||
static void nr_pdcch_demapping_deinterleaving(uint32_t *llr,
|
||||
uint32_t *z,
|
||||
uint32_t *e_rx,
|
||||
uint8_t coreset_time_dur,
|
||||
uint8_t start_symbol,
|
||||
uint32_t coreset_nbr_rb,
|
||||
@@ -190,10 +186,10 @@ static void nr_pdcch_demapping_deinterleaving(uint32_t *llr,
|
||||
index_z = data_sc * rb_count;
|
||||
index_llr = (uint16_t) (f*B_rb + rb + symbol_idx * coreset_nbr_rb) * data_sc;
|
||||
for (int i = 0; i < data_sc; i++) {
|
||||
z[index_z + i] = llr[index_llr + i];
|
||||
e_rx[index_z + i] = llr[index_llr + i];
|
||||
#ifdef NR_PDCCH_DCI_DEBUG
|
||||
LOG_I(PHY,"[candidate=%d,symbol_idx=%d,cce=%d,REG bundle=%d,PRB=%d] z[%d]=(%d,%d) <-> \t llr[%d]=(%d,%d) \n",
|
||||
c_id,symbol_idx,cce_count,k,f*B_rb + rb,(index_z + i),*(int16_t *) &z[index_z + i],*(1 + (int16_t *) &z[index_z + i]),
|
||||
c_id,symbol_idx,cce_count,k,f*B_rb + rb,(index_z + i),*(int16_t *) &e_rx[index_z + i],*(1 + (int16_t *) &e_rx[index_z + i]),
|
||||
(index_llr + i),*(int16_t *) &llr[index_llr + i], *(1 + (int16_t *) &llr[index_llr + i]));
|
||||
#endif
|
||||
}
|
||||
@@ -371,11 +367,6 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF,
|
||||
uint8_t i, j, aarx;
|
||||
int32_t *dl_ch0, *dl_ch0_ext, *rxF, *rxF_ext;
|
||||
|
||||
#ifdef DEBUG_DCI_DECODING
|
||||
uint8_t symbol_mod = (symbol >= (7 - frame_parms->Ncp)) ? symbol - (7 - frame_parms->Ncp) : symbol;
|
||||
LOG_I(PHY, "extract_rbs_single: symbol_mod %d\n",symbol_mod);
|
||||
#endif
|
||||
|
||||
for (aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
|
||||
dl_ch0 = &dl_ch_estimates[aarx][frame_parms->ofdm_symbol_size*symbol];
|
||||
LOG_DDD("dl_ch0 = &dl_ch_estimates[aarx = (%d)][0]\n",aarx);
|
||||
@@ -397,9 +388,9 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF,
|
||||
* 1.2 The RB is >= than the N_RB_DL/2 -> IQ symbols are in the first half of the rxdataF (from element 0)
|
||||
* 2. Number of RBs in the system bandwidth is odd
|
||||
* (particular case when the RB with DC as it is treated differently: it is situated in symbol borders of rxdataF)
|
||||
* 2.1 The RB is <= than the N_RB_DL/2 -> IQ symbols are in the second half of the rxdataF (from first_carrier_offset)
|
||||
* 2.2 The RB is > than the N_RB_DL/2+1 -> IQ symbols are in the first half of the rxdataF (from element 0 + 2nd half RB containing DC)
|
||||
* 2.3 The RB is == N_RB_DL/2+1 -> IQ symbols are in the lower border of the rxdataF for first 6 IQ element and the upper border of the rxdataF for the last 6 IQ elements
|
||||
* 2.1 The RB is < than the N_RB_DL/2 -> IQ symbols are in the second half of the rxdataF (from first_carrier_offset)
|
||||
* 2.2 The RB is > than the N_RB_DL/2 -> IQ symbols are in the first half of the rxdataF (from element 0 + 2nd half RB containing DC)
|
||||
* 2.3 The RB is == N_RB_DL/2 -> IQ symbols are in the upper border of the rxdataF for first 6 IQ element and the lower border of the rxdataF for the last 6 IQ elements
|
||||
* If the first RB containing PDCCH within the UE BWP and within the CORESET is higher than half of the system bandwidth (N_RB_DL),
|
||||
* then the IQ symbol is going to be found at the position 0+c_rb-N_RB_DL/2 in rxdataF and
|
||||
* we have to point the pointer at (1+c_rb-N_RB_DL/2) in rxdataF
|
||||
@@ -429,64 +420,65 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF,
|
||||
if (((c_rb + n_BWP_start) >= (frame_parms->N_RB_DL >> 1)) && ((frame_parms->N_RB_DL & 1) == 0)) {
|
||||
// number of RBs is even and c_rb is higher than half system bandwidth (we don't skip DC)
|
||||
// if these conditions are true the pointer has to be situated at the 1st part of the rxdataF
|
||||
rxF = &rxdataF[aarx][(12*(c_rb - (frame_parms->N_RB_DL>>1)) + (symbol * (frame_parms->ofdm_symbol_size)))+n_BWP_start*12]; // we point at the 1st part of the rxdataF in symbol
|
||||
LOG_DDD("in even case c_rb (%d) is higher than half N_RB_DL (not DC) -> rxF = &rxdataF[aarx = (%d)][(12*(c_rb - (frame_parms->N_RB_DL>>1)) + (symbol * (frame_parms->ofdm_symbol_size))) = (%d)]\n",
|
||||
c_rb,aarx,(12*(c_rb - (frame_parms->N_RB_DL>>1)) + (symbol * (frame_parms->ofdm_symbol_size))));
|
||||
//rxF = &rxdataF[aarx][(1 + 12*(c_rb - (frame_parms->N_RB_DL>>1)) + (symbol * (frame_parms->ofdm_symbol_size)))]; // we point at the 1st part of the rxdataF in symbol
|
||||
//#ifdef NR_PDCCH_DCI_DEBUG
|
||||
// LOG_DDD("in even case c_rb (%d) is higher than half N_RB_DL (not DC) -> rxF = &rxdataF[aarx = (%d)][(1 + 12*(c_rb - (frame_parms->N_RB_DL>>1)) + (symbol * (frame_parms->ofdm_symbol_size))) = (%d)]\n",
|
||||
// c_rb,aarx,(1 + 12*(c_rb - (frame_parms->N_RB_DL>>1)) + (symbol * (frame_parms->ofdm_symbol_size))));
|
||||
//#endif
|
||||
rxF = &rxdataF[aarx][12*(c_rb + n_BWP_start - (frame_parms->N_RB_DL>>1)) + symbol * frame_parms->ofdm_symbol_size]; // we point at the 1st part of the rxdataF in symbol
|
||||
LOG_DDD("in even case c_rb (%d) is higher than half N_RB_DL (not DC) -> rxF = &rxdataF[aarx = (%d)][12*(c_rb + n_BWP_start - (frame_parms->N_RB_DL>>1)) + symbol * frame_parms->ofdm_symbol_size = (%d)]\n",
|
||||
c_rb,aarx,(12*(c_rb + n_BWP_start - (frame_parms->N_RB_DL>>1)) + symbol * frame_parms->ofdm_symbol_size));
|
||||
}
|
||||
|
||||
if (((c_rb + n_BWP_start) < (frame_parms->N_RB_DL >> 1)) && ((frame_parms->N_RB_DL & 1) != 0)) {
|
||||
//if RB to be treated is lower than middle system bandwidth then rxdataF pointed at (offset + c_br + symbol * ofdm_symbol_size): odd case
|
||||
rxF = &rxdataF[aarx][(frame_parms->first_carrier_offset + 12 * c_rb + (symbol * (frame_parms->ofdm_symbol_size)))+n_BWP_start*12];
|
||||
#ifdef NR_PDCCH_DCI_DEBUG
|
||||
LOG_D(PHY,"in odd case c_rb (%d) is lower or equal than half N_RB_DL -> rxF = &rxdataF[aarx = (%d)][(frame_parms->first_carrier_offset + 12 * c_rb + (symbol * (frame_parms->ofdm_symbol_size))) = (%d)]\n",
|
||||
c_rb,aarx,(frame_parms->first_carrier_offset + 12 * c_rb + (symbol * (frame_parms->ofdm_symbol_size))));
|
||||
#endif
|
||||
rxF = &rxdataF[aarx][frame_parms->first_carrier_offset + 12 * (c_rb + n_BWP_start) + symbol * frame_parms->ofdm_symbol_size];
|
||||
LOG_DDD("in odd case c_rb (%d) is lower or equal than half N_RB_DL -> rxF = &rxdataF[aarx = (%d)][frame_parms->first_carrier_offset + 12 * (c_rb + n_BWP_start) + symbol * frame_parms->ofdm_symbol_size = (%d)]\n",
|
||||
c_rb,aarx,(frame_parms->first_carrier_offset + 12 * (c_rb + n_BWP_start) + symbol * frame_parms->ofdm_symbol_size));
|
||||
}
|
||||
|
||||
if (((c_rb + n_BWP_start) > (frame_parms->N_RB_DL >> 1)) && ((frame_parms->N_RB_DL & 1) != 0)) {
|
||||
// number of RBs is odd and c_rb is higher than half system bandwidth + 1
|
||||
// if these conditions are true the pointer has to be situated at the 1st part of the rxdataF just after the first IQ symbols of the RB containing DC
|
||||
rxF = &rxdataF[aarx][(12*(c_rb - (frame_parms->N_RB_DL>>1)) - 6 + (symbol * (frame_parms->ofdm_symbol_size)))+n_BWP_start*12]; // we point at the 1st part of the rxdataF in symbol
|
||||
#ifdef NR_PDCCH_DCI_DEBUG
|
||||
LOG_D(PHY,"in odd case c_rb (%d) is higher than half N_RB_DL (not DC) -> rxF = &rxdataF[aarx = (%d)][(12*(c_rb - frame_parms->N_RB_DL) - 5 + (symbol * (frame_parms->ofdm_symbol_size))) = (%d)]\n",
|
||||
c_rb,aarx,(12*(c_rb - (frame_parms->N_RB_DL>>1)) - 6 + (symbol * (frame_parms->ofdm_symbol_size))));
|
||||
#endif
|
||||
rxF = &rxdataF[aarx][12*(c_rb + n_BWP_start - (frame_parms->N_RB_DL>>1)) - 6 + symbol * frame_parms->ofdm_symbol_size]; // we point at the 1st part of the rxdataF in symbol
|
||||
LOG_DDD("in odd case c_rb (%d) is higher than half N_RB_DL (not DC) -> rxF = &rxdataF[aarx = (%d)][12*(c_rb + n_BWP_start - (frame_parms->N_RB_DL>>1)) - 6 + symbol * frame_parms->ofdm_symbol_size = (%d)]\n",
|
||||
c_rb,aarx,(12*(c_rb + n_BWP_start - (frame_parms->N_RB_DL>>1)) - 6 + symbol * frame_parms->ofdm_symbol_size));
|
||||
}
|
||||
|
||||
if (((c_rb + n_BWP_start) == (frame_parms->N_RB_DL >> 1)) && ((frame_parms->N_RB_DL & 1) != 0)) { // treatment of RB containing the DC
|
||||
// if odd number RBs in system bandwidth and first RB to be treated is higher than middle system bandwidth (around DC)
|
||||
// we have to treat the RB in two parts: first part from i=0 to 5, the data is at the end of rxdataF (pointing at the end of the table)
|
||||
rxF = &rxdataF[aarx][(frame_parms->first_carrier_offset + 12 * c_rb + (symbol * (frame_parms->ofdm_symbol_size)))+n_BWP_start*12];
|
||||
#ifdef NR_PDCCH_DCI_DEBUG
|
||||
LOG_D(PHY,"in odd case c_rb (%d) is half N_RB_DL + 1 we treat DC case -> rxF = &rxdataF[aarx = (%d)][(frame_parms->first_carrier_offset + 12 * c_rb + (symbol * (frame_parms->ofdm_symbol_size))) = (%d)]\n",
|
||||
c_rb,aarx,(frame_parms->first_carrier_offset + 12 * c_rb + (symbol * (frame_parms->ofdm_symbol_size))));
|
||||
#endif
|
||||
rxF = &rxdataF[aarx][frame_parms->first_carrier_offset + 12 * (c_rb + n_BWP_start) + symbol * frame_parms->ofdm_symbol_size];
|
||||
LOG_DDD("in odd case c_rb (%d) is half N_RB_DL + 1 we treat DC case -> rxF = &rxdataF[aarx = (%d)][frame_parms->first_carrier_offset + 12 * (c_rb + n_BWP_start) + symbol * frame_parms->ofdm_symbol_size = (%d)]\n",
|
||||
c_rb,aarx,(frame_parms->first_carrier_offset + 12 * (c_rb + n_BWP_start) + symbol * frame_parms->ofdm_symbol_size));
|
||||
j = 0;
|
||||
|
||||
for (i = 0; i < 6; i++) { //treating first part of the RB note that i=5 would correspond to DC. We treat it in NR
|
||||
if ((i != 1) && (i != 5)) {
|
||||
dl_ch0_ext[j] = dl_ch0[i];
|
||||
rxF_ext[j++] = rxF[i];
|
||||
// printf("**extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j-1],*(1+(short*)&rxF_ext[j-1]));
|
||||
rxF_ext[j] = rxF[i];
|
||||
LOG_DDD("RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d)\n",
|
||||
c_rb, i, j, *(short *) &rxF_ext[j],*(1 + (short *) &rxF_ext[j]), i,
|
||||
*(short *) &rxF[i], *(1 + (short *) &rxF[i]));
|
||||
j++;
|
||||
} else {
|
||||
LOG_DDD("RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d) \t\t <==> DM-RS PDCCH, this is a pilot symbol\n",
|
||||
c_rb, i, j, *(short *) &rxF_ext[j], *(1 + (short *) &rxF_ext[j]), i,
|
||||
*(short *) &rxF[i], *(1 + (short *) &rxF[i]));
|
||||
}
|
||||
}
|
||||
|
||||
// then we point at the begining of the symbol part of rxdataF do process second part of RB
|
||||
rxF = &rxdataF[aarx][((symbol * (frame_parms->ofdm_symbol_size)))]; // we point at the 1st part of the rxdataF in symbol
|
||||
#ifdef NR_PDCCH_DCI_DEBUG
|
||||
LOG_D(PHY,"in odd case c_rb (%d) is half N_RB_DL +1 we treat DC case -> rxF = &rxdataF[aarx = (%d)][(symbol * (frame_parms->ofdm_symbol_size)) = (%d)]\n",
|
||||
c_rb,aarx,(symbol * (frame_parms->ofdm_symbol_size)));
|
||||
#endif
|
||||
rxF = &rxdataF[aarx][symbol * frame_parms->ofdm_symbol_size]; // we point at the 1st part of the rxdataF in symbol
|
||||
LOG_DDD("in odd case c_rb (%d) is half N_RB_DL +1 we treat DC case -> rxF = &rxdataF[aarx = (%d)][symbol * frame_parms->ofdm_symbol_size = (%d)]\n",
|
||||
c_rb,aarx,(symbol * frame_parms->ofdm_symbol_size));
|
||||
for (; i < 12; i++) {
|
||||
if ((i != 9)) {
|
||||
dl_ch0_ext[j] = dl_ch0[i];
|
||||
rxF_ext[j++] = rxF[(1 + i - 6)];
|
||||
// printf("**extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j-1],*(1+(short*)&rxF_ext[j-1]));
|
||||
rxF_ext[j] = rxF[i - 6];
|
||||
LOG_DDD("RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d)\n",
|
||||
c_rb, i, j, *(short *) &rxF_ext[j],*(1 + (short *) &rxF_ext[j]), i,
|
||||
*(short *) &rxF[i-6], *(1 + (short *) &rxF[i-6]));
|
||||
j++;
|
||||
} else {
|
||||
LOG_DDD("RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d) \t\t <==> DM-RS PDCCH, this is a pilot symbol\n",
|
||||
c_rb, i, j, *(short *) &rxF_ext[j], *(1 + (short *) &rxF_ext[j]), i,
|
||||
*(short *) &rxF[i-6], *(1 + (short *) &rxF[i-6]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -494,32 +486,21 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF,
|
||||
dl_ch0_ext += NBR_RE_PER_RB_WITHOUT_DMRS;
|
||||
rxF_ext += NBR_RE_PER_RB_WITHOUT_DMRS;
|
||||
dl_ch0 += 12;
|
||||
//rxF += 7;
|
||||
//c_rb++;
|
||||
//n_BWP_start++; // We have to increment this variable here to be consequent in the for loop afterwards
|
||||
//}
|
||||
} else { // treatment of any RB that does not contain the DC
|
||||
j = 0;
|
||||
|
||||
for (i = 0; i < 12; i++) {
|
||||
if ((i != 1) && (i != 5) && (i != 9)) {
|
||||
rxF_ext[j] = rxF[i];
|
||||
#ifdef NR_PDCCH_DCI_DEBUG
|
||||
LOG_D(PHY,"RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d)\n",
|
||||
LOG_DDD("RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d)\n",
|
||||
c_rb, i, j, *(short *) &rxF_ext[j],*(1 + (short *) &rxF_ext[j]), i,
|
||||
*(short *) &rxF[i], *(1 + (short *) &rxF[i]));
|
||||
#endif
|
||||
dl_ch0_ext[j] = dl_ch0[i];
|
||||
|
||||
//LOG_DDD("ch %d => dl_ch0(%d,%d)\n", i, *(short *) &dl_ch0[i], *(1 + (short*) &dl_ch0[i]));
|
||||
//printf("\t-> dl_ch0[%d] => dl_ch0_ext[%d](%d,%d)\n", i,j, *(short *) &dl_ch0[i], *(1 + (short*) &dl_ch0[i]));
|
||||
j++;
|
||||
} else {
|
||||
#ifdef NR_PDCCH_DCI_DEBUG
|
||||
LOG_D(PHY,"RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d) \t\t <==> DM-RS PDCCH, this is a pilot symbol\n",
|
||||
LOG_DDD("RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d) \t\t <==> DM-RS PDCCH, this is a pilot symbol\n",
|
||||
c_rb, i, j, *(short *) &rxF_ext[j], *(1 + (short *) &rxF_ext[j]), i,
|
||||
*(short *) &rxF[i], *(1 + (short *) &rxF[i]));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -527,8 +508,6 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF,
|
||||
dl_ch0_ext += NBR_RE_PER_RB_WITHOUT_DMRS;
|
||||
rxF_ext += NBR_RE_PER_RB_WITHOUT_DMRS;
|
||||
dl_ch0 += 12;
|
||||
//rxF += 12;
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -686,7 +665,7 @@ void nr_pdcch_detection_mrc(NR_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue,
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15,
|
||||
int16_t e_rx[4*2*100*12] ) {
|
||||
int16_t *e_rx) {
|
||||
|
||||
uint32_t frame = proc->frame_rx;
|
||||
uint32_t slot = proc->nr_slot_rx;
|
||||
@@ -784,7 +763,7 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue,
|
||||
rel15->CCE,
|
||||
rel15->L);
|
||||
|
||||
LOG_D(PHY,"we end nr_pdcch_unscrambling()\n");
|
||||
LOG_D(PHY,"we end nr_pdcch_demapping_deinterleaving()\n");
|
||||
LOG_D(PHY,"Ending nr_rx_pdcch() function\n");
|
||||
|
||||
return (0);
|
||||
@@ -792,7 +771,7 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue,
|
||||
|
||||
|
||||
|
||||
void nr_pdcch_unscrambling(int16_t e_rx[4*2*100*12],
|
||||
void nr_pdcch_unscrambling(int16_t *e_rx,
|
||||
uint16_t scrambling_RNTI,
|
||||
uint32_t length,
|
||||
uint16_t pdcch_DMRS_scrambling_id,
|
||||
@@ -854,7 +833,7 @@ static uint16_t nr_dci_false_detection(uint64_t *dci,
|
||||
return x;
|
||||
}
|
||||
|
||||
uint8_t nr_dci_decoding_procedure(int16_t e_rx[4*2*100*12],
|
||||
uint8_t nr_dci_decoding_procedure(int16_t *e_rx,
|
||||
PHY_VARS_NR_UE *ue,
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
fapi_nr_dci_indication_t *dci_ind,
|
||||
@@ -888,16 +867,16 @@ uint8_t nr_dci_decoding_procedure(int16_t e_rx[4*2*100*12],
|
||||
int dci_length = rel15->dci_length_options[k];
|
||||
uint64_t dci_estimation[2]= {0};
|
||||
|
||||
LOG_D(PHY, "Trying DCI candidate %d of %d number of candidates, CCE %d (%d), L %d, length %d, format %s\n",
|
||||
j, rel15->number_of_candidates, CCEind, e_rx_cand_idx, L, dci_length,nr_dci_format_string[rel15->dci_format_options[k]]);
|
||||
LOG_D(PHY, "(%i.%i) Trying DCI candidate %d of %d number of candidates, CCE %d (%d), L %d, length %d, format %s\n",
|
||||
proc->frame_rx, proc->nr_slot_rx, j, rel15->number_of_candidates, CCEind, e_rx_cand_idx, L, dci_length, nr_dci_format_string[rel15->dci_format_options[k]]);
|
||||
|
||||
nr_pdcch_unscrambling(&e_rx[e_rx_cand_idx], rel15->coreset.scrambling_rnti, L*108, rel15->coreset.pdcch_dmrs_scrambling_id, tmp_e);
|
||||
|
||||
#ifdef DEBUG_DCI_DECODING
|
||||
uint32_t *z = (uint32_t *) &pdcch_vars->e_rx[e_rx_cand_idx];
|
||||
uint32_t *z = (uint32_t *) &e_rx[e_rx_cand_idx];
|
||||
for (int index_z = 0; index_z < L*6; index_z++){
|
||||
for (int i=0; i<9; i++) {
|
||||
LOG_D(PHY,"z[%d]=(%d,%d) \n", (9*index_z + i), *(int16_t *) &z[index_z + i],*(1 + (int16_t *) &z[index_z + i]));
|
||||
LOG_I(PHY,"z[%d]=(%d,%d) \n", (9*index_z + i), *(int16_t *) &z[9*index_z + i],*(1 + (int16_t *) &z[9*index_z + i]));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -226,7 +226,7 @@ bool nr_ue_postDecode(PHY_VARS_NR_UE *phy_vars_ue, notifiedFIFO_elt_t *req, bool
|
||||
//LOG_D(PHY,"[UE %d] DLSCH: Setting ACK for nr_slot_rx %d TBS %d mcs %d nb_rb %d harq_process->round %d\n",
|
||||
// phy_vars_ue->Mod_id,nr_slot_rx,harq_process->TBS,harq_process->mcs,harq_process->nb_rb, harq_process->round);
|
||||
harq_process->status = SCH_IDLE;
|
||||
harq_process->round = 0;
|
||||
harq_process->DLround = 0;
|
||||
harq_process->ack = 1;
|
||||
|
||||
//LOG_D(PHY,"[UE %d] DLSCH: Setting ACK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d)\n",
|
||||
@@ -241,9 +241,9 @@ bool nr_ue_postDecode(PHY_VARS_NR_UE *phy_vars_ue, notifiedFIFO_elt_t *req, bool
|
||||
//LOG_D(PHY,"[UE %d] DLSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d) Kr %d r %d harq_process->round %d\n",
|
||||
// phy_vars_ue->Mod_id, frame, nr_slot_rx, harq_pid,harq_process->status, harq_process->round,harq_process->TBS,harq_process->mcs,Kr,r,harq_process->round);
|
||||
harq_process->ack = 0;
|
||||
if (harq_process->round >= dlsch->Mlimit) {
|
||||
if (harq_process->DLround >= dlsch->Mlimit) {
|
||||
harq_process->status = SCH_IDLE;
|
||||
harq_process->round = 0;
|
||||
harq_process->DLround = 0;
|
||||
phy_vars_ue->dl_stats[4]++;
|
||||
}
|
||||
|
||||
@@ -400,7 +400,7 @@ void nr_processDLSegment(void* arg) {
|
||||
|
||||
// Fixme: correct type is unsigned, but nrLDPC_decoder and all called behind use signed int
|
||||
if (check_crc((uint8_t *)llrProcBuf,length_dec,harq_process->F,crc_type)) {
|
||||
LOG_D(PHY,"Segment %u CRC OK\n\033[0m",r);
|
||||
LOG_D(PHY,"Segment %u CRC OK\n",r);
|
||||
|
||||
if (r==0) {
|
||||
for (int i=0; i<10; i++) LOG_D(PHY,"byte %d : %x\n",i,((uint8_t *)llrProcBuf)[i]);
|
||||
@@ -410,7 +410,7 @@ void nr_processDLSegment(void* arg) {
|
||||
no_iteration_ldpc = dlsch->max_ldpc_iterations;
|
||||
rdata->decodeIterations = no_iteration_ldpc;
|
||||
} else {
|
||||
LOG_D(PHY,"CRC NOT OK\n\033[0m");
|
||||
LOG_D(PHY,"CRC NOT OK\n");
|
||||
}
|
||||
|
||||
nb_total_decod++;
|
||||
@@ -453,8 +453,8 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
}
|
||||
|
||||
// HARQ stats
|
||||
phy_vars_ue->dl_stats[harq_process->round]++;
|
||||
LOG_D(PHY,"Round %d RV idx %d\n",harq_process->round,harq_process->rvidx);
|
||||
phy_vars_ue->dl_stats[harq_process->DLround]++;
|
||||
LOG_D(PHY,"Round %d RV idx %d\n",harq_process->DLround,harq_process->rvidx);
|
||||
uint8_t kc;
|
||||
uint32_t Tbslbrm;// = 950984;
|
||||
uint16_t nb_rb;// = 30;
|
||||
@@ -507,7 +507,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
}
|
||||
*/
|
||||
nb_rb = harq_process->nb_rb;
|
||||
harq_process->trials[harq_process->round]++;
|
||||
harq_process->trials[harq_process->DLround]++;
|
||||
uint16_t nb_rb_oh = 0; // it was not computed at UE side even before and set to 0 in nr_compute_tbs
|
||||
harq_process->TBS = nr_compute_tbs(harq_process->Qm,harq_process->R,nb_rb,nb_symb_sch,nb_re_dmrs*dmrs_length, nb_rb_oh, 0, harq_process->Nl);
|
||||
A = harq_process->TBS;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -302,7 +302,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
|
||||
#endif
|
||||
|
||||
int freq_offset_sss = 0;
|
||||
rx_sss_nr(ue, proc, &metric_tdd_ncp, &phase_tdd_ncp, &freq_offset_sss);
|
||||
ret = rx_sss_nr(ue, proc, &metric_tdd_ncp, &phase_tdd_ncp, &freq_offset_sss);
|
||||
|
||||
accumulated_freq_offset += freq_offset_sss;
|
||||
|
||||
@@ -330,8 +330,10 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
|
||||
}
|
||||
}
|
||||
|
||||
nr_gold_pbch(ue);
|
||||
ret = nr_pbch_detection(proc, ue, 1); // start pbch detection at first symbol after pss
|
||||
if (ret==0) { //we got sss channel
|
||||
nr_gold_pbch(ue);
|
||||
ret = nr_pbch_detection(proc, ue, 1); // start pbch detection at first symbol after pss
|
||||
}
|
||||
|
||||
if (ret == 0) {
|
||||
// sync at symbol ue->symbol_offset
|
||||
|
||||
@@ -733,7 +733,7 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF,
|
||||
@param n_dmrs_cdm_groups
|
||||
@param frame_parms Pointer to frame descriptor
|
||||
*/
|
||||
unsigned short nr_dlsch_extract_rbs_multiple(int **rxdataF,
|
||||
void nr_dlsch_extract_rbs(int **rxdataF,
|
||||
int **dl_ch_estimates,
|
||||
int **rxdataF_ext,
|
||||
int **dl_ch_estimates_ext,
|
||||
@@ -824,28 +824,12 @@ void nr_dlsch_channel_compensation_core(int **rxdataF_ext,
|
||||
int start_point);
|
||||
|
||||
void nr_dlsch_deinterleaving(uint8_t symbol,
|
||||
uint8_t start_symbol,
|
||||
uint16_t L,
|
||||
uint16_t *llr,
|
||||
uint16_t *llr_deint,
|
||||
uint16_t nb_rb_pdsch);
|
||||
uint8_t start_symbol,
|
||||
uint16_t L,
|
||||
uint16_t *llr,
|
||||
uint16_t *llr_deint,
|
||||
uint16_t nb_rb_pdsch);
|
||||
|
||||
void dlsch_dual_stream_correlation(NR_DL_FRAME_PARMS *frame_parms,
|
||||
unsigned char symbol,
|
||||
unsigned short nb_rb,
|
||||
int **dl_ch_estimates_ext,
|
||||
int **dl_ch_estimates_ext_i,
|
||||
int **dl_ch_rho_ext,
|
||||
unsigned char output_shift);
|
||||
|
||||
void dlsch_dual_stream_correlationTM34(NR_DL_FRAME_PARMS *frame_parms,
|
||||
unsigned char symbol,
|
||||
unsigned short nb_rb,
|
||||
int **dl_ch_estimates_ext,
|
||||
int **dl_ch_estimates_ext_i,
|
||||
int **dl_ch_rho_ext,
|
||||
unsigned char output_shift0,
|
||||
unsigned char output_shift1);
|
||||
//This function is used to compute multiplications in Hhermitian * H matrix
|
||||
void conjch0_mult_ch1(int *ch0,
|
||||
int *ch1,
|
||||
@@ -897,19 +881,6 @@ void nr_dlsch_detection_mrc(int **rxdataF_comp,
|
||||
unsigned short nb_rb,
|
||||
int length);
|
||||
|
||||
void nr_dlsch_detection_mrc_core(int **rxdataF_comp,
|
||||
int **rxdataF_comp_i,
|
||||
int **rho,
|
||||
int **rho_i,
|
||||
int **dl_ch_mag,
|
||||
int **dl_ch_magb,
|
||||
int **dl_ch_mag_i,
|
||||
int **dl_ch_magb_i,
|
||||
unsigned char n_tx,
|
||||
unsigned char n_rx,
|
||||
int length,
|
||||
int start_point);
|
||||
|
||||
void det_HhH(int32_t *after_mf_00,
|
||||
int32_t *after_mf_01,
|
||||
int32_t *after_mf_10,
|
||||
@@ -1106,7 +1077,7 @@ uint32_t dlsch_decoding_emul(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue,
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15,
|
||||
int16_t e_rx[4*2*100*12]);
|
||||
int16_t *e_rx);
|
||||
|
||||
/*! \brief Extract PSS and SSS resource elements
|
||||
@param phy_vars_ue Pointer to UE variables
|
||||
@@ -1657,7 +1628,7 @@ uint8_t get_prach_prb_offset(NR_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
#include <openair1/PHY/LTE_TRANSPORT/transport_proto.h>
|
||||
|
||||
uint8_t nr_dci_decoding_procedure(int16_t e_rx[4*2*100*12],
|
||||
uint8_t nr_dci_decoding_procedure(int16_t *e_rx,
|
||||
PHY_VARS_NR_UE *ue,
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
fapi_nr_dci_indication_t *dci_ind,
|
||||
|
||||
@@ -184,7 +184,7 @@ typedef struct {
|
||||
/// Accumulates the soft bits for each round to increase decoding success (HARQ)
|
||||
int16_t **d;
|
||||
/// Index of current HARQ round for this DLSCH
|
||||
uint8_t round;
|
||||
uint8_t DLround;
|
||||
/// MCS table for this DLSCH
|
||||
uint8_t mcs_table;
|
||||
/// MCS format for this DLSCH
|
||||
|
||||
@@ -560,6 +560,10 @@ int rx_sss_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int32_t *tot_metric,
|
||||
|
||||
int re = 0;
|
||||
int im = 0;
|
||||
if (Nid1 == N_ID_1_NUMBER) {
|
||||
LOG_I(PHY,"Failled to detect SSS after PSS\n");
|
||||
return -1;
|
||||
}
|
||||
d = (int16_t *)&d_sss[Nid2][Nid1];
|
||||
for(i = 0; i<LENGTH_SSS_NR; i++) {
|
||||
re += d[i]*sss[2*i];
|
||||
|
||||
@@ -458,8 +458,6 @@ typedef struct RU_t_s {
|
||||
int emulate_rf;
|
||||
/// numerology index
|
||||
int numerology;
|
||||
/// flag to indicate basicsim operation
|
||||
int basicsim;
|
||||
/// flag to indicate the RU is in sync with a master reference
|
||||
int in_synch;
|
||||
/// timing offset
|
||||
|
||||
@@ -800,6 +800,13 @@ typedef struct PHY_VARS_gNB_s {
|
||||
/// PDSCH DMRS sequence
|
||||
uint32_t ****nr_gold_pdsch_dmrs;
|
||||
|
||||
/// PDSCH codebook I precoding LUTs
|
||||
/// first dimension: Rank number [0,...,noOfLayers-1[
|
||||
/// second dimension: PMI [0,...,CodeSize-1[
|
||||
/// third dimension: [i_rows*noOfLayers+j_col], i_rows=0,...pdsch_AntennaPorts-1 and j_col=0,...,noOfLayers-1
|
||||
int32_t ***nr_mimo_precoding_matrix;
|
||||
int pmiq_size[NR_MAX_NB_LAYERS];
|
||||
|
||||
/// PUSCH DMRS
|
||||
uint32_t ****nr_gold_pusch_dmrs;
|
||||
|
||||
@@ -845,6 +852,9 @@ typedef struct PHY_VARS_gNB_s {
|
||||
/// counter to average prach energh over first 100 prach opportunities
|
||||
int prach_energy_counter;
|
||||
|
||||
int ap_N1;
|
||||
int ap_N2;
|
||||
int ap_XP;
|
||||
int pucch0_thres;
|
||||
int pusch_thres;
|
||||
int prach_thres;
|
||||
|
||||
@@ -183,7 +183,7 @@ typedef struct {
|
||||
//! estimated rssi (dBm)
|
||||
short rx_rssi_dBm[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
//! estimated correlation (wideband linear) between spatial channels (computed in dlsch_demodulation)
|
||||
int rx_correlation[NUMBER_OF_CONNECTED_gNB_MAX][4][4];
|
||||
int rx_correlation[NUMBER_OF_CONNECTED_gNB_MAX][NB_ANTENNAS_RX][NR_MAX_NB_LAYERS*NR_MAX_NB_LAYERS];//
|
||||
//! estimated correlation (wideband dB) between spatial channels (computed in dlsch_demodulation)
|
||||
int rx_correlation_dB[NUMBER_OF_CONNECTED_gNB_MAX][2];
|
||||
|
||||
@@ -271,12 +271,6 @@ typedef struct {
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **rxdataF_comp0;
|
||||
/// \brief Received frequency-domain signal after extraction and channel compensation for the second stream. For the SIC receiver we need to store the history of this for each harq process and round
|
||||
/// - first index: ? [0..7] (hard coded) accessed via \c harq_pid
|
||||
/// - second index: ? [0..7] (hard coded) accessed via \c round
|
||||
/// - third index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - fourth index: ? [0..168*N_RB_DL[
|
||||
int32_t **rxdataF_comp1[8][8];
|
||||
/// \brief Hold the channel estimates in frequency domain.
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: samples? [0..symbols_per_tti*(ofdm_symbol_size+LTE_CE_FILTER_LENGTH)[
|
||||
@@ -289,12 +283,6 @@ typedef struct {
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_ptrs_estimates_ext;
|
||||
/// \brief Downlink cross-correlation of MIMO channel estimates (unquantized PMI) extracted in PRBS. For the SIC receiver we need to store the history of this for each harq process and round
|
||||
/// - first index: ? [0..7] (hard coded) accessed via \c harq_pid
|
||||
/// - second index: ? [0..7] (hard coded) accessed via \c round
|
||||
/// - third index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - fourth index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_rho_ext[8][8];
|
||||
/// \brief Downlink beamforming channel estimates in frequency domain.
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: samples? [0..symbols_per_tti*(ofdm_symbol_size+LTE_CE_FILTER_LENGTH)[
|
||||
@@ -303,10 +291,6 @@ typedef struct {
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_bf_ch_estimates_ext;
|
||||
/// \brief Downlink cross-correlation of MIMO channel estimates (unquantized PMI) extracted in PRBS.
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_rho2_ext;
|
||||
/// \brief Downlink PMIs extracted in PRBS and grouped in subbands.
|
||||
/// - first index: ressource block [0..N_RB_DL[
|
||||
uint8_t *pmi_ext;
|
||||
@@ -314,18 +298,10 @@ typedef struct {
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_mag0;
|
||||
/// \brief Magnitude of Downlink Channel second layer (16QAM level/First 64QAM level).
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_mag1[8][8];
|
||||
/// \brief Magnitude of Downlink Channel, first layer (2nd 64QAM level).
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_magb0;
|
||||
/// \brief Magnitude of Downlink Channel second layer (2nd 64QAM level).
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_magb1[8][8];
|
||||
/// \brief Magnitude of Downlink Channel, first layer (256QAM level).
|
||||
int32_t **dl_ch_magr0;
|
||||
/// \brief Cross-correlation Matrix of the gNB Tx channel signals.
|
||||
@@ -595,10 +571,6 @@ typedef struct {
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_estimates_ext;
|
||||
/// \brief Pointers to channel cross-correlation vectors for multi-gNB detection.
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_rho_ext;
|
||||
/// \brief Pointers to channel cross-correlation vectors for multi-gNB detection.
|
||||
/// - first index: rx antenna [0..nb_antennas_rx[
|
||||
/// - second index: ? [0..]
|
||||
int32_t **rho;
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
|
||||
/*used for the resource mapping*/
|
||||
#define NR_MAX_PDCCH_DMRS_LENGTH 576 // 16(L)*2(QPSK)*3(3 DMRS symbs per REG)*6(REG per CCE)
|
||||
#define NR_MAX_PDCCH_SIZE 8192 // It seems it is the max polar coded block size
|
||||
|
||||
#define NR_MAX_DCI_PAYLOAD_SIZE 64
|
||||
#define NR_MAX_DCI_SIZE 1728 //16(L)*2(QPSK)*9(12 RE per REG - 3(DMRS))*6(REG per CCE)
|
||||
@@ -322,7 +323,7 @@ struct NR_DL_FRAME_PARMS {
|
||||
uint32_t samples_per_frame_wCP;
|
||||
/// NR numerology index [0..5] as specified in 38.211 Section 4 (mu). 0=15khZ SCS, 1=30khZ, 2=60kHz, etc
|
||||
uint8_t numerology_index;
|
||||
/// Number of Physical transmit antennas in node
|
||||
/// Number of Physical transmit antennas in node (corresponds to nrOfAntennaPorts)
|
||||
uint8_t nb_antennas_tx;
|
||||
/// Number of Receive antennas in node
|
||||
uint8_t nb_antennas_rx;
|
||||
|
||||
Reference in New Issue
Block a user