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
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
hdl-core-lib
mock-turtle
Commits
8205f13f
Commit
8205f13f
authored
Apr 20, 2018
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw:rt: now we support byte addressing for all memories
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
6928903b
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
10 additions
and
39 deletions
+10
-39
mt_defconfig
demos/alarm_clock/firmware/fw-01/configs/mt_defconfig
+0
-1
mt_defconfig
demos/data_generator/firmware/fw-01/configs/mt_defconfig
+0
-1
mt_defconfig
...svec-carrier/software/firmware/fw-02/configs/mt_defconfig
+0
-1
mt_defconfig
...hello_world_framework/firmware/fw-01/configs/mt_defconfig
+0
-1
Kconfig.mt
software/rt/Kconfig.mt
+0
-8
mockturtle-frm-action.c
software/rt/framework/mockturtle-frm-action.c
+9
-8
mockturtle-frm-common.h
software/rt/framework/mockturtle-frm-common.h
+0
-1
mockturtle-frm-core.c
software/rt/framework/mockturtle-frm-core.c
+0
-17
mockturtle-frm-mqueue.c
software/rt/framework/mockturtle-frm-mqueue.c
+1
-1
No files found.
demos/alarm_clock/firmware/fw-01/configs/mt_defconfig
View file @
8205f13f
...
...
@@ -20,7 +20,6 @@ CONFIG_MOCKTURTLE_FRAMEWORK_ENABLE=y
CONFIG_MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE=y
CONFIG_MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE=y
# CONFIG_MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE is not set
CONFIG_MOCKTURTLE_FRAMEWORK_32BIT_ALIGN=y
#
# Mock Turtle library configuration
...
...
demos/data_generator/firmware/fw-01/configs/mt_defconfig
View file @
8205f13f
...
...
@@ -20,7 +20,6 @@ CONFIG_MOCKTURTLE_FRAMEWORK_ENABLE=y
CONFIG_MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE=y
CONFIG_MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE=y
CONFIG_MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE=y
CONFIG_MOCKTURTLE_FRAMEWORK_32BIT_ALIGN=y
#
# Mock Turtle library configuration
...
...
demos/fmc-svec-carrier/software/firmware/fw-02/configs/mt_defconfig
View file @
8205f13f
...
...
@@ -18,7 +18,6 @@ CONFIG_MOCKTURTLE_FRAMEWORK_ENABLE=y
CONFIG_MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE=y
CONFIG_MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE=y
CONFIG_MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE=y
# CONFIG_MOCKTURTLE_FRAMEWORK_32BIT_ALIGN is not set
#
# Mock Turtle library configuration
...
...
demos/hello_world_framework/firmware/fw-01/configs/mt_defconfig
View file @
8205f13f
...
...
@@ -20,7 +20,6 @@ CONFIG_MOCKTURTLE_FRAMEWORK_ENABLE=y
# CONFIG_MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE is not set
# CONFIG_MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE is not set
# CONFIG_MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE is not set
CONFIG_MOCKTURTLE_FRAMEWORK_32BIT_ALIGN=y
#
# Mock Turtle library configuration
...
...
software/rt/Kconfig.mt
View file @
8205f13f
...
...
@@ -31,14 +31,6 @@ config MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE
help
It enables the API for local buffers exchange with the host system.
config MOCKTURTLE_FRAMEWORK_32BIT_ALIGN
bool "Enable 32bit align in Mock Turtle framework"
depends on MOCKTURTLE_FRAMEWORK_ENABLE
default y
help
Enable this if Mock Turtle does not have byte addressing
support. If unsure: "yes".
comment "Mock Turtle library configuration"
config MOCKTURTLE_LIBRARY_PRINT_ENABLE
...
...
software/rt/framework/mockturtle-frm-action.c
View file @
8205f13f
...
...
@@ -36,8 +36,8 @@ int rt_version_getter(struct trtl_proto_header *hin, void *pin,
hout
->
msg_id
=
TRTL_MSG_ID_VERS_ANS
;
hout
->
len
=
sizeof
(
struct
trtl_rt_version
)
/
4
;
rt_
memcpy
(
dout
,
(
uint32_t
*
)
&
_app
->
version
,
sizeof
(
struct
trtl_rt_version
));
memcpy
(
dout
,
(
uint32_t
*
)
&
_app
->
version
,
sizeof
(
struct
trtl_rt_version
));
return
0
;
}
...
...
@@ -69,8 +69,8 @@ int rt_buffer_setter(struct trtl_proto_header *hin, void *pin,
index
,
size
,
_app
->
buffers
[
index
].
buf
);
if
(
_app
->
buffers
[
index
].
len
==
size
)
{
rt_
memcpy
((
uint32_t
*
)
_app
->
buffers
[
index
].
buf
,
&
din
[
offset
],
size
);
memcpy
((
uint32_t
*
)
_app
->
buffers
[
index
].
buf
,
&
din
[
offset
],
size
);
}
else
{
pr_error
(
"%s:%d structure %d len not correct %"
PRId32
" != %d
\n\r
"
,
__func__
,
__LINE__
,
index
,
...
...
@@ -117,9 +117,9 @@ int rt_buffer_getter(struct trtl_proto_header *hin, void *pin,
index
,
size
,
_app
->
buffers
[
index
].
buf
);
if
(
_app
->
buffers
[
index
].
len
==
size
)
{
rt_
memcpy
(
&
dout
[
offset
],
(
uint32_t
*
)
_app
->
buffers
[
index
].
buf
,
size
);
memcpy
(
&
dout
[
offset
],
(
uint32_t
*
)
_app
->
buffers
[
index
].
buf
,
size
);
}
else
{
pr_error
(
"%s: structure %d len not correct %"
PRId32
" != %d
\n\r
"
,
__func__
,
index
,
_app
->
buffers
[
index
].
len
,
size
);
...
...
@@ -294,7 +294,8 @@ static inline int rt_action_run(struct trtl_proto_header *hin, void *pin)
/* Do not write directly the header on the buffer because it does not
work for fields size different than 32bit */
pout
=
rt_proto_payload_get
((
void
*
)
out_buf
.
data
);
rt_memcpy
((
uint32_t
*
)
&
hout
,
(
uint32_t
*
)
hin
,
sizeof
(
struct
trtl_proto_header
));
memcpy
((
uint32_t
*
)
&
hout
,
(
uint32_t
*
)
hin
,
sizeof
(
struct
trtl_proto_header
));
err
=
action
(
hin
,
pin
,
&
hout
,
pout
);
if
(
err
)
...
...
software/rt/framework/mockturtle-frm-common.h
View file @
8205f13f
...
...
@@ -51,7 +51,6 @@ extern struct rt_application *_app;
extern
int
rt_init
(
struct
rt_application
*
app
);
extern
void
rt_get_time
(
uint32_t
*
seconds
,
uint32_t
*
cycles
);
extern
void
rt_memcpy
(
uint32_t
*
dest
,
uint32_t
*
src
,
size_t
n
);
#endif
/**@}*/
software/rt/framework/mockturtle-frm-core.c
View file @
8205f13f
...
...
@@ -12,23 +12,6 @@
uint32_t
msg_seq
=
0
;
struct
rt_application
*
_app
;
/**
* Some Mock Turtle version support only 32bit addressing.
* This memcpy implementation perform a 32bit aligned copy
* @param[out] dest destination buffer
* @param[in] src source buffer
* @param[in] n number of bytes
*/
void
rt_memcpy
(
uint32_t
*
dest
,
uint32_t
*
src
,
size_t
n
)
{
int
i
;
for
(
i
=
0
;
i
<
n
/
4
;
++
i
)
dest
[
i
]
=
src
[
i
];
}
/**
* It get the current time from the internal WRNC timer
* @param[out] seconds
...
...
software/rt/framework/mockturtle-frm-mqueue.c
View file @
8205f13f
...
...
@@ -85,7 +85,7 @@ void trtl_rt_mq_send_buf(unsigned int mq_idx, uint8_t msg_id,
};
void
*
buf
=
_app
->
mq
[
mq_idx
].
buf
;
rt_
memcpy
(
rt_proto_payload_get
(
buf
),
data
,
n
);
memcpy
(
rt_proto_payload_get
(
buf
),
data
,
n
);
rt_proto_header_set
(
buf
,
&
hdr
);
trtl_rt_mq_send
(
mq_idx
,
(
sizeof
(
struct
trtl_proto_header
)
/
4
)
+
...
...
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