Check ULSCH transport block CRC
This commit is contained in:
@@ -463,7 +463,22 @@ int nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
|||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_ULSCH_DECODING, 0);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_ULSCH_DECODING, 0);
|
||||||
|
|
||||||
|
bool crc_valid = false;
|
||||||
if (harq_process->processedSegments == harq_process->C) {
|
if (harq_process->processedSegments == harq_process->C) {
|
||||||
|
// When the number of code blocks is 1 (C = 1) and ulsch_harq->processedSegments = 1, we can assume a good TB because of the
|
||||||
|
// CRC check made by the LDPC for early termination, so, no need to perform CRC check twice for a single code block
|
||||||
|
crc_valid = true;
|
||||||
|
if (harq_process->C > 1) {
|
||||||
|
// Check ULSCH transport block CRC
|
||||||
|
crc_type = CRC16;
|
||||||
|
if (A > 3824) {
|
||||||
|
crc_type = CRC24_A;
|
||||||
|
}
|
||||||
|
crc_valid = check_crc(harq_process->b, harq_process->B, crc_type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (crc_valid) {
|
||||||
LOG_D(PHY, "[gNB %d] ULSCH: Setting ACK for slot %d TBS %d\n", phy_vars_gNB->Mod_id, ulsch->slot, harq_process->TBS);
|
LOG_D(PHY, "[gNB %d] ULSCH: Setting ACK for slot %d TBS %d\n", phy_vars_gNB->Mod_id, ulsch->slot, harq_process->TBS);
|
||||||
ulsch->active = false;
|
ulsch->active = false;
|
||||||
harq_process->round = 0;
|
harq_process->round = 0;
|
||||||
|
|||||||
@@ -261,8 +261,20 @@ static void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req)
|
|||||||
|
|
||||||
//int dumpsig=0;
|
//int dumpsig=0;
|
||||||
// if all segments are done
|
// if all segments are done
|
||||||
if (rdata->nbSegments == ulsch_harq->processedSegments) {
|
if (ulsch_harq->processedSegments == ulsch_harq->C) {
|
||||||
if (!check_abort(&ulsch_harq->abort_decode) && !gNB->pusch_vars[rdata->ulsch_id].DTX) {
|
// When the number of code blocks is 1 (C = 1) and ulsch_harq->processedSegments = 1, we can assume a good TB because of the
|
||||||
|
// CRC check made by the LDPC for early termination, so, no need to perform CRC check twice for a single code block
|
||||||
|
bool crc_valid = true;
|
||||||
|
if (ulsch_harq->C > 1) {
|
||||||
|
// Check ULSCH transport block CRC
|
||||||
|
int crc_type = CRC16;
|
||||||
|
if (rdata->A > 3824) {
|
||||||
|
crc_type = CRC24_A;
|
||||||
|
}
|
||||||
|
crc_valid = check_crc(ulsch_harq->b, ulsch_harq->B, crc_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (crc_valid && !check_abort(&ulsch_harq->abort_decode) && !gNB->pusch_vars[rdata->ulsch_id].DTX) {
|
||||||
LOG_D(PHY,
|
LOG_D(PHY,
|
||||||
"[gNB %d] ULSCH: Setting ACK for SFN/SF %d.%d (rnti %x, pid %d, ndi %d, status %d, round %d, TBS %d, Max interation "
|
"[gNB %d] ULSCH: Setting ACK for SFN/SF %d.%d (rnti %x, pid %d, ndi %d, status %d, round %d, TBS %d, Max interation "
|
||||||
"(all seg) %d)\n",
|
"(all seg) %d)\n",
|
||||||
|
|||||||
Reference in New Issue
Block a user