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
af7a8954
Commit
af7a8954
authored
Sep 11, 2023
by
Ejaz Ahmed
Committed by
Melissa
Sep 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added SNR in the launch scripts and implemented in 5G SL rfsim
parent
83ee05c0
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
107 additions
and
26 deletions
+107
-26
CMakeLists.txt
CMakeLists.txt
+1
-0
ci-scripts/run_sl_batch.sh
ci-scripts/run_sl_batch.sh
+55
-14
ci-scripts/run_sl_test.py
ci-scripts/run_sl_test.py
+18
-4
ci-scripts/sl_cmds.txt
ci-scripts/sl_cmds.txt
+2
-2
executables/nr-softmodem-common.h
executables/nr-softmodem-common.h
+1
-0
executables/nr-uesoftmodem.h
executables/nr-uesoftmodem.h
+1
-0
openair1/PHY/NR_UE_TRANSPORT/nr_slsch_ue.c
openair1/PHY/NR_UE_TRANSPORT/nr_slsch_ue.c
+14
-5
openair1/PHY/defs_nr_UE.h
openair1/PHY/defs_nr_UE.h
+1
-0
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
+14
-1
No files found.
CMakeLists.txt
View file @
af7a8954
...
...
@@ -2831,6 +2831,7 @@ add_executable(nr-uesoftmodem
${
OPENAIR_DIR
}
/executables/nr-ue.c
${
OPENAIR_DIR
}
/executables/softmodem-common.c
${
OPENAIR1_DIR
}
/SIMULATION/TOOLS/taus.c
${
OPENAIR1_DIR
}
/SIMULATION/TOOLS/rangen_double.c
${
OPENAIR_DIR
}
/sdr/COMMON/common_lib.c
${
OPENAIR_DIR
}
/sdr/COMMON/record_player.c
${
OPENAIR2_DIR
}
/RRC/NAS/nas_config.c
...
...
ci-scripts/run_sl_batch.sh
View file @
af7a8954
...
...
@@ -6,20 +6,61 @@ user_id=$USER
message_to_send
=
EpiScience
num_repeat
=
1
atten_list
=(
0
)
#(0 5 10 15 20 25 30 35 39 40)
mcs_list
=(
9
)
repeat
=
1
# change test type accordingly
test_type
=
'rfsim'
test_type_cmd
=
"--test "
$test_type
TEST_FOLDER
=
$HOME
/test_usrp
if
[
$test_type
!=
'rfsim'
]
;
then
atten_list
=(
0 5 10 15 20 25 30 35 39 40
)
test_params
=(
"
${
atten_list
[@]
}
"
)
param_name
=
'att'
else
param_name
=
'snr'
fi
start_mcs
=
0
end_mcs
=
9
step_mcs
=
1
mcs_list
=()
for
i
in
$(
seq
$start_mcs
$step_mcs
$end_mcs
)
;
do
mcs_list+
=(
$i
)
done
step_snr
=
0.2
start_snr
=
-10
TEST_FOLDER
=
$HOME
/test_
$test_type
[
-d
$TEST_FOLDER
]
||
mkdir
$TEST_FOLDER
for
i
in
${
!atten_list[@]
}
;
do
for
j
in
${
!mcs_list[@]
}
;
do
python3 run_sl_test.py
--repeat
$repeat
\
for
j
in
${
!mcs_list[@]
}
;
do
if
[
$test_type
=
'rfsim'
]
;
then
snr_list
=()
if
[
${
mcs_list
[
$j
]
}
-ge
0
]
&&
[
${
mcs_list
[
$j
]
}
-le
5
]
;
then
end_snr
=
6
elif
[
${
mcs_list
[
$j
]
}
-ge
6
]
&&
[
${
mcs_list
[
$j
]
}
-le
8
]
;
then
end_snr
=
10
else
start_snr
=
-6
end_snr
=
14
fi
for
k
in
$(
seq
$start_snr
$step_snr
$end_snr
)
;
do
snr_list+
=(
$k
)
done
test_params
=(
"
${
snr_list
[@]
}
"
)
fi
for
k
in
${
!test_params[@]
}
;
do
if
[
$test_type
=
'rfsim'
]
;
then
param_cmd
=
'--snr '
${
test_params
[
$k
]
}
else
param_cmd
=
'--att '
${
test_params
[
$k
]
}
fi
python3 run_sl_test.py
--repeat
$num_repeat
\
-u
$user_id
--host
$remote_host_ip
\
--att
${
atten_list
[
$i
]
}
\
--mcs
${
mcs_list
[
$j
]
}
\
--save
$TEST_FOLDER
/att_
${
atten_list
[
$i
]
}
_mcs_
${
mcs_list
[
$j
]
}
.txt
\
# -m $message_to_send
$param_cmd
\
--save
$TEST_FOLDER
/mcs_
${
mcs_list
[
$j
]
}
_
${
param_name
}
_
${
test_params
[
$k
]
}
.txt
\
$test_type_cmd
\
--duration
20
done
done
\ No newline at end of file
ci-scripts/run_sl_test.py
View file @
af7a8954
...
...
@@ -128,6 +128,10 @@ parser.add_argument('--test', '-t', default='usrp_n310', choices='psbchsim pssch
The kind of test scenario to run. The options include psbchsim, psschsim, rfsim, or usrp_b210 usrp_n310. (default: %(default)s)
"""
)
parser
.
add_argument
(
'--snr'
,
default
=
'0.0'
,
help
=
"""
Setting snr values (default: %(default)s)
"""
)
OPTS
=
parser
.
parse_args
()
del
parser
...
...
@@ -263,6 +267,8 @@ class TestThread(threading.Thread):
if
OPTS
.
basic
:
cmd
=
redirect_output
(
'uname -a'
,
self
.
log_file
)
else
:
cmd
=
self
.
commands
.
launch_cmds
[
job
]
cmd
=
cmd
[:
-
1
]
+
f' --message
{
OPTS
.
message
}
'
+
f' --mcs
{
OPTS
.
mcs
}
'
if
'rfsim'
in
OPTS
.
test
:
cmd
+=
f' --snr
{
OPTS
.
snr
}
'
proc
=
Popen
(
cmd
,
shell
=
True
)
LOGGER
.
info
(
f"syncref_proc =
{
proc
}
"
)
if
not
OPTS
.
basic
and
not
OPTS
.
no_run
:
...
...
@@ -291,12 +297,18 @@ class TestThread(threading.Thread):
if
nearby_result
:
self
.
find_nearby_result_metric
(
nearby_result
)
else
:
if
'rfsim'
in
OPTS
.
test
:
cmd
=
cmd
[:
-
1
]
+
f' --mcs
{
OPTS
.
mcs
}
'
+
f' --snr
{
OPTS
.
snr
}
'
else
:
cmd
=
cmd
[:
-
1
]
+
f' --mcs
{
OPTS
.
mcs
}
'
proc
=
Popen
(
cmd
,
shell
=
True
)
LOGGER
.
info
(
f"nearby_proc =
{
proc
}
"
)
if
not
OPTS
.
basic
and
not
OPTS
.
no_run
:
LOGGER
.
info
(
f"Process running...
{
job
}
"
)
time
.
sleep
(
OPTS
.
duration
)
self
.
kill_process
(
"nearby"
,
proc
)
if
proc
:
time
.
sleep
(
5
)
nearby_result
,
user_msg
=
self
.
log_agent
.
analyze_nearby_logs
(
OPTS
.
nid1
,
OPTS
.
nid2
,
OPTS
.
sci2
)
if
nearby_result
:
self
.
find_nearby_result_metric
([
nearby_result
])
...
...
@@ -372,6 +384,7 @@ def main() -> int:
pssch_rsrp_list
=
[]
ssb_rsrp_list
=
[]
sync_duration_list
=
[]
if
'usrp'
in
OPTS
.
test
:
set_attenuation
(
OPTS
.
att
,
OPTS
.
att_host
,
OPTS
.
att_user
)
for
i
in
range
(
OPTS
.
repeat
):
LOGGER
.
info
(
'-'
*
42
)
...
...
@@ -401,7 +414,8 @@ def main() -> int:
LOGGER
.
info
(
f"Failure detected during
{
i
+
1
}
/
{
OPTS
.
repeat
}
trial(s)."
)
num_passed
=
len
(
passed_metric
)
LOGGER
.
info
(
'#'
*
42
)
LOGGER
.
info
(
f"Attenuation value
{
OPTS
.
att
}
, MCS value
{
OPTS
.
mcs
}
"
)
atten_snr
=
{
"rfsim"
:
f'SNR value
{
OPTS
.
snr
}
'
,
"usrp_"
:
f'Attenuation value
{
OPTS
.
att
}
'
}
LOGGER
.
info
(
f"
{
atten_snr
[
OPTS
.
test
[:
5
]]
}
, MCS value
{
OPTS
.
mcs
}
"
)
if
'nearby'
in
jobs
:
LOGGER
.
info
(
f"Number of synced =
{
len
(
passed_metric
)
}
/
{
OPTS
.
repeat
}
"
)
if
len
(
num_tx_ssb
)
>
0
:
...
...
@@ -412,8 +426,8 @@ def main() -> int:
avg_bldr
=
(
float
)
(
sum_nb_decoded
)
/
sum_total_rx
if
sum_total_rx
>
0
else
1
LOGGER
.
info
(
f"Avg PSSCH RSRP =
{
sum
(
pssch_rsrp_list
)
/
len
(
passed_metric
):.
2
f
}
"
)
LOGGER
.
info
(
f"Avg SSB RSRP =
{
sum
(
ssb_rsrp_list
)
/
len
(
passed_metric
):.
2
f
}
"
)
LOGGER
.
info
(
f"Avg BLER =
{
avg_bler
:.
3
f
}
with
{
sum_total_rx
-
sum_nb_decoded
}
/
{
sum_total_rx
}
"
)
LOGGER
.
info
(
f"Avg BLDecodedRate =
{
avg_bldr
:.
3
f
}
with
{
sum_nb_decoded
}
/
{
sum_total_rx
}
"
)
LOGGER
.
info
(
f"Avg BLER =
{
avg_bler
:.
9
f
}
with
{
sum_total_rx
-
sum_nb_decoded
}
/
{
sum_total_rx
}
"
)
LOGGER
.
info
(
f"Avg BLDecodedRate =
{
avg_bldr
:.
9
f
}
with
{
sum_nb_decoded
}
/
{
sum_total_rx
}
"
)
LOGGER
.
info
(
f"Avg Sync duration (seconds) =
{
sum
(
sync_duration_list
)
/
len
(
passed_metric
):.
2
f
}
"
)
LOGGER
.
info
(
f"pssch_rsrp_list =
{
pssch_rsrp_list
}
"
)
LOGGER
.
info
(
f"ssb_rsrp_list =
{
ssb_rsrp_list
}
"
)
...
...
ci-scripts/sl_cmds.txt
View file @
af7a8954
...
...
@@ -56,7 +56,7 @@ $HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem \
nearby_rfsim_cmd = \
sudo -E RFSIMULATOR=127.0.0.1 \
$HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem \
--rfsim --sl-mode 2 --rfsimulator.serverport 4048 \
--rfsim --sl-mode 2 --r
bsl 106 --SLC 3300000000 --ue-rxgain 20 --r
fsimulator.serverport 4048 \
--log_config.global_log_options time,nocolor \
> ~/rx.log 2>&1
...
...
@@ -64,6 +64,6 @@ $HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem \
syncref_rfsim_cmd = \
sudo -E RFSIMULATOR=server \
$HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem \
--sync-ref --rfsim --sl-mode 2 --rfsimulator.serverport 4048 \
--sync-ref --rfsim --sl-mode 2 --r
bsl 106 --SLC 3300000000 --ue-txgain 0 --r
fsimulator.serverport 4048 \
--log_config.global_log_options time,nocolor \
> ~/tx.log 2>&1
executables/nr-softmodem-common.h
View file @
af7a8954
...
...
@@ -107,6 +107,7 @@
#define CONFIG_HLP_LOGV "Set the global log verbosity \n"
#define CONFIG_HLP_TELN "Start embedded telnet server \n"
#define CONFIG_HLP_SNR "Set average SNR in dB (for --siml1 option)\n"
#define CONFIG_HLP_UESNR "Set snr in UE\n"
#define CONFIG_HLP_NOS1 "Disable s1 interface\n"
#define CONFIG_HLP_NOKRNMOD "(noS1 only): Use tun instead of namesh module \n"
/*--------------------------------------------------------------------------------------------------------------------------------*/
...
...
executables/nr-uesoftmodem.h
View file @
af7a8954
...
...
@@ -68,6 +68,7 @@
{"r" , CONFIG_HLP_PRB_SA, 0, iptr:&(fp->N_RB_DL), defintval:106, TYPE_UINT, 0}, \
{"rbsl", CONFIG_HLP_PRB_SL, 0, iptr:&(fp->N_RB_SL), defintval:106, TYPE_UINT, 0}, \
{"mcs", CONFIG_HLP_PRB_IMCS, 0, uptr:&(fp->Imcs), defintval:9, TYPE_UINT, 0}, \
{"snr", CONFIG_HLP_UESNR, 0, dblptr:&(UE->snr), defdblval:0.0, TYPE_DOUBLE,0}, \
{"ssb", CONFIG_HLP_SSC, 0, u16ptr:&(fp->ssb_start_subcarrier), defintval:516, TYPE_UINT16,0}, \
{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \
{"if_freq" , CONFIG_HLP_IF_FREQ, 0, u64ptr:&(UE->if_freq), defuintval:0, TYPE_UINT64,0}, \
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_slsch_ue.c
View file @
af7a8954
...
...
@@ -320,10 +320,10 @@ void nr_ue_set_slsch(NR_DL_FRAME_PARMS *fp,
srand
(
time
(
NULL
));
for
(
int
i
=
0
;
i
<
TBS
/
8
;
i
++
)
test_input
[
i
]
=
(
unsigned
char
)
(
i
+
3
);
//rand();
test_input
[
0
]
=
(
unsigned
char
)
(
slot
);
test_input
[
1
]
=
(
unsigned
char
)
(
frame
&
0xFF
);
// 8 bits LSB
test_input
[
2
]
=
(
unsigned
char
)
((
frame
>>
8
)
&
0x3
);
//
test_input
[
3
]
=
(
unsigned
char
)
((
frame
&
0x111
)
<<
5
)
+
(
unsigned
char
)
(
slot
)
+
rand
()
%
256
;
//
test_input[0] = (unsigned char) (slot);
//
test_input[1] = (unsigned char) (frame & 0xFF); // 8 bits LSB
//
test_input[2] = (unsigned char) ((frame >> 8) & 0x3); //
//
test_input[3] = (unsigned char) ((frame & 0x111) << 5) + (unsigned char) (slot) + rand() % 256;
LOG_D
(
NR_PHY
,
"SLSCH_TX will send %u
\n
"
,
test_input
[
3
]);
}
uint64_t
u
=
pow
(
2
,
SCI2_LEN_SIZE
)
-
1
;
...
...
@@ -819,6 +819,15 @@ uint32_t nr_ue_slsch_rx_procedures(PHY_VARS_NR_UE *rxUE,
slsch_ue_rx_harq
,
rxUE
->
chest_time
);
#if 0
char buffer1[rxUE->frame_parms.ofdm_symbol_size * 4];
bzero(buffer1, sizeof(buffer1));
printf("Slot %u, RXUE Symbol[%d:%d]: rxdataF_ext %s\n",
slot, sym, sym * nb_rb * NR_NB_SC_PER_RB,
hexdump((int16_t *)&rxUE->pssch_vars[UE_id]->rxdataF_ext[0][sym * nb_rb * NR_NB_SC_PER_RB],
rxUE->frame_parms.ofdm_symbol_size * 4, buffer1, sizeof(buffer1)));
#endif
stop_meas
(
&
rxUE
->
generic_stat_bis
[
proc
->
thread_id
][
slot
]);
//----------------------------------------------------------
//--------------------- Channel Scaling --------------------
...
...
@@ -1086,7 +1095,7 @@ uint32_t nr_ue_slsch_rx_procedures(PHY_VARS_NR_UE *rxUE,
sprintf
(
filename
,
"llr_decoding.m"
);
LOG_M
(
filename
,
"llr_decoding"
,
ulsch_llr
[
0
],
5
*
(
rxUE
->
frame_parms
.
ofdm_symbol_size
),
1
,
13
);
#endif
/////////////// Decoding SLSCH and SCI
A
2 //////////////
/////////////// Decoding SLSCH and SCI2 //////////////
uint32_t
ret
=
nr_slsch_decoding
(
rxUE
,
proc
,
ulsch_llr
[
0
],
&
rxUE
->
frame_parms
,
slsch_ue_rx
,
slsch_ue_rx
->
harq_processes
[
0
],
frame
,
...
...
openair1/PHY/defs_nr_UE.h
View file @
af7a8954
...
...
@@ -1190,6 +1190,7 @@ typedef struct {
void
*
scopeData
;
uint32_t
rx_ssb_slot
;
uint32_t
rx_ssb_frame
;
double
snr
;
}
PHY_VARS_NR_UE
;
/* this structure is used to pass both UE phy vars and
...
...
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
View file @
af7a8954
...
...
@@ -54,6 +54,7 @@
#include "LAYER2/NR_MAC_UE/mac_proto.h"
#include "LAYER2/NR_MAC_UE/nr_l1_helpers.h"
#include "openair1/PHY/MODULATION/nr_modulation.h"
#include "openair1/SIMULATION/TOOLS/sim.h"
//#define DEBUG_PHY_PROC
#define NR_PDCCH_SCHED
//#define NR_PDCCH_SCHED_DEBUG
...
...
@@ -1420,7 +1421,6 @@ void *UE_thread_slot1_dl_processing(void *arg) {
return
&
UE_dl_slot1_processing_retval
;
}
#endif
int
phy_procedures_nrUE_SL_RX
(
PHY_VARS_NR_UE
*
ue
,
UE_nr_rxtx_proc_t
*
proc
,
uint8_t
synchRefUE_id
,
...
...
@@ -1433,6 +1433,19 @@ int phy_procedures_nrUE_SL_RX(PHY_VARS_NR_UE *ue,
int
frame_rx
=
proc
->
frame_rx
;
int
slot_rx
=
proc
->
nr_slot_rx
;
if
(
getenv
(
"RFSIMULATOR"
)
!=
NULL
)
{
if
(
get_softmodem_params
()
->
sl_mode
==
2
)
{
int
frame_length_complex_samples
=
ue
->
frame_parms
.
samples_per_subframe
*
NR_NUMBER_OF_SUBFRAMES_PER_FRAME
;
for
(
int
i
=
0
;
i
<
frame_length_complex_samples
;
i
++
)
{
double
sigma2_dB
=
20
*
log10
((
double
)
AMP
/
4
)
-
ue
->
snr
;
double
sigma2
=
pow
(
10
,
sigma2_dB
/
10
);
for
(
int
aa
=
0
;
aa
<
ue
->
frame_parms
.
nb_antennas_rx
;
aa
++
)
{
((
short
*
)
ue
->
common_vars
.
rxdata
[
aa
])[
2
*
i
]
+=
(
sqrt
(
sigma2
/
2
)
*
gaussdouble
(
0
.
0
,
1
.
0
));
((
short
*
)
ue
->
common_vars
.
rxdata
[
aa
])[
2
*
i
+
1
]
+=
(
sqrt
(
sigma2
/
2
)
*
gaussdouble
(
0
.
0
,
1
.
0
));
}
}
}
}
NR_UE_DLSCH_t
*
slsch
=
ue
->
slsch_rx
[
proc
->
thread_id
][
synchRefUE_id
][
0
];
NR_DL_UE_HARQ_t
*
harq
=
NULL
;
int32_t
**
rxdataF
=
ue
->
common_vars
.
common_vars_rx_data_per_thread
[
0
].
rxdataF
;
...
...
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