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
2d46638a
Commit
2d46638a
authored
Nov 04, 2022
by
laurent
Committed by
Roberto Louro Magueta
Nov 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix cpu cost in phy simulation with sanitize addr, some code un-obfuscation
parent
d9660677
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
66 deletions
+36
-66
cmake_targets/autotests/run_exec_autotests.bash
cmake_targets/autotests/run_exec_autotests.bash
+20
-42
openair1/SIMULATION/TOOLS/multipath_channel.c
openair1/SIMULATION/TOOLS/multipath_channel.c
+14
-22
openair1/SIMULATION/TOOLS/rangen_double.c
openair1/SIMULATION/TOOLS/rangen_double.c
+2
-2
No files found.
cmake_targets/autotests/run_exec_autotests.bash
View file @
2d46638a
#!/bin/bash
#set -xv
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
...
...
@@ -92,78 +93,55 @@ function test_run() {
tags_array_index
=
0
for
main_exec_args_array_index
in
"
${
main_exec_args_array
[@]
}
"
do
global_result
=
1
global_result
=
PASS
result_string
=
""
PROPER_DESC
=
`
echo
${
desc_array
[
$tags_array_index
]
}
|
sed
-e
"s@^.*Test cases.*(Test@Test@"
-e
"s@^ *(@@"
-e
"s/)
$/
/"
-e
"s/),
$/
/"
`
echo_info
"
$PROPER_DESC
"
for
((
run_index
=
1
;
run_index <
=
$nruns
;
run_index++
))
do
temp_exec_log
=
$log_dir
/test.
$test_case_name
.
${
tags_array
[
$tags_array_index
]
}
.run_
$run_index
echo
""
>
$temp_exec_log
temp_exec_log
=
"
$log_dir
/test.
$test_case_name
.
${
tags_array
[
$tags_array_index
]
}
.run_
$run_index
"
echo
"Executing test case
$test_case_name
.
${
tags_array
[
$tags_array_index
]
}
, Run Index =
$run_index
, Execution Log file =
$temp_exec_log
"
echo
"-----------------------------------------------------------------------------"
>>
$temp_exec_log
2>&1
echo
"<EXECUTION LOG Test Case =
$test_case_name
.
${
tags_array
[
$tags_array_index
]
}
, Run =
$run_index
>"
>>
$temp_exec_log
2>&1
echo
"Executing
$main_exec
$main_exec_args_array_index
"
|
tee
$temp_exec_log
{
uname
-a
;
eval
"
$main_exec
$main_exec_args_array_index
"
;
}
>>
$temp_exec_log
2>&1
echo
"-----------------------------------------------------------------------------"
>
"
$temp_exec_log
"
echo
"<EXECUTION LOG Test Case =
$test_case_name
.
${
tags_array
[
$tags_array_index
]
}
, Run =
$run_index
>"
>>
"
$temp_exec_log
"
echo
"Executing
$main_exec
$main_exec_args_array_index
"
>>
"
$temp_exec_log
"
uname
-a
>>
"
$temp_exec_log
"
"
$main_exec
"
$main_exec_args_array_index
>>
"
$temp_exec_log
"
2>&1
echo
"</EXECUTION LOG Test Case =
$test_case_name
.
${
tags_array
[
$tags_array_index
]
}
, Run =
$run_index
>"
>>
$temp_exec_log
2>&1
cat
$temp_exec_log
>>
$log_file
2>&1
result
=
1
result
=
PASS
for
search_expr
in
"
${
search_expr_array
[@]
}
"
do
search_result
=
`
grep
-E
"
$search_expr
"
$temp_exec_log
`
if
[
-z
"
$search_result
"
]
;
then
let
"result = result & 0"
else
let
"result = result & 1"
fi
grep
-Eq
"
$search_expr
"
$temp_exec_log
||
result
=
FAIL
done
#If we find a negative search result then there is crash of program and test case is failed even if above condition is true
search_result
=
`
grep
-iE
"
$search_expr_negative
"
$temp_exec_log
`
if
[
-n
"
$search_result
"
]
;
then
result
=
0
fi
let
"global_result = global_result & result"
#echo "result = $result"
if
[
"
$result
"
-eq
"0"
]
;
then
result_string
=
$result_string
" Run_
$run_index
=FAIL"
grep
-q
-iE
"
$search_expr_negative
"
$temp_exec_log
&&
result
=
FAIL
if
[
"
$result
"
!=
PASS
]
;
then
echo_error
"
$test_case_name
.
${
tags_array
[
$tags_array_index
]
}
RUN =
$run_index
Result = FAIL"
fi
if
[
"
$result
"
-eq
"1"
]
;
then
result_string
=
$result_string
" Run_
$run_index
=PASS"
else
echo_success
"
$test_case_name
.
${
tags_array
[
$tags_array_index
]
}
RUN =
$run_index
Result = PASS"
fi
result_string
=
$result_string
" Run_
$run_index
=
$result
"
if
[
$result
!=
PASS
]
;
then
global_result
=
FAIL
fi
done
#End of for loop (nindex)
echo
" Result String =
$result_string
"
if
[
"
$result_string
"
==
""
]
;
then
echo_error
"execution
$test_case_name
.
${
tags_array
[
$tags_array_index
]
}
{
$PROPER_DESC
} Run_Result =
\"
$result_string
\"
Result = FAIL"
xUnit_fail
"execution"
"
$test_case_name
.
${
tags_array
[
$tags_array_index
]
}
"
"FAIL"
"
$result_string
"
"
$xmlfile_testcase
"
"
$PROPER_DESC
"
else
if
[
"
$global_result
"
==
"0"
]
;
then
if
[
"
$global_result
"
!=
PASS
]
;
then
echo_error
"execution
$test_case_name
.
${
tags_array
[
$tags_array_index
]
}
{
$PROPER_DESC
} Run_Result =
\"
$result_string
\"
Result = FAIL"
xUnit_fail
"execution"
"
$test_case_name
.
${
tags_array
[
$tags_array_index
]
}
"
"FAIL"
"
$result_string
"
"
$xmlfile_testcase
"
"
$PROPER_DESC
"
fi
if
[
"
$global_result
"
==
"1"
]
;
then
else
echo_success
"execution
$test_case_name
.
${
tags_array
[
$tags_array_index
]
}
{
$PROPER_DESC
} Run_Result =
\"
$result_string
\"
Result = PASS "
xUnit_success
"execution"
"
$test_case_name
.
${
tags_array
[
$tags_array_index
]
}
"
"PASS"
"
$result_string
"
"
$xmlfile_testcase
"
"
$PROPER_DESC
"
fi
fi
let
"tags_array_index++"
done
...
...
openair1/SIMULATION/TOOLS/multipath_channel.c
View file @
2d46638a
...
...
@@ -38,7 +38,7 @@ uint8_t multipath_channel_nosigconv(channel_desc_t *desc)
//#define CHANNEL_SSE
#ifdef CHANNEL_SSE
void
multipath_channel
(
channel_desc_t
*
desc
,
void
__attribute__
((
no_sanitize_address
))
multipath_channel
(
channel_desc_t
*
desc
,
double
tx_sig_re
[
NB_ANTENNAS_TX
][
30720
*
2
],
double
tx_sig_im
[
NB_ANTENANS_TX
][
30720
*
2
],
double
rx_sig_re
[
NB_ANTENNAS_RX
][
30720
*
2
],
...
...
@@ -170,7 +170,7 @@ void add_noise(c16_t **rxdata,
}
}
void
multipath_channel
(
channel_desc_t
*
desc
,
void
__attribute__
((
no_sanitize_address
))
multipath_channel
(
channel_desc_t
*
desc
,
double
*
tx_sig_re
[
NB_ANTENNAS_TX
],
double
*
tx_sig_im
[
NB_ANTENNAS_TX
],
double
*
rx_sig_re
[
NB_ANTENNAS_RX
],
...
...
@@ -180,9 +180,6 @@ void multipath_channel(channel_desc_t *desc,
int
log_channel
)
{
int
i
,
ii
,
j
,
l
;
struct
complexd
rx_tmp
,
tx
;
double
path_loss
=
pow
(
10
,
desc
->
path_loss_dB
/
20
);
int
dd
;
dd
=
abs
(
desc
->
channel_offset
);
...
...
@@ -204,29 +201,24 @@ void multipath_channel(channel_desc_t *desc,
}
#endif
for
(
i
=
0
;
i
<
((
int
)
length
-
dd
);
i
++
)
{
for
(
ii
=
0
;
ii
<
desc
->
nb_rx
;
ii
++
)
{
rx_tmp
.
r
=
0
;
rx_tmp
.
i
=
0
;
for
(
j
=
0
;
j
<
desc
->
nb_tx
;
j
++
)
{
for
(
l
=
0
;
l
<
(
int
)
desc
->
channel_length
;
l
++
)
{
for
(
int
i
=
0
;
i
<
((
int
)
length
-
dd
);
i
++
)
{
for
(
int
ii
=
0
;
ii
<
desc
->
nb_rx
;
ii
++
)
{
struct
complexd
rx_tmp
=
{
0
};
for
(
int
j
=
0
;
j
<
desc
->
nb_tx
;
j
++
)
{
struct
complexd
*
chan
=
desc
->
ch
[
ii
+
(
j
*
desc
->
nb_rx
)];
for
(
int
l
=
0
;
l
<
(
int
)
desc
->
channel_length
;
l
++
)
{
if
((
i
>=
0
)
&&
(
i
-
l
)
>=
0
)
{
struct
complexd
tx
;
tx
.
r
=
tx_sig_re
[
j
][
i
-
l
];
tx
.
i
=
tx_sig_im
[
j
][
i
-
l
];
}
else
{
tx
.
r
=
0
;
tx
.
i
=
0
;
rx_tmp
.
r
+=
(
tx
.
r
*
chan
[
l
].
r
)
-
(
tx
.
i
*
chan
[
l
].
i
);
rx_tmp
.
i
+=
(
tx
.
i
*
chan
[
l
].
r
)
+
(
tx
.
r
*
chan
[
l
].
i
);
}
rx_tmp
.
r
+=
(
tx
.
r
*
desc
->
ch
[
ii
+
(
j
*
desc
->
nb_rx
)][
l
].
r
)
-
(
tx
.
i
*
desc
->
ch
[
ii
+
(
j
*
desc
->
nb_rx
)][
l
].
i
);
rx_tmp
.
i
+=
(
tx
.
i
*
desc
->
ch
[
ii
+
(
j
*
desc
->
nb_rx
)][
l
].
r
)
+
(
tx
.
r
*
desc
->
ch
[
ii
+
(
j
*
desc
->
nb_rx
)][
l
].
i
);
if
(
i
==
0
&&
log_channel
==
1
)
{
printf
(
"channel[%d][%d][%d] = %f dB
\t
(%e, %e)
\n
"
,
ii
,
j
,
l
,
10
*
log10
(
pow
(
desc
->
ch
[
ii
+
(
j
*
desc
->
nb_rx
)][
l
].
r
,
2
.
0
)
+
pow
(
desc
->
ch
[
ii
+
(
j
*
desc
->
nb_rx
)]
[
l
].
i
,
2
.
0
)),
desc
->
ch
[
ii
+
(
j
*
desc
->
nb_rx
)]
[
l
].
r
,
desc
->
ch
[
ii
+
(
j
*
desc
->
nb_rx
)]
[
l
].
i
);
ii
,
j
,
l
,
10
*
log10
(
pow
(
chan
[
l
].
r
,
2
.
0
)
+
pow
(
chan
[
l
].
i
,
2
.
0
)),
chan
[
l
].
r
,
chan
[
l
].
i
);
}
}
//l
}
// j
...
...
openair1/SIMULATION/TOOLS/rangen_double.c
View file @
2d46638a
...
...
@@ -86,7 +86,7 @@ double uniformrandom(void)
/*!\brief Gaussian random number generator based on modified Box-Muller transformation.Returns a double-precision floating-point number. */
double
gaussdouble
(
double
mean
,
double
variance
)
double
__attribute__
((
no_sanitize_address
))
gaussdouble
(
double
mean
,
double
variance
)
{
static
int
iset
=
0
;
static
double
gset
;
...
...
@@ -175,7 +175,7 @@ void tableNor(unsigned long seed)
return
;
}
double
gaussZiggurat
(
double
mean
,
double
variance
)
double
__attribute__
((
no_sanitize_address
))
gaussZiggurat
(
double
mean
,
double
variance
)
{
hz
=
SHR3
;
iz
=
hz
&
127
;
...
...
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