|
| 1 | +from gvtest.testsuite import * |
| 2 | +from functools import partial |
| 3 | + |
| 4 | +# This script can be used to run all the tests for different tile sizes on gvsoc |
| 5 | +# First compile all the tests for all the tiles with: |
| 6 | +# make build compiler=GCC_PULP tiles=2 CMAKE_BUILDDIR=$PWD/build/tile2 |
| 7 | +# make build compiler=GCC_PULP tiles=4 CMAKE_BUILDDIR=$PWD/build/tile4 |
| 8 | +# make build compiler=GCC_PULP tiles=8 CMAKE_BUILDDIR=$PWD/build/tile8 |
| 9 | +# Then execute: |
| 10 | +# gvtest |
| 11 | +# Available tests can be obtained with: |
| 12 | +# gvtest tests |
| 13 | +# Single test can be run with: |
| 14 | +# gvtest --test magia-sdk:tile8:test_float --stdout |
| 15 | + |
| 16 | +def tests_build(tile_name, nb_tile, testset): |
| 17 | + |
| 18 | + tests = [ |
| 19 | + "test_helloworld", |
| 20 | + "test_fsync_levels", |
| 21 | + "test_fsync_diag", |
| 22 | + "test_mm_is", |
| 23 | + "test_fsync_sync", |
| 24 | + "test_mm_os", |
| 25 | + "test_idma", |
| 26 | + "test_fsync_rc", |
| 27 | + "test_float", |
| 28 | + "test_cemm_global", |
| 29 | + "test_mm_is_nb", |
| 30 | + "test_mm_is_2", |
| 31 | + "test_mm_ws_2", |
| 32 | + "test_mm_ws", |
| 33 | + "test_amo", |
| 34 | + "test_mm_ws_nb", |
| 35 | + "test_brah", |
| 36 | + "test_mm_os_2", |
| 37 | + ] |
| 38 | + |
| 39 | + skipped_tests = { |
| 40 | + 'tile2': ['test_mm_is_nb', 'test_mm_ws_2', 'test_brah', 'test_mm_os_2'], |
| 41 | + 'tile4': ['test_cemm_global', 'test_mm_is_nb', 'test_mm_is_2', 'test_brah', 'test_mm_os_2'], |
| 42 | + 'tile8': ['test_mm_ws', 'test_amo', 'test_mm_ws_nb', 'test_brah', 'test_mm_os_2'], |
| 43 | + } |
| 44 | + |
| 45 | + for test_name in tests: |
| 46 | + test = testset.new_test(test_name) |
| 47 | + cwd = testset.get_path() |
| 48 | + 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 | + |
| 53 | + if skipped_tests.get(tile_name) is not None and test_name in skipped_tests.get(tile_name): |
| 54 | + print(f"\033[31mSkipping Magia test {test_name} for tile {tile_name}\033") |
| 55 | + test.skip('Failing, to be fixed') |
| 56 | + |
| 57 | + |
| 58 | +def testset_build(testset): |
| 59 | + |
| 60 | + testset.set_name('magia-sdk') |
| 61 | + |
| 62 | + testset.add_target('magia') |
| 63 | + |
| 64 | + for tile in [2, 4, 8]: |
| 65 | + name = f'tile{tile}' |
| 66 | + tile_testset = testset.new_testset(name) |
| 67 | + tile_testset.add_testset(callback=partial(tests_build, name, tile)) |
0 commit comments