Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
Mock Turtle
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Mock Turtle
Commits
17a62cb1
Commit
17a62cb1
authored
Apr 10, 2017
by
Federico Vaga
Committed by
Federico Vaga
Sep 13, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rt: add \r to all prints for TTY communication
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
1c7fef33
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
24 deletions
+24
-24
libmockturtle-rt.c
rt/libmockturtle-rt.c
+24
-24
No files found.
rt/libmockturtle-rt.c
View file @
17a62cb1
...
...
@@ -83,12 +83,12 @@ int rt_structure_setter(struct trtl_proto_header *hin, void *pin,
while
(
offset
<
hin
->
len
)
{
#ifdef LIBRT_DEBUG
pp_printf
(
"%s: offset %d/%d
\n
"
,
__func__
,
offset
,
hin
->
len
);
pp_printf
(
"%s: offset %d/%d
\n
\r
"
,
__func__
,
offset
,
hin
->
len
);
#endif
index
=
din
[
offset
++
];
size
=
din
[
offset
++
];
#ifdef LIBRT_DEBUG
pp_printf
(
"%s Type %d Len %d Addr 0x%p
\n
"
,
__func__
,
pp_printf
(
"%s Type %d Len %d Addr 0x%p
\n
\r
"
,
__func__
,
index
,
size
,
_app
->
structures
[
index
].
struct_ptr
);
delay
(
100000
);
#endif
...
...
@@ -98,7 +98,7 @@ int rt_structure_setter(struct trtl_proto_header *hin, void *pin,
}
#ifdef LIBRT_ERROR
else
{
pp_printf
(
"%s:%d structure %d len not correct %"
PRId32
" != %d
\n
"
,
pp_printf
(
"%s:%d structure %d len not correct %"
PRId32
" != %d
\n
\r
"
,
__func__
,
__LINE__
,
index
,
_app
->
structures
[
index
].
len
,
size
);
}
...
...
@@ -129,14 +129,14 @@ int rt_structure_getter(struct trtl_proto_header *hin, void *pin,
while
(
offset
<
hin
->
len
)
{
#ifdef LIBRT_DEBUG
pp_printf
(
"%s: offset %d/%d
\n
"
,
__func__
,
offset
,
hin
->
len
);
pp_printf
(
"%s: offset %d/%d
\n
\r
"
,
__func__
,
offset
,
hin
->
len
);
#endif
index
=
din
[
offset
];
dout
[
offset
++
]
=
index
;
size
=
din
[
offset
];
dout
[
offset
++
]
=
size
;
#ifdef LIBRT_DEBUG
pp_printf
(
"%s Type %d Len %d Addr 0x%p
\n
"
,
__func__
,
pp_printf
(
"%s Type %d Len %d Addr 0x%p
\n
\r
"
,
__func__
,
index
,
size
,
_app
->
structures
[
index
].
struct_ptr
);
delay
(
100000
);
#endif
...
...
@@ -147,7 +147,7 @@ int rt_structure_getter(struct trtl_proto_header *hin, void *pin,
}
#ifdef LIBRT_ERROR
else
{
pp_printf
(
"%s: structure %d len not correct %"
PRId32
" != %d
\n
"
,
pp_printf
(
"%s: structure %d len not correct %"
PRId32
" != %d
\n
\r
"
,
__func__
,
index
,
_app
->
structures
[
index
].
len
,
size
);
}
#endif
...
...
@@ -220,7 +220,7 @@ int rt_variable_setter(struct trtl_proto_header *hin, void *pin,
*
mem
=
(
*
mem
&
~
var
->
mask
)
|
val
;
#ifdef LIBRT_DEBUG
pp_printf
(
"%s index %d/%d | [0x%p] = 0x%08x <- 0x%08x (0x%08x) | index in msg (%d/%d)
\n
"
,
pp_printf
(
"%s index %d/%d | [0x%p] = 0x%08x <- 0x%08x (0x%08x) | index in msg (%d/%d)
\n
\r
"
,
__func__
,
din
[
i
],
_app
->
n_variables
,
mem
,
*
mem
,
val
,
din
[
i
+
1
],
...
...
@@ -270,7 +270,7 @@ int rt_variable_getter(struct trtl_proto_header *hin, void *pin,
val
=
(
*
mem
>>
var
->
offset
)
&
var
->
mask
;
dout
[
i
+
1
]
=
val
;
#ifdef LIBRT_DEBUG
pp_printf
(
"%s index %d/%d | [0x%p] = 0x%08x -> 0x%08x | index in msg (%d/%d)
\n
"
,
pp_printf
(
"%s index %d/%d | [0x%p] = 0x%08x -> 0x%08x | index in msg (%d/%d)
\n
\r
"
,
__func__
,
dout
[
i
],
_app
->
n_variables
,
mem
,
*
mem
,
dout
[
i
+
1
],
...
...
@@ -324,7 +324,7 @@ static inline int rt_action_run(struct trtl_proto_header *hin, void *pin)
int
err
=
0
;
if
(
hin
->
msg_id
>=
_app
->
n_actions
||
!
_app
->
actions
[
hin
->
msg_id
])
{
pp_printf
(
"Cannot dispatch ID 0x%x
\n
"
,
hin
->
msg_id
);
pp_printf
(
"Cannot dispatch ID 0x%x
\n
\r
"
,
hin
->
msg_id
);
return
-
EINVAL
;
}
...
...
@@ -335,7 +335,7 @@ static inline int rt_action_run(struct trtl_proto_header *hin, void *pin)
return
action
(
hin
,
pin
,
NULL
,
NULL
);
}
#ifdef LIBRT_DEBUG
pp_printf
(
"Message Input
\n
"
);
pp_printf
(
"Message Input
\n
\r
"
);
rt_print_header
(
hin
);
#ifdef LIBRT_DEBUG_VERBOSE
rt_print_data
(
pin
,
8
);
...
...
@@ -356,7 +356,7 @@ static inline int rt_action_run(struct trtl_proto_header *hin, void *pin)
rt_mq_msg_send
(
&
out_buf
);
#ifdef LIBRT_DEBUG
pp_printf
(
"Message Output
\n
"
);
pp_printf
(
"Message Output
\n
\r
"
);
rt_print_header
(
&
hout
);
#ifdef LIBRT_DEBUG_VERBOSE
rt_print_data
(
pout
,
8
);
...
...
@@ -394,14 +394,14 @@ int rt_mq_action_dispatch(unsigned int mq_in)
/* Get the message from the HMQ */
msg
=
mq_map_in_buffer
(
0
,
mq_in_slot
);
#ifdef LIBRT_DEBUG_VERBOSE
pp_printf
(
"Incoming message
\n
"
);
pp_printf
(
"Incoming message
\n
\r
"
);
rt_print_data
(
msg
,
8
);
#endif
header
=
rt_proto_header_get
((
void
*
)
msg
);
pin
=
rt_proto_payload_get
((
void
*
)
msg
);
if
(
header
->
rt_app_id
&&
header
->
rt_app_id
!=
_app
->
version
.
rt_id
)
{
pp_printf
(
"Not for this application 0x%x
\n
"
,
header
->
rt_app_id
);
pp_printf
(
"Not for this application 0x%x
\n
\r
"
,
header
->
rt_app_id
);
err
=
-
EINVAL
;
goto
out
;
}
...
...
@@ -412,11 +412,11 @@ int rt_mq_action_dispatch(unsigned int mq_in)
/* Run the correspondent action */
err
=
rt_action_run
(
header
,
pin
);
if
(
err
)
pp_printf
(
"%s: action failure err: %d
\n
"
,
__func__
,
err
);
pp_printf
(
"%s: action failure err: %d
\n
\r
"
,
__func__
,
err
);
#ifdef RTPERFORMANCE
rt_get_time
(
&
sec_n
,
&
cyc_n
);
pp_printf
(
"%s: time %d"
,
__func__
,
(
cyc_n
-
cyc
)
*
8
);
pp_printf
(
"%s: time %d
\n\r
"
,
__func__
,
(
cyc_n
-
cyc
)
*
8
);
#endif
out:
...
...
@@ -455,7 +455,7 @@ int rt_init(struct rt_application *app)
_app
=
app
;
pp_printf
(
"Running application '%s'
\n
"
,
_app
->
name
);
pp_printf
(
"Running application '%s'
\n
\r
"
,
_app
->
name
);
/* *fpga_id = 0x1234; /\* TODO read it from the FPGA ID register *\/ */
for
(
i
=
0
;
i
<
app
->
fpga_id_compat_n
;
i
++
)
{
...
...
@@ -463,18 +463,18 @@ int rt_init(struct rt_application *app)
break
;
}
if
(
app
->
fpga_id_compat_n
&&
app
->
fpga_id_compat_n
==
i
)
{
pp_printf
(
" FPGA '0x%"
PRIx32
"' not compatible with RT app: 0x%"
PRIx32
" 0x%"
PRIx32
" (git %"
PRIx32
")
\n
"
,
pp_printf
(
" FPGA '0x%"
PRIx32
"' not compatible with RT app: 0x%"
PRIx32
" 0x%"
PRIx32
" (git %"
PRIx32
")
\n
\r
"
,
_app
->
version
.
fpga_id
,
_app
->
version
.
rt_id
,
_app
->
version
.
rt_version
,
_app
->
version
.
git_version
);
return
-
1
;
}
pp_printf
(
" application id
\t
'0x%"
PRIx32
"'
\n
"
,
_app
->
version
.
rt_id
);
pp_printf
(
" application version
\t
'%"
PRId32
".%"
PRId32
"'
\n
"
,
pp_printf
(
" application id
\t
'0x%"
PRIx32
"'
\n
\r
"
,
_app
->
version
.
rt_id
);
pp_printf
(
" application version
\t
'%"
PRId32
".%"
PRId32
"'
\n
\r
"
,
RT_VERSION_MAJ
(
_app
->
version
.
rt_version
),
RT_VERSION_MIN
(
_app
->
version
.
rt_version
));
pp_printf
(
" source code id
\t
'0x%"
PRIx32
"'
\n
"
,
_app
->
version
.
git_version
);
pp_printf
(
" source code id
\t
'0x%"
PRIx32
"'
\n
\r
"
,
_app
->
version
.
git_version
);
/* Purge all slots */
for
(
i
=
0
;
i
<
_app
->
n_mq
;
++
i
)
{
mq_writel
(
!!
(
_app
->
mq
[
i
].
flags
&
RT_MQ_FLAGS_REMOTE
),
...
...
@@ -483,15 +483,15 @@ int rt_init(struct rt_application *app)
}
#ifdef LIBRT_DEBUG
pp_printf
(
"Exported Variables"
);
pp_printf
(
"Exported Variables
\n\r
"
);
for
(
i
=
0
;
i
<
_app
->
n_variables
;
++
i
)
pp_printf
(
"[%d] addr 0x%x | mask 0x%x | off %d
\n
"
,
i
,
pp_printf
(
"[%d] addr 0x%x | mask 0x%x | off %d
\n
\r
"
,
i
,
_app
->
variables
[
i
].
addr
,
_app
->
variables
[
i
].
mask
,
_app
->
variables
[
i
].
offset
);
pp_printf
(
"Exported Structures"
);
pp_printf
(
"Exported Structures
\n\r
"
);
for
(
i
=
0
;
i
<
_app
->
n_structures
;
++
i
)
pp_printf
(
"[%d] addr %p | len %d
\n
"
,
i
,
pp_printf
(
"[%d] addr %p | len %d
\n
\r
"
,
i
,
_app
->
structures
[
i
].
struct_ptr
,
_app
->
structures
[
i
].
len
);
#endif
...
...
Write
Preview
Markdown
is supported
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