- if(pXranConf->ru_conf.xranCat == XRAN_CATEGORY_B
- && startupConfiguration.appMode == APP_O_DU
- && sym_id == 0) {
- tx_dl_bfw_buffer_position[flowId] += (pXranConf->nDLRBs*pXranConf->nAntElmTRx)*4;
- if(tx_dl_bfw_buffer_position[flowId] >= tx_dl_bfw_buffer_size[flowId])
- tx_dl_bfw_buffer_position[flowId] = 0;
-
- tx_ul_bfw_buffer_position[flowId] += (pXranConf->nULRBs*pXranConf->nAntElmTRx)*4;
- if(tx_ul_bfw_buffer_position[flowId] >= tx_ul_bfw_buffer_size[flowId])
- tx_ul_bfw_buffer_position[flowId] = 0;
- }
- } else {
- //printf("flowId %d\n", flowId);
- }
- }
- }
-
- /* prach TX for RU only */
- if(startupConfiguration.appMode == APP_O_RU && startupConfiguration.enablePrach){
- for(ant_id = 0; ant_id < xran_max_antenna_nr; ant_id++){
- for(sym_id = 0; sym_id < XRAN_NUM_OF_SYMBOL_PER_SLOT; sym_id++) {
- flowId = startupConfiguration.numAxc*cc_id + ant_id;
-
- if(p_tx_prach_play_buffer[flowId]){
- pos = ((char*)p_tx_prach_play_buffer[flowId]);
-
- ptr = psBbuIo->sFHPrachRxBbuIoBufCtrl[tti][cc_id][ant_id].sBufferList.pBuffers[sym_id].pData;
-
- if(ptr && pos){
- u32dptr = (uint32_t*)(ptr);
- /* duplicate full PRACH (repetition * occassions ) in every symbol */
- memset(u32dptr,0 , PRACH_PLAYBACK_BUFFER_BYTES);
- rte_memcpy(u32dptr, pos, RTE_MIN(PRACH_PLAYBACK_BUFFER_BYTES, tx_prach_play_buffer_size[flowId]));
- } else {
- exit(-1);
- printf("ptr ==NULL\n");
- }
- } else {
- //printf("flowId %d\n", flowId);
- }
- }
- }
- }
-
- /* SRS TX for RU only */
- if(startupConfiguration.appMode == APP_O_RU && startupConfiguration.enableSrs){
- for(ant_id = 0; ant_id < xran_max_ant_array_elm_nr; ant_id++){
- for(sym_id = 0; sym_id < XRAN_MAX_NUM_OF_SRS_SYMBOL_PER_SLOT; sym_id++) {
- flowId = startupConfiguration.antElmTRx*cc_id + ant_id;
-
- if(p_tx_srs_play_buffer[flowId]){
- pos = ((char*)p_tx_srs_play_buffer[flowId]) + tx_srs_play_buffer_position[flowId];
- ptr = psBbuIo->sFHSrsRxBbuIoBufCtrl[tti][cc_id][ant_id].sBufferList.pBuffers[sym_id].pData;
-
- if(startupConfiguration.srsSymMask & (1 << sym_id) ){
- if(ptr && pos){
- u32dptr = (uint32_t*)(ptr);
- memset(u32dptr,0 , pXranConf->nULRBs*N_SC_PER_PRB*4);
- rte_memcpy(u32dptr, pos, pXranConf->nULRBs*N_SC_PER_PRB*4);
- } else {
- exit(-1);
- printf("ptr ==NULL\n");
- }
- }
-
- tx_srs_play_buffer_position[flowId] += pXranConf->nULRBs*N_SC_PER_PRB*4;
-
- if(tx_srs_play_buffer_position[flowId] >= tx_srs_play_buffer_size[flowId])
- tx_srs_play_buffer_position[flowId] = 0;
- } else {
- //printf("flowId %d\n", flowId);
- }
- }
- }
- }
- }
- }
-
- return 0;
-}
-
-void stop_xran(void)
-{
- xran_status_t status = 0;
- SWXRANInterfaceTypeEnum eInterfaceType;
-
- free(gpXranLibConfig);
- gpXranLibConfig = NULL;
-
- status += xran_mm_destroy(xranHandle)*2;
-
- if(XRAN_STATUS_SUCCESS != status)
- {
- printf("Failed at xran_mm_destroy, status %d\n",status);
- iAssert(status == XRAN_STATUS_SUCCESS);
- }
-}
-
-int get_xran_iq_content(void)
-{
- BbuXranIoIfStruct *psBbuIo = xran_get_ctx();
- xran_status_t status;
- int32_t nSectorIndex[XRAN_MAX_SECTOR_NR];
- int32_t nSectorNum;
- int32_t cc_id, ant_id, sym_id, tti;
- int32_t flowId;
-
- uint8_t frame_id = 0;
- uint8_t subframe_id = 0;
- uint8_t slot_id = 0;
- uint8_t sym = 0;
-
- void *ptr;
- uint32_t *u32dptr;
- uint16_t *u16dptr;
- uint8_t *u8dptr;
-
- uint32_t xran_max_antenna_nr = RTE_MAX(startupConfiguration.numAxc, startupConfiguration.numUlAxc);
- uint32_t xran_max_ant_array_elm_nr = RTE_MAX(startupConfiguration.antElmTRx, xran_max_antenna_nr);
-
- char *pos = NULL;
-
- for (nSectorNum = 0; nSectorNum < XRAN_MAX_SECTOR_NR; nSectorNum++)
- {
- nSectorIndex[nSectorNum] = nSectorNum;
- }
- nSectorNum = numCCPorts;
- printf ("get_xran_iq_content\n");
-
- /* Init Memory */
- for(cc_id = 0; cc_id <nSectorNum; cc_id++)
- {
- for(tti = 0; tti < XRAN_N_FE_BUF_LEN; tti++) {
- for(ant_id = 0; ant_id < xran_max_antenna_nr; ant_id++){
- int32_t idxElm = 0;
- struct xran_prb_map *pRbMap = NULL;
- struct xran_prb_elm *pRbElm = NULL;
- struct xran_section_desc *p_sec_desc = NULL;
- pRbMap = (struct xran_prb_map *) psBbuIo->sFrontHaulRxPrbMapBbuIoBufCtrl[tti][cc_id][ant_id].sBufferList.pBuffers->pData;
- if(pRbMap == NULL)
- exit(-1);
-
- if(startupConfiguration.appMode == APP_O_RU)
- flowId = startupConfiguration.numAxc * cc_id + ant_id;
- else
- flowId = startupConfiguration.numUlAxc * cc_id + ant_id;
-
- for(sym_id = 0; sym_id < XRAN_NUM_OF_SYMBOL_PER_SLOT; sym_id++) {
- pRbElm = &pRbMap->prbMap[0];
- if(pRbMap->nPrbElm == 1){
- if(p_rx_log_buffer[flowId]) {
- pos = ((char*)p_rx_log_buffer[flowId]) + rx_log_buffer_position[flowId];
- ptr = psBbuIo->sFrontHaulRxBbuIoBufCtrl[tti][cc_id][ant_id].sBufferList.pBuffers[sym_id].pData;
- if(ptr){
- u32dptr = (uint32_t*)(ptr);
- rte_memcpy(pos + pRbElm->nRBStart*N_SC_PER_PRB*4L , u32dptr, pRbElm->nRBSize*N_SC_PER_PRB*4L);
- }else {
- printf("[%d][%d][%d][%d]ptr ==NULL\n",tti,cc_id,ant_id, sym_id);
- }
- }
- } else {
- for(idxElm = 0; idxElm < pRbMap->nPrbElm; idxElm++ ) {
- pRbElm = &pRbMap->prbMap[idxElm];
- p_sec_desc = pRbElm->p_sec_desc[sym_id];
- if(p_rx_log_buffer[flowId] && p_sec_desc){
- if(sym_id >= pRbElm->nStartSymb && sym_id < pRbElm->nStartSymb + pRbElm->numSymb){
- pos = ((char*)p_rx_log_buffer[flowId]) + rx_log_buffer_position[flowId];
- ptr = p_sec_desc->pData;
- if(ptr){
- int32_t payload_len = 0;
- u32dptr = (uint32_t*)(ptr);
- if (pRbElm->compMethod != XRAN_COMPMETHOD_NONE){
- struct xranlib_decompress_request bfp_decom_req;
- struct xranlib_decompress_response bfp_decom_rsp;
-
- memset(&bfp_decom_req, 0, sizeof(struct xranlib_decompress_request));
- memset(&bfp_decom_rsp, 0, sizeof(struct xranlib_decompress_response));
-
- bfp_decom_req.data_in = (int8_t *)u32dptr;
- bfp_decom_req.numRBs = pRbElm->nRBSize;
- bfp_decom_req.len = (3* pRbElm->iqWidth + 1)*pRbElm->nRBSize;
- bfp_decom_req.compMethod = pRbElm->compMethod;
- bfp_decom_req.iqWidth = pRbElm->iqWidth;
-
- bfp_decom_rsp.data_out = (int16_t *)(pos + pRbElm->nRBStart*N_SC_PER_PRB*4);
- bfp_decom_rsp.len = 0;
-
- xranlib_decompress_avx512(&bfp_decom_req, &bfp_decom_rsp);
- payload_len = bfp_decom_rsp.len;
-
- } else {
- rte_memcpy(pos + pRbElm->nRBStart*N_SC_PER_PRB*4 , u32dptr, pRbElm->nRBSize*N_SC_PER_PRB*4);
- }
- }
- }
- }
- }
- }
- rx_log_buffer_position[flowId] += pXranConf->nULRBs*N_SC_PER_PRB*4;
-
- if(rx_log_buffer_position[flowId] >= rx_log_buffer_size[flowId])
- rx_log_buffer_position[flowId] = 0;
- }
-
- /* prach RX for O-DU only */
- if(startupConfiguration.appMode == APP_O_DU) {
- flowId = startupConfiguration.numAxc * cc_id + ant_id;
- for(sym_id = 0; sym_id < XRAN_NUM_OF_SYMBOL_PER_SLOT; sym_id++){
- if(p_prach_log_buffer[flowId]){
- /* (0-79 slots) 10ms of IQs */
- pos = ((char*)p_prach_log_buffer[flowId]) + prach_log_buffer_position[flowId];
- ptr = psBbuIo->sFHPrachRxBbuIoBufCtrl[tti][cc_id][ant_id].sBufferList.pBuffers[sym_id].pData; //8192 144
- if(ptr){
- u32dptr = (uint32_t*)(ptr);
- rte_memcpy(pos, u32dptr, PRACH_PLAYBACK_BUFFER_BYTES);
- }else
- printf("ptr ==NULL\n");
-
- prach_log_buffer_position[flowId] += PRACH_PLAYBACK_BUFFER_BYTES;
-
- if(prach_log_buffer_position[flowId] >= prach_log_buffer_size[flowId])
- prach_log_buffer_position[flowId] = 0;
- } else {
- //printf("flowId %d\n", flowId);
- }
- }
- }
- }
-
- /* SRS RX for O-DU only */
- if(startupConfiguration.appMode == APP_O_DU && startupConfiguration.enableSrs) {
- for(ant_id = 0; ant_id < xran_max_ant_array_elm_nr; ant_id++){
- flowId = startupConfiguration.antElmTRx*cc_id + ant_id;
- for(sym_id = 0; sym_id < XRAN_MAX_NUM_OF_SRS_SYMBOL_PER_SLOT; sym_id++){
- if(p_srs_log_buffer[flowId]){
- pos = ((char*)p_srs_log_buffer[flowId]) + srs_log_buffer_position[flowId];
- ptr = psBbuIo->sFHSrsRxBbuIoBufCtrl[tti][cc_id][ant_id].sBufferList.pBuffers[sym_id].pData;
- if(ptr){
- u32dptr = (uint32_t*)(ptr);
- rte_memcpy(pos, u32dptr, pXranConf->nULRBs*N_SC_PER_PRB*4);
- }else
- printf("ptr ==NULL\n");
-
- srs_log_buffer_position[flowId] += pXranConf->nULRBs*N_SC_PER_PRB*4;
-
- if(srs_log_buffer_position[flowId] >= srs_log_buffer_size[flowId])
- srs_log_buffer_position[flowId] = 0;
- } else {
- //printf("flowId %d\n", flowId);
- }
- }
- }
- }
- }
- }
-
- return 0;
-}
-
-void version_print(void)
-{
- char sysversion[100];
- char *compilation_date = __DATE__;
- char *compilation_time = __TIME__;
-
- uint32_t nLen;
-
- snprintf(sysversion, 99, "Version: %s", VERSIONX);
- nLen = strlen(sysversion);
-
- printf("\n\n");
- printf("===========================================================================================================\n");
- printf("SAMPLE-APP VERSION\n");
- printf("===========================================================================================================\n");
-
- printf("%s\n", sysversion);
- printf("build-date: %s\n", compilation_date);
- printf("build-time: %s\n", compilation_time);
-}
-
-static void app_Help(void)
-{
- char help_content[] = \
- "sample application\n\n"\
- "Usage: sample-app config_file_o_du.dat -p 2 0000:21:02.0 0000:21:02.1 0000:21:0a.0 0000:21:0a.1\n\n"\
- "supports the following parameters:\n\n"\
- "-p | --num_eth_pfs <number of ETH ports to connect to O-RU|O-DU> 1 - default sanity test\n"
- "-c | --cfgfile <name of cfg file>\n"\
- "-h | --help print usage\n";
-
- printf("%s", help_content);
-}
-
-/**
- *******************************************************************************
- *
- * @fn app_parse_args
- * @brief is used to parse incoming app args
- *
- * @param[i] argc - app arg count
- * @param[i] argv - array of args
- * @param[o] params - app startup params filled basing on args parse
- * @return number of parsed args
- *
- * @description
- * The routine is parse input args and convert them into app startup params
- *
- * @references
- * MS-111070-SP
- *
- * @ingroup icc_service_unit_test
- *
- ******************************************************************************/
-static int app_parse_args(int argc, char ** argv, struct sample_app_params* params)
-{
- int c;
- int *pInt;
- int cnt = 0;
-
- struct option long_options[] = {
- {"cfgfile", required_argument, 0, 'c'},
- {"num_eth_pfs", required_argument, 0, 'p'},
- {"help", no_argument, 0, 'h'},
- {0, 0, 0, 0}
- };
-
- memset(params, 0, sizeof (*params));
-
- while (1) {
- //int this_option_optind = optind ? optind : 1;
- int option_index = 0;
-
- c = getopt_long(argc, argv, "c:p:h", long_options, &option_index);
-
- if (c == -1)
- break;
-
- cnt += 1;
- pInt = NULL;
-
- switch (c) {
- case 'p': // test Case selection
- pInt = ¶ms->num_vfs;
- break;
- case 'c':
- params->cfg_file = optarg;
- break;
- case 'h':
- app_Help();
- exit(0);
- }
-
- if (pInt && optarg) {
- // get int arg
- if (optarg[0] == '0' && (optarg[1] == 'x' || optarg[1] == 'X')) {
- sscanf(optarg, "%x", (unsigned *) pInt);
- } else {
- *pInt = atoi(optarg);
- }
- }
- }
- return cnt;
-}
-
-int32_t app_init_set_eAxCId_conf(struct xran_eaxcid_config *p_eAxC_cfg, RuntimeConfig * p_s_cfg)
-{
- int32_t shift;
- uint16_t mask;
-
- if(p_s_cfg->DU_Port_ID_bitwidth && p_s_cfg->BandSector_ID_bitwidth && p_s_cfg->CC_ID_bitwidth
- && p_s_cfg->RU_Port_ID_bitwidth &&
- (p_s_cfg->DU_Port_ID_bitwidth + p_s_cfg->BandSector_ID_bitwidth + p_s_cfg->CC_ID_bitwidth
- + p_s_cfg->RU_Port_ID_bitwidth) == 16 /* eAxC ID subfields are 16 bits */
- ){ /* bit mask provided */
-
- mask = 0;
- p_eAxC_cfg->bit_ruPortId = 0;
- for (shift = 0; shift < p_s_cfg->RU_Port_ID_bitwidth; shift++){
- mask |= 1 << shift;
- }
- p_eAxC_cfg->mask_ruPortId = mask;
-
- p_eAxC_cfg->bit_ccId = p_s_cfg->RU_Port_ID_bitwidth;
- mask = 0;
- for (shift = p_s_cfg->RU_Port_ID_bitwidth; shift < p_s_cfg->RU_Port_ID_bitwidth + p_s_cfg->CC_ID_bitwidth; shift++){
- mask |= 1 << shift;
- }
- p_eAxC_cfg->mask_ccId = mask;
-
-
- p_eAxC_cfg->bit_bandSectorId = p_s_cfg->RU_Port_ID_bitwidth + p_s_cfg->CC_ID_bitwidth;
- mask = 0;
- for (shift = p_s_cfg->RU_Port_ID_bitwidth + p_s_cfg->CC_ID_bitwidth; shift < p_s_cfg->RU_Port_ID_bitwidth + p_s_cfg->CC_ID_bitwidth + p_s_cfg->BandSector_ID_bitwidth; shift++){
- mask |= 1 << shift;
- }
- p_eAxC_cfg->mask_bandSectorId = mask;
-
- p_eAxC_cfg->bit_cuPortId = p_s_cfg->RU_Port_ID_bitwidth + p_s_cfg->CC_ID_bitwidth + p_s_cfg->BandSector_ID_bitwidth;
- mask = 0;
- for (shift = p_s_cfg->RU_Port_ID_bitwidth + p_s_cfg->CC_ID_bitwidth + p_s_cfg->BandSector_ID_bitwidth;
- shift < p_s_cfg->RU_Port_ID_bitwidth + p_s_cfg->CC_ID_bitwidth + p_s_cfg->BandSector_ID_bitwidth + p_s_cfg->DU_Port_ID_bitwidth; shift++){
- mask |= 1 << shift;
- }
- p_eAxC_cfg->mask_cuPortId = mask;
-
-
- } else { /* bit mask config is not provided */
- switch (p_s_cfg->xranCat){
- case XRAN_CATEGORY_A: {
- p_eAxC_cfg->mask_cuPortId = 0xf000;
- p_eAxC_cfg->mask_bandSectorId = 0x0f00;
- p_eAxC_cfg->mask_ccId = 0x00f0;
- p_eAxC_cfg->mask_ruPortId = 0x000f;
- p_eAxC_cfg->bit_cuPortId = 12;
- p_eAxC_cfg->bit_bandSectorId = 8;
- p_eAxC_cfg->bit_ccId = 4;
- p_eAxC_cfg->bit_ruPortId = 0;
- break;
- }
- case XRAN_CATEGORY_B: {
- p_eAxC_cfg->mask_cuPortId = 0xf000;
- p_eAxC_cfg->mask_bandSectorId = 0x0c00;
- p_eAxC_cfg->mask_ccId = 0x0300;
- p_eAxC_cfg->mask_ruPortId = 0x00ff; /* more than [0-127] eAxC */
- p_eAxC_cfg->bit_cuPortId = 12;
- p_eAxC_cfg->bit_bandSectorId = 10;
- p_eAxC_cfg->bit_ccId = 8;
- p_eAxC_cfg->bit_ruPortId = 0;
- break;
- }
- default:
- rte_panic("Incorrect Category\n");
- }
- }
-
- if(p_s_cfg->xranCat == XRAN_CATEGORY_A)
- p_s_cfg->numUlAxc = p_s_cfg->numAxc;
-
- printf("bit_cuPortId %2d mask 0x%04x\n",p_eAxC_cfg->bit_cuPortId, p_eAxC_cfg->mask_cuPortId);
- printf("bit_bandSectorId %2d mask 0x%04x\n",p_eAxC_cfg->bit_bandSectorId, p_eAxC_cfg->mask_bandSectorId);
- printf("bit_ccId %2d mask 0x%04x\n",p_eAxC_cfg->bit_ccId, p_eAxC_cfg->mask_ccId);
- printf("ruPortId %2d mask 0x%04x\n",p_eAxC_cfg->bit_ruPortId, p_eAxC_cfg->mask_ruPortId);
-
- return 0;
-}
-
-int main(int argc, char *argv[])
-{
- int i;
- int j, len;
- int lcore_id = 0;
- char filename[256];
- char prefix_name[256];
- uint32_t nCenterFreq;
- int32_t xret = 0;
- struct stat st = {0};
- uint32_t filenameLength = strlen(argv[1]);
- enum xran_if_state xran_curr_if_state = XRAN_INIT;
- struct sample_app_params arg_params;
-
-
- uint64_t nTotalTime;
- uint64_t nUsedTime;
- uint32_t nCoreUsed;
- float nUsedPercent;
-
- app_parse_args(argc, argv, &arg_params);
-
- if( (arg_params.num_vfs % 2) != 0 || arg_params.num_vfs >= XRAN_VF_MAX){
- printf("warning: arg_params.num_vfs is not correct\n");
- exit(-1);
- }
-
- if (argc == 3 + arg_params.num_vfs){
- printf("Need at least two argument - the PCI address of the network port");
- exit(-1);
- }
-
- if (filenameLength >= 256)
- {
- printf("Config file name input is too long, exiting!\n");
- exit(-1);
- }
-
- version_print();
-
- //add for Klocworks
- printf("arg_params.cfg_file (%s)\n", arg_params.cfg_file);
- len = strlen(arg_params.cfg_file) + 1;
- if (len > (sizeof(filename) - 10))
- len = (sizeof(filename) - 10);
- strncpy(filename, arg_params.cfg_file, (sizeof(filename) - 10));
- filename[len] = '\0';
-
- if (xran_is_synchronized() != 0)
- printf("Machine is not synchronized using PTP!\n");
- else
- printf("Machine is synchronized using PTP!\n");
-
- memset(&startupConfiguration, 0, sizeof(RuntimeConfig));
-
- if (parseConfigFile(filename, (RuntimeConfig*)&startupConfiguration) != 0) {
- printf("Configuration file error.\n");
- return -1;
- }
-
- if(startupConfiguration.ant_file[0] == NULL){
- printf("it looks like test vector for antennas were not provided\n");
- exit(-1);
- }
-
- if (startupConfiguration.numCC > XRAN_MAX_SECTOR_NR) {
- printf("Number of cells %d exceeds max number supported %d!\n", startupConfiguration.numCC, XRAN_MAX_SECTOR_NR);
- startupConfiguration.numCC = XRAN_MAX_SECTOR_NR;
-
- }
- if (startupConfiguration.antElmTRx > XRAN_MAX_ANT_ARRAY_ELM_NR) {
- printf("Number of Antenna elements %d exceeds max number supported %d!\n", startupConfiguration.antElmTRx, XRAN_MAX_ANT_ARRAY_ELM_NR);
- startupConfiguration.antElmTRx = XRAN_MAX_ANT_ARRAY_ELM_NR;
- }
-
- numCCPorts = startupConfiguration.numCC;
- num_eAxc = startupConfiguration.numAxc;
-
- printf("numCCPorts %d num_eAxc%d\n", numCCPorts, num_eAxc);
-
- if (startupConfiguration.mu_number <= 1){
- nFpgaToSW_FTH_RxBufferLen = 13168; /* 273*12*4 + 64*/
- nFpgaToSW_PRACH_RxBufferLen = 8192;
- nSW_ToFpga_FTH_TxBufferLen = 13168 + /* 273*12*4 + 64* + ETH AND ORAN HDRs */
- XRAN_MAX_SECTIONS_PER_SYM* (RTE_PKTMBUF_HEADROOM + sizeof(struct rte_ether_hdr) +
- sizeof(struct xran_ecpri_hdr) +
- sizeof(struct radio_app_common_hdr) +
- sizeof(struct data_section_hdr));
- } else if (startupConfiguration.mu_number == 3){
- nFpgaToSW_FTH_RxBufferLen = 3328;
- nFpgaToSW_PRACH_RxBufferLen = 8192;
- nSW_ToFpga_FTH_TxBufferLen = 3328 +
- XRAN_MAX_SECTIONS_PER_SYM * (RTE_PKTMBUF_HEADROOM + sizeof(struct rte_ether_hdr) +
- sizeof(struct xran_ecpri_hdr) +
- sizeof(struct radio_app_common_hdr) +
- sizeof(struct data_section_hdr));
- } else {
- printf("given numerology is not supported %d\n", startupConfiguration.mu_number);
- exit(-1);
- }
- printf("nSW_ToFpga_FTH_TxBufferLen %d\n", nSW_ToFpga_FTH_TxBufferLen);
-
- memset(&xranInit, 0, sizeof(struct xran_fh_init));
-
- if(startupConfiguration.appMode == APP_O_DU) {
- printf("set O-DU\n");
- xranInit.io_cfg.id = 0;/* O-DU */
- xranInit.io_cfg.core = startupConfiguration.io_core;
- xranInit.io_cfg.system_core = startupConfiguration.system_core;
- xranInit.io_cfg.pkt_proc_core = startupConfiguration.io_worker; /* do not start */
- xranInit.io_cfg.pkt_aux_core = 0; /* do not start*/
- xranInit.io_cfg.timing_core = startupConfiguration.io_core;
- xranInit.io_cfg.dpdkIoVaMode = startupConfiguration.iova_mode;
- } else {
- printf("set O-RU\n");
- xranInit.io_cfg.id = 1; /* O-RU*/
- xranInit.io_cfg.core = startupConfiguration.io_core;
- xranInit.io_cfg.system_core = startupConfiguration.system_core;
- xranInit.io_cfg.pkt_proc_core = startupConfiguration.io_worker; /* do not start */
- xranInit.io_cfg.pkt_aux_core = 0; /* do not start */
- xranInit.io_cfg.timing_core = startupConfiguration.io_core;
- xranInit.io_cfg.dpdkIoVaMode = startupConfiguration.iova_mode;
- }
-
- xranInit.io_cfg.io_sleep = startupConfiguration.io_sleep;
- xranInit.io_cfg.bbdev_mode = XRAN_BBDEV_NOT_USED;
-
- app_init_set_eAxCId_conf(&xranInit.eAxCId_conf, &startupConfiguration);
-
- printf("arg_params.num_vfs %d\n", arg_params.num_vfs);
- for(i = 0; i < arg_params.num_vfs/2; i++){
- xranInit.io_cfg.dpdk_dev[XRAN_UP_VF+2*i] = argv[5+2*i];
- printf("VF[%d] %s\n",XRAN_UP_VF+2*i, xranInit.io_cfg.dpdk_dev[XRAN_UP_VF+2*i]);
- xranInit.io_cfg.dpdk_dev[XRAN_UP_VF+2*i+1] = argv[5+2*i+1];
- printf("VF[%d] %s\n",XRAN_UP_VF+2*i+1, xranInit.io_cfg.dpdk_dev[XRAN_UP_VF+2*i+1]);
- }
-
- xranInit.io_cfg.num_vfs = arg_params.num_vfs;
- xranInit.mtu = startupConfiguration.mtu;
- xranInit.p_o_du_addr = (int8_t *)startupConfiguration.o_du_addr;
- xranInit.p_o_ru_addr = (int8_t *)startupConfiguration.o_ru_addr;
-
- sprintf(prefix_name, "wls_%d",startupConfiguration.instance_id);
- xranInit.filePrefix = prefix_name;
-
- xranInit.totalBfWeights = startupConfiguration.totalBfWeights;
-
- xranInit.Tadv_cp_dl = startupConfiguration.Tadv_cp_dl;
- xranInit.T2a_min_cp_dl = startupConfiguration.T2a_min_cp_dl;
- xranInit.T2a_max_cp_dl = startupConfiguration.T2a_max_cp_dl;
- xranInit.T2a_min_cp_ul = startupConfiguration.T2a_min_cp_ul;
- xranInit.T2a_max_cp_ul = startupConfiguration.T2a_max_cp_ul;
- xranInit.T2a_min_up = startupConfiguration.T2a_min_up;
- xranInit.T2a_max_up = startupConfiguration.T2a_max_up;
- xranInit.Ta3_min = startupConfiguration.Ta3_min;
- xranInit.Ta3_max = startupConfiguration.Ta3_max;
- xranInit.T1a_min_cp_dl = startupConfiguration.T1a_min_cp_dl;
- xranInit.T1a_max_cp_dl = startupConfiguration.T1a_max_cp_dl;
- xranInit.T1a_min_cp_ul = startupConfiguration.T1a_min_cp_ul;
- xranInit.T1a_max_cp_ul = startupConfiguration.T1a_max_cp_ul;
- xranInit.T1a_min_up = startupConfiguration.T1a_min_up;
- xranInit.T1a_max_up = startupConfiguration.T1a_max_up;
- xranInit.Ta4_min = startupConfiguration.Ta4_min;
- xranInit.Ta4_max = startupConfiguration.Ta4_max;
-
- xranInit.enableCP = startupConfiguration.enableCP;
- xranInit.prachEnable = startupConfiguration.enablePrach;
- xranInit.srsEnable = startupConfiguration.enableSrs;
- xranInit.debugStop = startupConfiguration.debugStop;
- xranInit.debugStopCount = startupConfiguration.debugStopCount;
- xranInit.DynamicSectionEna = startupConfiguration.DynamicSectionEna;
- xranInit.io_cfg.bbdev_mode = XRAN_BBDEV_NOT_USED;
- xranInit.GPS_Alpha = startupConfiguration.GPS_Alpha;
- xranInit.GPS_Beta = startupConfiguration.GPS_Beta;
-
- xranInit.cp_vlan_tag = startupConfiguration.cp_vlan_tag;
- xranInit.up_vlan_tag = startupConfiguration.up_vlan_tag;
-
- printf("IQ files size is %d slots\n", startupConfiguration.numSlots);
-
- iq_playback_buffer_size_dl = (startupConfiguration.numSlots * N_SYM_PER_SLOT * N_SC_PER_PRB *
- app_xran_get_num_rbs(startupConfiguration.xranTech, startupConfiguration.mu_number, startupConfiguration.nDLBandwidth, startupConfiguration.nDLAbsFrePointA)
- *4L);
-
- iq_playback_buffer_size_ul = (startupConfiguration.numSlots * N_SYM_PER_SLOT * N_SC_PER_PRB *
- app_xran_get_num_rbs(startupConfiguration.xranTech, startupConfiguration.mu_number, startupConfiguration.nULBandwidth, startupConfiguration.nULAbsFrePointA)
- *4L);
-
-
- /* 10 * [14*32*273*2*2] = 4892160 bytes */
- iq_bfw_buffer_size_dl = (startupConfiguration.numSlots * N_SYM_PER_SLOT * startupConfiguration.antElmTRx *
- app_xran_get_num_rbs(startupConfiguration.xranTech, startupConfiguration.mu_number, startupConfiguration.nDLBandwidth, startupConfiguration.nDLAbsFrePointA)
- *4L);
-
- /* 10 * [14*32*273*2*2] = 4892160 bytes */
- iq_bfw_buffer_size_ul = (startupConfiguration.numSlots * N_SYM_PER_SLOT *
- app_xran_get_num_rbs(startupConfiguration.xranTech, startupConfiguration.mu_number, startupConfiguration.nULBandwidth, startupConfiguration.nULAbsFrePointA)
- *4L);
-
- /* 10 * [1*273*2*2] = 349440 bytes */
- iq_srs_buffer_size_ul = (startupConfiguration.numSlots * N_SYM_PER_SLOT * N_SC_PER_PRB *
- app_xran_get_num_rbs(startupConfiguration.xranTech, startupConfiguration.mu_number, startupConfiguration.nULBandwidth, startupConfiguration.nULAbsFrePointA)
- *4L);
-
- for(i = 0; i < MAX_ANT_CARRIER_SUPPORTED && i < (uint32_t)(numCCPorts * num_eAxc); i++) {
- p_tx_play_buffer[i] = (int16_t*)malloc(iq_playback_buffer_size_dl);
- tx_play_buffer_size[i] = (int32_t)iq_playback_buffer_size_dl;
-
- if (p_tx_play_buffer[i] == NULL)
- exit(-1);
-
- tx_play_buffer_size[i] = sys_load_file_to_buff(startupConfiguration.ant_file[i],
- "DL IFFT IN IQ Samples in binary format",
- (uint8_t*) p_tx_play_buffer[i],
- tx_play_buffer_size[i],
- 1);
- tx_play_buffer_position[i] = 0;
- }
-
- if (startupConfiguration.appMode == APP_O_DU && startupConfiguration.xranCat == XRAN_CATEGORY_B){
- for(i = 0; i < MAX_ANT_CARRIER_SUPPORTED && i < (uint32_t)(numCCPorts * num_eAxc); i++) {
-
- p_tx_dl_bfw_buffer[i] = (int16_t*)malloc(iq_bfw_buffer_size_dl);
- tx_dl_bfw_buffer_size[i] = (int32_t)iq_bfw_buffer_size_dl;
-
- if (p_tx_dl_bfw_buffer[i] == NULL)