Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zzha zzha
OpenXG-RAN
Commits
870dbe29
Commit
870dbe29
authored
Feb 09, 2022
by
Sofia Pison
Committed by
rajeshwari.p
Dec 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xran_lib_wrap.hpp moved and split to have separation between headers and code
parent
64b683d4
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
450 additions
and
646 deletions
+450
-646
CMakeLists.txt
CMakeLists.txt
+1
-3
targets/ARCH/ETHERNET/oran/5g/low_dpdk_oran.c
targets/ARCH/ETHERNET/oran/5g/low_dpdk_oran.c
+0
-99
targets/ARCH/ETHERNET/oran/5g/low_oran.c
targets/ARCH/ETHERNET/oran/5g/low_oran.c
+0
-41
targets/ARCH/ETHERNET/oran/5g/low_oran.h
targets/ARCH/ETHERNET/oran/5g/low_oran.h
+0
-40
targets/ARCH/ETHERNET/oran/5g/oran.cpp
targets/ARCH/ETHERNET/oran/5g/oran.cpp
+0
-4
targets/ARCH/ETHERNET/oran/5g/oran_isolate.c
targets/ARCH/ETHERNET/oran/5g/oran_isolate.c
+0
-3
targets/ARCH/ETHERNET/oran/5g/oran_isolate.h
targets/ARCH/ETHERNET/oran/5g/oran_isolate.h
+6
-2
targets/ARCH/ETHERNET/oran/5g/shared_buffers.c
targets/ARCH/ETHERNET/oran/5g/shared_buffers.c
+0
-123
targets/ARCH/ETHERNET/oran/5g/shared_buffers.h
targets/ARCH/ETHERNET/oran/5g/shared_buffers.h
+0
-61
targets/ARCH/ETHERNET/oran/5g/xran_lib_wrap.cpp
targets/ARCH/ETHERNET/oran/5g/xran_lib_wrap.cpp
+173
-270
targets/ARCH/ETHERNET/oran/5g/xran_lib_wrap.hpp
targets/ARCH/ETHERNET/oran/5g/xran_lib_wrap.hpp
+270
-0
No files found.
CMakeLists.txt
View file @
870dbe29
...
...
@@ -677,9 +677,7 @@ include_directories("${ICC_LIB}")
set
(
ORAN_FHLIB_5G_SOURCE
${
OPENAIR_TARGETS
}
/ARCH/ETHERNET/oran/5g/oran.cpp
${
OPENAIR_TARGETS
}
/ARCH/ETHERNET/oran/5g/shared_buffers.c
${
OPENAIR_TARGETS
}
/ARCH/ETHERNET/oran/5g/low_oran.c
${
OPENAIR_TARGETS
}
/ARCH/ETHERNET/oran/5g/low_dpdk_oran.c
${
OPENAIR_TARGETS
}
/ARCH/ETHERNET/oran/5g/xran_lib_wrap.cpp
${
OPENAIR_TARGETS
}
/ARCH/ETHERNET/oran/5g/oran_isolate.c
)
add_library
(
oran_fhlib_5g MODULE
${
ORAN_FHLIB_5G_SOURCE
}
)
...
...
targets/ARCH/ETHERNET/oran/5g/low_dpdk_oran.c
deleted
100644 → 0
View file @
64b683d4
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#define _GNU_SOURCE
#include <sched.h>
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include "low_oran.h"
int
oran_main
(
int
argc
,
char
**
argv
,
oran_t
*
);
void
*
dpdk_thread
(
void
*
bs
)
{
char
*
v
[]
=
{
"softmodem"
,
"config_file_o_du.dat"
,
"0000:81:0e.0"
,
"0000:81:0e.1"
};
oran_main
(
4
,
v
,
bs
);
exit
(
1
);
return
0
;
}
void
*
oran_start_dpdk
(
char
*
ifname
,
shared_buffers
*
buffers
)
{
oran_t
*
bs
;
bs
=
calloc
(
1
,
sizeof
(
oran_t
));
if
(
bs
==
NULL
)
{
printf
(
"%s: out of memory
\n
"
,
__FUNCTION__
);
exit
(
1
);
}
bs
->
buffers
=
buffers
;
pthread_attr_t
attr
;
if
(
pthread_attr_init
(
&
attr
)
!=
0
)
{
printf
(
"pthread_attr_init failed
\n
"
);
exit
(
1
);
}
cpu_set_t
cpuset
;
CPU_ZERO
(
&
cpuset
);
CPU_SET
(
10
,
&
cpuset
);
if
(
pthread_attr_setaffinity_np
(
&
attr
,
sizeof
(
cpu_set_t
),
&
cpuset
)
!=
0
)
{
printf
(
"pthread_attr_setaffinity_np failed
\n
"
);
exit
(
1
);
}
if
(
pthread_attr_setschedpolicy
(
&
attr
,
SCHED_FIFO
)
!=
0
)
{
printf
(
"pthread_attr_setschedpolicy failed
\n
"
);
exit
(
1
);
}
struct
sched_param
params
;
params
.
sched_priority
=
sched_get_priority_max
(
SCHED_FIFO
);
if
(
sched_get_priority_max
(
SCHED_FIFO
)
==
-
1
)
{
printf
(
"sched_get_priority_max failed
\n
"
);
exit
(
1
);
}
if
(
pthread_attr_setschedparam
(
&
attr
,
&
params
)
!=
0
)
{
printf
(
"pthread_setschedparam failed
\n
"
);
exit
(
1
);
}
pthread_t
t
;
if
(
pthread_create
(
&
t
,
&
attr
,
dpdk_thread
,
bs
)
!=
0
)
{
printf
(
"%s: thread creation failed
\n
"
,
__FUNCTION__
);
exit
(
1
);
}
if
(
pthread_attr_destroy
(
&
attr
)
!=
0
)
{
printf
(
"pthread_attr_init failed
\n
"
);
exit
(
1
);
}
return
bs
;
}
targets/ARCH/ETHERNET/oran/5g/low_oran.c
deleted
100644 → 0
View file @
64b683d4
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "low_oran.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void
*
oran_start_dpdk
(
char
*
ifname
,
shared_buffers
*
buffers
);
void
*
oran_start
(
char
*
ifname
,
shared_buffers
*
buffers
)
{
printf
(
"!!!!!!!!!!!!!!
\n
"
);
if
(
!
strcmp
(
ifname
,
"dpdk"
))
return
oran_start_dpdk
(
ifname
,
buffers
);
else
return
NULL
;
}
targets/ARCH/ETHERNET/oran/5g/low_oran.h
deleted
100644 → 0
View file @
64b683d4
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "shared_buffers.h"
#ifndef LOW_ORAN_H
#define LOW_ORAN_H
void
*
oran_start
(
char
*
ifname
,
shared_buffers
*
buffers
);
typedef
struct
{
shared_buffers
*
buffers
;
int
next_subframe
;
int
next_symbol
;
int
expected_oran_frame
;
}
oran_t
;
#endif
targets/ARCH/ETHERNET/oran/5g/oran.cpp
View file @
870dbe29
...
...
@@ -21,11 +21,7 @@
#include <stdio.h>
// #include "common_lib.h"
// #include "ethernet_lib.h"
#include "oran_isolate.h"
#include "shared_buffers.h"
#include "low_oran.h"
#include "xran_lib_wrap.hpp"
#include "common.hpp"
#include "xran_compression.h"
...
...
targets/ARCH/ETHERNET/oran/5g/oran_isolate.c
View file @
870dbe29
...
...
@@ -23,8 +23,6 @@
#include <stdio.h>
#include "common_lib.h"
#include "ethernet_lib.h"
#include "shared_buffers.h"
#include "low_oran.h"
#include "oran_isolate.h"
#include "common/utils/LOG/log.h"
...
...
@@ -33,7 +31,6 @@
typedef
struct
{
eth_state_t
e
;
shared_buffers
buffers
;
rru_config_msg_type_t
last_msg
;
int
capabilities_sent
;
void
*
oran_priv
;
...
...
targets/ARCH/ETHERNET/oran/5g/oran_isolate.h
View file @
870dbe29
...
...
@@ -23,8 +23,12 @@
#define _ORAN_ISOLATE_H_
#include <stdio.h>
#include "shared_buffers.h"
#include "low_oran.h"
#include <pthread.h>
#include <stdint.h>
//#include "shared_buffers.h"
//#include "low_oran.h"
/*
* Structure added to bear the information needed from OAI RU
...
...
targets/ARCH/ETHERNET/oran/5g/shared_buffers.c
deleted
100644 → 0
View file @
64b683d4
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "shared_buffers.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void
init_buffers
(
shared_buffers
*
s
)
{
int
slot
;
memset
(
s
,
0
,
sizeof
(
*
s
));
for
(
slot
=
0
;
slot
<
20
;
slot
++
)
{
if
(
pthread_mutex_init
(
&
s
->
m_dl
[
slot
],
NULL
)
!=
0
||
pthread_cond_init
(
&
s
->
c_dl
[
slot
],
NULL
)
!=
0
||
pthread_mutex_init
(
&
s
->
m_ul
[
slot
],
NULL
)
!=
0
||
pthread_cond_init
(
&
s
->
c_ul
[
slot
],
NULL
)
!=
0
)
{
printf
(
"%s: error initializing mutex/cond
\n
"
,
__FUNCTION__
);
exit
(
1
);
}
}
/* the gNB's first transmitted DL slot is 6 but the device
* needs to have slots 1, 2 and 3, 4 and 5 ready. Let's pretend
* they are ready.
*/
s
->
dl_busy
[
0
][
1
]
=
0x3fff
;
s
->
dl_busy
[
0
][
2
]
=
0x3fff
;
s
->
dl_busy
[
0
][
3
]
=
0x3fff
;
s
->
dl_busy
[
0
][
4
]
=
0x3fff
;
s
->
dl_busy
[
0
][
5
]
=
0x3fff
;
s
->
dl_busy
[
1
][
1
]
=
0x3fff
;
s
->
dl_busy
[
1
][
2
]
=
0x3fff
;
s
->
dl_busy
[
1
][
3
]
=
0x3fff
;
s
->
dl_busy
[
1
][
4
]
=
0x3fff
;
s
->
dl_busy
[
1
][
5
]
=
0x3fff
;
}
void
lock_dl_buffer
(
shared_buffers
*
s
,
int
slot
)
{
if
(
pthread_mutex_lock
(
&
s
->
m_dl
[
slot
])
!=
0
)
{
printf
(
"%s: fatal: lock fails
\n
"
,
__FUNCTION__
);
exit
(
1
);
}
}
void
unlock_dl_buffer
(
shared_buffers
*
s
,
int
slot
)
{
if
(
pthread_mutex_unlock
(
&
s
->
m_dl
[
slot
])
!=
0
)
{
printf
(
"%s: fatal: unlock fails
\n
"
,
__FUNCTION__
);
exit
(
1
);
}
}
void
wait_dl_buffer
(
shared_buffers
*
s
,
int
slot
)
{
if
(
pthread_cond_wait
(
&
s
->
c_dl
[
slot
],
&
s
->
m_dl
[
slot
])
!=
0
)
{
printf
(
"%s: fatal: cond_wait fails
\n
"
,
__FUNCTION__
);
exit
(
1
);
}
}
void
signal_dl_buffer
(
shared_buffers
*
s
,
int
slot
)
{
if
(
pthread_cond_broadcast
(
&
s
->
c_dl
[
slot
])
!=
0
)
{
printf
(
"%s: fatal: cond_broadcast fails
\n
"
,
__FUNCTION__
);
exit
(
1
);
}
}
void
lock_ul_buffer
(
shared_buffers
*
s
,
int
slot
)
{
if
(
pthread_mutex_lock
(
&
s
->
m_ul
[
slot
])
!=
0
)
{
printf
(
"%s: fatal: lock fails
\n
"
,
__FUNCTION__
);
printf
(
"%s: fatal: lock fails slot %d
\n
"
,
__FUNCTION__
,
slot
);
exit
(
1
);
}
}
void
unlock_ul_buffer
(
shared_buffers
*
s
,
int
slot
)
{
if
(
pthread_mutex_unlock
(
&
s
->
m_ul
[
slot
])
!=
0
)
{
printf
(
"%s: fatal: unlock fails
\n
"
,
__FUNCTION__
);
exit
(
1
);
}
}
void
wait_ul_buffer
(
shared_buffers
*
s
,
int
slot
)
{
if
(
pthread_cond_wait
(
&
s
->
c_ul
[
slot
],
&
s
->
m_ul
[
slot
])
!=
0
)
{
printf
(
"%s: fatal: cond_wait fails
\n
"
,
__FUNCTION__
);
exit
(
1
);
}
}
void
signal_ul_buffer
(
shared_buffers
*
s
,
int
slot
)
{
if
(
pthread_cond_broadcast
(
&
s
->
c_ul
[
slot
])
!=
0
)
{
printf
(
"%s: fatal: cond_broadcast fails
\n
"
,
__FUNCTION__
);
exit
(
1
);
}
}
targets/ARCH/ETHERNET/oran/5g/shared_buffers.h
deleted
100644 → 0
View file @
64b683d4
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef _BENETEL_5G_SHARED_BUFFERS_H_
#define _BENETEL_5G_SHARED_BUFFERS_H_
#include <pthread.h>
#include <stdint.h>
typedef
struct
{
/* [2] is for two antennas */
unsigned
char
dl
[
2
][
20
][
14
*
1272
*
4
];
unsigned
char
ul
[
2
][
20
][
14
*
1272
*
4
];
uint16_t
dl_busy
[
2
][
20
];
uint16_t
ul_busy
[
2
][
20
];
pthread_mutex_t
m_ul
[
20
];
pthread_cond_t
c_ul
[
20
];
pthread_mutex_t
m_dl
[
20
];
pthread_cond_t
c_dl
[
20
];
unsigned
char
prach
[
20
][
849
*
4
];
unsigned
char
prach_busy
[
20
];
/* statistics/error counting */
int
ul_overflow
;
int
dl_underflow
;
}
shared_buffers
;
void
init_buffers
(
shared_buffers
*
s
);
void
lock_dl_buffer
(
shared_buffers
*
s
,
int
slot
);
void
unlock_dl_buffer
(
shared_buffers
*
s
,
int
slot
);
void
wait_dl_buffer
(
shared_buffers
*
s
,
int
slot
);
void
signal_dl_buffer
(
shared_buffers
*
s
,
int
slot
);
void
lock_ul_buffer
(
shared_buffers
*
s
,
int
slot
);
void
unlock_ul_buffer
(
shared_buffers
*
s
,
int
slot
);
void
wait_ul_buffer
(
shared_buffers
*
s
,
int
slot
);
void
signal_ul_buffer
(
shared_buffers
*
s
,
int
slot
);
#endif
/* _BENETEL_5G_SHARED_BUFFERS_H_ */
targets/ARCH/
ORAN_FHI/lib/xran_lib_wrap.h
pp
→
targets/ARCH/
ETHERNET/oran/5g/xran_lib_wrap.c
pp
View file @
870dbe29
This diff is collapsed.
Click to expand it.
targets/ARCH/ETHERNET/oran/5g/xran_lib_wrap.hpp
0 → 100644
View file @
870dbe29
/*******************************************************************************
*
* <COPYRIGHT_TAG>
*
*******************************************************************************/
#ifndef XRAN_LIB_WRAP_HPP
#define XRAN_LIB_WRAP_HPP
#include <exception>
#include <random>
#include <string>
#include <utility>
#include <vector>
#include <malloc.h>
#include <stdint.h>
#include "common.hpp"
#include "xran_fh_o_du.h"
#include "xran_common.h"
#include "xran_frame_struct.h"
#define XRAN_UT_CFG_FILENAME "conf.json"
#define XRAN_UT_KEY_GLOBALCFG "GLOBAL"
#define XRAN_UT_KEY_GLOBALCFG_IO "io_cfg"
#define XRAN_UT_KEY_GLOBALCFG_EAXCID "eAxCId_cfg"
#define XRAN_UT_KEY_GLOBALCFG_PRACH "prach_cfg"
#define XRAN_UT_KEY_GLOBALCFG_RU "ru_cfg"
#define XRAN_UT_KEY_GLOBALCFG_SLOT "slotcfg_"
#define MAX_NUM_OF_XRAN_CTX (2)
#define SW_FPGA_TOTAL_BUFFER_LEN (4*1024*1024*1024)
#define SW_FPGA_SEGMENT_BUFFER_LEN (1*1024*1024*1024)
#define SW_FPGA_FH_TOTAL_BUFFER_LEN (1*1024*1024*1024)
#define FPGA_TO_SW_PRACH_RX_BUFFER_LEN (8192)
#define MAX_ANT_CARRIER_SUPPORTED (XRAN_MAX_SECTOR_NR*XRAN_MAX_ANTENNA_NR)
extern
"C"
{
extern
uint32_t
xran_lib_ota_tti
;
extern
uint32_t
xran_lib_ota_sym
;
extern
uint32_t
xran_lib_ota_sym_idx
;
void
sym_ota_cb
(
struct
rte_timer
*
tim
,
void
*
arg
);
void
tti_ota_cb
(
struct
rte_timer
*
tim
,
void
*
arg
);
}
class
xranLibWraper
{
public:
typedef
enum
{
XRANFTHTX_OUT
=
0
,
XRANFTHTX_PRB_MAP_OUT
,
XRANFTHTX_SEC_DESC_OUT
,
XRANFTHRX_IN
,
XRANFTHRX_PRB_MAP_IN
,
XRANFTHTX_SEC_DESC_IN
,
XRANFTHRACH_IN
,
#if 1
XRANSRS_IN
,
// Added this entry as in sample app
#endif
MAX_SW_XRAN_INTERFACE_NUM
}
SWXRANInterfaceTypeEnum
;
enum
nChBw
{
PHY_BW_5MHZ
=
5
,
PHY_BW_10MHZ
=
10
,
PHY_BW_15MHZ
=
15
,
PHY_BW_20MHZ
=
20
,
PHY_BW_25MHZ
=
25
,
PHY_BW_30MHZ
=
30
,
PHY_BW_40MHZ
=
40
,
PHY_BW_50MHZ
=
50
,
PHY_BW_60MHZ
=
60
,
PHY_BW_70MHZ
=
70
,
PHY_BW_80MHZ
=
80
,
PHY_BW_90MHZ
=
90
,
PHY_BW_100MHZ
=
100
,
PHY_BW_200MHZ
=
200
,
PHY_BW_400MHZ
=
400
};
// F1 Tables 38.101-1 Table 5.3.2-1. Maximum transmission bandwidth configuration NRB
const
uint16_t
nNumRbsPerSymF1
[
3
][
13
]
=
{
// 5MHz 10MHz 15MHz 20MHz 25MHz 30MHz 40MHz 50MHz 60MHz 70MHz 80MHz 90MHz 100MHz
{
25
,
52
,
79
,
106
,
133
,
160
,
216
,
270
,
0
,
0
,
0
,
0
,
0
},
// Numerology 0 (15KHz)
{
11
,
24
,
38
,
51
,
65
,
78
,
106
,
133
,
162
,
0
,
217
,
245
,
273
},
// Numerology 1 (30KHz)
{
0
,
11
,
18
,
24
,
31
,
38
,
51
,
65
,
79
,
0
,
107
,
121
,
135
}
// Numerology 2 (60KHz)
};
// F2 Tables 38.101-2 Table 5.3.2-1. Maximum transmission bandwidth configuration NRB
const
uint16_t
nNumRbsPerSymF2
[
2
][
4
]
=
{
// 50MHz 100MHz 200MHz 400MHz
{
66
,
132
,
264
,
0
},
// Numerology 2 (60KHz)
{
32
,
66
,
132
,
264
}
// Numerology 3 (120KHz)
};
protected:
char
argv
[
25
]
=
"unittest"
;
std
::
string
m_dpdk_dev_up
,
m_dpdk_dev_cp
,
m_dpdk_bbdev
;
void
*
m_xranhandle
;
uint8_t
m_du_mac
[
6
]
=
{
0x00
,
0x11
,
0x22
,
0x33
,
0x44
,
0x55
};
// Sofia: this is hard coded here and then it is read from the conf file
uint8_t
m_ru_mac
[
6
]
=
{
0x00
,
0x11
,
0x22
,
0x33
,
0x44
,
0x66
};
// Sofia: this is hard coded here and then it is read from the conf file
bool
m_bSub6
;
uint32_t
m_nSlots
=
20
;
struct
xran_fh_config
m_xranConf
;
struct
xran_fh_init
m_xranInit
;
struct
xran_timer_ctx
{
uint32_t
tti_to_process
;
}
m_timer_ctx
[
MAX_NUM_OF_XRAN_CTX
];
/* io struct */
BbuIoBufCtrlStruct
m_sFrontHaulTxBbuIoBufCtrl
[
XRAN_N_FE_BUF_LEN
][
XRAN_MAX_SECTOR_NR
][
XRAN_MAX_ANTENNA_NR
];
BbuIoBufCtrlStruct
m_sFrontHaulTxPrbMapBbuIoBufCtrl
[
XRAN_N_FE_BUF_LEN
][
XRAN_MAX_SECTOR_NR
][
XRAN_MAX_ANTENNA_NR
];
BbuIoBufCtrlStruct
m_sFrontHaulRxBbuIoBufCtrl
[
XRAN_N_FE_BUF_LEN
][
XRAN_MAX_SECTOR_NR
][
XRAN_MAX_ANTENNA_NR
];
BbuIoBufCtrlStruct
m_sFrontHaulRxPrbMapBbuIoBufCtrl
[
XRAN_N_FE_BUF_LEN
][
XRAN_MAX_SECTOR_NR
][
XRAN_MAX_ANTENNA_NR
];
BbuIoBufCtrlStruct
m_sFHPrachRxBbuIoBufCtrl
[
XRAN_N_FE_BUF_LEN
][
XRAN_MAX_SECTOR_NR
][
XRAN_MAX_ANTENNA_NR
];
/* Cat B */
BbuIoBufCtrlStruct
m_sFHSrsRxBbuIoBufCtrl
[
XRAN_N_FE_BUF_LEN
][
XRAN_MAX_SECTOR_NR
][
XRAN_MAX_ANT_ARRAY_ELM_NR
];
/* buffers lists */
struct
xran_flat_buffer
m_sFrontHaulTxBuffers
[
XRAN_N_FE_BUF_LEN
][
XRAN_MAX_SECTOR_NR
][
XRAN_MAX_ANTENNA_NR
][
XRAN_NUM_OF_SYMBOL_PER_SLOT
];
struct
xran_flat_buffer
m_sFrontHaulTxPrbMapBuffers
[
XRAN_N_FE_BUF_LEN
][
XRAN_MAX_SECTOR_NR
][
XRAN_MAX_ANTENNA_NR
];
struct
xran_flat_buffer
m_sFrontHaulRxBuffers
[
XRAN_N_FE_BUF_LEN
][
XRAN_MAX_SECTOR_NR
][
XRAN_MAX_ANTENNA_NR
][
XRAN_NUM_OF_SYMBOL_PER_SLOT
];
struct
xran_flat_buffer
m_sFrontHaulRxPrbMapBuffers
[
XRAN_N_FE_BUF_LEN
][
XRAN_MAX_SECTOR_NR
][
XRAN_MAX_ANTENNA_NR
];
struct
xran_flat_buffer
m_sFHPrachRxBuffers
[
XRAN_N_FE_BUF_LEN
][
XRAN_MAX_SECTOR_NR
][
XRAN_MAX_ANTENNA_NR
][
XRAN_NUM_OF_SYMBOL_PER_SLOT
];
/* Cat B SRS buffers */
struct
xran_flat_buffer
m_sFHSrsRxBuffers
[
XRAN_N_FE_BUF_LEN
][
XRAN_MAX_SECTOR_NR
][
XRAN_MAX_ANT_ARRAY_ELM_NR
][
XRAN_MAX_NUM_OF_SRS_SYMBOL_PER_SLOT
];
void
*
m_nInstanceHandle
[
XRAN_PORTS_NUM
][
XRAN_MAX_SECTOR_NR
];
// instance per sector
uint32_t
m_nBufPoolIndex
[
XRAN_MAX_SECTOR_NR
][
MAX_SW_XRAN_INTERFACE_NUM
];
// every api owns unique buffer pool
uint32_t
m_nSW_ToFpga_FTH_TxBufferLen
;
uint32_t
m_nFpgaToSW_FTH_RxBufferLen
;
int32_t
m_nSectorIndex
[
XRAN_MAX_SECTOR_NR
];
int
iq_bfw_buffer_size_dl
=
0
;
int
iq_bfw_buffer_size_ul
=
0
;
/* beamforming weights for UL (O-DU) */
int16_t
*
p_tx_dl_bfw_buffer
[
MAX_ANT_CARRIER_SUPPORTED
];
int32_t
tx_dl_bfw_buffer_size
[
MAX_ANT_CARRIER_SUPPORTED
];
int32_t
tx_dl_bfw_buffer_position
[
MAX_ANT_CARRIER_SUPPORTED
];
/* beamforming weights for UL (O-DU) */
int16_t
*
p_tx_ul_bfw_buffer
[
MAX_ANT_CARRIER_SUPPORTED
];
int32_t
tx_ul_bfw_buffer_size
[
MAX_ANT_CARRIER_SUPPORTED
];
int32_t
tx_ul_bfw_buffer_position
[
MAX_ANT_CARRIER_SUPPORTED
];
private:
json
m_global_cfg
;
template
<
typename
T
>
T
get_globalcfg
(
const
std
::
string
&
type
,
const
std
::
string
&
parameter_name
)
{
return
m_global_cfg
[
XRAN_UT_KEY_GLOBALCFG
][
type
][
parameter_name
];
}
template
<
typename
T
>
std
::
vector
<
T
>
get_globalcfg_array
(
const
std
::
string
&
type
,
const
std
::
string
&
parameter_name
)
{
auto
array_size
=
m_global_cfg
[
XRAN_UT_KEY_GLOBALCFG
][
type
][
parameter_name
].
size
();
std
::
vector
<
T
>
result
(
array_size
);
for
(
unsigned
number
=
0
;
number
<
array_size
;
number
++
)
result
.
at
(
number
)
=
m_global_cfg
[
XRAN_UT_KEY_GLOBALCFG
][
type
][
parameter_name
][
number
];
return
result
;
}
uint16_t
get_eaxcid_mask
(
int
numbit
,
int
shift
);
int
init_memory
();
public:
// Class constructor
xranLibWraper
();
// Class Distructor
~
xranLibWraper
();
int
SetUp
();
void
TearDown
();
int
Init
(
struct
xran_fh_config
*
pCfg
=
nullptr
);
void
Cleanup
();
void
Open
(
xran_ethdi_mbuf_send_fn
send_cp
,
xran_ethdi_mbuf_send_fn
send_up
,
void
*
fh_rx_callback
,
void
*
fh_rx_prach_callback
,
void
*
fh_srs_callback
);
void
Close
();
int
Start
();
int
Stop
();
/* emulation of timer */
void
update_tti
();
void
update_symbol_index
();
int
apply_cpenable
(
bool
flag
);
int
get_slot_config
(
const
std
::
string
&
cfgname
,
struct
xran_frame_config
*
pCfg
);
int
get_num_rbs
(
uint32_t
nNumerology
,
uint32_t
nBandwidth
,
bool
nSub6
);
void
*
get_xranhandle
();
void
*
get_timer_ctx
();
int
get_symbol_index
();
bool
is_running
();
enum
xran_category
get_rucategory
();
int
get_numerology
();
int
get_duplextype
();
int
get_num_cc
();
int
get_num_eaxc
();
int
get_num_eaxc_ul
();
int
get_num_dlrbs
();
int
get_num_ulrbs
();
int
get_num_antelmtrx
();
bool
is_cpenable
();
bool
is_prachenable
();
bool
is_dynamicsection
();
bool
get_sub6
();
void
get_cfg_prach
(
struct
xran_prach_config
*
pCfg
);
void
get_cfg_frame
(
struct
xran_frame_config
*
pCfg
);
void
get_cfg_ru
(
struct
xran_ru_config
*
pCfg
);
void
get_cfg_fh
(
struct
xran_fh_config
*
pCfg
);
};
/* external declaration for the instance */
extern
xranLibWraper
*
xranlib
;
#endif //XRAN_LIB_WRAP_HPP
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment