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
8d72ad93
Commit
8d72ad93
authored
Feb 07, 2019
by
Federico Vaga
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/build' into develop
parents
ec65f08d
988914c1
Hide whitespace changes
Inline
Side-by-side
Showing
43 changed files
with
243 additions
and
198 deletions
+243
-198
Makefile
demos/alarm_clock/firmware/fw-01/Makefile
+3
-5
TBuild
demos/alarm_clock/firmware/fw-01/TBuild
+3
-0
Makefile
demos/data_generator/firmware/fw-01/Makefile
+3
-5
TBuild
demos/data_generator/firmware/fw-01/TBuild
+3
-0
Makefile
demos/fmc-spec-carrier/software/firmware/fw-01/Makefile
+3
-15
TBuild
demos/fmc-spec-carrier/software/firmware/fw-01/TBuild
+13
-0
Makefile
demos/fmc-spec-carrier/software/firmware/fw-02/Makefile
+3
-16
TBuild
demos/fmc-spec-carrier/software/firmware/fw-02/TBuild
+14
-0
Makefile
demos/fmc-svec-carrier/software/firmware/fw-01/Makefile
+3
-15
TBuild
demos/fmc-svec-carrier/software/firmware/fw-01/TBuild
+13
-0
Makefile
demos/fmc-svec-carrier/software/firmware/fw-02/Makefile
+3
-16
TBuild
demos/fmc-svec-carrier/software/firmware/fw-02/TBuild
+14
-0
Makefile
demos/hello_world/firmware/fw-01/Makefile
+3
-5
TBuild
demos/hello_world/firmware/fw-01/TBuild
+3
-0
Makefile
demos/hello_world_framework/firmware/fw-01/Makefile
+3
-5
TBuild
demos/hello_world_framework/firmware/fw-01/TBuild
+3
-0
index-fw.rst
doc/software/index-fw.rst
+27
-13
Makefile
software/firmware/Makefile
+48
-34
Makefile
software/include/hw/Makefile
+1
-1
Makefile
software/lib/Makefile
+3
-2
Makefile
software/tools/Makefile
+6
-5
Makefile
tests/firmware/config_rom/Makefile
+3
-5
TBuild
tests/firmware/config_rom/TBuild
+3
-0
Makefile
tests/firmware/cpu-byte-addressing/Makefile
+3
-5
TBuild
tests/firmware/cpu-byte-addressing/TBuild
+3
-0
Makefile
tests/firmware/cpu-loop/Makefile
+3
-5
TBuild
tests/firmware/cpu-loop/TBuild
+3
-0
Makefile
tests/firmware/cpu-notify/Makefile
+3
-5
TBuild
tests/firmware/cpu-notify/TBuild
+3
-0
Makefile
tests/firmware/hmq-async-recv/Makefile
+3
-5
TBuild
tests/firmware/hmq-async-recv/TBuild
+3
-0
Makefile
tests/firmware/hmq-async-send/Makefile
+3
-5
TBuild
tests/firmware/hmq-async-send/TBuild
+3
-0
Makefile
tests/firmware/hmq-purge/Makefile
+3
-5
TBuild
tests/firmware/hmq-purge/TBuild
+3
-0
Makefile
tests/firmware/rmq-udp-send/Makefile
+3
-9
TBuild
tests/firmware/rmq-udp-send/TBuild
+5
-0
Makefile
tests/firmware/rt-frm/Makefile
+3
-5
TBuild
tests/firmware/rt-frm/TBuild
+3
-0
Makefile
tests/firmware/serial/Makefile
+3
-7
TBuild
tests/firmware/serial/TBuild
+3
-0
Makefile
tests/firmware/sim-verif/Makefile
+3
-5
TBuild
tests/firmware/sim-verif/TBuild
+3
-0
No files found.
demos/alarm_clock/firmware/fw-01/Makefile
View file @
8d72ad93
OBJS
=
fw-ac.o
OBJS
+=
# add other object files that you need
OUTPUT
=
fw-ac
TRTL
?=
../../../../
TRTL
?=
../../../../
TRTL_
SW
=
$(TRTL)
/soft
ware
TRTL_
FW
=
$(TRTL)
/software/firm
ware
include
$(TRTL_SW)/firmware/Makefile
all clean
:
$(MAKE)
-C
$(TRTL_FW)
M
=
$(
shell
/bin/pwd
)
$@
demos/alarm_clock/firmware/fw-01/TBuild
0 → 100644
View file @
8d72ad93
OBJS = fw-ac.o
OBJS += # add other object files that you need
OUTPUT = fw-ac
demos/data_generator/firmware/fw-01/Makefile
View file @
8d72ad93
OBJS
=
fw-dg.o
OBJS
+=
# add other object files that you need
OUTPUT
=
fw-dg
TRTL
?=
../../../../
TRTL
?=
../../../../
TRTL_
SW
=
$(TRTL)
/soft
ware
TRTL_
FW
=
$(TRTL)
/software/firm
ware
include
$(TRTL_SW)/firmware/Makefile
all clean
:
$(MAKE)
-C
$(TRTL_FW)
M
=
$(
shell
/bin/pwd
)
$@
demos/data_generator/firmware/fw-01/TBuild
0 → 100644
View file @
8d72ad93
OBJS = fw-dg.o
OBJS += # add other object files that you need
OUTPUT = fw-dg
demos/fmc-spec-carrier/software/firmware/fw-01/Makefile
View file @
8d72ad93
include
../../../project.mk
OBJS
=
fw-spec.o
OBJS
+=
common/fw-spec-smem-code.o
OBJDIR
+=
common
OUTPUT
=
fw-spec-1
TRTL
?=
../../../../../
TRTL
?=
../../../../../
TRTL_SW
=
$(TRTL)
/software
TRTL_FW
=
$(TRTL)
/software/firmware
EXTRA_CFLAGS
+=
-I
../../include
EXTRA_CFLAGS
+=
-I
../common
EXTRA_CFLAGS
+=
-DFPGA_APPLICATION_ID
=
APPLICATION_ID
EXTRA_CFLAGS
+=
-DRT_APPLICATION_ID
=
$(RT_APPLICATION_ID_CPU1)
vpath
%.c
../
include
$(TRTL_SW)/firmware/Makefile
all clean
:
$(MAKE)
-C
$(TRTL_FW)
M
=
$(
shell
/bin/pwd
)
$@
demos/fmc-spec-carrier/software/firmware/fw-01/TBuild
0 → 100644
View file @
8d72ad93
include $(src)/../../../project.mk
OBJS = fw-spec.o
OBJS += common/fw-spec-smem-code.o
OBJDIR += common
OUTPUT = fw-spec-1
EXTRA_CFLAGS += -I$(src)/../../include
EXTRA_CFLAGS += -I$(src)/../common
EXTRA_CFLAGS += -DFPGA_APPLICATION_ID=APPLICATION_ID
EXTRA_CFLAGS += -DRT_APPLICATION_ID=$(RT_APPLICATION_ID_CPU1)
vpath %.c $(src)../
demos/fmc-spec-carrier/software/firmware/fw-02/Makefile
View file @
8d72ad93
include
../../../project.mk
OBJS
=
fw-spec.o
OBJS
+=
common/fw-spec-smem-code.o
OBJDIR
+=
common
OUTPUT
=
fw-spec-2
TRTL
?=
../../../../../
TRTL
?=
../../../../../
TRTL_SW
=
$(TRTL)
/software
TRTL_FW
=
$(TRTL)
/software/firmware
EXTRA_CFLAGS
+=
-I
../../include
EXTRA_CFLAGS
+=
-I
../common
EXTRA_CFLAGS
+=
-DFPGA_APPLICATION_ID
=
$(APPLICATION_ID)
EXTRA_CFLAGS
+=
-DRT_APPLICATION_ID
=
$(RT_APPLICATION_ID_CPU2)
EXTRA_CFLAGS
+=
-DLIBRT_DEBUG_VERBOSE
-DLIBRT_DEBUG
vpath
%.c
../
include
$(TRTL_SW)/firmware/Makefile
all clean
:
$(MAKE)
-C
$(TRTL_FW)
M
=
$(
shell
/bin/pwd
)
$@
demos/fmc-spec-carrier/software/firmware/fw-02/TBuild
0 → 100644
View file @
8d72ad93
include $(src)../../../project.mk
OBJS = fw-spec.o
OBJS += common/fw-spec-smem-code.o
OBJDIR += common
OUTPUT = fw-spec-2
EXTRA_CFLAGS += -I$(src)/../../include
EXTRA_CFLAGS += -I$(src)/../common
EXTRA_CFLAGS += -DFPGA_APPLICATION_ID=$(APPLICATION_ID)
EXTRA_CFLAGS += -DRT_APPLICATION_ID=$(RT_APPLICATION_ID_CPU2)
EXTRA_CFLAGS += -DLIBRT_DEBUG_VERBOSE -DLIBRT_DEBUG
vpath %.c $(src)/../
demos/fmc-svec-carrier/software/firmware/fw-01/Makefile
View file @
8d72ad93
include
../../../project.mk
OBJS
=
fw-svec.o
OBJS
+=
common/fw-svec-smem-code.o
OBJDIR
+=
common
OUTPUT
=
fw-svec-1
TRTL
?=
../../../../../
TRTL
?=
../../../../../
TRTL_SW
=
$(TRTL)
/software
TRTL_FW
=
$(TRTL)
/software/firmware
EXTRA_CFLAGS
+=
-I
../../include
EXTRA_CFLAGS
+=
-I
../common
EXTRA_CFLAGS
+=
-DFPGA_APPLICATION_ID
=
APPLICATION_ID
EXTRA_CFLAGS
+=
-DRT_APPLICATION_ID
=
$(RT_APPLICATION_ID_CPU1)
vpath
%.c
../
include
$(TRTL_SW)/firmware/Makefile
all clean
:
$(MAKE)
-C
$(TRTL_FW)
M
=
$(
shell
/bin/pwd
)
$@
demos/fmc-svec-carrier/software/firmware/fw-01/TBuild
0 → 100644
View file @
8d72ad93
include $(src)/../../../project.mk
OBJS = fw-svec.o
OBJS += common/fw-svec-smem-code.o
OBJDIR += common
OUTPUT = fw-svec-1
EXTRA_CFLAGS += -I$(src)/../../include
EXTRA_CFLAGS += -I$(src)/../common
EXTRA_CFLAGS += -DFPGA_APPLICATION_ID=APPLICATION_ID
EXTRA_CFLAGS += -DRT_APPLICATION_ID=$(RT_APPLICATION_ID_CPU1)
vpath %.c $(src)/../
demos/fmc-svec-carrier/software/firmware/fw-02/Makefile
View file @
8d72ad93
include
../../../project.mk
OBJS
=
fw-svec.o
OBJS
+=
common/fw-svec-smem-code.o
OBJDIR
+=
common
OUTPUT
=
fw-svec-2
TRTL
?=
../../../../../
TRTL
?=
../../../../../
TRTL_SW
=
$(TRTL)
/software
TRTL_FW
=
$(TRTL)
/software/firmware
EXTRA_CFLAGS
+=
-I
../../include
EXTRA_CFLAGS
+=
-I
../common
EXTRA_CFLAGS
+=
-DFPGA_APPLICATION_ID
=
$(APPLICATION_ID)
EXTRA_CFLAGS
+=
-DRT_APPLICATION_ID
=
$(RT_APPLICATION_ID_CPU2)
EXTRA_CFLAGS
+=
-DLIBRT_DEBUG_VERBOSE
-DLIBRT_DEBUG
vpath
%.c
../
include
$(TRTL_SW)/firmware/Makefile
all clean
:
$(MAKE)
-C
$(TRTL_FW)
M
=
$(
shell
/bin/pwd
)
$@
demos/fmc-svec-carrier/software/firmware/fw-02/TBuild
0 → 100644
View file @
8d72ad93
include $(src)/../../../project.mk
OBJS = fw-svec.o
OBJS += common/fw-svec-smem-code.o
OBJDIR += common
OUTPUT = fw-svec-2
EXTRA_CFLAGS += -I$(src)/../../include
EXTRA_CFLAGS += -I$(src)/../common
EXTRA_CFLAGS += -DFPGA_APPLICATION_ID=$(APPLICATION_ID)
EXTRA_CFLAGS += -DRT_APPLICATION_ID=$(RT_APPLICATION_ID_CPU2)
EXTRA_CFLAGS += -DLIBRT_DEBUG_VERBOSE -DLIBRT_DEBUG
vpath %.c $(src)/../
demos/hello_world/firmware/fw-01/Makefile
View file @
8d72ad93
OBJS
=
fw-hello.o
OBJS
+=
# add other object files that you need
OUTPUT
=
fw-hello
TRTL
?=
../../../../
TRTL
?=
../../../../
TRTL_
SW
=
$(TRTL)
/soft
ware
TRTL_
FW
=
$(TRTL)
/software/firm
ware
include
$(TRTL_SW)/firmware/Makefile
all clean
:
$(MAKE)
-C
$(TRTL_FW)
M
=
$(
shell
/bin/pwd
)
$@
demos/hello_world/firmware/fw-01/TBuild
0 → 100644
View file @
8d72ad93
OBJS = fw-hello.o
OBJS += # add other object files that you need
OUTPUT = fw-hello
demos/hello_world_framework/firmware/fw-01/Makefile
View file @
8d72ad93
OBJS
=
fw-hellofrm.o
OBJS
+=
# add other object files that you need
OUTPUT
=
fw-hellofrm
TRTL
?=
../../../../
TRTL
?=
../../../../
TRTL_
SW
=
$(TRTL)
/soft
ware
TRTL_
FW
=
$(TRTL)
/software/firm
ware
include
$(TRTL_SW)/firmware/Makefile
all clean
:
$(MAKE)
-C
$(TRTL_FW)
M
=
$(
shell
/bin/pwd
)
$@
demos/hello_world_framework/firmware/fw-01/TBuild
0 → 100644
View file @
8d72ad93
OBJS = fw-hellofrm.o
OBJS += # add other object files that you need
OUTPUT = fw-hellofrm
doc/software/index-fw.rst
View file @
8d72ad93
...
@@ -43,11 +43,10 @@ memory) or you need much better performances: don't use this framework.
...
@@ -43,11 +43,10 @@ memory) or you need much better performances: don't use this framework.
All the Mock Turtle firmware source code can be found in the directory
All the Mock Turtle firmware source code can be found in the directory
``/path/to/mockturtle/software/firmware/``.
``/path/to/mockturtle/software/firmware/``.
Mock Turtle has a generic ``Makefile`` that you should include in your
Mock Turtle has a generic building system which can be used to produce
``Makefile`` in order to import all the Mock Turtle building rules.::
Mock Turtle firmware applications. What you have to do is to prepare a
file named ``TBuild`` next to your firmware source files. In this file
TRTL ?= /path/to/mcokturtle/
you have to specify what to build, for example::
TRTL_SW = $(TRTL)/software
# Mandatory
# Mandatory
OBJS = source1.o
OBJS = source1.o
...
@@ -56,15 +55,10 @@ Mock Turtle has a generic ``Makefile`` that you should include in your
...
@@ -56,15 +55,10 @@ Mock Turtle has a generic ``Makefile`` that you should include in your
OUTPUT = firmware-name
OUTPUT = firmware-name
# Optional (prefer default when possible)
# Optional (prefer default when possible)
CFLAGS_OPT := -O1
EXTRA_CFLAGS :=
CFLAGS_DBG := -ggdb
EXTRA_CFLGAS :=
MOCKTURTLE_LDSCRIPT := myfirmware.ld
MOCKTURTLE_LDSCRIPT := myfirmware.ld
# INCLUDE GENERIC Makefile
Here the list of supported TBuild variables
include $(TRTL_SW)/firmware/Makefile
Here the list of supported Makefile environment variables
OBJS
OBJS
(Mandatory) List of object files to generate from sources with
(Mandatory) List of object files to generate from sources with
...
@@ -74,10 +68,30 @@ OBJS
...
@@ -74,10 +68,30 @@ OBJS
OUTPUT
OUTPUT
(Mandatory) Final binary name (the firmware).
(Mandatory) Final binary name (the firmware).
EXTRA_CFLAGS
(Optional) Additional compiler options.
MOCKTURTLE_LDSCRIPT
MOCKTURTLE_LDSCRIPT
(Optional
) Local path to the linker script.
(Optional) Local path to the linker script.
The default is the standard Mock Turtle linker script.
The default is the standard Mock Turtle linker script.
You can build such firmware application by calling ``make`` from the
application directory (where the ``TBuild`` file is) like this::
make -C <path-to-mockturtle-project>/software/firmware M=$PWD
Or alternatively, you can copy the following lines in a Makefile::
TRTL_FW = $(TRTL)/software/firmware
all clean:
$(MAKE) -C $(TRTL_FW) M=$(shell /bin/pwd) $@
Then, you will compile your application with the following command
from the application directory (where the ``TBuild`` file is)::
make TRTL=<path-to-mockturtle-project>
Memory resources on Mock Turtle are very limited and the full framework
Memory resources on Mock Turtle are very limited and the full framework
may take more space than needed. For this reason Mock Turtle has
may take more space than needed. For this reason Mock Turtle has
*Kconfig* support which allows you to interactivly enable/disable both
*Kconfig* support which allows you to interactivly enable/disable both
...
...
software/firmware/Makefile
View file @
8d72ad93
-include
Makefile.specific
src
:=
$(M)
/
-include
$(CURDIR)/.config
-include
$(src)/Makefile.specific
-include
$(src)/.config
include
$(src)/TBuild
# Validation
ifndef
OUTPUT
$(error
Missing
variable
OUTPUT)
else
build_output
=
$(src)
/
$(OUTPUT)
endif
ifndef
OBJS
$(error
Missing
variable
OBJS)
endif
# and don't touch the rest unless you know what you're doing.
# and don't touch the rest unless you know what you're doing.
INSTALL_PREFIX
?=
.
INSTALL_PREFIX
?=
.
...
@@ -7,11 +22,12 @@ PATH_COMMON_RT ?= .
...
@@ -7,11 +22,12 @@ PATH_COMMON_RT ?= .
PATH_COMMON_H
?=
../include
PATH_COMMON_H
?=
../include
TRTL
?=
../../
TRTL
?=
../../
TRTL_SW
?=
$(TRTL)
/software
TRTL_SW
?=
$(TRTL)
/software
TRTL_FW
?=
$(TRTL_SW)
/firmware
TRTL_HDL
?=
$(TRTL)
/hdl/rtl
TRTL_HDL
?=
$(TRTL)
/hdl/rtl
RT_GIT_VERSION
=
0x
$(
shell
git rev-parse
--short
=
8 HEAD
||
echo
"0"
)
# empty if git is not there
RT_GIT_VERSION
=
0x
$(
shell
git rev-parse
--short
=
8 HEAD
||
echo
"0"
)
# empty if git is not there
# header file generated from the .config
# header file generated from the .config
AUTOCONF
=
$(
CURDIR
)
/
$(BUILDDIR)
/include/generated/autoconf.h
AUTOCONF
=
$(
src
)
/
$(BUILDDIR)
/include/generated/autoconf.h
CROSS_COMPILE_TARGET
?=
riscv32-elf-
CROSS_COMPILE_TARGET
?=
riscv32-elf-
# FIXME the mult/div is broken, for the time being remove it completely
# FIXME the mult/div is broken, for the time being remove it completely
...
@@ -21,10 +37,12 @@ CFLAGS += -mabi=ilp32 -march=rv32im -ffunction-sections -fdata-sections
...
@@ -21,10 +37,12 @@ CFLAGS += -mabi=ilp32 -march=rv32im -ffunction-sections -fdata-sections
LDFLAGS
+=
-lgcc
-lc
-Wl
,--gc-sections
LDFLAGS
+=
-lgcc
-lc
-Wl
,--gc-sections
# provide search patch for sources
# provide search patch for sources
vpath
%.c
$(TRTL)/software/firmware
vpath
%.c
$(TRTL_FW)
vpath
%.S
$(TRTL)/software/firmware
vpath
%.S
$(TRTL_FW)
vpath
%.c
$(src)
vpath
%.S
$(src)
BUILDDIR
:=
build
BUILDDIR
:=
$(src)
/
build
# auto dependency generation from
# auto dependency generation from
# http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/
# http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/
...
@@ -42,10 +60,10 @@ STRIP = $(CROSS_COMPILE_TARGET)strip
...
@@ -42,10 +60,10 @@ STRIP = $(CROSS_COMPILE_TARGET)strip
CFLAGS
+=
-Wall
-D__TRTL_FIRMWARE__
-DARCH
=
urv
CFLAGS
+=
-Wall
-D__TRTL_FIRMWARE__
-DARCH
=
urv
CFLAGS
+=
-I
.
CFLAGS
+=
-I
.
CFLAGS
+=
-I
$(BUILDDIR)
/include
CFLAGS
+=
-I
$(BUILDDIR)
/include
CFLAGS
+=
-I
$(TRTL
)
/software/firmware
CFLAGS
+=
-I
$(TRTL
_FW)
CFLAGS
+=
-I
$(TRTL
)
/software/firmware
/lib
CFLAGS
+=
-I
$(TRTL
_FW)
/lib
CFLAGS
+=
-I
$(TRTL
)
/software/firmware
/framework
CFLAGS
+=
-I
$(TRTL
_FW)
/framework
CFLAGS
+=
-I
$(TRTL
)
/software
/include
CFLAGS
+=
-I
$(TRTL
_SW)
/include
CFLAGS
+=
-DGIT_VERSION
=
$(RT_GIT_VERSION)
CFLAGS
+=
-DGIT_VERSION
=
$(RT_GIT_VERSION)
# used for firmware by trtl-project-creator
# used for firmware by trtl-project-creator
...
@@ -76,11 +94,11 @@ OBJS_BUILD = $(addprefix $(BUILDDIR)/, $(OBJS))
...
@@ -76,11 +94,11 @@ OBJS_BUILD = $(addprefix $(BUILDDIR)/, $(OBJS))
OBJDIR_BUILD
=
$
(
addprefix
$(BUILDDIR)
/,
$(OBJDIR)
)
OBJDIR_BUILD
=
$
(
addprefix
$(BUILDDIR)
/,
$(OBJDIR)
)
OBJDIR_BUILD
+=
$(BUILDDIR)
OBJDIR_BUILD
+=
$(BUILDDIR)
MOCKTURTLE_LDSCRIPT
?=
$(TRTL
)
/software/firmware
/urv/mockturtle.ld
MOCKTURTLE_LDSCRIPT
?=
$(TRTL
_FW)
/urv/mockturtle.ld
.PHONY
:
all clean cleanall
check-def
.PHONY
:
all clean cleanall
all
:
$(
OUTPUT
).bin
all
:
$(
build_output
).bin
WBGEN_FILES
=
mt_cpu_csr.wb mt_cpu_lr.wb
WBGEN_FILES
=
mt_cpu_csr.wb mt_cpu_lr.wb
WBGEN_HEADERS
=
mockturtle_cpu_csr.h mockturtle_cpu_lr.h
WBGEN_HEADERS
=
mockturtle_cpu_csr.h mockturtle_cpu_lr.h
...
@@ -93,16 +111,9 @@ $(TRTL_SW)/include/hw/mockturtle_cpu_csr.h: $(TRTL_HDL)/cpu/mt_cpu_csr.wb
...
@@ -93,16 +111,9 @@ $(TRTL_SW)/include/hw/mockturtle_cpu_csr.h: $(TRTL_HDL)/cpu/mt_cpu_csr.wb
$(TRTL_SW)/include/hw/mockturtle_cpu_lr.h
:
$(TRTL_HDL)/cpu/mt_cpu_lr.wb
$(TRTL_SW)/include/hw/mockturtle_cpu_lr.h
:
$(TRTL_HDL)/cpu/mt_cpu_lr.wb
# target to let wbgen2 to generate headers
# target to let wbgen2 to generate headers
$(addprefix $(TRTL_SW)/include/hw/,$(WBGEN_HEADERS))
:
| check-def
$(addprefix $(TRTL_SW)/include/hw/,$(WBGEN_HEADERS))
:
make
-C
$(TRTL_SW)
headers
make
-C
$(TRTL_SW)
headers
# check needed env variables
check-def
:
ifndef
OUTPUT
@echo
"OUTPUT variable is mandatory"
@exit
1
endif
# create dirs for object files
# create dirs for object files
$(OBJDIR_BUILD)
:
$(OBJDIR_BUILD)
:
mkdir
-p
$@
mkdir
-p
$@
...
@@ -112,12 +123,13 @@ $(OBJDIR_BUILD):
...
@@ -112,12 +123,13 @@ $(OBJDIR_BUILD):
$(OBJS_BUILD)
:
| $(AUTOCONF)
$(OBJS_BUILD)
:
| $(AUTOCONF)
$(OBJS_BUILD)
:
| $(OBJDIR_BUILD)
$(OBJS_BUILD)
:
| $(OBJDIR_BUILD)
$(OUTPUT).elf
:
$(addprefix $(TRTL_SW)/include/hw/
,
$(WBGEN_HEADERS)) $(MOCKTURTLE_LDSCRIPT) $(OBJS_BUILD) | check-def
$(build_output).elf
:
$(addprefix $(TRTL_SW)/include/hw/
,
$(WBGEN_HEADERS)) $(MOCKTURTLE_LDSCRIPT) $(OBJS_BUILD)
${
CC
}
$(CFLAGS)
$(LDFLAGS)
-o
$(OUTPUT)
.elf
-nostartfiles
$(OBJS_BUILD)
-T
$(MOCKTURTLE_LDSCRIPT)
$
(
warning
$(OBJS_BUILD)
)
${
CC
}
$(CFLAGS)
$(LDFLAGS)
-o
$(build_output)
.elf
-nostartfiles
$(OBJS_BUILD)
-T
$(MOCKTURTLE_LDSCRIPT)
$(
OUTPUT).bin
:
$(OUTPUT).elf | check-de
f
$(
build_output).bin
:
$(build_output).el
f
${
OBJCOPY
}
--remove-section
.smem
-O
binary
$(
OUTPUT)
.elf
$(OUTPUT
)
.bin
${
OBJCOPY
}
--remove-section
.smem
-O
binary
$(
build_output)
.elf
$(build_output
)
.bin
$(SIZE)
$(
OUTPUT
)
.elf
$(SIZE)
$(
build_output
)
.elf
$(BUILDDIR)/urv/emulate.o
:
urv/emulate.c
$(BUILDDIR)/urv/emulate.o
:
urv/emulate.c
${
CC
}
$(DEPFLAGS)
$(CFLAGS)
-march
=
rv32i
-c
$<
-o
$@
${
CC
}
$(DEPFLAGS)
$(CFLAGS)
-march
=
rv32i
-c
$<
-o
$@
...
@@ -126,13 +138,15 @@ $(BUILDDIR)/urv/emulate.o: urv/emulate.c
...
@@ -126,13 +138,15 @@ $(BUILDDIR)/urv/emulate.o: urv/emulate.c
$(BUILDDIR)/%.o
:
%.c
$(BUILDDIR)/%.o
:
%.c
${
CC
}
$(DEPFLAGS)
$(CFLAGS)
$(LDFLAGS)
-c
$<
-o
$@
${
CC
}
$(DEPFLAGS)
$(CFLAGS)
$(LDFLAGS)
-c
$<
-o
$@
$(POSTCOMPILE)
$(POSTCOMPILE)
$
(
warning
$<
----
$@
)
@
echo
""
$(BUILDDIR)/%.o
:
%.S
$(BUILDDIR)/%.o
:
%.S
${
CC
}
$(DEPFLAGS)
$(CFLAGS)
$(LDFLAGS)
-c
$<
-o
$@
${
CC
}
$(DEPFLAGS)
$(CFLAGS)
$(LDFLAGS)
-c
$<
-o
$@
$(POSTCOMPILE)
$(POSTCOMPILE)
clean
:
clean
:
rm
-f
$(
OUTPUT)
.bin
$(OUTPUT
)
.elf
rm
-f
$(
build_output)
.bin
$(build_output
)
.elf
rm
-rf
$(BUILDDIR)
rm
-rf
$(BUILDDIR)
clean-dot-config
:
clean-dot-config
:
...
@@ -141,7 +155,7 @@ clean-dot-config:
...
@@ -141,7 +155,7 @@ clean-dot-config:
cleanall
:
clean clean-dot-config
cleanall
:
clean clean-dot-config
install
:
install
:
@
cp
$(
OUTPUT
)
.bin
$(INSTALL_PREFIX)
@
cp
$(
build_output
)
.bin
$(INSTALL_PREFIX)
# inlude *.d files from the build directory
# inlude *.d files from the build directory
include
$(wildcard
$(patsubst
%,%/.d/*.d,$(basename
$(OBJDIR_BUILD))))
include
$(wildcard
$(patsubst
%,%/.d/*.d,$(basename
$(OBJDIR_BUILD))))
...
@@ -150,20 +164,20 @@ include $(wildcard $(patsubst %,%/.d/*.d,$(basename $(OBJDIR_BUILD))))
...
@@ -150,20 +164,20 @@ include $(wildcard $(patsubst %,%/.d/*.d,$(basename $(OBJDIR_BUILD))))
# following targets from Makefile.kconfig
# following targets from Makefile.kconfig
# this one is used to generate autoconf.h file
# this one is used to generate autoconf.h file
$(AUTOCONF) silentoldconfig
:
.config | $(BUILDDIR)
$(AUTOCONF) silentoldconfig
:
.config | $(BUILDDIR)
export
KCONFIG_CONFIG
=
$(
CURDIR
)
/.config
;
\
export
KCONFIG_CONFIG
=
$(
src
)
/.config
;
\
$(MAKE)
quiet
=
quiet_
KBUILD_KCONFIG
=
$(
CURDIR)
/Kconfig
projtree
=
$(CURDIR)
/
$(BUILDDIR)
-C
$(TRTL)
/software/firmware
-f
Makefile.kconfig silentoldconfig
$(MAKE)
quiet
=
quiet_
KBUILD_KCONFIG
=
$(
src)
/Kconfig
projtree
=
$(BUILDDIR)
-C
$(TRTL_FW)
-f
Makefile.kconfig silentoldconfig
scripts_basic config
:
scripts_basic config
:
$(MAKE)
quiet
=
quiet_
KBUILD_KCONFIG
=
$(
CURDIR)
/Kconfig
projtree
=
$(CURDIR)
-C
$(TRTL)
/software/firmware
-f
Makefile.kconfig
$@
$(MAKE)
quiet
=
quiet_
KBUILD_KCONFIG
=
$(
src)
/Kconfig
projtree
=
$(src)
-C
$(TRTL_FW)
-f
Makefile.kconfig
$@
%config
:
%config
:
$(MAKE)
quiet
=
quiet_
KBUILD_KCONFIG
=
$(
CURDIR)
/Kconfig
projtree
=
$(CURDIR)
-C
$(TRTL)
/software/firmware
-f
Makefile.kconfig
$@
$(MAKE)
quiet
=
quiet_
KBUILD_KCONFIG
=
$(
src)
/Kconfig
projtree
=
$(src)
-C
$(TRTL_FW)
-f
Makefile.kconfig
$@
defconfig
:
defconfig
:
$(MAKE)
quiet
=
quiet_
KBUILD_KCONFIG
=
$(
CURDIR)
/Kconfig
projtree
=
$(CURDIR)
-C
$(TRTL)
/software/firmware
-f
Makefile.kconfig mt_defconfig
$(MAKE)
quiet
=
quiet_
KBUILD_KCONFIG
=
$(
src)
/Kconfig
projtree
=
$(src)
-C
$(TRTL_FW)
-f
Makefile.kconfig mt_defconfig
.config
:
;
.config
:
;
# Explicit rule for .config
# Explicit rule for .config
# needed since -include XXX triggers build for XXX
# needed since -include XXX triggers build for XXX
$(
CURDIR
)/.config
:
;
$(
src
)/.config
:
;
software/include/hw/Makefile
View file @
8d72ad93
HEADERS
:=
mockturtle_cpu_csr.h
HEADERS
:=
mockturtle_cpu_csr.h
HEADERS
+=
mockturtle_cpu_lr.h
HEADERS
+=
mockturtle_cpu_lr.h
TRTL
=
../../..
TRTL
?
=
../../..
TRTL_HDL
=
$(TRTL)
/hdl/rtl/
TRTL_HDL
=
$(TRTL)
/hdl/rtl/
WBGEN2
?=
wbgen2
WBGEN2
?=
wbgen2
...
...
software/lib/Makefile
View file @
8d72ad93
...
@@ -8,7 +8,8 @@ REPO_PARENT ?= ../..
...
@@ -8,7 +8,8 @@ REPO_PARENT ?= ../..
-include
$(REPO_PARENT)/parent_common.mk
-include
$(REPO_PARENT)/parent_common.mk
TRTL
?=
../
TRTL
?=
../../
TRTL_SW
=
$(TRTL)
/software
LIBS
=
libmockturtle.so
LIBS
=
libmockturtle.so
LIB
=
libmockturtle.a
LIB
=
libmockturtle.a
...
@@ -16,7 +17,7 @@ LOBJ := libmockturtle.o
...
@@ -16,7 +17,7 @@ LOBJ := libmockturtle.o
LOBJ
+=
libmockturtle-rt-msg.o
LOBJ
+=
libmockturtle-rt-msg.o
CFLAGS
+=
-Wall
-Werror
-ggdb
-fPIC
CFLAGS
+=
-Wall
-Werror
-ggdb
-fPIC
CFLAGS
+=
-I
.
-I
$(TRTL)
/include
$(EXTRACFLAGS)
CFLAGS
+=
-I
.
-I
$(TRTL
_SW
)
/include
$(EXTRACFLAGS)
LDFLAGS
=
-L
.
-lmockturtle
LDFLAGS
=
-L
.
-lmockturtle
ARFLAGS
=
rc
ARFLAGS
=
rc
...
...
software/tools/Makefile
View file @
8d72ad93
...
@@ -8,14 +8,15 @@ REPO_PARENT ?= ../..
...
@@ -8,14 +8,15 @@ REPO_PARENT ?= ../..
-include
$(REPO_PARENT)/parent_common.mk
-include
$(REPO_PARENT)/parent_common.mk
DESTDIR
?=
/usr/local
DESTDIR
?=
/usr/local
TRTL
?=
../
TRTL
?=
../../
TRTL_SW
=
$(TRTL)
/software
GIT_VERSION
:=
$(
shell
git describe
--dirty
--long
--tags
)
GIT_VERSION
:=
$(
shell
git describe
--dirty
--long
--tags
)
CFLAGS
+=
-Wall
-Werror
-ggdb
-I
$(TRTL)
/lib
CFLAGS
+=
-Wall
-Werror
-ggdb
-I
$(TRTL
_SW
)
/lib
CFLAGS
+=
-I
$(TRTL)
/include
CFLAGS
+=
-I
$(TRTL
_SW
)
/include
CFLAGS
+=
$(EXTRACFLAGS)
CFLAGS
+=
$(EXTRACFLAGS)
LDLIBS
+=
-Wl
,-Bstatic
-L
$(TRTL)
/lib
-lmockturtle
LDLIBS
+=
-Wl
,-Bstatic
-L
$(TRTL
_SW
)
/lib
-lmockturtle
LDLIBS
+=
-Wl
,-Bdynamic
-lpthread
LDLIBS
+=
-Wl
,-Bdynamic
-lpthread
PROGS
:=
mockturtle-count
PROGS
:=
mockturtle-count
PROGS
+=
lsmockturtle
PROGS
+=
lsmockturtle
...
@@ -33,7 +34,7 @@ install:
...
@@ -33,7 +34,7 @@ install:
install
-d
$(DESTDIR)
/bin
install
-d
$(DESTDIR)
/bin
install
-D
$(PROGS)
$(DESTDIR)
/bin
install
-D
$(PROGS)
$(DESTDIR)
/bin
%
:
%.c $(TRTL
)
/libmockturtle.a
%
:
%.c $(TRTL
_SW)/lib
/libmockturtle.a
$(CC)
$(CFLAGS)
$^
-o
$@
$(LDLIBS)
$(CC)
$(CFLAGS)
$^
-o
$@
$(LDLIBS)
# make nothing for modules_install, but avoid errors
# make nothing for modules_install, but avoid errors
...
...
tests/firmware/config_rom/Makefile
View file @
8d72ad93
OBJS
=
config_rom.o
OBJS
+=
# add other object files that you need
OUTPUT
=
fw-config-rom
TRTL
?=
../../../
TRTL
?=
../../../
TRTL_
SW
=
$(TRTL)
/soft
ware
TRTL_
FW
=
$(TRTL)
/software/firm
ware
include
$(TRTL_SW)/firmware/Makefile
all clean
:
$(MAKE)
-C
$(TRTL_FW)
M
=
$(
shell
/bin/pwd
)
$@
tests/firmware/config_rom/TBuild
0 → 100644
View file @
8d72ad93
OBJS = config_rom.o
OBJS += # add other object files that you need
OUTPUT = fw-config-rom
tests/firmware/cpu-byte-addressing/Makefile
View file @
8d72ad93
OBJS
=
byte-addressing.o
OBJS
+=
# add other object files that you need
OUTPUT
=
fw-byte-addressing
TRTL
?=
../../../
TRTL
?=
../../../
TRTL_
SW
=
$(TRTL)
/soft
ware
TRTL_
FW
=
$(TRTL)
/software/firm
ware
include
$(TRTL_SW)/firmware/Makefile
all clean
:
$(MAKE)
-C
$(TRTL_FW)
M
=
$(
shell
/bin/pwd
)
$@
tests/firmware/cpu-byte-addressing/TBuild
0 → 100644
View file @
8d72ad93
OBJS = byte-addressing.o
OBJS += # add other object files that you need
OUTPUT = fw-byte-addressing
tests/firmware/cpu-loop/Makefile
View file @
8d72ad93
OBJS
=
cpu-loop.o
OBJS
+=
# add other object files that you need
OUTPUT
=
fw-loop
TRTL
?=
../../../
TRTL
?=
../../../
TRTL_
SW
=
$(TRTL)
/soft
ware
TRTL_
FW
=
$(TRTL)
/software/firm
ware
include
$(TRTL_SW)/firmware/Makefile
all clean
:
$(MAKE)
-C
$(TRTL_FW)
M
=
$(
shell
/bin/pwd
)
$@
tests/firmware/cpu-loop/TBuild
0 → 100644
View file @
8d72ad93
OBJS = cpu-loop.o
OBJS += # add other object files that you need
OUTPUT = fw-loop
tests/firmware/cpu-notify/Makefile
View file @
8d72ad93
OBJS
=
notify.o
OBJS
+=
# add other object files that you need
OUTPUT
=
fw-notify
TRTL
?=
../../../
TRTL
?=
../../../
TRTL_
SW
=
$(TRTL)
/soft
ware
TRTL_
FW
=
$(TRTL)
/software/firm
ware
include
$(TRTL_SW)/firmware/Makefile
all clean
:
$(MAKE)
-C
$(TRTL_FW)
M
=
$(
shell
/bin/pwd
)
$@
tests/firmware/cpu-notify/TBuild
0 → 100644
View file @
8d72ad93
OBJS = notify.o
OBJS += # add other object files that you need
OUTPUT = fw-notify
tests/firmware/hmq-async-recv/Makefile
View file @
8d72ad93
OBJS
=
hmq-async-recv.o
OBJS
+=
# add other object files that you need
OUTPUT
=
fw-hmq-async-recv
TRTL
?=
../../../
TRTL
?=
../../../
TRTL_
SW
=
$(TRTL)
/soft
ware
TRTL_
FW
=
$(TRTL)
/software/firm
ware
include
$(TRTL_SW)/firmware/Makefile
all clean
:
$(MAKE)
-C
$(TRTL_FW)
M
=
$(
shell
/bin/pwd
)
$@
tests/firmware/hmq-async-recv/TBuild
0 → 100644
View file @
8d72ad93
OBJS = hmq-async-recv.o
OBJS += # add other object files that you need
OUTPUT = fw-hmq-async-recv
tests/firmware/hmq-async-send/Makefile
View file @
8d72ad93
OBJS
=
hmq-async-send.o
OBJS
+=
# add other object files that you need
OUTPUT
=
fw-hmq-async-send
TRTL
?=
../../../
TRTL
?=
../../../
TRTL_
SW
=
$(TRTL)
/soft
ware
TRTL_
FW
=
$(TRTL)
/software/firm
ware
include
$(TRTL_SW)/firmware/Makefile
all clean
:
$(MAKE)
-C
$(TRTL_FW)
M
=
$(
shell
/bin/pwd
)
$@
tests/firmware/hmq-async-send/TBuild
0 → 100644
View file @
8d72ad93
OBJS = hmq-async-send.o
OBJS += # add other object files that you need
OUTPUT = fw-hmq-async-send
tests/firmware/hmq-purge/Makefile
View file @
8d72ad93
OBJS
=
hmq-purge.o
OBJS
+=
# add other object files that you need
OUTPUT
=
fw-hmq-purge
TRTL
?=
../../../
TRTL
?=
../../../
TRTL_
SW
=
$(TRTL)
/soft
ware
TRTL_
FW
=
$(TRTL)
/software/firm
ware
include
$(TRTL_SW)/firmware/Makefile
all clean
:
$(MAKE)
-C
$(TRTL_FW)
M
=
$(
shell
/bin/pwd
)
$@
tests/firmware/hmq-purge/TBuild
0 → 100644
View file @
8d72ad93
OBJS = hmq-purge.o
OBJS += # add other object files that you need
OUTPUT = fw-hmq-purge
tests/firmware/rmq-udp-send/Makefile
View file @
8d72ad93
-include
../Makefile.specific
OBJS
=
rmq-udp-send.o
OBJS
+=
# add other object files that you need
OUTPUT
=
fw-rmq-udp-send
TRTL
?=
../../../
TRTL
?=
../../../
TRTL_SW
=
$(TRTL)
/software
TRTL_FW
=
$(TRTL)
/software/firmware
CFLAGS_OPT
=
-O0
# disable optimization
include
$(TRTL_SW)/firmware/Makefile
all clean
:
$(MAKE)
-C
$(TRTL_FW)
M
=
$(
shell
/bin/pwd
)
$@
tests/firmware/rmq-udp-send/TBuild
0 → 100644
View file @
8d72ad93
OBJS = rmq-udp-send.o
OBJS += # add other object files that you need
OUTPUT = fw-rmq-udp-send
CFLAGS_OPT = -O0 # disable optimization
tests/firmware/rt-frm/Makefile
View file @
8d72ad93
OBJS
=
rt-frm.o
OBJS
+=
# add other object files that you need
OUTPUT
=
fw-rt-frm
TRTL
?=
../../../
TRTL
?=
../../../
TRTL_
SW
=
$(TRTL)
/soft
ware
TRTL_
FW
=
$(TRTL)
/software/firm
ware
include
$(TRTL_SW)/firmware/Makefile
all clean
:
$(MAKE)
-C
$(TRTL_FW)
M
=
$(
shell
/bin/pwd
)
$@
tests/firmware/rt-frm/TBuild
0 → 100644
View file @
8d72ad93
OBJS = rt-frm.o
OBJS += # add other object files that you need
OUTPUT = fw-rt-frm
tests/firmware/serial/Makefile
View file @
8d72ad93
-include
../Makefile.specific
OBJS
=
serial.o
OBJS
+=
# add other object files that you need
OUTPUT
=
fw-serial
TRTL
?=
../../../
TRTL
?=
../../../
TRTL_
SW
=
$(TRTL)
/soft
ware
TRTL_
FW
=
$(TRTL)
/software/firm
ware
include
$(TRTL_SW)/firmware/Makefile
all clean
:
$(MAKE)
-C
$(TRTL_FW)
M
=
$(
shell
/bin/pwd
)
$@
tests/firmware/serial/TBuild
0 → 100644
View file @
8d72ad93
OBJS = serial.o
OBJS += # add other object files that you need
OUTPUT = fw-serial
tests/firmware/sim-verif/Makefile
View file @
8d72ad93
OBJS
=
sim-verif.o
OBJS
+=
# add other object files that you need
OUTPUT
=
sim-verif
TRTL
?=
../../../
TRTL
?=
../../../
TRTL_
SW
=
$(TRTL)
/soft
ware
TRTL_
FW
=
$(TRTL)
/software/firm
ware
include
$(TRTL_SW)/firmware/Makefile
all clean
:
$(MAKE)
-C
$(TRTL_FW)
M
=
$(
shell
/bin/pwd
)
$@
tests/firmware/sim-verif/TBuild
0 → 100644
View file @
8d72ad93
OBJS = sim-verif.o
OBJS += # add other object files that you need
OUTPUT = sim-verif
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