diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index f3457cb27c..8a7b1dbdd8 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -42,6 +42,7 @@ #include "PHY/NR_TRANSPORT/nr_ulsch.h" #include "PHY/NR_TRANSPORT/nr_dlsch.h" #include "SCHED_NR/sched_nr.h" +#include "SCHED_NR/fapi_nr_l1.h" #include "defs.h" #include "common/utils/LOG/vcd_signal_dumper.h" #include "common/utils/LOG/log.h" @@ -408,7 +409,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, int8_t l_ol [68*384]; __m128i *pv_ol128 = (__m128i*)&z_ol; __m128i *pl_ol128 = (__m128i*)&l_ol; - int no_iteration_ldpc; + int no_iteration_ldpc = 2; int length_dec; uint8_t crc_type; int K_bits_F; @@ -623,6 +624,11 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, Qm, (int8_t*)&pl_ol128[0], llrProcBuf, 1); + if (ret<0) { + LOG_E(PHY,"ulsch_decoding.c: Problem in LDPC decoder offload\n"); + no_iteration_ldpc = ulsch->max_ldpc_iterations + 1; + return 1; + } } else{ K_bits_F = Kr-harq_process->F; @@ -650,7 +656,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, LOG_E(PHY,"ulsch_decoding.c: Problem in rate_matching\n"); no_iteration_ldpc = ulsch->max_ldpc_iterations + 1; - return; + return 1; } //set first 2*Z_c bits to zeros @@ -674,10 +680,6 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, p_procTime); } - /*if (ret<0) { - no_iteration_ldpc = ulsch->max_ldpc_iterations + 1; - } - else {*/ for (int m=0; m < Kr>>3; m ++) { harq_process->c[r][m]= (uint8_t) llrProcBuf[m]; @@ -708,8 +710,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, else{ dtx_det = 0; no_iteration_ldpc = ulsch->max_ldpc_iterations+1; - } - + } bool decodeSuccess = (no_iteration_ldpc <= ulsch->max_ldpc_iterations); if (decodeSuccess) { memcpy(harq_process->b+offset, @@ -723,7 +724,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, LOG_D(PHY, "ULSCH %d in error\n",ULSCH_id); break; //don't even attempt to decode other segments } - } + } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_ULSCH_DECODING,0); diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index d468cfa2cd..e3b06a6438 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -464,7 +464,7 @@ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_BEAM_SWITCHI write_package[end].buff[i] = buff[i]; write_thread->count_write++; write_thread->end = (write_thread->end + 1)% MAX_WRITE_THREAD_PACKAGE; - // LOG_D(HW,"Signaling TX TS %llu\n",(unsigned long long)timestamp); + LOG_D(HW,"Signaling TX TS %llu\n",(unsigned long long)timestamp); pthread_cond_signal(&write_thread->cond_write); pthread_mutex_unlock(&write_thread->mutex_write); return 0; @@ -555,7 +555,7 @@ void *trx_usrp_write_thread(void * arg){ s->tx_md.start_of_burst = (s->tx_count==0) ? true : first_packet; s->tx_md.end_of_burst = last_packet; s->tx_md.time_spec = uhd::time_spec_t::from_ticks(timestamp, s->sample_rate); - // LOG_D(PHY,"usrp_tx_write: tx_count %llu SoB %d, EoB %d, TS %llu\n",(unsigned long long)s->tx_count,s->tx_md.start_of_burst,s->tx_md.end_of_burst,(unsigned long long)timestamp); + LOG_D(PHY,"usrp_tx_write: tx_count %llu SoB %d, EoB %d, TS %llu\n",(unsigned long long)s->tx_count,s->tx_md.start_of_burst,s->tx_md.end_of_burst,(unsigned long long)timestamp); s->tx_count++; // bit 3 enables gpio (for backward compatibility) diff --git a/targets/ARCH/rfsimulator/simulator.c b/targets/ARCH/rfsimulator/simulator.c index 5e2015c496..75f77fd706 100644 --- a/targets/ARCH/rfsimulator/simulator.c +++ b/targets/ARCH/rfsimulator/simulator.c @@ -429,7 +429,7 @@ static int rfsimulator_write_internal(rfsimulator_state_t *t, openair0_timestamp if (!alreadyLocked) pthread_mutex_lock(&Sockmutex); - //LOG_D(HW,"sending %d samples at time: %ld\n", nsamps, timestamp); + LOG_D(HW,"sending %d samples at time: %ld\n", nsamps, timestamp); for (int i=0; ibuf[i]; @@ -464,8 +464,8 @@ static int rfsimulator_write_internal(rfsimulator_state_t *t, openair0_timestamp if (!alreadyLocked) pthread_mutex_unlock(&Sockmutex); - //LOG_D(HW,"sent %d samples at time: %ld->%ld, energy in first antenna: %d\n", - // nsamps, timestamp, timestamp+nsamps, signal_energy(samplesVoid[0], nsamps) ); + LOG_D(HW,"sent %d samples at time: %ld->%ld, energy in first antenna: %d\n", + nsamps, timestamp, timestamp+nsamps, signal_energy(samplesVoid[0], nsamps) ); return nsamps; } @@ -536,7 +536,7 @@ static bool flushInput(rfsimulator_state_t *t, int timeout, int nsamps_for_initi } else if ( sz == 0 ) continue; - //LOG_D(HW, "Socket rcv %zd bytes\n", sz); + LOG_D(HW, "Socket rcv %zd bytes\n", sz); AssertFatal((b->remainToTransfer-=sz) >= 0, ""); b->transferPtr+=sz; @@ -599,11 +599,11 @@ static bool flushInput(rfsimulator_state_t *t, int timeout, int nsamps_for_initi if ( b->headerMode==false ) { if ( ! b->trashingPacket ) { b->lastReceivedTS=b->th.timestamp+b->th.size-byteToSample(b->remainToTransfer,b->th.nbAnt); - //LOG_D(HW,"UEsock: %d Set b->lastReceivedTS %ld\n", fd, b->lastReceivedTS); + LOG_D(HW,"UEsock: %d Set b->lastReceivedTS %ld\n", fd, b->lastReceivedTS); } if ( b->remainToTransfer==0) { - //LOG_D(HW,"UEsock: %d Completed block reception: %ld\n", fd, b->lastReceivedTS); + LOG_D(HW,"UEsock: %d Completed block reception: %ld\n", fd, b->lastReceivedTS); b->headerMode=true; b->transferPtr=(char *)&b->th; b->remainToTransfer=sizeof(samplesBlockHeader_t);