Skip to content

Commit f663315

Browse files
committed
Fix to also use CMAKE_BUILDIR when test is run through 'make run' to allow parallel execution
1 parent 0353512 commit f663315

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ tiles_2 := $(shell echo $$(( $(tiles) * $(tiles) )))
4040
tiles_log := $(shell awk 'BEGIN { printf "%.0f", log($(tiles_2))/log(2) }')
4141
tiles_log_real := $(shell awk 'BEGIN { printf "%.0f", log($(tiles))/log(2) }')
4242

43+
GVRUN ?= $(GVSOC_DIR)/install/bin/gvrun
44+
4345
.PHONY: gvsoc build
4446

4547
clean:
@@ -82,14 +84,14 @@ run: set_mesh
8284
ifndef test
8385
$(error Proper formatting is: make run test=<test_name> platform=rtl|gvsoc)
8486
endif
85-
ifeq (,$(wildcard ./build/bin/$(test)))
87+
ifeq (,$(wildcard $(CMAKE_BUILDDIR)/bin/$(test)))
8688
$(error No test found with name: $(test))
8789
endif
8890
ifndef platform
8991
$(error Proper formatting is: make run test=<test_name> platform=rtl|gvsoc)
9092
endif
9193
ifeq ($(platform), gvsoc)
92-
$(GVSOC_DIR)/install/bin/gvsoc --target=magia --binary=./build/bin/$(test) --trace-level=trace run
94+
$(GVRUN) --target=magia --param binary=$(CMAKE_BUILDDIR)/bin/$(test) $(GVRUN_ARGS) run
9395
else ifeq ($(platform), rtl)
9496
mkdir -p $(BUILD_DIR) && cd $(BUILD_DIR) && mkdir -p build
9597
cp ./build/bin/$(test) $(BUILD_DIR)/build/verif

testset.cfg

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,9 @@ def tests_build(tile_name, nb_tile, testset):
4646
test = testset.new_test(test_name)
4747
cwd = testset.get_path()
4848
work_dir = f'{cwd}/build/{tile_name}/work/{test_name}'
49-
test.add_command(Shell('run', f'gvrun --target magia --build-dir {work_dir} '
50-
f'--param binary={cwd}/build/{tile_name}/bin/{test_name} run --attr magia/n_tiles_x={nb_tile} '
51-
f'--attr magia/n_tiles_y={nb_tile}'))
52-
49+
test.add_command(Shell('run', f'make run platform=gvsoc CMAKE_BUILDDIR={cwd}/build/{tile_name} GVRUN=gvrun test={test_name} GVRUN_ARGS="--work-dir {work_dir}'
50+
f' --attr magia/n_tiles_x={nb_tile} --attr magia/n_tiles_y={nb_tile}"'))
51+
5352
if skipped_tests.get(tile_name) is not None and test_name in skipped_tests.get(tile_name):
5453
print(f"\033[31mSkipping Magia test {test_name} for tile {tile_name}\033")
5554
test.skip('Failing, to be fixed')
@@ -59,9 +58,8 @@ def testset_build(testset):
5958

6059
testset.set_name('magia-sdk')
6160

62-
testset.add_target('magia')
63-
6461
for tile in [2, 4, 8]:
6562
name = f'tile{tile}'
6663
tile_testset = testset.new_testset(name)
64+
tile_testset.add_target('magia')
6765
tile_testset.add_testset(callback=partial(tests_build, name, tile))

0 commit comments

Comments
 (0)