Commit 34c2f0be authored by Thomas Schlichter's avatar Thomas Schlichter

Merge remote-tracking branch 'fhg-KPI-GUI'

parents 4be8cb64 044be0d1
......@@ -2484,6 +2484,24 @@ set (SIMUSRC
##########################
add_library(SIMU SHARED ${SIMUSRC} )
# Qt-based scope
set(QTSCOPE_SOURCE_NR
${OPENAIR1_DIR}/PHY/TOOLS/nr_phy_qt_scope.cpp
)
find_package(Qt5 COMPONENTS Widgets Charts)
if (Qt5_FOUND)
message ("Qt5 Packages found.")
# Creates rules for calling the Meta-Object Compiler (moc) on the given source files
qt5_wrap_cpp(QTSCOPE_SOURCE_NR ${OPENAIR1_DIR}/PHY/TOOLS/nr_phy_qt_scope.h)
add_library(nrqtscope MODULE ${QTSCOPE_SOURCE_NR})
# Use the Widgets module from Qt5.
target_link_libraries(nrqtscope Qt5::Widgets Qt5::Charts)
else (Qt5_FOUND)
message ("WARNING: Qt5 Packages NOT found, so qt scope can NOT be displayed.")
endif ()
add_library(SIMU_ETH
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
......
......@@ -58,7 +58,7 @@ CMAKE_CMD="$CMAKE"
NOAVX512="False"
BUILD_ECLIPSE=0
NR="False"
OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope"
OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope nrqtscope"
RU=0
CMAKE_C_FLAGS=()
CMAKE_CXX_FLAGS=()
......@@ -754,9 +754,22 @@ function main() {
######################
if [ ! -z "$BUILD_OPTLIB" ] ; then
for oklib in $BUILD_OPTLIB ; do
if [ "$oklib" != "nrqtscope" ]; then
compilations \
$BUILD_DIR $oklib \
lib${oklib}.so $dbin/lib${oklib}.so
fi
if [ "$oklib" = "nrqtscope" ]; then
HEAD_PATH="$(find /usr/ -iname qwidget.h)"
if [ "$HEAD_PATH" != "" ]; then
compilations \
$BUILD_DIR $oklib \
lib${oklib}.so $dbin/lib${oklib}.so
else
echo_warning "qt scope could not compile; make sure to install the Qt packages!"
fi
fi
done
fi
......
......@@ -764,6 +764,16 @@ int main( int argc, char **argv ) {
load_softscope("nr",&p);
}
if(IS_SOFTMODEM_DOSCOPE_QT) {
sleep(1);
scopeParms_t p;
p.argc=&argc;
p.argv=argv;
p.gNB=RC.gNB[0];
p.ru=RC.ru[0];
load_softscope("nrqt",&p);
}
if (NFAPI_MODE != NFAPI_MODE_PNF && NFAPI_MODE != NFAPI_MODE_VNF) {
printf("Not NFAPI mode - call init_eNB_afterRU()\n");
init_eNB_afterRU();
......
......@@ -518,6 +518,10 @@ int main( int argc, char **argv ) {
set_latency_target();
mlockall(MCL_CURRENT | MCL_FUTURE);
if(IS_SOFTMODEM_DOSCOPE_QT) {
load_softscope("nrqt",PHY_vars_UE_g[0][0]);
}
if(IS_SOFTMODEM_DOSCOPE) {
load_softscope("nr",PHY_vars_UE_g[0][0]);
}
......
......@@ -90,7 +90,7 @@ void get_common_options(uint32_t execmask) {
uint32_t glog_level=0 ;
uint32_t start_telnetsrv = 0, start_telnetclt = 0;
uint32_t noS1 = 0, nokrnmod = 1, nonbiot = 0;
uint32_t rfsim = 0, do_forms = 0;
uint32_t rfsim = 0, do_forms = 0, do_forms_qt = 0;
char *logmem_filename = NULL;
paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC ;
paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC ;
......@@ -146,6 +146,10 @@ void get_common_options(uint32_t execmask) {
set_softmodem_optmask(SOFTMODEM_DOSCOPE_BIT);
}
if (do_forms_qt) {
set_softmodem_optmask(SOFTMODEM_DOSCOPE_QT_BIT);
}
if(parallel_config != NULL) set_parallel_conf(parallel_config);
if(worker_config != NULL) set_worker_conf(worker_config);
......
......@@ -68,6 +68,7 @@ extern "C"
#define CONFIG_HLP_ULF "Set the uplink frequency offset for all component carriers\n"
#define CONFIG_HLP_CHOFF "Channel id offset\n"
#define CONFIG_HLP_SOFTS "Enable soft scope and L1 and L2 stats (Xforms)\n"
#define CONFIG_HLP_SOFTS_QT "Enable soft scope and L1 and L2 stats (QT)\n"
#define CONFIG_HLP_EXMCAL "Calibrate the EXMIMO borad, available files: exmimo2_2arxg.lime exmimo2_2brxg.lime \n"
#define CONFIG_HLP_ITTIL "Generate ITTI analyzser logs (similar to wireshark logs but with more details)\n"
#define CONFIG_HLP_DLMCS "Set the maximum downlink MCS\n"
......@@ -166,6 +167,7 @@ extern int usrp_tx_thread;
{"CO" , CONFIG_HLP_ULF, 0, iptr:&(uplink_frequency_offset[0][0]), defintval:0, TYPE_INT, 0}, \
{"a" , CONFIG_HLP_CHOFF, 0, iptr:&CHAIN_OFFSET, defintval:0, TYPE_INT, 0}, \
{"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:(uint32_t *)&do_forms, defintval:0, TYPE_INT8, 0}, \
{"dqt" , CONFIG_HLP_SOFTS_QT, PARAMFLAG_BOOL, uptr:(uint32_t *)&do_forms_qt, defintval:0, TYPE_INT8, 0}, \
{"q" , CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \
{"numerology" , CONFIG_HLP_NUMEROLOGY, PARAMFLAG_BOOL, iptr:&NUMEROLOGY, defintval:1, TYPE_INT, 0}, \
{"band" , CONFIG_HLP_BAND, PARAMFLAG_BOOL, iptr:&BAND, defintval:78, TYPE_INT, 0}, \
......@@ -238,6 +240,8 @@ extern int usrp_tx_thread;
#define SOFTMODEM_4GUE_BIT (1<<22)
#define SOFTMODEM_5GUE_BIT (1<<23)
#define SOFTMODEM_NOSTATS_BIT (1<<24)
#define SOFTMODEM_DOSCOPE_QT_BIT (1<<25)
#define SOFTMODEM_FUNC_BITS (SOFTMODEM_ENB_BIT | SOFTMODEM_GNB_BIT | SOFTMODEM_5GUE_BIT | SOFTMODEM_4GUE_BIT)
#define MAPPING_SOFTMODEM_FUNCTIONS {{"enb",SOFTMODEM_ENB_BIT},{"gnb",SOFTMODEM_GNB_BIT},{"4Gue",SOFTMODEM_4GUE_BIT},{"5Gue",SOFTMODEM_5GUE_BIT}}
......@@ -249,6 +253,7 @@ extern int usrp_tx_thread;
#define IS_SOFTMODEM_SIML1 ( get_softmodem_optmask() & SOFTMODEM_SIML1_BIT)
#define IS_SOFTMODEM_DLSIM ( get_softmodem_optmask() & SOFTMODEM_DLSIM_BIT)
#define IS_SOFTMODEM_DOSCOPE ( get_softmodem_optmask() & SOFTMODEM_DOSCOPE_BIT)
#define IS_SOFTMODEM_DOSCOPE_QT ( get_softmodem_optmask() & SOFTMODEM_DOSCOPE_QT_BIT)
#define IS_SOFTMODEM_IQPLAYER ( get_softmodem_optmask() & SOFTMODEM_RECPLAY_BIT)
#define IS_SOFTMODEM_TELNETCLT_BIT ( get_softmodem_optmask() & SOFTMODEM_TELNETCLT_BIT)
#define IS_SOFTMODEM_ENB_BIT ( get_softmodem_optmask() & SOFTMODEM_ENB_BIT)
......
......@@ -300,6 +300,7 @@ void nr_sort_asc_int16_1D_array_ind(int32_t *matrix,
void nr_free_double_2D_array(double **input, uint16_t xlen);
#ifndef __cplusplus
void updateLLR(uint8_t listSize,
uint16_t row,
uint16_t col,
......@@ -327,7 +328,7 @@ void updatePathMetric2(double *pathMetric,
int ylen,
int zlen,
double llr[xlen][ylen][zlen]);
#endif
//Also nr_polar_rate_matcher
static inline void nr_polar_interleaver(uint8_t *input,
uint8_t *output,
......
......@@ -51,6 +51,8 @@
#include "nfapi/oai_integration/vendor_ext.h"
#include "PHY/TOOLS/phy_scope_interface.h"
#include "T.h"
//#define DEBUG_NR_PUCCH_RX 1
......@@ -1688,6 +1690,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
((int16_t*)&llrs[half_prb])[7]);
} // half_prb
} // symb
// run polar decoder on llrs
decoderState = polar_decoder_int16((int16_t*)llrs, decodedPayload, 0, 2,nb_bit,pucch_pdu->prb_size);
LOG_D(PHY,"UCI decoderState %d, payload[0] %llu\n",decoderState,(unsigned long long)decodedPayload[0]);
......
......@@ -459,8 +459,12 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
}
}
if (dmrss == 2)
scopeData_t *scope=(scopeData_t *)ue->scopeData;
if ((scope) && (dmrss == 2)){
int istreamingFlag = scope->flag_streaming[pbchDlChEstimateTime];
if (istreamingFlag == 1)
UEscopeCopy(ue, pbchDlChEstimateTime, (void*)dl_ch_estimates_time, sizeof(struct complex16), ue->frame_parms.nb_antennas_rx, ue->frame_parms.ofdm_symbol_size);
}
return(0);
}
......
......@@ -749,8 +749,12 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue,
log2_maxh,
n_rb); // log2_maxh+I0_shift
scopeData_t *scope=(scopeData_t *)ue->scopeData;
if (scope){
int istreamingFlag = scope->flag_streaming[pdcchRxdataF_comp];
if (istreamingFlag == 1)
UEscopeCopy(ue, pdcchRxdataF_comp, rxdataF_comp, sizeof(struct complex16), frame_parms->nb_antennas_rx, rx_size);
}
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);
nr_pdcch_detection_mrc(frame_parms, rx_size, rxdataF_comp,s);
......@@ -765,7 +769,11 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue,
s,
n_rb);
if (scope){
int istreamingFlag = scope->flag_streaming[pdcchLlr];
if (istreamingFlag == 1)
UEscopeCopy(ue, pdcchLlr, llr, sizeof(int16_t), 1, llr_size);
}
#if T_TRACER
......
......@@ -44,6 +44,7 @@
#include "executables/nr-uesoftmodem.h"
#include "PHY/CODING/nrLDPC_extern.h"
#include "common/utils/nr/nr_common.h"
#include "openair1/PHY/TOOLS/phy_scope_interface.h"
//#define ENABLE_PHY_PAYLOAD_DEBUG 1
......@@ -53,10 +54,51 @@
static uint64_t nb_total_decod =0;
static uint64_t nb_error_decod =0;
static int nb_ack = 0;
static int nb_nack = 0;
static uint32_t blockSize = 0;
static uint8_t dl_mcs = 0;
static uint16_t nofRBs = 0;
notifiedFIFO_t freeBlocks_dl;
notifiedFIFO_elt_t *msgToPush_dl;
int nbDlProcessing =0;
static tpool_t pool_dl;
//extern double cpuf;
void getKPIUE(extended_kpi_ue* kpiStructure)
{
float dl_bler = 1.0;
if (nb_ack > 0){
dl_bler = (float)nb_nack / (float)nb_ack;
}
kpiStructure->DL_BLER = dl_bler;
kpiStructure->blockSize = blockSize;
kpiStructure->dl_mcs = dl_mcs;
kpiStructure->nofRBs = nofRBs;
}
void init_dlsch_tpool(uint8_t num_dlsch_threads) {
char *params = NULL;
if( num_dlsch_threads==0) {
params = calloc(1,2);
memcpy(params,"N",1);
}
else {
params = calloc(1,(num_dlsch_threads*3)+1);
for (int i=0; i<num_dlsch_threads; i++) {
memcpy(params+(i*3),"-1,",3);
}
}
initNamedTpool(params, &pool_dl, false,"dlsch");
free(params);
}
void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlschptr, uint16_t N_RB_DL) {
uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*NR_MAX_NB_LAYERS;
......@@ -194,6 +236,11 @@ bool nr_ue_postDecode(PHY_VARS_NR_UE *phy_vars_ue, notifiedFIFO_elt_t *req, bool
// if all segments are done
if (last) {
nb_ack++;
blockSize = harq_process->TBS;
dl_mcs = harq_process->mcs;
nofRBs = harq_process->nb_rb;
if (decodeSuccess) {
//LOG_D(PHY,"[UE %d] DLSCH: Setting ACK for nr_slot_rx %d TBS %d mcs %d nb_rb %d harq_process->round %d\n",
// phy_vars_ue->Mod_id,nr_slot_rx,harq_process->TBS,harq_process->mcs,harq_process->nb_rb, harq_process->round);
......@@ -209,6 +256,7 @@ bool nr_ue_postDecode(PHY_VARS_NR_UE *phy_vars_ue, notifiedFIFO_elt_t *req, bool
dlsch->last_iteration_cnt = rdata->decodeIterations;
LOG_D(PHY, "DLSCH received ok \n");
} else {
nb_nack++;
//LOG_D(PHY,"[UE %d] DLSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d) Kr %d r %d harq_process->round %d\n",
// phy_vars_ue->Mod_id, frame, nr_slot_rx, harq_pid,harq_process->status, harq_process->round,harq_process->TBS,harq_process->mcs,Kr,r,harq_process->round);
harq_process->ack = 0;
......
......@@ -487,8 +487,17 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
}
// legacy code use int16, but it is complex16
scopeData_t *scope=(scopeData_t *)ue->scopeData;
if (scope)
{
int istreamingFlag = scope->flag_streaming[pbchRxdataF_comp];
if (istreamingFlag == 1)
UEscopeCopy(ue, pbchRxdataF_comp, pbch_unClipped, sizeof(struct complex16), frame_parms->nb_antennas_rx, pbch_e_rx_idx/2);
istreamingFlag = scope->flag_streaming[pbchLlr];
if (istreamingFlag == 1)
UEscopeCopy(ue, pbchLlr, pbch_e_rx, sizeof(int16_t), frame_parms->nb_antennas_rx, pbch_e_rx_idx);
}
#ifdef DEBUG_PBCH
write_output("rxdataF_comp.m","rxFcomp",rxdataF_comp[0],240*3,1,1);
short *p = (short *)rxdataF_comp[0]);
......
This diff is collapsed.
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/* Header file generated by Bo Zhao (Fraunhofer IIS) on Wed. Dec. 08, 2021*/
#ifndef QT_SCOPE_MAINWINDOW_H
#define QT_SCOPE_MAINWINDOW_H
#include <QComboBox>
#include <QMessageBox>
#include <QtCharts>
#include <QChartView>
#include <QLineSeries>
extern "C" {
#include <simple_executable.h>
#include <common/utils/system.h>
#include "common/ran_context.h"
#include <openair1/PHY/defs_gNB.h>
#include "PHY/defs_gNB.h"
#include "PHY/defs_nr_UE.h"
#include "PHY/defs_RU.h"
#include "executables/softmodem-common.h"
#include "phy_scope_interface.h"
#include <openair2/LAYER2/NR_MAC_gNB/mac_proto.h>
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
extern RAN_CONTEXT_t RC;
}
typedef struct {
float max_value;
float min_value;
float avg_value;
int plot_idx;
uint64_t avg_idx;
uint64_t nof_retrans; // especially for the KPI: nof retransmissions
QLineSeries *series;
QLineSeries *seriesMin;
QLineSeries *seriesMax;
QLineSeries *seriesAvg;
}KPI_elements;
// drop-down list UE
class KPIListSelect : public QComboBox
{
Q_OBJECT
public:
explicit KPIListSelect(QWidget *parent = 0);
~KPIListSelect();
private:
};
// drop-down list gNB
class KPIListSelectgNB : public QComboBox
{
Q_OBJECT
public:
explicit KPIListSelectgNB(QWidget *parent = 0);
~KPIListSelectgNB();
private:
};
// Paint first on a pixmap, then on the widget. Previous paint is erased
class PainterWidget : public QWidget
{
Q_OBJECT
public:
PainterWidget(QComboBox *parent, PHY_VARS_NR_UE *ue);
void makeConnections();
void resetKPIPlot(KPI_elements *inputStruct);
void resetKPIValues(KPI_elements *inputStruct);
QPixmap *pix;
QTimer *timer;
int chartHight, chartWidth;
QComboBox *parentWindow;
QTimer *timerWaterFallTime;
// for waterfill graphs
int waterFallh;
int iteration;
double *waterFallAvg;
bool isWaterFallTimeActive;
extended_kpi_ue extendKPIUE;
KPI_elements DLBLER;
KPI_elements DLMCS;
KPI_elements Throu;
KPI_elements nofRBs;
protected:
void paintEvent(QPaintEvent *event);
void resizeEvent(QResizeEvent *event) override;
public slots:
// IQ constellations
void paintPixmap_uePdschIQ();
void paintPixmap_uePbchIQ();
void paintPixmap_uePdcchIQ();
// LLR plots
void paintPixmap_uePdschLLR();
void paintPixmap_uePbchLLR();
void paintPixmap_uePdcchLLR();
// Waterfall
void paintPixmap_ueWaterFallTime();
void paintPixmap_ueChannelResponse();
// Extended KPIs
void KPI_DL_BLER();
void KPI_DL_MCS();
void KPI_DL_Throu();
void KPI_Nof_RBs();
private:
PHY_VARS_NR_UE *ue;
int indexToPlot;
int previousIndex;
};
// Paint class for gNB
class PainterWidgetgNB : public QWidget
{
Q_OBJECT
public:
PainterWidgetgNB(QComboBox *parent, scopeData_t *p);
void makeConnections();
void createPixMap(float *xData, float *yData, int len, QColor MarkerColor, const QString xLabel, const QString yLabel, bool scaleX);
void resetKPIPlot(KPI_elements *inputStruct);
void resetKPIValues(KPI_elements *inputStruct);
QPixmap *pix;
QTimer *timer;
QTimer *timerRetrans;
int chartHight, chartWidth;
int nb_UEs;
QComboBox *parentWindow;
KPI_elements ULBLER;
KPI_elements ULMCS;
KPI_elements DLBLER;
KPI_elements DLMCS;
KPI_elements ULThrou;
KPI_elements DLThrou;
KPI_elements nofRBs;
KPI_elements ULSNR;
KPI_elements DLSNR;
KPI_elements ULRetrans[4];
KPI_elements DLRetrans[4];
protected:
void paintEvent(QPaintEvent *event);
void resizeEvent(QResizeEvent *event) override;
public slots:
void KPI_PuschIQ();
void KPI_PuschLLR();
void KPI_ChannelResponse();
void KPI_UL_BLER();
void KPI_UL_MCS();
void KPI_DL_BLER();
void KPI_DL_MCS();
void KPI_UL_Throu();
void KPI_DL_Throu();
void KPI_Nof_RBs();
void KPI_UL_SNR();
void KPI_DL_SNR();
void KPI_UL_Retrans();
void KPI_DL_Retrans();
private:
scopeData_t *p;
int indexToPlot;
int previousIndex;
};
#endif // QT_SCOPE_MAINWINDOW_H
......@@ -24,6 +24,7 @@
/* Form definition file generated by fdesign */
#include <stdlib.h>
#include <stdio.h>
#include "nr_phy_scope.h"
#include "executables/softmodem-common.h"
#include "executables/nr-softmodem-common.h"
......@@ -290,6 +291,8 @@ static void genericPowerPerAntena(OAIgraph_t *graph, const int nb_ant, const sc
float *values, *time;
oai_xygraph_getbuff(graph, &time, &values, len, 0);
printf("************Number of Antennas: %i", nb_ant);
for (int ant=0; ant<nb_ant; ant++) {
if (data[ant] != NULL) {
for (int i=0; i<len; i++) {
......@@ -757,6 +760,8 @@ static void uePdschIQ (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_
memset(I+base, 0, sz*RX_NB_TH_MAX * sizeof(*I));
memset(Q+base, 0, sz*RX_NB_TH_MAX * sizeof(*Q));
//printf("sz: %i, sizeof(*I): %i\n", sz, sizeof(*I));
for (int thr=0 ; thr < RX_NB_TH_MAX ; thr ++ ) {
scopeSample_t *pdsch_comp = (scopeSample_t *) phy_vars_ue->pdsch_vars[thr][eNB_id]->rxdataF_comp0[0];
......@@ -829,6 +834,7 @@ static OAI_phy_scope_t *create_phy_scope_nrue( int ID ) {
// LLR of PDCCH
fdui->graph[5] = nrUEcommonGraph(uePcchLLR,
FL_POINTS_XYPLOT, 0, curY, 500, 100, "PDCCH Log-Likelihood Ratios (LLR, mag)", FL_CYAN );
fl_set_xyplot_xgrid(fdui->graph[5].graph,FL_GRID_MAJOR);
// I/Q PDCCH comp
fdui->graph[6] = nrUEcommonGraph(uePcchIQ,
FL_POINTS_XYPLOT, 500, curY, 300, 100, "PDCCH I/Q of MF Output", FL_CYAN );
......@@ -837,6 +843,7 @@ static OAI_phy_scope_t *create_phy_scope_nrue( int ID ) {
// LLR of PDSCH
fdui->graph[7] = nrUEcommonGraph(uePdschLLR,
FL_POINTS_XYPLOT, 0, curY, 500, 200, "PDSCH Log-Likelihood Ratios (LLR, mag)", FL_YELLOW );
fl_set_xyplot_xgrid(fdui->graph[7].graph,FL_GRID_MAJOR);
// I/Q PDSCH comp
fdui->graph[8] = nrUEcommonGraph(uePdschIQ,
FL_POINTS_XYPLOT, 500, curY, 300, 200, "PDSCH I/Q of MF Output", FL_YELLOW );
......@@ -891,7 +898,7 @@ void phy_scope_nrUE(scopeGraphData_t **UEliveData,
}
static void *nrUEscopeThread(void *arg) {
PHY_VARS_NR_UE *ue=(PHY_VARS_NR_UE *)arg;
PHY_VARS_NR_UE *ue=(PHY_VARS_NR_UE *)arg; // local structure with all top-level phy date for UE, as passed through arg
size_t stksize;
pthread_attr_t atr= {0};
pthread_attr_getstacksize(&atr, &stksize);
......@@ -899,7 +906,7 @@ static void *nrUEscopeThread(void *arg) {
int fl_argc=1;
char *name="5G-UE-scope";
fl_initialize (&fl_argc, &name, NULL, 0, 0);
OAI_phy_scope_t *form_nrue=create_phy_scope_nrue(0);
OAI_phy_scope_t *form_nrue=create_phy_scope_nrue(0); // build scope, in which one figure is created for each KPI. Here, 9 KPI for UE
while (!oai_exit) {
fl_freeze_form(form_nrue->phy_scope);
......@@ -961,6 +968,8 @@ void nrUEinitScope(PHY_VARS_NR_UE *ue) {
scopeData_t *scope=(scopeData_t *) ue->scopeData;
scope->copyData=UEcopyData;
AssertFatal(scope->liveData=calloc(sizeof(scopeGraphData_t *), UEdataTypeNumberOfItems),"");
for (int i=0; i<UEdataTypeNumberOfItems; i++)
scope->flag_streaming[i] = 1;
pthread_t forms_thread;
threadCreate(&forms_thread, nrUEscopeThread, ue, "scope", -1, OAI_PRIORITY_RT_LOW);
}
......
......@@ -29,11 +29,19 @@
* \note
* \warning
*/
#ifndef __PHY_SCOPE_INTERFACE_H__
#define __PHY_SCOPE_INTERFACE_H__
#ifndef __PHY_SCOPE_INTERFACE_H
#define __PHY_SCOPE_INTERFACE_H
#include <openair1/PHY/defs_gNB.h>
#include <openair1/PHY/defs_nr_UE.h>
typedef struct {
float DL_BLER;
uint32_t blockSize; // block size, to be used for throughput calculation
uint8_t dl_mcs;
uint16_t nofRBs;
}extended_kpi_ue;
typedef struct {
int *argc;
char **argv;
......@@ -43,18 +51,20 @@ typedef struct {
enum UEdataType {
pbchDlChEstimateTime,
pbchLlr,
pbchRxdataF_comp,
pdcchLlr,
pdcchRxdataF_comp,
pdcchLlr,
pbchRxdataF_comp,
pbchLlr,
UEdataTypeNumberOfItems
};
typedef struct scopeData_s {
int flag_streaming[UEdataTypeNumberOfItems];
int *argc;
char **argv;
RU_t *ru;
PHY_VARS_gNB *gNB;
void *liveDataUE;
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);
......@@ -64,4 +74,7 @@ int load_softscope(char *exectype, void *initarg);
int end_forms(void) ;
#define UEscopeCopy(ue, type, ...) if(ue->scopeData) ((scopeData_t*)ue->scopeData)->copyData(ue, type, ##__VA_ARGS__);
void getKPIUE(extended_kpi_ue* kpiStructure);
#endif
......@@ -36,8 +36,6 @@
#include "defs_nr_common.h"
#include "CODING/nrPolar_tools/nr_polar_pbch_defs.h"
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
......
......@@ -139,7 +139,7 @@ typedef struct TDD_UL_DL_configCommon_s {
struct TDD_UL_DL_configCommon_s *p_next;
} TDD_UL_DL_configCommon_t;
typedef struct {
typedef struct TDD_UL_DL_SlotConfig_s {
/// \ Identifies a slot within a dl-UL-TransmissionPeriodicity (given in tdd-UL-DL-configurationCommon)
uint16_t slotIndex;
/// \ The direction (downlink or uplink) for the symbols in this slot. "allDownlink" indicates that all symbols in this slot are used
......@@ -154,7 +154,7 @@ typedef struct {
/// Corresponds to L1 parameter 'number-of-UL-symbols-dedicated' (see 38.211, section FFS_Section)
uint16_t nrofUplinkSymbols;
/// \ for setting a sequence
struct TDD_UL_DL_SlotConfig_t *p_next_TDD_UL_DL_SlotConfig;
struct TDD_UL_DL_SlotConfig_s *p_next_TDD_UL_DL_SlotConfig;
} TDD_UL_DL_SlotConfig_t;
/***********************************************************************
......
......@@ -221,7 +221,7 @@ void add_tdd_dedicated_configuration_nr(NR_DL_FRAME_PARMS *frame_parms, int slot
if (next == 0) {
frame_parms->p_TDD_UL_DL_ConfigDedicated = p_TDD_UL_DL_ConfigDedicated;
} else {
p_previous_TDD_UL_DL_ConfigDedicated->p_next_TDD_UL_DL_SlotConfig = (struct TDD_UL_DL_SlotConfig_t *)p_TDD_UL_DL_ConfigDedicated;
p_previous_TDD_UL_DL_ConfigDedicated->p_next_TDD_UL_DL_SlotConfig = (TDD_UL_DL_SlotConfig_t *)p_TDD_UL_DL_ConfigDedicated;
}
p_TDD_UL_DL_ConfigDedicated->slotIndex = slotIndex;
......
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