Commit 2bd68a9a authored by Marwan Hammouda's avatar Marwan Hammouda

Some extended KPIs for gNB added

parent b7f958a8
......@@ -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,
......
......@@ -1691,7 +1691,6 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
} // half_prb
} // symb
gNBscopeCopy(gNB, pucchllr, llrs, sizeof(__m128i), 2*pucch_pdu->prb_size, pucch_pdu->nr_of_symbols);
// 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,7 +459,8 @@ 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, idftsizeidx);
UEscopeCopy(ue, pbchDlChEstimateTime, (void*)dl_ch_estimates_time, sizeof(struct complex16), ue->frame_parms.nb_antennas_rx, ue->frame_parms.ofdm_symbol_size>>3);
return(0);
}
......
......@@ -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,55 @@
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;
double blerTerm = 1.0 - (double)dl_bler;
double blockSieBits = (double)(blockSize << 3);
kpiStructure->throu = blerTerm * blockSieBits / 0.1;
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 +240,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 +260,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;
......
This diff is collapsed.
......@@ -32,13 +32,19 @@
#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 <openair2/LAYER2/NR_MAC_gNB/mac_proto.h>
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
extern RAN_CONTEXT_t RC;
}
// drop-down list UE
......@@ -90,16 +96,7 @@ public:
double *waterFallAvg;
bool isWaterFallTimeActive;
enum UEdataType {
uePdschIQ,
uePbchIQ,
uePdcchIQ,
uePdschLLR,
uePbchLLR,
uePdcchLLR,
ueWaterFallTime
};
extended_kpi_ue extendKPIUE;
protected:
void paintEvent(QPaintEvent *event);
......@@ -150,13 +147,18 @@ public:
QComboBox *parentWindow;
extended_kpi extendKPIgNB;
extended_kpi_gNB extendKPIgNB_1;
int idx_ULBLER;
extended_kpi_gNB extendKPIgNB;
NR_UE_info_t *targetUE;
QLineSeries *seriesULBLER;
QLineSeries *seriesULMCS;
QLineSeries *seriesDLBLER;
QLineSeries *seriesDLMCS;
QLineSeries *seriesULThrou;
QLineSeries *seriesDLThrou;
float ul_thr_ue, dl_thr_ue;
protected:
void paintEvent(QPaintEvent *event);
......@@ -166,12 +168,16 @@ public slots:
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();
private:
scopeData_t *p;
int indexToPlot;
int previousIndex;
};
......
......@@ -29,30 +29,52 @@
* \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 UP_BLER; // Uplink BLock Error Rate
float UP_MCS; // Uplink MCS
// Uplink BLock Error Rate
int idx_ULBLER;
float DL_BLER; // Downlink BLock Error Rate
float DL_MCS; // Downlink MCS
}extended_kpi;
typedef struct {
float UL_BLER; // Uplink BLock Error Rate
float UL_MCS; // Uplink MCS
float DL_BLER; // Downlink BLock Error Rate
float DL_MCS; // Downlink MCS
// Uplink MCS
float UL_MCS_max;
int idx_ULMCS;
// Downlink BLock Error Rate
int idx_DLBLER;
// Downlink MCS
float DL_MCS_max;
int idx_DLMCS;
// UL Throughput
float UL_Throu_max;
int idx_ULThrou;
// DL Throughput
float DL_Throu_max;
int idx_DLThrou;
}extended_kpi_gNB;
typedef struct {
int idx_BLER;
float DL_BLER;
int idx_throu;
double throu;
int idx_mcs;
uint8_t dl_mcs;
int idx_nofRBs;
uint16_t nofRBs;
}extended_kpi_ue;
typedef struct {
int *argc;
char **argv;
......@@ -61,13 +83,11 @@ typedef struct {
} scopeParms_t;
enum UEdataType {
pucchllr,
pucchRxDataF_comp,
pbchDlChEstimateTime,
pbchLlr,
pbchRxdataF_comp,
pdcchLlr,
pdcchRxdataF_comp,
pdcchLlr,
pbchRxdataF_comp,
pbchLlr,
UEdataTypeNumberOfItems
};
......@@ -77,17 +97,16 @@ typedef struct scopeData_s {
RU_t *ru;
PHY_VARS_gNB *gNB;
void *liveData;
void *liveDataUE;
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);
void (*copyDatagNB)(PHY_VARS_gNB *,enum UEdataType, void *data, int elementSz, int colSz, int lineSz);
} scopeData_t;
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__);
#define gNBscopeCopy(gNB, type, data, elementSZ, colSz, lineSz) if(gNB->scopeData) ((scopeData_t*)gNB->scopeData)->copyDatagNB(gNB, type, data, elementSZ, colSz, lineSz);
void getKPIgNB(extended_kpi_gNB* kpiStructure);
void getKPIUE(extended_kpi_ue* kpiStructure);
#endif
......@@ -538,8 +538,6 @@ void handle_nr_ul_harq(const int CC_idP,
crc_pdu->rnti);
add_tail_nr_list(&sched_ctrl->retrans_ul_harq, harq_pid);
}
printf("nofBlocks: %i, nofErrors: %i, rnti: %u \n", nofBlocks, nofErrors, crc_pdu->rnti);
}
/*
......
......@@ -42,11 +42,7 @@
#include "common/ran_context.h"
#include "executables/softmodem-common.h"
#include "openair1/PHY/TOOLS/phy_scope_interface.h"
extern RAN_CONTEXT_t RC;
static float DL_BLER = 0.0;
static float DL_MCS = 0.0;
#define MACSTATSSTRLEN 16000
......@@ -77,12 +73,6 @@ void *nrmac_stats_thread(void *arg) {
return NULL;
}
void getKPIgNB(extended_kpi_gNB* kpiStructure)
{
kpiStructure->DL_BLER = DL_BLER;
kpiStructure->DL_MCS = DL_MCS;
}
void clear_mac_stats(gNB_MAC_INST *gNB) {
UE_iterator(gNB->UE_info.list, UE) {
memset(&UE->mac_stats,0,sizeof(UE->mac_stats));
......@@ -135,8 +125,6 @@ size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, size_t strlen, bool reset
sched_ctrl->dl_bler_stats.bler,
sched_ctrl->dl_bler_stats.mcs);
DL_BLER = sched_ctrl->dl_bler_stats.bler;
DL_MCS = sched_ctrl->dl_bler_stats.mcs;
if (reset_rsrp) {
stats->num_rsrp_meas = 0;
......
......@@ -21,6 +21,8 @@ gNBs =
////////// Physical parameters:
min_rxtxtime = 6;
servingCellConfigCommon = (
{
#spCellConfigCommon
......
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