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
159fc2f6
Commit
159fc2f6
authored
Oct 04, 2018
by
Tiago Jorge
Browse files
Add new b-mapper for BRAVE; Fix pointer to global variable.
(brave b-mapper is copy of zestsc1 as starting point)
parent
4e17a4b0
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
dmt/B_mappers/brave_B_mapper.py
0 → 100644
View file @
159fc2f6
This diff is collapsed.
Click to expand it.
dmt/B_mappers/synchronousTool.py
View file @
159fc2f6
...
...
@@ -695,15 +695,15 @@ class SynchronousToolGlueGeneratorGeneric(Generic[TSource, TDestin]):
self
.
C_SourceFile
.
write
(
' Delegate to one or the other side (SW or HW) depending on whether the value of a global variable storing the current
\n
'
)
self
.
C_SourceFile
.
write
(
' configuration equals one of those defined for the target function in new IV field.
\n
'
)
self
.
C_SourceFile
.
write
(
' */
\n
'
)
self
.
C_SourceFile
.
write
(
' extern const char
*
p_szGlobalState;
\n
'
)
self
.
C_SourceFile
.
write
(
' extern const char p_szGlobalState
[]
;
\n
'
)
self
.
C_SourceFile
.
write
(
' if(!strcmp(p_szGlobalState, "%s")){
\n
'
%
(
sp
.
_fpgaConfigurations
))
self
.
C_SourceFile
.
write
(
' // delegate to HW
\n
'
)
self
.
C_SourceFile
.
write
(
' printf("
d
elegat
e
to HW
\\
n");
\n
'
)
self
.
C_SourceFile
.
write
(
' //called_compute_something_Brave_Fpga(pinp, size_inp, poutp, pSize_outp);
\n
'
)
self
.
C_SourceFile
.
write
(
' printf("
[###### Dispatcher ######] D
elegat
ing
to HW
... (to be implemented)
\\
n");
\n
'
)
self
.
C_SourceFile
.
write
(
' //
called_compute_something_Brave_Fpga(pinp, size_inp, poutp, pSize_outp);
\n
'
)
self
.
C_SourceFile
.
write
(
' // delegated to HW, return 0
\n
'
)
self
.
C_SourceFile
.
write
(
' return 0;
\n
'
)
self
.
C_SourceFile
.
write
(
' }else{
\n
'
)
self
.
C_SourceFile
.
write
(
' printf("
d
elegat
e
to SW
\\
n");
\n
'
)
self
.
C_SourceFile
.
write
(
' printf("
[###### Dispatcher ######] D
elegat
ing
to SW
...
\\
n");
\n
'
)
self
.
C_SourceFile
.
write
(
' // delegate to SW, return 1
\n
'
)
self
.
C_SourceFile
.
write
(
' return 1;
\n
'
)
self
.
C_SourceFile
.
write
(
' }
\n
'
)
...
...
dmt/aadl2glueC.py
View file @
159fc2f6
...
...
@@ -100,6 +100,7 @@ from .B_mappers import simulink_B_mapper
from
.B_mappers
import
micropython_async_B_mapper
from
.B_mappers
import
vhdl_B_mapper
from
.B_mappers
import
zestSC1_B_mapper
from
.B_mappers
import
brave_B_mapper
from
.B_mappers.module_protos
import
Sync_B_Mapper
,
Async_B_Mapper
...
...
@@ -216,6 +217,8 @@ types). This used to cover Dumpable C/Ada Types and OG headers.'''
def
getSyncBackend
(
modelingLanguage
:
str
)
->
Sync_B_Mapper
:
if
modelingLanguage
not
in
g_sync_mappers
:
panic
(
"Synchronous modeling language '%s' not supported"
%
modelingLanguage
)
if
os
.
getenv
(
"BRAVE"
)
is
not
None
and
modelingLanguage
==
'vhdl'
:
return
cast
(
Sync_B_Mapper
,
brave_B_mapper
)
if
os
.
getenv
(
"ZESTSC1"
)
is
not
None
and
modelingLanguage
==
'vhdl'
:
return
cast
(
Sync_B_Mapper
,
zestSC1_B_mapper
)
return
cast
(
Sync_B_Mapper
,
g_sync_mappers
[
modelingLanguage
])
...
...
@@ -379,6 +382,8 @@ def ProcessCustomBackends(
if
lang
.
lower
()
in
[
"gui_pi"
,
"gui_ri"
]:
return
[
cast
(
Sync_B_Mapper
,
x
)
for
x
in
[
python_B_mapper
,
pyside_B_mapper
]]
# pragma: no cover
elif
lang
.
lower
()
==
"vhdl"
:
# pragma: no cover
if
os
.
getenv
(
"BRAVE"
)
is
not
None
:
return
[
cast
(
Sync_B_Mapper
,
brave_B_mapper
)]
# pragma: no cover
if
os
.
getenv
(
"ZESTSC1"
)
is
not
None
:
return
[
cast
(
Sync_B_Mapper
,
zestSC1_B_mapper
)]
# pragma: no cover
else
:
...
...
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