Merge remote-tracking branch 'origin/develop' into NR_UL_VRB_MAP_improv

This commit is contained in:
francescomani
2022-02-21 10:38:23 +01:00
130 changed files with 4015 additions and 1514 deletions
+8
View File
@@ -93,6 +93,14 @@ ID = GNB_PHY_PUCCH_PUSCH_IQ
DESC = gNodeB input data in the frequency domain for a slot where some PUCCH or PUSCH detection was done
GROUP = ALL:PHY:GRAPHIC:HEAVY:GNB
FORMAT = int,frame : int,slot : buffer,rxdataF
ID = GNB_PHY_UL_FREQ_CHANNEL_ESTIMATE
DESC = gNodeB channel estimation in the frequency domain
GROUP = ALL:PHY:GRAPHIC:HEAVY:GNB
FORMAT = int,gNB_ID : int,rnti : int,frame : int,subframe : int,antenna : buffer,chest_t
ID = GNB_PHY_UL_TIME_CHANNEL_ESTIMATE
DESC = gNodeB channel estimation in the time domain
GROUP = ALL:PHY:GRAPHIC:HEAVY:GNB
FORMAT = int,gNB_ID : int,rnti : int,frame : int,subframe : int,antenna : buffer,chest_t
ID = GNB_PHY_PRACH_INPUT_SIGNAL
DESC = gNodeB input data in the time domain for slots with PRACH detection
GROUP = ALL:PHY:GRAPHIC:HEAVY:GNB
+124 -7
View File
@@ -4,15 +4,28 @@
#include <pthread.h>
#include <unistd.h>
#include "database.h"
#include "event.h"
#include "handler.h"
#include "config.h"
#include "logger/logger.h"
#include "view/view.h"
#include "gui/gui.h"
#include "utils.h"
#include "openair_logo.h"
int ue_id[65536];
int next_ue_id;
typedef struct {
widget *pucch_pusch_iq_plot;
widget *ul_freq_estimate_ue_xy_plot;
widget *ul_time_estimate_ue_xy_plot;
widget *current_ue_label;
widget *current_ue_button;
widget *prev_ue_button;
widget *next_ue_button;
logger *pucch_pusch_iq_logger;
logger *ul_freq_estimate_ue_logger;
logger *ul_time_estimate_ue_logger;
} gnb_gui;
typedef struct {
@@ -21,6 +34,7 @@ typedef struct {
int nevents;
pthread_mutex_t lock;
gnb_gui *e;
int ue; /* what UE is displayed in the UE specific views */
void *database;
} gnb_data;
@@ -69,34 +83,133 @@ static void *gui_thread(void *_g)
return NULL;
}
static void gnb_main_gui(gnb_gui *e, gui *g, event_handler *h, void *database,
gnb_data *ed)
static void set_current_ue(gui *g, gnb_data *e, int ue)
{
char s[256];
sprintf(s, "[UE %d] ", ue);
label_set_text(g, e->e->current_ue_label, s);
sprintf(s, "GNB_PHY_PUCCH_PUSCH_IQ [UE %d]", ue);
xy_plot_set_title(g, e->e->pucch_pusch_iq_plot, s);
sprintf(s, "UL channel estimation in frequency domain [UE %d]", ue);
xy_plot_set_title(g, e->e->ul_freq_estimate_ue_xy_plot, s);
sprintf(s, "UL channel estimation in time domain [UE %d]", ue);
xy_plot_set_title(g, e->e->ul_time_estimate_ue_xy_plot, s);
}
void reset_ue_ids(void)
{
int i;
printf("resetting known UEs\n");
for (i = 0; i < 65536; i++) ue_id[i] = -1;
ue_id[65535] = 0;
ue_id[65534] = 1; /* HACK: to be removed */
ue_id[2] = 2; /* this supposes RA RNTI = 2, very openair specific */
next_ue_id = 0;
}
static void click(void *private, gui *g, char *notification, widget *w, void *notification_data)
{
int *d = notification_data;
int button = d[0];
gnb_data *ed = private;
gnb_gui *e = ed->e;
int ue = ed->ue;
int do_reset = 0;
if (button != 1) return;
if (w == e->prev_ue_button) { ue--; if (ue < 0) ue = 0; }
if (w == e->next_ue_button) ue++;
if (w == e->current_ue_button) do_reset = 1;
if (pthread_mutex_lock(&ed->lock)) abort();
if (do_reset) reset_ue_ids();
if (ue != ed->ue) {
set_current_ue(g, ed, ue);
ed->ue = ue;
}
if (pthread_mutex_unlock(&ed->lock)) abort();
}
static void gnb_main_gui(gnb_gui *e, gui *g, event_handler *h, void *database, gnb_data *ed)
{
widget *main_window;
widget *top_container;
widget *line;
widget *col;
widget *logo;
widget *w;
widget *w2;
logger *l;
view *v;
main_window = new_toplevel_window(g, 500, 300, "gNB tracer");
main_window = new_toplevel_window(g, 1500, 230, "gNB tracer");
top_container = new_container(g, VERTICAL);
widget_add_child(g, main_window, top_container, -1);
line = new_container(g, HORIZONTAL);
widget_add_child(g, top_container, line, -1);
logo = new_image(g, openair_logo_png, openair_logo_png_len);
/* logo + prev/next UE buttons */
col = new_container(g, VERTICAL);
widget_add_child(g, col, logo, -1);
w = new_container(g, HORIZONTAL);
widget_add_child(g, col, w, -1);
w2 = new_label(g, "");
widget_add_child(g, w, w2, -1);
label_set_clickable(g, w2, 1);
e->current_ue_button = w2;
e->current_ue_label = w2;
w2 = new_label(g, " [prev UE] ");
widget_add_child(g, w, w2, -1);
label_set_clickable(g, w2, 1);
e->prev_ue_button = w2;
w2 = new_label(g, " [next UE] ");
widget_add_child(g, w, w2, -1);
label_set_clickable(g, w2, 1);
e->next_ue_button = w2;
widget_add_child(g, line, col, -1);
/* PUCCH/PUSCH IQ data */
w = new_xy_plot(g, 55, 55, "", 50);
w = new_xy_plot(g, 200, 200, "", 10);
e->pucch_pusch_iq_plot = w;
widget_add_child(g, line, w, -1);
xy_plot_set_range(g, w, -1000, 1000, -1000, 1000);
xy_plot_set_title(g, w, "rxdataF");
l = new_iqlog_full(h, database, "GNB_PHY_PUCCH_PUSCH_IQ", "rxdataF");
v = new_view_xy(300*12*14,10,g,w,new_color(g,"#000"),XY_FORCED_MODE);
logger_add_view(l, v);
e->pucch_pusch_iq_logger = l;
/* UL channel estimation in frequency domain */
w = new_xy_plot(g, 490, 200, "", 50);
e->ul_freq_estimate_ue_xy_plot = w;
widget_add_child(g, line, w, -1);
xy_plot_set_range(g, w, 0, 2048, -10, 80);
l = new_framelog(h, database, "GNB_PHY_UL_FREQ_CHANNEL_ESTIMATE", "subframe", "chest_t");
framelog_set_update_only_at_sf9(l, 0);
v = new_view_xy(2048, 10, g, w, new_color(g, "#0c0c72"), XY_LOOP_MODE);
logger_add_view(l, v);
e->ul_freq_estimate_ue_logger = l;
/* UL channel estimation in time domain */
w = new_xy_plot(g, 490, 200, "", 50);
e->ul_time_estimate_ue_xy_plot = w;
widget_add_child(g, line, w, -1);
xy_plot_set_range(g, w, 0, 2048, -10, 80);
l = new_framelog(h, database, "GNB_PHY_UL_TIME_CHANNEL_ESTIMATE", "subframe", "chest_t");
framelog_set_update_only_at_sf9(l, 0);
v = new_view_xy(2048, 10, g, w, new_color(g, "#0c0c72"), XY_LOOP_MODE);
logger_add_view(l, v);
e->ul_time_estimate_ue_logger = l;
set_current_ue(g, ed, ed->ue);
register_notifier(g, "click", e->current_ue_button, click, ed);
register_notifier(g, "click", e->prev_ue_button, click, ed);
register_notifier(g, "click", e->next_ue_button, click, ed);
}
int main(int n, char **v)
@@ -136,7 +249,11 @@ int main(int n, char **v)
h = new_handler(database);
on_off(database, "GNB_PHY_PUCCH_PUSCH_IQ", is_on, 1);
on_off(database, "GNB_PHY_UL_FREQ_CHANNEL_ESTIMATE", is_on, 1);
on_off(database, "GNB_PHY_UL_TIME_CHANNEL_ESTIMATE", is_on, 1);
gnb_data.ue = 0;
gnb_data.e = &eg;
gnb_data.database = database;
gnb_data.socket = -1;
gnb_data.is_on = is_on;
-24
View File
@@ -362,16 +362,6 @@ void nr_dl_retx(void *_d, event e)
e.e[d->nr_dl_retx_data].bsize, NO_PREAMBLE);
}
void nr_dl_retx(void *_d, event e)
{
ev_data *d = _d;
trace_nr(d, NR_DIRECTION_DOWNLINK, NR_C_RNTI, e.e[d->nr_dl_retx_rnti].i,
e.e[d->nr_dl_retx_frame].i, e.e[d->nr_dl_retx_slot].i,
e.e[d->nr_dl_retx_data].b, e.e[d->nr_dl_retx_data].bsize,
NO_PREAMBLE);
}
void nr_mib(void *_d, event e)
{
ev_data *d = _d;
@@ -579,20 +569,6 @@ void setup_data(ev_data *d, void *database, int ul_id, int dl_id, int mib_id,
d->nr_dl_retx_data == -1)
goto error;
/* NR dl retx: rnti, frame, slot, data */
f = get_format(database, nr_dl_retx_id);
for (i = 0; i < f.count; i++) {
G("rnti", "int", d->nr_dl_retx_rnti);
G("frame", "int", d->nr_dl_retx_frame);
G("slot", "int", d->nr_dl_retx_slot);
G("data", "buffer", d->nr_dl_retx_data);
}
if (d->nr_dl_retx_rnti == -1 || d->nr_dl_retx_frame == -1 ||
d->nr_dl_retx_slot == -1 || d->nr_dl_retx_data == -1)
goto error;
/* NR MIB: frame, slot, data */
f = get_format(database, nr_mib_id);
+1
View File
@@ -80,6 +80,7 @@ void SLIV2SL(int SLIV,int *S,int *L);
int get_dmrs_port(int nl, uint16_t dmrs_ports);
uint16_t SL_to_bitmap(int startSymbolIndex, int nrOfSymbols);
int get_nb_periods_per_frame(uint8_t tdd_period);
long rrc_get_max_nr_csrs(uint8_t max_rbs, long b_SRS);
#define CEILIDIV(a,b) ((a+b-1)/b)
#define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1))
@@ -106,12 +106,13 @@
{"phy_proc", &(UE->phy_proc[0]),0,RX_NB_TH},\
{"phy_proc_rx", &(UE-> phy_proc_rx[0]),0,RX_NB_TH},\
{"phy_proc_tx", &(UE->phy_proc_tx),0,1},\
{"ue_ul_indication_stats", &(UE->ue_ul_indication_stats),0,1},\
{"ofdm_mod_stats", &(UE->ofdm_mod_stats),0,1},\
{"ulsch_encoding_stats", &(UE->ulsch_encoding_stats),0,1},\
{"ulsch_modulation_stats", &(UE->ulsch_modulation_stats),0,1},\
{"ulsch_segmentation_stats", &(UE->ulsch_segmentation_stats),0,1},\
{"ulsch_rate_matching_stats", &(UE->ulsch_rate_matching_stats),0,1},\
{"ulsch_turbo_encoding_stats", &(UE->ulsch_turbo_encoding_stats),0,1},\
{"ulsch_ldpc_encoding_stats", &(UE->ulsch_ldpc_encoding_stats),0,1},\
{"ulsch_interleaving_stats", &(UE->ulsch_interleaving_stats),0,1},\
{"ulsch_multiplexing_stats", &(UE->ulsch_multiplexing_stats),0,1},\
{"generic_stat", &(UE->generic_stat),0,1},\
@@ -123,12 +124,12 @@
{"dlsch_f...timation_stats", &(UE->dlsch_freq_offset_estimation_stats),0,1},\
{"dlsch_demodulation_stats", &(UE->dlsch_demodulation_stats),0,1},\
{"dlsch_rate_unmatching_stats", &(UE->dlsch_rate_unmatching_stats),0,1},\
{"dlsch_turbo_decoding_stats", &(UE->dlsch_turbo_decoding_stats),0,1},\
{"dlsch_ldpc_decoding_stats", &(UE->dlsch_ldpc_decoding_stats),0,1},\
{"dlsch_deinterleaving_stats", &(UE->dlsch_deinterleaving_stats),0,1},\
{"dlsch_llr_stats", &(UE->dlsch_llr_stats),0,1},\
{"dlsch_unscrambling_stats", &(UE->dlsch_unscrambling_stats),0,1},\
{"dlsch_rate_matching_stats", &(UE->dlsch_rate_matching_stats),0,1},\
{"dlsch_turbo_encoding_stats", &(UE->dlsch_turbo_encoding_stats),0,1},\
{"dlsch_ldpc_encoding_stats", &(UE->dlsch_ldpc_encoding_stats),0,1},\
{"dlsch_interleaving_stats", &(UE->dlsch_interleaving_stats),0,1},\
{"dlsch_tc_init_stats", &(UE->dlsch_tc_init_stats),0,1},\
{"dlsch_tc_alpha_stats", &(UE->dlsch_tc_alpha_stats),0,1},\
@@ -146,6 +147,7 @@
{"ue_front_end_stat", &(UE->ue_front_end_stat[0]),0,RX_NB_TH},\
{"ue_front_end_per_slot_stat", &(UE->ue_front_end_per_slot_stat[0][0]),0,RX_NB_TH,LTE_SLOTS_PER_SUBFRAME},\
{"pdcch_procedures_stat", &(UE->pdcch_procedures_stat[0]),0,RX_NB_TH},\
{"rx_pdsch_stats", &(UE->rx_pdsch_stats), 0, 1}, \
{"pdsch_procedures_stat", &(UE->pdsch_procedures_stat[0]),0,RX_NB_TH},\
{"pdsch_procedures_per_slot_stat", &(UE->pdsch_procedures_per_slot_stat[0][0]),0,RX_NB_TH,LTE_SLOTS_PER_SUBFRAME},\
{"dlsch_procedures_stat", &(UE->dlsch_procedures_stat[0]),0,RX_NB_TH},\