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
6f8a4727
Commit
6f8a4727
authored
Nov 21, 2018
by
Tiago Jorge
Browse files
Update synchronousTool so that some BRAVE device driver functions return asn1SccT_Int8
parent
5f752764
Changes
1
Hide whitespace changes
Inline
Side-by-side
dmt/B_mappers/synchronousTool.py
View file @
6f8a4727
...
...
@@ -579,13 +579,13 @@ class SynchronousToolGlueGeneratorGeneric(Generic[TSource, TDestin]):
fpgaSuffix
=
"_Brave_Fpga"
if
subProgramImplementation
.
lower
()
==
"c"
and
sp
.
_fpgaConfigurations
is
not
''
:
self
.
C_HeaderFile
.
write
(
"asn1Scc
My
Int
eger
Execute_%s();
\n
"
%
self
.
CleanNameAsADAWants
(
sp
.
_id
+
"_"
+
subProgramImplementation
))
self
.
C_HeaderFile
.
write
(
"asn1Scc
T_
Int
8
Execute_%s();
\n
"
%
self
.
CleanNameAsADAWants
(
sp
.
_id
+
"_"
+
subProgramImplementation
))
else
:
self
.
C_HeaderFile
.
write
(
"void Execute_%s();
\n
"
%
self
.
CleanNameAsADAWants
(
sp
.
_id
+
"_"
+
subProgramImplementation
))
if
maybeFVname
!=
""
:
self
.
C_HeaderFile
.
write
(
"void init_%s%s();
\n
"
%
(
self
.
CleanNameAsADAWants
(
maybeFVname
),
fpgaSuffix
))
if
subProgramImplementation
.
lower
()
==
"c"
and
sp
.
_fpgaConfigurations
is
not
''
:
self
.
C_HeaderFile
.
write
(
"asn1Scc
My
Int
eger
%s_%s%s("
%
(
self
.
CleanNameAsADAWants
(
maybeFVname
),
self
.
CleanNameAsADAWants
(
sp
.
_id
),
fpgaSuffix
))
self
.
C_HeaderFile
.
write
(
"asn1Scc
T_
Int
8
%s_%s%s("
%
(
self
.
CleanNameAsADAWants
(
maybeFVname
),
self
.
CleanNameAsADAWants
(
sp
.
_id
),
fpgaSuffix
))
else
:
self
.
C_HeaderFile
.
write
(
"void %s_%s%s("
%
(
self
.
CleanNameAsADAWants
(
maybeFVname
),
self
.
CleanNameAsADAWants
(
sp
.
_id
),
fpgaSuffix
))
else
:
# pragma: no cover
...
...
@@ -603,9 +603,9 @@ class SynchronousToolGlueGeneratorGeneric(Generic[TSource, TDestin]):
# Check if Function Block will exist both as SW and HW. If yes generate dispatcher function (to delegate to SW or HW).
if
subProgramImplementation
.
lower
()
==
"c"
and
sp
.
_fpgaConfigurations
is
not
''
:
if
maybeFVname
!=
""
:
self
.
C_HeaderFile
.
write
(
"asn1Scc
My
Int
eger
%s_%s%s("
%
(
self
.
CleanNameAsADAWants
(
maybeFVname
),
self
.
CleanNameAsADAWants
(
sp
.
_id
),
dispatcherSuffix
))
self
.
C_HeaderFile
.
write
(
"asn1Scc
T_
Int
8
%s_%s%s("
%
(
self
.
CleanNameAsADAWants
(
maybeFVname
),
self
.
CleanNameAsADAWants
(
sp
.
_id
),
dispatcherSuffix
))
else
:
# pragma: no cover
self
.
C_HeaderFile
.
write
(
"asn1Scc
My
Int
eger
%s%s("
%
(
self
.
CleanNameAsADAWants
(
sp
.
_id
),
dispatcherSuffix
))
# pragma: no cover
self
.
C_HeaderFile
.
write
(
"asn1Scc
T_
Int
8
%s%s("
%
(
self
.
CleanNameAsADAWants
(
sp
.
_id
),
dispatcherSuffix
))
# pragma: no cover
for
param
in
sp
.
_params
:
if
param
.
_id
!=
sp
.
_params
[
0
].
_id
:
self
.
C_HeaderFile
.
write
(
', '
)
...
...
@@ -618,7 +618,7 @@ class SynchronousToolGlueGeneratorGeneric(Generic[TSource, TDestin]):
self
.
C_HeaderFile
.
write
(
"
\n
#endif
\n
"
)
if
subProgramImplementation
.
lower
()
==
"c"
and
sp
.
_fpgaConfigurations
is
not
''
:
self
.
C_SourceFile
.
write
(
"asn1Scc
My
Int
eger
Execute_%s()
\n
{
\n
"
%
self
.
CleanNameAsADAWants
(
sp
.
_id
+
"_"
+
subProgramImplementation
))
self
.
C_SourceFile
.
write
(
"asn1Scc
T_
Int
8
Execute_%s()
\n
{
\n
"
%
self
.
CleanNameAsADAWants
(
sp
.
_id
+
"_"
+
subProgramImplementation
))
else
:
self
.
C_SourceFile
.
write
(
"void Execute_%s()
\n
{
\n
"
%
self
.
CleanNameAsADAWants
(
sp
.
_id
+
"_"
+
subProgramImplementation
))
self
.
ExecuteBlock
(
modelingLanguage
,
asnFile
,
sp
,
subProgramImplementation
,
maybeFVname
)
...
...
@@ -635,7 +635,7 @@ class SynchronousToolGlueGeneratorGeneric(Generic[TSource, TDestin]):
self
.
C_SourceFile
.
write
(
"}
\n\n
"
)
if
maybeFVname
!=
""
:
if
subProgramImplementation
.
lower
()
==
"c"
and
sp
.
_fpgaConfigurations
is
not
''
:
self
.
C_SourceFile
.
write
(
"asn1Scc
My
Int
eger
%s_%s%s("
%
(
self
.
CleanNameAsADAWants
(
maybeFVname
),
self
.
CleanNameAsADAWants
(
sp
.
_id
),
fpgaSuffix
))
self
.
C_SourceFile
.
write
(
"asn1Scc
T_
Int
8
%s_%s%s("
%
(
self
.
CleanNameAsADAWants
(
maybeFVname
),
self
.
CleanNameAsADAWants
(
sp
.
_id
),
fpgaSuffix
))
else
:
self
.
C_SourceFile
.
write
(
"void %s_%s%s("
%
(
self
.
CleanNameAsADAWants
(
maybeFVname
),
self
.
CleanNameAsADAWants
(
sp
.
_id
),
fpgaSuffix
))
else
:
# pragma: no cover
...
...
@@ -697,9 +697,9 @@ class SynchronousToolGlueGeneratorGeneric(Generic[TSource, TDestin]):
# Check if Function Block will exist both as SW and HW. If yes generate dispatcher function (to delegate to SW or HW).
if
subProgramImplementation
.
lower
()
==
"c"
and
sp
.
_fpgaConfigurations
is
not
''
:
if
maybeFVname
!=
""
:
self
.
C_SourceFile
.
write
(
"asn1Scc
My
Int
eger
%s_%s%s("
%
(
self
.
CleanNameAsADAWants
(
maybeFVname
),
self
.
CleanNameAsADAWants
(
sp
.
_id
),
dispatcherSuffix
))
self
.
C_SourceFile
.
write
(
"asn1Scc
T_
Int
8
%s_%s%s("
%
(
self
.
CleanNameAsADAWants
(
maybeFVname
),
self
.
CleanNameAsADAWants
(
sp
.
_id
),
dispatcherSuffix
))
else
:
# pragma: no cover
self
.
C_SourceFile
.
write
(
"asn1Scc
My
Int
eger
%s%s("
%
(
self
.
CleanNameAsADAWants
(
sp
.
_id
),
dispatcherSuffix
))
# pragma: no cover
self
.
C_SourceFile
.
write
(
"asn1Scc
T_
Int
8
%s%s("
%
(
self
.
CleanNameAsADAWants
(
sp
.
_id
),
dispatcherSuffix
))
# pragma: no cover
for
param
in
sp
.
_params
:
if
param
.
_id
!=
sp
.
_params
[
0
].
_id
:
self
.
C_SourceFile
.
write
(
', '
)
...
...
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