Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
buildsupport
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TASTE
buildsupport
Commits
9e3040bc
Commit
9e3040bc
authored
Aug 30, 2016
by
Maxime Perrotin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More VDM support
parent
05eff342
Pipeline
#1176
skipped
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
14 deletions
+28
-14
ada/imported_routines.ads
ada/imported_routines.ads
+1
-0
c/build_script.c
c/build_script.c
+15
-1
c/build_vdm_skeletons.c
c/build_vdm_skeletons.c
+7
-10
c/c_backend.c
c/c_backend.c
+1
-0
include/backends.h
include/backends.h
+3
-2
include/practical_functions.h
include/practical_functions.h
+1
-1
No files found.
ada/imported_routines.ads
View file @
9e3040bc
...
@@ -309,6 +309,7 @@ private
...
@@ -309,6 +309,7 @@ private
pragma
Linker_Options
(
"build_script.o"
);
pragma
Linker_Options
(
"build_script.o"
);
pragma
Linker_Options
(
"system_config.o"
);
pragma
Linker_Options
(
"system_config.o"
);
pragma
Linker_Options
(
"build_scade_skeletons.o"
);
pragma
Linker_Options
(
"build_scade_skeletons.o"
);
pragma
Linker_Options
(
"build_vdm_skeletons.o"
);
pragma
Linker_Options
(
"build_rtds_skeletons.o"
);
pragma
Linker_Options
(
"build_rtds_skeletons.o"
);
pragma
Linker_Options
(
"build_driver_skeletons.o"
);
pragma
Linker_Options
(
"build_driver_skeletons.o"
);
pragma
Linker_Options
(
"asn2datamodel.o"
);
pragma
Linker_Options
(
"asn2datamodel.o"
);
...
...
c/build_script.c
View file @
9e3040bc
...
@@ -120,6 +120,19 @@ void Create_script()
...
@@ -120,6 +120,19 @@ void Create_script()
}
}
});
});
/* VDM-Specific: call code generator and B mappers */
FOREACH
(
fv
,
FV
,
get_system_ast
()
->
functions
,
{
if
(
vdm
==
fv
->
language
)
{
fprintf
(
script
,
"# Generate code for VDM function %s
\n
"
"cd
\"
$SKELS
\"
/%s && "
"vdm2c %s.vdmpp %s_Interface.vdmpp out.vdm"
"&& cd $OLDPWD
\n\n
"
,
fv
->
name
,
fv
->
name
,
fv
->
name
,
fv
->
name
);
}
/* TODO call B mappers or add --subVdm in orchestrator */
});
/* Remove old zip files and create fresh new ones from user code */
/* Remove old zip files and create fresh new ones from user code */
FOREACH
(
fv
,
FV
,
get_system_ast
()
->
functions
,
{
FOREACH
(
fv
,
FV
,
get_system_ast
()
->
functions
,
{
//if (sdl != fv->language PUT BACK WHEN OPENGEODE FULLY SUPPORTED
//if (sdl != fv->language PUT BACK WHEN OPENGEODE FULLY SUPPORTED
...
@@ -186,13 +199,14 @@ void Create_script()
...
@@ -186,13 +199,14 @@ void Create_script()
case
rtds
:
fprintf
(
script
,
"--subRTDS "
);
case
rtds
:
fprintf
(
script
,
"--subRTDS "
);
break
;
break
;
case
c
:
case
c
:
case
vdm
:
case
blackbox_device
:
case
blackbox_device
:
fprintf
(
script
,
"--subC "
);
fprintf
(
script
,
"--subC "
);
break
;
break
;
case
cpp
:
case
cpp
:
fprintf
(
script
,
"--subCPP "
);
fprintf
(
script
,
"--subCPP "
);
break
;
break
;
case
sdl
:
// REMOVE WHEN OPENGEODE FULLY SUPPORTED
case
sdl
:
case
ada
:
fprintf
(
script
,
"--subAda "
);
case
ada
:
fprintf
(
script
,
"--subAda "
);
break
;
break
;
case
vhdl
:
fprintf
(
script
,
"--subVHDL "
);
case
vhdl
:
fprintf
(
script
,
"--subVHDL "
);
...
...
c/build_vdm_skeletons.c
View file @
9e3040bc
...
@@ -60,7 +60,7 @@ void Init_VDM_GW_Backend(FV *fv)
...
@@ -60,7 +60,7 @@ void Init_VDM_GW_Backend(FV *fv)
filename
=
make_string
(
"%s_interface.vdmpp"
,
fv
->
name
);
filename
=
make_string
(
"%s_interface.vdmpp"
,
fv
->
name
);
create_file
(
path
,
filename
,
&
interface
);
create_file
(
path
,
filename
,
&
interface
);
free
(
filename
);
free
(
filename
);
filename
=
make_string
(
"%s
_code
.vdmpp"
,
fv
->
name
);
filename
=
make_string
(
"%s.vdmpp"
,
fv
->
name
);
if
(
!
file_exists
(
path
,
filename
))
{
if
(
!
file_exists
(
path
,
filename
))
{
create_file
(
path
,
filename
,
&
user_code
);
create_file
(
path
,
filename
,
&
user_code
);
...
@@ -137,13 +137,8 @@ void add_pi_to_vdm_gw(Interface * i)
...
@@ -137,13 +137,8 @@ void add_pi_to_vdm_gw(Interface * i)
fprintf
(
user_code
,
fprintf
(
user_code
,
"
\n
"
"
\n
"
"%s%s == -- Write your code here
\n\n
"
,
"%s%s == -- Write your code here
\n\n
"
,
NULL
!=
i
->
in
?
params
:
""
,
i
->
name
,
i
->
name
);
NULL
!=
i
->
in
?
params
:
""
);
free
(
signature
);
free
(
sep2
);
free
(
params
);
free
(
sep
);
}
}
/* Declaration of the RI */
/* Declaration of the RI */
...
@@ -158,9 +153,11 @@ void add_ri_to_vdm_gw(Interface * i)
...
@@ -158,9 +153,11 @@ void add_ri_to_vdm_gw(Interface * i)
void
End_VDM_GW_Backend
(
FV
*
fv
)
void
End_VDM_GW_Backend
(
FV
*
fv
)
{
{
fprintf
(
interface
,
"end %s_Interface
\n
"
,
fv
->
name
);
fprintf
(
interface
,
"end %s_Interface
\n
"
,
fv
->
name
);
fprintf
(
user_code
,
"end %s
\n
"
,
fv
->
name
);
close_file
(
&
interface
);
close_file
(
&
interface
);
close_file
(
&
user_code
);
if
(
NULL
!=
user_code
)
{
fprintf
(
user_code
,
"end %s
\n
"
,
fv
->
name
);
close_file
(
&
user_code
);
}
}
}
/* Function to process one interface of the FV */
/* Function to process one interface of the FV */
...
...
c/c_backend.c
View file @
9e3040bc
...
@@ -126,6 +126,7 @@ void C_End()
...
@@ -126,6 +126,7 @@ void C_End()
GW_SDL_Backend
(
fv
);
GW_SDL_Backend
(
fv
);
GW_Simulink_Backend
(
fv
);
GW_Simulink_Backend
(
fv
);
GW_C_Backend
(
fv
);
GW_C_Backend
(
fv
);
GW_VDM_Backend
(
fv
);
GW_Ada_Backend
(
fv
);
GW_Ada_Backend
(
fv
);
GW_SCADE_Backend
(
fv
);
GW_SCADE_Backend
(
fv
);
GW_RTDS_Backend
(
fv
);
GW_RTDS_Backend
(
fv
);
...
...
include/backends.h
View file @
9e3040bc
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
* contact: maxime.perrotin@esa.int
* contact: maxime.perrotin@esa.int
* License is LGPL, check LICENSE file */
* License is LGPL, check LICENSE file */
/*
/*
Backends.h
Backends.h
External declaration of the backend functions
External declaration of the backend functions
*/
*/
#include "my_types.h"
#include "my_types.h"
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
extern
void
GW_SDL_Backend
(
FV
*
);
extern
void
GW_SDL_Backend
(
FV
*
);
extern
void
GW_Simulink_Backend
(
FV
*
);
extern
void
GW_Simulink_Backend
(
FV
*
);
extern
void
GW_C_Backend
(
FV
*
);
extern
void
GW_C_Backend
(
FV
*
);
extern
void
GW_VDM_Backend
(
FV
*
);
extern
void
GW_Ada_Backend
(
FV
*
);
extern
void
GW_Ada_Backend
(
FV
*
);
extern
void
GW_SCADE_Backend
(
FV
*
);
extern
void
GW_SCADE_Backend
(
FV
*
);
extern
void
GW_RTDS_Backend
(
FV
*
);
extern
void
GW_RTDS_Backend
(
FV
*
);
...
...
include/practical_functions.h
View file @
9e3040bc
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
/* Return a string representing the selected encoding rules for a Parameter */
/* Return a string representing the selected encoding rules for a Parameter */
#define BINARY_ENCODING(p) (native==p->encoding)?"NATIVE":(uper==p->encoding)?"UPER":(acn==p->encoding)?"ACN":"#ERROR#"
#define BINARY_ENCODING(p) (native==p->encoding)?"NATIVE":(uper==p->encoding)?"UPER":(acn==p->encoding)?"ACN":"#ERROR#"
#define LANGUAGE(fv) ada==fv->language?"Ada": c==fv->language?"C": sdl==fv->language?"OG": rtds==fv->language?"RTDS": scade==fv->language?"SCADE6":simulink==fv->language?"SIMULINK": blackbox_device==fv->language? "C": rhapsody==fv->language? "C": vhdl==fv->language?"VHDL": system_c==fv->language?"SYSTEM_C":gui==fv->language?"GUI": qgenc==fv->language?"QGenC": qgenada==fv->language?"QGenAda": cpp==fv->language?"CPP": vdm==fv->language?"V
DM
": "UNSUPPORTED_LANGUAGE!"
#define LANGUAGE(fv) ada==fv->language?"Ada": c==fv->language?"C": sdl==fv->language?"OG": rtds==fv->language?"RTDS": scade==fv->language?"SCADE6":simulink==fv->language?"SIMULINK": blackbox_device==fv->language? "C": rhapsody==fv->language? "C": vhdl==fv->language?"VHDL": system_c==fv->language?"SYSTEM_C":gui==fv->language?"GUI": qgenc==fv->language?"QGenC": qgenada==fv->language?"QGenAda": cpp==fv->language?"CPP": vdm==fv->language?"V
dm
": "UNSUPPORTED_LANGUAGE!"
#define RCM_KIND(IF) (protected==IF->rcm?"protected":unprotected==IF->rcm?"unprotected":sporadic==IF->rcm?"sporadic":cyclic==IF->rcm?"cyclic":variator==IF->rcm?"variator":"unknown")
#define RCM_KIND(IF) (protected==IF->rcm?"protected":unprotected==IF->rcm?"unprotected":sporadic==IF->rcm?"sporadic":cyclic==IF->rcm?"cyclic":variator==IF->rcm?"variator":"unknown")
...
...
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