aboutsummaryrefslogtreecommitdiff
path: root/tests/simple_mesh2d
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2025-08-10 21:37:15 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2025-08-10 21:37:15 +0300
commit82c77b22605d691884be4c4e1e6bae8d66598d02 (patch)
tree040a9e97c12abc14b2ecda6bd16662b6908c083e /tests/simple_mesh2d
parent489beadf61d05f40dd4ac40e4e5290502f7ad078 (diff)
downloadgran-82c77b22605d691884be4c4e1e6bae8d66598d02.tar.gz
gran-82c77b22605d691884be4c4e1e6bae8d66598d02.zip
make tests actually useful
+ Apparently quite a few components are currently broken, didn't even remember
Diffstat (limited to 'tests/simple_mesh2d')
-rw-r--r--tests/simple_mesh2d/sim.c4
-rw-r--r--tests/simple_mesh2d/source.mk25
2 files changed, 11 insertions, 18 deletions
diff --git a/tests/simple_mesh2d/sim.c b/tests/simple_mesh2d/sim.c
index cbce9f3..f3e213d 100644
--- a/tests/simple_mesh2d/sim.c
+++ b/tests/simple_mesh2d/sim.c
@@ -73,8 +73,8 @@ static stat build_mesh(struct clock_domain *clk, uint16_t x, uint16_t y)
struct component *imem = create_simple_mem(4096);
init_simple_mem(imem, 0,
- build_tests_simple_mesh2d_test_bin_len,
- build_tests_simple_mesh2d_test_bin);
+ build_tests_simple_mesh2d_test_inc_bin_len,
+ build_tests_simple_mesh2d_test_inc_bin);
uint64_t rcv = mesh2d_addr(i, j, 0, 0);
struct component *rv64 = create_simple_riscv64(rcv, 0,
diff --git a/tests/simple_mesh2d/source.mk b/tests/simple_mesh2d/source.mk
index 525efa3..af80ab1 100644
--- a/tests/simple_mesh2d/source.mk
+++ b/tests/simple_mesh2d/source.mk
@@ -1,18 +1,11 @@
-MESH2D_TEST_OBJ != ./scripts/gen-deps --sources "tests/simple_mesh2d/sim.c"
-TEST_PROGS += build/tests/simple_mesh2d/sim
+SIMPLE_MESH2D := tests/simple_mesh2d
+SIMPLE_MESH2D_SIM := $(SIMPLE_MESH2D)/sim.c
-build/tests/simple_mesh2d/test.inc: tests/simple_mesh2d/test.c
- riscv64-unknown-elf-gcc -O2 -Wall -Wextra -ffreestanding -nostdlib \
- -march=rv64i -mabi=lp64 \
- -o build/tests/simple_mesh2d/test \
- tests/simple_mesh2d/test.c
- riscv64-unknown-elf-objcopy -Obinary \
- build/tests/simple_mesh2d/test \
- build/tests/simple_mesh2d/test.bin
- xxd -i build/tests/simple_mesh2d/test.bin \
- > build/tests/simple_mesh2d/test.inc
+TESTS += $(SIMPLE_MESH2D)/sim
-build/tests/simple_mesh2d/sim.o: build/tests/simple_mesh2d/test.inc
-
-build/tests/simple_mesh2d/sim: $(MESH2D_TEST_OBJ) $(OBJS)
- $(COMPILE) $(MESH2D_TEST_OBJ) $(OBJS) -o $@
+.PHONY: $(SIMPLE_MESH2D)/sim
+$(SIMPLE_MESH2D)/sim: $(SIMPLE_MESH2D_SIM) libgran.a
+ mkdir -p build/$(SIMPLE_MESH2D)
+ ./scripts/gen-rv64-fw -d build -o $(SIMPLE_MESH2D)/test.inc $(SIMPLE_MESH2D)/test.c
+ $(COMPILE_TEST) $(SIMPLE_MESH2D_SIM) libgran.a -o build/$@
+ ./scripts/gen-report -d build $@