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
0ba0422d
Commit
0ba0422d
authored
Jun 24, 2019
by
laurent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add simple main
parent
9371c569
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
1282 additions
and
208 deletions
+1282
-208
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+34
-0
executables/dl_fs6.c
executables/dl_fs6.c
+64
-68
executables/simple_main.c
executables/simple_main.c
+1121
-0
executables/transport_split.c
executables/transport_split.c
+30
-23
targets/ARCH/rfsimulator/simulator.c
targets/ARCH/rfsimulator/simulator.c
+0
-3
targets/RT/USER/lte-enb.c
targets/RT/USER/lte-enb.c
+1
-1
targets/RT/USER/lte-ru.c
targets/RT/USER/lte-ru.c
+24
-104
targets/RT/USER/lte-softmodem.c
targets/RT/USER/lte-softmodem.c
+8
-9
No files found.
cmake_targets/CMakeLists.txt
View file @
0ba0422d
...
@@ -2115,6 +2115,40 @@ target_link_libraries (lte-softmodem
...
@@ -2115,6 +2115,40 @@ target_link_libraries (lte-softmodem
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
)
add_executable
(
simple-softmodem
${
OPENAIR_TARGETS
}
/RT/USER/rt_wrapper.c
${
OPENAIR_DIR
}
/executables/simple_main.c
${
OPENAIR_TARGETS
}
/RT/USER/lte-softmodem.c
${
OPENAIR_TARGETS
}
/RT/USER/lte-softmodem-common.c
${
OPENAIR2_DIR
}
/ENB_APP/NB_IoT_interface.c
${
OPENAIR1_DIR
}
/SIMULATION/TOOLS/taus.c
${
OPENAIR_TARGETS
}
/COMMON/create_tasks.c
${
OPENAIR_TARGETS
}
/ARCH/COMMON/common_lib.c
${
OPENAIR2_DIR
}
/RRC/NAS/nas_config.c
${
OPENAIR2_DIR
}
/RRC/NAS/rb_config.c
${
OPENAIR1_DIR
}
/SIMULATION/ETH_TRANSPORT/netlink_init.c
${
OPENAIR1_DIR
}
/SIMULATION/ETH_TRANSPORT/multicast_link.c
${
OPENAIR1_DIR
}
/SIMULATION/ETH_TRANSPORT/socket.c
${
OPENAIR3_DIR
}
/NAS/UE/nas_ue_task.c
${
OPENAIR_DIR
}
/common/utils/utils.c
${
OPENAIR_DIR
}
/common/utils/system.c
${
GTPU_need_ITTI
}
${
XFORMSINTERFACE_SOURCE
}
${
T_SOURCE
}
${
CONFIG_SOURCES
}
${
SHLIB_LOADER_SOURCES
}
)
add_dependencies
(
simple-softmodem rrc_flag s1ap_flag x2_flag
)
target_link_libraries
(
simple-softmodem
-Wl,--start-group
RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP X2AP_LIB X2AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2
${
MSC_LIB
}
${
RAL_LIB
}
${
NAS_UE_LIB
}
${
ITTI_LIB
}
${
FLPT_MSG_LIB
}
${
ASYNC_IF_LIB
}
${
FLEXRAN_AGENT_LIB
}
${
FSPT_MSG_LIB
}
${
PROTO_AGENT_LIB
}
LFDS7
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
-Wl,--end-group z dl
)
target_link_libraries
(
simple-softmodem
${
LIBXML2_LIBRARIES
}
pthread m
${
CONFIG_LIBRARIES
}
rt crypt
${
CRYPTO_LIBRARIES
}
${
OPENSSL_LIBRARIES
}
${
NETTLE_LIBRARIES
}
sctp
${
PROTOBUF_LIB
}
${
CMAKE_DL_LIBS
}
${
LIBYAML_LIBRARIES
}
${
LIB_LMS_LIBRARIES
}
${
T_LIB
}
)
add_executable
(
cu_test
add_executable
(
cu_test
${
OPENAIR2_DIR
}
/LAYER2/PROTO_AGENT/cu_test.c
${
OPENAIR2_DIR
}
/LAYER2/PROTO_AGENT/cu_test.c
${
OPENAIR2_DIR
}
/LAYER2/PROTO_AGENT/proto_agent_handler.c
${
OPENAIR2_DIR
}
/LAYER2/PROTO_AGENT/proto_agent_handler.c
...
...
executables/dl_fs6.c
View file @
0ba0422d
...
@@ -8,7 +8,6 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
...
@@ -8,7 +8,6 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
LTE_eNB_DLSCH_t
*
dlsch1
,
LTE_eNB_DLSCH_t
*
dlsch1
,
LTE_eNB_UE_stats
*
ue_stats
,
LTE_eNB_UE_stats
*
ue_stats
,
int
ra_flag
)
{
int
ra_flag
)
{
int
frame
=
proc
->
frame_tx
;
int
frame
=
proc
->
frame_tx
;
int
subframe
=
proc
->
subframe_tx
;
int
subframe
=
proc
->
subframe_tx
;
LTE_DL_eNB_HARQ_t
*
dlsch_harq
=
dlsch
->
harq_processes
[
harq_pid
];
LTE_DL_eNB_HARQ_t
*
dlsch_harq
=
dlsch
->
harq_processes
[
harq_pid
];
...
@@ -16,7 +15,6 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
...
@@ -16,7 +15,6 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
// 36-212
// 36-212
if
(
NFAPI_MODE
==
NFAPI_MONOLITHIC
||
NFAPI_MODE
==
NFAPI_MODE_PNF
)
{
// monolthic OR PNF - do not need turbo encoding on VNF
if
(
NFAPI_MODE
==
NFAPI_MONOLITHIC
||
NFAPI_MODE
==
NFAPI_MODE_PNF
)
{
// monolthic OR PNF - do not need turbo encoding on VNF
// Replace dlsch_encoding
// Replace dlsch_encoding
// data is in
// data is in
// dlsch->harq_processes[harq_pid]->e
// dlsch->harq_processes[harq_pid]->e
...
@@ -33,7 +31,6 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
...
@@ -33,7 +31,6 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
&
eNB
->
dlsch_turbo_encoding_wakeup_stats0
,
&
eNB
->
dlsch_turbo_encoding_wakeup_stats0
,
&
eNB
->
dlsch_turbo_encoding_wakeup_stats1
,
&
eNB
->
dlsch_turbo_encoding_wakeup_stats1
,
&
eNB
->
dlsch_interleaving_stats
);
&
eNB
->
dlsch_interleaving_stats
);
// 36-211
// 36-211
dlsch_scrambling
(
fp
,
dlsch_scrambling
(
fp
,
0
,
0
,
...
@@ -65,7 +62,6 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
...
@@ -65,7 +62,6 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
}
}
phy_procedures_eNB_TX_fs6
()
{
phy_procedures_eNB_TX_fs6
()
{
receiveSubFrame
();
receiveSubFrame
();
// We got
// We got
...
@@ -124,6 +120,7 @@ phy_procedures_eNB_TX_fs6() {
...
@@ -124,6 +120,7 @@ phy_procedures_eNB_TX_fs6() {
num_pdcch_symbols
=
eNB
->
pdcch_vars
[
subframe
&
1
].
num_pdcch_symbols
;
num_pdcch_symbols
=
eNB
->
pdcch_vars
[
subframe
&
1
].
num_pdcch_symbols
;
num_dci
=
eNB
->
pdcch_vars
[
subframe
&
1
].
num_dci
;
num_dci
=
eNB
->
pdcch_vars
[
subframe
&
1
].
num_dci
;
if
(
num_dci
>
0
)
if
(
num_dci
>
0
)
if
(
NFAPI_MODE
==
NFAPI_MONOLITHIC
||
NFAPI_MODE
==
NFAPI_MODE_PNF
)
{
if
(
NFAPI_MODE
==
NFAPI_MONOLITHIC
||
NFAPI_MODE
==
NFAPI_MODE_PNF
)
{
generate_dci_top
(
num_pdcch_symbols
,
generate_dci_top
(
num_pdcch_symbols
,
...
@@ -176,10 +173,10 @@ phy_procedures_eNB_TX_fs6() {
...
@@ -176,10 +173,10 @@ phy_procedures_eNB_TX_fs6() {
dlsch0
->
subframe_tx
[
subframe
]
=
0
;
dlsch0
->
subframe_tx
[
subframe
]
=
0
;
}
}
}
}
generate_phich_top
(
eNB
,
generate_phich_top
(
eNB
,
proc
,
proc
,
AMP
);
AMP
);
}
}
DL_thread_fs6
()
{
DL_thread_fs6
()
{
...
@@ -194,5 +191,4 @@ DL_thread_fs6() {
...
@@ -194,5 +191,4 @@ DL_thread_fs6() {
DL_thread_frequency
()
{
DL_thread_frequency
()
{
frequency_t
header
;
frequency_t
header
;
full_read
(
&
header
,
full_read
(
&
header
,
\ No newline at end of file
executables/simple_main.c
0 → 100644
View file @
0ba0422d
This diff is collapsed.
Click to expand it.
executables/transport_split.c
View file @
0ba0422d
...
@@ -7,14 +7,14 @@ int createListner (port) {
...
@@ -7,14 +7,14 @@ int createListner (port) {
sin_family:
sin_family:
AF_INET
,
AF_INET
,
sin_port:
sin_port:
htons
(
port
),
htons
(
port
),
sin_addr:
sin_addr:
{
s_addr
:
INADDR_ANY
}
{
s_addr
:
INADDR_ANY
}
};
};
int
enable
=
1
;
int
enable
=
1
;
AssertFatal
(
setsockopt
(
eth
->
sockfdc
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
enable
,
sizeof
(
enable
))
==
0
,
""
);
AssertFatal
(
setsockopt
(
eth
->
sockfdc
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
enable
,
sizeof
(
enable
))
==
0
,
""
);
AssertFatal
(
bind
(
sock
,
const
struct
sockaddr
*
addr
,
socklen_t
addrlen
)
==
0
,
""
);
AssertFatal
(
bind
(
sock
,
const
struct
sockaddr
*
addr
,
socklen_t
addrlen
)
==
0
,
""
);
struct
timeval
tv
=
{
0
,
UDP_TIMEOUT
};
struct
timeval
tv
=
{
0
,
UDP_TIMEOUT
};
AssertFatal
(
setsockopt
(
sock
,
SOL_SOCKET
,
SO_RCVTIMEO
,
&
tv
,
sizeof
(
tv
))
==
0
,
""
);
AssertFatal
(
setsockopt
(
sock
,
SOL_SOCKET
,
SO_RCVTIMEO
,
&
tv
,
sizeof
(
tv
))
==
0
,
""
);
// Make a send/recv buffer larger than a a couple of subframe
// Make a send/recv buffer larger than a a couple of subframe
// so the kernel will store for us in and out paquets
// so the kernel will store for us in and out paquets
...
@@ -26,11 +26,13 @@ sin_addr:
...
@@ -26,11 +26,13 @@ sin_addr:
// sock: udp socket
// sock: udp socket
// expectedTS: the expected timestamp, 0 if unknown
// expectedTS: the expected timestamp, 0 if unknown
// bufferZone: a reception area of bufferSize
// bufferZone: a reception area of bufferSize
int
receiveSubFrame
(
int
sock
,
uint64_t
expectedTS
,
void
*
bufferZone
,
int
bufferSize
)
{
int
receiveSubFrame
(
int
sock
,
uint64_t
expectedTS
,
void
*
bufferZone
,
int
bufferSize
)
{
int
rcved
=
0
;
int
rcved
=
0
;
do
{
do
{
//read all subframe data from the control unit
//read all subframe data from the control unit
int
ret
=
recv
(
sock
,
bufferZone
,
bufferSize
,
0
);
int
ret
=
recv
(
sock
,
bufferZone
,
bufferSize
,
0
);
if
(
ret
==-
1
)
{
if
(
ret
==-
1
)
{
if
(
errno
==
EWOULDBLOCK
||
errno
==
EINTR
)
{
if
(
errno
==
EWOULDBLOCK
||
errno
==
EINTR
)
{
return
rcved
;
// Timeout, subframe incomplete
return
rcved
;
// Timeout, subframe incomplete
...
@@ -39,7 +41,8 @@ int receiveSubFrame(int sock, uint64_t expectedTS, void* bufferZone, int buffer
...
@@ -39,7 +41,8 @@ int receiveSubFrame(int sock, uint64_t expectedTS, void* bufferZone, int buffer
return
-
1
;
return
-
1
;
}
}
}
else
{
}
else
{
commonUDP_t
*
tmp
=
(
commonUDP_t
*
)
bufferZone
;
commonUDP_t
*
tmp
=
(
commonUDP_t
*
)
bufferZone
;
if
(
expectedTS
&&
tmp
->
timestamp
!=
expectedTS
)
{
if
(
expectedTS
&&
tmp
->
timestamp
!=
expectedTS
)
{
LOG_W
(
HW
,
"Received a paquet in mixed subframes, dropping it
\n
"
);
LOG_W
(
HW
,
"Received a paquet in mixed subframes, dropping it
\n
"
);
}
else
{
}
else
{
...
@@ -48,18 +51,22 @@ int receiveSubFrame(int sock, uint64_t expectedTS, void* bufferZone, int buffer
...
@@ -48,18 +51,22 @@ int receiveSubFrame(int sock, uint64_t expectedTS, void* bufferZone, int buffer
}
}
}
}
}
while
(
!
recved
||
recved
<
tmp
->
nbBlocks
);
}
while
(
!
recved
||
recved
<
tmp
->
nbBlocks
);
return
recv
;
return
recv
;
}
}
int
sendSubFrame
(
int
sock
,
void
*
bufferZone
,
int
nbBlocks
)
{
int
sendSubFrame
(
int
sock
,
void
*
bufferZone
,
int
nbBlocks
)
{
do
{
do
{
int
sz
=
alignedSize
(
bufferZone
);
int
sz
=
alignedSize
(
bufferZone
);
int
ret
=
send
(
sock
,
bufferZone
,
sz
,
0
);
int
ret
=
send
(
sock
,
bufferZone
,
sz
,
0
);
if
(
ret
!=
sz
)
if
(
ret
!=
sz
)
LOG_W
(
HW
,
"Wrote socket doesn't return size %d (val: %d, errno:%d)
\n
"
,
LOG_W
(
HW
,
"Wrote socket doesn't return size %d (val: %d, errno:%d)
\n
"
,
sz
,
ret
,
errno
);
sz
,
ret
,
errno
);
bufferZone
+=
sz
;
bufferZone
+=
sz
;
nbBlocks
--
;
nbBlocks
--
;
}
while
(
nbBlocks
);
}
while
(
nbBlocks
);
return
0
;
return
0
;
}
}
targets/ARCH/rfsimulator/simulator.c
View file @
0ba0422d
...
@@ -135,9 +135,6 @@ void rxAddInput( struct complex16 *input_sig, struct complex16 *after_channel_si
...
@@ -135,9 +135,6 @@ void rxAddInput( struct complex16 *input_sig, struct complex16 *after_channel_si
}
}
out_ptr
->
r
+=
round
(
rx_tmp
.
x
*
pathLossLinear
+
noise_per_sample
*
gaussdouble
(
0
.
0
,
1
.
0
));
out_ptr
->
r
+=
round
(
rx_tmp
.
x
*
pathLossLinear
+
noise_per_sample
*
gaussdouble
(
0
.
0
,
1
.
0
));
printf
(
"in: %d, out %d= %f*%f + %f*%f
\n
"
,
input_sig
[((
TS
+
i
)
*
nbTx
)
%
CirSize
].
r
,
out_ptr
->
r
,
rx_tmp
.
x
,
pathLossLinear
,
noise_per_sample
,
gaussdouble
(
0
.
0
,
1
.
0
));
out_ptr
->
i
+=
round
(
rx_tmp
.
y
*
pathLossLinear
+
noise_per_sample
*
gaussdouble
(
0
.
0
,
1
.
0
));
out_ptr
->
i
+=
round
(
rx_tmp
.
y
*
pathLossLinear
+
noise_per_sample
*
gaussdouble
(
0
.
0
,
1
.
0
));
out_ptr
++
;
out_ptr
++
;
}
}
...
...
targets/RT/USER/lte-enb.c
View file @
0ba0422d
targets/RT/USER/lte-ru.c
View file @
0ba0422d
...
@@ -983,11 +983,9 @@ void wakeup_slaves(RU_proc_t *proc) {
...
@@ -983,11 +983,9 @@ void wakeup_slaves(RU_proc_t *proc) {
// wake up slave FH thread
// wake up slave FH thread
// lock the FH mutex and make sure the thread is ready
// lock the FH mutex and make sure the thread is ready
if
(
pthread_mutex_timedlock
(
&
slave_proc
->
mutex_FH
,
&
wait
)
!=
0
)
{
AssertFatal
(
pthread_mutex_timedlock
(
&
slave_proc
->
mutex_FH
,
&
wait
)
==
0
,
LOG_E
(
PHY
,
"ERROR pthread_mutex_lock for RU %d slave %d (IC %d)
\n
"
,
proc
->
ru
->
idx
,
slave_proc
->
ru
->
idx
,
slave_proc
->
instance_cnt_FH
);
"ERROR pthread_mutex_lock for RU %d slave %d (IC %d)
\n
"
,
exit_fun
(
"error locking mutex_rxtx"
);
proc
->
ru
->
idx
,
slave_proc
->
ru
->
idx
,
slave_proc
->
instance_cnt_FH
);
break
;
}
int
cnt_slave
=
++
slave_proc
->
instance_cnt_FH
;
int
cnt_slave
=
++
slave_proc
->
instance_cnt_FH
;
slave_proc
->
frame_rx
=
proc
->
frame_rx
;
slave_proc
->
frame_rx
=
proc
->
frame_rx
;
...
@@ -1628,7 +1626,6 @@ static void *ru_thread( void *param ) {
...
@@ -1628,7 +1626,6 @@ static void *ru_thread( void *param ) {
pthread_cond_signal
(
&
proc
->
cond_FH1
);
pthread_cond_signal
(
&
proc
->
cond_FH1
);
wait_sync
(
"ru_thread"
);
wait_sync
(
"ru_thread"
);
if
(
!
(
get_softmodem_params
()
->
emulate_rf
))
{
// Start RF device if any
// Start RF device if any
if
(
ru
->
start_rf
)
{
if
(
ru
->
start_rf
)
{
if
(
ru
->
start_rf
(
ru
)
!=
0
)
if
(
ru
->
start_rf
(
ru
)
!=
0
)
...
@@ -1648,12 +1645,9 @@ static void *ru_thread( void *param ) {
...
@@ -1648,12 +1645,9 @@ static void *ru_thread( void *param ) {
// if this is a slave RRU, try to synchronize on the DL frequency
// if this is a slave RRU, try to synchronize on the DL frequency
if
((
ru
->
is_slave
)
&&
(
ru
->
if_south
==
LOCAL_RF
))
do_ru_synch
(
ru
);
if
((
ru
->
is_slave
)
&&
(
ru
->
if_south
==
LOCAL_RF
))
do_ru_synch
(
ru
);
}
// This is a forever while loop, it loops over subframes which are scheduled by incoming samples from HW devices
// This is a forever while loop, it loops over subframes which are scheduled by incoming samples from HW devices
while
(
!
oai_exit
)
{
while
(
!
oai_exit
)
{
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_CPUID_RU_THREAD
,
sched_getcpu
());
LOG_ENTER
(
PHY
);
// these are local subframe/frame counters to check that we are in synch with the fronthaul timing.
// these are local subframe/frame counters to check that we are in synch with the fronthaul timing.
// They are set on the first rx/tx in the underly FH routines.
// They are set on the first rx/tx in the underly FH routines.
if
(
subframe
==
9
)
{
if
(
subframe
==
9
)
{
...
@@ -1665,37 +1659,9 @@ static void *ru_thread( void *param ) {
...
@@ -1665,37 +1659,9 @@ static void *ru_thread( void *param ) {
}
}
// synchronization on input FH interface, acquire signals/data and block
// synchronization on input FH interface, acquire signals/data and block
if
(
ru
->
fh_south_in
)
ru
->
fh_south_in
(
ru
,
&
frame
,
&
subframe
);
AssertFatal
(
ru
->
fh_south_in
,
"No fronthaul interface at south port"
);
else
AssertFatal
(
1
==
0
,
"No fronthaul interface at south port"
);
ru
->
fh_south_in
(
ru
,
&
frame
,
&
subframe
);
#ifdef PHY_TX_THREAD
if
(
first_phy_tx
==
0
)
{
phy_tx_end
=
0
;
phy_tx_txdataF_end
=
0
;
if
(
pthread_mutex_lock
(
&
ru
->
proc
.
mutex_phy_tx
)
!=
0
)
{
LOG_E
(
PHY
,
"[RU] ERROR pthread_mutex_lock for phy tx thread (IC %d)
\n
"
,
ru
->
proc
.
instance_cnt_phy_tx
);
exit_fun
(
"error locking mutex_rxtx"
);
}
if
(
ru
->
proc
.
instance_cnt_phy_tx
==-
1
)
{
++
ru
->
proc
.
instance_cnt_phy_tx
;
// the thread can now be woken up
AssertFatal
(
pthread_cond_signal
(
&
ru
->
proc
.
cond_phy_tx
)
==
0
,
"ERROR pthread_cond_signal for phy_tx thread
\n
"
);
}
else
{
LOG_E
(
PHY
,
"phy tx thread busy, skipping
\n
"
);
++
ru
->
proc
.
instance_cnt_phy_tx
;
}
pthread_mutex_unlock
(
&
ru
->
proc
.
mutex_phy_tx
);
}
else
{
phy_tx_end
=
1
;
phy_tx_txdataF_end
=
1
;
}
first_phy_tx
=
0
;
#endif
LOG_D
(
PHY
,
"RU thread (do_prach %d, is_prach_subframe %d), received frame %d, subframe %d
\n
"
,
LOG_D
(
PHY
,
"RU thread (do_prach %d, is_prach_subframe %d), received frame %d, subframe %d
\n
"
,
ru
->
do_prach
,
ru
->
do_prach
,
is_prach_subframe
(
fp
,
proc
->
frame_rx
,
proc
->
subframe_rx
),
is_prach_subframe
(
fp
,
proc
->
frame_rx
,
proc
->
subframe_rx
),
...
@@ -1720,70 +1686,24 @@ static void *ru_thread( void *param ) {
...
@@ -1720,70 +1686,24 @@ static void *ru_thread( void *param ) {
// At this point, all information for subframe has been received on FH interface
// At this point, all information for subframe has been received on FH interface
// If this proc is to provide synchronization, do so
// If this proc is to provide synchronization, do so
wakeup_slaves
(
proc
);
// Fixme: not used
#if defined(PRE_SCD_THREAD)
// wakeup_slaves(proc);
new_dlsch_ue_select_tbl_in_use
=
dlsch_ue_select_tbl_in_use
;
for
(
int
i
=
0
;
i
<
ru
->
num_eNB
;
i
++
)
{
dlsch_ue_select_tbl_in_use
=
!
dlsch_ue_select_tbl_in_use
;
char
string
[
20
];
memcpy
(
&
pre_scd_eNB_UE_stats
,
&
RC
.
mac
[
ru
->
eNB_list
[
0
]
->
Mod_id
]
->
UE_list
.
eNB_UE_stats
,
sizeof
(
eNB_UE_STATS
)
*
MAX_NUM_CCs
*
NUMBER_OF_UE_MAX
);
sprintf
(
string
,
"Incoming RU %d"
,
ru
->
idx
);
memcpy
(
&
pre_scd_activeUE
,
&
RC
.
mac
[
ru
->
eNB_list
[
0
]
->
Mod_id
]
->
UE_list
.
active
,
sizeof
(
boolean_t
)
*
NUMBER_OF_UE_MAX
);
ru
->
eNB_top
(
ru
->
eNB_list
[
i
],
ru
->
proc
.
frame_rx
,
ru
->
proc
.
subframe_rx
,
string
,
ru
);
if
(
pthread_mutex_lock
(
&
ru
->
proc
.
mutex_pre_scd
)
!=
0
)
{
LOG_E
(
PHY
,
"[eNB] error locking proc mutex for eNB pre scd
\n
"
);
exit_fun
(
"error locking mutex_time"
);
}
ru
->
proc
.
instance_pre_scd
++
;
if
(
ru
->
proc
.
instance_pre_scd
==
0
)
{
if
(
pthread_cond_signal
(
&
ru
->
proc
.
cond_pre_scd
)
!=
0
)
{
LOG_E
(
PHY
,
"[eNB] ERROR pthread_cond_signal for eNB pre scd
\n
"
);
exit_fun
(
"ERROR pthread_cond_signal cond_pre_scd"
);
}
}
else
{
LOG_E
(
PHY
,
"[eNB] frame %d subframe %d rxtx busy instance_pre_scd %d
\n
"
,
frame
,
subframe
,
ru
->
proc
.
instance_pre_scd
);
}
if
(
pthread_mutex_unlock
(
&
ru
->
proc
.
mutex_pre_scd
)
!=
0
)
{
LOG_E
(
PHY
,
"[eNB] error unlocking mutex_pre_scd mutex for eNB pre scd
\n
"
);
exit_fun
(
"error unlocking mutex_pre_scd"
);
}
}
#endif
// wakeup all eNB processes waiting for this RU
if
(
ru
->
num_eNB
>
0
)
wakeup_L1s
(
ru
);
#ifndef PHY_TX_THREAD
if
(
get_thread_parallel_conf
()
==
PARALLEL_SINGLE_THREAD
||
ru
->
num_eNB
==
0
)
{
// do TX front-end processing if needed (precoding and/or IDFTs)
// do TX front-end processing if needed (precoding and/or IDFTs)
if
(
ru
->
feptx_prec
)
ru
->
feptx_prec
(
ru
);
if
(
ru
->
feptx_prec
)
ru
->
feptx_prec
(
ru
);
// do OFDM if needed
// do OFDM if needed
if
((
ru
->
fh_north_asynch_in
==
NULL
)
&&
(
ru
->
feptx_ofdm
))
ru
->
feptx_ofdm
(
ru
);
if
((
ru
->
fh_north_asynch_in
==
NULL
)
&&
(
ru
->
feptx_ofdm
))
ru
->
feptx_ofdm
(
ru
);
if
(
!
(
get_softmodem_params
()
->
emulate_rf
))
{
// do outgoing fronthaul (south) if needed
// do outgoing fronthaul (south) if needed
if
((
ru
->
fh_north_asynch_in
==
NULL
)
&&
(
ru
->
fh_south_out
))
ru
->
fh_south_out
(
ru
);
if
((
ru
->
fh_north_asynch_in
==
NULL
)
&&
(
ru
->
fh_south_out
))
ru
->
fh_south_out
(
ru
);
if
(
ru
->
fh_north_out
)
ru
->
fh_north_out
(
ru
);
if
(
ru
->
fh_north_out
)
ru
->
fh_north_out
(
ru
);
}
proc
->
emulate_rf_busy
=
0
;
}
#else
struct
timespec
time_req
,
time_rem
;
time_req
.
tv_sec
=
0
;
time_req
.
tv_nsec
=
10000
;
while
((
!
oai_exit
)
&&
(
phy_tx_end
==
0
))
{
nanosleep
(
&
time_req
,
&
time_rem
);
continue
;
}
#endif
}
}
printf
(
"Exiting ru_thread
\n
"
);
printf
(
"Exiting ru_thread
\n
"
);
...
...
targets/RT/USER/lte-softmodem.c
View file @
0ba0422d
...
@@ -505,9 +505,7 @@ int main( int argc, char **argv ) {
...
@@ -505,9 +505,7 @@ int main( int argc, char **argv ) {
}
}
for
(
int
enb_id
=
0
;
enb_id
<
RC
.
nb_inst
;
enb_id
++
)
{
for
(
int
enb_id
=
0
;
enb_id
<
RC
.
nb_inst
;
enb_id
++
)
{
MessageDef
*
msg_p
=
itti_alloc_new_message
(
TASK_ENB_APP
,
RRC_CONFIGURATION_REQ
);
openair_rrc_eNB_configuration
(
enb_id
,
&
RC
.
rrc
[
enb_id
]
->
configuration
);
RRC_CONFIGURATION_REQ
(
msg_p
)
=
RC
.
rrc
[
enb_id
]
->
configuration
;
itti_send_msg_to_task
(
TASK_RRC_ENB
,
ENB_MODULE_ID_TO_INSTANCE
(
enb_id
),
msg_p
);
}
}
}
else
{
}
else
{
printf
(
"RC.nb_inst = 0, Initializing L1
\n
"
);
printf
(
"RC.nb_inst = 0, Initializing L1
\n
"
);
...
@@ -530,12 +528,9 @@ int main( int argc, char **argv ) {
...
@@ -530,12 +528,9 @@ int main( int argc, char **argv ) {
// init UE_PF_PO and mutex lock
// init UE_PF_PO and mutex lock
pthread_mutex_init
(
&
ue_pf_po_mutex
,
NULL
);
pthread_mutex_init
(
&
ue_pf_po_mutex
,
NULL
);
memset
(
&
UE_PF_PO
[
0
][
0
],
0
,
sizeof
(
UE_PF_PO_t
)
*
MAX_MOBILES_PER_ENB
*
MAX_NUM_CCs
);
memset
(
&
UE_PF_PO
[
0
][
0
],
0
,
sizeof
(
UE_PF_PO_t
)
*
MAX_MOBILES_PER_ENB
*
MAX_NUM_CCs
);
mlockall
(
MCL_CURRENT
|
MCL_FUTURE
);
pthread_cond_init
(
&
sync_cond
,
NULL
);
pthread_cond_init
(
&
sync_cond
,
NULL
);
pthread_mutex_init
(
&
sync_mutex
,
NULL
);
pthread_mutex_init
(
&
sync_mutex
,
NULL
);
rt_sleep_ns
(
10
*
100000000ULL
);
rt_sleep_ns
(
10
*
100000000ULL
);
if
(
NFAPI_MODE
!=
NFAPI_MONOLITHIC
)
{
if
(
NFAPI_MODE
!=
NFAPI_MONOLITHIC
)
{
...
@@ -563,9 +558,10 @@ int main( int argc, char **argv ) {
...
@@ -563,9 +558,10 @@ int main( int argc, char **argv ) {
// for (CC_id=0;CC_id<RC.nb_L1_CC[inst];CC_id++) phy_init_lte_eNB(RC.eNB[inst][CC_id],0,0);
// for (CC_id=0;CC_id<RC.nb_L1_CC[inst];CC_id++) phy_init_lte_eNB(RC.eNB[inst][CC_id],0,0);
}
}
printf
(
"wait_eNBs()
\n
"
);
// no need to wait: openair_rrc_eNB_configuration() is called earlier from this thread
wait_eNBs
();
// openair_rrc_eNB_configuration()->init_SI()->rrc_mac_config_req_eNB ()->phy_config_request () sets the wait_eNBs() tested flag
printf
(
"About to Init RU threads RC.nb_RU:%d
\n
"
,
RC
.
nb_RU
);
// wait_eNBs();
// printf("About to Init RU threads RC.nb_RU:%d\n", RC.nb_RU);
// RU thread and some L1 procedure aren't necessary in VNF or L2 FAPI simulator.
// RU thread and some L1 procedure aren't necessary in VNF or L2 FAPI simulator.
// but RU thread deals with pre_scd and this is necessary in VNF and simulator.
// but RU thread deals with pre_scd and this is necessary in VNF and simulator.
...
@@ -588,6 +584,9 @@ int main( int argc, char **argv ) {
...
@@ -588,6 +584,9 @@ int main( int argc, char **argv ) {
printf
(
"wait RUs
\n
"
);
printf
(
"wait RUs
\n
"
);
// end of CI modifications
// end of CI modifications
// fixme: very weird usage of bitmask
// lack of mutex in: ru_thread_prach(),...
// wait_RUs() is wrong and over complex!
wait_RUs
();
wait_RUs
();
LOG_I
(
ENB_APP
,
"RC.nb_RU:%d
\n
"
,
RC
.
nb_RU
);
LOG_I
(
ENB_APP
,
"RC.nb_RU:%d
\n
"
,
RC
.
nb_RU
);
// once all RUs are ready intiailize the rest of the eNBs ((dependence on final RU parameters after configuration)
// once all RUs are ready intiailize the rest of the eNBs ((dependence on final RU parameters after configuration)
...
...
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