From 79f67d5ca820b663e9e5682aaaad07118fdbfad8 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Mon, 1 May 2023 22:18:32 +0300 Subject: update license stuff --- Makefile | 16 +++++++--------- include/gran/bus/simple_bus.h | 3 +++ include/gran/clock_domain.h | 3 +++ include/gran/common.h | 3 +++ include/gran/component.h | 3 +++ include/gran/cpu/riscv/simple_riscv32.h | 7 ++++++- include/gran/mem/simple_mem.h | 3 +++ include/gran/root.h | 3 +++ scripts/license | 7 ++++++- src/clock_domain.c | 3 +++ src/components/bus/simple_bus.c | 3 +++ src/components/cpu/riscv/simple_riscv32.c | 7 ++++++- src/components/mem/simple_mem.c | 3 +++ src/main.c | 3 +++ src/root.c | 3 +++ tests/simple_mem/bus.c | 6 +++++- tests/simple_mem/many.c | 9 +++++++-- tests/simple_mem/no_bus.c | 3 +++ tests/simple_mem/traffic_gen.c | 6 +++++- tests/simple_mem/traffic_gen.h | 3 +++ 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 -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 #include #include 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 #include #include 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 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 #include 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 #include 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 #include @@ -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 #include @@ -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 #include 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 #include @@ -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 -- cgit v1.3