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
1fd03e45
Commit
1fd03e45
authored
Oct 21, 2019
by
Federico Vaga
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release/v4.0.4'
parents
88c968b8
907f0715
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
123 additions
and
66 deletions
+123
-66
.gitlab-ci.yml
.gitlab-ci.yml
+9
-4
CHANGELOG.rst
CHANGELOG.rst
+11
-0
common.mk
common.mk
+6
-0
Makefile
distribution/Makefile
+25
-5
mockturtle.spec
distribution/mockturtle.spec
+1
-3
Makefile
software/Makefile
+4
-2
Makefile
software/include/Makefile
+7
-0
Kbuild
software/kernel/Kbuild
+32
-0
Makefile
software/kernel/Makefile
+18
-41
mockturtle-core.c
software/kernel/mockturtle-core.c
+1
-1
Makefile
software/lib/Makefile
+5
-5
Makefile
software/tools/Makefile
+4
-5
No files found.
.gitlab-ci.yml
View file @
1fd03e45
...
...
@@ -9,6 +9,10 @@ variables:
DIST_PATH
:
distribution
BUILD_PATH
:
${DIST_PATH}/build
before_script
:
-
git clone https://ohwr.org/project/wishbone-gen.git ~/git/wbgen2
-
export WBGEN2=~/git/wbgen2/wbgen2
stages
:
-
static-analysis
-
build
...
...
@@ -27,9 +31,9 @@ reuse:
build
:
stage
:
build
script
:
-
yum install -y kernel-devel lua
-
git clone https://ohwr.org/project/wishbone-gen.git ~/git/wbgen2
-
WBGEN2=~/git/wbgen2/wbgen2 LINUX=/usr/src/kernels/*/
make
-
yum install -y kernel-devel lua
git
-
export LINUX=/usr/src/kernels/*/
-
make
artifacts
:
paths
:
-
include/
...
...
@@ -39,7 +43,8 @@ build_srpm:
stage
:
srpm
script
:
-
yum-builddep -y ${DIST_PATH}/*.spec
-
LINUX=/usr/src/kernels/*/ make -C distribution srpm
-
export LINUX=/usr/src/kernels/*/
-
make -C distribution srpm
artifacts
:
paths
:
-
distribution/build/SRPMS/${CI_PROJECT_NAME}*src.rpm
...
...
CHANGELOG.rst
View file @
1fd03e45
...
...
@@ -7,6 +7,17 @@
Change Log
==========
[4.0.4] - 2019-10-21
====================
Changed
-----
- [sw] remove git dependency when building from SRPM
- [sw] use Kbuild to build kernel module
- [sw] remove wbgen2 requirement when bailing from SRPM
Fixed
-----
- [sw] dkms is not a building requirement for RPM
[4.0.3] - 2019-10-18
====================
Changed
...
...
common.mk
0 → 100644
View file @
1fd03e45
PREFIX ?= /
GIT_VERSION := $(shell git describe --always --dirty --long --tags)
VERSION := $(shell git describe --tags --abbrev=0 | tr -d 'v')
TRTL_SW := $(TRTL)/software
distribution/Makefile
View file @
1fd03e45
...
...
@@ -3,9 +3,10 @@
# SPDX-FileCopyrightText: 2019 CERN
TOP_DIR
?=
$(
shell
pwd
)
/../
TRTL
?=
$(TOP_DIR)
include
$(TRTL)/common.mk
NAME
:=
mockturtle
VERSION
:=
$(
shell
git describe
--abbrev
=
0 |
tr
-d
'v'
)
DIR_NAME
:=
$(NAME)
-
$(VERSION)
KEEP_TEMP
?=
n
...
...
@@ -104,12 +105,28 @@ devel-rpm: userspace-tar
.PHONY
:
dkmstree dkms-add kernel-dkms-tar userspace-dir userspace-spec userspace-tar userspace-rpm tools-rpm lib-static-rpm lib-rpm
sources-tar
:
mkdir
-p
$(SOURCES)
cd
$(TRTL)
&&
$(GIT)
archive
--format
=
tar.gz
-o
$(SOURCES)
/
$(DIR_NAME)
.tar.gz
--prefix
=
$(DIR_NAME)
/ HEAD
sources
:
sources-tar
@
mkdir
-p
$(SOURCES)
@
cd
$(TRTL)
&&
$(GIT)
archive
--format
=
tar
-o
$(SOURCES)
/
$(DIR_NAME)
.tar
--prefix
=
$(DIR_NAME)
/ HEAD
sources-tar-replace-autogen
:
sources-tar wbgen2-headers
@
tar
-rf
$(SOURCES)
/
$(DIR_NAME)
.tar
--transform
"s,^,"
$(DIR_NAME)
"/,"
$(TRTL_SW)
/include/mockturtle/hw/mockturtle_cpu_lr.h
$(TRTL_SW)
/include/mockturtle/hw/mockturtle_cpu_csr.h
@
tar
--delete
-f
$(SOURCES)
/
$(DIR_NAME)
.tar
$(DIR_NAME)
/software/include/mockturtle/hw/Makefile
@
cp
$(TRTL)
/common.mk
$(SOURCES)
/common.mk
@
sed
-e
"s,^GIT_VERSION.*
$$
,GIT_VERSION := "
$(GIT_VERSION)
","
\
-e
"s,^VERSION.*
$$
,VERSION := "
$(VERSION)
","
\
-i
$(SOURCES)
/common.mk
@
cd
$(SOURCES)
&&
tar
--update
-f
$(SOURCES)
/
$(DIR_NAME)
.tar
\
--transform
"s,^,"
$(DIR_NAME)
"/,"
\
common.mk
@
rm
$(SOURCES)
/common.mk
sources-tar-gz
:
sources-tar sources-tar-replace-autogen
@
gzip
$(SOURCES)
/
$(DIR_NAME)
.tar
sources
:
sources-tar-gz
@
tar
-C
$(SOURCES)
-xvf
$(SOURCES)
/
$(DIR_NAME)
.tar.gz
$(DIR_NAME)
/CHANGELOG.rst
@
mv
$(SOURCES)
/
$(DIR_NAME)
/CHANGELOG.rst
$(SOURCES)
/CHANGELOG
@
rmdir
$(SOURCES)
/
$(DIR_NAME)
srpm-changelog
:
sources
$
(
eval
$@
_pattern :
=
^
\[
([
0-9]+
\.
[
0-9]+
\.
[
0-9]+
)
\]\s
-
\s
([
0-9]
{
4
}
-[0-9]
{
2
}
-[0-9]
{
2
})
$
)
...
...
@@ -136,3 +153,6 @@ endif
clean
:
@
rm
-rf
$(BUILD)
$(SOURCES)
*
.tar.gz
$(RPM_SPEC)
.PHONY
:
sources-tar-reeplace-autogen sources-tar sources-tar-gz sources srpm-changelog rpm-spec srpm-changelog srpm
distribution/mockturtle.spec
View file @
1fd03e45
...
...
@@ -26,7 +26,6 @@ This package is a meta package that install the Mock Turtle distribution
%autosetup -n %{name}-%{version}
%build
make -C software/include
make -C software/lib
make -C software/tools
...
...
@@ -69,7 +68,6 @@ This package contains the Mock Turtle tools
%package -n dkms-%{name}
Summary: Mock Turtle DKMS module
BuildRequires: dkms
Requires: dkms
%description -n dkms-%{name}
...
...
@@ -85,7 +83,7 @@ dkms remove -m %{name} -v %{version} --rpm_safe_upgrade --all ||:
%files -n dkms-%{name}
%license LICENSES/GPL-2.0.txt
/usr/src/%{name}-%{version}/
/usr/src/%{name}-%{version}/
*
#
# lib
...
...
software/Makefile
View file @
1fd03e45
...
...
@@ -9,7 +9,9 @@ CURDIR:=$(shell /bin/pwd)
REPO_PARENT
?=
$(CURDIR)
/..
-include
$(REPO_PARENT)/parent_common.mk
PREFIX
?=
/
TOP_DIR
?=
$(
shell
pwd
)
/../
TRTL
?=
$(TOP_DIR)
include
$(TRTL)/common.mk
DIRS
=
kernel lib tools include
...
...
@@ -20,7 +22,7 @@ kernel lib: headers
tools
:
lib
.PHONY
:
all clean modules install modules_install $(DIRS)
.PHONY
:
gitmodules
prereq_install prereq_install_warn
.PHONY
:
prereq_install prereq_install_warn
.PHONY
:
gtags headers
install modules_install
:
prereq_install_warn
...
...
software/include/Makefile
View file @
1fd03e45
...
...
@@ -5,11 +5,16 @@
PREFIX
?=
/
INCLUDEDESTDIR
?=
$(PREFIX)
/usr/local/include
all
:
ifneq
($(wildcard
./mockturtle/hw/Makefile),)
# Removed during distribution
$(MAKE)
-C
mockturtle/hw
endif
clean
:
ifneq
($(wildcard
./mockturtle/hw/Makefile),)
# Removed during distribution
$(MAKE)
-C
mockturtle/hw
clean
endif
install
:
all
install
-d
$(INCLUDEDESTDIR)
/mockturtle
...
...
@@ -23,3 +28,5 @@ uninstall:
rm
-f
$(INCLUDEDESTDIR)
/mockturtle/
*
rmdir
--ignore-fail-on-non-empty
$(INCLUDEDESTDIR)
/mockturtle
rmdir
--ignore-fail-on-non-empty
$(INCLUDEDESTDIR)
.PHONY
:
all clean install uninstall
software/kernel/Kbuild
0 → 100644
View file @
1fd03e45
# SPDX-License-Identifier: CC0-1.0
#
# SPDX-FileCopyrightText: 2019 CERN
# add versions of supermodule. It is useful when fine-delay-sw is included as sub-module
# of a bigger project that we want to track
ifdef CONFIG_SUPER_REPO
ifdef CONFIG_SUPER_REPO_VERSION
SUBMODULE_VERSIONS-y += MODULE_INFO(version_$(CONFIG_SUPER_REPO),\"$(CONFIG_SUPER_REPO_VERSION)\");
endif
endif
ccflags-y += -DADDITIONAL_VERSIONS="$(SUBMODULE_VERSIONS-y)"
ccflags-y += -DGIT_VERSION=\"$(GIT_VERSION)\"
ccflags-y += -I$(src)
ifeq ($(DKMS), 0)
ccflags-y += -I$(src)/../include
endif
ccflags-$(CONFIG_TRTL_DEBUG) += -DDEBUG
subdirs-ccflags-y = $(ccflags-y)
obj-m := mockturtle.o
mockturtle-y := mockturtle-core.o
mockturtle-y += mockturtle-cpu.o
mockturtle-y += mockturtle-hmq.o
mockturtle-y += mockturtle-tty.o
mockturtle-y += mockturtle-dbg.o
mockturtle-y += mockturtle-dbg.o
mockturtle-y += mockturtle-compat.o
software/kernel/Makefile
View file @
1fd03e45
...
...
@@ -3,51 +3,32 @@
# SPDX-FileCopyrightText: 2019 CERN
TOP_DIR
?=
$(
shell
pwd
)
/../../
TRTL
?=
$(TOP_DIR)
TRTL_SW
:=
$(TRTL)
/software
PREFIX
?=
/
# If it exists includes Makefile.specific. In this Makefile, you should put
# specific Makefile code that you want to run before this. For example,
# build a particular environment.
-include
Makefile.specific
# include parent_common.mk for buildsystem's defines
REPO_PARENT
?=
$(TOD_DIR)
/../
-include
$(REPO_PARENT)/parent_common.mk
TRTL
?=
$(TOP_DIR)
include
$(TRTL)/common.mk
KVERSION
?=
$(
shell
uname
-r
)
LINUX
?=
/lib/modules/
$(KVERSION)
/build
DKMS
?=
0
GIT_VERSION
=
$(
shell
cd
$(src)
;
git describe
--always
--dirty
--long
--tags
)
VERSION
:=
$(
shell
git describe
--tags
--abbrev
=
0 |
tr
-d
'v'
)
# For this CSM_VERSION, please see ohwr.org/csm documentation
ifdef
CONFIG_CSM_VERSION
ccflags-y
+=
-D
"CERN_SUPER_MODULE=MODULE_VERSION(
\"
$(CONFIG_CSM_VERSION)
\"
)"
else
ccflags-y
+=
-DCERN_SUPER_MODULE
=
""
endif
ccflags-y
+=
-DGIT_VERSION
=
\"
$(GIT_VERSION)
\"
ccflags-y
+=
-I
$(src)
ifeq
($(DKMS),
0)
ccflags-y
+=
-I
$(src)
/../include
endif
ccflags-$(CONFIG_TRTL_DEBUG)
+=
-DDEBUG
subdirs-ccflags-y
=
$
(
ccflags-y
)
obj-m
:=
mockturtle.o
mockturtle-y
:=
mockturtle-core.o
mockturtle-y
+=
mockturtle-cpu.o
mockturtle-y
+=
mockturtle-hmq.o
mockturtle-y
+=
mockturtle-tty.o
mockturtle-y
+=
mockturtle-dbg.o
mockturtle-y
+=
mockturtle-dbg.o
mockturtle-y
+=
mockturtle-compat.o
all modules
:
hw_header
$(MAKE)
-C
$(LINUX)
M
=
$(
shell
/bin/pwd
)
modules
$(MAKE)
-C
$(LINUX)
M
=
$(
shell
/bin/pwd
)
\
GIT_VERSION
=
$(GIT_VERSION)
\
DKMS
=
$(DKMS)
\
modules
hw_header
:
ifeq
($(DKMS),
0)
$(MAKE)
-C
$(TRTL_SW)/include/
mockturtle/hw/
$(MAKE)
-C
$(TRTL_SW)/include/
endif
install
:
modules_install
...
...
@@ -65,11 +46,7 @@ dkms_install: hw_header
@sed
-r
-i
-e
"s/@PKGVER@/$(VERSION)/"
$($@_dir)/dkms.conf
# be able to run the "clean" rule even if $(LINUX) is not valid
clean
:
rm
-rf
*
.o
*
~ .
*
.cmd
*
.ko
*
.mod.c .tmp_versions Module.symvers
\
Module.markers modules.order
coccicheck
:
$(MAKE)
-C
$(LINUX)
M
=
$(
shell
/bin/pwd
)
coccicheck
coccicheck clean
:
$(MAKE)
-C
$(LINUX)
M
=
$(
shell
/bin/pwd
)
INSTALL_MOD_PATH
=
$(PREFIX)
$@
.PHONY
:
headers
software/kernel/mockturtle-core.c
View file @
1fd03e45
...
...
@@ -785,4 +785,4 @@ MODULE_LICENSE("GPL");
MODULE_VERSION
(
GIT_VERSION
);
MODULE_DEVICE_TABLE
(
platform
,
trtl_id
);
CERN_SUPER_MODULE
;
ADDITIONAL_VERSIONS
;
software/lib/Makefile
View file @
1fd03e45
...
...
@@ -11,14 +11,14 @@
REPO_PARENT
?=
../..
-include
$(REPO_PARENT)/parent_common.mk
GIT_VERSION
:=
$(
shell
git describe
--dirty
--long
--tags
)
SO_VERSION_XYZ
:=
$(
shell
git describe
--abbrev
=
0 |
grep
-o
-E
"[0-9]+
\.
[0-9]+
\.
[0-9]"
)
TOP_DIR
?=
$(
shell
pwd
)
/../../
TRTL
?=
$(TOP_DIR)
include
$(TRTL)/common.mk
SO_VERSION_XYZ
:=
$(
shell
echo
$(VERSION)
|
grep
-o
-E
"[0-9]+
\.
[0-9]+
\.
[0-9]"
)
SO_VERSION_X
:=
$(
shell
echo
$(SO_VERSION_XYZ)
|
cut
-d
"."
-f
1
)
PREFIX
?=
/
DESTLIBDIR
?=
$(PREFIX)
/usr/local/lib
TRTL
?=
../..
TRTL_SW
=
$(TRTL)
/software
LIBS
=
libmockturtle.so
LIBS_XYZ
=
$(LIBS)
.
$(SO_VERSION_XYZ)
...
...
software/tools/Makefile
View file @
1fd03e45
...
...
@@ -11,12 +11,11 @@
REPO_PARENT
?=
../..
-include
$(REPO_PARENT)/parent_common.mk
PREFIX
?=
/
BINDESTDIR
?=
$(PREFIX)
/usr/local/bin
TRTL
?=
../..
TRTL_SW
=
$(TRTL)
/software
TOP_DIR
?=
$(
shell
pwd
)
/../../
TRTL
?=
$(TOP_DIR)
include
$(TRTL)/common.mk
GIT_VERSION
:=
$(
shell
git describe
--dirty
--long
--tags
)
BINDESTDIR
?=
$(PREFIX)
/usr/local/bin
CFLAGS
+=
-Wall
-Werror
CFLAGS
+=
-I
$(TRTL_SW)
/include
...
...
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