Commit 49f1fc36 authored by hardy's avatar hardy

Merge remote-tracking branch 'origin/remove_ratematching_assertion' into integration_2021_wk47_b

parents 5319d220 b4acb028
...@@ -388,7 +388,7 @@ int nr_rate_matching_ldpc(uint8_t Ilbrm, ...@@ -388,7 +388,7 @@ int nr_rate_matching_ldpc(uint8_t Ilbrm,
uint32_t Ncb,ind,k=0,Nref,N; uint32_t Ncb,ind,k=0,Nref,N;
if (C==0) { if (C==0) {
printf("nr_rate_matching: invalid parameters (C %d\n",C); LOG_E(PHY,"nr_rate_matching: invalid parameters (C %d\n",C);
return -1; return -1;
} }
...@@ -407,16 +407,15 @@ int nr_rate_matching_ldpc(uint8_t Ilbrm, ...@@ -407,16 +407,15 @@ int nr_rate_matching_ldpc(uint8_t Ilbrm,
#ifdef RM_DEBUG #ifdef RM_DEBUG
printf("nr_rate_matching_ldpc: E %d, F %d, Foffset %d, k0 %d, Ncb %d, rvidx %d\n", E, F, Foffset,ind, Ncb, rvidx); printf("nr_rate_matching_ldpc: E %d, F %d, Foffset %d, k0 %d, Ncb %d, rvidx %d\n", E, F, Foffset,ind, Ncb, rvidx);
#endif #endif
AssertFatal(Foffset <= E,
"Foffset %d > E %d " if (Foffset > E) {
"(Ilbrm %d, Tbslbrm %d, Z %d, BG %d, C %d)\n", LOG_E(PHY,"nr_rate_matching: invalid parameters (Foffset %d > E %d)\n",Foffset,E);
Foffset, E, return -1;
Ilbrm, Tbslbrm, Z, BG, C); }
AssertFatal(Foffset <= Ncb, if (Foffset > Ncb) {
"Foffset %d > Ncb %d " LOG_E(PHY,"nr_rate_matching: invalid parameters (Foffset %d > Ncb %d)\n",Foffset,Ncb);
"(Ilbrm %d, Tbslbrm %d, Z %d, BG %d, C %d)\n", return -1;
Foffset, Ncb, }
Ilbrm, Tbslbrm, Z, BG, C);
if (ind >= Foffset && ind < (F+Foffset)) ind = F+Foffset; if (ind >= Foffset && ind < (F+Foffset)) ind = F+Foffset;
...@@ -478,7 +477,7 @@ int nr_rate_matching_ldpc_rx(uint8_t Ilbrm, ...@@ -478,7 +477,7 @@ int nr_rate_matching_ldpc_rx(uint8_t Ilbrm,
#endif #endif
if (C==0) { if (C==0) {
printf("nr_rate_matching: invalid parameters (C %d\n",C); LOG_E(PHY,"nr_rate_matching: invalid parameters (C %d\n",C);
return -1; return -1;
} }
...@@ -493,8 +492,14 @@ int nr_rate_matching_ldpc_rx(uint8_t Ilbrm, ...@@ -493,8 +492,14 @@ int nr_rate_matching_ldpc_rx(uint8_t Ilbrm,
} }
ind = (index_k0[BG-1][rvidx]*Ncb/N)*Z; ind = (index_k0[BG-1][rvidx]*Ncb/N)*Z;
AssertFatal(Foffset <= E,"Foffset %d > E %d\n",Foffset,E); if (Foffset > E) {
AssertFatal(Foffset <= Ncb,"Foffset %d > Ncb %d\n",Foffset,Ncb); LOG_E(PHY,"nr_rate_matching: invalid parameters (Foffset %d > E %d)\n",Foffset,E);
return -1;
}
if (Foffset > Ncb) {
LOG_E(PHY,"nr_rate_matching: invalid parameters (Foffset %d > Ncb %d)\n",Foffset,Ncb);
return -1;
}
#ifdef RM_DEBUG #ifdef RM_DEBUG
printf("nr_rate_matching_ldpc_rx: Clear %d, E %d, k0 %d, Ncb %d, rvidx %d\n", clear, E, ind, Ncb, rvidx); printf("nr_rate_matching_ldpc_rx: Clear %d, E %d, k0 %d, Ncb %d, rvidx %d\n", clear, E, ind, Ncb, rvidx);
......
...@@ -111,9 +111,9 @@ void nr_pdsch_codeword_scrambling_optim(uint8_t *in, ...@@ -111,9 +111,9 @@ void nr_pdsch_codeword_scrambling_optim(uint8_t *in,
} }
uint8_t nr_generate_pdsch(processingData_L1tx_t *msgTx, void nr_generate_pdsch(processingData_L1tx_t *msgTx,
int frame, int frame,
int slot) { int slot) {
PHY_VARS_gNB *gNB = msgTx->gNB; PHY_VARS_gNB *gNB = msgTx->gNB;
NR_gNB_DLSCH_t *dlsch; NR_gNB_DLSCH_t *dlsch;
...@@ -181,11 +181,12 @@ uint8_t nr_generate_pdsch(processingData_L1tx_t *msgTx, ...@@ -181,11 +181,12 @@ uint8_t nr_generate_pdsch(processingData_L1tx_t *msgTx,
/// CRC, coding, interleaving and rate matching /// CRC, coding, interleaving and rate matching
AssertFatal(harq->pdu!=NULL,"harq->pdu is null\n"); AssertFatal(harq->pdu!=NULL,"harq->pdu is null\n");
start_meas(dlsch_encoding_stats); start_meas(dlsch_encoding_stats);
nr_dlsch_encoding(gNB, if (nr_dlsch_encoding(gNB,
harq->pdu, frame, slot, dlsch, frame_parms,tinput,tprep,tparity,toutput, harq->pdu, frame, slot, dlsch, frame_parms,tinput,tprep,tparity,toutput,
dlsch_rate_matching_stats, dlsch_rate_matching_stats,
dlsch_interleaving_stats, dlsch_interleaving_stats,
dlsch_segmentation_stats); dlsch_segmentation_stats) == -1)
return;
stop_meas(dlsch_encoding_stats); stop_meas(dlsch_encoding_stats);
#ifdef DEBUG_DLSCH #ifdef DEBUG_DLSCH
printf("PDSCH encoding:\nPayload:\n"); printf("PDSCH encoding:\nPayload:\n");
...@@ -522,9 +523,6 @@ uint8_t nr_generate_pdsch(processingData_L1tx_t *msgTx, ...@@ -522,9 +523,6 @@ uint8_t nr_generate_pdsch(processingData_L1tx_t *msgTx,
LOG_D(PHY,"beam index for PDSCH allocation already taken\n"); LOG_D(PHY,"beam index for PDSCH allocation already taken\n");
} }
}// dlsch loop }// dlsch loop
return 0;
} }
void dump_pdsch_stats(FILE *fd,PHY_VARS_gNB *gNB) { void dump_pdsch_stats(FILE *fd,PHY_VARS_gNB *gNB) {
......
...@@ -67,9 +67,9 @@ void nr_fill_dlsch(processingData_L1tx_t *msgTx, ...@@ -67,9 +67,9 @@ void nr_fill_dlsch(processingData_L1tx_t *msgTx,
nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu, nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu,
unsigned char *sdu); unsigned char *sdu);
uint8_t nr_generate_pdsch(processingData_L1tx_t *msgTx, void nr_generate_pdsch(processingData_L1tx_t *msgTx,
int frame, int frame,
int slot); int slot);
void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB); void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB);
void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch); void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch);
......
...@@ -427,17 +427,19 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB, ...@@ -427,17 +427,19 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
Tbslbrm = nr_compute_tbslbrm(rel15->mcsTable[0],nb_rb,Nl); Tbslbrm = nr_compute_tbslbrm(rel15->mcsTable[0],nb_rb,Nl);
start_meas(dlsch_rate_matching_stats); start_meas(dlsch_rate_matching_stats);
nr_rate_matching_ldpc(Ilbrm, if (nr_rate_matching_ldpc(Ilbrm,
Tbslbrm, Tbslbrm,
harq->BG, harq->BG,
*Zc, *Zc,
harq->d[r], harq->d[r],
harq->e+r_offset, harq->e+r_offset,
harq->C, harq->C,
F, F,
Kr-F-2*(*Zc), Kr-F-2*(*Zc),
rel15->rvIndex[0], rel15->rvIndex[0],
E); E) == -1)
return -1;
stop_meas(dlsch_rate_matching_stats); stop_meas(dlsch_rate_matching_stats);
#ifdef DEBUG_DLSCH_CODING #ifdef DEBUG_DLSCH_CODING
for (int i =0; i<16; i++) for (int i =0; i<16; i++)
......
...@@ -274,7 +274,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue, ...@@ -274,7 +274,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
#ifdef DEBUG_ULSCH_CODING #ifdef DEBUG_ULSCH_CODING
printf("encoding thinks this is a new packet \n"); printf("encoding thinks this is a new packet \n");
#endif #endif
harq_process->first_tx = 0; harq_process->first_tx = 0;
///////////////////////// a---->| add CRC |---->b ///////////////////////// ///////////////////////// a---->| add CRC |---->b /////////////////////////
/////////// ///////////
/* /*
...@@ -445,17 +445,19 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue, ...@@ -445,17 +445,19 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RATE_MATCHING_LDPC, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RATE_MATCHING_LDPC, VCD_FUNCTION_IN);
start_meas(&ue->ulsch_rate_matching_stats); start_meas(&ue->ulsch_rate_matching_stats);
nr_rate_matching_ldpc(Ilbrm, if (nr_rate_matching_ldpc(Ilbrm,
Tbslbrm, Tbslbrm,
harq_process->BG, harq_process->BG,
*pz, *pz,
harq_process->d[r], harq_process->d[r],
harq_process->e+r_offset, harq_process->e+r_offset,
harq_process->C, harq_process->C,
F, F,
Kr-F-2*(*pz), Kr-F-2*(*pz),
harq_process->pusch_pdu.pusch_data.rv_index, harq_process->pusch_pdu.pusch_data.rv_index,
E); E) == -1)
return -1;
stop_meas(&ue->ulsch_rate_matching_stats); stop_meas(&ue->ulsch_rate_matching_stats);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RATE_MATCHING_LDPC, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RATE_MATCHING_LDPC, VCD_FUNCTION_OUT);
......
...@@ -162,7 +162,8 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, ...@@ -162,7 +162,8 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
nb_dmrs_re_per_rb, number_dmrs_symbols, mod_order, Nl); nb_dmrs_re_per_rb, number_dmrs_symbols, mod_order, Nl);
nr_ulsch_encoding(UE, ulsch_ue, frame_parms, harq_pid, G); if (nr_ulsch_encoding(UE, ulsch_ue, frame_parms, harq_pid, G) == -1)
return;
/////////// ///////////
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment