Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
dmt
Commits
909655e4
Commit
909655e4
authored
Dec 19, 2018
by
Tiago Jorge
Browse files
Add call to Brave dispatcher from Simulink glue
parent
4adc8cc1
Changes
2
Show whitespace changes
Inline
Side-by-side
dmt/B_mappers/simulink_B_mapper.py
View file @
909655e4
...
...
@@ -446,11 +446,13 @@ class SimulinkGlueGenerator(SynchronousToolGlueGenerator):
panicWithCallStack
(
"%s not supported (yet?)
\n
"
%
str
(
param
.
_sourceElement
))
# pragma: no cover
return
dstSimulink
def
InitializeBlock
(
self
,
unused_modelingLanguage
:
str
,
unused_asnFile
:
str
,
unused_
sp
:
ApLevelContainer
,
unused_subProgramImplementation
:
str
,
unused_
maybeFVname
:
str
)
->
None
:
def
InitializeBlock
(
self
,
unused_modelingLanguage
:
str
,
unused_asnFile
:
str
,
sp
:
ApLevelContainer
,
unused_subProgramImplementation
:
str
,
maybeFVname
:
str
)
->
None
:
self
.
C_SourceFile
.
write
(
" static int initialized = 0;
\n
"
)
self
.
C_SourceFile
.
write
(
" if (!initialized) {
\n
"
)
self
.
C_SourceFile
.
write
(
" initialized = 1;
\n
"
)
self
.
C_SourceFile
.
write
(
" %s_initialize(1);
\n
"
%
self
.
g_FVname
)
if
sp
.
_fpgaConfigurations
is
not
''
:
self
.
C_SourceFile
.
write
(
" init_%s_Brave_Fpga();
\n
"
%
maybeFVname
)
self
.
C_SourceFile
.
write
(
" }
\n
"
)
def
ExecuteBlock
(
self
,
unused_modelingLanguage
:
str
,
unused_asnFile
:
str
,
unused_sp
:
ApLevelContainer
,
unused_subProgramImplementation
:
str
,
unused_maybeFVname
:
str
)
->
None
:
...
...
dmt/B_mappers/synchronousTool.py
View file @
909655e4
...
...
@@ -673,6 +673,21 @@ class SynchronousToolGlueGeneratorGeneric(Generic[TSource, TDestin]):
self
.
C_SourceFile
.
write
(
'void *p'
+
self
.
CleanNameAsToolWants
(
param
.
_id
)
+
', size_t *pSize_'
+
self
.
CleanNameAsToolWants
(
param
.
_id
))
self
.
C_SourceFile
.
write
(
")
\n
{
\n
"
)
if
sp
.
_fpgaConfigurations
is
not
''
and
subProgramImplementation
.
lower
()
==
"simulink"
and
modelingLanguage
!=
"vhdl"
:
self
.
C_SourceFile
.
write
(
' // Calling Brave VHDL dispatcher function
\n
'
)
self
.
C_SourceFile
.
write
(
' if (0 == %s_%s%s ('
%
\
(
self
.
CleanNameAsADAWants
(
maybeFVname
),
self
.
CleanNameAsADAWants
(
sp
.
_id
),
dispatcherSuffix
))
for
param
in
sp
.
_params
:
if
param
.
_id
!=
sp
.
_params
[
0
].
_id
:
self
.
C_SourceFile
.
write
(
', '
)
if
isinstance
(
param
,
InParam
):
self
.
C_SourceFile
.
write
(
'p'
+
self
.
CleanNameAsToolWants
(
param
.
_id
)
+
', size_'
+
self
.
CleanNameAsToolWants
(
param
.
_id
))
else
:
self
.
C_SourceFile
.
write
(
'p'
+
self
.
CleanNameAsToolWants
(
param
.
_id
)
+
', pSize_'
+
self
.
CleanNameAsToolWants
(
param
.
_id
))
self
.
C_SourceFile
.
write
(
")) return;
\n
"
)
if
genHwDevDrv
:
self
.
C_SourceFile
.
write
(
' // Check if FPGA is ready.
\n
'
)
self
.
C_SourceFile
.
write
(
' extern const char globalFpgaStatus_%s[];
\n
'
%
(
self
.
CleanNameAsADAWants
(
maybeFVname
)))
...
...
Write
Preview
Supports
Markdown
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