Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
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
Michael Black
OpenXG UE
Commits
cc95e226
Commit
cc95e226
authored
Feb 13, 2020
by
frtabu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A fix proposal for phy simulators compilation Pb.
parent
717720d8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
63 deletions
+66
-63
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+5
-1
executables/softmodem-common.c
executables/softmodem-common.c
+61
-60
openair1/SIMULATION/NR_PHY/dlsim.c
openair1/SIMULATION/NR_PHY/dlsim.c
+0
-1
openair1/SIMULATION/NR_PHY/ulsim.c
openair1/SIMULATION/NR_PHY/ulsim.c
+0
-1
No files found.
cmake_targets/CMakeLists.txt
View file @
cc95e226
...
...
@@ -2771,6 +2771,7 @@ add_executable(nr_dlsim
${
OPENAIR1_DIR
}
/SIMULATION/NR_PHY/dlsim.c
${
OPENAIR_DIR
}
/common/utils/system.c
${
OPENAIR_DIR
}
/common/utils/nr/nr_common.c
${
OPENAIR_DIR
}
/executables/softmodem-common.c
${
UTIL_SRC
}
${
T_SOURCE
}
${
SHLIB_LOADER_SOURCES
}
...
...
@@ -2779,6 +2780,7 @@ target_link_libraries(nr_dlsim
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_NR -Wl,--end-group
m pthread
${
ATLAS_LIBRARIES
}
${
T_LIB
}
${
ITTI_LIB
}
dl
)
target_compile_definitions
(
nr_dlsim PUBLIC -DPHYSICAL_SIMULATOR
)
add_executable
(
nr_prachsim
${
OPENAIR1_DIR
}
/SIMULATION/NR_PHY/prachsim.c
...
...
@@ -2807,6 +2809,7 @@ add_executable(nr_ulsim
${
OPENAIR1_DIR
}
/SIMULATION/NR_PHY/ulsim.c
${
OPENAIR_DIR
}
/common/utils/system.c
${
OPENAIR_DIR
}
/common/utils/nr/nr_common.c
${
OPENAIR_DIR
}
/executables/softmodem-common.c
${
UTIL_SRC
}
${
T_SOURCE
}
${
SHLIB_LOADER_SOURCES
}
...
...
@@ -2815,7 +2818,7 @@ target_link_libraries(nr_ulsim
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR PHY_NR_COMMON PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_NR -Wl,--end-group
m pthread
${
ATLAS_LIBRARIES
}
${
T_LIB
}
${
ITTI_LIB
}
dl
)
target_compile_definitions
(
nr_ulsim PUBLIC -DPHYSICAL_SIMULATOR
)
foreach
(
myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim syncsim
)
...
...
@@ -2833,6 +2836,7 @@ foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim pr
-Wl,--start-group SIMU UTIL SCHED_LIB SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_NR_COMMON PHY PHY_UE PHY_RU LFDS
${
ITTI_LIB
}
LFDS7 -Wl,--end-group
pthread m rt
${
CONFIG_LIB
}
${
ATLAS_LIBRARIES
}
${
XFORMS_LIBRARIES
}
${
T_LIB
}
dl
)
endforeach
(
myExe
)
add_executable
(
test_epc_generate_scenario
...
...
executables/softmodem-common.c
View file @
cc95e226
...
...
@@ -60,6 +60,66 @@ softmodem_params_t *get_softmodem_params(void) {
return
&
softmodem_params
;
}
void
softmodem_printresources
(
int
sig
,
telnet_printfunc_t
pf
)
{
struct
rusage
usage
;
struct
timespec
stop
;
clock_gettime
(
CLOCK_BOOTTIME
,
&
stop
);
uint64_t
elapse
=
(
stop
.
tv_sec
-
start
.
tv_sec
)
;
// in seconds
int
st
=
getrusage
(
RUSAGE_SELF
,
&
usage
);
if
(
!
st
)
{
pf
(
"
\n
Run time: %lluh %llus
\n
"
,(
unsigned
long
long
)
elapse
/
3600
,(
unsigned
long
long
)(
elapse
-
(
elapse
/
3600
)));
pf
(
"
\t
Time executing user inst.: %lds %ldus
\n
"
,(
long
)
usage
.
ru_utime
.
tv_sec
,(
long
)
usage
.
ru_utime
.
tv_usec
);
pf
(
"
\t
Time executing system inst.: %lds %ldus
\n
"
,(
long
)
usage
.
ru_stime
.
tv_sec
,(
long
)
usage
.
ru_stime
.
tv_usec
);
pf
(
"
\t
Max. Phy. memory usage: %ldkB
\n
"
,(
long
)
usage
.
ru_maxrss
);
pf
(
"
\t
Page fault number (no io): %ld
\n
"
,(
long
)
usage
.
ru_minflt
);
pf
(
"
\t
Page fault number (requiring io): %ld
\n
"
,(
long
)
usage
.
ru_majflt
);
pf
(
"
\t
Number of file system read: %ld
\n
"
,(
long
)
usage
.
ru_inblock
);
pf
(
"
\t
Number of filesystem write: %ld
\n
"
,(
long
)
usage
.
ru_oublock
);
pf
(
"
\t
Number of context switch (process origin, io...): %ld
\n
"
,(
long
)
usage
.
ru_nvcsw
);
pf
(
"
\t
Number of context switch (os origin, priority...): %ld
\n
"
,(
long
)
usage
.
ru_nivcsw
);
}
}
void
signal_handler
(
int
sig
)
{
void
*
array
[
10
];
size_t
size
;
if
(
sig
==
SIGSEGV
)
{
// get void*'s for all entries on the stack
size
=
backtrace
(
array
,
10
);
// print out all the frames to stderr
fprintf
(
stderr
,
"Error: signal %d:
\n
"
,
sig
);
backtrace_symbols_fd
(
array
,
size
,
2
);
exit
(
-
1
);
}
else
{
if
(
sig
==
SIGINT
||
sig
==
SOFTMODEM_RTSIGNAL
)
softmodem_printresources
(
sig
,(
telnet_printfunc_t
)
printf
);
if
(
sig
!=
SOFTMODEM_RTSIGNAL
)
{
printf
(
"Linux signal %s...
\n
"
,
strsignal
(
sig
));
exit_function
(
__FILE__
,
__FUNCTION__
,
__LINE__
,
"softmodem starting exit procedure
\n
"
);
}
}
}
void
set_softmodem_sighandler
(
void
)
{
struct
sigaction
act
,
oldact
;
clock_gettime
(
CLOCK_BOOTTIME
,
&
start
);
memset
(
&
act
,
0
,
sizeof
(
act
));
act
.
sa_handler
=
signal_handler
;
sigaction
(
SOFTMODEM_RTSIGNAL
,
&
act
,
&
oldact
);
printf
(
"Send signal %d to display resource usage...
\n
"
,
SIGRTMIN
+
1
);
signal
(
SIGSEGV
,
signal_handler
);
signal
(
SIGINT
,
signal_handler
);
signal
(
SIGTERM
,
signal_handler
);
signal
(
SIGABRT
,
signal_handler
);
}
#ifndef PHYSICAL_SIMULATOR
void
get_common_options
(
void
)
{
uint32_t
online_log_messages
;
uint32_t
glog_level
;
...
...
@@ -123,63 +183,4 @@ void get_common_options(void) {
if
(
worker_config
!=
NULL
)
set_worker_conf
(
worker_config
);
}
void
softmodem_printresources
(
int
sig
,
telnet_printfunc_t
pf
)
{
struct
rusage
usage
;
struct
timespec
stop
;
clock_gettime
(
CLOCK_BOOTTIME
,
&
stop
);
uint64_t
elapse
=
(
stop
.
tv_sec
-
start
.
tv_sec
)
;
// in seconds
int
st
=
getrusage
(
RUSAGE_SELF
,
&
usage
);
if
(
!
st
)
{
pf
(
"
\n
Run time: %lluh %llus
\n
"
,(
unsigned
long
long
)
elapse
/
3600
,(
unsigned
long
long
)(
elapse
-
(
elapse
/
3600
)));
pf
(
"
\t
Time executing user inst.: %lds %ldus
\n
"
,(
long
)
usage
.
ru_utime
.
tv_sec
,(
long
)
usage
.
ru_utime
.
tv_usec
);
pf
(
"
\t
Time executing system inst.: %lds %ldus
\n
"
,(
long
)
usage
.
ru_stime
.
tv_sec
,(
long
)
usage
.
ru_stime
.
tv_usec
);
pf
(
"
\t
Max. Phy. memory usage: %ldkB
\n
"
,(
long
)
usage
.
ru_maxrss
);
pf
(
"
\t
Page fault number (no io): %ld
\n
"
,(
long
)
usage
.
ru_minflt
);
pf
(
"
\t
Page fault number (requiring io): %ld
\n
"
,(
long
)
usage
.
ru_majflt
);
pf
(
"
\t
Number of file system read: %ld
\n
"
,(
long
)
usage
.
ru_inblock
);
pf
(
"
\t
Number of filesystem write: %ld
\n
"
,(
long
)
usage
.
ru_oublock
);
pf
(
"
\t
Number of context switch (process origin, io...): %ld
\n
"
,(
long
)
usage
.
ru_nvcsw
);
pf
(
"
\t
Number of context switch (os origin, priority...): %ld
\n
"
,(
long
)
usage
.
ru_nivcsw
);
}
}
void
signal_handler
(
int
sig
)
{
void
*
array
[
10
];
size_t
size
;
if
(
sig
==
SIGSEGV
)
{
// get void*'s for all entries on the stack
size
=
backtrace
(
array
,
10
);
// print out all the frames to stderr
fprintf
(
stderr
,
"Error: signal %d:
\n
"
,
sig
);
backtrace_symbols_fd
(
array
,
size
,
2
);
exit
(
-
1
);
}
else
{
if
(
sig
==
SIGINT
||
sig
==
SOFTMODEM_RTSIGNAL
)
softmodem_printresources
(
sig
,(
telnet_printfunc_t
)
printf
);
if
(
sig
!=
SOFTMODEM_RTSIGNAL
)
{
printf
(
"Linux signal %s...
\n
"
,
strsignal
(
sig
));
exit_function
(
__FILE__
,
__FUNCTION__
,
__LINE__
,
"softmodem starting exit procedure
\n
"
);
}
}
}
void
set_softmodem_sighandler
(
void
)
{
struct
sigaction
act
,
oldact
;
clock_gettime
(
CLOCK_BOOTTIME
,
&
start
);
memset
(
&
act
,
0
,
sizeof
(
act
));
act
.
sa_handler
=
signal_handler
;
sigaction
(
SOFTMODEM_RTSIGNAL
,
&
act
,
&
oldact
);
printf
(
"Send signal %d to display resource usage...
\n
"
,
SIGRTMIN
+
1
);
signal
(
SIGSEGV
,
signal_handler
);
signal
(
SIGINT
,
signal_handler
);
signal
(
SIGTERM
,
signal_handler
);
signal
(
SIGABRT
,
signal_handler
);
}
#endif
\ No newline at end of file
openair1/SIMULATION/NR_PHY/dlsim.c
View file @
cc95e226
...
...
@@ -109,7 +109,6 @@ void config_common(int Mod_idP,
NR_ServingCellConfigCommon_t
*
scc
);
uint64_t
get_softmodem_optmask
(
void
)
{
return
0
;}
mac_rlc_status_resp_t
mac_rlc_status_ind
(
const
module_id_t
module_idP
,
const
rnti_t
rntiP
,
const
eNB_index_t
eNB_index
,
...
...
openair1/SIMULATION/NR_PHY/ulsim.c
View file @
cc95e226
...
...
@@ -113,7 +113,6 @@ int generate_dlsch_header(unsigned char *mac_header,
unsigned
char
*
ue_cont_res_id
,
unsigned
char
short_padding
,
unsigned
short
post_padding
){
return
0
;}
uint64_t
get_softmodem_optmask
(
void
)
{
return
0
;}
int
rlc_module_init
(
int
enb
)
{
return
(
0
);}
void
pdcp_layer_init
(
void
)
{}
void
pdcp_run
(
const
protocol_ctxt_t
*
const
ctxt_pP
)
{
return
;}
...
...
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