* INTC Contribution to the O-RAN F Release for O-DU Low
[o-du/phy.git] / fhi_lib / app / src / app_bbu_main.c
1 /******************************************************************************
2 *
3 *   Copyright (c) 2020 Intel.
4 *
5 *   Licensed under the Apache License, Version 2.0 (the "License");
6 *   you may not use this file except in compliance with the License.
7 *   You may obtain a copy of the License at
8 *
9 *       http://www.apache.org/licenses/LICENSE-2.0
10 *
11 *   Unless required by applicable law or agreed to in writing, software
12 *   distributed under the License is distributed on an "AS IS" BASIS,
13 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 *   See the License for the specific language governing permissions and
15 *   limitations under the License.
16 *
17 *******************************************************************************/
18
19 /**
20  * @brief This module provides implementation of BBU tasks for sample app
21  * @file app_bbu_main.c
22  * @ingroup xran
23  * @author Intel Corporation
24  *
25  **/
26
27 #define _GNU_SOURCE
28 #include <sched.h>
29 #include <memory.h>
30 #include <stdio.h>
31 #include <stdlib.h>
32 #include <unistd.h>
33 #include <assert.h>
34 #include <pthread.h>
35 #include <time.h>
36
37
38 #include "app_bbu_pool.h"
39 #include "app_io_fh_xran.h"
40 #include "xran_mlog_task_id.h"
41
42 /**
43   * @file   app_bbu_main.c
44   * @brief  example pipeline code to use Enhanced BBUPool Framework
45 */
46
47 uint32_t gRunCount = 0;
48 volatile uint32_t nStopFlag = 1;
49 int32_t gQueueCtxNum = 1;
50
51 int32_t nSplitNumCell[EBBU_POOL_MAX_TEST_CELL];
52
53 int32_t nTestCell = 0;
54 int32_t nTestCore = 0;
55 volatile uint64_t ttistart = 0;
56 int32_t dl_ul_count, dl_count, ul_count;
57
58 uint32_t gMaxSlotNum[MAX_PHY_INSTANCES];
59 uint32_t gNumDLCtx[MAX_PHY_INSTANCES];
60 uint32_t gNumULCtx[MAX_PHY_INSTANCES];
61 uint32_t gNumDLBufferCtx[MAX_PHY_INSTANCES];
62 uint32_t gNumULBufferCtx[MAX_PHY_INSTANCES];
63 uint32_t gDLProcAdvance[MAX_PHY_INSTANCES];
64 int32_t gULProcAdvance[MAX_PHY_INSTANCES];
65
66
67 #define EX_FUNC_NUM 9
68 int32_t exGenDlFunc[EX_FUNC_NUM] =
69 {
70     DL_CONFIG,
71     DL_PDSCH_SCRM,
72 };
73 int32_t exGenUlFunc[EX_FUNC_NUM] =
74 {
75     UL_CONFIG,
76     UL_IQ_DECOMP2,
77     UL_IQ_DECOMP6,
78     UL_IQ_DECOMP11,
79     UL_IQ_DECOMP13,
80     UL_PRACH,
81     UL_PUSCH_TB
82 };
83
84 int32_t exGenAllFunc[EX_FUNC_NUM] =
85 {
86     DL_CONFIG,
87     UL_CONFIG,
88     DL_PDSCH_SCRM,
89     UL_IQ_DECOMP2,
90     UL_IQ_DECOMP6,
91     UL_IQ_DECOMP11,
92     UL_IQ_DECOMP13,
93     UL_PRACH,
94     UL_PUSCH_TB
95 };
96
97 peBbuPoolCfgVarsStruct pCfg;
98 pthread_t tCtrlThread;
99 eBbuPoolHandler pHandler = NULL;
100 clock_t tStart, tEnd;
101 uint32_t ttiCell[EBBU_POOL_MAX_TEST_CELL] = {0};
102 uint64_t ttiCountCell[EBBU_POOL_MAX_TEST_CELL] = {0UL};
103 uint32_t frameFormatCell[EBBU_POOL_MAX_TEST_CELL] = {0};
104 uint64_t tTTI = 0;
105
106
107 eBbuPoolHandler app_get_ebbu_pool_handler(void)
108 {
109     return pHandler;
110 }
111
112
113 int32_t
114 app_bbu_dl_tti_call_back(void * param)
115 {
116     int32_t ret = 0;
117     uint64_t t1 = MLogTick();
118     int32_t iCell = 0;
119     int32_t nCtx[EBBU_POOL_MAX_TEST_CELL] = {0}, iExFunc = 0, eventId = 0;
120     int32_t *exGenFuncDl = NULL, *exGenFuncUl = NULL;
121     int32_t nFuncNumDl = 0, nFuncNumUl = 0;
122     uint8_t Numerlogy = app_io_xran_fh_config[0].frame_conf.nNumerology;
123     uint8_t nNrOfSlotInSf = 1<<Numerlogy;
124     int32_t sfIdx = app_io_xran_sfidx_get(nNrOfSlotInSf);
125     uint64_t t = MLogTick();
126     uint32_t mlogVars[10], mlogVarsCnt = 0;
127
128     exGenFuncDl = exGenDlFunc;
129     nFuncNumDl = 2;
130     exGenFuncUl = exGenUlFunc;
131     nFuncNumUl = 7;
132
133     mlogVars[mlogVarsCnt++] = 0x99999999;
134     mlogVars[mlogVarsCnt++] = sfIdx % gMaxSlotNum[0];
135     MLogAddVariables(mlogVarsCnt, mlogVars, t);
136
137     for(iCell = 0; iCell < nTestCell ; iCell ++)
138     {
139         //check is it a tti for this cell
140         if(sfIdx % ttiCell[iCell] == 0)
141         {
142             ttistart = MLogTick();
143             dl_ul_count = nTestCell;
144             dl_ul_count += nTestCell;
145             ttiCountCell[iCell] = sfIdx;
146             nCtx[iCell] = ttiCountCell[iCell] % MAX_TEST_CTX;
147
148             event_chain_reset(&gEventChain[iCell][nCtx[iCell]]);
149
150             //if(nD2USwitch[frameFormatCell[iCell]][ttiCountCell[iCell]%EBBU_POOL_TDD_PERIOD] & EBBU_POOL_TEST_DL)
151             {
152                 //printf("\ncell %d dl", iCell);
153                 for(iExFunc = 0; iExFunc < nFuncNumDl; iExFunc ++)
154                 {
155                     eventId = exGenFuncDl[iExFunc];
156                     ret = test_func_gen(pHandler, iCell, ttiCountCell[iCell], eventId);
157                 }
158             }
159
160             //if(nD2USwitch[frameFormatCell[iCell]][ttiCountCell[iCell]%EBBU_POOL_TDD_PERIOD] & EBBU_POOL_TEST_UL)
161             {
162                 //printf("\ncell %d ul", iCell);
163                 for(iExFunc = 0; iExFunc < nFuncNumUl; iExFunc ++)
164                 {
165                     eventId = exGenFuncUl[iExFunc];
166                     ret = test_func_gen(pHandler, iCell, ttiCountCell[iCell], eventId);
167                 }
168             }
169         }
170
171         if(EBBUPOOL_ERROR == ret)
172         {
173             printf("\nFail to send cell %d, sf %lu, tsc %llu", iCell, ttiCountCell[iCell], ebbu_pool_tick()/tTTI/2);
174         }
175     }
176     MLogTask(PID_GNB_PROC_TIMING, t1, MLogTick());
177     return 0;
178 }
179
180 int32_t app_bbu_init(int argc, char *argv[], char cfgName[512], UsecaseConfig* p_use_cfg,  RuntimeConfig* p_o_xu_cfg[], uint64_t nActiveCoreMask[EBBUPOOL_MAX_CORE_MASK])
181 {
182     tStart = clock();
183     uint32_t nFh_cell = 0;
184     int32_t i;
185
186     ebbu_pool_cfg_set_cfg_filename(argc, argv, cfgName);
187
188     ebbu_pool_cfg_init_from_xml();
189     pCfg = ebbu_pool_cfg_get_ctx();
190
191     nTestCell = pCfg->testCellNum;
192
193     for (i = 0; i < p_use_cfg->oXuNum; i++)
194         nFh_cell += p_o_xu_cfg[i]->numCC;
195
196     if (nFh_cell != nTestCell) {
197         rte_panic("WARNING: miss match between BBU Cells (%d) and O-RAN FH Cells (%d)", nTestCell, nFh_cell);
198     }
199
200     if(nTestCell > EBBU_POOL_MAX_TEST_CELL || nTestCell <= 0)
201     {
202         printf("Wrong cell num %d\n",nTestCell);
203         nTestCell = 0;
204     }
205     nTestCore = pCfg->testCoreNum;
206     if(nTestCore > EBBU_POOL_MAX_TEST_CORE || nTestCore <= 0)
207     {
208         printf("Wrong core num %d\n",nTestCore);
209         nTestCore = 0;
210     }
211
212     gRunCount = 0;
213
214     printf("Test cell %d, test total core num %d, test slots %d\n", nTestCell, nTestCore, gRunCount);
215
216     // Step 1: create Framework handler
217     ebbu_pool_create_handler(&pHandler, 1, pCfg->mainThreadCoreId);
218     if(NULL == pHandler)
219     {
220         printf("\nFail to init Framework!");
221         exit(-1);
222     }
223
224     // Step 2: create priority queues
225     // Assume 3 queues
226     uint32_t nPrioQueue = pCfg->queueNum;
227     uint32_t nQueueSize = pCfg->queueDepth;
228     uint32_t pPrioQueueSize[8] = {nQueueSize, nQueueSize, nQueueSize, nQueueSize,nQueueSize, nQueueSize, nQueueSize, nQueueSize};
229     QueueConfigStruct sQueueConfig;
230     sQueueConfig.pQueueDepth = pPrioQueueSize;
231     sQueueConfig.nPriQueueNum = nPrioQueue;
232     sQueueConfig.nPriQueueCtxNum = pCfg->ququeCtxNum;
233     sQueueConfig.nPriQueueCtxMaxFetch = pCfg->ququeCtxNum;
234
235     ebbu_pool_create_queues(pHandler, sQueueConfig);
236
237     ebbu_pool_queue_ctx_set_threshold(pHandler, 2*nTestCell);
238
239     // Step 3: create one report for Framework
240     ReportCfg sReport;
241     sReport.nEventHoldNum = 2000;
242     sReport.pHandler = (void *)pHandler;
243     ebbu_pool_create_report(sReport);
244
245     // Step 4: start control thread
246    // pthread_create(&tCtrlThread, NULL, controlThread, (void *)pHandler);
247
248     peBbuPoolCfgVarsStruct pCfg = ebbu_pool_cfg_get_ctx();
249     int32_t iCell = 0;
250     int32_t iCtx = 0;
251     uint32_t xran_timer = (1000/(1 << p_o_xu_cfg[0]->mu_number)); /* base on O-RU 0 */
252
253     printf("xran_timer for TTI [%d] us\n", xran_timer);
254     // Init base timing as per xran_timer
255     uint64_t tStart = ebbu_pool_tick();
256     usleep(xran_timer);
257     tTTI = ebbu_pool_tick() - tStart;
258
259     // cell specific TTI init
260     // create cell and create consumer thread
261     // set events num per cell
262     for(iCell = 0; iCell < nTestCell; iCell ++)
263     {
264         ttiCell[iCell] = pCfg->sTestCell[iCell].tti/xran_timer;
265         printf("\nttiCell[%d] %d", iCell, ttiCell[iCell]);
266
267         frameFormatCell[iCell] = pCfg->sTestCell[iCell].frameFormat;
268         if(frameFormatCell[iCell] >= EBBU_POOL_MAX_FRAME_FORMAT)
269             frameFormatCell[iCell] = 0;
270
271         for(iCtx = 0; iCtx < MAX_TEST_CTX; iCtx ++)
272         {
273             event_chain_gen(&gEventChain[iCell][iCtx]);
274         }
275         nSplitNumCell[iCell] = 1;//((pCfg->sTestCell[iCell].eventPerTti)-11)/18; //current event chain has 29 events, 19 of them can be split
276         printf("\nnSplitNumCell[%d] %d", iCell, nSplitNumCell[iCell]);
277         if(nSplitNumCell[iCell] > MAX_TEST_SPLIT_NUM)
278             nSplitNumCell[iCell] = MAX_TEST_SPLIT_NUM;
279
280     }
281     test_buffer_create();
282
283     // add consumer thread
284
285     /*int32_t corePool[EBBU_POOL_MAX_TEST_CORE] = {4,24,5,25,6,26,7,27,
286                                   8,28,9,29,10,30,11,31,
287                                   12,32,13,33,14,34,15,35,
288                                   16,36,17,37,18,38,19,39,
289                                   2,22,3,23};
290     */
291
292     int32_t iCore = 0;
293     uint64_t nMask0 = 0UL, nMask1 = 0UL;
294     uint32_t iCoreIdx = 0;
295     uint64_t nCoreMask[EBBUPOOL_MAX_CORE_MASK];
296
297     for(; iCore < nTestCore; iCore ++)
298     {
299         iCoreIdx = pCfg->testCoreList[iCore];
300         if(iCoreIdx < 64)
301             nMask0 |= 1UL << iCoreIdx;
302         else
303             nMask1 |= 1UL << iCoreIdx;
304
305     }
306     //printf("\nnStartMask %016lx\n", nStartMask);
307
308     nActiveCoreMask[0] = nCoreMask[0] = nMask0;
309     nActiveCoreMask[0] = nCoreMask[1] = nMask1;
310     nActiveCoreMask[0] = nCoreMask[2] = 0;
311     nActiveCoreMask[0] = nCoreMask[3] = 0;
312
313     ebbu_pool_consumer_set_thread_params(pHandler, 55, SCHED_FIFO, pCfg->sleepFlag);
314     ebbu_pool_consumer_set_thread_mask(pHandler, nCoreMask);
315
316     usleep(100000);
317
318     /* mMIMO with 64TRX */
319     for(iCell = 0; iCell < nTestCell; iCell ++) {
320
321         gDLProcAdvance[iCell] = DL_PROC_ADVANCE_MU1;
322         gULProcAdvance[iCell] = UL_PROC_ADVANCE_MU1;
323         gNumDLCtx[iCell] = 5;
324         gNumDLBufferCtx[iCell] = 3;
325         gNumULCtx[iCell] = 8;
326         gNumULBufferCtx[iCell] = 2;
327         gMaxSlotNum[iCell] = 10240 * (1 << p_o_xu_cfg[0]->mu_number);
328     }
329
330     return 0;
331 }
332
333 int32_t app_bbu_close(void)
334 {
335     // Close Mlog Buffer and write to File
336    // if(pCfg->mlogEnable)
337      //   MLogPrint(NULL);
338
339     // Step 5: release all the threads
340     ebbu_pool_release_threads(pHandler);
341
342     // Step 6: get report for Framework
343     int32_t testResult = ebbu_pool_status_report(pHandler);
344     // Save the test status, 0 means pass, other means fail
345     char resultString[8] = {'\0'};
346     if(testResult == 0)
347         sprintf(resultString, "PASS");
348     else
349         sprintf(resultString, "FAIL");
350
351     tEnd = clock();
352
353     char fResultName[64] = {"sample-app_bbu_pool_test_results.txt"};
354     FILE *pFile = fopen(fResultName, "a");
355     if(pFile != NULL)
356     {
357         fprintf(pFile, "sample-app test case\n");
358         fprintf(pFile, "Execution time: %.3f second\n", (double)(tEnd - tStart)/1000000);
359         fprintf(pFile, "Result: %s\n\n", resultString);
360         fclose(pFile);
361     }
362
363     // Step 7: release report for Framework
364     ebbu_pool_release_report(pHandler);
365
366     // Step 8: release all allocated queues
367     ebbu_pool_release_queues(pHandler);
368
369     // Step 9: release handler for Framework
370     ebbu_pool_release_handler(&pHandler);
371     printf("\n");
372
373     return 0;
374 }
375
376 void
377 app_io_xran_fh_bbu_rx_callback(void *pCallbackTag, xran_status_t status)
378 {
379     eBbuPoolHandler pHandler = app_get_ebbu_pool_handler();
380     uint64_t t1 = MLogTick();
381     uint32_t mlogVar[10];
382     uint32_t mlogVarCnt = 0;
383     int32_t nCellIdx;
384     int32_t nCcIdx;
385     int32_t sym, nSlotIdx, ntti;
386     uint64_t mlog_start;
387     struct xran_cb_tag *pTag = (struct xran_cb_tag *) pCallbackTag;
388     int32_t o_xu_id = pTag->oXuId;
389     struct xran_io_shared_ctrl *psIoCtrl = app_io_xran_if_ctrl_get(o_xu_id);
390     struct bbu_xran_io_if *psXranIoIf  = app_io_xran_if_get();
391     struct xran_fh_config  *pXranConf = &app_io_xran_fh_config[o_xu_id];
392     uint32_t xran_max_antenna_nr = RTE_MAX(pXranConf->neAxc, pXranConf->neAxcUl);
393     uint32_t ant_id, sym_id, idxElm;
394     struct xran_prb_map *pRbMap = NULL;
395     struct xran_prb_elm *pRbElm = NULL;
396
397     mlog_start = MLogTick();
398     nCcIdx   = pTag->cellId;
399     nCellIdx = psXranIoIf->map_cell_id2port[o_xu_id][nCcIdx];
400     nSlotIdx = pTag->slotiId; ///((status >> 16) & 0xFFFF);  /** TTI aka slotIdx */
401     sym      = pTag->symbol & 0xFF; /* sym */
402     ntti = (nSlotIdx + XRAN_N_FE_BUF_LEN-1) % XRAN_N_FE_BUF_LEN;
403
404     {
405         mlogVar[mlogVarCnt++] = 0xbcbcbcbc;
406         mlogVar[mlogVarCnt++] = o_xu_id;
407         mlogVar[mlogVarCnt++] = nCellIdx;
408         mlogVar[mlogVarCnt++] = sym;
409         mlogVar[mlogVarCnt++] = nSlotIdx;
410         mlogVar[mlogVarCnt++] = ntti;
411         //mlogVar[mlogVarCnt++] = nSlotIdx % gNumSlotPerSfn[nCellIdx];
412         //mlogVar[mlogVarCnt++] = get_slot_type(nCellIdx, nSlotIdx, SLOT_TYPE_UL);
413
414         MLogAddVariables(mlogVarCnt, mlogVar, mlog_start);
415     }
416
417     if(psIoCtrl == NULL)
418     {
419         printf("psIoCtrl NULL! o_xu_id= %d\n", o_xu_id);
420         return;
421     }
422
423     if (sym == XRAN_ONE_FOURTHS_CB_SYM) {
424         // 1/4 of slot
425         test_func_gen(pHandler, nCellIdx, nSlotIdx, SYM2_WAKE_UP);
426     } else if (sym == XRAN_HALF_CB_SYM) {
427         // First Half
428         test_func_gen(pHandler, nCellIdx, nSlotIdx, SYM6_WAKE_UP);
429     } else if (sym == XRAN_THREE_FOURTHS_CB_SYM) {
430         // 2/4 of slot
431         test_func_gen(pHandler, nCellIdx, nSlotIdx, SYM11_WAKE_UP);
432     } else if (sym == XRAN_FULL_CB_SYM) {
433         // Second Half
434         test_func_gen(pHandler, nCellIdx, nSlotIdx, SYM13_WAKE_UP);
435     } else {
436         /* error */
437         MLogTask(PID_GNB_SYM_CB, t1, MLogTick());
438
439         rte_panic("app_io_xran_fh_bbu_rx_callback: sym\n");
440         return;
441     }
442
443     if(sym == XRAN_FULL_CB_SYM)  //full slot callback only
444     {
445         for(ant_id = 0; ant_id < xran_max_antenna_nr; ant_id++) {
446             pRbMap = (struct xran_prb_map *) psIoCtrl->sFrontHaulRxPrbMapBbuIoBufCtrl[ntti][nCcIdx][ant_id].sBufferList.pBuffers->pData;
447             if(pRbMap == NULL){
448                 printf("(%d:%d:%d)pRbMap == NULL\n", nCcIdx, ntti, ant_id);
449                 exit(-1);
450             }
451             for(sym_id = 0; sym_id < XRAN_NUM_OF_SYMBOL_PER_SLOT; sym_id++) {
452                 for(idxElm = 0; idxElm < pRbMap->nPrbElm; idxElm++ ) {
453                     pRbElm = &pRbMap->prbMap[idxElm];
454                     pRbElm->nSecDesc[sym_id] = 0;
455                 }
456             }
457         }
458     }
459
460     rte_pause();
461
462     MLogTask(PCID_GNB_FH_RX_DATA_CC0+nCellIdx, mlog_start, MLogTick());
463     return;
464 }
465
466 void
467 app_io_xran_fh_bbu_rx_prach_callback(void *pCallbackTag, xran_status_t status)
468 {
469     eBbuPoolHandler pHandler = app_get_ebbu_pool_handler();
470     int32_t nCellIdx, nCcIdx;
471     int32_t sym, nSlotIdx, ntti;
472     struct xran_cb_tag *pTag = (struct xran_cb_tag *) pCallbackTag;
473     int32_t o_xu_id = pTag->oXuId;
474     uint64_t mlog_start = MLogTick();
475     uint32_t mlogVar[10];
476     struct bbu_xran_io_if *psXranIoIf  = app_io_xran_if_get();
477     struct xran_io_shared_ctrl *psIoCtrl = app_io_xran_if_ctrl_get(o_xu_id);
478     uint32_t mlogVarCnt = 0;
479
480     if(psIoCtrl == NULL || psXranIoIf == NULL)
481     {
482         printf("psIoCtrl NULL! o_xu_id= %d\n", o_xu_id);
483         return;
484     }
485
486     nCcIdx   = pTag->cellId;
487     nCellIdx = psXranIoIf->map_cell_id2port[o_xu_id][nCcIdx];
488     nSlotIdx = pTag->slotiId; ///((status >> 16) & 0xFFFF);  /** TTI aka slotIdx */
489     sym      = pTag->symbol & 0xFF; /* sym */
490     ntti = (nSlotIdx + XRAN_N_FE_BUF_LEN-1) % XRAN_N_FE_BUF_LEN;
491
492     mlogVar[mlogVarCnt++] = 0xDDDDDDDD;
493     mlogVar[mlogVarCnt++] = o_xu_id;
494     mlogVar[mlogVarCnt++] = nCellIdx;
495     mlogVar[mlogVarCnt++] = sym;
496     mlogVar[mlogVarCnt++] = nSlotIdx;
497     mlogVar[mlogVarCnt++] = ntti;
498     MLogAddVariables(mlogVarCnt, mlogVar, MLogTick());
499     test_func_gen(pHandler, nCellIdx, nSlotIdx, PRACH_WAKE_UP);
500
501     MLogTask(PCID_GNB_FH_RX_PRACH_CC0+nCellIdx, mlog_start, MLogTick());
502 }
503
504 void
505 app_io_xran_fh_bbu_rx_srs_callback(void *pCallbackTag, xran_status_t status)
506 {
507     eBbuPoolHandler pHandler = app_get_ebbu_pool_handler();
508     int32_t nCellIdx;
509     int32_t nCcIdx;
510     int32_t sym, nSlotIdx, ntti;
511     struct xran_cb_tag *pTag = (struct xran_cb_tag *) pCallbackTag;
512     int32_t o_xu_id = pTag->oXuId;
513     struct xran_io_shared_ctrl *psIoCtrl = app_io_xran_if_ctrl_get(o_xu_id);
514     struct bbu_xran_io_if *psXranIoIf  = app_io_xran_if_get();
515     struct xran_fh_config  *pXranConf = &app_io_xran_fh_config[o_xu_id];
516     uint32_t xran_max_antenna_nr = RTE_MAX(pXranConf->neAxc, pXranConf->neAxcUl);
517     uint32_t xran_max_ant_array_elm_nr = RTE_MAX(pXranConf->nAntElmTRx, xran_max_antenna_nr);
518     uint32_t ant_id, sym_id, idxElm;
519     struct xran_prb_map *pRbMap = NULL;
520     struct xran_prb_elm *pRbElm = NULL;
521     uint64_t mlog_start = MLogTick();
522     uint32_t mlogVar[10];
523     uint32_t mlogVarCnt = 0;
524
525     if(psIoCtrl == NULL || psXranIoIf == NULL)
526     {
527         printf("psIoCtrl NULL! o_xu_id= %d\n", o_xu_id);
528         return;
529     }
530     nCcIdx   = pTag->cellId;
531     nCellIdx = psXranIoIf->map_cell_id2port[o_xu_id][nCcIdx];
532     nSlotIdx = pTag->slotiId; ///((status >> 16) & 0xFFFF);  /** TTI aka slotIdx */
533     sym      = pTag->symbol & 0xFF; /* sym */
534     ntti = (nSlotIdx + XRAN_N_FE_BUF_LEN-1) % XRAN_N_FE_BUF_LEN;
535
536     mlogVar[mlogVarCnt++] = 0xCCCCCCCC;
537     mlogVar[mlogVarCnt++] = o_xu_id;
538     mlogVar[mlogVarCnt++] = nCellIdx;
539     mlogVar[mlogVarCnt++] = sym;
540     mlogVar[mlogVarCnt++] = nSlotIdx;
541     mlogVar[mlogVarCnt++] = ntti;
542     MLogAddVariables(mlogVarCnt, mlogVar, MLogTick());
543     test_func_gen(pHandler, nCellIdx, nSlotIdx, SRS_WAKE_UP);
544
545     if(sym == XRAN_FULL_CB_SYM)  //full slot callback only
546     {
547         for(ant_id = 0; ant_id < xran_max_ant_array_elm_nr; ant_id++) {
548             pRbMap = (struct xran_prb_map *) psIoCtrl->sFHSrsRxPrbMapBbuIoBufCtrl[ntti][nCcIdx][ant_id].sBufferList.pBuffers->pData;
549             if(pRbMap == NULL){
550                 printf("(%d:%d:%d)pRbMap == NULL\n", nCcIdx, ntti, ant_id);
551                 exit(-1);
552             }
553             for(sym_id = 0; sym_id < XRAN_NUM_OF_SYMBOL_PER_SLOT; sym_id++) {
554                 for(idxElm = 0; idxElm < pRbMap->nPrbElm; idxElm++ ) {
555                     pRbElm = &pRbMap->prbMap[idxElm];
556                     pRbElm->nSecDesc[sym_id] = 0;
557                 }
558             }
559         }
560     }
561     MLogTask(PCID_GNB_FH_RX_SRS_CC0+nCellIdx, mlog_start, MLogTick());
562 }