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
b031fd3f
Commit
b031fd3f
authored
Jan 12, 2024
by
mir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TASK_MANAGER_RU RF Sim working
parent
b11c8070
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
103 additions
and
8 deletions
+103
-8
common/utils/thread_pool/task_manager.h
common/utils/thread_pool/task_manager.h
+2
-5
executables/nr-ru.c
executables/nr-ru.c
+5
-0
openair1/PHY/defs_RU.h
openair1/PHY/defs_RU.h
+11
-0
openair1/SCHED_NR/nr_ru_procedures.c
openair1/SCHED_NR/nr_ru_procedures.c
+85
-3
No files found.
common/utils/thread_pool/task_manager.h
View file @
b031fd3f
...
@@ -5,17 +5,13 @@
...
@@ -5,17 +5,13 @@
#define TASK_MANAGER_DECODING
#define TASK_MANAGER_DECODING
#define TASK_MANAGER_DEMODULATION
#define TASK_MANAGER_DEMODULATION
#define TASK_MANAGER_CODING
#define TASK_MANAGER_CODING
//#define TASK_MANAGER_RU
#define TASK_MANAGER_RU
//#define TASK_MANAGER_UE
//#define TASK_MANAGER_UE
//#define TASK_MANAGER_UE_DECODING
//#define TASK_MANAGER_UE_DECODING
//#define TASK_MANAGER_SIM
//#define TASK_MANAGER_SIM
//#define TASK_MANAGER_LTE
//#define TASK_MANAGER_LTE
// LTE
//#define TASK_MANAGER_LTE
#include "task.h"
#include "task.h"
#ifndef __cplusplus
#ifndef __cplusplus
...
@@ -36,6 +32,7 @@
...
@@ -36,6 +32,7 @@
#elif __aarch64__
#elif __aarch64__
// This is not always true for ARM
// This is not always true for ARM
// in linux, you can obtain the size at runtime using sysconf (_SC_LEVEL1_DCACHE_LINESIZE)
// in linux, you can obtain the size at runtime using sysconf (_SC_LEVEL1_DCACHE_LINESIZE)
// or from the bash with the command $ getconf LEVEL1_DCACHE_LINESIZE
// in c++ using std::hardware_destructive_interference_size
// in c++ using std::hardware_destructive_interference_size
#define LEVEL1_DCACHE_LINESIZE 64
#define LEVEL1_DCACHE_LINESIZE 64
#else
#else
...
...
executables/nr-ru.c
View file @
b031fd3f
...
@@ -54,6 +54,8 @@
...
@@ -54,6 +54,8 @@
#include <executables/softmodem-common.h>
#include <executables/softmodem-common.h>
#include "common/utils/thread_pool/task_manager.h"
#ifdef SMBV
#ifdef SMBV
#include "PHY/TOOLS/smbv.h"
#include "PHY/TOOLS/smbv.h"
unsigned
short
config_frames
[
4
]
=
{
2
,
9
,
11
,
13
};
unsigned
short
config_frames
[
4
]
=
{
2
,
9
,
11
,
13
};
...
@@ -1907,6 +1909,9 @@ void init_NR_RU(configmodule_interface_t *cfg, char *rf_config_file)
...
@@ -1907,6 +1909,9 @@ void init_NR_RU(configmodule_interface_t *cfg, char *rf_config_file)
s_offset
+=
sprintf
(
pool
+
s_offset
,
",%d"
,
ru
->
tpcores
[
icpu
]);
s_offset
+=
sprintf
(
pool
+
s_offset
,
",%d"
,
ru
->
tpcores
[
icpu
]);
}
}
LOG_I
(
PHY
,
"RU thread-pool core string %s
\n
"
,
pool
);
LOG_I
(
PHY
,
"RU thread-pool core string %s
\n
"
,
pool
);
#ifdef TASK_MANAGER_RU
init_task_manager
(
&
ru
->
man
,
ru
->
num_tpcores
);
#endif
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
));
// FEP RX result FIFO
// FEP RX result FIFO
...
...
openair1/PHY/defs_RU.h
View file @
b031fd3f
...
@@ -41,6 +41,8 @@
...
@@ -41,6 +41,8 @@
#include "nfapi_nr_interface_scf.h"
#include "nfapi_nr_interface_scf.h"
#include <common/utils/threadPool/thread-pool.h>
#include <common/utils/threadPool/thread-pool.h>
#include <executables/rt_profiling.h>
#include <executables/rt_profiling.h>
#include "common/utils/thread_pool/task_manager.h"
#define MAX_BANDS_PER_RRU 4
#define MAX_BANDS_PER_RRU 4
#define MAX_RRU_CONFIG_SIZE 1024
#define MAX_RRU_CONFIG_SIZE 1024
...
@@ -176,6 +178,9 @@ typedef struct {
...
@@ -176,6 +178,9 @@ typedef struct {
int
startSymbol
;
int
startSymbol
;
int
endSymbol
;
int
endSymbol
;
int
slot
;
int
slot
;
#ifdef TASK_MANAGER_RU
task_ans_t
*
ans
;
#endif
}
feprx_cmd_t
;
}
feprx_cmd_t
;
typedef
struct
{
typedef
struct
{
...
@@ -184,6 +189,9 @@ typedef struct {
...
@@ -184,6 +189,9 @@ typedef struct {
int
slot
;
int
slot
;
int
startSymbol
;
int
startSymbol
;
int
numSymbols
;
int
numSymbols
;
#ifdef TASK_MANAGER_RU
task_ans_t
*
ans
;
#endif
}
feptx_cmd_t
;
}
feptx_cmd_t
;
typedef
struct
{
typedef
struct
{
...
@@ -426,6 +434,9 @@ typedef enum {
...
@@ -426,6 +434,9 @@ typedef enum {
typedef
struct
RU_t_s
{
typedef
struct
RU_t_s
{
#ifdef TASK_MANAGER_RU
task_manager_t
man
;
#endif
/// ThreadPool for RU
/// ThreadPool for RU
tpool_t
*
threadPool
;
tpool_t
*
threadPool
;
/// index of this ru
/// index of this ru
...
...
openair1/SCHED_NR/nr_ru_procedures.c
View file @
b031fd3f
...
@@ -38,6 +38,8 @@
...
@@ -38,6 +38,8 @@
#include "common/utils/LOG/log.h"
#include "common/utils/LOG/log.h"
#include "common/utils/system.h"
#include "common/utils/system.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "common/utils/thread_pool/task_manager.h"
#include "T.h"
#include "T.h"
...
@@ -319,6 +321,10 @@ void nr_feptx(void *arg) {
...
@@ -319,6 +321,10 @@ void nr_feptx(void *arg) {
////////////FEPTX////////////
////////////FEPTX////////////
nr_feptx0
(
ru
,
slot
,
startSymbol
,
numSymbols
,
aa
);
nr_feptx0
(
ru
,
slot
,
startSymbol
,
numSymbols
,
aa
);
#ifdef TASK_MANAGER_RU
completed_task_ans
(
feptx
->
ans
);
#endif
}
}
// RU FEP TX using thread-pool
// RU FEP TX using thread-pool
...
@@ -331,33 +337,69 @@ void nr_feptx_tp(RU_t *ru, int frame_tx, int slot) {
...
@@ -331,33 +337,69 @@ 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
,
1
);
if
(
ru
->
idx
==
0
)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM
,
1
);
start_meas
(
&
ru
->
ofdm_total_stats
);
start_meas
(
&
ru
->
ofdm_total_stats
);
#ifdef TASK_MANAGER_RU
size_t
const
sz
=
ru
->
nb_tx
+
(
ru
->
half_slot_parallelization
>
0
)
*
ru
->
nb_tx
;
feptx_cmd_t
arr
[
sz
];
task_ans_t
ans
[
sz
];
memset
(
ans
,
0
,
sz
*
sizeof
(
task_ans_t
));
#endif
for
(
int
aid
=
0
;
aid
<
ru
->
nb_tx
;
aid
++
)
{
for
(
int
aid
=
0
;
aid
<
ru
->
nb_tx
;
aid
++
)
{
notifiedFIFO_elt_t
*
req
=
newNotifiedFIFO_elt
(
sizeof
(
feptx_cmd_t
),
2000
+
aid
,
ru
->
respfeptx
,
nr_feptx
);
#ifdef TASK_MANAGER_RU
feptx_cmd_t
*
feptx_cmd
=
(
feptx_cmd_t
*
)
NotifiedFifoData
(
req
);
feptx_cmd_t
*
feptx_cmd
=
&
arr
[
nbfeptx
];
feptx_cmd
->
ans
=
&
ans
[
nbfeptx
];
#else
notifiedFIFO_elt_t
*
req
=
newNotifiedFIFO_elt
(
sizeof
(
feptx_cmd_t
),
2000
+
aid
,
ru
->
respfeptx
,
nr_feptx
);
feptx_cmd_t
*
feptx_cmd
=
(
feptx_cmd_t
*
)
NotifiedFifoData
(
req
);
#endif
feptx_cmd
->
aid
=
aid
;
feptx_cmd
->
aid
=
aid
;
feptx_cmd
->
ru
=
ru
;
feptx_cmd
->
ru
=
ru
;
feptx_cmd
->
slot
=
slot
;
feptx_cmd
->
slot
=
slot
;
feptx_cmd
->
startSymbol
=
0
;
feptx_cmd
->
startSymbol
=
0
;
feptx_cmd
->
numSymbols
=
(
ru
->
half_slot_parallelization
>
0
)
?
ru
->
nr_frame_parms
->
symbols_per_slot
>>
1
:
ru
->
nr_frame_parms
->
symbols_per_slot
;
feptx_cmd
->
numSymbols
=
(
ru
->
half_slot_parallelization
>
0
)
?
ru
->
nr_frame_parms
->
symbols_per_slot
>>
1
:
ru
->
nr_frame_parms
->
symbols_per_slot
;
#ifdef TASK_MANAGER_RU
task_t
t
=
{.
func
=
nr_feptx
,
.
args
=
feptx_cmd
};
async_task_manager
(
&
ru
->
man
,
t
);
#else
pushTpool
(
ru
->
threadPool
,
req
);
pushTpool
(
ru
->
threadPool
,
req
);
#endif
nbfeptx
++
;
nbfeptx
++
;
if
(
ru
->
half_slot_parallelization
>
0
)
{
if
(
ru
->
half_slot_parallelization
>
0
)
{
notifiedFIFO_elt_t
*
req
=
newNotifiedFIFO_elt
(
sizeof
(
feptx_cmd_t
),
2000
+
aid
+
ru
->
nb_tx
,
ru
->
respfeptx
,
nr_feptx
);
#ifdef TASK_MANAGER_RU
feptx_cmd_t
*
feptx_cmd
=
&
arr
[
nbfeptx
];
feptx_cmd
->
ans
=
&
ans
[
nbfeptx
];
#else
notifiedFIFO_elt_t
*
req
=
newNotifiedFIFO_elt
(
sizeof
(
feptx_cmd_t
),
2000
+
aid
+
ru
->
nb_tx
,
ru
->
respfeptx
,
nr_feptx
);
feptx_cmd_t
*
feptx_cmd
=
(
feptx_cmd_t
*
)
NotifiedFifoData
(
req
);
feptx_cmd_t
*
feptx_cmd
=
(
feptx_cmd_t
*
)
NotifiedFifoData
(
req
);
#endif
feptx_cmd
->
aid
=
aid
;
feptx_cmd
->
aid
=
aid
;
feptx_cmd
->
ru
=
ru
;
feptx_cmd
->
ru
=
ru
;
feptx_cmd
->
slot
=
slot
;
feptx_cmd
->
slot
=
slot
;
feptx_cmd
->
startSymbol
=
ru
->
nr_frame_parms
->
symbols_per_slot
>>
1
;
feptx_cmd
->
startSymbol
=
ru
->
nr_frame_parms
->
symbols_per_slot
>>
1
;
feptx_cmd
->
numSymbols
=
ru
->
nr_frame_parms
->
symbols_per_slot
>>
1
;
feptx_cmd
->
numSymbols
=
ru
->
nr_frame_parms
->
symbols_per_slot
>>
1
;
#ifdef TASK_MANAGER_RU
task_t
t
=
{.
func
=
nr_feptx
,
.
args
=
feptx_cmd
};
async_task_manager
(
&
ru
->
man
,
t
);
#else
pushTpool
(
ru
->
threadPool
,
req
);
pushTpool
(
ru
->
threadPool
,
req
);
#endif
nbfeptx
++
;
nbfeptx
++
;
}
}
}
}
#ifdef TASK_MANAGER_RU
if
(
nbfeptx
>
0
)
join_task_ans
(
ans
,
nbfeptx
);
#else
while
(
nbfeptx
>
0
)
{
while
(
nbfeptx
>
0
)
{
notifiedFIFO_elt_t
*
req
=
pullTpool
(
ru
->
respfeptx
,
ru
->
threadPool
);
notifiedFIFO_elt_t
*
req
=
pullTpool
(
ru
->
respfeptx
,
ru
->
threadPool
);
delNotifiedFIFO_elt
(
req
);
delNotifiedFIFO_elt
(
req
);
nbfeptx
--
;
nbfeptx
--
;
}
}
#endif
stop_meas
(
&
ru
->
ofdm_total_stats
);
stop_meas
(
&
ru
->
ofdm_total_stats
);
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
);
}
}
...
@@ -387,6 +429,10 @@ void nr_fep(void* arg) {
...
@@ -387,6 +429,10 @@ void nr_fep(void* arg) {
tti_rx
,
tti_rx
,
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
);
#ifdef TASK_MANAGER_RU
completed_task_ans
(
feprx_cmd
->
ans
);
#endif
}
}
// RU RX FEP using thread-pool
// RU RX FEP using thread-pool
...
@@ -395,33 +441,69 @@ void nr_fep_tp(RU_t *ru, int slot) {
...
@@ -395,33 +441,69 @@ void nr_fep_tp(RU_t *ru, int slot) {
int
nbfeprx
=
0
;
int
nbfeprx
=
0
;
if
(
ru
->
idx
==
0
)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX
,
1
);
if
(
ru
->
idx
==
0
)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX
,
1
);
start_meas
(
&
ru
->
ofdm_demod_stats
);
start_meas
(
&
ru
->
ofdm_demod_stats
);
#ifdef TASK_MANAGER_RU
size_t
const
sz
=
ru
->
nb_rx
+
(
ru
->
half_slot_parallelization
>
0
)
*
ru
->
nb_rx
;
feprx_cmd_t
arr
[
sz
];
task_ans_t
ans
[
sz
];
memset
(
&
ans
,
0
,
sz
*
sizeof
(
task_ans_t
));
#endif
for
(
int
aid
=
0
;
aid
<
ru
->
nb_rx
;
aid
++
)
{
for
(
int
aid
=
0
;
aid
<
ru
->
nb_rx
;
aid
++
)
{
#ifdef TASK_MANAGER_RU
feprx_cmd_t
*
feprx_cmd
=
&
arr
[
nbfeprx
];
feprx_cmd
->
ans
=
&
ans
[
nbfeprx
];
#else
notifiedFIFO_elt_t
*
req
=
newNotifiedFIFO_elt
(
sizeof
(
feprx_cmd_t
),
1000
+
aid
,
ru
->
respfeprx
,
nr_fep
);
notifiedFIFO_elt_t
*
req
=
newNotifiedFIFO_elt
(
sizeof
(
feprx_cmd_t
),
1000
+
aid
,
ru
->
respfeprx
,
nr_fep
);
feprx_cmd_t
*
feprx_cmd
=
(
feprx_cmd_t
*
)
NotifiedFifoData
(
req
);
feprx_cmd_t
*
feprx_cmd
=
(
feprx_cmd_t
*
)
NotifiedFifoData
(
req
);
#endif
feprx_cmd
->
aid
=
aid
;
feprx_cmd
->
aid
=
aid
;
feprx_cmd
->
ru
=
ru
;
feprx_cmd
->
ru
=
ru
;
feprx_cmd
->
slot
=
ru
->
proc
.
tti_rx
;
feprx_cmd
->
slot
=
ru
->
proc
.
tti_rx
;
feprx_cmd
->
startSymbol
=
0
;
feprx_cmd
->
startSymbol
=
0
;
feprx_cmd
->
endSymbol
=
(
ru
->
half_slot_parallelization
>
0
)
?
(
ru
->
nr_frame_parms
->
symbols_per_slot
>>
1
)
-
1
:
(
ru
->
nr_frame_parms
->
symbols_per_slot
-
1
);
feprx_cmd
->
endSymbol
=
(
ru
->
half_slot_parallelization
>
0
)
?
(
ru
->
nr_frame_parms
->
symbols_per_slot
>>
1
)
-
1
:
(
ru
->
nr_frame_parms
->
symbols_per_slot
-
1
);
#ifdef TASK_MANAGER_RU
task_t
t
=
{.
func
=
nr_fep
,
.
args
=
feprx_cmd
};
async_task_manager
(
&
ru
->
man
,
t
);
#else
pushTpool
(
ru
->
threadPool
,
req
);
pushTpool
(
ru
->
threadPool
,
req
);
#endif
nbfeprx
++
;
nbfeprx
++
;
if
(
ru
->
half_slot_parallelization
>
0
)
{
if
(
ru
->
half_slot_parallelization
>
0
)
{
#ifdef TASK_MANAGER_RU
feprx_cmd_t
*
feprx_cmd
=
&
arr
[
nbfeprx
];
feprx_cmd
->
ans
=
&
ans
[
nbfeprx
];
#else
notifiedFIFO_elt_t
*
req
=
newNotifiedFIFO_elt
(
sizeof
(
feprx_cmd_t
),
1000
+
aid
+
ru
->
nb_rx
,
ru
->
respfeprx
,
nr_fep
);
notifiedFIFO_elt_t
*
req
=
newNotifiedFIFO_elt
(
sizeof
(
feprx_cmd_t
),
1000
+
aid
+
ru
->
nb_rx
,
ru
->
respfeprx
,
nr_fep
);
feprx_cmd_t
*
feprx_cmd
=
(
feprx_cmd_t
*
)
NotifiedFifoData
(
req
);
feprx_cmd_t
*
feprx_cmd
=
(
feprx_cmd_t
*
)
NotifiedFifoData
(
req
);
#endif
feprx_cmd
->
aid
=
aid
;
feprx_cmd
->
aid
=
aid
;
feprx_cmd
->
ru
=
ru
;
feprx_cmd
->
ru
=
ru
;
feprx_cmd
->
slot
=
ru
->
proc
.
tti_rx
;
feprx_cmd
->
slot
=
ru
->
proc
.
tti_rx
;
feprx_cmd
->
startSymbol
=
ru
->
nr_frame_parms
->
symbols_per_slot
>>
1
;
feprx_cmd
->
startSymbol
=
ru
->
nr_frame_parms
->
symbols_per_slot
>>
1
;
feprx_cmd
->
endSymbol
=
ru
->
nr_frame_parms
->
symbols_per_slot
-
1
;
feprx_cmd
->
endSymbol
=
ru
->
nr_frame_parms
->
symbols_per_slot
-
1
;
#ifdef TASK_MANAGER_RU
task_t
t
=
{.
func
=
nr_fep
,
.
args
=
feprx_cmd
};
async_task_manager
(
&
ru
->
man
,
t
);
#else
pushTpool
(
ru
->
threadPool
,
req
);
pushTpool
(
ru
->
threadPool
,
req
);
#endif
nbfeprx
++
;
nbfeprx
++
;
}
}
}
}
#ifdef TASK_MANAGER_RU
if
(
nbfeprx
>
0
)
join_task_ans
(
ans
,
nbfeprx
);
#else
while
(
nbfeprx
>
0
)
{
while
(
nbfeprx
>
0
)
{
notifiedFIFO_elt_t
*
req
=
pullTpool
(
ru
->
respfeprx
,
ru
->
threadPool
);
notifiedFIFO_elt_t
*
req
=
pullTpool
(
ru
->
respfeprx
,
ru
->
threadPool
);
delNotifiedFIFO_elt
(
req
);
delNotifiedFIFO_elt
(
req
);
nbfeprx
--
;
nbfeprx
--
;
}
}
#endif
stop_meas
(
&
ru
->
ofdm_demod_stats
);
stop_meas
(
&
ru
->
ofdm_demod_stats
);
if
(
ru
->
idx
==
0
)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX
,
0
);
if
(
ru
->
idx
==
0
)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX
,
0
);
}
}
...
...
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