Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
esm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lrs
esm
Commits
0e2d8fde
Commit
0e2d8fde
authored
5 years ago
by
Torsten Merz
Browse files
Options
Downloads
Patches
Plain Diff
added generic cmake file and extended number of concurrent regions
parent
5f518479
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
smi/CMakeLists.txt
+84
-0
84 additions, 0 deletions
smi/CMakeLists.txt
smi/src/smi_def.h
+1
-1
1 addition, 1 deletion
smi/src/smi_def.h
smi/src/smiplay_nrt.c
+7
-1
7 additions, 1 deletion
smi/src/smiplay_nrt.c
with
92 additions
and
2 deletions
smi/CMakeLists.txt
0 → 100644
+
84
−
0
View file @
0e2d8fde
cmake_minimum_required
(
VERSION 2.6
)
project
(
smi C
)
if
(
"$ENV{MACHTYPE}"
STREQUAL
"x86_64"
)
SET
(
NRTCFLAGS
"-D_NRT -O2 -Wall -std=gnu90"
)
if
(
$ENV{RTAI}
)
# RTAI
SET
(
RTCFLAGS
"$(shell rtai-config --lxrt-cflags) -D_RTAI -Wall -std=gnu90"
)
SET
(
RTLIB rtsmirtai
)
SET
(
NRTLIB nrtsmirtai
)
else
()
# PREEMPT_RT
SET
(
RTCFLAGS
"-O2 -Wall -fno-stack-protector -std=gnu90"
)
SET
(
RTLIB rtsmi
)
SET
(
NRTLIB nrtsmi
)
endif
()
else
()
if
(
$ENV{GNU90}
)
SET
(
NRTCFLAGS
"-D_NRT -O2 -m32 -Wall -std=gnu90"
)
if
(
$ENV{RTAI}
)
# RTAI
SET
(
RTCFLAGS
"$(shell rtai-config --lxrt-cflags) -D_RTAI -m32 -Wall -std=gnu90"
)
SET
(
RTLIB rtsmirtai
)
SET
(
NRTLIB nrtsmirtai
)
else
()
# PREEMPT_RT
SET
(
RTCFLAGS
"-O2 -m32 -Wall -fno-stack-protector -std=gnu90"
)
SET
(
RTLIB rtsmi
)
SET
(
NRTLIB nrtsmi
)
endif
()
else
()
SET
(
NRTCFLAGS
"-D_NRT -O2 -m32 -Wall"
)
if
(
$ENV{RTAI}
)
# RTAI
SET
(
RTCFLAGS
"$(shell rtai-config --lxrt-cflags) -D_RTAI -m32 -Wall"
)
SET
(
RTLIB rtsmirtai
)
SET
(
NRTLIB nrtsmirtai
)
else
()
# PREEMPT_RT
SET
(
RTCFLAGS
"-O2 -m32 -Wall -fno-stack-protector"
)
SET
(
RTLIB rtsmi
)
SET
(
NRTLIB nrtsmi
)
endif
()
endif
()
endif
()
set
(
CMAKE_RUNTIME_OUTPUT_DIRECTORY
${
CMAKE_BINARY_DIR
}
/../bin
)
include_directories
(
src
)
set
(
RTSOURCES
src/rt_system.c
src/shm.c
src/smi.c
src/taskdisp.c
)
set
(
NRTSOURCES
src/nrt_system.c
src/shm.c
src/smi_nrt.c
src/smiplay_nrt.c
src/taskdisp_nrt.c
)
if
(
$ENV{RTAI}
)
add_library
(
rtsmirtai STATIC
${
RTSOURCES
}
)
add_library
(
nrtsmirtai STATIC
${
NRTSOURCES
}
)
SET_TARGET_PROPERTIES
(
rtsmirtai PROPERTIES COMPILE_FLAGS
"
${
RTCFLAGS
}
${
DEBUGFLAGS
}
"
)
SET_TARGET_PROPERTIES
(
nrtsmirtai PROPERTIES COMPILE_FLAGS
"
${
NRTCFLAGS
}
${
DEBUGFLAGS
}
"
)
else
()
add_library
(
rtsmi STATIC
${
RTSOURCES
}
)
add_library
(
nrtsmi STATIC
${
NRTSOURCES
}
)
SET_TARGET_PROPERTIES
(
rtsmi PROPERTIES COMPILE_FLAGS
"
${
RTCFLAGS
}
${
DEBUGFLAGS
}
"
)
SET_TARGET_PROPERTIES
(
nrtsmi PROPERTIES COMPILE_FLAGS
"
${
NRTCFLAGS
}
${
DEBUGFLAGS
}
"
)
endif
()
if
(
$ENV{RTAI}
)
add_custom_target
(
rtaicheck.sh
COMMAND ../bin/rtaicheck.sh
)
add_dependencies
(
rtsmirtai rtaicheck.sh
)
endif
()
This diff is collapsed.
Click to expand it.
smi/src/smi_def.h
+
1
−
1
View file @
0e2d8fde
...
...
@@ -10,7 +10,7 @@
#define SMI_LOG_BUF_SIZE (1*1024)
#define MAX_NUMBER_OF_CONCURRENT_STATES
8
0
#define MAX_NUMBER_OF_CONCURRENT_STATES
10
0
#define MAX_NUMBER_OF_REGIONS_PER_SUPERSTATE 32
#define MAX_NUMBER_OF_TRANSITIONS_PER_STATE 16 //8
#define MAX_NUMBER_OF_TRANSITIONS (MAX_NUMBER_OF_ESM_STATES*4)
...
...
This diff is collapsed.
Click to expand it.
smi/src/smiplay_nrt.c
+
7
−
1
View file @
0e2d8fde
...
...
@@ -10,6 +10,7 @@
#include
"smi_def.h"
int
printOnce
=
0
;
// UDP socket related
unsigned
short
usiGUIUDPPort
,
usiLocalUDPPort
;
...
...
@@ -28,8 +29,11 @@ int initUDPSocket(int *UDP_socket, struct sockaddr_in *UDPRemote_addr, unsigned
UDPRemote_addr
->
sin_port
=
htons
(
(
u_short
)
*
usiUDPRemote_port
);
if
((
he
=
gethostbyname
(
rgcHostName
))
==
0
){
if
(
printOnce
&
1
==
0
)
{
printf
(
"
\n
[initUDPSocket] Couldn't resolve
\"
%s
\"
host name
\n
"
,
rgcHostName
);
fflush
(
stdout
);
printOnce
|=
1
;
}
return
(
-
1
);
}
UDPRemote_addr
->
sin_addr
=
*
((
struct
in_addr
*
)
he
->
h_addr
);
...
...
@@ -62,8 +66,10 @@ int initIPC(char *rgcHostName){
usiGUIUDPPort
=
7070
;
sprintf
(
rgcGUIHostName
,
"%s"
,
rgcHostName
);
if
(
printOnce
&
2
==
0
)
{
printf
(
"[initIPC] %s
\n
"
,
rgcGUIHostName
);
printOnce
|=
2
;
}
return
initUDPSocket
(
&
iGUIUDPSocket
,
&
addrGUIUDP
,
&
usiGUIUDPPort
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment