Merge remote-tracking branch 'origin/imscope-td-plot' into integration_2024_w40b

This commit is contained in:
Jaroslava Fiedlerova
2024-10-04 07:52:36 +02:00
6 changed files with 57 additions and 8 deletions
+42 -2
View File
@@ -279,8 +279,17 @@ class IQHist {
}
} else if (plot_type == 1) {
if (ImPlot::BeginPlot(label.c_str(), {(float)ImGui::GetWindowWidth() * 0.3f, (float)ImGui::GetWindowWidth() * 0.3f})) {
// Limit the amount of data plotted with scatterplot (issue with vertices/draw call)
ImPlot::PlotScatter(label.c_str(), iq_data->real.data(), iq_data->imag.data(), std::min(16000, iq_data->len));
int points_drawn = 0;
while (points_drawn < iq_data->len) {
// Limit the amount of data plotted with PlotScatter call (issue with vertices/draw call)
int points_to_draw = std::min(iq_data->len - points_drawn, 16000);
ImPlot::SetNextMarkerStyle(ImPlotMarker_Circle, 1, IMPLOT_AUTO_COL, 1);
ImPlot::PlotScatter(label.c_str(),
iq_data->real.data() + points_drawn,
iq_data->imag.data() + points_drawn,
points_to_draw);
points_drawn += points_to_draw;
}
ImPlot::EndPlot();
}
} else if (plot_type == 2) {
@@ -480,6 +489,26 @@ void ShowUeScope(PHY_VARS_NR_UE *ue, float t)
pdsch_iq_hist->Draw(iq_data, t, new_data);
ImGui::TreePop();
}
if (ImGui::TreeNode("Time domain samples")) {
static auto iq_data = new IQData();
static auto time_domain_iq = new IQHist("Time domain samples");
bool new_data = false;
if (time_domain_iq->ShouldReadData()) {
new_data = iq_data->TryCollect(&scope_array[ueTimeDomainSamples], t, time_domain_iq->GetEpsilon());
}
time_domain_iq->Draw(iq_data, t, new_data);
ImGui::TreePop();
}
if (ImGui::TreeNode("Time domain samples - before sync")) {
static auto iq_data = new IQData();
static auto time_domain_iq = new IQHist("Time domain samples - before sync");
bool new_data = false;
if (time_domain_iq->ShouldReadData()) {
new_data = iq_data->TryCollect(&scope_array[ueTimeDomainSamplesBeforeSync], t, time_domain_iq->GetEpsilon());
}
time_domain_iq->Draw(iq_data, t, new_data);
ImGui::TreePop();
}
if (ImGui::TreeNode("Broadcast channel")) {
ImGui::Text("RSRP %d", ue->measurements.ssb_rsrp_dBm[ue->frame_parms.ssb_index]);
if (ImGui::TreeNode("IQ")) {
@@ -552,6 +581,16 @@ void ShowGnbScope(PHY_VARS_gNB *gNB, float t)
pusch_llr_plot->Draw(t, gNBPuschLlr, "PUSCH LLR");
ImGui::TreePop();
}
if (ImGui::TreeNode("Time domain samples")) {
static auto iq_data = new IQData();
static auto time_domain_iq = new IQHist("Time domain samples");
bool new_data = false;
if (time_domain_iq->ShouldReadData()) {
new_data = iq_data->TryCollect(&scope_array[gNbTimeDomainSamples], t, time_domain_iq->GetEpsilon());
}
time_domain_iq->Draw(iq_data, t, new_data);
ImGui::TreePop();
}
}
void *imscope_thread(void *data_void_ptr)
@@ -722,6 +761,7 @@ extern "C" void imscope_autoinit(void *dataptr)
scope->copyDataUnsafeWithOffset = copyDataUnsafeWithOffset;
scope->unlockScopeData = unlockScopeData;
scope_params->gNB->scopeData = scope;
scope_params->ru->scopeData = scope;
} else {
PHY_VARS_NR_UE *ue = (PHY_VARS_NR_UE *)dataptr;
scopeData_t *scope = (scopeData_t *)calloc(1, sizeof(scopeData_t));
+5 -2
View File
@@ -73,6 +73,9 @@ enum scopeDataType {
MAX_SCOPE_TYPES,
gNBPuschRxIq = MAX_SCOPE_TYPES,
gNBPuschLlr,
ueTimeDomainSamples,
ueTimeDomainSamplesBeforeSync,
gNbTimeDomainSamples,
EXTRA_SCOPE_TYPES
};
@@ -127,12 +130,12 @@ void copyData(void *, enum scopeDataType type, void *dataIn, int elementSz, int
}
#define gNBscopeCopyWithMetadata(gnb, type, ...) \
if (gnb->scopeData) { \
((scopeData_t *)gnb->scopeData)->copyData((scopeData_t *)gNB->scopeData, type, ##__VA_ARGS__); \
((scopeData_t *)gnb->scopeData)->copyData((scopeData_t *)gnb->scopeData, type, ##__VA_ARGS__); \
}
#define gNBscopeCopy(gnb, type, ...) \
if (gnb->scopeData) { \
metadata mt = {.slot = -1, .frame = -1}; \
((scopeData_t *)gnb->scopeData)->copyData((scopeData_t *)gNB->scopeData, type, ##__VA_ARGS__, &mt); \
((scopeData_t *)gnb->scopeData)->copyData((scopeData_t *)gnb->scopeData, type, ##__VA_ARGS__, &mt); \
}
#define GnbScopeUpdate(gnb, type, numElt) \
if (gnb->scopeData) \
+2 -1
View File
@@ -661,7 +661,8 @@ typedef struct RU_t_s {
/// number of cores for RU ThreadPool
int num_tpcores;
/// structure for analyzing high-level RT measurements
rt_ru_profiling_t rt_ru_profiling;
rt_ru_profiling_t rt_ru_profiling;
void* scopeData;
} RU_t;