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
regression-suites
Commits
27cc2ee1
Commit
27cc2ee1
authored
Sep 20, 2019
by
Tiago Jorge
Browse files
Make some prints as debug messages only. Fix status check.
parent
bc743141
Changes
1
Hide whitespace changes
Inline
Side-by-side
Demo_CoRAMBAD_Brave_GR740_GNC/calling/calling.c
View file @
27cc2ee1
...
...
@@ -21,15 +21,24 @@ char p_szGlobalState[10] = "modeX";
char
globalFpgaStatus_gnc
[
20
]
=
FPGA_DISABLED
;
char
globalFpgaStatus_gnc2
[
20
]
=
FPGA_DISABLED
;
//uncomment the following define to print debug level info
//#define DEBUG_RECONF
int
get_bitfile_info
(
char
*
config
,
char
**
global_status_var
,
asn1SccMyInteger
*
offset
,
asn1SccMyInteger
*
size
)
{
int
headerfile_entries
=
0
;
headerfile_entries
=
sizeof
(
bitfiles
)
/
sizeof
(
struct
config_bitfile
);
#ifdef DEBUG_RECONF
printf
(
"[get_bitfile_info] There are %d headerfile entries.
\n
"
,
headerfile_entries
);
#endif
for
(
int
i
=
0
;
i
<
headerfile_entries
;
i
++
){
#ifdef DEBUG_RECONF
printf
(
"[get_bitfile_info] Mode index %d is %s
\n
"
,
i
,
bitfiles
[
i
].
config
);
#endif
if
(
strcmp
(
config
,
bitfiles
[
i
].
config
)
==
0
)
{
#ifdef DEBUG_RECONF
printf
(
"[get_bitfile_info] Mode found in index %d which is %s
\n
"
,
i
,
bitfiles
[
i
].
config
);
#endif
*
global_status_var
=
bitfiles
[
i
].
global_status_var
;
*
offset
=
bitfiles
[
i
].
offset
;
*
size
=
bitfiles
[
i
].
size
;
...
...
@@ -52,7 +61,7 @@ void calling_startup()
void
calling_PI_changeMode
()
{
/* Write your code here! */
printf
(
"
\n
[calling_PI_changeMode] Current mode is %s
\n
"
,
p_szGlobalState
);
//
printf("\n[calling_PI_changeMode] Current mode is %s\n", p_szGlobalState);
/* FPGA reconfiguration engine part */
static
asn1SccMyInteger
fpga_status
=
1
;
...
...
@@ -82,36 +91,41 @@ void calling_PI_changeMode()
offset
=
-
1
;
size
=
-
1
;
if
(
!
get_bitfile_info
(
new_config
,
&
global_status_var
,
&
offset
,
&
size
)){
#ifdef DEBUG_RECONF
printf
(
"[calling_PI_changeMode] bitfile info is: global_status_var prev - %s, offset - %lld, size - %lld
\n
"
,
global_status_var
,
offset
,
size
);
#endif
// DISABLE ALL
strcpy
(
globalFpgaStatus_gnc
,
FPGA_DISABLED
);
strcpy
(
globalFpgaStatus_gnc2
,
FPGA_DISABLED
);
// SET NEXT AS RECONFIGURING
strcpy
(
global_status_var
,
FPGA_RECONFIGURING
);
#ifdef DEBUG_RECONF
printf
(
"[calling_PI_changeMode] global_status_var now is - %s
\n
"
,
global_status_var
);
printf
(
"[calling_PI_changeMode] cross check: globalFpgaStatus_gnc now is - %s
\n
"
,
globalFpgaStatus_gnc
);
printf
(
"[calling_PI_changeMode] cross check: globalFpgaStatus_gnc2 now is - %s
\n
"
,
globalFpgaStatus_gnc2
);
#endif
// CALL engine
/* ## FPGA reconfiguration engine status */
calling_RI_status
(
&
fpga_status
);
#ifdef DEBUG_RECONF
printf
(
"[calling_PI_changeMode] FPGA STATUS before reconf = %lld
\n
"
,
fpga_status
);
#endif
/* ## FPGA reconfiguration engine configuration */
calling_RI_run
(
&
offset
,
&
size
);
/* ## FPGA reconfiguration engine status */
calling_RI_status
(
&
fpga_status
);
#ifdef DEBUG_RECONF
printf
(
"[calling_PI_changeMode] FPGA STATUS after reconf = %lld
\n
"
,
fpga_status
);
#endif
// update again global variables to new value depending on the FPGA state: FPGA_READY? FPGA_ERROR?
if
(
fpga_status
){
if
(
!
fpga_status
){
strcpy
(
global_status_var
,
FPGA_READY
);
printf
(
"[calling_PI_changeMode] New config loaded with success.
\n
"
);
strcpy
(
p_szGlobalState
,
new_config
);
printf
(
"[calling_PI_changeMode] NEW mode is %s
\n
"
,
p_szGlobalState
);
//
printf("[calling_PI_changeMode] NEW mode is %s\n", p_szGlobalState);
}
else
{
strcpy
(
global_status_var
,
FPGA_ERROR
);
printf
(
"[calling_PI_changeMode] New config could not be loaded!
\n
"
);
...
...
@@ -120,7 +134,7 @@ void calling_PI_changeMode()
}
else
{
printf
(
"[calling_PI_changeMode] New (HW) config not found... SW mode applies.
\n
"
);
strcpy
(
p_szGlobalState
,
new_config
);
printf
(
"[calling_PI_changeMode] NEW mode is %s
\n
"
,
p_szGlobalState
);
//
printf("[calling_PI_changeMode] NEW mode is %s\n", p_szGlobalState);
}
}
...
...
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