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
f34acd94
Commit
f34acd94
authored
Nov 26, 2018
by
Tiago Jorge
Browse files
Update log levels instead of raw printfs.
parent
39e9c0c9
Changes
2
Hide whitespace changes
Inline
Side-by-side
dmt/B_mappers/brave_B_mapper.py
View file @
f34acd94
...
...
@@ -437,6 +437,32 @@ class VHDLGlueGenerator(SynchronousToolGlueGeneratorGeneric[List[int], List[int]
#define STATIC
#endif
#define LOGERROR 1
#define LOGWARNING 1
#define LOGINFO 1
#define LOGDEBUG 0
#ifdef LOGERROR
#define LOGERROR(x...) printf(x)
#else
#define LOGERROR(x...)
#endif
#ifdef LOGWARNING
#define LOGWARNING(x...) printf(x)
#else
#define LOGWARNING(x...)
#endif
#ifdef LOGINFO
#define LOGINFO(x...) printf(x)
#else
#define LOGINFO(x...)
#endif
#ifdef LOGDEBUG
#define LOGDEBUG(x...) printf(x)
#else
#define LOGDEBUG(x...)
#endif
#define FPGA_READY "ready"
#define FPGA_RECONFIGURING "reconfiguring"
#define FPGA_ERROR "error"
...
...
@@ -518,7 +544,7 @@ unsigned int rmap_dst_address = R_RMAP_DSTADR; /* SpW Destination address. */
# def InitializeBlock(self, modelingLanguage, asnFile, sp, subProgramImplementation, maybeFVname):
def
InitializeBlock
(
self
,
unused_modelingLanguage
:
str
,
unused_asnFile
:
str
,
unused_sp
:
ApLevelContainer
,
unused_subProgramImplementation
:
str
,
unused_maybeFVname
:
str
)
->
None
:
self
.
C_SourceFile
.
write
(
'''
printf
("[ ********* %s Init ********* ] Device driver init ...
\\
n");
self
.
C_SourceFile
.
write
(
'''
LOGINFO
("[ ********* %s Init ********* ] Device driver init ...
\\
n");
rmap123_init();
\n
'''
%
(
self
.
CleanNameAsADAWants
(
unused_maybeFVname
)))
...
...
@@ -536,10 +562,10 @@ unsigned int rmap_dst_address = R_RMAP_DSTADR; /* SpW Destination address. */
self
.
C_SourceFile
.
write
(
' unsigned char okstart = 1;
\n
'
)
self
.
C_SourceFile
.
write
(
' if (rmap_tgt_write(apb_base_address + %s, &okstart, 1, rmap_dst_address)) {
\n
'
%
hex
(
int
(
VHDL_Circuit
.
lookupSP
[
sp
.
_id
].
_offset
)))
self
.
C_SourceFile
.
write
(
'
printf
("Failed writing Target
\\
n");
\n
'
)
self
.
C_SourceFile
.
write
(
'
LOGERROR
("Failed writing Target
\\
n");
\n
'
)
self
.
C_SourceFile
.
write
(
' return -1;
\n
'
)
self
.
C_SourceFile
.
write
(
' }
\n
'
)
self
.
C_SourceFile
.
write
(
'
//printf
(" - Write OK
\\
n");
\n
'
)
self
.
C_SourceFile
.
write
(
'
LOGDEBUG
(" - Write OK
\\
n");
\n
'
)
self
.
C_SourceFile
.
write
(
' //count = 0;
\n
'
)
self
.
C_SourceFile
.
write
(
' //ts_prev = ObtainTimeStamp();
\n
'
)
...
...
@@ -554,10 +580,10 @@ unsigned int rmap_dst_address = R_RMAP_DSTADR; /* SpW Destination address. */
self
.
C_SourceFile
.
write
(
' if (rmap_tgt_read(apb_base_address + %s, &flag, 1, rmap_dst_address)) {
\n
'
%
hex
(
int
(
VHDL_Circuit
.
lookupSP
[
sp
.
_id
].
_offset
)))
self
.
C_SourceFile
.
write
(
'
printf
("Failed reading Target
\\
n");
\n
'
)
self
.
C_SourceFile
.
write
(
'
LOGERROR
("Failed reading Target
\\
n");
\n
'
)
self
.
C_SourceFile
.
write
(
' return -1;
\n
'
)
self
.
C_SourceFile
.
write
(
' }
\n
'
)
self
.
C_SourceFile
.
write
(
'
//printf
(" - Read OK
\\
n");
\n
'
)
self
.
C_SourceFile
.
write
(
'
LOGDEBUG
(" - Read OK
\\
n");
\n
'
)
self
.
C_SourceFile
.
write
(
" //if(flag) break;
\n
"
)
self
.
C_SourceFile
.
write
(
' // Recheck if FPGA is (still) ready.
\n
'
)
...
...
dmt/B_mappers/synchronousTool.py
View file @
f34acd94
...
...
@@ -719,7 +719,7 @@ class SynchronousToolGlueGeneratorGeneric(Generic[TSource, TDestin]):
self
.
C_SourceFile
.
write
(
' while( fConfig != NULL ) {
\n
'
)
self
.
C_SourceFile
.
write
(
' if(!strcmp(p_szGlobalState, fConfig)){
\n
'
)
self
.
C_SourceFile
.
write
(
' // delegate to HW
\n
'
)
self
.
C_SourceFile
.
write
(
'
printf
("[ <-?-> <-?-> <-?-> %s Dispatcher <-?-> <-?-> <-?-> ] Delegating to HW ...
\\
n");
\n
'
%
(
self
.
CleanNameAsADAWants
(
maybeFVname
)))
self
.
C_SourceFile
.
write
(
'
LOGDEBUG
("[ <-?-> <-?-> <-?-> %s Dispatcher <-?-> <-?-> <-?-> ] Delegating to HW ...
\\
n");
\n
'
%
(
self
.
CleanNameAsADAWants
(
maybeFVname
)))
self
.
C_SourceFile
.
write
(
" if(%s_%s%s("
%
(
self
.
CleanNameAsADAWants
(
maybeFVname
),
self
.
CleanNameAsADAWants
(
sp
.
_id
),
fpgaSuffix
))
for
param
in
sp
.
_params
:
if
param
.
_id
!=
sp
.
_params
[
0
].
_id
:
...
...
@@ -730,7 +730,7 @@ class SynchronousToolGlueGeneratorGeneric(Generic[TSource, TDestin]):
self
.
C_SourceFile
.
write
(
'p'
+
self
.
CleanNameAsToolWants
(
param
.
_id
)
+
', pSize_'
+
self
.
CleanNameAsToolWants
(
param
.
_id
))
self
.
C_SourceFile
.
write
(
")){
\n
"
)
self
.
C_SourceFile
.
write
(
' // HW error, return 2
\n
'
)
self
.
C_SourceFile
.
write
(
'
printf
("[ <-?-> <-?-> <-?-> %s Dispatcher <-?-> <-?-> <-?-> ] HW error!
\\
n");
\n
'
%
(
self
.
CleanNameAsADAWants
(
maybeFVname
)))
self
.
C_SourceFile
.
write
(
'
LOGERROR
("[ <-?-> <-?-> <-?-> %s Dispatcher <-?-> <-?-> <-?-> ] HW error!
\\
n");
\n
'
%
(
self
.
CleanNameAsADAWants
(
maybeFVname
)))
self
.
C_SourceFile
.
write
(
' return 2;
\n
'
)
self
.
C_SourceFile
.
write
(
' }
\n
'
)
self
.
C_SourceFile
.
write
(
' // delegated to HW, return 0
\n
'
)
...
...
@@ -738,7 +738,7 @@ class SynchronousToolGlueGeneratorGeneric(Generic[TSource, TDestin]):
self
.
C_SourceFile
.
write
(
' }
\n
'
)
self
.
C_SourceFile
.
write
(
' fConfig = strtok(NULL, ",");
\n
'
)
self
.
C_SourceFile
.
write
(
' }
\n
'
)
self
.
C_SourceFile
.
write
(
'
printf
("[ <-?-> <-?-> <-?-> %s Dispatcher <-?-> <-?-> <-?-> ] Delegating to SW ...
\\
n");
\n
'
%
(
self
.
CleanNameAsADAWants
(
maybeFVname
)))
self
.
C_SourceFile
.
write
(
'
LOGDEBUG
("[ <-?-> <-?-> <-?-> %s Dispatcher <-?-> <-?-> <-?-> ] Delegating to SW ...
\\
n");
\n
'
%
(
self
.
CleanNameAsADAWants
(
maybeFVname
)))
self
.
C_SourceFile
.
write
(
' // delegate to SW, return 1
\n
'
)
self
.
C_SourceFile
.
write
(
' return 1;
\n
'
)
self
.
C_SourceFile
.
write
(
"}
\n\n
"
)
...
...
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