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
05f17114
Commit
05f17114
authored
Apr 27, 2018
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
global compilation fixes (sorry)
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
5136d4ad
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
35 additions
and
47 deletions
+35
-47
fw-ac.c
demos/alarm_clock/firmware/fw-01/fw-ac.c
+0
-1
fw-svec-common.h
...mc-svec-carrier/software/firmware/common/fw-svec-common.h
+1
-1
svec-common.h
demos/fmc-svec-carrier/software/include/svec-common.h
+1
-1
libsvec.c
demos/fmc-svec-carrier/software/lib/libsvec.c
+7
-14
fw-hello.c
demos/hello_world/firmware/fw-01/fw-hello.c
+1
-1
mockturtle-framework.c
software/rt/framework/mockturtle-framework.c
+5
-7
mockturtle-rt.h
software/rt/lib/mockturtle-rt.h
+1
-1
cpu-loop.c
tests/firmware/cpu-loop/cpu-loop.c
+0
-2
hmq-async-send.c
tests/firmware/hmq-async-send/hmq-async-send.c
+3
-3
hmq-purge.c
tests/firmware/hmq-purge/hmq-purge.c
+8
-8
hmq-sync.c
tests/firmware/hmq-sync/hmq-sync.c
+3
-3
serial.c
tests/firmware/serial/serial.c
+1
-1
sim-verif.c
tests/firmware/sim-verif/sim-verif.c
+4
-4
No files found.
demos/alarm_clock/firmware/fw-01/fw-ac.c
View file @
05f17114
...
...
@@ -4,7 +4,6 @@
* License: GPLv3
*/
#include <mockturtle-rt-smem.h>
#include <mockturtle-framework.h>
static
unsigned
int
iteration
;
...
...
demos/fmc-svec-carrier/software/firmware/common/fw-svec-common.h
View file @
05f17114
...
...
@@ -5,7 +5,7 @@
#ifndef __FW_SVEC_COMMON_H__
#define __FW_SVEC_COMMON_H__
#include <mockturtle-rt
-smem
.h>
#include <mockturtle-rt.h>
#include <svec-common.h>
extern
volatile
int
autosvec_run
;
...
...
demos/fmc-svec-carrier/software/include/svec-common.h
View file @
05f17114
...
...
@@ -37,7 +37,7 @@ enum trtl_fw_buffer_index {
/* Command and log message IDs */
enum
rt_action_recv_svec
{
SVEC_ID_LED_SET
=
__RT_ACTION_RECV_STANDARD_NUMBER
,
SVEC_ID_LED_SET
=
0
,
SVEC_ID_LEMO_SET
,
SVEC_ID_LEMO_DIR_SET
,
SVEC_ID_STATE_GET
,
...
...
demos/fmc-svec-carrier/software/lib/libsvec.c
View file @
05f17114
...
...
@@ -14,13 +14,6 @@
#include <libmockturtle.h>
#include <libsvec-internal.h>
static
const
struct
trtl_proto_header
hdr_tmpl
=
{
.
rt_app_id
=
0
,
.
slot_io
=
(
SVEC_HMQ_IN
<<
4
)
|
(
SVEC_HMQ_OUT
&
0xF
),
};
const
char
*
svec_errors
[]
=
{
"Received an invalid answer from white-rabbit-node-code CPU"
,
"Real-Time application does not acknowledge"
,
...
...
@@ -229,16 +222,16 @@ int svec_version(struct svec_node *dev, struct trtl_fw_version *version)
{
struct
svec_desc
*
svec
=
(
struct
svec_desc
*
)
dev
;
return
trtl_fw_version
_get
(
svec
->
trtl
,
SVEC_CPU_MANUAL
,
SVEC_CPU_MANUAL_HMQ
,
version
);
return
trtl_fw_version
(
svec
->
trtl
,
SVEC_CPU_MANUAL
,
SVEC_CPU_MANUAL_HMQ
,
version
);
}
int
svec_test_struct_get
(
struct
svec_node
*
dev
,
struct
svec_structure
*
test
)
{
struct
svec_desc
*
svec
=
(
struct
svec_desc
*
)
dev
;
struct
trtl_
structure_
tlv
tlv
=
{
.
index
=
SVEC_BUF_TEST
,
struct
trtl_tlv
tlv
=
{
.
type
=
SVEC_BUF_TEST
,
.
size
=
sizeof
(
struct
svec_structure
),
.
buf
=
test
,
};
...
...
@@ -251,8 +244,8 @@ int svec_test_struct_get(struct svec_node *dev, struct svec_structure *test)
int
svec_test_struct_set
(
struct
svec_node
*
dev
,
struct
svec_structure
*
test
)
{
struct
svec_desc
*
svec
=
(
struct
svec_desc
*
)
dev
;
struct
trtl_
structure_
tlv
tlv
=
{
.
index
=
SVEC_BUF_TEST
,
struct
trtl_tlv
tlv
=
{
.
type
=
SVEC_BUF_TEST
,
.
size
=
sizeof
(
struct
svec_structure
),
.
buf
=
test
,
};
...
...
demos/hello_world/firmware/fw-01/fw-hello.c
View file @
05f17114
#include <mockturtle-rt
-serial
.h>
#include <mockturtle-rt.h>
int
main
()
{
...
...
software/rt/framework/mockturtle-framework.c
View file @
05f17114
...
...
@@ -346,14 +346,12 @@ int trtl_fw_mq_action_dispatch(enum trtl_mq_type type, unsigned int idx_mq)
struct
trtl_msg
msg
;
int
err
=
0
;
if
(
type
==
TRTL_RMQ
)
return
-
EPERM
;
/* not supported yet */
/* Check if we have a pending message */
if
(
type
==
TRTL_HMQ
)
{
if
(
!
(
hmq_poll_in
()
&
(
1
<<
idx_mq
)))
return
-
EAGAIN
;
}
else
{
if
(
!
(
rmq_poll_in
()
&
(
1
<<
idx_mq
)))
return
-
EAGAIN
;
}
if
(
!
(
mq_poll_in
(
type
)
&
(
1
<<
idx_mq
)))
return
-
EAGAIN
;
/* Map the message */
mq_map_in_message
(
type
,
idx_mq
,
&
msg
);
...
...
software/rt/lib/mockturtle-rt.h
View file @
05f17114
...
...
@@ -285,7 +285,7 @@ static inline void trtl_notify(unsigned int id)
static
inline
void
trtl_notify_user
(
unsigned
int
id
)
{
if
(
id
<
__TRTL_CPU_NOTIFY_MAX
)
{
pr_error
(
"%s invalid user id %d. Replaced with
\r\n
"
,
pr_error
(
"%s invalid user id %d. Replaced with
%d
\r\n
"
,
__func__
,
id
,
TRTL_CPU_NOTIFY_APPLICATION
);
id
=
TRTL_CPU_NOTIFY_APPLICATION
;
}
...
...
tests/firmware/cpu-loop/cpu-loop.c
View file @
05f17114
#include <mockturtle-rt-serial.h>
int
main
()
{
int
sum
=
0
;
...
...
tests/firmware/hmq-async-send/hmq-async-send.c
View file @
05f17114
...
...
@@ -20,7 +20,7 @@ int main()
max_wait_cycle
=
0xFFFF
;
while
(
1
)
{
/* Wait incoming message */
while
((
hmq_poll_in
(
)
&
wait
)
!=
wait
)
{
while
((
mq_poll_in
(
TRTL_HMQ
)
&
wait
)
!=
wait
)
{
if
(
--
max_wait_cycle
==
0
)
{
pr_error
(
"
\t
NO MESSAGE PENDING h:%d, cnt:0x%x
\r\n
"
,
hmq
,
count
);
...
...
@@ -30,13 +30,13 @@ int main()
/* validate message */
if
(
hdr
->
len
!=
1
||
msg
[
0
]
!=
count
)
{
pr_error
(
"
\t
h: %d, l:%
l
d, d[0]:0x%lx, cnt:0x%x
\r\n
"
,
pr_error
(
"
\t
h: %d, l:%d, d[0]:0x%lx, cnt:0x%x
\r\n
"
,
hmq
,
hdr
->
len
,
msg
[
0
],
count
);
mq_discard
(
TRTL_HMQ
,
hmq
);
return
-
1
;
}
if
(
msg
[
1
]
<
count
)
{
pr_error
(
"
\t
h:%d, l:%
l
d d[1]:0x%lx, cnt:0x%x
\r\n
"
,
pr_error
(
"
\t
h:%d, l:%d d[1]:0x%lx, cnt:0x%x
\r\n
"
,
hmq
,
hdr
->
len
,
msg
[
1
],
count
);
mq_discard
(
TRTL_HMQ
,
hmq
);
return
-
1
;
...
...
tests/firmware/hmq-purge/hmq-purge.c
View file @
05f17114
...
...
@@ -10,23 +10,23 @@ int main()
cpu
=
0
;
for
(
hmq
=
0
;
hmq
<
cfgrom
->
n_hmq
[
cpu
];
++
hmq
)
{
if
((
hmq_poll_in
(
)
&
(
1
<<
hmq
))
!=
(
1
<<
hmq
))
{
pr_error
(
"HMQ-%d after poll: 0x%
lx
\r\n
"
,
hmq
,
hmq_poll_in
(
));
if
((
mq_poll_in
(
TRTL_HMQ
)
&
(
1
<<
hmq
))
!=
(
1
<<
hmq
))
{
pr_error
(
"HMQ-%d after poll: 0x%
"
PRIx32
"
\r\n
"
,
hmq
,
mq_poll_in
(
TRTL_HMQ
));
return
-
1
;
}
mq_purge
(
TRTL_HMQ
,
hmq
);
if
((
hmq_poll_in
(
)
&
(
1
<<
hmq
))
==
(
1
<<
hmq
))
{
pr_error
(
"HMQ-%d after poll: 0x%
lx
\r\n
"
,
hmq
,
hmq_poll_in
(
));
if
((
mq_poll_in
(
TRTL_HMQ
)
&
(
1
<<
hmq
))
==
(
1
<<
hmq
))
{
pr_error
(
"HMQ-%d after poll: 0x%
"
PRIx32
"
\r\n
"
,
hmq
,
mq_poll_in
(
TRTL_HMQ
));
return
-
1
;
}
}
if
(
hmq_poll_in
(
)
!=
0
)
{
pr_error
(
"END poll: 0x%
lx
\r\n
"
,
hmq_poll_in
(
));
if
(
mq_poll_in
(
TRTL_HMQ
)
!=
0
)
{
pr_error
(
"END poll: 0x%
"
PRIx32
"
\r\n
"
,
mq_poll_in
(
TRTL_HMQ
));
return
-
1
;
}
...
...
tests/firmware/hmq-sync/hmq-sync.c
View file @
05f17114
...
...
@@ -23,7 +23,7 @@ int main()
max_wait_cycle
=
0xFFFFFFFF
;
while
(
1
)
{
/* Wait incoming message */
while
((
hmq_poll_in
(
)
&
wait
)
!=
wait
)
{
while
((
mq_poll_in
(
TRTL_HMQ
)
&
wait
)
!=
wait
)
{
if
(
--
max_wait_cycle
==
0
)
{
pr_error
(
"
\t
NO MESSAGE PENDING h:%d, cnt:0x%x
\r\n
"
,
hmq
,
count
);
...
...
@@ -33,13 +33,13 @@ int main()
/* validate message */
if
(
hdr_r
->
len
!=
1
||
msg_r
[
0
]
!=
count
)
{
pr_error
(
"
\t
h: %d, l:%
l
d, d[0]:0x%lx, cnt:0x%x
\r\n
"
,
pr_error
(
"
\t
h: %d, l:%d, d[0]:0x%lx, cnt:0x%x
\r\n
"
,
hmq
,
hdr_r
->
len
,
msg_r
[
0
],
count
);
mq_discard
(
TRTL_HMQ
,
hmq
);
return
-
1
;
}
if
(
msg_r
[
1
]
<
count
)
{
pr_error
(
"
\t
h:%d, l:%
l
d d[1]:0x%lx, cnt:0x%x
\r\n
"
,
pr_error
(
"
\t
h:%d, l:%d d[1]:0x%lx, cnt:0x%x
\r\n
"
,
hmq
,
hdr_r
->
len
,
msg_r
[
1
],
count
);
mq_discard
(
TRTL_HMQ
,
hmq
);
return
-
1
;
...
...
tests/firmware/serial/serial.c
View file @
05f17114
#include <mockturtle-rt
-serial
.h>
#include <mockturtle-rt.h>
int
main
()
{
...
...
tests/firmware/sim-verif/sim-verif.c
View file @
05f17114
...
...
@@ -65,7 +65,7 @@ test_hmq(void)
mq_send
(
TRTL_HMQ
,
0
);
// Wait for answer
while
((
hmq_poll_in
(
)
&
1
)
==
0
)
while
((
mq_poll_in
(
TRTL_HMQ
)
&
1
)
==
0
)
;
if
(
counts
[
cpu
]
!=
v
+
1
)
failed
(
'H'
);
...
...
@@ -80,7 +80,7 @@ test_hmq(void)
failed
(
'K'
);
mq_discard
(
TRTL_HMQ
,
0
);
if
((
hmq_poll_in
(
)
&
1
)
!=
0
)
if
((
mq_poll_in
(
TRTL_HMQ
)
&
1
)
!=
0
)
failed
(
'k'
);
}
...
...
@@ -103,7 +103,7 @@ test_rmq(void)
mq_send
(
TRTL_RMQ
,
0
);
// Wait for answer
while
((
rmq_poll_in
(
)
&
1
)
==
0
)
while
((
mq_poll_in
(
TRTL_RMQ
)
&
1
)
==
0
)
;
// Read answer
...
...
@@ -116,7 +116,7 @@ test_rmq(void)
failed
(
'r'
);
mq_discard
(
TRTL_RMQ
,
0
);
if
((
rmq_poll_in
(
)
&
1
)
!=
0
)
if
((
mq_poll_in
(
TRTL_RMQ
)
&
1
)
!=
0
)
failed
(
's'
);
}
...
...
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