Merge branch '398-nr-pdsch-deinterleaving-and-rate-matching-are-in-wrong-order' into 'develop-nr'
Resolve "NR PDSCH: Deinterleaving and rate-matching are in wrong order" See merge request oai/openairinterface5g!502
This commit is contained in:
@@ -467,33 +467,26 @@ void nr_interleaving_ldpc(uint32_t E, uint8_t Qm, uint8_t *e,uint8_t *f);
|
|||||||
|
|
||||||
void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e,int16_t *f);
|
void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e,int16_t *f);
|
||||||
|
|
||||||
uint32_t nr_rate_matching_ldpc(uint8_t Ilbrm,
|
int nr_rate_matching_ldpc(uint8_t Ilbrm,
|
||||||
uint32_t Tbslbrm,
|
uint32_t Tbslbrm,
|
||||||
uint8_t BG,
|
uint8_t BG,
|
||||||
uint16_t Z,
|
uint16_t Z,
|
||||||
uint32_t G,
|
uint8_t *w,
|
||||||
uint8_t *w,
|
uint8_t *e,
|
||||||
uint8_t *e,
|
uint8_t C,
|
||||||
uint8_t C,
|
uint8_t rvidx,
|
||||||
uint8_t rvidx,
|
uint32_t E);
|
||||||
uint8_t Qm,
|
|
||||||
uint8_t Nl,
|
|
||||||
uint8_t r);
|
|
||||||
|
|
||||||
int nr_rate_matching_ldpc_rx(uint8_t Ilbrm,
|
int nr_rate_matching_ldpc_rx(uint8_t Ilbrm,
|
||||||
uint32_t Tbslbrm,
|
uint32_t Tbslbrm,
|
||||||
uint8_t BG,
|
uint8_t BG,
|
||||||
uint16_t Z,
|
uint16_t Z,
|
||||||
uint32_t G,
|
|
||||||
int16_t *w,
|
int16_t *w,
|
||||||
int16_t *soft_input,
|
int16_t *soft_input,
|
||||||
uint8_t C,
|
uint8_t C,
|
||||||
uint8_t rvidx,
|
uint8_t rvidx,
|
||||||
uint8_t clear,
|
uint8_t clear,
|
||||||
uint8_t Qm,
|
uint32_t E);
|
||||||
uint8_t Nl,
|
|
||||||
uint8_t r,
|
|
||||||
uint32_t *E_out);
|
|
||||||
|
|
||||||
decoder_if_t phy_threegpplte_turbo_decoder;
|
decoder_if_t phy_threegpplte_turbo_decoder;
|
||||||
decoder_if_t phy_threegpplte_turbo_decoder8;
|
decoder_if_t phy_threegpplte_turbo_decoder8;
|
||||||
|
|||||||
@@ -63,55 +63,39 @@ void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e,int16_t *f)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uint32_t nr_rate_matching_ldpc(uint8_t Ilbrm,
|
int nr_rate_matching_ldpc(uint8_t Ilbrm,
|
||||||
uint32_t Tbslbrm,
|
uint32_t Tbslbrm,
|
||||||
uint8_t BG,
|
uint8_t BG,
|
||||||
uint16_t Z,
|
uint16_t Z,
|
||||||
uint32_t G,
|
uint8_t *w,
|
||||||
uint8_t *w,
|
uint8_t *e,
|
||||||
uint8_t *e,
|
uint8_t C,
|
||||||
uint8_t C,
|
uint8_t rvidx,
|
||||||
uint8_t rvidx,
|
uint32_t E)
|
||||||
uint8_t Qm,
|
|
||||||
uint8_t Nl,
|
|
||||||
uint8_t r)
|
|
||||||
{
|
{
|
||||||
uint8_t Cprime;
|
uint32_t Ncb,ind,k,Nref,N;
|
||||||
uint32_t Ncb,E,ind,k,Nref,N;
|
|
||||||
//uint8_t *e2;
|
|
||||||
|
|
||||||
AssertFatal(Nl>0,"Nl is 0\n");
|
if (C==0) {
|
||||||
AssertFatal(Qm>0,"Qm is 0\n");
|
printf("nr_rate_matching: invalid parameters (C %d\n",C);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
//Bit selection
|
//Bit selection
|
||||||
N = (BG==1)?(66*Z):(50*Z);
|
N = (BG==1)?(66*Z):(50*Z);
|
||||||
|
|
||||||
if (Ilbrm == 0)
|
if (Ilbrm == 0)
|
||||||
Ncb = N;
|
Ncb = N;
|
||||||
else {
|
else {
|
||||||
Nref = 3*Tbslbrm/(2*C); //R_LBRM = 2/3
|
Nref = 3*Tbslbrm/(2*C); //R_LBRM = 2/3
|
||||||
Ncb = min(N, Nref);
|
Ncb = min(N, Nref);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef RM_DEBUG
|
|
||||||
printf("nr_rate_matching: Ncb %d, rvidx %d, G %d, Qm %d, Nl%d, r %d\n",Ncb,rvidx, G, Qm,Nl,r);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Cprime = C; //assume CBGTI not present
|
|
||||||
|
|
||||||
if (r <= Cprime - ((G/(Nl*Qm))%Cprime) - 1)
|
|
||||||
E = Nl*Qm*(G/(Nl*Qm*Cprime));
|
|
||||||
else
|
|
||||||
E = Nl*Qm*((G/(Nl*Qm*Cprime))+1);
|
|
||||||
|
|
||||||
ind = (index_k0[BG-1][rvidx]*Ncb/N)*Z;
|
ind = (index_k0[BG-1][rvidx]*Ncb/N)*Z;
|
||||||
|
|
||||||
#ifdef RM_DEBUG
|
#ifdef RM_DEBUG
|
||||||
printf("nr_rate_matching: E %d, k0 %d Cprime %d modcprime %d\n",E,ind, Cprime,((G/(Nl*Qm))%Cprime));
|
printf("nr_rate_matching_ldpc: E %d, k0 %d, Ncb %d, rvidx %d\n", E, ind, Ncb, rvidx);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//e2 = e;
|
|
||||||
|
|
||||||
k=0;
|
k=0;
|
||||||
|
|
||||||
for (; (ind<Ncb)&&(k<E); ind++) {
|
for (; (ind<Ncb)&&(k<E); ind++) {
|
||||||
@@ -120,7 +104,6 @@ uint32_t nr_rate_matching_ldpc(uint8_t Ilbrm,
|
|||||||
printf("RM_TX k%d Ind: %d (%d)\n",k,ind,w[ind]);
|
printf("RM_TX k%d Ind: %d (%d)\n",k,ind,w[ind]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//if (w[ind] != NR_NULL) e2[k++]=w[ind];
|
|
||||||
if (w[ind] != NR_NULL) e[k++]=w[ind];
|
if (w[ind] != NR_NULL) e[k++]=w[ind];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,79 +114,60 @@ uint32_t nr_rate_matching_ldpc(uint8_t Ilbrm,
|
|||||||
printf("RM_TX k%d Ind: %d (%d)\n",k,ind,w[ind]);
|
printf("RM_TX k%d Ind: %d (%d)\n",k,ind,w[ind]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//if (w[ind] != NR_NULL) e2[k++]=w[ind];
|
|
||||||
if (w[ind] != NR_NULL) e[k++]=w[ind];
|
if (w[ind] != NR_NULL) e[k++]=w[ind];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return(E);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int nr_rate_matching_ldpc_rx(uint8_t Ilbrm,
|
int nr_rate_matching_ldpc_rx(uint8_t Ilbrm,
|
||||||
uint32_t Tbslbrm,
|
uint32_t Tbslbrm,
|
||||||
uint8_t BG,
|
uint8_t BG,
|
||||||
uint16_t Z,
|
uint16_t Z,
|
||||||
uint32_t G,
|
|
||||||
int16_t *w,
|
int16_t *w,
|
||||||
int16_t *soft_input,
|
int16_t *soft_input,
|
||||||
uint8_t C,
|
uint8_t C,
|
||||||
uint8_t rvidx,
|
uint8_t rvidx,
|
||||||
uint8_t clear,
|
uint8_t clear,
|
||||||
uint8_t Qm,
|
uint32_t E)
|
||||||
uint8_t Nl,
|
|
||||||
uint8_t r,
|
|
||||||
uint32_t *E_out)
|
|
||||||
{
|
{
|
||||||
uint8_t Cprime;
|
uint32_t Ncb,ind,k,Nref,N;
|
||||||
uint32_t Ncb,E,ind,k,Nref,N;
|
|
||||||
|
|
||||||
int16_t *soft_input2;
|
|
||||||
|
|
||||||
#ifdef RM_DEBUG
|
#ifdef RM_DEBUG
|
||||||
int nulled=0;
|
int nulled=0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (C==0 || Qm==0 || Nl==0) {
|
if (C==0) {
|
||||||
printf("nr_rate_matching: invalid parameters (C %d, Qm %d, Nl %d\n",C,Qm,Nl);
|
printf("nr_rate_matching: invalid parameters (C %d\n",C);
|
||||||
return(-1);
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
AssertFatal(Nl>0,"Nl is 0\n");
|
|
||||||
AssertFatal(Qm>0,"Qm is 0\n");
|
|
||||||
|
|
||||||
//Bit selection
|
//Bit selection
|
||||||
N = (BG==1)?(66*Z):(50*Z);
|
N = (BG==1)?(66*Z):(50*Z);
|
||||||
|
|
||||||
if (Ilbrm == 0)
|
if (Ilbrm == 0)
|
||||||
Ncb = N;
|
Ncb = N;
|
||||||
else {
|
else {
|
||||||
Nref = (3*Tbslbrm/(2*C)); //R_LBRM = 2/3
|
Nref = (3*Tbslbrm/(2*C)); //R_LBRM = 2/3
|
||||||
Ncb = min(N, Nref);
|
Ncb = min(N, Nref);
|
||||||
}
|
}
|
||||||
|
|
||||||
Cprime = C; //assume CBGTI not present
|
|
||||||
|
|
||||||
if (r <= Cprime - ((G/(Nl*Qm))%Cprime) - 1)
|
|
||||||
E = Nl*Qm*(G/(Nl*Qm*Cprime));
|
|
||||||
else
|
|
||||||
E = Nl*Qm*((G/(Nl*Qm*Cprime))+1);
|
|
||||||
|
|
||||||
ind = (index_k0[BG-1][rvidx]*Ncb/N)*Z;
|
ind = (index_k0[BG-1][rvidx]*Ncb/N)*Z;
|
||||||
|
|
||||||
#ifdef RM_DEBUG
|
#ifdef RM_DEBUG
|
||||||
printf("nr_rate_matching_ldpc_rx: Clear %d, E %d, Ncb %d,rvidx %d, G %d, Qm %d, Nl%d, r %d\n",clear,E,Ncb,rvidx, G, Qm,Nl,r);
|
printf("nr_rate_matching_ldpc_rx: Clear %d, E %d, k0 %d, Ncb %d, rvidx %d\n", clear, E, ind, Ncb, rvidx);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (clear==1)
|
if (clear==1)
|
||||||
memset(w,0,Ncb*sizeof(int16_t));
|
memset(w,0,Ncb*sizeof(int16_t));
|
||||||
|
|
||||||
soft_input2 = soft_input;
|
|
||||||
k=0;
|
k=0;
|
||||||
|
|
||||||
for (; (ind<Ncb)&&(k<E); ind++) {
|
for (; (ind<Ncb)&&(k<E); ind++) {
|
||||||
if (soft_input2[ind] != NR_NULL) {
|
if (soft_input[ind] != NR_NULL) {
|
||||||
w[ind] += soft_input2[k++];
|
w[ind] += soft_input[k++];
|
||||||
#ifdef RM_DEBUG
|
#ifdef RM_DEBUG
|
||||||
printf("RM_RX k%d Ind: %d (%d)\n",k-1,ind,w[ind]);
|
printf("RM_RX k%d Ind: %d (%d)\n",k-1,ind,w[ind]);
|
||||||
#endif
|
#endif
|
||||||
@@ -220,10 +184,10 @@ int nr_rate_matching_ldpc_rx(uint8_t Ilbrm,
|
|||||||
|
|
||||||
while(k<E) {
|
while(k<E) {
|
||||||
for (ind=0; (ind<Ncb)&&(k<E); ind++) {
|
for (ind=0; (ind<Ncb)&&(k<E); ind++) {
|
||||||
if (soft_input2[ind] != NR_NULL) {
|
if (soft_input[ind] != NR_NULL) {
|
||||||
w[ind] += soft_input2[k++];
|
w[ind] += soft_input[k++];
|
||||||
#ifdef RM_DEBUG
|
#ifdef RM_DEBUG
|
||||||
printf("RM_RX k%d Ind: %d (%d)(soft in %d)\n",k-1,ind,w[ind],soft_input2[k-1]);
|
printf("RM_RX k%d Ind: %d (%d)(soft in %d)\n",k-1,ind,w[ind],soft_input[k-1]);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -237,7 +201,5 @@ int nr_rate_matching_ldpc_rx(uint8_t Ilbrm,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*E_out = E;
|
return 0;
|
||||||
return(0);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,6 +90,8 @@ uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t dlsch,
|
|||||||
@param nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs */
|
@param nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs */
|
||||||
uint32_t nr_get_G(uint16_t nb_rb, uint16_t nb_symb_sch,uint8_t nb_re_dmrs,uint16_t length_dmrs,uint8_t Qm, uint8_t Nl);
|
uint32_t nr_get_G(uint16_t nb_rb, uint16_t nb_symb_sch,uint8_t nb_re_dmrs,uint16_t length_dmrs,uint8_t Qm, uint8_t Nl);
|
||||||
|
|
||||||
|
uint32_t nr_get_E(uint32_t G, uint8_t C, uint8_t Qm, uint8_t Nl, uint8_t r);
|
||||||
|
|
||||||
void free_gNB_dlsch(NR_gNB_DLSCH_t *dlsch);
|
void free_gNB_dlsch(NR_gNB_DLSCH_t *dlsch);
|
||||||
|
|
||||||
void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch);
|
void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch);
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ int nr_dlsch_encoding(unsigned char *a,
|
|||||||
uint32_t A, Z;
|
uint32_t A, Z;
|
||||||
uint32_t *pz = &Z;
|
uint32_t *pz = &Z;
|
||||||
uint8_t mod_order = rel15.modulation_order;
|
uint8_t mod_order = rel15.modulation_order;
|
||||||
uint16_t Kr=0,r,r_offset=0;//Kr_bytes
|
uint16_t Kr=0,r,r_offset=0,Kr_bytes;
|
||||||
uint8_t *d_tmp[MAX_NUM_DLSCH_SEGMENTS];
|
uint8_t *d_tmp[MAX_NUM_DLSCH_SEGMENTS];
|
||||||
uint8_t kb,BG=1;
|
uint8_t kb,BG=1;
|
||||||
uint32_t E;
|
uint32_t E;
|
||||||
@@ -346,7 +346,7 @@ int nr_dlsch_encoding(unsigned char *a,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Kr = dlsch->harq_processes[harq_pid]->K;
|
Kr = dlsch->harq_processes[harq_pid]->K;
|
||||||
//Kr_bytes = Kr>>3;
|
Kr_bytes = Kr>>3;
|
||||||
|
|
||||||
//printf("segment Z %d kb %d k %d Kr %d BG %d\n", *pz,kb,dlsch->harq_processes[harq_pid]->K,Kr,BG);
|
//printf("segment Z %d kb %d k %d Kr %d BG %d\n", *pz,kb,dlsch->harq_processes[harq_pid]->K,Kr,BG);
|
||||||
|
|
||||||
@@ -403,25 +403,24 @@ int nr_dlsch_encoding(unsigned char *a,
|
|||||||
|
|
||||||
//start_meas(rm_stats);
|
//start_meas(rm_stats);
|
||||||
#ifdef DEBUG_DLSCH_CODING
|
#ifdef DEBUG_DLSCH_CODING
|
||||||
printf("rvidx in encoding = %d\n", dlsch->harq_processes[harq_pid]->rvidx);
|
printf("rvidx in encoding = %d\n", rel15.redundancy_version);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
E = nr_rate_matching_ldpc(Ilbrm,
|
E = nr_get_E(G, dlsch->harq_processes[harq_pid]->C, mod_order, rel15.nb_layers, r);
|
||||||
Tbslbrm,
|
|
||||||
BG,
|
nr_rate_matching_ldpc(Ilbrm,
|
||||||
*pz,
|
Tbslbrm,
|
||||||
G,
|
BG,
|
||||||
dlsch->harq_processes[harq_pid]->d[r],
|
*pz,
|
||||||
dlsch->harq_processes[harq_pid]->e+r_offset,
|
dlsch->harq_processes[harq_pid]->d[r],
|
||||||
dlsch->harq_processes[harq_pid]->C,
|
dlsch->harq_processes[harq_pid]->e+r_offset,
|
||||||
rel15.redundancy_version,
|
dlsch->harq_processes[harq_pid]->C,
|
||||||
mod_order,
|
rel15.redundancy_version,
|
||||||
rel15.nb_layers,
|
E);
|
||||||
r);
|
|
||||||
|
|
||||||
#ifdef DEBUG_DLSCH_CODING
|
#ifdef DEBUG_DLSCH_CODING
|
||||||
for (int i =0; i<16; i++)
|
for (int i =0; i<16; i++)
|
||||||
printf("output ratematching e[%d]= %d r_offset %d\n", i,dlsch->harq_processes[harq_pid]->e[i], r_offset);
|
printf("output ratematching e[%d]= %d r_offset %d\n", i,dlsch->harq_processes[harq_pid]->e[i+r_offset], r_offset);
|
||||||
#endif
|
#endif
|
||||||
//stop_meas(rm_stats);
|
//stop_meas(rm_stats);
|
||||||
|
|
||||||
@@ -432,18 +431,15 @@ int nr_dlsch_encoding(unsigned char *a,
|
|||||||
dlsch->harq_processes[harq_pid]->f+r_offset);
|
dlsch->harq_processes[harq_pid]->f+r_offset);
|
||||||
//stop_meas(i_stats);
|
//stop_meas(i_stats);
|
||||||
|
|
||||||
r_offset += E;
|
|
||||||
#ifdef DEBUG_DLSCH_CODING
|
#ifdef DEBUG_DLSCH_CODING
|
||||||
for (int i =0; i<16; i++)
|
for (int i =0; i<16; i++)
|
||||||
printf("output interleaving f[%d]= %d r_offset %d\n", i,dlsch->harq_processes[harq_pid]->f[i+r*r_offset], r_offset);
|
printf("output interleaving f[%d]= %d r_offset %d\n", i,dlsch->harq_processes[harq_pid]->f[i+r_offset], r_offset);
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef DEBUG_DLSCH_CODING
|
|
||||||
|
|
||||||
if (r==dlsch->harq_processes[harq_pid]->C-1)
|
if (r==dlsch->harq_processes[harq_pid]->C-1)
|
||||||
write_output("enc_output.m","enc",dlsch->harq_processes[harq_pid]->f,r_offset,1,4);
|
write_output("enc_output.m","enc",dlsch->harq_processes[harq_pid]->f,G,1,4);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
r_offset += E;
|
||||||
}
|
}
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ENCODING, VCD_FUNCTION_OUT);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ENCODING, VCD_FUNCTION_OUT);
|
||||||
|
|||||||
@@ -176,3 +176,18 @@ uint32_t nr_get_G(uint16_t nb_rb, uint16_t nb_symb_sch,uint8_t nb_re_dmrs,uint16
|
|||||||
G = ((NR_NB_SC_PER_RB*nb_symb_sch)-(nb_re_dmrs*length_dmrs))*nb_rb*Qm*Nl;
|
G = ((NR_NB_SC_PER_RB*nb_symb_sch)-(nb_re_dmrs*length_dmrs))*nb_rb*Qm*Nl;
|
||||||
return(G);
|
return(G);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t nr_get_E(uint32_t G, uint8_t C, uint8_t Qm, uint8_t Nl, uint8_t r) {
|
||||||
|
uint32_t E;
|
||||||
|
uint8_t Cprime = C; //assume CBGTI not present
|
||||||
|
|
||||||
|
AssertFatal(Nl>0,"Nl is 0\n");
|
||||||
|
AssertFatal(Qm>0,"Qm is 0\n");
|
||||||
|
|
||||||
|
if (r <= Cprime - ((G/(Nl*Qm))%Cprime) - 1)
|
||||||
|
E = Nl*Qm*(G/(Nl*Qm*Cprime));
|
||||||
|
else
|
||||||
|
E = Nl*Qm*((G/(Nl*Qm*Cprime))+1);
|
||||||
|
|
||||||
|
return E;
|
||||||
|
}
|
||||||
|
|||||||
@@ -376,6 +376,22 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
|||||||
for (r=0; r<harq_process->C; r++) {
|
for (r=0; r<harq_process->C; r++) {
|
||||||
|
|
||||||
//printf("start rx segment %d\n",r);
|
//printf("start rx segment %d\n",r);
|
||||||
|
E = nr_get_E(G, harq_process->C, harq_process->Qm, harq_process->Nl, r);
|
||||||
|
|
||||||
|
#if UE_TIMING_TRACE
|
||||||
|
start_meas(dlsch_deinterleaving_stats);
|
||||||
|
#endif
|
||||||
|
nr_deinterleaving_ldpc(E,
|
||||||
|
harq_process->Qm,
|
||||||
|
harq_process->w[r],
|
||||||
|
dlsch_llr+r_offset);
|
||||||
|
|
||||||
|
//for (int i =0; i<16; i++)
|
||||||
|
// printf("rx output deinterleaving w[%d]= %d r_offset %d\n", i,harq_process->w[r][i], r_offset);
|
||||||
|
|
||||||
|
#if UE_TIMING_TRACE
|
||||||
|
stop_meas(dlsch_deinterleaving_stats);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if UE_TIMING_TRACE
|
#if UE_TIMING_TRACE
|
||||||
start_meas(dlsch_rate_unmatching_stats);
|
start_meas(dlsch_rate_unmatching_stats);
|
||||||
@@ -394,20 +410,15 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (nr_rate_matching_ldpc_rx(Ilbrm,
|
if (nr_rate_matching_ldpc_rx(Ilbrm,
|
||||||
Tbslbrm,
|
Tbslbrm,
|
||||||
p_decParams->BG,
|
p_decParams->BG,
|
||||||
p_decParams->Z,
|
p_decParams->Z,
|
||||||
G,
|
harq_process->d[r],
|
||||||
harq_process->w[r],
|
harq_process->w[r],
|
||||||
dlsch_llr+r_offset,
|
harq_process->C,
|
||||||
harq_process->C,
|
harq_process->rvidx,
|
||||||
harq_process->rvidx,
|
(harq_process->round==0)?1:0,
|
||||||
(harq_process->round==0)?1:0,
|
E)==-1) {
|
||||||
harq_process->Qm,
|
|
||||||
harq_process->Nl,
|
|
||||||
r,
|
|
||||||
&E)==-1) {
|
|
||||||
|
|
||||||
#if UE_TIMING_TRACE
|
#if UE_TIMING_TRACE
|
||||||
stop_meas(dlsch_rate_unmatching_stats);
|
stop_meas(dlsch_rate_unmatching_stats);
|
||||||
#endif
|
#endif
|
||||||
@@ -419,27 +430,13 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
|||||||
stop_meas(dlsch_rate_unmatching_stats);
|
stop_meas(dlsch_rate_unmatching_stats);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//for (int i =0; i<16; i++)
|
||||||
|
// printf("rx output ratematching d[%d]= %d r_offset %d\n", i,harq_process->d[r][i], r_offset);
|
||||||
|
|
||||||
r_offset += E;
|
r_offset += E;
|
||||||
|
|
||||||
//for (int i =0; i<16; i++)
|
|
||||||
// printf("rx output ratematching w[%d]= %d r_offset %d\n", i,harq_process->w[r][i], r_offset);
|
|
||||||
|
|
||||||
#if UE_TIMING_TRACE
|
|
||||||
start_meas(dlsch_deinterleaving_stats);
|
|
||||||
#endif
|
|
||||||
nr_deinterleaving_ldpc(E,
|
|
||||||
harq_process->Qm,
|
|
||||||
harq_process->d[r],
|
|
||||||
harq_process->w[r]);
|
|
||||||
|
|
||||||
//for (int i =0; i<16; i++)
|
|
||||||
// printf("rx output interleaving d[%d]= %d r_offset %d\n", i,harq_process->d[r][i], r_offset);
|
|
||||||
|
|
||||||
#if UE_TIMING_TRACE
|
|
||||||
stop_meas(dlsch_deinterleaving_stats);
|
|
||||||
#endif
|
|
||||||
#ifdef DEBUG_DLSCH_DECODING
|
#ifdef DEBUG_DLSCH_DECODING
|
||||||
|
|
||||||
if (r==0) {
|
if (r==0) {
|
||||||
write_output("decoder_llr.m","decllr",dlsch_llr,G,1,0);
|
write_output("decoder_llr.m","decllr",dlsch_llr,G,1,0);
|
||||||
write_output("decoder_in.m","dec",&harq_process->d[0][0],(3*8*Kr_bytes)+12,1,0);
|
write_output("decoder_in.m","dec",&harq_process->d[0][0],(3*8*Kr_bytes)+12,1,0);
|
||||||
@@ -979,6 +976,30 @@ if (harq_process->C>1) { // wakeup worker if more than 1 segment
|
|||||||
|
|
||||||
Tbslbrm = nr_compute_tbs(28,nb_rb,frame_parms->symbols_per_slot,0,0, harq_process->Nl);
|
Tbslbrm = nr_compute_tbs(28,nb_rb,frame_parms->symbols_per_slot,0,0, harq_process->Nl);
|
||||||
|
|
||||||
|
E = nr_get_E(G, harq_process->C, harq_process->Qm, harq_process->Nl, r);
|
||||||
|
|
||||||
|
/*
|
||||||
|
printf("Subblock deinterleaving, dlsch_llr %p, w %p\n",
|
||||||
|
dlsch_llr+r_offset,
|
||||||
|
&harq_process->w[r]);
|
||||||
|
*/
|
||||||
|
#if UE_TIMING_TRACE
|
||||||
|
start_meas(dlsch_deinterleaving_stats);
|
||||||
|
#endif
|
||||||
|
nr_deinterleaving_ldpc(E,
|
||||||
|
harq_process->Qm,
|
||||||
|
harq_process->w[r],
|
||||||
|
dlsch_llr+r_offset);
|
||||||
|
|
||||||
|
#ifdef DEBUG_DLSCH_DECODING
|
||||||
|
for (int i =0; i<16; i++)
|
||||||
|
printf("rx output deinterleaving w[%d]= %d r_offset %d\n", i,harq_process->w[r][i], r_offset);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if UE_TIMING_TRACE
|
||||||
|
stop_meas(dlsch_deinterleaving_stats);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if UE_TIMING_TRACE
|
#if UE_TIMING_TRACE
|
||||||
start_meas(dlsch_rate_unmatching_stats);
|
start_meas(dlsch_rate_unmatching_stats);
|
||||||
#endif
|
#endif
|
||||||
@@ -995,23 +1016,16 @@ if (harq_process->C>1) { // wakeup worker if more than 1 segment
|
|||||||
harq_process->round);
|
harq_process->round);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_DLSCH_DECODING
|
|
||||||
printf(" in decoding dlsch->harq_processes[harq_pid]->rvidx = %d\n", dlsch->harq_processes[harq_pid]->rvidx);
|
|
||||||
#endif
|
|
||||||
if (nr_rate_matching_ldpc_rx(Ilbrm,
|
if (nr_rate_matching_ldpc_rx(Ilbrm,
|
||||||
Tbslbrm,
|
Tbslbrm,
|
||||||
p_decParams->BG,
|
p_decParams->BG,
|
||||||
p_decParams->Z,
|
p_decParams->Z,
|
||||||
G,
|
harq_process->d[r],
|
||||||
harq_process->w[r],
|
harq_process->w[r],
|
||||||
dlsch_llr+r_offset,
|
harq_process->C,
|
||||||
harq_process->C,
|
harq_process->rvidx,
|
||||||
harq_process->rvidx,
|
(harq_process->round==0)?1:0,
|
||||||
(harq_process->round==0)?1:0,
|
E)==-1) {
|
||||||
harq_process->Qm,
|
|
||||||
harq_process->Nl,
|
|
||||||
r,
|
|
||||||
&E)==-1) {
|
|
||||||
#if UE_TIMING_TRACE
|
#if UE_TIMING_TRACE
|
||||||
stop_meas(dlsch_rate_unmatching_stats);
|
stop_meas(dlsch_rate_unmatching_stats);
|
||||||
#endif
|
#endif
|
||||||
@@ -1023,34 +1037,18 @@ if (harq_process->C>1) { // wakeup worker if more than 1 segment
|
|||||||
stop_meas(dlsch_rate_unmatching_stats);
|
stop_meas(dlsch_rate_unmatching_stats);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//for (int i =0; i<16; i++)
|
||||||
|
// printf("rx output ratematching d[%d]= %d r_offset %d\n", i,harq_process->d[r][i], r_offset);
|
||||||
|
|
||||||
//r_offset += E;
|
//r_offset += E;
|
||||||
//printf("main thread r_offset %d\n",r_offset);
|
//printf("main thread r_offset %d\n",r_offset);
|
||||||
|
|
||||||
#ifdef DEBUG_DLSCH_DECODING
|
#ifdef DEBUG_DLSCH_DECODING
|
||||||
for (int i =0; i<16; i++)
|
for (int i =0; i<16; i++)
|
||||||
printf("rx output ratematching w[%d]= %d r_offset %d\n", i,harq_process->w[r][i], r_offset);
|
printf("rx output ratematching d[%d]= %d r_offset %d\n", i,harq_process->d[r][i], r_offset);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
printf("Subblock deinterleaving, d %p w %p\n",
|
|
||||||
harq_process->d[r],
|
|
||||||
harq_process->w);
|
|
||||||
*/
|
|
||||||
#if UE_TIMING_TRACE
|
|
||||||
start_meas(dlsch_deinterleaving_stats);
|
|
||||||
#endif
|
|
||||||
nr_deinterleaving_ldpc(E,
|
|
||||||
harq_process->Qm,
|
|
||||||
harq_process->d[r],
|
|
||||||
harq_process->w[r]);
|
|
||||||
#ifdef DEBUG_DLSCH_DECODING
|
|
||||||
for (int i =0; i<16; i++)
|
|
||||||
printf("rx output interleaving d[%d]= %d r_offset %d\n", i,harq_process->d[r][i], r_offset);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if UE_TIMING_TRACE
|
|
||||||
stop_meas(dlsch_deinterleaving_stats);
|
|
||||||
#endif
|
|
||||||
#ifdef DEBUG_DLSCH_DECODING
|
#ifdef DEBUG_DLSCH_DECODING
|
||||||
|
|
||||||
if (r==0) {
|
if (r==0) {
|
||||||
@@ -1526,6 +1524,23 @@ void *nr_dlsch_decoding_2thread0(void *arg)
|
|||||||
|
|
||||||
Tbslbrm = nr_compute_tbs(28,nb_rb,frame_parms->symbols_per_slot,0,0, harq_process->Nl);
|
Tbslbrm = nr_compute_tbs(28,nb_rb,frame_parms->symbols_per_slot,0,0, harq_process->Nl);
|
||||||
|
|
||||||
|
E = nr_get_E(G, harq_process->C, harq_process->Qm, harq_process->Nl, r);
|
||||||
|
|
||||||
|
#if UE_TIMING_TRACE
|
||||||
|
start_meas(dlsch_deinterleaving_stats);
|
||||||
|
#endif
|
||||||
|
nr_deinterleaving_ldpc(E,
|
||||||
|
harq_process->Qm,
|
||||||
|
harq_process->w[r],
|
||||||
|
dlsch_llr+r_offset);
|
||||||
|
|
||||||
|
//for (int i =0; i<16; i++)
|
||||||
|
// printf("rx output deinterleaving w[%d]= %d r_offset %d\n", i,harq_process->w[r][i], r_offset);
|
||||||
|
|
||||||
|
#if UE_TIMING_TRACE
|
||||||
|
stop_meas(dlsch_deinterleaving_stats);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if UE_TIMING_TRACE
|
#if UE_TIMING_TRACE
|
||||||
start_meas(dlsch_rate_unmatching_stats);
|
start_meas(dlsch_rate_unmatching_stats);
|
||||||
#endif
|
#endif
|
||||||
@@ -1542,23 +1557,16 @@ void *nr_dlsch_decoding_2thread0(void *arg)
|
|||||||
harq_process->round);
|
harq_process->round);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_DLSCH_DECODING
|
|
||||||
printf(" in decoding dlsch->harq_processes[harq_pid]->rvidx = %d\n", dlsch->harq_processes[harq_pid]->rvidx);
|
|
||||||
#endif
|
|
||||||
if (nr_rate_matching_ldpc_rx(Ilbrm,
|
if (nr_rate_matching_ldpc_rx(Ilbrm,
|
||||||
Tbslbrm,
|
Tbslbrm,
|
||||||
p_decParams->BG,
|
p_decParams->BG,
|
||||||
p_decParams->Z,
|
p_decParams->Z,
|
||||||
G,
|
harq_process->d[r],
|
||||||
harq_process->w[r],
|
harq_process->w[r],
|
||||||
dlsch_llr+r_offset,
|
harq_process->C,
|
||||||
harq_process->C,
|
harq_process->rvidx,
|
||||||
harq_process->rvidx,
|
(harq_process->round==0)?1:0,
|
||||||
(harq_process->round==0)?1:0,
|
E)==-1) {
|
||||||
harq_process->Qm,
|
|
||||||
harq_process->Nl,
|
|
||||||
r,
|
|
||||||
&E)==-1) {
|
|
||||||
#if UE_TIMING_TRACE
|
#if UE_TIMING_TRACE
|
||||||
stop_meas(dlsch_rate_unmatching_stats);
|
stop_meas(dlsch_rate_unmatching_stats);
|
||||||
#endif
|
#endif
|
||||||
@@ -1570,23 +1578,13 @@ void *nr_dlsch_decoding_2thread0(void *arg)
|
|||||||
stop_meas(dlsch_rate_unmatching_stats);
|
stop_meas(dlsch_rate_unmatching_stats);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
//r_offset += E;
|
|
||||||
|
|
||||||
//for (int i =0; i<16; i++)
|
//for (int i =0; i<16; i++)
|
||||||
// printf("rx output ratematching w[%d]= %d r_offset %d\n", i,harq_process->w[r][i], r_offset);
|
// printf("rx output ratematching d[%d]= %d r_offset %d\n", i,harq_process->d[r][i], r_offset);
|
||||||
|
|
||||||
|
//r_offset += E;
|
||||||
|
|
||||||
#if UE_TIMING_TRACE
|
|
||||||
start_meas(dlsch_deinterleaving_stats);
|
|
||||||
#endif
|
|
||||||
nr_deinterleaving_ldpc(E,
|
|
||||||
harq_process->Qm,
|
|
||||||
harq_process->d[r],
|
|
||||||
harq_process->w[r]);
|
|
||||||
#if UE_TIMING_TRACE
|
|
||||||
stop_meas(dlsch_deinterleaving_stats);
|
|
||||||
#endif
|
|
||||||
#ifdef DEBUG_DLSCH_DECODING
|
#ifdef DEBUG_DLSCH_DECODING
|
||||||
|
|
||||||
if (r==0) {
|
if (r==0) {
|
||||||
write_output("decoder_llr.m","decllr",dlsch_llr,G,1,0);
|
write_output("decoder_llr.m","decllr",dlsch_llr,G,1,0);
|
||||||
write_output("decoder_in.m","dec",&harq_process->d[0][0],(3*8*Kr_bytes)+12,1,0);
|
write_output("decoder_in.m","dec",&harq_process->d[0][0],(3*8*Kr_bytes)+12,1,0);
|
||||||
@@ -2043,6 +2041,28 @@ void *nr_dlsch_decoding_2thread1(void *arg)
|
|||||||
|
|
||||||
Tbslbrm = nr_compute_tbs(28,nb_rb,frame_parms->symbols_per_slot,0,0, harq_process->Nl);
|
Tbslbrm = nr_compute_tbs(28,nb_rb,frame_parms->symbols_per_slot,0,0, harq_process->Nl);
|
||||||
|
|
||||||
|
E = nr_get_E(G, harq_process->C, harq_process->Qm, harq_process->Nl, r);
|
||||||
|
|
||||||
|
/*
|
||||||
|
printf("Subblock deinterleaving, d %p w %p\n",
|
||||||
|
harq_process->d[r],
|
||||||
|
harq_process->w);
|
||||||
|
*/
|
||||||
|
#if UE_TIMING_TRACE
|
||||||
|
start_meas(dlsch_deinterleaving_stats);
|
||||||
|
#endif
|
||||||
|
nr_deinterleaving_ldpc(E,
|
||||||
|
harq_process->Qm,
|
||||||
|
harq_process->w[r],
|
||||||
|
dlsch_llr+r_offset);
|
||||||
|
|
||||||
|
//for (int i =0; i<16; i++)
|
||||||
|
// printf("rx output deinterleaving w[%d]= %d r_offset %d\n", i,harq_process->w[r][i], r_offset);
|
||||||
|
|
||||||
|
#if UE_TIMING_TRACE
|
||||||
|
stop_meas(dlsch_deinterleaving_stats);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if UE_TIMING_TRACE
|
#if UE_TIMING_TRACE
|
||||||
start_meas(dlsch_rate_unmatching_stats);
|
start_meas(dlsch_rate_unmatching_stats);
|
||||||
#endif
|
#endif
|
||||||
@@ -2059,23 +2079,16 @@ void *nr_dlsch_decoding_2thread1(void *arg)
|
|||||||
harq_process->round);
|
harq_process->round);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_DLSCH_DECODING
|
|
||||||
printf(" in decoding dlsch->harq_processes[harq_pid]->rvidx = %d\n", dlsch->harq_processes[harq_pid]->rvidx);
|
|
||||||
#endif
|
|
||||||
if (nr_rate_matching_ldpc_rx(Ilbrm,
|
if (nr_rate_matching_ldpc_rx(Ilbrm,
|
||||||
Tbslbrm,
|
Tbslbrm,
|
||||||
p_decParams->BG,
|
p_decParams->BG,
|
||||||
p_decParams->Z,
|
p_decParams->Z,
|
||||||
G,
|
harq_process->d[r],
|
||||||
harq_process->w[r],
|
harq_process->w[r],
|
||||||
dlsch_llr+r_offset,
|
|
||||||
harq_process->C,
|
harq_process->C,
|
||||||
harq_process->rvidx,
|
harq_process->rvidx,
|
||||||
(harq_process->round==0)?1:0,
|
(harq_process->round==0)?1:0,
|
||||||
harq_process->Qm,
|
E)==-1) {
|
||||||
harq_process->Nl,
|
|
||||||
r,
|
|
||||||
&E)==-1) {
|
|
||||||
#if UE_TIMING_TRACE
|
#if UE_TIMING_TRACE
|
||||||
stop_meas(dlsch_rate_unmatching_stats);
|
stop_meas(dlsch_rate_unmatching_stats);
|
||||||
#endif
|
#endif
|
||||||
@@ -2087,23 +2100,12 @@ void *nr_dlsch_decoding_2thread1(void *arg)
|
|||||||
stop_meas(dlsch_rate_unmatching_stats);
|
stop_meas(dlsch_rate_unmatching_stats);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//for (int i =0; i<16; i++)
|
||||||
|
// printf("rx output ratematching d[%d]= %d r_offset %d\n", i,harq_process->d[r][i], r_offset);
|
||||||
|
|
||||||
//r_offset += E;
|
//r_offset += E;
|
||||||
|
|
||||||
/*
|
|
||||||
printf("Subblock deinterleaving, d %p w %p\n",
|
|
||||||
harq_process->d[r],
|
|
||||||
harq_process->w);
|
|
||||||
*/
|
|
||||||
#if UE_TIMING_TRACE
|
|
||||||
start_meas(dlsch_deinterleaving_stats);
|
|
||||||
#endif
|
|
||||||
nr_deinterleaving_ldpc(E,
|
|
||||||
harq_process->Qm,
|
|
||||||
harq_process->d[r],
|
|
||||||
harq_process->w[r]);
|
|
||||||
#if UE_TIMING_TRACE
|
|
||||||
stop_meas(dlsch_deinterleaving_stats);
|
|
||||||
#endif
|
|
||||||
#ifdef DEBUG_DLSCH_DECODING
|
#ifdef DEBUG_DLSCH_DECODING
|
||||||
if (r==0) {
|
if (r==0) {
|
||||||
write_output("decoder_llr.m","decllr",dlsch_llr,G,1,0);
|
write_output("decoder_llr.m","decllr",dlsch_llr,G,1,0);
|
||||||
|
|||||||
Reference in New Issue
Block a user