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
wangwenhui
OpenXG-RAN
Commits
58309dd7
Commit
58309dd7
authored
Dec 23, 2020
by
frtabu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify nrue command line parameter processing
parent
d3919b6a
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
110 additions
and
117 deletions
+110
-117
common/utils/LOG/log.h
common/utils/LOG/log.h
+1
-0
common/utils/threadPool/thread-pool.h
common/utils/threadPool/thread-pool.h
+1
-1
executables/nr-uesoftmodem.c
executables/nr-uesoftmodem.c
+55
-54
executables/nr-uesoftmodem.h
executables/nr-uesoftmodem.h
+43
-53
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
+10
-9
No files found.
common/utils/LOG/log.h
View file @
58309dd7
...
@@ -167,6 +167,7 @@ extern "C" {
...
@@ -167,6 +167,7 @@ extern "C" {
{"SECURITY", DEBUG_SECURITY},\
{"SECURITY", DEBUG_SECURITY},\
{"NAS", DEBUG_NAS},\
{"NAS", DEBUG_NAS},\
{"RLC", DEBUG_RLC},\
{"RLC", DEBUG_RLC},\
{"DLSCH_DECOD", DEBUG_DLSCH_DECOD},\
{"UE_TIMING", UE_TIMING},\
{"UE_TIMING", UE_TIMING},\
{NULL,-1}\
{NULL,-1}\
}
}
...
...
common/utils/threadPool/thread-pool.h
View file @
58309dd7
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
#define condwait(condition, mutex) AssertFatal(pthread_cond_wait(&condition, &mutex)==0,"");
#define condwait(condition, mutex) AssertFatal(pthread_cond_wait(&condition, &mutex)==0,"");
#define condbroadcast(signal) AssertFatal(pthread_cond_broadcast(&signal)==0,"");
#define condbroadcast(signal) AssertFatal(pthread_cond_broadcast(&signal)==0,"");
#define condsignal(signal) AssertFatal(pthread_cond_broadcast(&signal)==0,"");
#define condsignal(signal) AssertFatal(pthread_cond_broadcast(&signal)==0,"");
#define tpool_nbthreads(tpool) (tpool.nbThreads)
typedef
struct
notifiedFIFO_elt_s
{
typedef
struct
notifiedFIFO_elt_s
{
struct
notifiedFIFO_elt_s
*
next
;
struct
notifiedFIFO_elt_s
*
next
;
uint64_t
key
;
//To filter out elements
uint64_t
key
;
//To filter out elements
...
...
executables/nr-uesoftmodem.c
View file @
58309dd7
...
@@ -111,17 +111,10 @@ extern int16_t nr_dlsch_demod_shift;
...
@@ -111,17 +111,10 @@ extern int16_t nr_dlsch_demod_shift;
static
int
tx_max_power
[
MAX_NUM_CCs
]
=
{
0
};
static
int
tx_max_power
[
MAX_NUM_CCs
]
=
{
0
};
int
single_thread_flag
=
1
;
int
single_thread_flag
=
1
;
int
threequarter_fs
=
0
;
int
UE_scan_carrier
=
0
;
int
UE_fo_compensation
=
0
;
int
UE_no_timing_correction
=
0
;
int
N_RB_DL
=
0
;
int
tddflag
=
0
;
int
tddflag
=
0
;
int
vcdflag
=
0
;
int
vcdflag
=
0
;
uint8_t
nb_antenna_tx
=
1
;
uint8_t
nb_antenna_rx
=
1
;
double
rx_gain_off
=
0
.
0
;
double
rx_gain_off
=
0
.
0
;
uint32_t
timing_advance
=
0
;
char
*
usrp_args
=
NULL
;
char
*
usrp_args
=
NULL
;
char
*
rrc_config_path
=
NULL
;
char
*
rrc_config_path
=
NULL
;
int
dumpframe
=
0
;
int
dumpframe
=
0
;
...
@@ -147,8 +140,7 @@ int16_t node_synch_ref[MAX_NUM_CCs];
...
@@ -147,8 +140,7 @@ int16_t node_synch_ref[MAX_NUM_CCs];
int
otg_enabled
;
int
otg_enabled
;
double
cpuf
;
double
cpuf
;
runmode_t
mode
=
normal_txrx
;
int
UE_scan
=
0
;
int
chain_offset
=
0
;
int
chain_offset
=
0
;
int
card_offset
=
0
;
int
card_offset
=
0
;
uint64_t
num_missed_slots
=
0
;
// counter for the number of missed slots
uint64_t
num_missed_slots
=
0
;
// counter for the number of missed slots
...
@@ -222,38 +214,21 @@ nrUE_params_t *get_nrUE_params(void) {
...
@@ -222,38 +214,21 @@ nrUE_params_t *get_nrUE_params(void) {
}
}
/* initialie thread pools used for NRUE processing paralleliation */
/* initialie thread pools used for NRUE processing paralleliation */
void
init_tpools
(
uint8_t
nun_dlsch_threads
)
{
void
init_tpools
(
uint8_t
nun_dlsch_threads
)
{
char
*
params
=
calloc
(
1
,(
RX_NB_TH
*
2
)
+
1
);
initTpool
(
"-1,-1"
,
&
(
nrUE_params
.
Tpool
),
false
);
for
(
int
i
=
0
;
i
<
RX_NB_TH
;
i
++
)
{
init_dlsch_tpool
(
nrUE_params
.
nr_dlsch_parallel
);
memcpy
(
params
+
(
i
*
2
),
"-1"
,
2
);
}
initTpool
(
params
,
&
(
nrUE_params
.
Tpool
),
false
);
free
(
params
);
init_dlsch_tpool
(
nun_dlsch_threads
);
}
}
static
void
get_options
(
void
)
{
static
void
get_options
(
void
)
{
char
*
loopfile
=
NULL
;
paramdef_t
cmdline_params
[]
=
CMDLINE_NRUEPARAMS_DESC
;
int
numparams
=
sizeof
(
cmdline_params
)
/
sizeof
(
paramdef_t
);
paramdef_t
cmdline_params
[]
=
CMDLINE_PARAMS_DESC_UE
;
config_process_cmdline
(
cmdline_params
,
numparams
,
NULL
);
config_process_cmdline
(
cmdline_params
,
sizeof
(
cmdline_params
)
/
sizeof
(
paramdef_t
),
NULL
);
paramdef_t
cmdline_uemodeparams
[]
=
CMDLINE_UEMODEPARAMS_DESC
;
paramdef_t
cmdline_ueparams
[]
=
CMDLINE_NRUEPARAMS_DESC
;
config_process_cmdline
(
cmdline_uemodeparams
,
sizeof
(
cmdline_uemodeparams
)
/
sizeof
(
paramdef_t
),
NULL
);
config_process_cmdline
(
cmdline_ueparams
,
sizeof
(
cmdline_ueparams
)
/
sizeof
(
paramdef_t
),
NULL
);
if
(
(
cmdline_uemodeparams
[
CMDLINE_CALIBUERX_IDX
].
paramflags
&
PARAMFLAG_PARAMSET
)
!=
0
)
mode
=
rx_calib_ue
;
if
(
(
cmdline_uemodeparams
[
CMDLINE_CALIBUERXMED_IDX
].
paramflags
&
PARAMFLAG_PARAMSET
)
!=
0
)
mode
=
rx_calib_ue_med
;
if
(
(
cmdline_uemodeparams
[
CMDLINE_CALIBUERXBYP_IDX
].
paramflags
&
PARAMFLAG_PARAMSET
)
!=
0
)
mode
=
rx_calib_ue_byp
;
if
(
cmdline_uemodeparams
[
CMDLINE_DEBUGUEPRACH_IDX
].
uptr
)
if
(
*
(
cmdline_uemodeparams
[
CMDLINE_DEBUGUEPRACH_IDX
].
uptr
)
>
0
)
mode
=
debug_prach
;
if
(
cmdline_uemodeparams
[
CMDLINE_NOL2CONNECT_IDX
].
uptr
)
if
(
*
(
cmdline_uemodeparams
[
CMDLINE_NOL2CONNECT_IDX
].
uptr
)
>
0
)
mode
=
no_L2_connect
;
if
(
cmdline_uemodeparams
[
CMDLINE_CALIBPRACHTX_IDX
].
uptr
)
if
(
*
(
cmdline_uemodeparams
[
CMDLINE_CALIBPRACHTX_IDX
].
uptr
)
>
0
)
mode
=
calib_prach_tx
;
if
((
cmdline_uemodeparams
[
CMDLINE_DUMPMEMORY_IDX
].
paramflags
&
PARAMFLAG_PARAMSET
)
!=
0
)
mode
=
rx_dump_frame
;
if
(
vcdflag
>
0
)
if
(
vcdflag
>
0
)
ouput_vcd
=
1
;
ouput_vcd
=
1
;
...
@@ -270,6 +245,38 @@ static void get_options(void) {
...
@@ -270,6 +245,38 @@ static void get_options(void) {
// set PHY vars from command line
// set PHY vars from command line
void
set_options
(
int
CC_id
,
PHY_VARS_NR_UE
*
UE
){
void
set_options
(
int
CC_id
,
PHY_VARS_NR_UE
*
UE
){
NR_DL_FRAME_PARMS
*
fp
=
&
UE
->
frame_parms
;
paramdef_t
cmdline_params
[]
=
CMDLINE_NRUE_PHYPARAMS_DESC
;
int
numparams
=
sizeof
(
cmdline_params
)
/
sizeof
(
paramdef_t
);
UE
->
mode
=
normal_txrx
;
config_process_cmdline
(
cmdline_params
,
numparams
,
NULL
);
int
pindex
=
config_paramidx_fromname
(
cmdline_params
,
numparams
,
CALIBRX_OPT
);
if
(
(
cmdline_params
[
pindex
].
paramflags
&
PARAMFLAG_PARAMSET
)
!=
0
)
UE
->
mode
=
rx_calib_ue
;
pindex
=
config_paramidx_fromname
(
cmdline_params
,
numparams
,
CALIBRXMED_OPT
);
if
(
(
cmdline_params
[
pindex
].
paramflags
&
PARAMFLAG_PARAMSET
)
!=
0
)
UE
->
mode
=
rx_calib_ue_med
;
pindex
=
config_paramidx_fromname
(
cmdline_params
,
numparams
,
CALIBRXBYP_OPT
);
if
(
(
cmdline_params
[
pindex
].
paramflags
&
PARAMFLAG_PARAMSET
)
!=
0
)
UE
->
mode
=
rx_calib_ue_byp
;
pindex
=
config_paramidx_fromname
(
cmdline_params
,
numparams
,
DBGPRACH_OPT
);
if
(
cmdline_params
[
pindex
].
uptr
)
if
(
*
(
cmdline_params
[
pindex
].
uptr
)
>
0
)
UE
->
mode
=
debug_prach
;
pindex
=
config_paramidx_fromname
(
cmdline_params
,
numparams
,
NOL2CONNECT_OPT
);
if
(
cmdline_params
[
pindex
].
uptr
)
if
(
*
(
cmdline_params
[
pindex
].
uptr
)
>
0
)
UE
->
mode
=
no_L2_connect
;
pindex
=
config_paramidx_fromname
(
cmdline_params
,
numparams
,
CALIBPRACH_OPT
);
if
(
cmdline_params
[
pindex
].
uptr
)
if
(
*
(
cmdline_params
[
pindex
].
uptr
)
>
0
)
UE
->
mode
=
calib_prach_tx
;
pindex
=
config_paramidx_fromname
(
cmdline_params
,
numparams
,
DUMPFRAME_OPT
);
if
((
cmdline_params
[
pindex
].
paramflags
&
PARAMFLAG_PARAMSET
)
!=
0
)
UE
->
mode
=
rx_dump_frame
;
// Init power variables
// Init power variables
tx_max_power
[
CC_id
]
=
tx_max_power
[
0
];
tx_max_power
[
CC_id
]
=
tx_max_power
[
0
];
...
@@ -277,35 +284,29 @@ void set_options(int CC_id, PHY_VARS_NR_UE *UE){
...
@@ -277,35 +284,29 @@ void set_options(int CC_id, PHY_VARS_NR_UE *UE){
tx_gain
[
0
][
CC_id
]
=
tx_gain
[
0
][
0
];
tx_gain
[
0
][
CC_id
]
=
tx_gain
[
0
][
0
];
// Set UE variables
// Set UE variables
UE
->
UE_scan
=
UE_scan
;
UE
->
UE_scan_carrier
=
UE_scan_carrier
;
UE
->
UE_fo_compensation
=
UE_fo_compensation
;
UE
->
no_timing_correction
=
UE_no_timing_correction
;
UE
->
mode
=
mode
;
UE
->
rx_total_gain_dB
=
(
int
)
rx_gain
[
CC_id
][
0
]
+
rx_gain_off
;
UE
->
rx_total_gain_dB
=
(
int
)
rx_gain
[
CC_id
][
0
]
+
rx_gain_off
;
UE
->
tx_total_gain_dB
=
(
int
)
tx_gain
[
CC_id
][
0
];
UE
->
tx_total_gain_dB
=
(
int
)
tx_gain
[
CC_id
][
0
];
UE
->
tx_power_max_dBm
=
tx_max_power
[
CC_id
];
UE
->
tx_power_max_dBm
=
tx_max_power
[
CC_id
];
UE
->
rf_map
.
card
=
card_offset
;
UE
->
rf_map
.
card
=
card_offset
;
UE
->
rf_map
.
chain
=
CC_id
+
chain_offset
;
UE
->
rf_map
.
chain
=
CC_id
+
chain_offset
;
UE
->
timing_advance
=
timing_advance
;
LOG_I
(
PHY
,
"Set UE mode %d, UE_fo_compensation %d, UE_scan %d, UE_scan_carrier %d, UE_no_timing_correction %d
\n
"
,
mode
,
UE_fo_compensation
,
UE_scan
,
UE_scan_carrier
,
UE_no_timing_correction
);
LOG_I
(
PHY
,
"Set UE mode %d, UE_fo_compensation %d, UE_scan_carrier %d, UE_no_timing_correction %d
\n
"
,
UE
->
mode
,
UE
->
UE_fo_compensation
,
UE
->
UE_scan_carrier
,
UE
->
no_timing_correction
);
// Set FP variables
// Set FP variables
NR_DL_FRAME_PARMS
*
fp
=
&
UE
->
frame_parms
;
fp
->
nb_antennas_tx
=
nb_antenna_tx
;
fp
->
nb_antennas_rx
=
nb_antenna_rx
;
fp
->
threequarter_fs
=
threequarter_fs
;
if
(
tddflag
){
if
(
tddflag
){
fp
->
frame_type
=
TDD
;
fp
->
frame_type
=
TDD
;
LOG_I
(
PHY
,
"Set UE frame_type %d
\n
"
,
fp
->
frame_type
);
LOG_I
(
PHY
,
"Set UE frame_type %d
\n
"
,
fp
->
frame_type
);
}
}
if
(
N_RB_DL
){
fp
->
N_RB_DL
=
N_RB_DL
;
LOG_I
(
PHY
,
"Set UE N_RB_DL %d
\n
"
,
N_RB_DL
);
}
LOG_I
(
PHY
,
"Set UE nb_rx_antenna %d, nb_tx_antenna %d, threequarter_fs %d
\n
"
,
nb_antenna_rx
,
nb_antenna_tx
,
threequarter_fs
);
LOG_I
(
PHY
,
"Set UE N_RB_DL %d
\n
"
,
fp
->
N_RB_DL
);
LOG_I
(
PHY
,
"Set UE nb_rx_antenna %d, nb_tx_antenna %d, threequarter_fs %d
\n
"
,
fp
->
nb_antennas_rx
,
fp
->
nb_antennas_tx
,
fp
->
threequarter_fs
);
}
}
...
@@ -555,7 +556,7 @@ int main( int argc, char **argv ) {
...
@@ -555,7 +556,7 @@ int main( int argc, char **argv ) {
for
(
int
CC_id
=
0
;
CC_id
<
MAX_NUM_CCs
;
CC_id
++
)
{
for
(
int
CC_id
=
0
;
CC_id
<
MAX_NUM_CCs
;
CC_id
++
)
{
PHY_vars_UE_g
[
0
][
CC_id
]
->
rf_map
.
card
=
0
;
PHY_vars_UE_g
[
0
][
CC_id
]
->
rf_map
.
card
=
0
;
PHY_vars_UE_g
[
0
][
CC_id
]
->
rf_map
.
chain
=
CC_id
+
chain_offset
;
PHY_vars_UE_g
[
0
][
CC_id
]
->
rf_map
.
chain
=
CC_id
+
chain_offset
;
PHY_vars_UE_g
[
0
][
CC_id
]
->
timing_advance
=
timing_advance
;
PHY_vars_UE_g
[
0
][
CC_id
]
->
timing_advance
=
UE
[
CC_id
]
->
timing_advance
;
}
}
init_NR_UE_threads
(
1
);
init_NR_UE_threads
(
1
);
...
...
executables/nr-uesoftmodem.h
View file @
58309dd7
This diff is collapsed.
Click to expand it.
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
View file @
58309dd7
...
@@ -65,11 +65,12 @@ void init_dlsch_tpool(uint8_t nun_dlsch_threads)
...
@@ -65,11 +65,12 @@ void init_dlsch_tpool(uint8_t nun_dlsch_threads)
if
(
nun_dlsch_threads
==
0
)
if
(
nun_dlsch_threads
==
0
)
return
;
return
;
char
*
params
=
malloc
(
nun_dlsch_threads
*
3
*
sizeof
(
char
)
);
char
*
params
=
calloc
(
1
,(
nun_dlsch_threads
*
2
)
+
1
);
for
(
int
i
=
0
;
i
<
nun_dlsch_threads
;
i
++
)
{
for
(
int
i
=
0
;
i
<
nun_dlsch_threads
;
i
++
)
{
memcpy
(
params
+
(
i
*
3
),
"-1
\0
"
,
3
);
memcpy
(
params
+
(
i
*
2
),
"-1"
,
2
);
}
}
initTpool
(
params
,
&
pool_dl
,
false
);
initTpool
(
params
,
&
pool_dl
,
false
);
free
(
params
);
}
}
...
@@ -1434,7 +1435,7 @@ void nr_dlsch_decoding_process(void *arg)
...
@@ -1434,7 +1435,7 @@ void nr_dlsch_decoding_process(void *arg)
Kr
=
harq_process
->
K
;
Kr
=
harq_process
->
K
;
Kr_bytes
=
Kr
>>
3
;
Kr_bytes
=
Kr
>>
3
;
K_b
it
s_F
=
Kr
-
harq_process
->
F
;
K_b
yte
s_F
=
Kr
-
harq_process
->
F
;
E
=
nr_get_E
(
G
,
harq_process
->
C
,
harq_process
->
Qm
,
harq_process
->
Nl
,
r
);
E
=
nr_get_E
(
G
,
harq_process
->
C
,
harq_process
->
Qm
,
harq_process
->
Nl
,
r
);
...
@@ -1546,9 +1547,9 @@ void nr_dlsch_decoding_process(void *arg)
...
@@ -1546,9 +1547,9 @@ void nr_dlsch_decoding_process(void *arg)
//set first 2*Z_c bits to zeros
//set first 2*Z_c bits to zeros
memset
(
&
z
[
0
],
0
,
2
*
harq_process
->
Z
*
sizeof
(
int16_t
));
memset
(
&
z
[
0
],
0
,
2
*
harq_process
->
Z
*
sizeof
(
int16_t
));
//set Filler bits
//set Filler bits
memset
((
&
z
[
0
]
+
K_b
it
s_F
),
127
,
harq_process
->
F
*
sizeof
(
int16_t
));
memset
((
&
z
[
0
]
+
K_b
yte
s_F
),
127
,
harq_process
->
F
*
sizeof
(
int16_t
));
//Move coded bits before filler bits
//Move coded bits before filler bits
memcpy
((
&
z
[
0
]
+
2
*
harq_process
->
Z
),
harq_process
->
d
[
r
],(
K_b
it
s_F
-
2
*
harq_process
->
Z
)
*
sizeof
(
int16_t
));
memcpy
((
&
z
[
0
]
+
2
*
harq_process
->
Z
),
harq_process
->
d
[
r
],(
K_b
yte
s_F
-
2
*
harq_process
->
Z
)
*
sizeof
(
int16_t
));
//skip filler bits
//skip filler bits
memcpy
((
&
z
[
0
]
+
Kr
),
harq_process
->
d
[
r
]
+
(
Kr
-
2
*
harq_process
->
Z
),(
kc
*
harq_process
->
Z
-
Kr
)
*
sizeof
(
int16_t
));
memcpy
((
&
z
[
0
]
+
Kr
),
harq_process
->
d
[
r
]
+
(
Kr
-
2
*
harq_process
->
Z
),(
kc
*
harq_process
->
Z
-
Kr
)
*
sizeof
(
int16_t
));
//Saturate coded bits before decoding into 8 bits values
//Saturate coded bits before decoding into 8 bits values
...
@@ -1609,7 +1610,7 @@ void *dlsch_thread(void *arg) {
...
@@ -1609,7 +1610,7 @@ void *dlsch_thread(void *arg) {
notifiedFIFO_elt_t
*
res_dl
;
notifiedFIFO_elt_t
*
res_dl
;
initNotifiedFIFO_nothreadSafe
(
&
freeBlocks_dl
);
initNotifiedFIFO_nothreadSafe
(
&
freeBlocks_dl
);
for
(
int
i
=
0
;
i
<
RX_NB_TH_DL
+
1
;
i
++
){
for
(
int
i
=
0
;
i
<
tpool_nbthreads
(
pool_dl
)
+
1
;
i
++
){
pushNotifiedFIFO_nothreadSafe
(
&
freeBlocks_dl
,
pushNotifiedFIFO_nothreadSafe
(
&
freeBlocks_dl
,
newNotifiedFIFO_elt
(
sizeof
(
nr_rxtx_thread_data_t
),
0
,
&
nf
,
nr_dlsch_decoding_process
));}
newNotifiedFIFO_elt
(
sizeof
(
nr_rxtx_thread_data_t
),
0
,
&
nf
,
nr_dlsch_decoding_process
));}
...
@@ -1617,7 +1618,7 @@ void *dlsch_thread(void *arg) {
...
@@ -1617,7 +1618,7 @@ void *dlsch_thread(void *arg) {
notifiedFIFO_elt_t
*
res
;
notifiedFIFO_elt_t
*
res
;
while
(
nbDlProcessing
>=
RX_NB_TH_DL
)
{
while
(
nbDlProcessing
>=
tpool_nbthreads
(
pool_dl
)
)
{
if
(
(
res
=
tryPullTpool
(
&
nf
,
&
pool_dl
))
!=
NULL
)
{
if
(
(
res
=
tryPullTpool
(
&
nf
,
&
pool_dl
))
!=
NULL
)
{
//nbDlProcessing--;
//nbDlProcessing--;
pushNotifiedFIFO_nothreadSafe
(
&
freeBlocks_dl
,
res
);
pushNotifiedFIFO_nothreadSafe
(
&
freeBlocks_dl
,
res
);
...
...
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