Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
dmt
Commits
1b2e68b9
Commit
1b2e68b9
authored
Sep 20, 2019
by
Tiago Jorge
Browse files
Bambu bridge now calls init function of Simulink blocks (only the first time).
parent
4fd95579
Changes
1
Hide whitespace changes
Inline
Side-by-side
dmt/B_mappers/brave_B_mapper.py
View file @
1b2e68b9
...
...
@@ -1388,8 +1388,11 @@ def EmitBambuSimulinkBridge(sp: ApLevelContainer, subProgramImplementation: str)
bambuFile
.
write
(
"#include
\"
%s.h
\"
// Space certified compiler generated
\n
"
%
vhdlBackend
.
asn_name
)
bambuFile
.
write
(
"#include
\"
%s.h
\"\n
"
%
vhdlBackend
.
CleanNameAsToolWants
(
sp
.
_id
))
bambuFile
.
write
(
"#include
\"
%s_types.h
\"\n\n
"
%
vhdlBackend
.
CleanNameAsToolWants
(
sp
.
_id
))
bambuFile
.
write
(
"#include
\"
%s_types.h
\"\n\n
"
%
vhdlBackend
.
CleanNameAsToolWants
(
sp
.
_id
))
#TODO can be added later for optimization (and these 2 files can then be removed from Bambu call
#bambuFile.write("#include \"%s.c\"\n\n" % vhdlBackend.CleanNameAsToolWants(sp._id))
#bambuFile.write("#include \"%s_data.c\"\n\n" % vhdlBackend.CleanNameAsToolWants(sp._id))
bambuFile
.
write
(
'void bambu_%s(
\n
'
%
sp
.
_id
)
lines
=
[]
for
param
in
sp
.
_params
:
...
...
@@ -1400,6 +1403,16 @@ def EmitBambuSimulinkBridge(sp: ApLevelContainer, subProgramImplementation: str)
'%s%s'
%
(
",
\n
"
if
idx
!=
0
else
""
,
line
))
bambuFile
.
write
(
') {
\n
'
)
initStr
=
"""
static int initialized = 0;
if (!initialized) {
initialized = 1;
%s_initialize();
}
"""
%
(
sp
.
_id
)
bambuFile
.
write
(
initStr
)
lines
=
[]
for
param
in
sp
.
_params
:
if
isinstance
(
param
,
InParam
):
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment