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
lizhongxiao
OpenXG-RAN
Commits
7ff37059
Commit
7ff37059
authored
Sep 14, 2018
by
Florian Kaltenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding basic simulator support to nr softmodems. however, simulator not yet functional.
parent
d326da0d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
39 deletions
+61
-39
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+17
-6
openair2/LAYER2/MAC/eNB_scheduler.c
openair2/LAYER2/MAC/eNB_scheduler.c
+2
-1
targets/ARCH/tcp_bridge/tcp_bridge.c
targets/ARCH/tcp_bridge/tcp_bridge.c
+4
-2
targets/ARCH/tcp_bridge/tcp_bridge_oai.c
targets/ARCH/tcp_bridge/tcp_bridge_oai.c
+4
-3
targets/RT/USER/nr-ue.c
targets/RT/USER/nr-ue.c
+34
-27
No files found.
cmake_targets/CMakeLists.txt
View file @
7ff37059
...
@@ -1453,6 +1453,9 @@ set(L2_SRC
...
@@ -1453,6 +1453,9 @@ set(L2_SRC
${
RRC_DIR
}
/L2_interface.c
${
RRC_DIR
}
/L2_interface.c
${
RRC_DIR
}
/L2_interface_common.c
${
RRC_DIR
}
/L2_interface_common.c
${
RRC_DIR
}
/L2_interface_ue.c
${
RRC_DIR
}
/L2_interface_ue.c
)
set
(
NR_L2_SRC
${
NR_RRC_DIR
}
/rrc_gNB.c
${
NR_RRC_DIR
}
/rrc_gNB.c
${
NR_RRC_DIR
}
/nr_rrc_common.c
${
NR_RRC_DIR
}
/nr_rrc_common.c
${
NR_RRC_DIR
}
/L2_nr_interface.c
${
NR_RRC_DIR
}
/L2_nr_interface.c
...
@@ -1529,7 +1532,10 @@ set (MAC_SRC
...
@@ -1529,7 +1532,10 @@ set (MAC_SRC
${
MAC_DIR
}
/eNB_scheduler_phytest.c
${
MAC_DIR
}
/eNB_scheduler_phytest.c
${
MAC_DIR
}
/pre_processor.c
${
MAC_DIR
}
/pre_processor.c
${
MAC_DIR
}
/config.c
${
MAC_DIR
}
/config.c
#${MAC_DIR}/config_ue.c
${
MAC_DIR
}
/config_ue.c
)
set
(
NR_MAC_SRC
${
NR_PHY_INTERFACE_DIR
}
/NR_IF_Module.c
${
NR_PHY_INTERFACE_DIR
}
/NR_IF_Module.c
${
NR_MAC_DIR
}
/main.c
${
NR_MAC_DIR
}
/main.c
${
NR_MAC_DIR
}
/config.c
${
NR_MAC_DIR
}
/config.c
...
@@ -1573,8 +1579,13 @@ add_library(L2
...
@@ -1573,8 +1579,13 @@ add_library(L2
${
L2_SRC
}
${
L2_SRC
}
${
MAC_SRC
}
${
MAC_SRC
}
${
ENB_APP_SRC
}
${
ENB_APP_SRC
}
${
GNB_APP_SRC
}
)
)
# ${OPENAIR2_DIR}/RRC/L2_INTERFACE/openair_rrc_L2_interface.c)
add_library
(
NR_L2
${
NR_L2_SRC
}
${
NR_MAC_SRC
}
${
GNB_APP_SRC
}
)
add_library
(
L2_UE
add_library
(
L2_UE
${
L2_SRC_UE
}
${
L2_SRC_UE
}
...
@@ -2345,7 +2356,7 @@ target_link_libraries (nr-softmodem
...
@@ -2345,7 +2356,7 @@ target_link_libraries (nr-softmodem
-Wl,--start-group
-Wl,--start-group
UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA
UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA
${
ITTI_LIB
}
${
FLPT_MSG_LIB
}
${
ASYNC_IF_LIB
}
${
FLEXRAN_AGENT_LIB
}
LFDS7
${
MSC_LIB
}
${
RAL_LIB
}
${
NAS_UE_LIB
}
${
ATLAS_LIBRARIES
}
${
ITTI_LIB
}
${
FLPT_MSG_LIB
}
${
ASYNC_IF_LIB
}
${
FLEXRAN_AGENT_LIB
}
LFDS7
${
MSC_LIB
}
${
RAL_LIB
}
${
NAS_UE_LIB
}
${
ATLAS_LIBRARIES
}
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB L2
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB L2
NR_L2
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
-Wl,--end-group z dl
)
-Wl,--end-group z dl
)
...
@@ -2385,7 +2396,7 @@ target_link_libraries (nr-softmodem-nos1
...
@@ -2385,7 +2396,7 @@ target_link_libraries (nr-softmodem-nos1
-Wl,--start-group
-Wl,--start-group
UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA
UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA
${
ITTI_LIB
}
${
FLPT_MSG_LIB
}
${
ASYNC_IF_LIB
}
${
FLEXRAN_AGENT_LIB
}
LFDS7
${
MSC_LIB
}
${
RAL_LIB
}
${
NAS_UE_LIB
}
${
MIH_LIB
}
${
ITTI_LIB
}
${
FLPT_MSG_LIB
}
${
ASYNC_IF_LIB
}
${
FLEXRAN_AGENT_LIB
}
LFDS7
${
MSC_LIB
}
${
RAL_LIB
}
${
NAS_UE_LIB
}
${
MIH_LIB
}
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB L2
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB L2
NR_L2
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
-Wl,--end-group z dl
)
-Wl,--end-group z dl
)
...
...
openair2/LAYER2/MAC/eNB_scheduler.c
View file @
7ff37059
...
@@ -667,7 +667,8 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP,
...
@@ -667,7 +667,8 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP,
/*
/*
if((subframeP == 0) && (frameP & 7) == 0){
if((subframeP == 0) && (frameP & 7) == 0){
schedule_nr_mib(module_idP, frameP, subframeP);
schedule_nr_mib(module_idP, frameP, subframeP);
}*/
}
*/
if
(
phy_test
==
0
){
if
(
phy_test
==
0
){
// This schedules SI for legacy LTE and eMTC starting in subframeP
// This schedules SI for legacy LTE and eMTC starting in subframeP
...
...
targets/ARCH/tcp_bridge/tcp_bridge.c
View file @
7ff37059
...
@@ -250,10 +250,11 @@ int device_init(openair0_device* device, openair0_config_t *openair0_cfg)
...
@@ -250,10 +250,11 @@ int device_init(openair0_device* device, openair0_config_t *openair0_cfg)
memset
(
tcp_bridge
,
0
,
sizeof
(
tcp_bridge_state_t
));
memset
(
tcp_bridge
,
0
,
sizeof
(
tcp_bridge_state_t
));
/* only 25 or 50 PRBs handled for the moment */
/* only 25 or 50 PRBs handled for the moment */
if
(
openair0_cfg
[
0
].
sample_rate
!=
30720000
&&
if
(
openair0_cfg
[
0
].
sample_rate
!=
61440000
&&
openair0_cfg
[
0
].
sample_rate
!=
30720000
&&
openair0_cfg
[
0
].
sample_rate
!=
15360000
&&
openair0_cfg
[
0
].
sample_rate
!=
15360000
&&
openair0_cfg
[
0
].
sample_rate
!=
7680000
)
{
openair0_cfg
[
0
].
sample_rate
!=
7680000
)
{
printf
(
"tcp_bridge: ERROR: only
25, 50 or 100 PRB
s supported
\n
"
);
printf
(
"tcp_bridge: ERROR: only
sample rate 61.44, 30.72, 15.36, and 7.68 Msp
s supported
\n
"
);
exit
(
1
);
exit
(
1
);
}
}
...
@@ -270,6 +271,7 @@ int device_init(openair0_device* device, openair0_config_t *openair0_cfg)
...
@@ -270,6 +271,7 @@ int device_init(openair0_device* device, openair0_config_t *openair0_cfg)
device
->
priv
=
tcp_bridge
;
device
->
priv
=
tcp_bridge
;
switch
((
int
)
openair0_cfg
[
0
].
sample_rate
)
{
switch
((
int
)
openair0_cfg
[
0
].
sample_rate
)
{
case
61440000
:
tcp_bridge
->
samples_per_subframe
=
61440
;
break
;
case
30720000
:
tcp_bridge
->
samples_per_subframe
=
30720
;
break
;
case
30720000
:
tcp_bridge
->
samples_per_subframe
=
30720
;
break
;
case
15360000
:
tcp_bridge
->
samples_per_subframe
=
15360
;
break
;
case
15360000
:
tcp_bridge
->
samples_per_subframe
=
15360
;
break
;
case
7680000
:
tcp_bridge
->
samples_per_subframe
=
7680
;
break
;
case
7680000
:
tcp_bridge
->
samples_per_subframe
=
7680
;
break
;
...
...
targets/ARCH/tcp_bridge/tcp_bridge_oai.c
View file @
7ff37059
...
@@ -280,11 +280,11 @@ int device_init(openair0_device* device, openair0_config_t *openair0_cfg)
...
@@ -280,11 +280,11 @@ int device_init(openair0_device* device, openair0_config_t *openair0_cfg)
printf
(
"tcp_bridge: running as %s
\n
"
,
tcp_bridge
->
is_enb
?
"eNB"
:
"UE"
);
printf
(
"tcp_bridge: running as %s
\n
"
,
tcp_bridge
->
is_enb
?
"eNB"
:
"UE"
);
/* only 25, 50 or 100 PRBs handled for the moment */
if
(
openair0_cfg
[
0
].
sample_rate
!=
61440000
&&
if
(
openair0_cfg
[
0
].
sample_rate
!=
30720000
&&
openair0_cfg
[
0
].
sample_rate
!=
30720000
&&
openair0_cfg
[
0
].
sample_rate
!=
15360000
&&
openair0_cfg
[
0
].
sample_rate
!=
15360000
&&
openair0_cfg
[
0
].
sample_rate
!=
7680000
)
{
openair0_cfg
[
0
].
sample_rate
!=
7680000
)
{
printf
(
"tcp_bridge: ERROR: only
25, 50 or 100 PRB
s supported
\n
"
);
printf
(
"tcp_bridge: ERROR: only
sample rate 61.44, 30.72, 15.36, and 7.68 Msp
s supported
\n
"
);
exit
(
1
);
exit
(
1
);
}
}
...
@@ -306,6 +306,7 @@ int device_init(openair0_device* device, openair0_config_t *openair0_cfg)
...
@@ -306,6 +306,7 @@ int device_init(openair0_device* device, openair0_config_t *openair0_cfg)
device
->
priv
=
tcp_bridge
;
device
->
priv
=
tcp_bridge
;
switch
((
int
)
openair0_cfg
[
0
].
sample_rate
)
{
switch
((
int
)
openair0_cfg
[
0
].
sample_rate
)
{
case
61440000
:
tcp_bridge
->
samples_per_subframe
=
61440
;
break
;
case
30720000
:
tcp_bridge
->
samples_per_subframe
=
30720
;
break
;
case
30720000
:
tcp_bridge
->
samples_per_subframe
=
30720
;
break
;
case
15360000
:
tcp_bridge
->
samples_per_subframe
=
15360
;
break
;
case
15360000
:
tcp_bridge
->
samples_per_subframe
=
15360
;
break
;
case
7680000
:
tcp_bridge
->
samples_per_subframe
=
7680
;
break
;
case
7680000
:
tcp_bridge
->
samples_per_subframe
=
7680
;
break
;
...
...
targets/RT/USER/nr-ue.c
View file @
7ff37059
...
@@ -755,6 +755,9 @@ static void *UE_thread_rxn_txnp4(void *arg) {
...
@@ -755,6 +755,9 @@ static void *UE_thread_rxn_txnp4(void *arg) {
exit_fun
(
"noting to add"
);
exit_fun
(
"noting to add"
);
}
}
proc
->
instance_cnt_rxtx
--
;
proc
->
instance_cnt_rxtx
--
;
#if BASIC_SIMULATOR
if
(
pthread_cond_signal
(
&
proc
->
cond_rxtx
)
!=
0
)
abort
();
#endif
if
(
pthread_mutex_unlock
(
&
proc
->
mutex_rxtx
)
!=
0
)
{
if
(
pthread_mutex_unlock
(
&
proc
->
mutex_rxtx
)
!=
0
)
{
LOG_E
(
PHY
,
"[SCHED][UE] error unlocking mutex for UE RXTX
\n
"
);
LOG_E
(
PHY
,
"[SCHED][UE] error unlocking mutex for UE RXTX
\n
"
);
exit_fun
(
"noting to add"
);
exit_fun
(
"noting to add"
);
...
@@ -822,6 +825,12 @@ void *UE_thread(void *arg) {
...
@@ -822,6 +825,12 @@ void *UE_thread(void *arg) {
AssertFatal
(
0
==
pthread_mutex_unlock
(
&
UE
->
proc
.
mutex_synch
),
""
);
AssertFatal
(
0
==
pthread_mutex_unlock
(
&
UE
->
proc
.
mutex_synch
),
""
);
if
(
is_synchronized
==
0
)
{
if
(
is_synchronized
==
0
)
{
#if BASIC_SIMULATOR
while
(
!
((
instance_cnt_synch
=
UE
->
proc
.
instance_cnt_synch
)
<
0
))
{
printf
(
"ue sync not ready
\n
"
);
usleep
(
500
*
1000
);
}
#endif
if
(
instance_cnt_synch
<
0
)
{
// we can invoke the synch
if
(
instance_cnt_synch
<
0
)
{
// we can invoke the synch
// grab 10 ms of signal and wakeup synch thread
// grab 10 ms of signal and wakeup synch thread
for
(
int
i
=
0
;
i
<
UE
->
frame_parms
.
nb_antennas_rx
;
i
++
)
for
(
int
i
=
0
;
i
<
UE
->
frame_parms
.
nb_antennas_rx
;
i
++
)
...
@@ -834,6 +843,7 @@ void *UE_thread(void *arg) {
...
@@ -834,6 +843,7 @@ void *UE_thread(void *arg) {
rxp
,
rxp
,
UE
->
frame_parms
.
samples_per_subframe
*
10
,
UE
->
frame_parms
.
samples_per_subframe
*
10
,
UE
->
frame_parms
.
nb_antennas_rx
),
""
);
UE
->
frame_parms
.
nb_antennas_rx
),
""
);
AssertFatal
(
0
==
pthread_mutex_lock
(
&
UE
->
proc
.
mutex_synch
),
""
);
AssertFatal
(
0
==
pthread_mutex_lock
(
&
UE
->
proc
.
mutex_synch
),
""
);
instance_cnt_synch
=
++
UE
->
proc
.
instance_cnt_synch
;
instance_cnt_synch
=
++
UE
->
proc
.
instance_cnt_synch
;
if
(
instance_cnt_synch
==
0
)
{
if
(
instance_cnt_synch
==
0
)
{
...
@@ -869,28 +879,13 @@ void *UE_thread(void *arg) {
...
@@ -869,28 +879,13 @@ void *UE_thread(void *arg) {
start_rx_stream
=
1
;
start_rx_stream
=
1
;
if
(
UE
->
mode
!=
loop_through_memory
)
{
if
(
UE
->
mode
!=
loop_through_memory
)
{
if
(
UE
->
no_timing_correction
==
0
)
{
if
(
UE
->
no_timing_correction
==
0
)
{
printf
(
"before resync
\n
"
);
LOG_I
(
PHY
,
"Resynchronizing RX by %d samples (mode = %d)
\n
"
,
UE
->
rx_offset
,
UE
->
mode
);
//nr_slot_fep(UE,0, 0, UE->rx_offset, 1, 1, NR_PDCCH_EST);
//nr_slot_fep(UE,1, 0, UE->rx_offset, 1, 1, NR_PDCCH_EST);
//write_output("txdata_pre.m", "txdata_pre", UE->common_vars.rxdata[0], UE->frame_parms.samples_per_subframe*10, 1, 1);
/*LOG_I(PHY,"Resynchronizing RX by %d samples (mode = %d)\n",UE->rx_offset,UE->mode);
AssertFatal
(
UE
->
rx_offset
==
AssertFatal
(
UE
->
rx_offset
==
UE
->
rfdevice
.
trx_read_func
(
&
UE
->
rfdevice
,
UE
->
rfdevice
.
trx_read_func
(
&
UE
->
rfdevice
,
&
timestamp
,
&
timestamp
,
(
void
**
)
UE
->
common_vars
.
rxdata
,
(
void
**
)
UE
->
common_vars
.
rxdata
,
UE
->
rx_offset
,
UE
->
rx_offset
,
UE
->
frame_parms
.
nb_antennas_rx
),
""
);
UE
->
frame_parms
.
nb_antennas_rx
),
""
);
AssertFatal(UE->frame_parms.samples_per_subframe*10 ==
UE->rfdevice.trx_read_func(&UE->rfdevice,
×tamp,
(void**)UE->common_vars.rxdata,
UE->frame_parms.samples_per_subframe*10,
UE->frame_parms.nb_antennas_rx),"");*/
//write_output("txdataF_ue.m", "txdataF_ue", UE->common_vars.rxdata[0], UE->frame_parms.samples_per_subframe*10, 1, 1);
}
}
UE
->
rx_offset
=
0
;
UE
->
rx_offset
=
0
;
UE
->
time_sync_cell
=
0
;
UE
->
time_sync_cell
=
0
;
...
@@ -923,6 +918,17 @@ void *UE_thread(void *arg) {
...
@@ -923,6 +918,17 @@ void *UE_thread(void *arg) {
// update thread index for received subframe
// update thread index for received subframe
UE
->
current_thread_id
[
tti_nr
]
=
thread_idx
;
UE
->
current_thread_id
[
tti_nr
]
=
thread_idx
;
#if BASIC_SIMULATOR
{
int
t
;
for
(
t
=
0
;
t
<
2
;
t
++
)
{
UE_rxtx_proc_t
*
proc
=
&
UE
->
proc
.
proc_rxtx
[
t
];
pthread_mutex_lock
(
&
proc
->
mutex_rxtx
);
while
(
proc
->
instance_cnt_rxtx
>=
0
)
pthread_cond_wait
(
&
proc
->
cond_rxtx
,
&
proc
->
mutex_rxtx
);
pthread_mutex_unlock
(
&
proc
->
mutex_rxtx
);
}
}
#endif
LOG_D
(
PHY
,
"Process TTI %d thread Idx %d
\n
"
,
tti_nr
,
UE
->
current_thread_id
[
tti_nr
]);
LOG_D
(
PHY
,
"Process TTI %d thread Idx %d
\n
"
,
tti_nr
,
UE
->
current_thread_id
[
tti_nr
]);
thread_idx
++
;
thread_idx
++
;
...
@@ -962,7 +968,7 @@ void *UE_thread(void *arg) {
...
@@ -962,7 +968,7 @@ void *UE_thread(void *arg) {
UE
->
rx_offset_diff
;
UE
->
rx_offset_diff
;
}
}
/*
AssertFatal(readBlockSize ==
AssertFatal
(
readBlockSize
==
UE
->
rfdevice
.
trx_read_func
(
&
UE
->
rfdevice
,
UE
->
rfdevice
.
trx_read_func
(
&
UE
->
rfdevice
,
&
timestamp
,
&
timestamp
,
rxp
,
rxp
,
...
@@ -977,17 +983,18 @@ void *UE_thread(void *arg) {
...
@@ -977,17 +983,18 @@ void *UE_thread(void *arg) {
txp
,
txp
,
writeBlockSize
,
writeBlockSize
,
UE
->
frame_parms
.
nb_antennas_tx
,
UE
->
frame_parms
.
nb_antennas_tx
,
1),"");*/
1
),
""
);
if
(
tti_nr
==
(
ttis_per_frame
-
1
))
{
if
(
tti_nr
==
(
ttis_per_frame
-
1
))
{
// read in first symbol of next frame and adjust for timing drift
// read in first symbol of next frame and adjust for timing drift
int
first_symbols
=
writeBlockSize
-
readBlockSize
;
int
first_symbols
=
writeBlockSize
-
readBlockSize
;
if
(
first_symbols
>
0
)
if
(
first_symbols
>
0
)
/*
AssertFatal(first_symbols ==
AssertFatal
(
first_symbols
==
UE
->
rfdevice
.
trx_read_func
(
&
UE
->
rfdevice
,
UE
->
rfdevice
.
trx_read_func
(
&
UE
->
rfdevice
,
&
timestamp1
,
&
timestamp1
,
(
void
**
)
UE
->
common_vars
.
rxdata
,
(
void
**
)
UE
->
common_vars
.
rxdata
,
first_symbols
,
first_symbols
,
UE->frame_parms.nb_antennas_rx),"");
*/
UE
->
frame_parms
.
nb_antennas_rx
),
""
);
if
(
first_symbols
<
0
)
if
(
first_symbols
<
0
)
LOG_E
(
PHY
,
"can't compensate: diff =%d
\n
"
,
first_symbols
);
LOG_E
(
PHY
,
"can't compensate: diff =%d
\n
"
,
first_symbols
);
}
}
...
...
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