From 57dec19ac87f4952967a04e5970520123b8642a1 Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Thu, 27 Aug 2020 18:23:29 +0200 Subject: [PATCH] fixed thread init; ulsim runs fine --- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 6 +++--- openair1/PHY/defs_gNB.h | 2 +- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 2 +- openair1/SIMULATION/NR_PHY/ulsim.c | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index 082fbf0966..1731091659 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -293,7 +293,7 @@ uint32_t nr_processULSegment(void* arg) { ldpcDecode_t *rdata = (ldpcDecode_t*) arg; PHY_VARS_gNB *phy_vars_gNB = rdata->gNB; NR_UL_gNB_HARQ_t *ulsch_harq = rdata->ulsch_harq; - t_nrLDPC_dec_params *p_decoderParms = rdata->p_decoderParms; + t_nrLDPC_dec_params *p_decoderParms = &rdata->decoderParms; int length_dec; int no_iteration_ldpc; int Kr; @@ -311,7 +311,7 @@ uint32_t nr_processULSegment(void* arg) { uint8_t kc = rdata->Kc; uint32_t Tbslbrm = rdata->Tbslbrm; short* ulsch_llr = rdata->ulsch_llr; - int max_ldpc_iterations = rdata->p_decoderParms->numMaxIter; + int max_ldpc_iterations = p_decoderParms->numMaxIter; int8_t llrProcBuf[OAI_UL_LDPC_MAX_NUM_LLR] __attribute__ ((aligned(32))); int16_t z [68*384]; @@ -617,7 +617,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, rdata->gNB = phy_vars_gNB; rdata->ulsch_harq = harq_process; - rdata->p_decoderParms = p_decParams; + rdata->decoderParms = decParams; rdata->ulsch_llr = ulsch_llr; rdata->Kc = kc; rdata->harq_pid = harq_pid; diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 609161dd86..7e185015a8 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -812,7 +812,7 @@ typedef struct PHY_VARS_gNB_s { typedef struct LDPCDecode_s { PHY_VARS_gNB *gNB; NR_UL_gNB_HARQ_t *ulsch_harq; - t_nrLDPC_dec_params *p_decoderParms; + t_nrLDPC_dec_params decoderParms; NR_gNB_ULSCH_t *ulsch; short* ulsch_llr; int ulsch_id; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index c746494a2b..847731b89c 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -231,7 +231,7 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) { NR_gNB_ULSCH_t *ulsch = rdata->ulsch; int r = rdata->segment_r; - bool decodeSuccess = (rdata->decodeIterations <= rdata->p_decoderParms->numMaxIter); + bool decodeSuccess = (rdata->decodeIterations <= rdata->decoderParms.numMaxIter); ulsch_harq->processedSegments++; LOG_D(PHY, "processing result of segment: %d, processed %d/%d\n", rdata->segment_r, ulsch_harq->processedSegments, rdata->nbSegments); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 635245b320..91daffb76b 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -473,7 +473,8 @@ int main(int argc, char **argv) gNB = RC.gNB[0]; gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t)); gNB->respDecode = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); - initTpool("n", gNB->threadPool, true); + char tp_param[] = "-1,-1,-1,-1,-1,-1"; + initTpool(tp_param, gNB->threadPool, false); initNotifiedFIFO(gNB->respDecode); //gNB_config = &gNB->gNB_config;