NR UE & gNB imscope.
A new phy scope based on ImGui and ImPlot. This scope uses a different concurrency model than previous scopes. The PHY thread writing the data first checks if the data is ready to be written. If its not, nothing is copied. The GUI thread reads data if available and marks it ready to write. This makes sure that the PHY threads are not busy copying data that would never be displayed. Some of the scopes also have a freeze functionality that further limit the amount of data that needs to be copied from PHY threads. If a scope is "frozen" it still allows the user to explore the data using plots zoom/pan functions but doesn't cause PHY threads to perform extra writes on the displayed data. A compile option was added to enable/disable the scope. Use cmake -DENABLE_IMSCOPE=ON to enable the scope. Update CXX standard to 17; it is required by some libraries (e.g., dear imgui). The oldest gcc version in use by a distribution supported is Ubuntu 20, which has gcc 9.4 with c++17 support.
This commit is contained in:
@@ -70,7 +70,10 @@ enum scopeDataType {
|
||||
psbchDlChEstimateTime,
|
||||
psbchLlr,
|
||||
psbchRxdataF_comp,
|
||||
MAX_SCOPE_TYPES
|
||||
MAX_SCOPE_TYPES,
|
||||
gNBPuschRxIq = MAX_SCOPE_TYPES,
|
||||
gNBPuschLlr,
|
||||
EXTRA_SCOPE_TYPES
|
||||
};
|
||||
|
||||
enum PlotTypeGnbIf {
|
||||
@@ -87,34 +90,70 @@ typedef struct {
|
||||
int lineSz;
|
||||
} scopeGraphData_t;
|
||||
|
||||
typedef struct {
|
||||
int slot;
|
||||
int frame;
|
||||
} metadata;
|
||||
|
||||
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);
|
||||
void (*copyData)(void *, enum scopeDataType, void *data, int elementSz, int colSz, int lineSz, int offset, metadata *meta);
|
||||
pthread_mutex_t copyDataMutex;
|
||||
scopeGraphData_t *copyDataBufs[MAX_SCOPE_TYPES][COPIES_MEM];
|
||||
int copyDataBufsIdx[MAX_SCOPE_TYPES];
|
||||
void (*scopeUpdater)(enum PlotTypeGnbIf plotType, int numElements);
|
||||
bool (*tryLockScopeData)(enum scopeDataType type, int elementSz, int colSz, int lineSz, metadata *meta);
|
||||
void (*copyDataUnsafeWithOffset)(enum scopeDataType type, void *dataIn, size_t size, size_t offset, int copy_index);
|
||||
void (*unlockScopeData)(enum scopeDataType type);
|
||||
} scopeData_t;
|
||||
|
||||
int load_softscope(char *exectype, void *initarg);
|
||||
int end_forms(void) ;
|
||||
int copyDataMutexInit(scopeData_t *);
|
||||
void copyData(void *, enum scopeDataType type, void *dataIn, int elementSz, int colSz, int lineSz, int offset);
|
||||
void copyData(void *, enum scopeDataType type, void *dataIn, int elementSz, int colSz, int lineSz, int offset, metadata *meta);
|
||||
|
||||
#define UEscopeCopyWithMetadata(ue, type, ...) \
|
||||
if (ue->scopeData) { \
|
||||
((scopeData_t *)ue->scopeData)->copyData((scopeData_t *)ue->scopeData, type, ##__VA_ARGS__); \
|
||||
}
|
||||
#define UEscopeCopy(ue, type, ...) \
|
||||
if (ue->scopeData) \
|
||||
((scopeData_t *)ue->scopeData)->copyData((scopeData_t *)ue->scopeData, type, ##__VA_ARGS__);
|
||||
if (ue->scopeData) { \
|
||||
metadata mt = {.slot = -1, .frame = -1}; \
|
||||
((scopeData_t *)ue->scopeData)->copyData((scopeData_t *)ue->scopeData, type, ##__VA_ARGS__, &mt); \
|
||||
}
|
||||
#define gNBscopeCopyWithMetadata(gnb, type, ...) \
|
||||
if (gnb->scopeData) { \
|
||||
((scopeData_t *)gnb->scopeData)->copyData((scopeData_t *)gNB->scopeData, type, ##__VA_ARGS__); \
|
||||
}
|
||||
#define gNBscopeCopy(gnb, type, ...) \
|
||||
if (gnb->scopeData) \
|
||||
((scopeData_t *)gnb->scopeData)->copyData((scopeData_t *)gNB->scopeData, type, ##__VA_ARGS__);
|
||||
if (gnb->scopeData) { \
|
||||
metadata mt = {.slot = -1, .frame = -1}; \
|
||||
((scopeData_t *)gnb->scopeData)->copyData((scopeData_t *)gNB->scopeData, type, ##__VA_ARGS__, &mt); \
|
||||
}
|
||||
#define GnbScopeUpdate(gnb, type, numElt) \
|
||||
if (gnb->scopeData) \
|
||||
((scopeData_t *)gnb->scopeData)->scopeUpdater(type, numElt);
|
||||
|
||||
#define gNBTryLockScopeData(gnb, type, ...) \
|
||||
gnb->scopeData && ((scopeData_t *)gnb->scopeData)->tryLockScopeData \
|
||||
&& ((scopeData_t *)gnb->scopeData)->tryLockScopeData(type, ##__VA_ARGS__)
|
||||
|
||||
#define gNBscopeCopyUnsafe(gnb, type, ...) \
|
||||
scopeData_t *scope_data = (scopeData_t *)gnb->scopeData; \
|
||||
if (scope_data && scope_data->copyDataUnsafeWithOffset) { \
|
||||
scope_data->copyDataUnsafeWithOffset(type, ##__VA_ARGS__); \
|
||||
}
|
||||
|
||||
#define gNBunlockScopeData(gnb, type) \
|
||||
scopeData_t *scope_data = (scopeData_t *)gnb->scopeData; \
|
||||
if (scope_data && scope_data->unlockScopeData) { \
|
||||
scope_data->unlockScopeData(type); \
|
||||
}
|
||||
|
||||
extended_kpi_ue* getKPIUE();
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user