make common code for data copy to the scope

This commit is contained in:
Laurent THOMAS
2023-07-19 10:19:25 +02:00
parent fe61354173
commit 37752af2cf
10 changed files with 87 additions and 77 deletions
+24 -14
View File
@@ -57,7 +57,7 @@ typedef struct {
PHY_VARS_gNB *gNB;
} scopeParms_t;
enum UEdataType {
enum scopeDataType {
pbchDlChEstimateTime,
pbchLlr,
pbchRxdataF_comp,
@@ -66,18 +66,11 @@ enum UEdataType {
pdschLlr,
pdschRxdataF_comp,
commonRxdataF,
UEdataTypeNumberOfItems
gNBRxdataF,
MAX_SCOPE_TYPES
};
typedef struct scopeData_s {
int *argc;
char **argv;
RU_t *ru;
PHY_VARS_gNB *gNB;
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);
} scopeData_t;
#define COPIES_MEM 4
typedef struct {
int dataSize;
@@ -86,12 +79,29 @@ typedef struct {
int lineSz;
} scopeGraphData_t;
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);
pthread_mutex_t copyDataMutex;
scopeGraphData_t *copyDataBufs[MAX_SCOPE_TYPES][COPIES_MEM];
int copyDataBufsIdx[MAX_SCOPE_TYPES];
} scopeData_t;
int load_softscope(char *exectype, void *initarg);
int end_forms(void) ;
int UEcopyDataMutexInit(void);
void UEcopyData(PHY_VARS_NR_UE *ue, enum UEdataType type, void *dataIn, int elementSz, int colSz, int lineSz);
int copyDataMutexInit(scopeData_t *);
void copyData(void *, enum scopeDataType type, void *dataIn, int elementSz, int colSz, int lineSz, int offset);
#define UEscopeCopy(ue, type, ...) if(ue->scopeData) ((scopeData_t*)ue->scopeData)->copyData(ue, type, ##__VA_ARGS__);
#define UEscopeCopy(ue, type, ...) \
if (ue->scopeData) \
((scopeData_t *)ue->scopeData)->copyData((scopeData_t *)ue->scopeData, type, ##__VA_ARGS__);
#define gNBscopeCopy(gnb, type, ...) \
if (gnb->scopeData) \
((scopeData_t *)gnb->scopeData)->copyData((scopeData_t *)gNB->scopeData, type, ##__VA_ARGS__);
extended_kpi_ue* getKPIUE();