aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile16
-rw-r--r--include/gran/bus/simple_bus.h3
-rw-r--r--include/gran/clock_domain.h3
-rw-r--r--include/gran/common.h3
-rw-r--r--include/gran/component.h3
-rw-r--r--include/gran/cpu/riscv/simple_riscv32.h7
-rw-r--r--include/gran/mem/simple_mem.h3
-rw-r--r--include/gran/root.h3
-rwxr-xr-xscripts/license7
-rw-r--r--src/clock_domain.c3
-rw-r--r--src/components/bus/simple_bus.c3
-rw-r--r--src/components/cpu/riscv/simple_riscv32.c7
-rw-r--r--src/components/mem/simple_mem.c3
-rw-r--r--src/main.c3
-rw-r--r--src/root.c3
-rw-r--r--tests/simple_mem/bus.c6
-rw-r--r--tests/simple_mem/many.c9
-rw-r--r--tests/simple_mem/no_bus.c3
-rw-r--r--tests/simple_mem/traffic_gen.c6
-rw-r--r--tests/simple_mem/traffic_gen.h3
20 files changed, 81 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index dad5988..2db9806 100644
--- a/Makefile
+++ b/Makefile
@@ -36,20 +36,18 @@ lint: $(OBJS:.o=.o.l)
.PHONY: format
format:
- @cd src; find . -iname '*.[ch]' |\
- xargs -n 10 -P 0 uncrustify -c ../uncrustify.conf --no-backup -F -
- @cd include; find . -iname '*.[ch]' |\
- xargs -n 10 -P 0 uncrustify -c ../uncrustify.conf --no-backup -F -
+ find src include tests -iname '*.[ch]' |\
+ xargs -n 10 -P 0 uncrustify -c uncrustify.conf --no-backup -F -
.PHONY: license
license:
- @find . -iname '*.[ch]' |\
+ find src include tests -iname '*.[ch]' |\
xargs -n 10 -P 0 ./scripts/license
.PHONY: docs
docs:
- @./scripts/warn-undocumented
- @doxygen docs/doxygen.conf
+ ./scripts/warn-undocumented
+ doxygen docs/doxygen.conf
.PHONY: check
check: $(TEST_PROGS)
@@ -60,11 +58,11 @@ gran: $(MAIN_OBJ) $(OBJS)
.PHONY: clean
clean:
- @$(RM) -r build gran deps.mk
+ $(RM) -r build gran deps.mk
.PHONY: clean_docs
clean_docs:
- @$(RM) -r docs/output
+ $(RM) -r docs/output
.PHONY: clean_all
clean_all: clean clean_docs
diff --git a/include/gran/bus/simple_bus.h b/include/gran/bus/simple_bus.h
index c569e8a..41a8d2e 100644
--- a/include/gran/bus/simple_bus.h
+++ b/include/gran/bus/simple_bus.h
@@ -1,3 +1,6 @@
+/* SPDX-License-Identifier: copyleft-next-0.3.1 */
+/* Copyright 2023 Kim Kuparinen < kimi.h.kuparinen@gmail.com > */
+
#ifndef GRAN_SIMPLE_BUS_H
#define GRAN_SIMPLE_BUS_H
diff --git a/include/gran/clock_domain.h b/include/gran/clock_domain.h
index 9fb04a4..1feb3ac 100644
--- a/include/gran/clock_domain.h
+++ b/include/gran/clock_domain.h
@@ -1,3 +1,6 @@
+/* SPDX-License-Identifier: copyleft-next-0.3.1 */
+/* Copyright 2023 Kim Kuparinen < kimi.h.kuparinen@gmail.com > */
+
#ifndef GRAN_CLOCK_DOMAIN_H
#define GRAN_CLOCK_DOMAIN_H
diff --git a/include/gran/common.h b/include/gran/common.h
index b4b8978..b71417d 100644
--- a/include/gran/common.h
+++ b/include/gran/common.h
@@ -1,3 +1,6 @@
+/* SPDX-License-Identifier: copyleft-next-0.3.1 */
+/* Copyright 2023 Kim Kuparinen < kimi.h.kuparinen@gmail.com > */
+
#ifndef GRAN_COMMON_H
#define GRAN_COMMON_H
diff --git a/include/gran/component.h b/include/gran/component.h
index 498d7c0..15dc875 100644
--- a/include/gran/component.h
+++ b/include/gran/component.h
@@ -1,3 +1,6 @@
+/* SPDX-License-Identifier: copyleft-next-0.3.1 */
+/* Copyright 2023 Kim Kuparinen < kimi.h.kuparinen@gmail.com > */
+
#ifndef GRAN_COMPONENT_H
#define GRAN_COMPONENT_H
diff --git a/include/gran/cpu/riscv/simple_riscv32.h b/include/gran/cpu/riscv/simple_riscv32.h
index 054c76d..3cbd842 100644
--- a/include/gran/cpu/riscv/simple_riscv32.h
+++ b/include/gran/cpu/riscv/simple_riscv32.h
@@ -1,8 +1,13 @@
+/* SPDX-License-Identifier: copyleft-next-0.3.1 */
+/* Copyright 2023 Kim Kuparinen < kimi.h.kuparinen@gmail.com > */
+
#ifndef GRAN_SIMPLE_RISCV32
#define GRAN_SIMPLE_RISCV32
#include <gran/component.h>
-struct component *create_simple_riscv32(uint32_t start_pc, struct component *imem, struct component *dmem);
+struct component *create_simple_riscv32(uint32_t start_pc,
+ struct component *imem,
+ struct component *dmem);
#endif /* GRAN_SIMPLE_RISCV */
diff --git a/include/gran/mem/simple_mem.h b/include/gran/mem/simple_mem.h
index 984dbf6..8d6ce75 100644
--- a/include/gran/mem/simple_mem.h
+++ b/include/gran/mem/simple_mem.h
@@ -1,3 +1,6 @@
+/* SPDX-License-Identifier: copyleft-next-0.3.1 */
+/* Copyright 2023 Kim Kuparinen < kimi.h.kuparinen@gmail.com > */
+
#ifndef GRAN_SIMPLE_MEM_H
#define GRAN_SIMPLE_MEM_H
diff --git a/include/gran/root.h b/include/gran/root.h
index 32ca1cf..7126bf3 100644
--- a/include/gran/root.h
+++ b/include/gran/root.h
@@ -1,3 +1,6 @@
+/* SPDX-License-Identifier: copyleft-next-0.3.1 */
+/* Copyright 2023 Kim Kuparinen < kimi.h.kuparinen@gmail.com > */
+
#ifndef GRAN_ROOT_H
#define GRAN_ROOT_H
diff --git a/scripts/license b/scripts/license
index 2a2de9b..53bd5da 100755
--- a/scripts/license
+++ b/scripts/license
@@ -1,6 +1,6 @@
#!/bin/sh
-SPDX="/* SPDX-License-Identifier: GPL-3.0-or-later */"
+SPDX="/* SPDX-License-Identifier: copyleft-next-0.3.1 */"
for f in "$@"
do
@@ -8,4 +8,9 @@ do
then
sed -i "1i${SPDX}\n" "$f"
fi
+
+ if ! grep 'Copyright' "$f" > /dev/null
+ then
+ echo "Missing copyright info in $f"
+ fi
done
diff --git a/src/clock_domain.c b/src/clock_domain.c
index 825cf0d..15f1793 100644
--- a/src/clock_domain.c
+++ b/src/clock_domain.c
@@ -1,3 +1,6 @@
+/* SPDX-License-Identifier: copyleft-next-0.3.1 */
+/* Copyright 2023 Kim Kuparinen < kimi.h.kuparinen@gmail.com > */
+
#include <stdlib.h>
#include <threads.h>
#include <assert.h>
diff --git a/src/components/bus/simple_bus.c b/src/components/bus/simple_bus.c
index 58e4132..3629ecd 100644
--- a/src/components/bus/simple_bus.c
+++ b/src/components/bus/simple_bus.c
@@ -1,3 +1,6 @@
+/* SPDX-License-Identifier: copyleft-next-0.3.1 */
+/* Copyright 2023 Kim Kuparinen < kimi.h.kuparinen@gmail.com > */
+
#include <threads.h>
#include <inttypes.h>
#include <stdlib.h>
diff --git a/src/components/cpu/riscv/simple_riscv32.c b/src/components/cpu/riscv/simple_riscv32.c
index 1f19b1f..63eba4d 100644
--- a/src/components/cpu/riscv/simple_riscv32.c
+++ b/src/components/cpu/riscv/simple_riscv32.c
@@ -1,3 +1,6 @@
+/* SPDX-License-Identifier: copyleft-next-0.3.1 */
+/* Copyright 2023 Kim Kuparinen < kimi.h.kuparinen@gmail.com > */
+
#include <gran/cpu/riscv/simple_riscv32.h>
struct simple_riscv32 {
@@ -43,7 +46,9 @@ static stat simple_riscv32_clock(struct simple_riscv32 *cpu)
return OK;
}
-struct componen *create_simple_riscv32(uint32_t start_pc, struct component *imem, struct component *dmem)
+struct componen *create_simple_riscv32(uint32_t start_pc,
+ struct component *imem,
+ struct component *dmem)
{
struct component *new = calloc(1, sizeof(simple_riscv32));
if (!new)
diff --git a/src/components/mem/simple_mem.c b/src/components/mem/simple_mem.c
index 52606e2..db2632a 100644
--- a/src/components/mem/simple_mem.c
+++ b/src/components/mem/simple_mem.c
@@ -1,3 +1,6 @@
+/* SPDX-License-Identifier: copyleft-next-0.3.1 */
+/* Copyright 2023 Kim Kuparinen < kimi.h.kuparinen@gmail.com > */
+
#include <string.h>
#include <stdlib.h>
diff --git a/src/main.c b/src/main.c
index 149f017..abb57e6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,3 +1,6 @@
+/* SPDX-License-Identifier: copyleft-next-0.3.1 */
+/* Copyright 2023 Kim Kuparinen < kimi.h.kuparinen@gmail.com > */
+
int main(int argc, char **argv)
{
diff --git a/src/root.c b/src/root.c
index 4324437..172728e 100644
--- a/src/root.c
+++ b/src/root.c
@@ -1,3 +1,6 @@
+/* SPDX-License-Identifier: copyleft-next-0.3.1 */
+/* Copyright 2023 Kim Kuparinen < kimi.h.kuparinen@gmail.com > */
+
#include <stdlib.h>
#include <gran/root.h>
diff --git a/tests/simple_mem/bus.c b/tests/simple_mem/bus.c
index 67fb53b..9fa7a47 100644
--- a/tests/simple_mem/bus.c
+++ b/tests/simple_mem/bus.c
@@ -1,3 +1,6 @@
+/* SPDX-License-Identifier: copyleft-next-0.3.1 */
+/* Copyright 2023 Kim Kuparinen < kimi.h.kuparinen@gmail.com > */
+
#include <assert.h>
#include <gran/root.h>
@@ -15,7 +18,8 @@ int main()
struct component *simple_bus = create_simple_bus();
simple_bus_add(simple_bus, simple_mem, addr, size);
- struct component *traffic_gen = create_traffic_gen(simple_mem, addr, size);
+ struct component *traffic_gen = create_traffic_gen(simple_mem, addr,
+ size);
struct clock_domain *clk = create_clock_domain(NS(1));
clock_domain_add(clk, traffic_gen);
diff --git a/tests/simple_mem/many.c b/tests/simple_mem/many.c
index 254b49f..f2d246a 100644
--- a/tests/simple_mem/many.c
+++ b/tests/simple_mem/many.c
@@ -1,3 +1,6 @@
+/* SPDX-License-Identifier: copyleft-next-0.3.1 */
+/* Copyright 2023 Kim Kuparinen < kimi.h.kuparinen@gmail.com > */
+
#include <assert.h>
#include <gran/root.h>
@@ -12,8 +15,10 @@ int main()
struct component *simple_mem1 = create_simple_mem(size);
struct component *simple_mem2 = create_simple_mem(size);
- struct component *traffic_gen1 = create_traffic_gen(simple_mem1, 0, size);
- struct component *traffic_gen2 = create_traffic_gen(simple_mem2, 0, size);
+ struct component *traffic_gen1 =
+ create_traffic_gen(simple_mem1, 0, size);
+ struct component *traffic_gen2 =
+ create_traffic_gen(simple_mem2, 0, size);
struct clock_domain *clk = create_clock_domain(NS(1));
clock_domain_add(clk, traffic_gen1);
diff --git a/tests/simple_mem/no_bus.c b/tests/simple_mem/no_bus.c
index 8a5b05b..8c67e1e 100644
--- a/tests/simple_mem/no_bus.c
+++ b/tests/simple_mem/no_bus.c
@@ -1,3 +1,6 @@
+/* SPDX-License-Identifier: copyleft-next-0.3.1 */
+/* Copyright 2023 Kim Kuparinen < kimi.h.kuparinen@gmail.com > */
+
#include <assert.h>
#include <gran/root.h>
diff --git a/tests/simple_mem/traffic_gen.c b/tests/simple_mem/traffic_gen.c
index 4d14d12..2de8f6e 100644
--- a/tests/simple_mem/traffic_gen.c
+++ b/tests/simple_mem/traffic_gen.c
@@ -1,3 +1,6 @@
+/* SPDX-License-Identifier: copyleft-next-0.3.1 */
+/* Copyright 2023 Kim Kuparinen < kimi.h.kuparinen@gmail.com > */
+
#include <stdlib.h>
#include <assert.h>
@@ -44,7 +47,8 @@ void traffic_gen_destroy(struct traffic_gen *tg)
free(tg);
}
-struct component *create_traffic_gen(struct component *stress, uintptr_t start, size_t size)
+struct component *create_traffic_gen(struct component *stress, uintptr_t start,
+ size_t size)
{
struct traffic_gen *new = calloc(1, sizeof(struct traffic_gen));
if (!new)
diff --git a/tests/simple_mem/traffic_gen.h b/tests/simple_mem/traffic_gen.h
index 1975e48..018fcaf 100644
--- a/tests/simple_mem/traffic_gen.h
+++ b/tests/simple_mem/traffic_gen.h
@@ -1,3 +1,6 @@
+/* SPDX-License-Identifier: copyleft-next-0.3.1 */
+/* Copyright 2023 Kim Kuparinen < kimi.h.kuparinen@gmail.com > */
+
#ifndef GRAN_TRAFFIC_GEN_H
#define GRAN_TRAFFIC_GEN_H