From 37752af2cfa2aa609ebd1919da8188231f674a64 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Wed, 5 Jul 2023 20:00:33 +0200 Subject: [PATCH 1/3] make common code for data copy to the scope --- executables/nr-ru.c | 9 ++- .../nr_dl_channel_estimation.c | 8 ++- openair1/PHY/NR_UE_TRANSPORT/dci_nr.c | 4 +- .../NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 7 +- openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c | 4 +- .../NR_UE_TRANSPORT/nr_transport_proto_ue.h | 2 +- openair1/PHY/TOOLS/nr_phy_scope.c | 24 +++---- openair1/PHY/TOOLS/phy_scope_interface.c | 64 +++++++++---------- openair1/PHY/TOOLS/phy_scope_interface.h | 38 +++++++---- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 4 +- 10 files changed, 87 insertions(+), 77 deletions(-) diff --git a/executables/nr-ru.c b/executables/nr-ru.c index c19d3f8b4f..dd3b1ac0cb 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -1249,8 +1249,13 @@ void *ru_thread( void *param ) { clock_gettime(CLOCK_MONOTONIC,&ru->rt_ru_profiling.return_RU_feprx[rt_prof_idx]); //LOG_M("rxdata.m","rxs",ru->common.rxdata[0],1228800,1,1); LOG_D(PHY,"RU proc: frame_rx = %d, tti_rx = %d\n", proc->frame_rx, proc->tti_rx); - if (IS_SOFTMODEM_DOSCOPE && RC.gNB[0]->scopeData) - ((scopeData_t *)RC.gNB[0]->scopeData)->slotFunc(ru->common.rxdataF[0],proc->tti_rx, RC.gNB[0]->scopeData); + gNBscopeCopy(RC.gNB[0], + gNBRxdataF, + ru->common.rxdataF[0], + sizeof(c16_t), + 1, + gNB->frame_parms.samples_per_slot_wCP, + proc->tti_rx * gNB->frame_parms.samples_per_slot_wCP); // Do PRACH RU processing int prach_id=find_nr_prach_ru(ru,proc->frame_rx,proc->tti_rx,SEARCH_EXIST); diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c index baf9d91bb3..1dc97cc674 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -993,7 +993,13 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, } if (dmrss == 2) - UEscopeCopy(ue, pbchDlChEstimateTime, (void*)dl_ch_estimates_time, sizeof(struct complex16), ue->frame_parms.nb_antennas_rx, ue->frame_parms.ofdm_symbol_size); + UEscopeCopy(ue, + pbchDlChEstimateTime, + (void *)dl_ch_estimates_time, + sizeof(c16_t), + ue->frame_parms.nb_antennas_rx, + ue->frame_parms.ofdm_symbol_size, + 0); return(0); } diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c index 3d1d9b8c73..de672b8cc5 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c @@ -745,7 +745,7 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue, log2_maxh, n_rb); // log2_maxh+I0_shift - UEscopeCopy(ue, pdcchRxdataF_comp, rxdataF_comp, sizeof(struct complex16), frame_parms->nb_antennas_rx, rx_size); + UEscopeCopy(ue, pdcchRxdataF_comp, rxdataF_comp, sizeof(struct complex16), frame_parms->nb_antennas_rx, rx_size, 0); if (frame_parms->nb_antennas_rx > 1) { LOG_D(PHY,"we enter nr_pdcch_detection_mrc(frame_parms->nb_antennas_rx=%d)\n", frame_parms->nb_antennas_rx); @@ -761,7 +761,7 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue, s, n_rb); - UEscopeCopy(ue, pdcchLlr, llr, sizeof(int16_t), 1, llr_size); + UEscopeCopy(ue, pdcchLlr, llr, sizeof(int16_t), 1, llr_size, 0); #if T_TRACER diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index 0b63af4af7..37feb297eb 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -259,7 +259,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, int32_t *log2_maxh, int rx_size_symbol, int nbRx, - int32_t rxdataF_comp[][nbRx][rx_size_symbol], + int32_t rxdataF_comp[][nbRx][rx_size_symbol * NR_SYMBOLS_PER_SLOT], c16_t ptrs_phase_per_slot[][NR_SYMBOLS_PER_SLOT], int32_t ptrs_re_per_slot[][NR_SYMBOLS_PER_SLOT]) { @@ -621,7 +621,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, codeword_TB0, codeword_TB1, layer_llr); - + // if (llr[0][0]) abort(); for (int i=0; isymbols_per_slot), T_BUFFER(&rxdataF_comp[gNB_id][0], 2 * /* ulsch[UE_id]->harq_processes[harq_pid]->nb_rb */ frame_parms->N_RB_UL * 12 * 2)); #endif - - UEscopeCopy(ue, pdschRxdataF_comp, rxdataF_comp, sizeof(c16_t), nbRx, rx_size_symbol); + UEscopeCopy(ue, pdschRxdataF_comp, rxdataF_comp[0], sizeof(c16_t), nbRx, rx_size_symbol * NR_SYMBOLS_PER_SLOT, 0); if (ue->phy_sim_pdsch_rxdataF_comp) for (int a = 0; a < nbRx; a++) { diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index c846e55227..b51f225268 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -486,8 +486,8 @@ int nr_rx_pbch(PHY_VARS_NR_UE *ue, } // legacy code use int16, but it is complex16 - UEscopeCopy(ue, pbchRxdataF_comp, pbch_unClipped, sizeof(struct complex16), frame_parms->nb_antennas_rx, pbch_e_rx_idx/2); - UEscopeCopy(ue, pbchLlr, pbch_e_rx, sizeof(int16_t), frame_parms->nb_antennas_rx, pbch_e_rx_idx); + UEscopeCopy(ue, pbchRxdataF_comp, pbch_unClipped, sizeof(struct complex16), frame_parms->nb_antennas_rx, pbch_e_rx_idx / 2, 0); + UEscopeCopy(ue, pbchLlr, pbch_e_rx, sizeof(int16_t), frame_parms->nb_antennas_rx, pbch_e_rx_idx, 0); #ifdef DEBUG_PBCH write_output("rxdataF_comp.m","rxFcomp",rxdataF_comp[0],240*3,1,1); short *p = (short *)rxdataF_comp[0]); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h index 6b40f0f54c..0112d5809e 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -404,7 +404,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, int32_t *log2_maxhrx_size_symbol, int rx_size_symbol, int nbRx, - int32_t rxdataF_comp[][nbRx][rx_size_symbol], + int32_t rxdataF_comp[][nbRx][rx_size_symbol * NR_SYMBOLS_PER_SLOT], c16_t ptrs_phase_per_slot[][NR_SYMBOLS_PER_SLOT], int32_t ptrs_re_per_slot[][NR_SYMBOLS_PER_SLOT]); diff --git a/openair1/PHY/TOOLS/nr_phy_scope.c b/openair1/PHY/TOOLS/nr_phy_scope.c index bc202590ed..9b0d152c6d 100644 --- a/openair1/PHY/TOOLS/nr_phy_scope.c +++ b/openair1/PHY/TOOLS/nr_phy_scope.c @@ -501,7 +501,9 @@ static void timeResponse (OAIgraph_t *graph, scopeData_t *p, int nb_UEs) { static void gNBfreqWaterFall (OAIgraph_t *graph, scopeData_t *p, int nb_UEs) { NR_DL_FRAME_PARMS *frame_parms=&p->gNB->frame_parms; //use 1st antenna - genericWaterFall(graph, (scopeSample_t *)p->liveData, frame_parms->samples_per_frame_wCP, + genericWaterFall(graph, + (scopeSample_t *)p->liveData[gNBRxdataF], + frame_parms->samples_per_frame_wCP, frame_parms->slots_per_frame, "X axis: Frequency domain, one subframe"); } @@ -736,26 +738,19 @@ static void *scope_thread_gNB(void *arg) { } #endif -static void copyRxdataF(int32_t *data, int slot, void *scopeData) { - scopeData_t *scope=(scopeData_t *)scopeData; - memcpy(((int32_t *)scope->liveData) + slot*scope->gNB->frame_parms.samples_per_slot_wCP, - data, - scope->gNB->frame_parms.samples_per_slot_wCP*sizeof(int32_t)); -} - STATICFORXSCOPE void gNBinitScope(scopeParms_t *p) { - AssertFatal(p->gNB->scopeData=malloc(sizeof(scopeData_t)),""); + AssertFatal(p->gNB->scopeData = calloc(sizeof(scopeData_t), 1), ""); scopeData_t *scope=(scopeData_t *) p->gNB->scopeData; scope->argc=p->argc; scope->argv=p->argv; scope->ru=p->ru; scope->gNB=p->gNB; - scope->slotFunc=copyRxdataF; - AssertFatal(scope->liveData= calloc(p->gNB->frame_parms.samples_per_frame_wCP*sizeof(int32_t),1),""); + scope->copyData = copyData; #ifndef WEBSRVSCOPE pthread_t forms_thread; threadCreate(&forms_thread, scope_thread_gNB, p->gNB->scopeData, "scope", -1, OAI_PRIORITY_RT_LOW); + copyDataMutexInit(scope); #endif } static void ueWaterFall (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { @@ -1140,14 +1135,13 @@ static void *nrUEscopeThread(void *arg) { STATICFORXSCOPE void nrUEinitScope(PHY_VARS_NR_UE *ue) { - AssertFatal(ue->scopeData=malloc(sizeof(scopeData_t)),""); + AssertFatal(ue->scopeData = calloc(sizeof(scopeData_t), 1), ""); scopeData_t *scope=(scopeData_t *) ue->scopeData; - scope->copyData=UEcopyData; - AssertFatal(scope->liveData=calloc(sizeof(scopeGraphData_t *), UEdataTypeNumberOfItems),""); + scope->copyData = copyData; #ifndef WEBSRVSCOPE pthread_t forms_thread; threadCreate(&forms_thread, nrUEscopeThread, ue, "scope", -1, OAI_PRIORITY_RT_LOW); - UEcopyDataMutexInit(); + copyDataMutexInit(scope); #endif } diff --git a/openair1/PHY/TOOLS/phy_scope_interface.c b/openair1/PHY/TOOLS/phy_scope_interface.c index 6dfcc36c75..14f361362d 100644 --- a/openair1/PHY/TOOLS/phy_scope_interface.c +++ b/openair1/PHY/TOOLS/phy_scope_interface.c @@ -35,14 +35,12 @@ #include "phy_scope_interface.h" #define SOFTSCOPE_ENDFUNC_IDX 0 -#define THREAD_MEM 4 static loader_shlibfunc_t scope_fdesc[]= {{"end_forms",NULL}}; -pthread_mutex_t UEcopyDataMutex; - -int UEcopyDataMutexInit(void) { - return pthread_mutex_init(&UEcopyDataMutex, NULL); +int copyDataMutexInit(scopeData_t *p) +{ + return pthread_mutex_init(&p->copyDataMutex, NULL); } int load_softscope(char *exectype, void *initarg) { @@ -60,46 +58,44 @@ int end_forms(void) { return -1; } -void UEcopyData(PHY_VARS_NR_UE *ue, enum UEdataType type, void *dataIn, int elementSz, int colSz, int lineSz) { - // Local static copy of the scope data bufs - // The active data buf is alterned to avoid interference between the Scope thread (display) and the Rx thread (data input) - // Index of THREAD_MEM could be set to the number of Rx threads + 1. Rx slots could run asynchronous to each other. - // THREAD_MEM = 4 slot process running in parallel is an assumption. THREAD_MEM can be increased if scope appears inconsistent. - static scopeGraphData_t *copyDataBufs[UEdataTypeNumberOfItems][THREAD_MEM] = {0}; - static int copyDataBufsIdx[UEdataTypeNumberOfItems] = {0}; - - scopeData_t *tmp = (scopeData_t *)ue->scopeData; +void copyData(void *scopeData, enum scopeDataType type, void *dataIn, int elementSz, int colSz, int lineSz, int offset) +{ + scopeData_t *tmp = (scopeData_t *)scopeData; if (tmp) { // Begin of critical zone between UE Rx threads that might copy new data at the same time: - pthread_mutex_lock(&UEcopyDataMutex); - int newCopyDataIdx = (copyDataBufsIdx[type]<(THREAD_MEM-1))?copyDataBufsIdx[type]+1:0; - copyDataBufsIdx[type] = newCopyDataIdx; - pthread_mutex_unlock(&UEcopyDataMutex); + pthread_mutex_lock(&tmp->copyDataMutex); + scopeGraphData_t *oldData = ((scopeGraphData_t **)tmp->liveData)[type]; + tmp->copyDataBufsIdx[type] = (tmp->copyDataBufsIdx[type] + 1) % COPIES_MEM; + int newCopyDataIdx = tmp->copyDataBufsIdx[type]; + pthread_mutex_unlock(&tmp->copyDataMutex); // End of critical zone between UE Rx threads - + int oldDataSz = oldData ? oldData->dataSize : 0; + int newSz = max(elementSz * colSz * (lineSz + offset), oldDataSz); // New data will be copied in a different buffer than the live one - scopeGraphData_t *copyData = copyDataBufs[type][newCopyDataIdx]; - - if (copyData == NULL || copyData->dataSize < elementSz*colSz*lineSz) { - scopeGraphData_t *ptr = (scopeGraphData_t*) realloc(copyData, sizeof(scopeGraphData_t) + elementSz*colSz*lineSz); - + scopeGraphData_t *newData = tmp->copyDataBufs[type][newCopyDataIdx]; + if (newData == NULL || newData->dataSize < newSz) { + scopeGraphData_t *ptr = (scopeGraphData_t *)realloc(newData, sizeof(scopeGraphData_t) + newSz); if (!ptr) { - LOG_E(PHY,"can't realloc\n"); + LOG_E(PHY, "can't realloc\n"); return; } else { - copyData = ptr; + tmp->copyDataBufs[type][newCopyDataIdx] = ptr; + if (!newData) // we have a new malloc + *ptr = (scopeGraphData_t){0}; + newData = ptr; + newData->dataSize = newSz; } } + if (offset && oldDataSz) // we copy the previous buffer because we have as input only a part of + memcpy(newData + 1, oldData + 1, oldDataSz); - copyData->dataSize = elementSz*colSz*lineSz; - copyData->elementSz = elementSz; - copyData->colSz = colSz; - copyData->lineSz = lineSz; - memcpy(copyData+1, dataIn, elementSz*colSz*lineSz); - copyDataBufs[type][newCopyDataIdx] = copyData; + newData->elementSz = elementSz; + newData->colSz = colSz; + newData->lineSz = lineSz + offset; + memcpy(((void *)(newData + 1)) + elementSz * colSz * offset, dataIn, elementSz * colSz * lineSz); - // The new data just copied in the local static buffer becomes live now - ((scopeGraphData_t **)tmp->liveData)[type] = copyData; + // The new data just copied becomes live now + ((scopeGraphData_t **)tmp->liveData)[type] = newData; } } diff --git a/openair1/PHY/TOOLS/phy_scope_interface.h b/openair1/PHY/TOOLS/phy_scope_interface.h index d0e3bf7dac..3c520513cf 100644 --- a/openair1/PHY/TOOLS/phy_scope_interface.h +++ b/openair1/PHY/TOOLS/phy_scope_interface.h @@ -57,7 +57,7 @@ typedef struct { PHY_VARS_gNB *gNB; } scopeParms_t; -enum UEdataType { +enum scopeDataType { pbchDlChEstimateTime, pbchLlr, pbchRxdataF_comp, @@ -66,18 +66,11 @@ enum UEdataType { pdschLlr, pdschRxdataF_comp, commonRxdataF, - UEdataTypeNumberOfItems + gNBRxdataF, + MAX_SCOPE_TYPES }; -typedef struct scopeData_s { - int *argc; - char **argv; - RU_t *ru; - PHY_VARS_gNB *gNB; - void *liveData; - void (*slotFunc)(int32_t *data, int slot, void *scopeData); - void (*copyData)(PHY_VARS_NR_UE *,enum UEdataType, void *data, int elementSz, int colSz, int lineSz); -} scopeData_t; +#define COPIES_MEM 4 typedef struct { int dataSize; @@ -86,12 +79,29 @@ typedef struct { int lineSz; } scopeGraphData_t; +typedef struct scopeData_s { + int *argc; + char **argv; + RU_t *ru; + PHY_VARS_gNB *gNB; + scopeGraphData_t *liveData[MAX_SCOPE_TYPES]; + void (*copyData)(void *, enum scopeDataType, void *data, int elementSz, int colSz, int lineSz, int offset); + pthread_mutex_t copyDataMutex; + scopeGraphData_t *copyDataBufs[MAX_SCOPE_TYPES][COPIES_MEM]; + int copyDataBufsIdx[MAX_SCOPE_TYPES]; +} scopeData_t; + int load_softscope(char *exectype, void *initarg); int end_forms(void) ; -int UEcopyDataMutexInit(void); -void UEcopyData(PHY_VARS_NR_UE *ue, enum UEdataType type, void *dataIn, int elementSz, int colSz, int lineSz); +int copyDataMutexInit(scopeData_t *); +void copyData(void *, enum scopeDataType type, void *dataIn, int elementSz, int colSz, int lineSz, int offset); -#define UEscopeCopy(ue, type, ...) if(ue->scopeData) ((scopeData_t*)ue->scopeData)->copyData(ue, type, ##__VA_ARGS__); +#define UEscopeCopy(ue, type, ...) \ + if (ue->scopeData) \ + ((scopeData_t *)ue->scopeData)->copyData((scopeData_t *)ue->scopeData, type, ##__VA_ARGS__); +#define gNBscopeCopy(gnb, type, ...) \ + if (gnb->scopeData) \ + ((scopeData_t *)gnb->scopeData)->copyData((scopeData_t *)gNB->scopeData, type, ##__VA_ARGS__); extended_kpi_ue* getKPIUE(); diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 3300f7a421..eba59eb712 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1078,7 +1078,7 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_C, VCD_FUNCTION_OUT); - UEscopeCopy(ue, pdschLlr, llr[0], sizeof(int16_t), 1, rx_llr_size); + UEscopeCopy(ue, pdschLlr, llr[0], sizeof(int16_t), 1, rx_llr_size, 0); LOG_D(PHY, "DLSCH data reception at nr_slot_rx: %d\n", nr_slot_rx); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); @@ -1179,7 +1179,7 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",nr_slot_rx,ue->phy_proc_rx.p_time/(cpuf*1000.0)); LOG_D(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, nr_slot_rx); - UEscopeCopy(ue, commonRxdataF, rxdataF, sizeof(int32_t), ue->frame_parms.nb_antennas_rx, rxdataF_sz); + UEscopeCopy(ue, commonRxdataF, rxdataF, sizeof(int32_t), ue->frame_parms.nb_antennas_rx, rxdataF_sz, 0); } From 7e112c4caf0b10f09f1630c3283920639cae06fe Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Thu, 6 Jul 2023 14:04:47 +0200 Subject: [PATCH 2/3] fix qtscope with new api --- openair1/PHY/TOOLS/nr_phy_qt_scope.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/openair1/PHY/TOOLS/nr_phy_qt_scope.cpp b/openair1/PHY/TOOLS/nr_phy_qt_scope.cpp index 5aecc3906b..69a0506531 100644 --- a/openair1/PHY/TOOLS/nr_phy_qt_scope.cpp +++ b/openair1/PHY/TOOLS/nr_phy_qt_scope.cpp @@ -1234,12 +1234,14 @@ void *nrUEQtscopeThread(void *arg) // gNB scope initialization void nrgNBinitQtScope(scopeParms_t *p) { - scopeData_t *scope = (scopeData_t *)malloc(sizeof(scopeData_t)); + scopeData_t *scope = (scopeData_t *)calloc(sizeof(scopeData_t), 1); scope->gNB = p->gNB; scope->argc = p->argc; scope->argv = p->argv; scope->ru = p->ru; + scope->copyData = copyData; + copyDataMutexInit(scope); p->gNB->scopeData = scope; @@ -1250,11 +1252,10 @@ void nrgNBinitQtScope(scopeParms_t *p) // UE scope initialization void nrUEinitQtScope(PHY_VARS_NR_UE *ue) { - scopeData_t *scope = (scopeData_t *)malloc(sizeof(scopeData_t)); + scopeData_t *scope = (scopeData_t *)calloc(sizeof(scopeData_t), 1); - scope->liveData = calloc(sizeof(scopeGraphData_t *), UEdataTypeNumberOfItems); - scope->copyData = UEcopyData; - UEcopyDataMutexInit(); + scope->copyData = copyData; + copyDataMutexInit(scope); ue->scopeData = scope; From f0e4f74a7c016a9dcd31621bcd26371512378fab Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Mon, 10 Jul 2023 10:02:25 +0200 Subject: [PATCH 3/3] review --- openair1/PHY/TOOLS/nr_phy_qt_scope.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/TOOLS/nr_phy_qt_scope.cpp b/openair1/PHY/TOOLS/nr_phy_qt_scope.cpp index 69a0506531..4f73978448 100644 --- a/openair1/PHY/TOOLS/nr_phy_qt_scope.cpp +++ b/openair1/PHY/TOOLS/nr_phy_qt_scope.cpp @@ -1234,7 +1234,7 @@ void *nrUEQtscopeThread(void *arg) // gNB scope initialization void nrgNBinitQtScope(scopeParms_t *p) { - scopeData_t *scope = (scopeData_t *)calloc(sizeof(scopeData_t), 1); + scopeData_t *scope = (scopeData_t *)calloc(1, sizeof(scopeData_t)); scope->gNB = p->gNB; scope->argc = p->argc; @@ -1252,7 +1252,7 @@ void nrgNBinitQtScope(scopeParms_t *p) // UE scope initialization void nrUEinitQtScope(PHY_VARS_NR_UE *ue) { - scopeData_t *scope = (scopeData_t *)calloc(sizeof(scopeData_t), 1); + scopeData_t *scope = (scopeData_t *)calloc(1, sizeof(scopeData_t)); scope->copyData = copyData; copyDataMutexInit(scope);