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
spbro
OpenXG-RAN
Commits
491d97de
Commit
491d97de
authored
Aug 06, 2022
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removal of IF5_tools.x and old NR RU multi-threaded implementation. Fixes for LTE build
parent
517970a4
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
35 additions
and
1962 deletions
+35
-1962
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+0
-1
executables/nr-gnb.c
executables/nr-gnb.c
+0
-1
executables/nr-ru.c
executables/nr-ru.c
+8
-60
openair1/PHY/LTE_TRANSPORT/if5_tools.c
openair1/PHY/LTE_TRANSPORT/if5_tools.c
+0
-1397
openair1/PHY/LTE_TRANSPORT/if5_tools.h
openair1/PHY/LTE_TRANSPORT/if5_tools.h
+0
-70
openair1/SCHED/ru_procedures.c
openair1/SCHED/ru_procedures.c
+0
-1
openair1/SCHED_NR/nr_ru_procedures.c
openair1/SCHED_NR/nr_ru_procedures.c
+12
-418
openair1/SCHED_NR/sched_nr.h
openair1/SCHED_NR/sched_nr.h
+0
-5
targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h
targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h
+0
-1
targets/RT/USER/lte-enb.c
targets/RT/USER/lte-enb.c
+0
-1
targets/RT/USER/lte-ru.c
targets/RT/USER/lte-ru.c
+15
-6
targets/RT/USER/ru_control.c
targets/RT/USER/ru_control.c
+0
-1
No files found.
cmake_targets/CMakeLists.txt
View file @
491d97de
...
@@ -1514,7 +1514,6 @@ set(PHY_SRC
...
@@ -1514,7 +1514,6 @@ set(PHY_SRC
set
(
PHY_SRC_RU
set
(
PHY_SRC_RU
${
OPENAIR1_DIR
}
/PHY/LTE_TRANSPORT/if4_tools.c
${
OPENAIR1_DIR
}
/PHY/LTE_TRANSPORT/if4_tools.c
${
OPENAIR1_DIR
}
/PHY/LTE_TRANSPORT/if5_tools.c
${
OPENAIR1_DIR
}
/PHY/LTE_UE_TRANSPORT/drs_modulation.c
${
OPENAIR1_DIR
}
/PHY/LTE_UE_TRANSPORT/drs_modulation.c
${
OPENAIR1_DIR
}
/PHY/LTE_TRANSPORT/ulsch_demodulation.c
${
OPENAIR1_DIR
}
/PHY/LTE_TRANSPORT/ulsch_demodulation.c
${
OPENAIR1_DIR
}
/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
${
OPENAIR1_DIR
}
/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
...
...
executables/nr-gnb.c
View file @
491d97de
...
@@ -60,7 +60,6 @@
...
@@ -60,7 +60,6 @@
//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
#include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/LTE_TRANSPORT/if5_tools.h"
#include "PHY/phy_extern.h"
#include "PHY/phy_extern.h"
...
...
executables/nr-ru.c
View file @
491d97de
...
@@ -40,7 +40,6 @@
...
@@ -40,7 +40,6 @@
#include "../../ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h"
#include "../../ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/LTE_TRANSPORT/if5_tools.h"
#include "PHY/types.h"
#include "PHY/types.h"
#include "PHY/defs_nr_common.h"
#include "PHY/defs_nr_common.h"
...
@@ -59,7 +58,6 @@
...
@@ -59,7 +58,6 @@
unsigned
short
config_frames
[
4
]
=
{
2
,
9
,
11
,
13
};
unsigned
short
config_frames
[
4
]
=
{
2
,
9
,
11
,
13
};
#endif
#endif
#define USE_TPOOL 1
/* these variables have to be defined before including ENB_APP/enb_paramdef.h and GNB_APP/gnb_paramdef.h */
/* these variables have to be defined before including ENB_APP/enb_paramdef.h and GNB_APP/gnb_paramdef.h */
static
int
DEFBANDS
[]
=
{
7
};
static
int
DEFBANDS
[]
=
{
7
};
...
@@ -1575,10 +1573,6 @@ void init_RU_proc(RU_t *ru) {
...
@@ -1575,10 +1573,6 @@ void init_RU_proc(RU_t *ru) {
if
(
opp_enabled
==
1
)
if
(
opp_enabled
==
1
)
threadCreate
(
&
ru
->
ru_stats_thread
,
ru_stats_thread
,
(
void
*
)
ru
,
"ru_stats"
,
-
1
,
OAI_PRIORITY_RT
);
threadCreate
(
&
ru
->
ru_stats_thread
,
ru_stats_thread
,
(
void
*
)
ru
,
"ru_stats"
,
-
1
,
OAI_PRIORITY_RT
);
if
(
get_thread_worker_conf
()
==
WORKER_ENABLE
)
{
if
(
get_thread_worker_conf
()
==
WORKER_ENABLE
)
{
#ifndef USE_TPOOL
if
(
ru
->
feprx
)
nr_init_feprx_thread
(
ru
);
if
(
ru
->
feptx_ofdm
)
nr_init_feptx_thread
(
ru
);
#endif
}
}
}
}
...
@@ -1589,33 +1583,6 @@ void kill_NR_RU_proc(int inst) {
...
@@ -1589,33 +1583,6 @@ void kill_NR_RU_proc(int inst) {
LOG_D
(
PHY
,
"Joining pthread_FH
\n
"
);
LOG_D
(
PHY
,
"Joining pthread_FH
\n
"
);
pthread_join
(
proc
->
pthread_FH
,
NULL
);
pthread_join
(
proc
->
pthread_FH
,
NULL
);
if
(
get_nprocs
()
>=
2
)
{
#ifndef USE_TPOOL
if
(
ru
->
feprx
)
{
for
(
int
aid
=
0
;
aid
<
ru
->
nb_rx
;
aid
++
)
{
pthread_mutex_lock
(
&
proc
->
mutex_fep
[
aid
]);
proc
->
instance_cnt_fep
[
aid
]
=
0
;
pthread_mutex_unlock
(
&
proc
->
mutex_fep
[
aid
]);
pthread_cond_signal
(
&
proc
->
cond_fep
[
aid
]);
LOG_D
(
PHY
,
"Joining pthread_fep %d
\n
"
,
aid
);
pthread_join
(
proc
->
pthread_fep
[
aid
],
NULL
);
pthread_mutex_destroy
(
&
proc
->
mutex_fep
[
aid
]);
pthread_cond_destroy
(
&
proc
->
cond_fep
[
aid
]);
}
}
if
(
ru
->
feptx_ofdm
)
{
pthread_mutex_lock
(
&
proc
->
mutex_feptx
);
proc
->
instance_cnt_feptx
=
0
;
pthread_mutex_unlock
(
&
proc
->
mutex_feptx
);
pthread_cond_signal
(
&
proc
->
cond_feptx
);
LOG_D
(
PHY
,
"Joining pthread_feptx
\n
"
);
pthread_join
(
proc
->
pthread_feptx
,
NULL
);
pthread_mutex_destroy
(
&
proc
->
mutex_feptx
);
pthread_cond_destroy
(
&
proc
->
cond_feptx
);
}
#endif
}
if
(
opp_enabled
)
{
if
(
opp_enabled
)
{
LOG_D
(
PHY
,
"Joining ru_stats_thread
\n
"
);
LOG_D
(
PHY
,
"Joining ru_stats_thread
\n
"
);
pthread_join
(
ru
->
ru_stats_thread
,
NULL
);
pthread_join
(
ru
->
ru_stats_thread
,
NULL
);
...
@@ -1823,13 +1790,8 @@ void set_function_spec_param(RU_t *ru) {
...
@@ -1823,13 +1790,8 @@ void set_function_spec_param(RU_t *ru) {
ru
->
fh_north_out
=
fh_if4p5_north_out
;
// send_IF4p5 on reception
ru
->
fh_north_out
=
fh_if4p5_north_out
;
// send_IF4p5 on reception
ru
->
fh_south_out
=
tx_rf
;
// send output to RF
ru
->
fh_south_out
=
tx_rf
;
// send output to RF
ru
->
fh_north_asynch_in
=
fh_if4p5_north_asynch_in
;
// TX packets come asynchronously
ru
->
fh_north_asynch_in
=
fh_if4p5_north_asynch_in
;
// TX packets come asynchronously
#ifdef USE_TPOOL
ru
->
feprx
=
nr_fep_tp
;
// this is frequency-shift + DFTs
ru
->
feprx
=
(
get_thread_worker_conf
()
==
WORKER_ENABLE
)
?
nr_fep_tp
:
nr_fep_full
;
// this is frequency-shift + DFTs
ru
->
feptx_ofdm
=
nr_feptx_tp
;
// this is fep with idft only (no precoding in RRU)
ru
->
feptx_ofdm
=
(
get_thread_worker_conf
()
==
WORKER_ENABLE
)
?
nr_feptx_tp
:
nr_feptx_ofdm
;
// this is fep with idft only (no precoding in RRU)
#else
ru
->
feprx
=
(
get_thread_worker_conf
()
==
WORKER_ENABLE
)
?
nr_fep_full_2thread
:
nr_fep_full
;
// this is frequency-shift + DFTs
ru
->
feptx_ofdm
=
(
get_thread_worker_conf
()
==
WORKER_ENABLE
)
?
nr_feptx_ofdm_2thread
:
nr_feptx_ofdm
;
// this is fep with idft only (no precoding in RRU)
#endif
ru
->
feptx_prec
=
NULL
;
ru
->
feptx_prec
=
NULL
;
ru
->
nr_start_if
=
nr_start_if
;
// need to start the if interface for if4p5
ru
->
nr_start_if
=
nr_start_if
;
// need to start the if interface for if4p5
ru
->
ifdevice
.
host_type
=
RRU_HOST
;
ru
->
ifdevice
.
host_type
=
RRU_HOST
;
...
@@ -1849,14 +1811,9 @@ void set_function_spec_param(RU_t *ru) {
...
@@ -1849,14 +1811,9 @@ void set_function_spec_param(RU_t *ru) {
malloc_IF4p5_buffer
(
ru
);
malloc_IF4p5_buffer
(
ru
);
}
else
if
(
ru
->
function
==
gNodeB_3GPP
)
{
}
else
if
(
ru
->
function
==
gNodeB_3GPP
)
{
ru
->
do_prach
=
0
;
// no prach processing in RU
ru
->
do_prach
=
0
;
// no prach processing in RU
#ifdef USE_TPOOL
ru
->
feprx
=
nr_fep_tp
;
// this is frequency-shift + DFTs
ru
->
feprx
=
(
get_thread_worker_conf
()
==
WORKER_ENABLE
)
?
nr_fep_tp
:
nr_fep_full
;
// this is frequency-shift + DFTs
ru
->
feptx_ofdm
=
nr_feptx_tp
;
// this is fep with idft and precoding
ru
->
feptx_ofdm
=
(
get_thread_worker_conf
()
==
WORKER_ENABLE
)
?
nr_feptx_tp
:
nr_feptx_ofdm
;
// this is fep with idft and precoding
ru
->
feptx_prec
=
nr_feptx_prec
;
// this is fep with idft and precoding
#else
ru
->
feprx
=
(
get_thread_worker_conf
()
==
WORKER_ENABLE
)
?
nr_fep_full_2thread
:
nr_fep_full
;
// this is frequency-shift + DFTs
ru
->
feptx_ofdm
=
(
get_thread_worker_conf
()
==
WORKER_ENABLE
)
?
nr_feptx_ofdm_2thread
:
nr_feptx_ofdm
;
// this is fep with idft and precoding
#endif
ru
->
feptx_prec
=
(
get_thread_worker_conf
()
==
WORKER_ENABLE
)
?
NULL
:
nr_feptx_prec
;
// this is fep with idft and precoding
ru
->
fh_north_in
=
NULL
;
// no incoming fronthaul from north
ru
->
fh_north_in
=
NULL
;
// no incoming fronthaul from north
ru
->
fh_north_out
=
NULL
;
// no outgoing fronthaul to north
ru
->
fh_north_out
=
NULL
;
// no outgoing fronthaul to north
ru
->
nr_start_if
=
NULL
;
// no if interface
ru
->
nr_start_if
=
NULL
;
// no if interface
...
@@ -1886,15 +1843,9 @@ void set_function_spec_param(RU_t *ru) {
...
@@ -1886,15 +1843,9 @@ void set_function_spec_param(RU_t *ru) {
case
REMOTE_IF5
:
// the remote unit is IF5 RRU
case
REMOTE_IF5
:
// the remote unit is IF5 RRU
ru
->
do_prach
=
0
;
ru
->
do_prach
=
0
;
ru
->
txfh_in_fep
=
0
;
ru
->
txfh_in_fep
=
0
;
#ifdef USE_TPOOL
ru
->
feprx
=
nr_fep_tp
;
// this is frequency-shift + DFTs
ru
->
feprx
=
(
get_thread_worker_conf
()
==
WORKER_ENABLE
)
?
nr_fep_tp
:
nr_fep_full
;
// this is frequency-shift + DFTs
ru
->
feptx_prec
=
nr_feptx_prec
;
// need to do transmit Precoding + IDFTs
ru
->
feptx_prec
=
(
get_thread_worker_conf
()
==
WORKER_ENABLE
)
?
NULL
:
nr_feptx_prec
;
// need to do transmit Precoding + IDFTs
ru
->
feptx_ofdm
=
nr_feptx_tp
;
// need to do transmit Precoding + IDFTs
ru
->
feptx_ofdm
=
(
get_thread_worker_conf
()
==
WORKER_ENABLE
)
?
nr_feptx_tp
:
nr_feptx_ofdm
;
// need to do transmit Precoding + IDFTs
#else
ru
->
feprx
=
(
get_thread_worker_conf
()
==
WORKER_ENABLE
)
?
nr_fep_full_2thread
:
nr_fep_full
;
// this is frequency-shift + DFTs
ru
->
feptx_prec
=
(
get_thread_worker_conf
()
==
WORKER_ENABLE
)
?
NULL
:
nr_feptx_prec
;
// need to do transmit Precoding + IDFTs
ru
->
feptx_ofdm
=
(
get_thread_worker_conf
()
==
WORKER_ENABLE
)
?
nr_feptx_ofdm_2thread
:
nr_feptx_ofdm
;
// need to do transmit Precoding + IDFTs
#endif
ru
->
fh_south_in
=
fh_if5_south_in
;
// synchronous IF5 reception
ru
->
fh_south_in
=
fh_if5_south_in
;
// synchronous IF5 reception
ru
->
fh_south_out
=
(
ru
->
txfh_in_fep
>
0
)
?
NULL
:
fh_if5_south_out
;
// synchronous IF5 transmission
ru
->
fh_south_out
=
(
ru
->
txfh_in_fep
>
0
)
?
NULL
:
fh_if5_south_out
;
// synchronous IF5 transmission
ru
->
fh_south_asynch_in
=
NULL
;
// no asynchronous UL
ru
->
fh_south_asynch_in
=
NULL
;
// no asynchronous UL
...
@@ -1997,7 +1948,6 @@ void init_NR_RU(char *rf_config_file) {
...
@@ -1997,7 +1948,6 @@ void init_NR_RU(char *rf_config_file) {
ru
->
gNB_list
[
0
]
=
RC
.
gNB
[
0
];
ru
->
gNB_list
[
0
]
=
RC
.
gNB
[
0
];
ru
->
num_gNB
=
1
;
ru
->
num_gNB
=
1
;
//
//
// DJP - feptx_prec() / feptx_ofdm() parses the gNB_list (based on num_gNB) and copies the txdata_F to txdata in RU
//
//
}
else
{
}
else
{
LOG_E
(
PHY
,
"DJP - delete code above this %s:%d
\n
"
,
__FILE__
,
__LINE__
);
LOG_E
(
PHY
,
"DJP - delete code above this %s:%d
\n
"
,
__FILE__
,
__LINE__
);
...
@@ -2041,7 +1991,6 @@ void init_NR_RU(char *rf_config_file) {
...
@@ -2041,7 +1991,6 @@ void init_NR_RU(char *rf_config_file) {
for
(
int
icpu
=
1
;
icpu
<
threadCnt
;
icpu
++
)
{
for
(
int
icpu
=
1
;
icpu
<
threadCnt
;
icpu
++
)
{
s_offset
+=
sprintf
(
pool
+
s_offset
,
",%d"
,
ru
->
tpcores
[
icpu
]);
s_offset
+=
sprintf
(
pool
+
s_offset
,
",%d"
,
ru
->
tpcores
[
icpu
]);
}
}
#ifdef USE_TPOOL
LOG_I
(
PHY
,
"RU thread-pool core string %s
\n
"
,
pool
);
LOG_I
(
PHY
,
"RU thread-pool core string %s
\n
"
,
pool
);
ru
->
threadPool
=
(
tpool_t
*
)
malloc
(
sizeof
(
tpool_t
));
ru
->
threadPool
=
(
tpool_t
*
)
malloc
(
sizeof
(
tpool_t
));
initTpool
(
pool
,
ru
->
threadPool
,
cpumeas
(
CPUMEAS_GETSTATE
));
initTpool
(
pool
,
ru
->
threadPool
,
cpumeas
(
CPUMEAS_GETSTATE
));
...
@@ -2051,7 +2000,6 @@ void init_NR_RU(char *rf_config_file) {
...
@@ -2051,7 +2000,6 @@ void init_NR_RU(char *rf_config_file) {
// FEP TX result FIFO
// FEP TX result FIFO
ru
->
respfeptx
=
(
notifiedFIFO_t
*
)
malloc
(
sizeof
(
notifiedFIFO_t
));
ru
->
respfeptx
=
(
notifiedFIFO_t
*
)
malloc
(
sizeof
(
notifiedFIFO_t
));
initNotifiedFIFO
(
ru
->
respfeptx
);
initNotifiedFIFO
(
ru
->
respfeptx
);
#endif
}
// for ru_id
}
// for ru_id
// sleep(1);
// sleep(1);
...
...
openair1/PHY/LTE_TRANSPORT/if5_tools.c
deleted
100644 → 0
View file @
517970a4
This source diff could not be displayed because it is too large. You can
view the blob
instead.
openair1/PHY/LTE_TRANSPORT/if5_tools.h
deleted
100644 → 0
View file @
517970a4
/*
* 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
*/
/*! \file PHY/LTE_TRANSPORT/if5_tools.h
* \brief
* \author S. Sandeep Kumar, Raymond Knopp
* \date 2016
* \version 0.1
* \company Eurecom
* \email: ee13b1025@iith.ac.in, knopp@eurecom.fr
* \note
* \warning
*/
#ifndef __IF5_TOOLS_H__
#define __IF5_TOOLS_H__
#include <stdint.h>
#include "PHY/defs_eNB.h"
#define IF5_RRH_GW_DL 0x0022
#define IF5_RRH_GW_UL 0x0023
#define IF5_MOBIPASS 0xbffe
struct
IF5_mobipass_header
{
///
uint16_t
flags
;
///
uint16_t
fifo_status
;
///
uint8_t
seqno
;
///
uint8_t
ack
;
///
uint32_t
word0
;
///
uint32_t
time_stamp
;
}
__attribute__
((
__packed__
));
typedef
struct
IF5_mobipass_header
IF5_mobipass_header_t
;
#define sizeof_IF5_mobipass_header_t 14
void
send_IF5
(
RU_t
*
,
openair0_timestamp
,
int
,
uint8_t
*
,
uint16_t
);
void
recv_IF5
(
RU_t
*
ru
,
openair0_timestamp
*
proc_timestamp
,
int
subframe
,
uint16_t
packet_type
,
int
is_rx
);
void
malloc_IF5_buffer
(
RU_t
*
ru
);
#endif
openair1/SCHED/ru_procedures.c
View file @
491d97de
...
@@ -57,7 +57,6 @@
...
@@ -57,7 +57,6 @@
#include "SCHED/sched_eNB.h"
#include "SCHED/sched_eNB.h"
#include "PHY/MODULATION/modulation_eNB.h"
#include "PHY/MODULATION/modulation_eNB.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/LTE_TRANSPORT/if5_tools.h"
#include "PHY/LTE_TRANSPORT/transport_common_proto.h"
#include "PHY/LTE_TRANSPORT/transport_common_proto.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
...
...
openair1/SCHED_NR/nr_ru_procedures.c
View file @
491d97de
...
@@ -35,7 +35,6 @@
...
@@ -35,7 +35,6 @@
#include "PHY/MODULATION/modulation_common.h"
#include "PHY/MODULATION/modulation_common.h"
#include "PHY/MODULATION/nr_modulation.h"
#include "PHY/MODULATION/nr_modulation.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/LTE_TRANSPORT/if5_tools.h"
#include "common/utils/LOG/log.h"
#include "common/utils/LOG/log.h"
#include "common/utils/system.h"
#include "common/utils/system.h"
...
@@ -46,12 +45,14 @@
...
@@ -46,12 +45,14 @@
#include "assertions.h"
#include "assertions.h"
#include <time.h>
#include <time.h>
// RU OFDM Modulator gNodeB
// RU OFDM Modulator gNodeB
extern
openair0_config_t
openair0_cfg
[
MAX_CARDS
];
extern
int
oai_exit
;
extern
int
oai_exit
;
// OFDM modulation core routine, generates a first_symbol to first_symbol+num_symbols on a particular slot and TX antenna port
void
nr_feptx0
(
RU_t
*
ru
,
int
tti_tx
,
int
first_symbol
,
int
num_symbols
,
int
aa
)
{
void
nr_feptx0
(
RU_t
*
ru
,
int
tti_tx
,
int
first_symbol
,
int
num_symbols
,
int
aa
)
{
NR_DL_FRAME_PARMS
*
fp
=
ru
->
nr_frame_parms
;
NR_DL_FRAME_PARMS
*
fp
=
ru
->
nr_frame_parms
;
...
@@ -140,268 +141,7 @@ void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols, int aa) {
...
@@ -140,268 +141,7 @@ void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols, int aa) {
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+(first_symbol!=0?1:0), 0);
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+(first_symbol!=0?1:0), 0);
}
}
void
nr_feptx_ofdm_2thread
(
RU_t
*
ru
,
int
frame_tx
,
int
tti_tx
)
{
// RU FEP TX OFDM modulation, single-thread
nfapi_nr_config_request_scf_t
*
cfg
=
&
ru
->
gNB_list
[
0
]
->
gNB_config
;
RU_proc_t
*
proc
=
&
ru
->
proc
;
RU_feptx_t
*
feptx
=
proc
->
feptx
;
PHY_VARS_gNB
*
gNB
;
NR_DL_FRAME_PARMS
*
fp
=
ru
->
nr_frame_parms
;
int
slot
=
tti_tx
;
int
i
=
0
;
int
j
=
0
;
//symbol
int
aa
=
0
;
//physical antenna number
int
ret
=
0
;
int
ofdm_mask_full
=
(
1
<<
(
ru
->
nb_tx
*
2
))
-
1
;
int
txdataF_offset
=
(
tti_tx
*
fp
->
samples_per_slot_wCP
);
if
(
nr_slot_select
(
cfg
,
frame_tx
,
slot
)
==
NR_UPLINK_SLOT
)
return
;
for
(
aa
=
0
;
aa
<
ru
->
nb_tx
;
aa
++
)
memset
(
ru
->
common
.
txdataF
[
aa
],
0
,
fp
->
samples_per_slot_wCP
*
sizeof
(
int32_t
));
start_meas
(
&
ru
->
ofdm_total_stats
);
//if (nr_slot_select(cfg,frame_tx,slot)==NR_DOWNLINK_SLOT) {
if
(
ru
->
num_gNB
!=
0
){
//L1 RU on same machine
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM
,
1
);
for
(
j
=
0
;
j
<
2
;
++
j
){
//half slot
for
(
i
=
0
;
i
<
ru
->
nb_tx
;
++
i
){
if
(
j
==
0
){
AssertFatal
((
ret
=
pthread_mutex_lock
(
&
feptx
[
i
].
mutex_feptx
))
==
0
,
"mutex_lock return %d
\n
"
,
ret
);
feptx
[
i
].
aa
=
i
;
feptx
[
i
].
index
=
i
;
feptx
[
i
].
ru
=
ru
;
feptx
[
i
].
symbol
=
0
;
feptx
[
i
].
slot
=
slot
;
feptx
[
i
].
nb_antenna_ports
=
ru
->
nb_tx
;
feptx
[
i
].
instance_cnt_feptx
=
0
;
AssertFatal
(
pthread_cond_signal
(
&
feptx
[
i
].
cond_feptx
)
==
0
,
"ERROR pthread_cond_signal for feptx_ofdm_thread
\n
"
);
AssertFatal
((
ret
=
pthread_mutex_unlock
(
&
feptx
[
i
].
mutex_feptx
))
==
0
,
"mutex_lock returns %d
\n
"
,
ret
);
}
//first half
else
{
AssertFatal
((
ret
=
pthread_mutex_lock
(
&
feptx
[
i
+
ru
->
nb_tx
].
mutex_feptx
))
==
0
,
"mutex_lock return %d
\n
"
,
ret
);
feptx
[
i
+
ru
->
nb_tx
].
aa
=
i
;
feptx
[
i
+
ru
->
nb_tx
].
index
=
i
+
ru
->
nb_tx
;
feptx
[
i
+
ru
->
nb_tx
].
ru
=
ru
;
feptx
[
i
+
ru
->
nb_tx
].
symbol
=
fp
->
symbols_per_slot
>>
1
;
feptx
[
i
+
ru
->
nb_tx
].
slot
=
slot
;
feptx
[
i
+
ru
->
nb_tx
].
nb_antenna_ports
=
ru
->
nb_tx
;
feptx
[
i
+
ru
->
nb_tx
].
instance_cnt_feptx
=
0
;
AssertFatal
(
pthread_cond_signal
(
&
feptx
[
i
+
ru
->
nb_tx
].
cond_feptx
)
==
0
,
"ERROR pthread_cond_signal for feptx_ofdm_thread
\n
"
);
AssertFatal
((
ret
=
pthread_mutex_unlock
(
&
feptx
[
i
+
ru
->
nb_tx
].
mutex_feptx
))
==
0
,
"mutex_lock returns %d
\n
"
,
ret
);
}
//second half
}
//physical antenna
}
//half slot
}
//if L1 RU on same machine
else
{
//(RU only machine)
for
(
j
=
0
;
j
<
fp
->
symbols_per_slot
;
++
j
){
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC
+
j
,
1
);
start_meas
(
&
ru
->
txdataF_copy_stats
);
AssertFatal
(
ru
->
num_gNB
==
1
,
"num_gNB>1, help
\n
"
);
gNB
=
ru
->
gNB_list
[
0
];
cfg
=
&
gNB
->
gNB_config
;
for
(
i
=
0
;
i
<
ru
->
nb_tx
;
++
i
){
memcpy
((
void
*
)
&
ru
->
common
.
txdataF
[
i
][
j
*
fp
->
ofdm_symbol_size
],
(
void
*
)
&
gNB
->
common_vars
.
txdataF
[
i
][
j
*
fp
->
ofdm_symbol_size
+
txdataF_offset
],
fp
->
ofdm_symbol_size
*
sizeof
(
int32_t
));
}
stop_meas
(
&
ru
->
txdataF_copy_stats
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC
+
j
,
0
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM
,
1
);
if
(
nr_slot_select
(
cfg
,
slot
,
frame_tx
)
==
SF_DL
)
{
// If this is not an S-tti
for
(
i
=
0
;
i
<
ru
->
nb_tx
;
++
i
){
if
(
j
%
2
==
0
){
while
(
feptx
[
i
].
instance_cnt_feptx
!=
-
1
){
usleep
(
5
);
}
AssertFatal
((
ret
=
pthread_mutex_lock
(
&
feptx
[
i
].
mutex_feptx
))
==
0
,
"mutex_lock return %d
\n
"
,
ret
);
feptx
[
i
].
aa
=
i
;
feptx
[
i
].
index
=
i
;
feptx
[
i
].
ru
=
ru
;
feptx
[
i
].
symbol
=
j
;
feptx
[
i
].
slot
=
slot
;
feptx
[
i
].
nb_antenna_ports
=
ru
->
nb_tx
;
feptx
[
i
].
instance_cnt_feptx
=
0
;
AssertFatal
(
pthread_cond_signal
(
&
feptx
[
i
].
cond_feptx
)
==
0
,
"ERROR pthread_cond_signal for feptx_ofdm_thread
\n
"
);
AssertFatal
((
ret
=
pthread_mutex_unlock
(
&
feptx
[
i
].
mutex_feptx
))
==
0
,
"mutex_lock returns %d
\n
"
,
ret
);
}
else
{
while
(
feptx
[
i
+
ru
->
nb_tx
].
instance_cnt_feptx
!=
-
1
){
usleep
(
5
);
}
AssertFatal
((
ret
=
pthread_mutex_lock
(
&
feptx
[
i
+
ru
->
nb_tx
].
mutex_feptx
))
==
0
,
"mutex_lock return %d
\n
"
,
ret
);
feptx
[
i
+
ru
->
nb_tx
].
aa
=
i
;
feptx
[
i
+
ru
->
nb_tx
].
index
=
i
+
ru
->
nb_tx
;
feptx
[
i
+
ru
->
nb_tx
].
ru
=
ru
;
feptx
[
i
+
ru
->
nb_tx
].
symbol
=
j
;
feptx
[
i
+
ru
->
nb_tx
].
slot
=
slot
;
feptx
[
i
+
ru
->
nb_tx
].
nb_antenna_ports
=
ru
->
nb_tx
;
feptx
[
i
+
ru
->
nb_tx
].
instance_cnt_feptx
=
0
;
AssertFatal
(
pthread_cond_signal
(
&
feptx
[
i
+
ru
->
nb_tx
].
cond_feptx
)
==
0
,
"ERROR pthread_cond_signal for feptx_ofdm_thread
\n
"
);
AssertFatal
((
ret
=
pthread_mutex_unlock
(
&
feptx
[
i
+
ru
->
nb_tx
].
mutex_feptx
))
==
0
,
"mutex_lock returns %d
\n
"
,
ret
);
}
}
}
//if == SF_DL
else
{
proc
->
feptx_mask
=
ofdm_mask_full
;
}
}
//j<fp->symbols_per_slot
}
//else (RU only machine)
//}
// wait all process to finish
AssertFatal
((
ret
=
pthread_mutex_lock
(
&
proc
->
mutex_feptx
))
==
0
,
"mutex_lock return %d
\n
"
,
ret
);
while
(
proc
->
feptx_mask
!=
ofdm_mask_full
)
{
// most of the time the thread is waiting here
// proc->instance_cnt_rxtx is -1
pthread_cond_wait
(
&
proc
->
cond_feptx
,
&
proc
->
mutex_feptx
);
// this unlocks mutex_rxtx while waiting and then locks it again
}
proc
->
feptx_mask
=
0
;
AssertFatal
((
ret
=
pthread_mutex_unlock
(
&
proc
->
mutex_feptx
))
==
0
,
"mutex_lock return %d
\n
"
,
ret
);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_RU_TX_OFDM_MASK
,
proc
->
feptx_mask
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM
,
0
);
stop_meas
(
&
ru
->
ofdm_total_stats
);
}
static
void
*
nr_feptx_thread
(
void
*
param
)
{
RU_feptx_t
*
feptx
=
(
RU_feptx_t
*
)
param
;
RU_t
*
ru
;
int
aa
,
slot
,
start
,
l
,
ret
;
int
i
;
int32_t
***
bw
;
NR_DL_FRAME_PARMS
*
fp
;
int
ofdm_mask_full
;
int
txdataF_offset
;
while
(
!
oai_exit
)
{
ret
=
0
;
if
(
wait_on_condition
(
&
feptx
->
mutex_feptx
,
&
feptx
->
cond_feptx
,
&
feptx
->
instance_cnt_feptx
,
"NR feptx thread"
)
<
0
)
break
;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM
+
feptx
->
index
+
1
,
1
);
AssertFatal
(
feptx
->
ru
->
nb_log_antennas
>
0
&&
feptx
->
ru
->
nb_log_antennas
<
13
,
"ru->nb_log_antennas is %d
\n
"
,
feptx
->
ru
->
nb_log_antennas
);
ru
=
feptx
->
ru
;
slot
=
feptx
->
slot
;
aa
=
feptx
->
aa
;
l
=
feptx
->
symbol
;
fp
=
ru
->
nr_frame_parms
;
start
=
feptx
->
symbol
;
ofdm_mask_full
=
(
1
<<
(
ru
->
nb_tx
*
2
))
-
1
;
if
(
ru
->
num_gNB
!=
0
){
txdataF_offset
=
(
slot
*
fp
->
samples_per_slot_wCP
);
////////////precoding////////////
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC
+
feptx
->
index
+
1
,
1
);
if
(
aa
==
0
&&
l
==
0
)
start_meas
(
&
ru
->
precoding_stats
);
if
(
ru
->
do_precoding
==
1
)
{
for
(
i
=
0
;
i
<
ru
->
nb_log_antennas
;
++
i
)
{
memcpy
((
void
*
)
&
ru
->
common
.
beam_id
[
i
][
slot
*
fp
->
symbols_per_slot
+
l
],
(
void
*
)
&
ru
->
gNB_list
[
0
]
->
common_vars
.
beam_id
[
i
][
slot
*
fp
->
symbols_per_slot
+
l
],
(
fp
->
symbols_per_slot
>>
1
)
*
sizeof
(
uint8_t
));
}
}
if
(
ru
->
nb_tx
==
1
&&
ru
->
nb_log_antennas
==
1
)
{
memcpy
((
void
*
)
&
ru
->
common
.
txdataF_BF
[
0
][
l
*
fp
->
ofdm_symbol_size
],
(
void
*
)
&
ru
->
gNB_list
[
0
]
->
common_vars
.
txdataF
[
0
][
txdataF_offset
+
l
*
fp
->
ofdm_symbol_size
],
(
fp
->
samples_per_slot_wCP
>>
1
)
*
sizeof
(
int32_t
));
}
else
if
(
ru
->
do_precoding
==
0
)
{
int
gNB_tx
=
ru
->
gNB_list
[
0
]
->
frame_parms
.
nb_antennas_tx
;
memcpy
((
void
*
)
&
ru
->
common
.
txdataF_BF
[
aa
][
l
*
fp
->
ofdm_symbol_size
],
(
void
*
)
&
ru
->
gNB_list
[
0
]
->
common_vars
.
txdataF
[
aa
%
gNB_tx
][
txdataF_offset
+
l
*
fp
->
ofdm_symbol_size
],
(
fp
->
samples_per_slot_wCP
>>
1
)
*
sizeof
(
int32_t
));
}
else
{
bw
=
ru
->
beam_weights
[
0
];
for
(
i
=
0
;
i
<
fp
->
symbols_per_slot
>>
1
;
++
i
){
nr_beam_precoding
(
ru
->
gNB_list
[
0
]
->
common_vars
.
txdataF
,
ru
->
common
.
txdataF_BF
,
fp
,
bw
,
slot
,
l
+
i
,
aa
,
ru
->
nb_log_antennas
,
txdataF_offset
);
//here
}
}
if
(
aa
==
0
&&
l
==
0
)
stop_meas
(
&
ru
->
precoding_stats
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC
+
feptx
->
index
+
1
,
0
);
////////////FEPTX////////////
nr_feptx0
(
ru
,
slot
,
start
,
fp
->
symbols_per_slot
>>
1
,
aa
);
if
(
release_thread
(
&
feptx
->
mutex_feptx
,
&
feptx
->
instance_cnt_feptx
,
"NR feptx thread"
)
<
0
)
break
;
AssertFatal
((
ret
=
pthread_mutex_lock
(
&
ru
->
proc
.
mutex_feptx
))
==
0
,
"mutex_lock return %d
\n
"
,
ret
);
ru
->
proc
.
feptx_mask
|=
1
<<
(
feptx
->
index
);
if
(
ru
->
proc
.
feptx_mask
==
ofdm_mask_full
)
AssertFatal
(
pthread_cond_signal
(
&
ru
->
proc
.
cond_feptx
)
==
0
,
"ERROR pthread_cond_signal for precoding and ofdm finish
\n
"
);
AssertFatal
((
ret
=
pthread_mutex_unlock
(
&
ru
->
proc
.
mutex_feptx
))
==
0
,
"mutex_lock returns %d
\n
"
,
ret
);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_RU_TX_OFDM_MASK
,
ru
->
proc
.
feptx_mask
);
}
// if L1 RU on same machine
else
{
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC
+
feptx
->
index
+
1
,
1
);
start_meas
(
&
ru
->
precoding_stats
);
if
(
ru
->
nb_tx
==
1
&&
ru
->
nb_log_antennas
)
{
memcpy
((
void
*
)
&
ru
->
common
.
txdataF_BF
[
0
][
l
*
fp
->
ofdm_symbol_size
],
(
void
*
)
&
ru
->
common
.
txdataF
[
0
][
l
*
fp
->
ofdm_symbol_size
],
fp
->
ofdm_symbol_size
*
sizeof
(
int32_t
));
}
else
{
bw
=
ru
->
beam_weights
[
0
];
nr_beam_precoding
(
ru
->
common
.
txdataF
,
ru
->
common
.
txdataF_BF
,
fp
,
bw
,
slot
,
l
,
aa
,
ru
->
nb_log_antennas
,
0
);
}
stop_meas
(
&
ru
->
precoding_stats
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC
+
feptx
->
index
+
1
,
0
);
nr_feptx0
(
ru
,
slot
,
start
,
1
,
aa
);
if
(
release_thread
(
&
feptx
->
mutex_feptx
,
&
feptx
->
instance_cnt_feptx
,
"NR feptx thread"
)
<
0
)
break
;
if
(
l
>=
fp
->
symbols_per_slot
-
2
){
AssertFatal
((
ret
=
pthread_mutex_lock
(
&
ru
->
proc
.
mutex_feptx
))
==
0
,
"mutex_lock return %d
\n
"
,
ret
);
ru
->
proc
.
feptx_mask
|=
1
<<
(
feptx
->
index
);
if
(
ru
->
proc
.
feptx_mask
==
ofdm_mask_full
)
AssertFatal
(
pthread_cond_signal
(
&
ru
->
proc
.
cond_feptx
)
==
0
,
"ERROR pthread_cond_signal for precoding and ofdm finish
\n
"
);
AssertFatal
((
ret
=
pthread_mutex_unlock
(
&
ru
->
proc
.
mutex_feptx
))
==
0
,
"mutex_lock returns %d
\n
"
,
ret
);
}
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_RU_TX_OFDM_MASK
,
ru
->
proc
.
feptx_mask
);
}
// else (RU only machine)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM
+
feptx
->
index
+
1
,
0
);
}
// while (oai_exit)
return
(
NULL
);
}
// is this supposed to generate a slot or a subframe???
// seems to be hardcoded to numerology 1 (2 slots=1 subframe)
void
nr_feptx_ofdm
(
RU_t
*
ru
,
int
frame_tx
,
int
tti_tx
)
{
void
nr_feptx_ofdm
(
RU_t
*
ru
,
int
frame_tx
,
int
tti_tx
)
{
nfapi_nr_config_request_scf_t
*
cfg
=
&
ru
->
gNB_list
[
0
]
->
gNB_config
;
nfapi_nr_config_request_scf_t
*
cfg
=
&
ru
->
gNB_list
[
0
]
->
gNB_config
;
...
@@ -431,25 +171,7 @@ void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx) {
...
@@ -431,25 +171,7 @@ void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx) {
}
}
void
nr_init_feptx_thread
(
RU_t
*
ru
)
{
// FEP TX precoding function, single-thread
RU_proc_t
*
proc
=
&
ru
->
proc
;
RU_feptx_t
*
feptx
=
proc
->
feptx
;
int
i
=
0
;
for
(
i
=
0
;
i
<
(
ru
->
nb_tx
*
2
);
i
++
){
feptx
[
i
].
instance_cnt_feptx
=
-
1
;
pthread_mutex_init
(
&
feptx
[
i
].
mutex_feptx
,
NULL
);
pthread_cond_init
(
&
feptx
[
i
].
cond_feptx
,
NULL
);
threadCreate
(
&
feptx
[
i
].
pthread_feptx
,
nr_feptx_thread
,
(
void
*
)
&
feptx
[
i
],
"feptx"
,
-
1
,
OAI_PRIORITY_RT
);
LOG_I
(
PHY
,
"init feptx thread %d
\n
"
,
i
);
}
}
void
nr_feptx_prec
(
RU_t
*
ru
,
int
frame_tx
,
int
tti_tx
)
{
void
nr_feptx_prec
(
RU_t
*
ru
,
int
frame_tx
,
int
tti_tx
)
{
int
l
,
aa
;
int
l
,
aa
;
...
@@ -508,140 +230,7 @@ void nr_feptx_prec(RU_t *ru,int frame_tx,int tti_tx) {
...
@@ -508,140 +230,7 @@ void nr_feptx_prec(RU_t *ru,int frame_tx,int tti_tx) {
stop_meas
(
&
ru
->
precoding_stats
);
stop_meas
(
&
ru
->
precoding_stats
);
}
}
void
nr_fep0
(
RU_t
*
ru
,
int
aid
)
{
// single thread RU FEP RX
int
l
;
RU_proc_t
*
proc
=
&
ru
->
proc
;
NR_DL_FRAME_PARMS
*
fp
=
ru
->
nr_frame_parms
;
// printf("fep0: slot %d\n",slot);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX
+
proc
->
tti_rx
,
1
);
int
offset
=
(
proc
->
tti_rx
&
3
)
*
fp
->
symbols_per_slot
*
fp
->
ofdm_symbol_size
;
for
(
l
=
0
;
l
<
NR_SYMBOLS_PER_SLOT
;
l
++
)
{
nr_slot_fep_ul
(
fp
,
ru
->
common
.
rxdata
[
aid
],
&
ru
->
common
.
rxdataF
[
aid
][
offset
],
l
,
proc
->
tti_rx
,
ru
->
N_TA_offset
);
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX
+
proc
->
tti_rx
,
0
);
}
static
void
*
nr_feprx_thread
(
void
*
param
)
{
feprx_cmd_t
*
feprx_cmd
=
(
feprx_cmd_t
*
)
param
;
RU_t
*
ru
=
feprx_cmd
->
ru
;
RU_proc_t
*
proc
=
&
ru
->
proc
;
int
aid
=
feprx_cmd
->
aid
;
while
(
!
oai_exit
)
{
if
(
wait_on_condition
(
&
proc
->
mutex_fep
[
aid
-
1
],
&
proc
->
cond_fep
[
aid
-
1
],
&
proc
->
instance_cnt_fep
[
aid
-
1
],
"NR feprx thread"
)
<
0
)
break
;
if
(
oai_exit
)
break
;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX1
,
1
);
nr_fep0
(
ru
,
aid
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX1
,
0
);
if
(
release_thread
(
&
proc
->
mutex_fep
[
aid
-
1
],
&
proc
->
instance_cnt_fep
[
aid
-
1
],
"nr_feprx thread"
)
<
0
)
break
;
if
(
pthread_cond_signal
(
&
proc
->
cond_fep
[
aid
-
1
])
!=
0
)
{
printf
(
"[gNB] ERROR pthread_cond_signal for nr_feprx thread exit
\n
"
);
exit_fun
(
"ERROR pthread_cond_signal"
);
return
NULL
;
}
}
free
(
param
);
return
NULL
;
}
void
nr_init_feprx_thread
(
RU_t
*
ru
)
{
RU_proc_t
*
proc
=
&
ru
->
proc
;
AssertFatal
(
ru
->
nb_rx
<
8
,
"FEP is limited to 8 antennas maximum
\n
"
);
feprx_cmd_t
*
feprx_cmd
;
for
(
int
aid
=
0
;
aid
<
(
ru
->
nb_rx
-
1
);
aid
++
)
{
proc
->
instance_cnt_fep
[
aid
]
=
-
1
;
pthread_mutex_init
(
&
proc
->
mutex_fep
[
aid
],
NULL
);
pthread_cond_init
(
&
proc
->
cond_fep
[
aid
],
NULL
);
feprx_cmd
=
malloc
(
sizeof
(
feprx_cmd_t
));
feprx_cmd
->
aid
=
aid
+
1
;
feprx_cmd
->
ru
=
ru
;
threadCreate
(
&
proc
->
pthread_fep
[
aid
],
nr_feprx_thread
,
(
void
*
)
feprx_cmd
,
"feprx"
,
-
1
,
OAI_PRIORITY_RT
);
}
}
void
nr_fep_full_2thread
(
RU_t
*
ru
,
int
slot
)
{
RU_proc_t
*
proc
=
&
ru
->
proc
;
struct
timespec
wait
;
// NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
// if ((fp->frame_type == TDD) &&
// (subframe_select(fp,proc->tti_rx) != NR_UPLINK_SLOT)) return;
if
(
ru
->
idx
==
0
)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX
,
1
);
wait
.
tv_sec
=
0
;
wait
.
tv_nsec
=
7000000L
;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX
,
1
);
start_meas
(
&
ru
->
ofdm_demod_stats
);
for
(
int
aid
=
0
;
aid
<
ru
->
nb_rx
-
1
;
aid
++
)
{
if
(
pthread_mutex_timedlock
(
&
proc
->
mutex_fep
[
aid
],
&
wait
)
!=
0
)
{
printf
(
"[RU] ERROR timeout on pthread_mutex_lock for nr_feprx thread aid %d (IC %d)
\n
"
,
aid
,
proc
->
instance_cnt_fep
[
aid
]);
exit_fun
(
"error locking mutex_fep"
);
return
;
}
if
(
proc
->
instance_cnt_fep
[
aid
]
==
0
)
{
printf
(
"[RU] FEP thread busy
\n
"
);
exit_fun
(
"FEP thread busy"
);
pthread_mutex_unlock
(
&
proc
->
mutex_fep
[
aid
]
);
return
;
}
++
proc
->
instance_cnt_fep
[
aid
];
if
(
pthread_cond_signal
(
&
proc
->
cond_fep
[
aid
])
!=
0
)
{
printf
(
"[RU] ERROR pthread_cond_signal for nr_feprx thread
\n
"
);
exit_fun
(
"ERROR pthread_cond_signal"
);
return
;
}
//start_meas(&ru->ofdm_demod_wakeup_stats);
pthread_mutex_unlock
(
&
proc
->
mutex_fep
[
aid
]
);
}
// call first antenna in this thread
nr_fep0
(
ru
,
0
);
start_meas
(
&
ru
->
ofdm_demod_wait_stats
);
for
(
int
aid
=
0
;
aid
<
ru
->
nb_rx
-
1
;
aid
++
)
wait_on_busy_condition
(
&
proc
->
mutex_fep
[
aid
],
&
proc
->
cond_fep
[
aid
],
&
proc
->
instance_cnt_fep
[
aid
],
"nr_feprx thread"
);
stop_meas
(
&
ru
->
ofdm_demod_wait_stats
);
if
(
opp_enabled
==
1
&&
ru
->
ofdm_demod_wakeup_stats
.
p_time
>
30
*
3000
){
print_meas_now
(
&
ru
->
ofdm_demod_wakeup_stats
,
"fep wakeup"
,
stderr
);
printf
(
"delay in fep wait on codition in frame_rx: %d subframe_rx: %d
\n
"
,
proc
->
frame_rx
,
proc
->
tti_rx
);
}
stop_meas
(
&
ru
->
ofdm_demod_stats
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX
,
0
);
}
void
nr_fep_full
(
RU_t
*
ru
,
int
slot
)
{
void
nr_fep_full
(
RU_t
*
ru
,
int
slot
)
{
RU_proc_t
*
proc
=
&
ru
->
proc
;
RU_proc_t
*
proc
=
&
ru
->
proc
;
...
@@ -677,7 +266,7 @@ void nr_fep_full(RU_t *ru, int slot) {
...
@@ -677,7 +266,7 @@ void nr_fep_full(RU_t *ru, int slot) {
}
}
// core routine for FEP TX, called from threads in RU TX thread-pool
void
nr_feptx
(
void
*
arg
)
{
void
nr_feptx
(
void
*
arg
)
{
feptx_cmd_t
*
feptx
=
(
feptx_cmd_t
*
)
arg
;
feptx_cmd_t
*
feptx
=
(
feptx_cmd_t
*
)
arg
;
...
@@ -732,6 +321,8 @@ void nr_feptx(void *arg) {
...
@@ -732,6 +321,8 @@ void nr_feptx(void *arg) {
////////////FEPTX////////////
////////////FEPTX////////////
nr_feptx0
(
ru
,
slot
,
0
,
fp
->
symbols_per_slot
,
aa
);
nr_feptx0
(
ru
,
slot
,
0
,
fp
->
symbols_per_slot
,
aa
);
}
}
// RU FEP TX using thread-pool
void
nr_feptx_tp
(
RU_t
*
ru
,
int
frame_tx
,
int
slot
)
{
void
nr_feptx_tp
(
RU_t
*
ru
,
int
frame_tx
,
int
slot
)
{
nfapi_nr_config_request_scf_t
*
cfg
=
&
ru
->
gNB_list
[
0
]
->
gNB_config
;
nfapi_nr_config_request_scf_t
*
cfg
=
&
ru
->
gNB_list
[
0
]
->
gNB_config
;
...
@@ -759,6 +350,7 @@ void nr_feptx_tp(RU_t *ru, int frame_tx, int slot) {
...
@@ -759,6 +350,7 @@ void nr_feptx_tp(RU_t *ru, int frame_tx, int slot) {
if
(
ru
->
idx
==
0
)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM
,
0
);
if
(
ru
->
idx
==
0
)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM
,
0
);
}
}
// core RX FEP routine, called by threads in RU thread-pool
void
nr_fep
(
void
*
arg
)
{
void
nr_fep
(
void
*
arg
)
{
feprx_cmd_t
*
feprx_cmd
=
(
feprx_cmd_t
*
)
arg
;
feprx_cmd_t
*
feprx_cmd
=
(
feprx_cmd_t
*
)
arg
;
...
@@ -783,6 +375,8 @@ void nr_fep(void* arg) {
...
@@ -783,6 +375,8 @@ void nr_fep(void* arg) {
ru
->
N_TA_offset
);
ru
->
N_TA_offset
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX
+
aid
,
0
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX
+
aid
,
0
);
}
}
// RU RX FEP using thread-pool
void
nr_fep_tp
(
RU_t
*
ru
,
int
slot
)
{
void
nr_fep_tp
(
RU_t
*
ru
,
int
slot
)
{
int
nbfeprx
=
0
;
int
nbfeprx
=
0
;
...
...
openair1/SCHED_NR/sched_nr.h
View file @
491d97de
...
@@ -42,16 +42,11 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx);
...
@@ -42,16 +42,11 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx);
void
L1_nr_prach_procedures
(
PHY_VARS_gNB
*
gNB
,
int
frame
,
int
slot
);
void
L1_nr_prach_procedures
(
PHY_VARS_gNB
*
gNB
,
int
frame
,
int
slot
);
void
nr_common_signal_procedures
(
PHY_VARS_gNB
*
gNB
,
int
frame
,
int
slot
,
nfapi_nr_dl_tti_ssb_pdu
ssb_pdu
);
void
nr_common_signal_procedures
(
PHY_VARS_gNB
*
gNB
,
int
frame
,
int
slot
,
nfapi_nr_dl_tti_ssb_pdu
ssb_pdu
);
void
nr_feptx_ofdm
(
RU_t
*
ru
,
int
frame_tx
,
int
tti_tx
);
void
nr_feptx_ofdm
(
RU_t
*
ru
,
int
frame_tx
,
int
tti_tx
);
void
nr_feptx_ofdm_2thread
(
RU_t
*
ru
,
int
frame_tx
,
int
tti_tx
);
void
nr_feptx0
(
RU_t
*
ru
,
int
tti_tx
,
int
first_symbol
,
int
num_symbols
,
int
aa
);
void
nr_feptx0
(
RU_t
*
ru
,
int
tti_tx
,
int
first_symbol
,
int
num_symbols
,
int
aa
);
void
nr_init_feptx_thread
(
RU_t
*
ru
);
void
fep_full
(
RU_t
*
ru
,
int
slot
);
void
fep_full
(
RU_t
*
ru
,
int
slot
);
void
nr_feptx_prec
(
RU_t
*
ru
,
int
frame_tx
,
int
tti_tx
);
void
nr_feptx_prec
(
RU_t
*
ru
,
int
frame_tx
,
int
tti_tx
);
void
nr_init_feptx_prec_thread
(
RU_t
*
ru
);
void
nr_feptx_prec_control
(
RU_t
*
ru
,
int
frame
,
int
tti_tx
);
void
nr_feptx_prec_control
(
RU_t
*
ru
,
int
frame
,
int
tti_tx
);
void
nr_init_feprx_thread
(
RU_t
*
ru
);
void
nr_fep_full
(
RU_t
*
ru
,
int
slot
);
void
nr_fep_full
(
RU_t
*
ru
,
int
slot
);
void
nr_fep_full_2thread
(
RU_t
*
ru
,
int
slot
);
void
nr_fep_tp
(
RU_t
*
ru
,
int
slot
);
void
nr_fep_tp
(
RU_t
*
ru
,
int
slot
);
void
nr_feptx_tp
(
RU_t
*
ru
,
int
frame_tx
,
int
slot
);
void
nr_feptx_tp
(
RU_t
*
ru
,
int
frame_tx
,
int
slot
);
void
feptx_prec
(
RU_t
*
ru
,
int
frame_tx
,
int
tti_tx
);
void
feptx_prec
(
RU_t
*
ru
,
int
frame_tx
,
int
tti_tx
);
...
...
targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h
View file @
491d97de
...
@@ -38,7 +38,6 @@
...
@@ -38,7 +38,6 @@
#ifndef LITE_COMPILATION
#ifndef LITE_COMPILATION
#include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/LTE_TRANSPORT/if5_tools.h"
#endif
#endif
// ETH transport preference modes
// ETH transport preference modes
...
...
targets/RT/USER/lte-enb.c
View file @
491d97de
...
@@ -67,7 +67,6 @@
...
@@ -67,7 +67,6 @@
//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
#include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/LTE_TRANSPORT/if5_tools.h"
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
#include "PHY/phy_extern.h"
#include "PHY/phy_extern.h"
...
...
targets/RT/USER/lte-ru.c
View file @
491d97de
...
@@ -54,7 +54,6 @@
...
@@ -54,7 +54,6 @@
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/LTE_TRANSPORT/if5_tools.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "SCHED/sched_common.h"
#include "SCHED/sched_common.h"
#include "common/utils/LOG/log.h"
#include "common/utils/LOG/log.h"
...
@@ -136,8 +135,18 @@ static inline void fh_if5_south_out(RU_t *ru,int frame, int subframe, uint64_t t
...
@@ -136,8 +135,18 @@ static inline void fh_if5_south_out(RU_t *ru,int frame, int subframe, uint64_t t
if
(
ru
->
idx
==
0
)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST
,
ru
->
proc
.
timestamp_tx
&
0xffffffff
);
if
(
ru
->
idx
==
0
)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST
,
ru
->
proc
.
timestamp_tx
&
0xffffffff
);
ru
->
south_out_cnt
++
;
ru
->
south_out_cnt
++
;
int
offset
=
subframe
*
ru
->
frame_parms
->
samples_per_tti
;
void
*
buffs
[
ru
->
nb_tx
];
for
(
int
aid
=
0
;
aid
<
ru
->
nb_tx
;
aid
++
)
buffs
[
aid
]
=
(
void
*
)
&
ru
->
common
.
txdata
[
aid
][
offset
];
ru
->
ifdevice
.
trx_write_func2
(
&
ru
->
ifdevice
,
timestamp
,
buffs
,
0
,
ru
->
frame_parms
->
samples_per_tti
,
0
,
ru
->
nb_tx
);
send_IF5
(
ru
,
timestamp
,
subframe
,
&
ru
->
seqno
,
IF5_RRH_GW_DL
);
}
}
...
@@ -174,7 +183,7 @@ void fh_if5_south_in(RU_t *ru,
...
@@ -174,7 +183,7 @@ void fh_if5_south_in(RU_t *ru,
int
*
subframe
)
{
int
*
subframe
)
{
LTE_DL_FRAME_PARMS
*
fp
=
ru
->
frame_parms
;
LTE_DL_FRAME_PARMS
*
fp
=
ru
->
frame_parms
;
RU_proc_t
*
proc
=
&
ru
->
proc
;
RU_proc_t
*
proc
=
&
ru
->
proc
;
r
ecv_IF5
(
ru
,
&
proc
->
timestamp_rx
,
*
subframe
,
IF5_RRH_GW_UL
);
r
u
->
ifdevice
.
trx_read_func2
(
&
ru
->
ifdevice
,
&
proc
->
timestamp_rx
,
NULL
,
fp
->
samples_per_tti
);
proc
->
frame_rx
=
(
proc
->
timestamp_rx
/
(
fp
->
samples_per_tti
*
10
))
&
1023
;
proc
->
frame_rx
=
(
proc
->
timestamp_rx
/
(
fp
->
samples_per_tti
*
10
))
&
1023
;
proc
->
tti_rx
=
(
proc
->
timestamp_rx
/
fp
->
samples_per_tti
)
%
10
;
proc
->
tti_rx
=
(
proc
->
timestamp_rx
/
fp
->
samples_per_tti
)
%
10
;
...
@@ -400,8 +409,8 @@ void fh_if5_north_asynch_in(RU_t *ru,
...
@@ -400,8 +409,8 @@ void fh_if5_north_asynch_in(RU_t *ru,
LTE_DL_FRAME_PARMS
*
fp
=
ru
->
frame_parms
;
LTE_DL_FRAME_PARMS
*
fp
=
ru
->
frame_parms
;
RU_proc_t
*
proc
=
&
ru
->
proc
;
RU_proc_t
*
proc
=
&
ru
->
proc
;
int
tti_tx
,
frame_tx
;
int
tti_tx
,
frame_tx
;
openair0_timestamp
timestamp_tx
;
openair0_timestamp
timestamp_tx
=
0
;
recv_IF5
(
ru
,
&
timestamp_tx
,
*
subframe
,
IF5_RRH_GW_DL
);
//
recv_IF5(ru, ×tamp_tx, *subframe, IF5_RRH_GW_DL);
// LOG_I(PHY,"Received subframe %d (TS %llu) from RCC\n",tti_tx,timestamp_tx);
// LOG_I(PHY,"Received subframe %d (TS %llu) from RCC\n",tti_tx,timestamp_tx);
tti_tx
=
(
timestamp_tx
/
fp
->
samples_per_tti
)
%
10
;
tti_tx
=
(
timestamp_tx
/
fp
->
samples_per_tti
)
%
10
;
frame_tx
=
(
timestamp_tx
/
(
fp
->
samples_per_tti
*
10
))
&
1023
;
frame_tx
=
(
timestamp_tx
/
(
fp
->
samples_per_tti
*
10
))
&
1023
;
...
@@ -498,7 +507,7 @@ void fh_if5_north_out(RU_t *ru) {
...
@@ -498,7 +507,7 @@ void fh_if5_north_out(RU_t *ru) {
uint8_t
seqno
=
0
;
uint8_t
seqno
=
0
;
/// **** send_IF5 of rxdata to BBU **** ///
/// **** send_IF5 of rxdata to BBU **** ///
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF5
,
1
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF5
,
1
);
send_IF5
(
ru
,
proc
->
timestamp_rx
,
proc
->
tti_rx
,
&
seqno
,
IF5_RRH_GW_UL
);
//
send_IF5(ru, proc->timestamp_rx, proc->tti_rx, &seqno, IF5_RRH_GW_UL);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF5
,
0
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF5
,
0
);
}
}
...
...
targets/RT/USER/ru_control.c
View file @
491d97de
...
@@ -57,7 +57,6 @@
...
@@ -57,7 +57,6 @@
#include "../../ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h"
#include "../../ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/LTE_TRANSPORT/if5_tools.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "SCHED/sched_eNB.h"
#include "SCHED/sched_eNB.h"
...
...
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