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
998c0cf5
Commit
998c0cf5
authored
Feb 15, 2017
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demos: add profiling demo
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
948b709c
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
191 additions
and
0 deletions
+191
-0
Makefile
demos/Makefile
+1
-0
Makefile
demos/profiling/Makefile
+17
-0
Makefile
demos/profiling/firmware/Makefile
+17
-0
Makefile
demos/profiling/firmware/fw-01/Makefile
+21
-0
fw-profile.c
demos/profiling/firmware/fw-01/fw-profile.c
+21
-0
Makefile
demos/profiling/firmware/fw-02/Makefile
+21
-0
fw-profile.c
demos/profiling/firmware/fw-02/fw-profile.c
+19
-0
Makefile
demos/profiling/firmware/fw-03/Makefile
+21
-0
fw-profile.c
demos/profiling/firmware/fw-03/fw-profile.c
+53
-0
No files found.
demos/Makefile
View file @
998c0cf5
...
...
@@ -3,6 +3,7 @@ DIRS := hello_world
DIRS
+=
hello_world_framework
DIRS
+=
alarm_clock
DIRS
+=
demo_generator
DIRS
+=
profiling
all clean modules install modules_install
:
$(DIRS)
...
...
demos/profiling/Makefile
0 → 100644
View file @
998c0cf5
-include
Makefile.specific
DIRS
:=
firmware
all clean modules install modules_install
:
$(DIRS)
clean
:
TARGET = clean
modules
:
TARGET = modules
install
:
TARGET = install
modules_install
:
TARGET = modules_install
$(DIRS)
:
$(MAKE)
-C
$@
$(TARGET)
.PHONY
:
all clean modules install modules_install
.PHONY
:
$(DIRS)
demos/profiling/firmware/Makefile
0 → 100644
View file @
998c0cf5
-include
Makefile.specific
DIRS
:=
fw-01
DIRS
+=
fw-02
DIRS
+=
fw-03
all clean modules install modules_install
:
$(DIRS)
clean
:
TARGET = clean
modules
:
TARGET = modules
install
:
TARGET = install
modules_install
:
TARGET = modules_install
$(DIRS)
:
$(MAKE)
-C
$@
$(TARGET)
.PHONY
:
all clean modules install modules_install
.PHONY
:
$(DIRS)
demos/profiling/firmware/fw-01/Makefile
0 → 100755
View file @
998c0cf5
OBJS
=
fw-profile.o
OBJS
+=
# add other object files that you need
OUTPUT
=
fw-profile
TRTL
?=
../../../../
CFLAGS_OPT
=
-O0
EXTRA_CFLAGS
+=
-DFPGA_APPLICATION_ID
=
0x0
EXTRA_CFLAGS
+=
-DRT_APPLICATION_ID
=
0x0
MOCKTURTLE_LIBRARY_PRINT_ENABLE
:=
1
MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE
:=
1
# Firmware Libray configuration
MOCKTURTLE_FRAMEWORK_ENABLE
:=
0
MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE
:=
0
MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE
:=
0
MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE
:=
0
MOCKTURTLE_FRAMEWORK_32BIT_ALIGN
:=
0
include
$(TRTL)/rt/Makefile
demos/profiling/firmware/fw-01/fw-profile.c
0 → 100644
View file @
998c0cf5
#include <mockturtle-rt-serial.h>
#include <mockturtle-rt-profile.h>
int
main
()
{
pr_debug
(
"%s:%d
\n\r
"
,
__func__
,
__LINE__
);
trtl_tpu_profile_start
(
1
);
pr_debug
(
"%s:%d
\n\r
"
,
__func__
,
__LINE__
);
trtl_tpu_probe_trigger
(
2
);
pr_debug
(
"%s:%d
\n\r
"
,
__func__
,
__LINE__
);
trtl_tpu_probe_trigger
(
3
);
pr_debug
(
"%s:%d
\n\r
"
,
__func__
,
__LINE__
);
trtl_tpu_probe_trigger
(
4
);
pr_debug
(
"%s:%d
\n\r
"
,
__func__
,
__LINE__
);
trtl_tpu_probe_trigger
(
5
);
pr_debug
(
"%s:%d
\n\r
"
,
__func__
,
__LINE__
);
trtl_tpu_profile_stop
(
6
);
pr_debug
(
"%s:%d
\n\r
"
,
__func__
,
__LINE__
);
return
0
;
}
demos/profiling/firmware/fw-02/Makefile
0 → 100755
View file @
998c0cf5
OBJS
=
fw-profile.o
OBJS
+=
# add other object files that you need
OUTPUT
=
fw-profile
TRTL
?=
../../../../
CFLAGS_OPT
=
-O0
EXTRA_CFLAGS
+=
-DFPGA_APPLICATION_ID
=
0x0
EXTRA_CFLAGS
+=
-DRT_APPLICATION_ID
=
0x0
MOCKTURTLE_LIBRARY_PRINT_ENABLE
:=
1
MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE
:=
1
# Firmware Libray configuration
MOCKTURTLE_FRAMEWORK_ENABLE
:=
0
MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE
:=
0
MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE
:=
0
MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE
:=
0
MOCKTURTLE_FRAMEWORK_32BIT_ALIGN
:=
0
include
$(TRTL)/rt/Makefile
demos/profiling/firmware/fw-02/fw-profile.c
0 → 100644
View file @
998c0cf5
#include <mockturtle-rt-serial.h>
#include <mockturtle-rt-profile.h>
int
main
()
{
int
i
;
pr_debug
(
"%s:%d
\n\r
"
,
__func__
,
__LINE__
);
trtl_tpu_profile_start
(
1
);
for
(
i
=
0
;
i
<
10
;
++
i
)
{
trtl_tpu_probe_trigger
(
2
);
pr_debug
(
"%s:%d
\n\r
"
,
__func__
,
__LINE__
);
trtl_tpu_probe_trigger
(
3
);
}
trtl_tpu_profile_stop
(
4
);
pr_debug
(
"%s:%d
\n\r
"
,
__func__
,
__LINE__
);
return
0
;
}
demos/profiling/firmware/fw-03/Makefile
0 → 100755
View file @
998c0cf5
OBJS
=
fw-profile.o
OBJS
+=
# add other object files that you need
OUTPUT
=
fw-profile
TRTL
?=
../../../../
CFLAGS_OPT
=
-O0
EXTRA_CFLAGS
+=
-DFPGA_APPLICATION_ID
=
0x0
EXTRA_CFLAGS
+=
-DRT_APPLICATION_ID
=
0x0
MOCKTURTLE_LIBRARY_PRINT_ENABLE
:=
1
MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE
:=
1
# Firmware Libray configuration
MOCKTURTLE_FRAMEWORK_ENABLE
:=
0
MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE
:=
0
MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE
:=
0
MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE
:=
0
MOCKTURTLE_FRAMEWORK_32BIT_ALIGN
:=
0
include
$(TRTL)/rt/Makefile
demos/profiling/firmware/fw-03/fw-profile.c
0 → 100644
View file @
998c0cf5
#include <mockturtle-rt-serial.h>
#include <mockturtle-rt-profile.h>
#define PROFILE_PROBE_ID0 0
#define PROFILE_PROBE_ID1 1
static
int
num
=
0
;
static
void
profile_short
(
void
)
{
int
i
=
0
;
pr_debug
(
"%s:%d
\n\r
"
,
__func__
,
__LINE__
);
trtl_tpu_probe_trigger
(
3
);
/* start */
for
(
i
=
0
;
i
<
100
;
++
i
)
num
*=
2
;
trtl_tpu_probe_trigger
(
4
);
/* end */
pr_debug
(
"%s:%d
\n\r
"
,
__func__
,
__LINE__
);
}
static
void
profile_long
(
void
)
{
int
i
=
0
;
pr_debug
(
"%s:%d
\n\r
"
,
__func__
,
__LINE__
);
trtl_tpu_probe_trigger
(
5
);
/* start */
for
(
i
=
0
;
i
<
10000
;
++
i
)
{
num
/=
2
;
num
++
;
}
trtl_tpu_probe_trigger
(
6
);
/* end */
pr_debug
(
"%s:%d
\n\r
"
,
__func__
,
__LINE__
);
}
static
void
profile_func
(
void
)
{
pr_debug
(
"%s:%d
\n\r
"
,
__func__
,
__LINE__
);
trtl_tpu_profile_start
(
1
);
profile_short
();
profile_long
();
trtl_tpu_profile_stop
(
2
);
pr_debug
(
"%s:%d
\n\r
"
,
__func__
,
__LINE__
);
}
int
main
()
{
pr_debug
(
"%s:%d
\n\r
"
,
__func__
,
__LINE__
);
profile_func
();
pr_debug
(
"%s:%d
\n\r
"
,
__func__
,
__LINE__
);
return
0
;
}
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